@bygd/gd-sdk-pes 1.28.21 → 1.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{getParentUrl as i,getParentDomain as a,getIframeDepth as s,getTopDomain as o,getQueryParams as c,parseJSON as d,getMobilePlatform as u,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as v,Layers as g,getKeyByValue as b,getQueryString as y,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as D}from"@bygd/gd-sdk-era/dist/default";import S from"@babel/runtime/helpers/classCallCheck";import R from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import I from"url-parse";import{Base64 as O}from"js-base64";import P from"validator";import C from"is-valid-domain";import L from"get-value";import U from"set-value";import M from"lodash.clonedeep";import j from"can-autoplay";import{isPlainObject as B}from"is-plain-object";import G from"querystringify";import N from"lodash.merge";import{EventEmitter as q}from"events";import{v4 as F}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},K=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||function(){return this}()||Function("return this")(),H={exports:{}},z=K,$=Object.defineProperty,Q=function(e,t){try{$(z,e,{value:t,configurable:!0,writable:!0})}catch(n){z[e]=t}return t},Y=Q,J=K["__core-js_shared__"]||Y("__core-js_shared__",{}),X=J;(H.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Z,ee,te=Function.prototype,ne=te.bind,re=te.call,ie=ne&&ne.bind(re),ae=ne?function(e){return e&&ie(re,e)}:function(e){return e&&function(){return re.apply(e,arguments)}},se=K.TypeError,oe=function(e){if(null==e)throw se("Can't call method on "+e);return e},ce=oe,de=K.Object,ue=function(e){return de(ce(e))},le=ue,he=ae({}.hasOwnProperty),pe=Object.hasOwn||function(e,t){return he(le(e),t)},fe=ae,me=0,ve=Math.random(),ge=fe(1..toString),be=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ge(++me+ve,36)},ye=function(e){return"function"==typeof e},_e=K,we=ye,Ae=function(e){return we(e)?e:void 0},ke=function(e,t){return arguments.length<2?Ae(_e[e]):_e[e]&&_e[e][t]},Ee=ke("navigator","userAgent")||"",xe=K,De=Ee,Se=xe.process,Re=xe.Deno,Te=Se&&Se.versions||Re&&Re.version,Ie=Te&&Te.v8;Ie&&(ee=(Z=Ie.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!ee&&De&&(!(Z=De.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=De.match(/Chrome\/(\d+)/))&&(ee=+Z[1]);var Oe=ee,Pe=function(e){try{return!!e()}catch(e){return!0}},Ce=Oe,Le=Pe,Ue=!!Object.getOwnPropertySymbols&&!Le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ce&&Ce<41})),Me=Ue&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=K,Be=H.exports,Ge=pe,Ne=be,qe=Ue,Fe=Me,Ve=Be("wks"),We=je.Symbol,Ke=We&&We.for,He=Fe?We:We&&We.withoutSetter||Ne,ze=function(e){if(!Ge(Ve,e)||!qe&&"string"!=typeof Ve[e]){var t="Symbol."+e;qe&&Ge(We,e)?Ve[e]=We[e]:Ve[e]=Fe&&Ke?Ke(t):He(t)}return Ve[e]},$e={};$e[ze("toStringTag")]="z";var Qe="[object z]"===String($e),Ye={exports:{}},Je=!Pe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Xe={},Ze=ye,et=function(e){return"object"==typeof e?null!==e:Ze(e)},tt=et,nt=K.document,rt=tt(nt)&&tt(nt.createElement),it=function(e){return rt?nt.createElement(e):{}},at=it,st=!Je&&!Pe((function(){return 7!=Object.defineProperty(at("div"),"a",{get:function(){return 7}}).a})),ot=K,ct=et,dt=ot.String,ut=ot.TypeError,lt=function(e){if(ct(e))return e;throw ut(dt(e)+" is not an object")},ht=Function.prototype.call,pt=ht.bind?ht.bind(ht):function(){return ht.apply(ht,arguments)},ft=ae({}.isPrototypeOf),mt=ke,vt=ye,gt=ft,bt=Me,yt=K.Object,_t=bt?function(e){return"symbol"==typeof e}:function(e){var t=mt("Symbol");return vt(t)&&gt(t.prototype,yt(e))},wt=K.String,At=function(e){try{return wt(e)}catch(e){return"Object"}},kt=ye,Et=At,xt=K.TypeError,Dt=function(e){if(kt(e))return e;throw xt(Et(e)+" is not a function")},St=Dt,Rt=function(e,t){var n=e[t];return null==n?void 0:St(n)},Tt=pt,It=ye,Ot=et,Pt=K.TypeError,Ct=pt,Lt=et,Ut=_t,Mt=Rt,jt=function(e,t){var n,r;if("string"===t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;if(It(n=e.valueOf)&&!Ot(r=Tt(n,e)))return r;if("string"!==t&&It(n=e.toString)&&!Ot(r=Tt(n,e)))return r;throw Pt("Can't convert object to primitive value")},Bt=ze,Gt=K.TypeError,Nt=Bt("toPrimitive"),qt=function(e,t){if(!Lt(e)||Ut(e))return e;var n,r=Mt(e,Nt);if(r){if(void 0===t&&(t="default"),n=Ct(r,e,t),!Lt(n)||Ut(n))return n;throw Gt("Can't convert object to primitive value")}return void 0===t&&(t="number"),jt(e,t)},Ft=_t,Vt=function(e){var t=qt(e,"string");return Ft(t)?t:t+""},Wt=Je,Kt=st,Ht=lt,zt=Vt,$t=K.TypeError,Qt=Object.defineProperty;Xe.f=Wt?Qt:function(e,t,n){if(Ht(e),t=zt(t),Ht(n),Kt)try{return Qt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw $t("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Yt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Jt=Xe,Xt=Yt,Zt=Je?function(e,t,n){return Jt.f(e,t,Xt(1,n))}:function(e,t,n){return e[t]=n,e},en=ye,tn=J,nn=ae(Function.toString);en(tn.inspectSource)||(tn.inspectSource=function(e){return nn(e)});var rn,an,sn,on=tn.inspectSource,cn=ye,dn=on,un=K.WeakMap,ln=cn(un)&&/native code/.test(dn(un)),hn=H.exports,pn=be,fn=hn("keys"),mn=function(e){return fn[e]||(fn[e]=pn(e))},vn={},gn=ln,bn=K,yn=ae,_n=et,wn=Zt,An=pe,kn=J,En=mn,xn=vn,Dn=bn.TypeError,Sn=bn.WeakMap;if(gn||kn.state){var Rn=kn.state||(kn.state=new Sn),Tn=yn(Rn.get),In=yn(Rn.has),On=yn(Rn.set);rn=function(e,t){if(In(Rn,e))throw new Dn("Object already initialized");return t.facade=e,On(Rn,e,t),t},an=function(e){return Tn(Rn,e)||{}},sn=function(e){return In(Rn,e)}}else{var Pn=En("state");xn[Pn]=!0,rn=function(e,t){if(An(e,Pn))throw new Dn("Object already initialized");return t.facade=e,wn(e,Pn,t),t},an=function(e){return An(e,Pn)?e[Pn]:{}},sn=function(e){return An(e,Pn)}}var Cn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!_n(t)||(n=an(t)).type!==e)throw Dn("Incompatible receiver, "+e+" required");return n}}},Ln=Je,Un=pe,Mn=Function.prototype,jn=Ln&&Object.getOwnPropertyDescriptor,Bn=Un(Mn,"name"),Gn={EXISTS:Bn,PROPER:Bn&&"something"===function(){}.name,CONFIGURABLE:Bn&&(!Ln||Ln&&jn(Mn,"name").configurable)},Nn=K,qn=ye,Fn=pe,Vn=Zt,Wn=Q,Kn=on,Hn=Gn.CONFIGURABLE,zn=Cn.get,$n=Cn.enforce,Qn=String(String).split("String");(Ye.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,c=r&&void 0!==r.name?r.name:t;qn(n)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Fn(n,"name")||Hn&&n.name!==c)&&Vn(n,"name",c),(i=$n(n)).source||(i.source=Qn.join("string"==typeof c?c:""))),e!==Nn?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Vn(e,t,n)):s?e[t]=n:Wn(t,n)})(Function.prototype,"toString",(function(){return qn(this)&&zn(this).source||Kn(this)}));var Yn=ae,Jn=Yn({}.toString),Xn=Yn("".slice),Zn=function(e){return Xn(Jn(e),8,-1)},er=K,tr=Qe,nr=ye,rr=Zn,ir=ze("toStringTag"),ar=er.Object,sr="Arguments"==rr(function(){return arguments}()),or=tr?rr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=ar(e),ir))?n:sr?rr(t):"Object"==(r=rr(t))&&nr(t.callee)?"Arguments":r},cr=or,dr=Qe?{}.toString:function(){return"[object "+cr(this)+"]"},ur=Qe,lr=Ye.exports,hr=dr;ur||lr(Object.prototype,"toString",hr,{unsafe:!0});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fr=it("span").classList,mr=fr&&fr.constructor&&fr.constructor.prototype,vr=mr===Object.prototype?void 0:mr,gr=Dt,br=ae(ae.bind),yr=function(e,t){return gr(e),void 0===t?e:br?br(e,t):function(){return e.apply(t,arguments)}},_r=ae,wr=Pe,Ar=Zn,kr=K.Object,Er=_r("".split),xr=wr((function(){return!kr("z").propertyIsEnumerable(0)}))?function(e){return"String"==Ar(e)?Er(e,""):kr(e)}:kr,Dr=Math.ceil,Sr=Math.floor,Rr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Sr:Dr)(t)},Tr=Rr,Ir=Math.min,Or=function(e){return e>0?Ir(Tr(e),9007199254740991):0},Pr=Or,Cr=function(e){return Pr(e.length)},Lr=Zn,Ur=Array.isArray||function(e){return"Array"==Lr(e)},Mr=ae,jr=Pe,Br=ye,Gr=or,Nr=on,qr=function(){},Fr=[],Vr=ke("Reflect","construct"),Wr=/^\s*(?:class|function)\b/,Kr=Mr(Wr.exec),Hr=!Wr.exec(qr),zr=function(e){if(!Br(e))return!1;try{return Vr(qr,Fr,e),!0}catch(e){return!1}},$r=!Vr||jr((function(){var e;return zr(zr.call)||!zr(Object)||!zr((function(){e=!0}))||e}))?function(e){if(!Br(e))return!1;switch(Gr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Hr||!!Kr(Wr,Nr(e))}:zr,Qr=K,Yr=Ur,Jr=$r,Xr=et,Zr=ze("species"),ei=Qr.Array,ti=function(e){var t;return Yr(e)&&(t=e.constructor,(Jr(t)&&(t===ei||Yr(t.prototype))||Xr(t)&&null===(t=t[Zr]))&&(t=void 0)),void 0===t?ei:t},ni=function(e,t){return new(ti(e))(0===t?0:t)},ri=yr,ii=xr,ai=ue,si=Cr,oi=ni,ci=ae([].push),di=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(c,d,u,l){for(var h,p,f=ai(c),m=ii(f),v=ri(d,u),g=si(m),b=0,y=l||oi,_=t?y(c,g):n||s?y(c,0):void 0;g>b;b++)if((o||b in m)&&(p=v(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:ci(_,h)}else switch(e){case 4:return!1;case 7:ci(_,h)}return a?-1:r||i?i:_}},ui={forEach:di(0),map:di(1),filter:di(2),some:di(3),every:di(4),find:di(5),findIndex:di(6),filterReject:di(7)},li=Pe,hi=function(e,t){var n=[][e];return!!n&&li((function(){n.call(null,t||function(){throw 1},1)}))},pi=ui.forEach,fi=K,mi=pr,vi=vr,gi=hi("forEach")?[].forEach:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)},bi=Zt,yi=function(e){if(e&&e.forEach!==gi)try{bi(e,"forEach",gi)}catch(t){e.forEach=gi}};for(var _i in mi)mi[_i]&&yi(fi[_i]&&fi[_i].prototype);yi(vi);var wi={},Ai={},ki={}.propertyIsEnumerable,Ei=Object.getOwnPropertyDescriptor,xi=Ei&&!ki.call({1:2},1);Ai.f=xi?function(e){var t=Ei(this,e);return!!t&&t.enumerable}:ki;var Di=xr,Si=oe,Ri=function(e){return Di(Si(e))},Ti=Je,Ii=pt,Oi=Ai,Pi=Yt,Ci=Ri,Li=Vt,Ui=pe,Mi=st,ji=Object.getOwnPropertyDescriptor;wi.f=Ti?ji:function(e,t){if(e=Ci(e),t=Li(t),Mi)try{return ji(e,t)}catch(e){}if(Ui(e,t))return Pi(!Ii(Oi.f,e,t),e[t])};var Bi={},Gi=Rr,Ni=Math.max,qi=Math.min,Fi=function(e,t){var n=Gi(e);return n<0?Ni(n+t,0):qi(n,t)},Vi=Ri,Wi=Fi,Ki=Cr,Hi=function(e){return function(t,n,r){var i,a=Vi(t),s=Ki(a),o=Wi(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},zi={includes:Hi(!0),indexOf:Hi(!1)},$i=pe,Qi=Ri,Yi=zi.indexOf,Ji=vn,Xi=ae([].push),Zi=function(e,t){var n,r=Qi(e),i=0,a=[];for(n in r)!$i(Ji,n)&&$i(r,n)&&Xi(a,n);for(;t.length>i;)$i(r,n=t[i++])&&(~Yi(a,n)||Xi(a,n));return a},ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ta=Zi,na=ea.concat("length","prototype");Bi.f=Object.getOwnPropertyNames||function(e){return ta(e,na)};var ra={};ra.f=Object.getOwnPropertySymbols;var ia=ke,aa=Bi,sa=ra,oa=lt,ca=ae([].concat),da=ia("Reflect","ownKeys")||function(e){var t=aa.f(oa(e)),n=sa.f;return n?ca(t,n(e)):t},ua=pe,la=da,ha=wi,pa=Xe,fa=function(e,t){for(var n=la(t),r=pa.f,i=ha.f,a=0;a<n.length;a++){var s=n[a];ua(e,s)||r(e,s,i(t,s))}},ma=Pe,va=ye,ga=/#|\.prototype\./,ba=function(e,t){var n=_a[ya(e)];return n==Aa||n!=wa&&(va(t)?ma(t):!!t)},ya=ba.normalize=function(e){return String(e).replace(ga,".").toLowerCase()},_a=ba.data={},wa=ba.NATIVE="N",Aa=ba.POLYFILL="P",ka=ba,Ea=K,xa=wi.f,Da=Zt,Sa=Ye.exports,Ra=Q,Ta=fa,Ia=ka,Oa=function(e,t){var n,r,i,a,s,o=e.target,c=e.global,d=e.stat;if(n=c?Ea:d?Ea[o]||Ra(o,{}):(Ea[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xa(n,r))&&s.value:n[r],!Ia(c?r:o+(d?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ta(a,i)}(e.sham||i&&i.sham)&&Da(a,"sham",!0),Sa(n,r,a,e)}},Pa=Zi,Ca=ea,La=Object.keys||function(e){return Pa(e,Ca)},Ua=ue,Ma=La;Oa({target:"Object",stat:!0,forced:Pe((function(){Ma(1)}))},{keys:function(e){return Ma(Ua(e))}});var ja,Ba={},Ga=Function.prototype,Na=Ga.apply,qa=Ga.bind,Fa=Ga.call,Va="object"==typeof Reflect&&Reflect.apply||(qa?Fa.bind(Na):function(){return Fa.apply(Na,arguments)}),Wa=or,Ka=K.String,Ha=function(e){if("Symbol"===Wa(e))throw TypeError("Cannot convert a Symbol value to a string");return Ka(e)},za=Xe,$a=lt,Qa=Ri,Ya=La,Ja=Je?Object.defineProperties:function(e,t){$a(e);for(var n,r=Qa(t),i=Ya(t),a=i.length,s=0;a>s;)za.f(e,n=i[s++],r[n]);return e},Xa=ke("document","documentElement"),Za=lt,es=Ja,ts=ea,ns=vn,rs=Xa,is=it,as=mn("IE_PROTO"),ss=function(){},os=function(e){return"<script>"+e+"<\/script>"},cs=function(e){e.write(os("")),e.close();var t=e.parentWindow.Object;return e=null,t},ds=function(){try{ja=new ActiveXObject("htmlfile")}catch(e){}var e,t;ds="undefined"!=typeof document?document.domain&&ja?cs(ja):((t=is("iframe")).style.display="none",rs.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(os("document.F=Object")),e.close(),e.F):cs(ja);for(var n=ts.length;n--;)delete ds.prototype[ts[n]];return ds()};ns[as]=!0;var us=Object.create||function(e,t){var n;return null!==e?(ss.prototype=Za(e),n=new ss,ss.prototype=null,n[as]=e):n=ds(),void 0===t?n:es(n,t)},ls={},hs=ae([].slice),ps=Zn,fs=Ri,ms=Bi.f,vs=hs,gs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ls.f=function(e){return gs&&"Window"==ps(e)?function(e){try{return ms(e)}catch(e){return vs(gs)}}(e):ms(fs(e))};var bs={},ys=ze;bs.f=ys;var _s=K,ws=pe,As=bs,ks=Xe.f,Es=function(e){var t=_s.Symbol||(_s.Symbol={});ws(t,e)||ks(t,e,{value:As.f(e)})},xs=Xe.f,Ds=pe,Ss=ze("toStringTag"),Rs=function(e,t,n){e&&!Ds(e=n?e:e.prototype,Ss)&&xs(e,Ss,{configurable:!0,value:t})},Ts=Oa,Is=K,Os=ke,Ps=Va,Cs=pt,Ls=ae,Us=Je,Ms=Ue,js=Pe,Bs=pe,Gs=Ur,Ns=ye,Fs=et,Vs=ft,Ws=_t,Ks=lt,Hs=ue,zs=Ri,$s=Vt,Qs=Ha,Ys=Yt,Js=us,Xs=La,Zs=Bi,eo=ls,to=ra,no=wi,ro=Xe,io=Ai,ao=hs,so=Ye.exports,oo=H.exports,co=vn,uo=be,lo=ze,ho=bs,po=Es,fo=Rs,mo=Cn,vo=ui.forEach,go=mn("hidden"),bo=lo("toPrimitive"),yo=mo.set,_o=mo.getterFor("Symbol"),wo=Object.prototype,Ao=Is.Symbol,ko=Ao&&Ao.prototype,Eo=Is.TypeError,xo=Is.QObject,Do=Os("JSON","stringify"),So=no.f,Ro=ro.f,To=eo.f,Io=io.f,Oo=Ls([].push),Po=oo("symbols"),Co=oo("op-symbols"),Lo=oo("string-to-symbol-registry"),Uo=oo("symbol-to-string-registry"),Mo=oo("wks"),jo=!xo||!xo.prototype||!xo.prototype.findChild,Bo=Us&&js((function(){return 7!=Js(Ro({},"a",{get:function(){return Ro(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=So(wo,t);r&&delete wo[t],Ro(e,t,n),r&&e!==wo&&Ro(wo,t,r)}:Ro,Go=function(e,t){var n=Po[e]=Js(ko);return yo(n,{type:"Symbol",tag:e,description:t}),Us||(n.description=t),n},No=function(e,t,n){e===wo&&No(Co,t,n),Ks(e);var r=$s(t);return Ks(n),Bs(Po,r)?(n.enumerable?(Bs(e,go)&&e[go][r]&&(e[go][r]=!1),n=Js(n,{enumerable:Ys(0,!1)})):(Bs(e,go)||Ro(e,go,Ys(1,{})),e[go][r]=!0),Bo(e,r,n)):Ro(e,r,n)},qo=function(e,t){Ks(e);var n=zs(t),r=Xs(n).concat(Ko(n));return vo(r,(function(t){Us&&!Cs(Fo,n,t)||No(e,t,n[t])})),e},Fo=function(e){var t=$s(e),n=Cs(Io,this,t);return!(this===wo&&Bs(Po,t)&&!Bs(Co,t))&&(!(n||!Bs(this,t)||!Bs(Po,t)||Bs(this,go)&&this[go][t])||n)},Vo=function(e,t){var n=zs(e),r=$s(t);if(n!==wo||!Bs(Po,r)||Bs(Co,r)){var i=So(n,r);return!i||!Bs(Po,r)||Bs(n,go)&&n[go][r]||(i.enumerable=!0),i}},Wo=function(e){var t=To(zs(e)),n=[];return vo(t,(function(e){Bs(Po,e)||Bs(co,e)||Oo(n,e)})),n},Ko=function(e){var t=e===wo,n=To(t?Co:zs(e)),r=[];return vo(n,(function(e){!Bs(Po,e)||t&&!Bs(wo,e)||Oo(r,Po[e])})),r};(Ms||(so(ko=(Ao=function(){if(Vs(ko,this))throw Eo("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Qs(arguments[0]):void 0,t=uo(e),n=function(e){this===wo&&Cs(n,Co,e),Bs(this,go)&&Bs(this[go],t)&&(this[go][t]=!1),Bo(this,t,Ys(1,e))};return Us&&jo&&Bo(wo,t,{configurable:!0,set:n}),Go(t,e)}).prototype,"toString",(function(){return _o(this).tag})),so(Ao,"withoutSetter",(function(e){return Go(uo(e),e)})),io.f=Fo,ro.f=No,no.f=Vo,Zs.f=eo.f=Wo,to.f=Ko,ho.f=function(e){return Go(lo(e),e)},Us&&(Ro(ko,"description",{configurable:!0,get:function(){return _o(this).description}}),so(wo,"propertyIsEnumerable",Fo,{unsafe:!0}))),Ts({global:!0,wrap:!0,forced:!Ms,sham:!Ms},{Symbol:Ao}),vo(Xs(Mo),(function(e){po(e)})),Ts({target:"Symbol",stat:!0,forced:!Ms},{for:function(e){var t=Qs(e);if(Bs(Lo,t))return Lo[t];var n=Ao(t);return Lo[t]=n,Uo[n]=t,n},keyFor:function(e){if(!Ws(e))throw Eo(e+" is not a symbol");if(Bs(Uo,e))return Uo[e]},useSetter:function(){jo=!0},useSimple:function(){jo=!1}}),Ts({target:"Object",stat:!0,forced:!Ms,sham:!Us},{create:function(e,t){return void 0===t?Js(e):qo(Js(e),t)},defineProperty:No,defineProperties:qo,getOwnPropertyDescriptor:Vo}),Ts({target:"Object",stat:!0,forced:!Ms},{getOwnPropertyNames:Wo,getOwnPropertySymbols:Ko}),Ts({target:"Object",stat:!0,forced:js((function(){to.f(1)}))},{getOwnPropertySymbols:function(e){return to.f(Hs(e))}}),Do)&&Ts({target:"JSON",stat:!0,forced:!Ms||js((function(){var e=Ao();return"[null]"!=Do([e])||"{}"!=Do({a:e})||"{}"!=Do(Object(e))}))},{stringify:function(e,t,n){var r=ao(arguments),i=t;if((Fs(t)||void 0!==e)&&!Ws(e))return Gs(t)||(t=function(e,t){if(Ns(i)&&(t=Cs(i,this,e,t)),!Ws(t))return t}),r[1]=t,Ps(Do,null,r)}});if(!ko[bo]){var Ho=ko.valueOf;so(ko,bo,(function(e){return Cs(Ho,this)}))}fo(Ao,"Symbol"),co[go]=!0;var zo=Pe,$o=Oe,Qo=ze("species"),Yo=function(e){return $o>=51||!zo((function(){var t=[];return(t.constructor={})[Qo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Jo=ui.filter;Oa({target:"Array",proto:!0,forced:!Yo("filter")},{filter:function(e){return Jo(this,e,arguments.length>1?arguments[1]:void 0)}});var Xo=Oa,Zo=Pe,ec=Ri,tc=wi.f,nc=Je,rc=Zo((function(){tc(1)}));Xo({target:"Object",stat:!0,forced:!nc||rc,sham:!nc},{getOwnPropertyDescriptor:function(e,t){return tc(ec(e),t)}});var ic=Vt,ac=Xe,sc=Yt,oc=function(e,t,n){var r=ic(t);r in e?ac.f(e,r,sc(0,n)):e[r]=n},cc=da,dc=Ri,uc=wi,lc=oc;Oa({target:"Object",stat:!0,sham:!Je},{getOwnPropertyDescriptors:function(e){for(var t,n,r=dc(e),i=uc.f,a=cc(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&lc(s,t,n);return s}});var hc=Oa,pc=K,fc=Ur,mc=$r,vc=et,gc=Fi,bc=Cr,yc=Ri,_c=oc,wc=ze,Ac=hs,kc=Yo("slice"),Ec=wc("species"),xc=pc.Array,Dc=Math.max;hc({target:"Array",proto:!0,forced:!kc},{slice:function(e,t){var n,r,i,a=yc(this),s=bc(a),o=gc(e,s),c=gc(void 0===t?s:t,s);if(fc(a)&&(n=a.constructor,(mc(n)&&(n===xc||fc(n.prototype))||vc(n)&&null===(n=n[Ec]))&&(n=void 0),n===xc||void 0===n))return Ac(a,o,c);for(r=new(void 0===n?xc:n)(Dc(c-o,0)),i=0;o<c;o++,i++)o in a&&_c(r,i,a[o]);return r.length=i,r}});var Sc=pt,Rc=lt,Tc=Rt,Ic=function(e,t,n){var r,i;Rc(e);try{if(!(r=Tc(e,"return"))){if("throw"===t)throw n;return n}r=Sc(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Rc(r),n},Oc=lt,Pc=Ic,Cc={},Lc=Cc,Uc=ze("iterator"),Mc=Array.prototype,jc=function(e){return void 0!==e&&(Lc.Array===e||Mc[Uc]===e)},Bc=or,Gc=Rt,Nc=Cc,qc=ze("iterator"),Fc=function(e){if(null!=e)return Gc(e,qc)||Gc(e,"@@iterator")||Nc[Bc(e)]},Vc=pt,Wc=Dt,Kc=lt,Hc=At,zc=Fc,$c=K.TypeError,Qc=function(e,t){var n=arguments.length<2?zc(e):t;if(Wc(n))return Kc(Vc(n,e));throw $c(Hc(e)+" is not iterable")},Yc=yr,Jc=pt,Xc=ue,Zc=function(e,t,n,r){try{return r?t(Oc(n)[0],n[1]):t(n)}catch(t){Pc(e,"throw",t)}},ed=jc,td=$r,nd=Cr,rd=oc,id=Qc,ad=Fc,sd=K.Array,od=ze("iterator"),cd=!1;try{var dd=0,ud={next:function(){return{done:!!dd++}},return:function(){cd=!0}};ud[od]=function(){return this},Array.from(ud,(function(){throw 2}))}catch(e){}var ld=function(e,t){if(!t&&!cd)return!1;var n=!1;try{var r={};r[od]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},hd=function(e){var t=Xc(e),n=td(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=Yc(i,r>2?arguments[2]:void 0));var s,o,c,d,u,l,h=ad(t),p=0;if(!h||this==sd&&ed(h))for(s=nd(t),o=n?new this(s):sd(s);s>p;p++)l=a?i(t[p],p):t[p],rd(o,p,l);else for(u=(d=id(t,h)).next,o=n?new this:[];!(c=Jc(u,d)).done;p++)l=a?Zc(d,i,[c.value,p],!0):c.value,rd(o,p,l);return o.length=p,o};Oa({target:"Array",stat:!0,forced:!ld((function(e){Array.from(e)}))},{from:hd});var pd,fd,md,vd=ae,gd=Rr,bd=Ha,yd=oe,_d=vd("".charAt),wd=vd("".charCodeAt),Ad=vd("".slice),kd=function(e){return function(t,n){var r,i,a=bd(yd(t)),s=gd(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=wd(a,s))<55296||r>56319||s+1===o||(i=wd(a,s+1))<56320||i>57343?e?_d(a,s):r:e?Ad(a,s,s+2):i-56320+(r-55296<<10)+65536}},Ed={codeAt:kd(!1),charAt:kd(!0)},xd=!Pe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Dd=K,Sd=pe,Rd=ye,Td=ue,Id=xd,Od=mn("IE_PROTO"),Pd=Dd.Object,Cd=Pd.prototype,Ld=Id?Pd.getPrototypeOf:function(e){var t=Td(e);if(Sd(t,Od))return t[Od];var n=t.constructor;return Rd(n)&&t instanceof n?n.prototype:t instanceof Pd?Cd:null},Ud=Pe,Md=ye,jd=Ld,Bd=Ye.exports,Gd=ze("iterator"),Nd=!1;[].keys&&("next"in(md=[].keys())?(fd=jd(jd(md)))!==Object.prototype&&(pd=fd):Nd=!0);var qd=null==pd||Ud((function(){var e={};return pd[Gd].call(e)!==e}));qd&&(pd={}),Md(pd[Gd])||Bd(pd,Gd,(function(){return this}));var Fd={IteratorPrototype:pd,BUGGY_SAFARI_ITERATORS:Nd},Vd=Fd.IteratorPrototype,Wd=us,Kd=Yt,Hd=Rs,zd=Cc,$d=function(){return this},Qd=function(e,t,n){var r=t+" Iterator";return e.prototype=Wd(Vd,{next:Kd(1,n)}),Hd(e,r,!1),zd[r]=$d,e},Yd=K,Jd=ye,Xd=Yd.String,Zd=Yd.TypeError,eu=ae,tu=lt,nu=function(e){if("object"==typeof e||Jd(e))return e;throw Zd("Can't set "+Xd(e)+" as a prototype")},ru=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=eu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return tu(n),nu(r),t?e(n,r):n.__proto__=r,n}}():void 0),iu=Oa,au=pt,su=Gn,ou=ye,cu=Qd,du=Ld,uu=ru,lu=Rs,hu=Zt,pu=Ye.exports,fu=Cc,mu=su.PROPER,vu=su.CONFIGURABLE,gu=Fd.IteratorPrototype,bu=Fd.BUGGY_SAFARI_ITERATORS,yu=ze("iterator"),_u=function(){return this},wu=function(e,t,n,r,i,a,s){cu(n,t,r);var o,c,d,u=function(e){if(e===i&&m)return m;if(!bu&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[yu]||p["@@iterator"]||i&&p[i],m=!bu&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(o=du(v.call(new e)))!==Object.prototype&&o.next&&(du(o)!==gu&&(uu?uu(o,gu):ou(o[yu])||pu(o,yu,_u)),lu(o,l,!0)),mu&&"values"==i&&f&&"values"!==f.name&&(vu?hu(p,"name","values"):(h=!0,m=function(){return au(f,this)})),i)if(c={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(d in c)(bu||h||!(d in p))&&pu(p,d,c[d]);else iu({target:t,proto:!0,forced:bu||h},c);return p[yu]!==m&&pu(p,yu,m,{name:i}),fu[t]=m,c},Au=Ed.charAt,ku=Ha,Eu=Cn,xu=wu,Du=Eu.set,Su=Eu.getterFor("String Iterator");xu(String,"String",(function(e){Du(this,{type:"String Iterator",string:ku(e),index:0})}),(function(){var e,t=Su(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Au(n,r),t.index+=e.length,{value:e,done:!1})}));var Ru=lt,Tu=function(){var e=Ru(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Iu={},Ou=Pe,Pu=K.RegExp;Iu.UNSUPPORTED_Y=Ou((function(){var e=Pu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Iu.BROKEN_CARET=Ou((function(){var e=Pu("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Cu=Pe,Lu=K.RegExp,Uu=Cu((function(){var e=Lu(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Mu=Pe,ju=K.RegExp,Bu=Mu((function(){var e=ju("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Gu=pt,Nu=ae,qu=Ha,Fu=Tu,Vu=Iu,Wu=H.exports,Ku=us,Hu=Cn.get,zu=Uu,$u=Bu,Qu=Wu("native-string-replace",String.prototype.replace),Yu=RegExp.prototype.exec,Ju=Yu,Xu=Nu("".charAt),Zu=Nu("".indexOf),el=Nu("".replace),tl=Nu("".slice),nl=function(){var e=/a/,t=/b*/g;return Gu(Yu,e,"a"),Gu(Yu,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),rl=Vu.UNSUPPORTED_Y||Vu.BROKEN_CARET,il=void 0!==/()??/.exec("")[1];(nl||il||rl||zu||$u)&&(Ju=function(e){var t,n,r,i,a,s,o,c=this,d=Hu(c),u=qu(e),l=d.raw;if(l)return l.lastIndex=c.lastIndex,t=Gu(Ju,l,u),c.lastIndex=l.lastIndex,t;var h=d.groups,p=rl&&c.sticky,f=Gu(Fu,c),m=c.source,v=0,g=u;if(p&&(f=el(f,"y",""),-1===Zu(f,"g")&&(f+="g"),g=tl(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Xu(u,c.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),il&&(n=new RegExp("^"+m+"$(?!\\s)",f)),nl&&(r=c.lastIndex),i=Gu(Yu,p?n:c,g),p?i?(i.input=tl(i.input,v),i[0]=tl(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:nl&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),il&&i&&i.length>1&&Gu(Qu,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=Ku(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var al=Ju;Oa({target:"RegExp",proto:!0,forced:/./.exec!==al},{exec:al});var sl=Oa,ol=Je,cl=K,dl=ae,ul=pe,ll=ye,hl=ft,pl=Ha,fl=Xe.f,ml=fa,vl=cl.Symbol,gl=vl&&vl.prototype;if(ol&&ll(vl)&&(!("description"in gl)||void 0!==vl().description)){var bl={},yl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:pl(arguments[0]),t=hl(gl,this)?new vl(e):void 0===e?vl():vl(e);return""===e&&(bl[t]=!0),t};ml(yl,vl),yl.prototype=gl,gl.constructor=yl;var _l="Symbol(test)"==String(vl("test")),wl=dl(gl.toString),Al=dl(gl.valueOf),kl=/^Symbol\((.*)\)[^)]+$/,El=dl("".replace),xl=dl("".slice);fl(gl,"description",{configurable:!0,get:function(){var e=Al(this),t=wl(e);if(ul(bl,e))return"";var n=_l?xl(t,7,-1):El(t,kl,"$1");return""===n?void 0:n}}),sl({global:!0,forced:!0},{Symbol:yl})}Es("iterator");var Dl=us,Sl=Xe,Rl=ze("unscopables"),Tl=Array.prototype;null==Tl[Rl]&&Sl.f(Tl,Rl,{configurable:!0,value:Dl(null)});var Il=function(e){Tl[Rl][e]=!0},Ol=Ri,Pl=Il,Cl=Cc,Ll=Cn,Ul=wu,Ml=Ll.set,jl=Ll.getterFor("Array Iterator"),Bl=Ul(Array,"Array",(function(e,t){Ml(this,{type:"Array Iterator",target:Ol(e),index:0,kind:t})}),(function(){var e=jl(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Cl.Arguments=Cl.Array,Pl("keys"),Pl("values"),Pl("entries");var Gl=K,Nl=pr,ql=vr,Fl=Bl,Vl=Zt,Wl=ze,Kl=Wl("iterator"),Hl=Wl("toStringTag"),zl=Fl.values,$l=function(e,t){if(e){if(e[Kl]!==zl)try{Vl(e,Kl,zl)}catch(t){e[Kl]=zl}if(e[Hl]||Vl(e,Hl,t),Nl[t])for(var n in Fl)if(e[n]!==Fl[n])try{Vl(e,n,Fl[n])}catch(t){e[n]=Fl[n]}}};for(var Ql in Nl)$l(Gl[Ql]&&Gl[Ql].prototype,Ql);$l(ql,"DOMTokenList");var Yl,Jl,Xl,Zl,eh=K.Promise,th=Ye.exports,nh=function(e,t,n){for(var r in t)th(e,r,t[r],n);return e},rh=ke,ih=Xe,ah=Je,sh=ze("species"),oh=function(e){var t=rh(e),n=ih.f;ah&&t&&!t[sh]&&n(t,sh,{configurable:!0,get:function(){return this}})},ch=ft,dh=K.TypeError,uh=function(e,t){if(ch(t,e))return e;throw dh("Incorrect invocation")},lh=yr,hh=pt,ph=lt,fh=At,mh=jc,vh=Cr,gh=ft,bh=Qc,yh=Fc,_h=Ic,wh=K.TypeError,Ah=function(e,t){this.stopped=e,this.result=t},kh=Ah.prototype,Eh=$r,xh=At,Dh=K.TypeError,Sh=lt,Rh=function(e){if(Eh(e))return e;throw Dh(xh(e)+" is not a constructor")},Th=ze("species"),Ih=function(e,t){var n,r=Sh(e).constructor;return void 0===r||null==(n=Sh(r)[Th])?t:Rh(n)},Oh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ee),Ph="process"==Zn(K.process),Ch=K,Lh=Va,Uh=yr,Mh=ye,jh=pe,Bh=Pe,Gh=Xa,Nh=hs,qh=it,Fh=Oh,Vh=Ph,Wh=Ch.setImmediate,Kh=Ch.clearImmediate,Hh=Ch.process,zh=Ch.Dispatch,$h=Ch.Function,Qh=Ch.MessageChannel,Yh=Ch.String,Jh=0,Xh={};try{Yl=Ch.location}catch(e){}var Zh=function(e){if(jh(Xh,e)){var t=Xh[e];delete Xh[e],t()}},ep=function(e){return function(){Zh(e)}},tp=function(e){Zh(e.data)},np=function(e){Ch.postMessage(Yh(e),Yl.protocol+"//"+Yl.host)};Wh&&Kh||(Wh=function(e){var t=Nh(arguments,1);return Xh[++Jh]=function(){Lh(Mh(e)?e:$h(e),void 0,t)},Jl(Jh),Jh},Kh=function(e){delete Xh[e]},Vh?Jl=function(e){Hh.nextTick(ep(e))}:zh&&zh.now?Jl=function(e){zh.now(ep(e))}:Qh&&!Fh?(Zl=(Xl=new Qh).port2,Xl.port1.onmessage=tp,Jl=Uh(Zl.postMessage,Zl)):Ch.addEventListener&&Mh(Ch.postMessage)&&!Ch.importScripts&&Yl&&"file:"!==Yl.protocol&&!Bh(np)?(Jl=np,Ch.addEventListener("message",tp,!1)):Jl="onreadystatechange"in qh("script")?function(e){Gh.appendChild(qh("script")).onreadystatechange=function(){Gh.removeChild(this),Zh(e)}}:function(e){setTimeout(ep(e),0)});var rp,ip,ap,sp,op,cp,dp,up,lp={set:Wh,clear:Kh},hp=K,pp=/ipad|iphone|ipod/i.test(Ee)&&void 0!==hp.Pebble,fp=/web0s(?!.*chrome)/i.test(Ee),mp=K,vp=yr,gp=wi.f,bp=lp.set,yp=Oh,_p=pp,wp=fp,Ap=Ph,kp=mp.MutationObserver||mp.WebKitMutationObserver,Ep=mp.document,xp=mp.process,Dp=mp.Promise,Sp=gp(mp,"queueMicrotask"),Rp=Sp&&Sp.value;Rp||(rp=function(){var e,t;for(Ap&&(e=xp.domain)&&e.exit();ip;){t=ip.fn,ip=ip.next;try{t()}catch(e){throw ip?sp():ap=void 0,e}}ap=void 0,e&&e.enter()},yp||Ap||wp||!kp||!Ep?!_p&&Dp&&Dp.resolve?((dp=Dp.resolve(void 0)).constructor=Dp,up=vp(dp.then,dp),sp=function(){up(rp)}):Ap?sp=function(){xp.nextTick(rp)}:(bp=vp(bp,mp),sp=function(){bp(rp)}):(op=!0,cp=Ep.createTextNode(""),new kp(rp).observe(cp,{characterData:!0}),sp=function(){cp.data=op=!op}));var Tp=Rp||function(e){var t={fn:e,next:void 0};ap&&(ap.next=t),ip||(ip=t,sp()),ap=t},Ip={},Op=Dt,Pp=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Op(t),this.reject=Op(n)};Ip.f=function(e){return new Pp(e)};var Cp,Lp,Up,Mp,jp=lt,Bp=et,Gp=Ip,Np=function(e,t){if(jp(e),Bp(t)&&t.constructor===e)return t;var n=Gp.f(e);return(0,n.resolve)(t),n.promise},qp=K,Fp="object"==typeof window,Vp=Oa,Wp=K,Kp=ke,Hp=pt,zp=eh,$p=Ye.exports,Qp=nh,Yp=ru,Jp=Rs,Xp=oh,Zp=Dt,ef=ye,tf=et,nf=uh,rf=on,af=function(e,t,n){var r,i,a,s,o,c,d,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=lh(t,u),m=function(e){return r&&_h(r,"normal",e),new Ah(!0,e)},v=function(e){return l?(ph(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=yh(e)))throw wh(fh(e)+" is not iterable");if(mh(i)){for(a=0,s=vh(e);s>a;a++)if((o=v(e[a]))&&gh(kh,o))return o;return new Ah(!1)}r=bh(e,i)}for(c=r.next;!(d=hh(c,r)).done;){try{o=v(d.value)}catch(e){_h(r,"throw",e)}if("object"==typeof o&&o&&gh(kh,o))return o}return new Ah(!1)},sf=ld,of=Ih,cf=lp.set,df=Tp,uf=Np,lf=function(e,t){var n=qp.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},hf=Ip,pf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ff=Cn,mf=ka,vf=Fp,gf=Ph,bf=Oe,yf=ze("species"),_f=ff.get,wf=ff.set,Af=ff.getterFor("Promise"),kf=zp&&zp.prototype,Ef=zp,xf=kf,Df=Wp.TypeError,Sf=Wp.document,Rf=Wp.process,Tf=hf.f,If=Tf,Of=!!(Sf&&Sf.createEvent&&Wp.dispatchEvent),Pf=ef(Wp.PromiseRejectionEvent),Cf=!1,Lf=mf("Promise",(function(){var e=rf(Ef),t=e!==String(Ef);if(!t&&66===bf)return!0;if(bf>=51&&/native code/.test(e))return!1;var n=new Ef((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[yf]=r,!(Cf=n.then((function(){}))instanceof r)||!t&&vf&&!Pf})),Uf=Lf||!sf((function(e){Ef.all(e).catch((function(){}))})),Mf=function(e){var t;return!(!tf(e)||!ef(t=e.then))&&t},jf=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;df((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var s,o,c,d=n[a++],u=i?d.ok:d.fail,l=d.resolve,h=d.reject,p=d.domain;try{u?(i||(2===e.rejection&&qf(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),c=!0)),s===d.promise?h(Df("Promise-chain cycle")):(o=Mf(s))?Hp(o,s,l,h):l(s)):h(r)}catch(e){p&&!c&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Gf(e)}))}},Bf=function(e,t,n){var r,i;Of?((r=Sf.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Wp.dispatchEvent(r)):r={promise:t,reason:n},!Pf&&(i=Wp["on"+e])?i(r):"unhandledrejection"===e&&lf("Unhandled promise rejection",n)},Gf=function(e){Hp(cf,Wp,(function(){var t,n=e.facade,r=e.value;if(Nf(e)&&(t=pf((function(){gf?Rf.emit("unhandledRejection",r,n):Bf("unhandledrejection",n,r)})),e.rejection=gf||Nf(e)?2:1,t.error))throw t.value}))},Nf=function(e){return 1!==e.rejection&&!e.parent},qf=function(e){Hp(cf,Wp,(function(){var t=e.facade;gf?Rf.emit("rejectionHandled",t):Bf("rejectionhandled",t,e.value)}))},Ff=function(e,t,n){return function(r){e(t,r,n)}},Vf=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,jf(e,!0))},Wf=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Df("Promise can't be resolved itself");var r=Mf(t);r?df((function(){var n={done:!1};try{Hp(r,t,Ff(Wf,n,e),Ff(Vf,n,e))}catch(t){Vf(n,t,e)}})):(e.value=t,e.state=1,jf(e,!1))}catch(t){Vf({done:!1},t,e)}}};if(Lf&&(xf=(Ef=function(e){nf(this,xf),Zp(e),Hp(Cp,this);var t=_f(this);try{e(Ff(Wf,t),Ff(Vf,t))}catch(e){Vf(t,e)}}).prototype,(Cp=function(e){wf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Qp(xf,{then:function(e,t){var n=Af(this),r=n.reactions,i=Tf(of(this,Ef));return i.ok=!ef(e)||e,i.fail=ef(t)&&t,i.domain=gf?Rf.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&jf(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),Lp=function(){var e=new Cp,t=_f(e);this.promise=e,this.resolve=Ff(Wf,t),this.reject=Ff(Vf,t)},hf.f=Tf=function(e){return e===Ef||e===Up?new Lp(e):If(e)},ef(zp)&&kf!==Object.prototype)){Mp=kf.then,Cf||($p(kf,"then",(function(e,t){var n=this;return new Ef((function(e,t){Hp(Mp,n,e,t)})).then(e,t)}),{unsafe:!0}),$p(kf,"catch",xf.catch,{unsafe:!0}));try{delete kf.constructor}catch(e){}Yp&&Yp(kf,xf)}Vp({global:!0,wrap:!0,forced:Lf},{Promise:Ef}),Jp(Ef,"Promise",!1),Xp("Promise"),Up=Kp("Promise"),Vp({target:"Promise",stat:!0,forced:Lf},{reject:function(e){var t=Tf(this);return Hp(t.reject,void 0,e),t.promise}}),Vp({target:"Promise",stat:!0,forced:Lf},{resolve:function(e){return uf(this,e)}}),Vp({target:"Promise",stat:!0,forced:Uf},{all:function(e){var t=this,n=Tf(t),r=n.resolve,i=n.reject,a=pf((function(){var n=Zp(t.resolve),a=[],s=0,o=1;af(e,(function(e){var c=s++,d=!1;o++,Hp(n,t,e).then((function(e){d||(d=!0,a[c]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=Tf(t),r=n.reject,i=pf((function(){var i=Zp(t.resolve);af(e,(function(e){Hp(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Kf=Oa,Hf=K,zf=Pe,$f=Ur,Qf=et,Yf=ue,Jf=Cr,Xf=oc,Zf=ni,em=Yo,tm=Oe,nm=ze("isConcatSpreadable"),rm=Hf.TypeError,im=tm>=51||!zf((function(){var e=[];return e[nm]=!1,e.concat()[0]!==e})),am=em("concat"),sm=function(e){if(!Qf(e))return!1;var t=e[nm];return void 0!==t?!!t:$f(e)};Kf({target:"Array",proto:!0,forced:!im||!am},{concat:function(e){var t,n,r,i,a,s=Yf(this),o=Zf(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(sm(a=-1===t?s:arguments[t])){if(c+(i=Jf(a))>9007199254740991)throw rm("Maximum allowed index exceeded");for(n=0;n<i;n++,c++)n in a&&Xf(o,c,a[n])}else{if(c>=9007199254740991)throw rm("Maximum allowed index exceeded");Xf(o,c++,a)}return o.length=c,o}});var om=Je,cm=Gn.EXISTS,dm=ae,um=Xe.f,lm=Function.prototype,hm=dm(lm.toString),pm=/^\s*function ([^ (]*)/,fm=dm(pm.exec);function mm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return vm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vm(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function vm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gm(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}om&&!cm&&um(lm,"name",{configurable:!0,get:function(){try{return fm(pm,hm(this))[1]}catch(e){return""}}});var ym,_m={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},wm={},Am=function(e,t){wm[e]=bm(bm({},t),{},{isLoading:!1})},km=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Em=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,c,d,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=wm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=mm(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,c=_m[o].name,!window[c]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,km({id:o,src:_m[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),d=o.id,u=o.src,console.log("Could not load external script ".concat(d," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,km({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),xm=new function t(){var n=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Em("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),R(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Am(this.moduleName,this.moduleConfig)},Dm=et,Sm=Zn,Rm=ze("match"),Tm=function(e){var t;return Dm(e)&&(void 0!==(t=e[Rm])?!!t:"RegExp"==Sm(e))},Im=Tm,Om=K.TypeError,Pm=function(e){if(Im(e))throw Om("The method doesn't accept regular expressions");return e},Cm=ze("match"),Lm=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Cm]=!1,"/./"[e](t)}catch(e){}}return!1},Um=Oa,Mm=ae,jm=wi.f,Bm=Or,Gm=Ha,Nm=Pm,qm=oe,Fm=Lm,Vm=Mm("".startsWith),Wm=Mm("".slice),Km=Math.min,Hm=Fm("startsWith");Um({target:"String",proto:!0,forced:!!(Hm||(ym=jm(String.prototype,"startsWith"),!ym||ym.writable))&&!Hm},{startsWith:function(e){var t=Gm(qm(this));Nm(e);var n=Bm(Km(arguments.length>1?arguments[1]:void 0,t.length)),r=Gm(e);return Vm?Vm(t,r,n):Wm(t,n,n+r.length)===r}});var zm=ae,$m=Gn.PROPER,Qm=Ye.exports,Ym=lt,Jm=ft,Xm=Ha,Zm=Pe,ev=Tu,tv=RegExp.prototype,nv=tv.toString,rv=zm(ev),iv=Zm((function(){return"/a/b"!=nv.call({source:"a",flags:"b"})})),av=$m&&"toString"!=nv.name;(iv||av)&&Qm(RegExp.prototype,"toString",(function(){var e=Ym(this),t=Xm(e.source),n=e.flags;return"/"+t+"/"+Xm(void 0===n&&Jm(tv,e)&&!("flags"in tv)?rv(e):n)}),{unsafe:!0});var sv=ae,ov=Ye.exports,cv=al,dv=Pe,uv=ze,lv=Zt,hv=uv("species"),pv=RegExp.prototype,fv=function(e,t,n,r){var i=uv(e),a=!dv((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!dv((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[hv]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=sv(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var s=sv(e),c=t.exec;return c===cv||c===pv.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));ov(String.prototype,e,c[0]),ov(pv,i,c[1])}r&&lv(pv[i],"sham",!0)},mv=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},vv=pt,gv=lt,bv=ye,yv=Zn,_v=al,wv=K.TypeError,Av=function(e,t){var n=e.exec;if(bv(n)){var r=vv(n,e,t);return null!==r&&gv(r),r}if("RegExp"===yv(e))return vv(_v,e,t);throw wv("RegExp#exec called on incompatible receiver")},kv=pt,Ev=lt,xv=oe,Dv=mv,Sv=Ha,Rv=Rt,Tv=Av;function Iv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ov(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iv(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}fv("search",(function(e,t,n){return[function(t){var n=xv(this),r=null==t?void 0:Rv(t,e);return r?kv(r,t,n):new RegExp(t)[e](Sv(n))},function(e){var r=Ev(this),i=Sv(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;Dv(s,0)||(r.lastIndex=0);var o=Tv(r,i);return Dv(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Pv,Cv,Lv=function(){function e(){S(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),d=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?d:o()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:c,parentDomain:d,topDomain:u&&u.length?u:d,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:y,depth:s(),domainMatched:d===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=Ov(Ov({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}}]),e}(),Uv=function(){try{return(new Lv).getBridgeContext()}catch(e){return{}}}(),Mv={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Pv=!1,(Cv=c("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Cv.xanthophyll&&(Pv=!0),Pv)},jv=Ed.charAt,Bv=function(e,t,n){return t+(n?jv(e,t).length:1)},Gv=ae,Nv=ue,qv=Math.floor,Fv=Gv("".charAt),Vv=Gv("".replace),Wv=Gv("".slice),Kv=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Hv=/\$([$&'`]|\d{1,2})/g,zv=Va,$v=pt,Qv=ae,Yv=fv,Jv=Pe,Xv=lt,Zv=ye,eg=Rr,tg=Or,ng=Ha,rg=oe,ig=Bv,ag=Rt,sg=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,c=Hv;return void 0!==i&&(i=Nv(i),c=Kv),Vv(a,c,(function(a,c){var d;switch(Fv(c,0)){case"$":return"$";case"&":return e;case"`":return Wv(t,0,n);case"'":return Wv(t,s);case"<":d=i[Wv(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>o){var l=qv(u/10);return 0===l?a:l<=o?void 0===r[l-1]?Fv(c,1):r[l-1]+Fv(c,1):a}d=r[u-1]}return void 0===d?"":d}))},og=Av,cg=ze("replace"),dg=Math.max,ug=Math.min,lg=Qv([].concat),hg=Qv([].push),pg=Qv("".indexOf),fg=Qv("".slice),mg="$0"==="a".replace(/./,"$0"),vg=!!/./[cg]&&""===/./[cg]("a","$0");Yv("replace",(function(e,t,n){var r=vg?"$":"$0";return[function(e,n){var r=rg(this),i=null==e?void 0:ag(e,cg);return i?$v(i,e,r,n):$v(t,ng(r),e,n)},function(e,i){var a=Xv(this),s=ng(e);if("string"==typeof i&&-1===pg(i,r)&&-1===pg(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var c=Zv(i);c||(i=ng(i));var d=a.global;if(d){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=og(a,s);if(null===h)break;if(hg(l,h),!d)break;""===ng(h[0])&&(a.lastIndex=ig(s,tg(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=ng((h=l[v])[0]),b=dg(ug(eg(h.index),s.length),0),y=[],_=1;_<h.length;_++)hg(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(c){var A=lg([g],y,b,s);void 0!==w&&hg(A,w);var k=ng(zv(i,void 0,A))}else k=sg(g,s,b,y,w,i);b>=m&&(f+=fg(s,m,b)+k,m=b+g.length)}return f+fg(s,m)}]}),!!Jv((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!mg||vg);var gg=Pe,bg=ze("iterator"),yg=!gg((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[bg]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),_g=hs,wg=Math.floor,Ag=function(e,t){var n=e.length,r=wg(n/2);return n<8?kg(e,t):Eg(e,Ag(_g(e,0,r),t),Ag(_g(e,r),t),t)},kg=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Eg=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},xg=Ag,Dg=Oa,Sg=K,Rg=ke,Tg=pt,Ig=ae,Og=yg,Pg=Ye.exports,Cg=nh,Lg=Rs,Ug=Qd,Mg=Cn,jg=uh,Bg=ye,Gg=pe,Ng=yr,qg=or,Fg=lt,Vg=et,Wg=Ha,Kg=us,Hg=Yt,zg=Qc,$g=Fc,Qg=xg,Yg=ze("iterator"),Jg=Mg.set,Xg=Mg.getterFor("URLSearchParams"),Zg=Mg.getterFor("URLSearchParamsIterator"),eb=Rg("fetch"),tb=Rg("Request"),nb=Rg("Headers"),rb=tb&&tb.prototype,ib=nb&&nb.prototype,ab=Sg.RegExp,sb=Sg.TypeError,ob=Sg.decodeURIComponent,cb=Sg.encodeURIComponent,db=Ig("".charAt),ub=Ig([].join),lb=Ig([].push),hb=Ig("".replace),pb=Ig([].shift),fb=Ig([].splice),mb=Ig("".split),vb=Ig("".slice),gb=/\+/g,bb=Array(4),yb=function(e){return bb[e-1]||(bb[e-1]=ab("((?:%[\\da-f]{2}){"+e+"})","gi"))},_b=function(e){try{return ob(e)}catch(t){return e}},wb=function(e){var t=hb(e,gb," "),n=4;try{return ob(t)}catch(e){for(;n;)t=hb(t,yb(n--),_b);return t}},Ab=/[!'()~]|%20/g,kb={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Eb=function(e){return kb[e]},xb=function(e){return hb(cb(e),Ab,Eb)},Db=function(e,t){if(t)for(var n,r,i=mb(t,"&"),a=0;a<i.length;)(n=i[a++]).length&&(r=mb(n,"="),lb(e,{key:wb(pb(r)),value:wb(ub(r,"="))}))},Sb=function(e){this.entries.length=0,Db(this.entries,e)},Rb=function(e,t){if(e<t)throw sb("Not enough arguments")},Tb=Ug((function(e,t){Jg(this,{type:"URLSearchParamsIterator",iterator:zg(Xg(e).entries),kind:t})}),"Iterator",(function(){var e=Zg(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Ib=function(){jg(this,Ob);var e,t,n,r,i,a,s,o,c,d=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(Jg(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Sb}),void 0!==d)if(Vg(d))if(e=$g(d))for(n=(t=zg(d,e)).next;!(r=Tg(n,t)).done;){if(a=(i=zg(Fg(r.value))).next,(s=Tg(a,i)).done||(o=Tg(a,i)).done||!Tg(a,i).done)throw sb("Expected sequence with length 2");lb(l,{key:Wg(s.value),value:Wg(o.value)})}else for(c in d)Gg(d,c)&&lb(l,{key:c,value:Wg(d[c])});else Db(l,"string"==typeof d?"?"===db(d,0)?vb(d,1):d:Wg(d))},Ob=Ib.prototype;if(Cg(Ob,{append:function(e,t){Rb(arguments.length,2);var n=Xg(this);lb(n.entries,{key:Wg(e),value:Wg(t)}),n.updateURL()},delete:function(e){Rb(arguments.length,1);for(var t=Xg(this),n=t.entries,r=Wg(e),i=0;i<n.length;)n[i].key===r?fb(n,i,1):i++;t.updateURL()},get:function(e){Rb(arguments.length,1);for(var t=Xg(this).entries,n=Wg(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Rb(arguments.length,1);for(var t=Xg(this).entries,n=Wg(e),r=[],i=0;i<t.length;i++)t[i].key===n&&lb(r,t[i].value);return r},has:function(e){Rb(arguments.length,1);for(var t=Xg(this).entries,n=Wg(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Rb(arguments.length,1);for(var n,r=Xg(this),i=r.entries,a=!1,s=Wg(e),o=Wg(t),c=0;c<i.length;c++)(n=i[c]).key===s&&(a?fb(i,c--,1):(a=!0,n.value=o));a||lb(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=Xg(this);Qg(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=Xg(this).entries,r=Ng(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new Tb(this,"keys")},values:function(){return new Tb(this,"values")},entries:function(){return new Tb(this,"entries")}},{enumerable:!0}),Pg(Ob,Yg,Ob.entries,{name:"entries"}),Pg(Ob,"toString",(function(){for(var e,t=Xg(this).entries,n=[],r=0;r<t.length;)e=t[r++],lb(n,xb(e.key)+"="+xb(e.value));return ub(n,"&")}),{enumerable:!0}),Lg(Ib,"URLSearchParams"),Dg({global:!0,forced:!Og},{URLSearchParams:Ib}),!Og&&Bg(nb)){var Pb=Ig(ib.has),Cb=Ig(ib.set),Lb=function(e){if(Vg(e)){var t,n=e.body;if("URLSearchParams"===qg(n))return t=e.headers?new nb(e.headers):new nb,Pb(t,"content-type")||Cb(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Kg(e,{body:Hg(0,Wg(n)),headers:Hg(0,t)})}return e};if(Bg(eb)&&Dg({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return eb(e,arguments.length>1?Lb(arguments[1]):{})}}),Bg(tb)){var Ub=function(e){return jg(this,rb),new tb(e,arguments.length>1?Lb(arguments[1]):{})};rb.constructor=Ub,Ub.prototype=rb,Dg({global:!0,forced:!0},{Request:Ub})}}var Mb=zi.includes,jb=Il;Oa({target:"Array",proto:!0},{includes:function(e){return Mb(this,e,arguments.length>1?arguments[1]:void 0)}}),jb("includes");var Bb=Oa,Gb=Pm,Nb=oe,qb=Ha,Fb=Lm,Vb=ae("".indexOf);Bb({target:"String",proto:!0,forced:!Fb("includes")},{includes:function(e){return!!~Vb(qb(Nb(this)),qb(Gb(e)),arguments.length>1?arguments[1]:void 0)}});var Wb=Va,Kb=pt,Hb=ae,zb=fv,$b=Tm,Qb=lt,Yb=oe,Jb=Ih,Xb=Bv,Zb=Or,ey=Ha,ty=Rt,ny=hs,ry=Av,iy=al,ay=Pe,sy=Iu.UNSUPPORTED_Y,oy=Math.min,cy=[].push,dy=Hb(/./.exec),uy=Hb(cy),ly=Hb("".slice);function hy(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function c(e){return L(r,e)}function d(e,t){return U(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new I(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),P.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(d("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],d("top.domain.from","origins");else if(0===t)n=s,d("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,d("top.domain.from","referrer"))}d("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(C(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",r.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",r.top.domain.value),d("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?C(e)?(d("partner.url.value",a),d("partner.url.from","partner-domain")):(d("partner.url.value",e),d("partner.url.from","partner-url")):(d("partner.url.value",o),d("partner.url.from","fallback"))}.bind(this)(),{get:c,print:function(e){console.log(c(e))}}}zb("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=ey(Yb(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!$b(e))return Kb(t,r,e,i);for(var a,s,o,c=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,d+"g");(a=Kb(iy,l,r))&&!((s=l.lastIndex)>u&&(uy(c,ly(r,u,a.index)),a.length>1&&a.index<r.length&&Wb(cy,c,ny(a,1)),o=a[0].length,u=s,c.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&dy(l,"")||uy(c,""):uy(c,ly(r,u)),c.length>i?ny(c,0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Kb(t,this,e,n)}:t,[function(t,n){var i=Yb(this),a=null==t?void 0:ty(t,e);return a?Kb(a,t,i,n):Kb(r,ey(i),t,n)},function(e,i){var a=Qb(this),s=ey(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var c=Jb(a,RegExp),d=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(sy?"g":"y"),l=new c(sy?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===ry(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=sy?0:f;var v,g=ry(l,sy?ly(s,f):s);if(null===g||(v=oy(Zb(l.lastIndex+(sy?f:0)),s.length))===p)f=Xb(s,f,d);else{if(uy(m,ly(s,p,f)),m.length===h)return m;for(var b=1;b<=g.length-1;b++)if(uy(m,g[b]),m.length===h)return m;f=p=v}}return uy(m,ly(s,p)),m}]}),!!ay((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),sy);var py={name:"@bygd/gd-sdk-pes",version:"1.28.21",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},fy="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==fy&&fy,my="URLSearchParams"in fy,vy="Symbol"in fy&&"iterator"in Symbol,gy="FileReader"in fy&&"Blob"in fy&&function(){try{return new Blob,!0}catch(e){return!1}}(),by="FormData"in fy,yy="ArrayBuffer"in fy;if(yy)var _y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],wy=ArrayBuffer.isView||function(e){return e&&_y.indexOf(Object.prototype.toString.call(e))>-1};function Ay(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function ky(e){return"string"!=typeof e&&(e=String(e)),e}function Ey(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return vy&&(t[Symbol.iterator]=function(){return t}),t}function xy(e){this.map={},e instanceof xy?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Dy(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Sy(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Ry(e){var t=new FileReader,n=Sy(t);return t.readAsArrayBuffer(e),n}function Ty(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Iy(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:gy&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:by&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:my&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():yy&&gy&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ty(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):yy&&(ArrayBuffer.prototype.isPrototypeOf(e)||wy(e))?this._bodyArrayBuffer=Ty(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):my&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},gy&&(this.blob=function(){var e=Dy(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Dy(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Ry)}),this.text=function(){var e=Dy(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Sy(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},by&&(this.formData=function(){return this.text().then(Cy)}),this.json=function(){return this.text().then(JSON.parse)},this}xy.prototype.append=function(e,t){e=Ay(e),t=ky(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},xy.prototype.delete=function(e){delete this.map[Ay(e)]},xy.prototype.get=function(e){return e=Ay(e),this.has(e)?this.map[e]:null},xy.prototype.has=function(e){return this.map.hasOwnProperty(Ay(e))},xy.prototype.set=function(e,t){this.map[Ay(e)]=ky(t)},xy.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},xy.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Ey(e)},xy.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Ey(e)},xy.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Ey(e)},vy&&(xy.prototype[Symbol.iterator]=xy.prototype.entries);var Oy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Py(e,t){if(!(this instanceof Py))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Py){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new xy(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new xy(t.headers)),this.method=function(e){var t=e.toUpperCase();return Oy.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Cy(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Ly(e,t){if(!(this instanceof Ly))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new xy(t.headers),this.url=t.url||"",this._initBody(e)}Py.prototype.clone=function(){return new Py(this,{body:this._bodyInit})},Iy.call(Py.prototype),Iy.call(Ly.prototype),Ly.prototype.clone=function(){return new Ly(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new xy(this.headers),url:this.url})},Ly.error=function(){var e=new Ly(null,{status:0,statusText:""});return e.type="error",e};var Uy=[301,302,303,307,308];Ly.redirect=function(e,t){if(-1===Uy.indexOf(t))throw new RangeError("Invalid status code");return new Ly(null,{status:t,headers:{location:e}})};var My=fy.DOMException;try{new My}catch(e){My=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},My.prototype=Object.create(Error.prototype),My.prototype.constructor=My}function jy(e,t){return new Promise((function(n,r){var i=new Py(e,t);if(i.signal&&i.signal.aborted)return r(new My("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new xy,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Ly(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new My("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&fy.location.href?fy.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(gy?a.responseType="blob":yy&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof xy?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,ky(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}jy.polyfill=!0,fy.fetch||(fy.fetch=jy,fy.Headers=xy,fy.Request=Py,fy.Response=Ly);var By,Gy,Ny=Array.isArray,qy=Object.prototype.toString,Fy=Ny||function(e){return!!e&&"[object Array]"==qy.call(e)},Vy=function(e){var t=Wy("object"===n(e)?e:d(e));return t&&t.version?py.version>=t.version?t:void 0:t},Wy=function(e){var n=this;if(!Fy(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},Ky=function(e){var n=this;if(!By){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Uv.topDomain,domain:Uv.parentDomain,referrer:Uv.parentURL,depth:s(),version:py.version,byloader:Uv.isTokenGameURL,isTokenGameURL:Uv.isTokenGameURL,isMasterGameURL:Uv.isMasterGameURL,isExtHostedGameURL:Uv.isExtHostedGameURL,byloaderVersion:Uv.version,tracking:Mv.userDeclinedTracking,whitelabel:Mv.whitelabelPartner,platform:u()};By=new l(r)}return By||{send:function(){t(this,n)}.bind(this)}};var Hy,zy,$y=[],Qy=function(e){$y.push(e)},Yy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Hy){e.next=4;break}return e.next=3,Jy(zy);case 3:Hy=e.sent;case 4:return e.abrupt("return",Hy);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Jy=function(e){var n=this;Gy.send("gdfw.loading",{message:"loading"}),$y=[],Qy("1"),Qy("2");var r=new hy;Qy("3");var i=r.get("partner.domain.value");Qy("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Qy("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(py.version,"&localTime=").concat((new Date).getHours())}.bind(this);Qy("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Qy("7"),new Promise(function(e){var r=this;if(t(this,n),Hy)e(Hy);else{Qy("7.1");var i=a();try{Qy("7.2");var o=s();Qy("7.3"),fetch(o).then(function(e){return t(this,r),Qy("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Qy("7.5"),n.success){var s,o,c,d,u=n.result.game;Qy("7.6");var l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:u.__t4r||{},block_exts:Vy(u.push_cuda),bloc_gard:Vy(u.bloc_gard),cookie:Vy(u.cookie),gdpr:Vy(u.gdpr),diagnostic:Vy(u.diagnostic),cmp:Vy(u.cmp),gft:Vy(u.gft)||{},sdk:Vy(u.sdk)||{},sdkfw:Vy(u.sdkfw)||{},loader:Vy(u.loader)||{},splash:Vy(u.splash)||{},promo:Vy(u.promo)||{},dAds:Vy(u.dads)||{},pAds:Vy(u.pads)||{},mAds:Vy(u.mads)||{},rAds:Vy(u.rads)||{},lp:Vy(u.lp)||{},extsc:Vy(u.extsc)||{},evnts:Vy(u.evnts)||{},dp:Vy(u.dp)||{}};Qy("7.7");var p=h(M(i),l);Qy("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(c=o.afg)||void 0===c?void 0:c.enabled),function(){t(this,a)}.bind(this),Qy("7.9"),null!==(d=p.pAds)&&void 0!==d&&d.enabled&&(p.preroll=!0),Qy("7.10"),Gy.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=$y[$y.length-1];Gy.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=$y[$y.length-1];Gy.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var c=$y[$y.length-1];Gy.send("gdfw.err",{message:"".concat(c,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},Xy=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yy();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zy=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yy();case 2:return n=e.sent,e.next=5,Xy();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),e_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yy();case 2:return c=e.sent,d=!(null==c||null===(t=c.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:d,path:d?null==c||null===(n=c.extsc)||void 0===n?void 0:n.path:"",name:d?null==c||null===(i=c.extsc)||void 0===i?void 0:i.name:"",ref:d?null==c||null===(a=c.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:d?null==c||null===(s=c.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!d&&!(null==c||null===(o=c.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),t_=function(){var n=e(r.mark((function e(){var n,i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,e_();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,c),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),n_=!1,r_=!1,i_=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n_){e.next=4;break}return e.abrupt("return",n(r_));case 4:n_=!0;case 5:return e.next=7,e_();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return r_=!0,e.abrupt("return",n(!0));case 16:c=!0,setTimeout(function(){t(this,u),c&&(c=!1,n_=!0,n(!1))}.bind(this),5e3),d=setInterval(function(){t(this,u),c&&o&&window[s]?(c=!1,n_=!0,r_=!0,clearInterval(d),n(!0)):c||clearInterval(d)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},a_=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),h("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),h("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),h("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),h("cancelAd")}.bind(this),o=function(){return t(this,n),h("openConsole")}.bind(this),c=function(){return t(this,n),h("showBanner")}.bind(this),d=function(){return t(this,n),h("session")}.bind(this),u=function(e){return t(this,n),h("sendGenericEvent",{options:e})}.bind(this),l=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),h=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),p=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&m(r)}),!1)}.bind(this),f=function(){t(this,n),p(),h("init")}.bind(this),m=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:c,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:d,onEvent:m,init:f,_sendSDKReady:l,sendGenericEvent:u}}(e);return n.init(),n},s_=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},o_=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},c_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return t=e.sent,n=!t,e.next=6,o_(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=s_(),s=a.isMasterGameURL,o=s(),e.next=13,Zy();case 13:return c=e.sent,d=!1,d=c?!o&&!!i:!o,e.abrupt("return",d);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),d_=Je,u_=ae,l_=La,h_=Ri,p_=u_(Ai.f),f_=u_([].push),m_=function(e){return function(t){for(var n,r=h_(t),i=l_(r),a=i.length,s=0,o=[];a>s;)n=i[s++],d_&&!p_(r,n)||f_(o,e?[n,r[n]]:r[n]);return o}},v_={entries:m_(!0),values:m_(!1)}.values;Oa({target:"Object",stat:!0},{values:function(e){return v_(e)}});var g_=Oa,b_=eh,y_=Pe,__=ke,w_=ye,A_=Ih,k_=Np,E_=Ye.exports;if(g_({target:"Promise",proto:!0,real:!0,forced:!!b_&&y_((function(){b_.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=A_(this,__("Promise")),n=w_(e);return this.then(n?function(n){return k_(t,e()).then((function(){return n}))}:e,n?function(n){return k_(t,e()).then((function(){throw n}))}:e)}}),w_(b_)){var x_=__("Promise").prototype.finally;b_.prototype.finally!==x_&&E_(b_.prototype,"finally",x_,{unsafe:!0})}var D_=oe,S_=Ha,R_=ae("".replace),T_="[\t\n\v\f\r                 \u2028\u2029\ufeff]",I_=RegExp("^"+T_+T_+"*"),O_=RegExp(T_+T_+"*$"),P_=function(e){return function(t){var n=S_(D_(t));return 1&e&&(n=R_(n,I_,"")),2&e&&(n=R_(n,O_,"")),n}},C_={start:P_(1),end:P_(2),trim:P_(3)},L_=Gn.PROPER,U_=Pe,M_="\t\n\v\f\r                 \u2028\u2029\ufeff",j_=C_.trim;Oa({target:"String",proto:!0,forced:function(e){return U_((function(){return!!M_[e]()||"​…᠎"!=="​…᠎"[e]()||L_&&M_[e].name!==e}))}("trim")},{trim:function(){return j_(this)}});var B_=ye,G_=et,N_=ru,q_=Je,F_=K,V_=ae,W_=ka,K_=function(e,t,n){var r,i;return N_&&B_(r=t.constructor)&&r!==n&&G_(i=r.prototype)&&i!==n.prototype&&N_(e,i),e},H_=Zt,z_=Xe.f,$_=Bi.f,Q_=ft,Y_=Tm,J_=Ha,X_=Tu,Z_=Iu,ew=Ye.exports,tw=Pe,nw=pe,rw=Cn.enforce,iw=oh,aw=Uu,sw=Bu,ow=ze("match"),cw=F_.RegExp,dw=cw.prototype,uw=F_.SyntaxError,lw=V_(X_),hw=V_(dw.exec),pw=V_("".charAt),fw=V_("".replace),mw=V_("".indexOf),vw=V_("".slice),gw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,bw=/a/g,yw=/a/g,_w=new cw(bw)!==bw,ww=Z_.UNSUPPORTED_Y,Aw=q_&&(!_w||ww||aw||sw||tw((function(){return yw[ow]=!1,cw(bw)!=bw||cw(yw)==yw||"/a/i"!=cw(bw,"i")})));if(W_("RegExp",Aw)){for(var kw=function(e,t){var n,r,i,a,s,o,c=Q_(dw,this),d=Y_(e),u=void 0===t,l=[],h=e;if(!c&&d&&u&&e.constructor===kw)return e;if((d||Q_(dw,e))&&(e=e.source,u&&(t="flags"in h?h.flags:lw(h))),e=void 0===e?"":J_(e),t=void 0===t?"":J_(t),h=e,aw&&"dotAll"in bw&&(r=!!t&&mw(t,"s")>-1)&&(t=fw(t,/s/g,"")),n=t,ww&&"sticky"in bw&&(i=!!t&&mw(t,"y")>-1)&&(t=fw(t,/y/g,"")),sw&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,c=!1,d=0,u="";r<=n;r++){if("\\"===(t=pw(e,r)))t+=pw(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:hw(gw,vw(e,r+1))&&(r+=2,c=!0),i+=t,d++;continue;case">"===t&&c:if(""===u||nw(s,u))throw new uw("Invalid capture group name");s[u]=!0,a[a.length]=[u,d],c=!1,u="";continue}c?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=K_(cw(e,t),c?this:dw,kw),(r||i||l.length)&&(o=rw(s),r&&(o.dotAll=!0,o.raw=kw(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=pw(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+pw(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{H_(s,"source",""===h?"(?:)":h)}catch(e){}return s},Ew=function(e){e in kw||z_(kw,e,{configurable:!0,get:function(){return cw[e]},set:function(t){cw[e]=t}})},xw=$_(cw),Dw=0;xw.length>Dw;)Ew(xw[Dw++]);dw.constructor=kw,kw.prototype=dw,ew(F_,"RegExp",kw)}iw("RegExp");var Sw=Oa,Rw=ui.find,Tw=Il,Iw=!0;"find"in[]&&Array(1).find((function(){Iw=!1})),Sw({target:"Array",proto:!0,forced:Iw},{find:function(e){return Rw(this,e,arguments.length>1?arguments[1]:void 0)}}),Tw("find");var Ow=Oa,Pw=xr,Cw=Ri,Lw=hi,Uw=ae([].join),Mw=Pw!=Object,jw=Lw("join",",");Ow({target:"Array",proto:!0,forced:Mw||!jw},{join:function(e){return Uw(Cw(this),void 0===e?",":e)}});var Bw=ui.map;Oa({target:"Array",proto:!0,forced:!Yo("map")},{map:function(e){return Bw(this,e,arguments.length>1?arguments[1]:void 0)}});var Gw=Je,Nw=ae,qw=pt,Fw=Pe,Vw=La,Ww=ra,Kw=Ai,Hw=ue,zw=xr,$w=Object.assign,Qw=Object.defineProperty,Yw=Nw([].concat),Jw=!$w||Fw((function(){if(Gw&&1!==$w({b:1},$w(Qw({},"a",{enumerable:!0,get:function(){Qw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=$w({},e)[n]||Vw($w({},t)).join("")!=r}))?function(e,t){for(var n=Hw(e),r=arguments.length,i=1,a=Ww.f,s=Kw.f;r>i;)for(var o,c=zw(arguments[i++]),d=a?Yw(Vw(c),a(c)):Vw(c),u=d.length,l=0;u>l;)o=d[l++],Gw&&!qw(s,c,o)||(n[o]=c[o]);return n}:$w,Xw=Jw;Oa({target:"Object",stat:!0,forced:Object.assign!==Xw},{assign:Xw});var Zw=function(){function e(t){S(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new I(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),eA=function(){function e(t,n){S(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),tA=function(e){if(!e)return!1;var t=nA.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},nA=Object.prototype.toString;function rA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function aA(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function sA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cA=new q,dA=null,uA=function(){function n(e,r,i){var a=this;if(S(this,n),dA)return dA;dA=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:c,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,c,d,u,l,p,A,k,E,x,D,P,C,L,U,q,F,V;return T(n,[{key:"start",value:(V=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){t(this,n),this.eventBus.broadcast(e,{message:"",status:"success"})}.bind(this),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(0),new Error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,d,u,l,h,p,f,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],c=Math.floor(Math.random()*o.length),d=o[c],s({url:d}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,u=a.nextAdPosition(n),console.log("GD-SDK Position",u),a.eventBus.broadcast("AD_REQUEST",{message:u}),l=a.options,"preroll"===u&&B(l.preroll)?l=l.preroll:"midroll"===u&&B(l.midroll)?l=l.midroll:"rewarded"===u&&B(l.rewarded)&&(l=l.rewarded),h="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",e.next=17,window.idhb.isLoaded();case 17:if(p={tnl_keys:oA(oA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&B(l.retry_on_success)&&B(l.retry_on_success.vast))){e.next=22;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 22:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&B(l.retry_on_failure.vast))){e.next=26;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 26:if(!B(l.vast)){e.next=28;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 28:return e.next=30,a._create_dp_context(u,i);case 30:f=e.sent,console.log("GD-SDK Before HB..."),window.idhb.requestAds({slots:R({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),console.log("GD-SDK After HB..."),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:oA(oA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=38;break;case 35:throw e.prev=35,e.t0=e.catch(8),new Error(e.t0);case 38:case"end":return e.stop()}}),e,this,[[8,35]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===v.Rewarded)return this.adRewardedCount++,"rewarded";if(e===v.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===v.Rewarded?"rewarded":e===v.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,s=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var o=new google.ima.AdsRequest,c=this._transformVast(e,n),d=oA(oA({},n),{},{adTag:c,tnl_ad_pos:s});this.adCounter[s]=this.adCounter[s]||0,this.adCounter[s]++;var u=e.dp,l=e.hl;if(u&&(u.adtag_url=c.url,this._extend_dp_with_adsense(u,l,null==e?void 0:e.tnl_keys)),this._isVMAP(s)){var h=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new I(e.adtag_url_1,!0);a.query=iA(iA({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new I(e.adtag_url_2,!0);o.query=iA(iA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var c=o.toString(),d=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(aA({id:d++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(d++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(aA({id:d++,adtag_url:c,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:u,adtag:c,position:"preroll"===d.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(s)}));o.adsResponse=h}else if(u&&l.bidFloorApplied){var p=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);o.adsResponse=p}else if(u&&u.fallback_url){var f=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(u);o.adsResponse=f}else o.adTagUrl=c.url;o.linearAdSlotWidth=this.options.width,o.linearAdSlotHeight=this.options.height,o.nonLinearAdSlotWidth=this.options.width,o.nonLinearAdSlotHeight=this.options.height,o.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(o.vastLoadTimeout=this.options.vast_load_timeout),o.setAdWillAutoPlay(n.autoplayAllowed),o.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(o,d);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}i(o)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(F=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):j.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(q=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,i=t.adType,a=t.params,this.adType_=i,"promo"!==(null==a?void 0:a.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(a,i));case 5:if(i!==v.Interstitial){e.next=25;break}if(!n){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(a));case 10:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(a));case 23:case 31:e.next=34;break;case 25:if(i!==v.Rewarded){e.next=33;break}if(!(n||"ima"===(null==a?void 0:a.adapter)&&"softgames"===(null==a?void 0:a.source))){e.next=30;break}return e.abrupt("return",this._startRewardedAd(a));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==v.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==v.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new eA(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(C=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,c,d,u,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(c=i?i.containerId:null)||s("Container id is not specified"),d=document.getElementById(c),document.getElementById(c)||s("No container is found with this id - ".concat(c)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),u=i.slotId?i.slotId:"gd__banner@".concat(c),document.getElementById(u)||(l="\n .gd__banner{\n z-index: ".concat(g.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),d.appendChild(h)),(p=document.createElement("div")).id=u,p.classList.add("gd__banner"),d.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[u]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,v)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return C.apply(this,arguments)})},{key:"_startInterstitialAd",value:(P=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(oA(oA({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return P.apply(this,arguments)})},{key:"_startPromo",value:(D=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(oA(oA({},i),t),n);case 11:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(n,i){var a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,a=this.nextAdPosition(i),s=this._create_promo_context(a),o=this._requestPromo(s,oA({adType:v.Interstitial},n)),e.next=7,new Promise(function(e,n){var r=this;t(this,c);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),s=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",s,i),this.eventBus.subscribe("AD_ERROR",s,i),cA.once("AD_ERROR",function(e){t(this,r),s(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",o);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Interstitial,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(i,oA({adType:v.Interstitial},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(oA(oA({},i),n));case 13:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Rewarded,n);case 6:e.t0=e.sent;case 7:return i=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(i,oA({adType:v.Rewarded},n));case 11:return a=e.sent,e.next=14,new Promise(function(e,n){var r=this;t(this,s);var i="videoad.preloadad";this.eventBus.unsubscribeScope(i);var a=function(n){t(this,r),this.eventBus.unsubscribeScope(i),e(n.message)}.bind(this),o=function(e){t(this,r),this.eventBus.unsubscribeScope(i),n(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,i),this.eventBus.subscribe("AD_SDK_CANCELED",o,i),this.eventBus.subscribe("AD_ERROR",o,i)}.bind(this));case 14:return e.abrupt("return",a);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=Vy(this.gameData.__t4r)||{};var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this.eventBus.broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=g.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){t(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),c=i.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(c)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),a=n.getMonth(),s=n.getFullYear(),o=b(google.ima.AdEvent.Type,e.type),c=!1,d=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",u=!d.startsWith("image")&&!d.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:c=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:c=this._is_completed(e.getAd()),l="Fired when the ad completes playing.",this.adType_===v.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",c=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:u&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",u&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:c=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:c=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==o&&""!==l&&this.eventBus.broadcast(o,{name:o,message:l,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(a," y").concat(s)}}),c&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);cA.emit("AD_ERROR",r),this.eventBus.broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(tA(e.getInnerError)){var t=e.getInnerError();if(t)return tA(t.getErrorCode)&&tA(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];B(s)&&(i.query[a]=G.stringify(s))}var o=new I(i.url,!0);return N(o.query,i.query||{}),oA({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new I(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new I(e.url,!0);if(a.query.cust_params){var s=G.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&B(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&B(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=M(a),B(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var c=G.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var d in c){new RegExp(a.cust_params.$$remove,"i").test(d)&&delete c[d]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=c,N(s,u),s.cust_params=G.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var c,d=Math.random()<o;return a&&d&&(null===(c=e.t4r[a])||void 0===c?void 0:c.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,c,d,u,l,h,p,f,m;if(!e)return!1;var v="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(c=this.gameData)||void 0===c||null===(d=c.mAds)||void 0===d||null===(u=d.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):v}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,c=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:c}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,c;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(c=o.pAds)||void 0===c?void 0:c.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Zw(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(O.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(O.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,c="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),d=o?c:void 0;return function(){t(this,r)}.bind(this),{promo_url:d,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,c,d,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:c={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(d=new Zw(a.gameData).checkCustomParams())&&(c.cp=d),u=encodeURIComponent(O.encode(JSON.stringify(c))),l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&!0!==(null==i?void 0:i.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(u,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(u),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(u),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 18:case"end":return e.stop()}}),e,this,[[0,14]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new I(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=G.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=G.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(u=e(r.mark((function e(n){var i,a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,d),window.idhb.requestAds}.bind(this)});case 8:s=y("ch",window.location.href),o=y("ch_date",window.location.href),c={tnl_content_category:this.category.toLowerCase()},s&&(c.channel=s),o&&(c.ch_date=o),window.idhb.setAdserverTargeting(c),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,d);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_ima_script",value:(d=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_afg_script",value:(c=e(r.mark((function e(n){var i,a,s,o,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,c),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,c,d,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,u)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),c=function(e){t(this,u),e()}.bind(this),d=function(e){t(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),n={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:c,adBreakDone:d},window.adsbygoogle.push(n),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var n}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,a)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"preroll",adBreakDone:i},window.adsbygoogle.push(n),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var n}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),n={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){t(this,o)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),n={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(n),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var n}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(O.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===v.Rewarded)t="reward";else if(n===v.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),n}(),lA=function t(n){var i=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Em(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",c=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},Am(this.moduleName,this.moduleConfig)},hA=function t(n){var i=this;S(this,t),R(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Em(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",c=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:c},Am(this.moduleName,this.moduleConfig)},pA=function(e,t){console.log(e,t)},fA={},mA={},vA=null;function gA(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return fA.version=r,fA.frame=e,fA.function=n,fA.version}function bA(e){var n=this;return vA||(vA=new Promise(function(r){function i(t,n){if(pA("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:fA,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),gA(),fA.frame?2===fA.version?(pA("TCF v2 CMP found. Fetching the consent."),fA.function?(pA("CMP API is directly accessible, calling it now..."),fA.function("addEventListener",fA.version,i)):(pA("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==mA[r.callId]&&mA[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var c=Math.random()+"",d="".concat(a,"Call"),u=R({},d,{command:e,parameter:o,callId:c,version:r});mA[c]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,fA.version,r)}("addEventListener",fA.frame,i))):r({result:"cmpVersionNotV2",cmp:fA}):r({result:"cmpNotFound"})}.bind(this)),vA)}var yA=new(function(){function t(){S(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,c,d;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,c="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(c,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(d,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function _A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return wA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function wA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var AA=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var c=this;t(this,n);try{var d=document.createElement("script");if(d.async=null==s||s,d.type="text/javascript",d.onload=function(){t(this,c),e()}.bind(this),d.onerror=function(){t(this,c);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),d.src=r,i){var u,l=_A(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;d.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(d)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},kA=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,AA({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,AA({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,AA({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),EA=new q,xA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(xA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=xA[i][a];s&&EA.emit(s,r)}}),!1);var SA=F(),RA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:SA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){OA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",OA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=SA,OA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},TA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=IA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},IA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},OA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function PA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function CA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PA(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var LA,UA=null,MA=null,jA=function(){function n(e){var r=this;if(S(this,n),UA)return UA;UA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new hy,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&RA(this._gameData)}.bind(this)),this._registerSGBridge()}var d,g,b,y,w,R,P,C,L,U,j,B;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(B=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new hy,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,kA();case 6:case"end":return e.stop()}}),e,this)}))),function(){return B.apply(this,arguments)})},{key:"testConsent",value:function(){try{gA();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,bA({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;EA.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(j=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return t(this,s),console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return j.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=M(e);this.options=t?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=py.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(G.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=c("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:s(),version:py.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:u(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),MA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&MA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),yA.track(MA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=MA)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&yA.track(MA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(py.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(G.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(L=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new uA(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=py,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(C=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Yy();case 2:return t=e.sent,this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"_createSplash",value:(P=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(CA(CA({},this.options),{},{isConsentDomain:i,version:py.version}),n,this._parentDomain),e.next=6,e_();case 6:o=e.sent,c=o.enabled,s.on("playClick",function(){var e=this;if(t(this,d),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),c?window.gdsdk.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,d),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,d),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(R=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(CA(CA({},this.options),{},{isConsentDomain:i,version:py.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,d),c.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,c,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(c=new o(CA(CA({},this.options),{},{isConsentDomain:i,version:py.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,d),c.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(v.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(y=e(r.mark((function n(i){var a,s=this,o=arguments;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:{},n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,o){var c,d,u,l,h,p,f,m,v,g,b=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d={adType:i,params:a,adTimestamp:s.adRequestTimer},e.next=4,s.sdkReady;case 4:return u=e.sent,e.next=7,s.videoAdReady;case 7:return null!==(c=s._gameData.lp)&&void 0!==c&&c.load||s._sendLoadedEvent(),s._sendGamedockGamePlay(),s._rejectAdIfGameBlocked({gameData:u,adRequest:d}),s._rejectAdIfAdDisabled({gameData:u,adRequest:d}),s._rejectAdIfUnsupportedType({adRequest:d}),s._rejectAdIfRewardedDisabled({gameData:u,adRequest:d}),null!=a&&a.isGift||s._rejectAdIfAdRateHits({gameData:u,adRequest:d}),s.adInstance.attachAfgPosition(d),s._attachAfgFallback({gameData:u,adRequest:d}),l="main.showad",h=function(e){var n,r,i;t(this,b),s.eventBus.unsubscribeScope(l),s.onResumeGame(e.message,"warning"),null!=u&&null!==(n=u.gft)&&void 0!==n&&n.enabled&&(null==u||null===(r=u.gft)||void 0===r||null===(i=r.durations[s._giftCount])||void 0===i?void 0:i.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),o(e.message)}.bind(this),p=function(e){var r,i,a;t(this,b),s.eventBus.unsubscribeScope(l),s.adRequestTimer=Date.now(),s.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=u&&null!==(r=u.gft)&&void 0!==r&&r.enabled&&(null==u||null===(i=u.gft)||void 0===i||null===(a=i.durations[s._giftCount])||void 0===a?void 0:a.after)===s.adInstance.adMidrollCount&&s.decideToGiveAGift(),n(e.message)}.bind(this),f=function(e){var r=this;t(this,b),s.eventBus.unsubscribeScope(l),a.fallback_adsense=!1,s.showAd(i,CA(CA({},a),{},{adapter:"adsense"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),m=function(e){var r=this;t(this,b),s.eventBus.unsubscribeScope(l),a.fallback_adsense=!1,s.showAd(i,CA(CA({},a),{},{adapter:"promo"})).then(function(e){t(this,r),n(e)}.bind(this)).catch(function(e){t(this,r),o(e)}.bind(this))}.bind(this),v=function(){var e,n,r;t(this,b);var i=!("promo"===(null==a?void 0:a.adapter)||("reward"!==(null==a?void 0:a.position)||u.afg_disabled)&&"adsense"!==(null==a?void 0:a.adapter)),s=null===(e=u.promo)||void 0===e||null===(n=e.rainbow)||void 0===n?void 0:n.enabled,o=null===(r=u.promo)||void 0===r?void 0:r.onadsense,c="reward"===(null==a?void 0:a.position);return i&&s&&o&&c?m:null!=a&&a.fallback_adsense?f:h}.bind(this),g=v(),s.eventBus.subscribe("AD_ERROR",function(e){t(this,b),g(e)}.bind(this),l),s.eventBus.subscribe("AD_SDK_CANCELED",g,l),s.eventBus.subscribe("AD_SUCCESS",p,l),console.log("GD-SDK Ad Start Invoked..."),e.next=29,s.adInstance.startAd(d);case 29:s._post_message({topic:"adrequest.instream"}),e.next=36;break;case 32:e.prev=32,e.t0=e.catch(0),s.onResumeGame(e.t0.message,"warning"),o(e.t0.message);case 36:case"end":return e.stop()}}),e,this,[[0,32]])})));return function(e,t){return n.apply(this,arguments)}}()));case 2:case"end":return n.stop()}}),n)}))),function(e){return y.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==v.Interstitial&&t.adType!==v.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=v.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===v.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,c=e.adRequest,d=null;c.adType===v.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(d=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):d=o.midroll;if(c.adType===v.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<d)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(b=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=v.Rewarded,e.next=16;break;case 14:if(n===v.Interstitial||n===v.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==v.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return b.apply(this,arguments)})},{key:"cancelAd",value:(g=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||TA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||TA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new D(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var c=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:i()),d=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===s()?d:o()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:c,parentDomain:d,topDomain:u&&u.length?u:d,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:y,depth:s(),domainMatched:d===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new I(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new I(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new I(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(O.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new hA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(d=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new lA(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return d.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(O.encode(JSON.stringify(e)))}catch(e){}try{var n=new I(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(G.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new I(e,!0);return n.query=CA(CA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return O.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)MA.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning?console.log("Advertisement already running..."):(n.showAd(v.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),BA={},GA=function(e){try{if(e.skipForward)return;if(BA.source){var t={type:"gd-sdk-on-event",event:e};BA.source.postMessage(t,BA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},NA=function(){GA({name:"SDK_READY",status:"success",message:"Everything is ready."}),GA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),GA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},qA=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,c=a.type,d=a.method,u=a.options;if("gd-sdk-self"!==c){if("gd-sdk"===c){if(!BA.source&&"init"===d)return function(e){var t=e.source,n=e.origin;BA={source:t,origin:n}}({source:o,origin:s}),void NA();var l=n[d];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===d&&Ba.firstAdapterModeAdsense&&"rewarded"!==u.adType&&(console.log("promo-test, set first adapter to adssense 3"),u.params=u.params?u.params:{},u.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(u)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:d,options:u};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},FA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){GA(e),t.apply(this,arguments)}}(e);var t=new jA(e);return qA(t),t},VA=function(e){try{var t=Ky(e);e.gameId||t.send("nogameid",{message:"".concat(Uv.parentURL)})}catch(e){}},WA={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,VA(t),Gy=Ky(zy=t),e.next=5,c_();case 5:return n=e.sent,i=n?a_(t):FA(t),t_(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",FA(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function KA(){return(KA=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i_();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,zA(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var HA=!1;function zA(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),LA)return r(LA);if(HA)var s=setInterval(function(){t(this,a),LA&&(HA=!1,clearInterval(s),r(LA))}.bind(this),100);else HA=!0,WA.create(e).then(function(e){t(this,a),LA=e,e._sendSDKReady(),HA=!1,r(LA)}.bind(this))}.bind(this))}var $A,QA=(zA($A=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return KA.apply(this,arguments)}($A,e)}});function YA(){var n=this;this.AdType=v,this.preloadAd=function(e){var n=this;return QA.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",QA.invoke(function(e){var r=this;if(t(this,a),n===v.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return QA.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return QA.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return QA.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.sendEvent=function(e){var n=this;return QA.invoke(function(r){return t(this,n),r.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){t(this,n),xm.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),xm.addScore(e)}.bind(this)}}YA.prototype=new function(){this.showBanner=function(){var e=this;return QA.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new YA,window.gdApi=window.gdsdk;
1
+ import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/newArrowCheck";import n from"@babel/runtime/helpers/typeof";import r from"@babel/runtime/regenerator";import{parseJSON as i,getParentUrl as a,getParentDomain as s,getIframeDepth as o,getTopDomain as d,getQueryParams as c,getMobilePlatform as u,MessageRouter as l,extendDefaults as h,dankLog as p,getScript as f,Ls as m,AdType as v,Layers as g,getKeyByValue as b,getQueryString as y,EventBus as _,getIMASampleTags as w,SDKEvents as A,IMAEvents as k,Macros as E,setDankLog as x,ImplementationTest as R}from"@bygd/gd-sdk-era/dist/default";import S from"@babel/runtime/helpers/classCallCheck";import D from"@babel/runtime/helpers/defineProperty";import T from"@babel/runtime/helpers/createClass";import O from"url-parse";import{Base64 as I}from"js-base64";import P from"validator";import C from"is-valid-domain";import L from"get-value";import U from"set-value";import j from"lodash.clonedeep";import M from"can-autoplay";import{isPlainObject as G}from"is-plain-object";import N from"querystringify";import B from"lodash.merge";import{EventEmitter as F}from"events";import{v4 as q}from"uuid";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=function(e){return e&&e.Math==Math&&e},H=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof V&&V)||function(){return this}()||Function("return this")(),z={exports:{}},K=H,$=Object.defineProperty,Q=function(e,t){try{$(K,e,{value:t,configurable:!0,writable:!0})}catch(n){K[e]=t}return t},Y=Q,J=H["__core-js_shared__"]||Y("__core-js_shared__",{}),X=J;(z.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Z,ee,te=Function.prototype,ne=te.bind,re=te.call,ie=ne&&ne.bind(re),ae=ne?function(e){return e&&ie(re,e)}:function(e){return e&&function(){return re.apply(e,arguments)}},se=H.TypeError,oe=function(e){if(null==e)throw se("Can't call method on "+e);return e},de=oe,ce=H.Object,ue=function(e){return ce(de(e))},le=ue,he=ae({}.hasOwnProperty),pe=Object.hasOwn||function(e,t){return he(le(e),t)},fe=ae,me=0,ve=Math.random(),ge=fe(1..toString),be=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ge(++me+ve,36)},ye=function(e){return"function"==typeof e},_e=H,we=ye,Ae=function(e){return we(e)?e:void 0},ke=function(e,t){return arguments.length<2?Ae(_e[e]):_e[e]&&_e[e][t]},Ee=ke("navigator","userAgent")||"",xe=H,Re=Ee,Se=xe.process,De=xe.Deno,Te=Se&&Se.versions||De&&De.version,Oe=Te&&Te.v8;Oe&&(ee=(Z=Oe.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!ee&&Re&&(!(Z=Re.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=Re.match(/Chrome\/(\d+)/))&&(ee=+Z[1]);var Ie=ee,Pe=function(e){try{return!!e()}catch(e){return!0}},Ce=Ie,Le=Pe,Ue=!!Object.getOwnPropertySymbols&&!Le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ce&&Ce<41})),je=Ue&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Me=H,Ge=z.exports,Ne=pe,Be=be,Fe=Ue,qe=je,Ve=Ge("wks"),We=Me.Symbol,He=We&&We.for,ze=qe?We:We&&We.withoutSetter||Be,Ke=function(e){if(!Ne(Ve,e)||!Fe&&"string"!=typeof Ve[e]){var t="Symbol."+e;Fe&&Ne(We,e)?Ve[e]=We[e]:Ve[e]=qe&&He?He(t):ze(t)}return Ve[e]},$e={};$e[Ke("toStringTag")]="z";var Qe="[object z]"===String($e),Ye={exports:{}},Je=!Pe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Xe={},Ze=ye,et=function(e){return"object"==typeof e?null!==e:Ze(e)},tt=et,nt=H.document,rt=tt(nt)&&tt(nt.createElement),it=function(e){return rt?nt.createElement(e):{}},at=it,st=!Je&&!Pe((function(){return 7!=Object.defineProperty(at("div"),"a",{get:function(){return 7}}).a})),ot=H,dt=et,ct=ot.String,ut=ot.TypeError,lt=function(e){if(dt(e))return e;throw ut(ct(e)+" is not an object")},ht=Function.prototype.call,pt=ht.bind?ht.bind(ht):function(){return ht.apply(ht,arguments)},ft=ae({}.isPrototypeOf),mt=ke,vt=ye,gt=ft,bt=je,yt=H.Object,_t=bt?function(e){return"symbol"==typeof e}:function(e){var t=mt("Symbol");return vt(t)&&gt(t.prototype,yt(e))},wt=H.String,At=function(e){try{return wt(e)}catch(e){return"Object"}},kt=ye,Et=At,xt=H.TypeError,Rt=function(e){if(kt(e))return e;throw xt(Et(e)+" is not a function")},St=Rt,Dt=function(e,t){var n=e[t];return null==n?void 0:St(n)},Tt=pt,Ot=ye,It=et,Pt=H.TypeError,Ct=pt,Lt=et,Ut=_t,jt=Dt,Mt=function(e,t){var n,r;if("string"===t&&Ot(n=e.toString)&&!It(r=Tt(n,e)))return r;if(Ot(n=e.valueOf)&&!It(r=Tt(n,e)))return r;if("string"!==t&&Ot(n=e.toString)&&!It(r=Tt(n,e)))return r;throw Pt("Can't convert object to primitive value")},Gt=Ke,Nt=H.TypeError,Bt=Gt("toPrimitive"),Ft=function(e,t){if(!Lt(e)||Ut(e))return e;var n,r=jt(e,Bt);if(r){if(void 0===t&&(t="default"),n=Ct(r,e,t),!Lt(n)||Ut(n))return n;throw Nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Mt(e,t)},qt=_t,Vt=function(e){var t=Ft(e,"string");return qt(t)?t:t+""},Wt=Je,Ht=st,zt=lt,Kt=Vt,$t=H.TypeError,Qt=Object.defineProperty;Xe.f=Wt?Qt:function(e,t,n){if(zt(e),t=Kt(t),zt(n),Ht)try{return Qt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw $t("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Yt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Jt=Xe,Xt=Yt,Zt=Je?function(e,t,n){return Jt.f(e,t,Xt(1,n))}:function(e,t,n){return e[t]=n,e},en=ye,tn=J,nn=ae(Function.toString);en(tn.inspectSource)||(tn.inspectSource=function(e){return nn(e)});var rn,an,sn,on=tn.inspectSource,dn=ye,cn=on,un=H.WeakMap,ln=dn(un)&&/native code/.test(cn(un)),hn=z.exports,pn=be,fn=hn("keys"),mn=function(e){return fn[e]||(fn[e]=pn(e))},vn={},gn=ln,bn=H,yn=ae,_n=et,wn=Zt,An=pe,kn=J,En=mn,xn=vn,Rn=bn.TypeError,Sn=bn.WeakMap;if(gn||kn.state){var Dn=kn.state||(kn.state=new Sn),Tn=yn(Dn.get),On=yn(Dn.has),In=yn(Dn.set);rn=function(e,t){if(On(Dn,e))throw new Rn("Object already initialized");return t.facade=e,In(Dn,e,t),t},an=function(e){return Tn(Dn,e)||{}},sn=function(e){return On(Dn,e)}}else{var Pn=En("state");xn[Pn]=!0,rn=function(e,t){if(An(e,Pn))throw new Rn("Object already initialized");return t.facade=e,wn(e,Pn,t),t},an=function(e){return An(e,Pn)?e[Pn]:{}},sn=function(e){return An(e,Pn)}}var Cn={set:rn,get:an,has:sn,enforce:function(e){return sn(e)?an(e):rn(e,{})},getterFor:function(e){return function(t){var n;if(!_n(t)||(n=an(t)).type!==e)throw Rn("Incompatible receiver, "+e+" required");return n}}},Ln=Je,Un=pe,jn=Function.prototype,Mn=Ln&&Object.getOwnPropertyDescriptor,Gn=Un(jn,"name"),Nn={EXISTS:Gn,PROPER:Gn&&"something"===function(){}.name,CONFIGURABLE:Gn&&(!Ln||Ln&&Mn(jn,"name").configurable)},Bn=H,Fn=ye,qn=pe,Vn=Zt,Wn=Q,Hn=on,zn=Nn.CONFIGURABLE,Kn=Cn.get,$n=Cn.enforce,Qn=String(String).split("String");(Ye.exports=function(e,t,n,r){var i,a=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;Fn(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!qn(n,"name")||zn&&n.name!==d)&&Vn(n,"name",d),(i=$n(n)).source||(i.source=Qn.join("string"==typeof d?d:""))),e!==Bn?(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Vn(e,t,n)):s?e[t]=n:Wn(t,n)})(Function.prototype,"toString",(function(){return Fn(this)&&Kn(this).source||Hn(this)}));var Yn=ae,Jn=Yn({}.toString),Xn=Yn("".slice),Zn=function(e){return Xn(Jn(e),8,-1)},er=H,tr=Qe,nr=ye,rr=Zn,ir=Ke("toStringTag"),ar=er.Object,sr="Arguments"==rr(function(){return arguments}()),or=tr?rr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=ar(e),ir))?n:sr?rr(t):"Object"==(r=rr(t))&&nr(t.callee)?"Arguments":r},dr=or,cr=Qe?{}.toString:function(){return"[object "+dr(this)+"]"},ur=Qe,lr=Ye.exports,hr=cr;ur||lr(Object.prototype,"toString",hr,{unsafe:!0});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fr=it("span").classList,mr=fr&&fr.constructor&&fr.constructor.prototype,vr=mr===Object.prototype?void 0:mr,gr=Rt,br=ae(ae.bind),yr=function(e,t){return gr(e),void 0===t?e:br?br(e,t):function(){return e.apply(t,arguments)}},_r=ae,wr=Pe,Ar=Zn,kr=H.Object,Er=_r("".split),xr=wr((function(){return!kr("z").propertyIsEnumerable(0)}))?function(e){return"String"==Ar(e)?Er(e,""):kr(e)}:kr,Rr=Math.ceil,Sr=Math.floor,Dr=function(e){var t=+e;return t!=t||0===t?0:(t>0?Sr:Rr)(t)},Tr=Dr,Or=Math.min,Ir=function(e){return e>0?Or(Tr(e),9007199254740991):0},Pr=Ir,Cr=function(e){return Pr(e.length)},Lr=Zn,Ur=Array.isArray||function(e){return"Array"==Lr(e)},jr=ae,Mr=Pe,Gr=ye,Nr=or,Br=on,Fr=function(){},qr=[],Vr=ke("Reflect","construct"),Wr=/^\s*(?:class|function)\b/,Hr=jr(Wr.exec),zr=!Wr.exec(Fr),Kr=function(e){if(!Gr(e))return!1;try{return Vr(Fr,qr,e),!0}catch(e){return!1}},$r=!Vr||Mr((function(){var e;return Kr(Kr.call)||!Kr(Object)||!Kr((function(){e=!0}))||e}))?function(e){if(!Gr(e))return!1;switch(Nr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return zr||!!Hr(Wr,Br(e))}:Kr,Qr=H,Yr=Ur,Jr=$r,Xr=et,Zr=Ke("species"),ei=Qr.Array,ti=function(e){var t;return Yr(e)&&(t=e.constructor,(Jr(t)&&(t===ei||Yr(t.prototype))||Xr(t)&&null===(t=t[Zr]))&&(t=void 0)),void 0===t?ei:t},ni=function(e,t){return new(ti(e))(0===t?0:t)},ri=yr,ii=xr,ai=ue,si=Cr,oi=ni,di=ae([].push),ci=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,a=6==e,s=7==e,o=5==e||a;return function(d,c,u,l){for(var h,p,f=ai(d),m=ii(f),v=ri(c,u),g=si(m),b=0,y=l||oi,_=t?y(d,g):n||s?y(d,0):void 0;g>b;b++)if((o||b in m)&&(p=v(h=m[b],b,f),e))if(t)_[b]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return b;case 2:di(_,h)}else switch(e){case 4:return!1;case 7:di(_,h)}return a?-1:r||i?i:_}},ui={forEach:ci(0),map:ci(1),filter:ci(2),some:ci(3),every:ci(4),find:ci(5),findIndex:ci(6),filterReject:ci(7)},li=Pe,hi=function(e,t){var n=[][e];return!!n&&li((function(){n.call(null,t||function(){throw 1},1)}))},pi=ui.forEach,fi=H,mi=pr,vi=vr,gi=hi("forEach")?[].forEach:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)},bi=Zt,yi=function(e){if(e&&e.forEach!==gi)try{bi(e,"forEach",gi)}catch(t){e.forEach=gi}};for(var _i in mi)mi[_i]&&yi(fi[_i]&&fi[_i].prototype);yi(vi);var wi={},Ai={},ki={}.propertyIsEnumerable,Ei=Object.getOwnPropertyDescriptor,xi=Ei&&!ki.call({1:2},1);Ai.f=xi?function(e){var t=Ei(this,e);return!!t&&t.enumerable}:ki;var Ri=xr,Si=oe,Di=function(e){return Ri(Si(e))},Ti=Je,Oi=pt,Ii=Ai,Pi=Yt,Ci=Di,Li=Vt,Ui=pe,ji=st,Mi=Object.getOwnPropertyDescriptor;wi.f=Ti?Mi:function(e,t){if(e=Ci(e),t=Li(t),ji)try{return Mi(e,t)}catch(e){}if(Ui(e,t))return Pi(!Oi(Ii.f,e,t),e[t])};var Gi={},Ni=Dr,Bi=Math.max,Fi=Math.min,qi=function(e,t){var n=Ni(e);return n<0?Bi(n+t,0):Fi(n,t)},Vi=Di,Wi=qi,Hi=Cr,zi=function(e){return function(t,n,r){var i,a=Vi(t),s=Hi(a),o=Wi(r,s);if(e&&n!=n){for(;s>o;)if((i=a[o++])!=i)return!0}else for(;s>o;o++)if((e||o in a)&&a[o]===n)return e||o||0;return!e&&-1}},Ki={includes:zi(!0),indexOf:zi(!1)},$i=pe,Qi=Di,Yi=Ki.indexOf,Ji=vn,Xi=ae([].push),Zi=function(e,t){var n,r=Qi(e),i=0,a=[];for(n in r)!$i(Ji,n)&&$i(r,n)&&Xi(a,n);for(;t.length>i;)$i(r,n=t[i++])&&(~Yi(a,n)||Xi(a,n));return a},ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ta=Zi,na=ea.concat("length","prototype");Gi.f=Object.getOwnPropertyNames||function(e){return ta(e,na)};var ra={};ra.f=Object.getOwnPropertySymbols;var ia=ke,aa=Gi,sa=ra,oa=lt,da=ae([].concat),ca=ia("Reflect","ownKeys")||function(e){var t=aa.f(oa(e)),n=sa.f;return n?da(t,n(e)):t},ua=pe,la=ca,ha=wi,pa=Xe,fa=function(e,t){for(var n=la(t),r=pa.f,i=ha.f,a=0;a<n.length;a++){var s=n[a];ua(e,s)||r(e,s,i(t,s))}},ma=Pe,va=ye,ga=/#|\.prototype\./,ba=function(e,t){var n=_a[ya(e)];return n==Aa||n!=wa&&(va(t)?ma(t):!!t)},ya=ba.normalize=function(e){return String(e).replace(ga,".").toLowerCase()},_a=ba.data={},wa=ba.NATIVE="N",Aa=ba.POLYFILL="P",ka=ba,Ea=H,xa=wi.f,Ra=Zt,Sa=Ye.exports,Da=Q,Ta=fa,Oa=ka,Ia=function(e,t){var n,r,i,a,s,o=e.target,d=e.global,c=e.stat;if(n=d?Ea:c?Ea[o]||Da(o,{}):(Ea[o]||{}).prototype)for(r in t){if(a=t[r],i=e.noTargetGet?(s=xa(n,r))&&s.value:n[r],!Oa(d?r:o+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ta(a,i)}(e.sham||i&&i.sham)&&Ra(a,"sham",!0),Sa(n,r,a,e)}},Pa=Zi,Ca=ea,La=Object.keys||function(e){return Pa(e,Ca)},Ua=ue,ja=La;Ia({target:"Object",stat:!0,forced:Pe((function(){ja(1)}))},{keys:function(e){return ja(Ua(e))}});var Ma=Array.isArray,Ga=Object.prototype.toString,Na=Ma||function(e){return!!e&&"[object Array]"==Ga.call(e)},Ba={name:"@bygd/gd-sdk-pes",version:"1.29.1",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.6",axios:"^0.26.1","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7",uuid:"^8.3.2",validator:"^13.6.0"}},Fa=function(e){var t=qa("object"===n(e)?e:i(e));return t&&t.version?Ba.version>=t.version?t:void 0:t},qa=function(e){var n=this;if(!Na(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){t(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var i=Math.floor(Math.random()*Math.floor(r));r=0;for(var a=0;a<e.length;a++){var s=e[a];if(i<(r+=s.weight))return s}},Va=function(){var e;(e=console).log.apply(e,arguments)},Wa=function(){var e;(e=console).log.apply(e,arguments)};JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima","adsense"],midroll:["ima","adsense","ima","adsense"],rewarded:["ima","adsense","ima","adsense"]}}),JSON.stringify({adapters:{default:["ima","adsense","ima","adsense"],preroll:["ima","adsense","ima"],midroll:["ima","adsense","ima"],rewarded:["ima","adsense","ima","adsense"]}});var Ha,za={},Ka=Function.prototype,$a=Ka.apply,Qa=Ka.bind,Ya=Ka.call,Ja="object"==typeof Reflect&&Reflect.apply||(Qa?Ya.bind($a):function(){return Ya.apply($a,arguments)}),Xa=or,Za=H.String,es=function(e){if("Symbol"===Xa(e))throw TypeError("Cannot convert a Symbol value to a string");return Za(e)},ts=Xe,ns=lt,rs=Di,is=La,as=Je?Object.defineProperties:function(e,t){ns(e);for(var n,r=rs(t),i=is(t),a=i.length,s=0;a>s;)ts.f(e,n=i[s++],r[n]);return e},ss=ke("document","documentElement"),os=lt,ds=as,cs=ea,us=vn,ls=ss,hs=it,ps=mn("IE_PROTO"),fs=function(){},ms=function(e){return"<script>"+e+"<\/script>"},vs=function(e){e.write(ms("")),e.close();var t=e.parentWindow.Object;return e=null,t},gs=function(){try{Ha=new ActiveXObject("htmlfile")}catch(e){}var e,t;gs="undefined"!=typeof document?document.domain&&Ha?vs(Ha):((t=hs("iframe")).style.display="none",ls.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ms("document.F=Object")),e.close(),e.F):vs(Ha);for(var n=cs.length;n--;)delete gs.prototype[cs[n]];return gs()};us[ps]=!0;var bs=Object.create||function(e,t){var n;return null!==e?(fs.prototype=os(e),n=new fs,fs.prototype=null,n[ps]=e):n=gs(),void 0===t?n:ds(n,t)},ys={},_s=ae([].slice),ws=Zn,As=Di,ks=Gi.f,Es=_s,xs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ys.f=function(e){return xs&&"Window"==ws(e)?function(e){try{return ks(e)}catch(e){return Es(xs)}}(e):ks(As(e))};var Rs={},Ss=Ke;Rs.f=Ss;var Ds=H,Ts=pe,Os=Rs,Is=Xe.f,Ps=function(e){var t=Ds.Symbol||(Ds.Symbol={});Ts(t,e)||Is(t,e,{value:Os.f(e)})},Cs=Xe.f,Ls=pe,Us=Ke("toStringTag"),js=function(e,t,n){e&&!Ls(e=n?e:e.prototype,Us)&&Cs(e,Us,{configurable:!0,value:t})},Ms=Ia,Gs=H,Ns=ke,Bs=Ja,Fs=pt,Vs=ae,Ws=Je,Hs=Ue,zs=Pe,Ks=pe,$s=Ur,Qs=ye,Ys=et,Js=ft,Xs=_t,Zs=lt,eo=ue,to=Di,no=Vt,ro=es,io=Yt,ao=bs,so=La,oo=Gi,co=ys,uo=ra,lo=wi,ho=Xe,po=Ai,fo=_s,mo=Ye.exports,vo=z.exports,go=vn,bo=be,yo=Ke,_o=Rs,wo=Ps,Ao=js,ko=Cn,Eo=ui.forEach,xo=mn("hidden"),Ro=yo("toPrimitive"),So=ko.set,Do=ko.getterFor("Symbol"),To=Object.prototype,Oo=Gs.Symbol,Io=Oo&&Oo.prototype,Po=Gs.TypeError,Co=Gs.QObject,Lo=Ns("JSON","stringify"),Uo=lo.f,jo=ho.f,Mo=co.f,Go=po.f,No=Vs([].push),Bo=vo("symbols"),Fo=vo("op-symbols"),qo=vo("string-to-symbol-registry"),Vo=vo("symbol-to-string-registry"),Wo=vo("wks"),Ho=!Co||!Co.prototype||!Co.prototype.findChild,zo=Ws&&zs((function(){return 7!=ao(jo({},"a",{get:function(){return jo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Uo(To,t);r&&delete To[t],jo(e,t,n),r&&e!==To&&jo(To,t,r)}:jo,Ko=function(e,t){var n=Bo[e]=ao(Io);return So(n,{type:"Symbol",tag:e,description:t}),Ws||(n.description=t),n},$o=function(e,t,n){e===To&&$o(Fo,t,n),Zs(e);var r=no(t);return Zs(n),Ks(Bo,r)?(n.enumerable?(Ks(e,xo)&&e[xo][r]&&(e[xo][r]=!1),n=ao(n,{enumerable:io(0,!1)})):(Ks(e,xo)||jo(e,xo,io(1,{})),e[xo][r]=!0),zo(e,r,n)):jo(e,r,n)},Qo=function(e,t){Zs(e);var n=to(t),r=so(n).concat(Zo(n));return Eo(r,(function(t){Ws&&!Fs(Yo,n,t)||$o(e,t,n[t])})),e},Yo=function(e){var t=no(e),n=Fs(Go,this,t);return!(this===To&&Ks(Bo,t)&&!Ks(Fo,t))&&(!(n||!Ks(this,t)||!Ks(Bo,t)||Ks(this,xo)&&this[xo][t])||n)},Jo=function(e,t){var n=to(e),r=no(t);if(n!==To||!Ks(Bo,r)||Ks(Fo,r)){var i=Uo(n,r);return!i||!Ks(Bo,r)||Ks(n,xo)&&n[xo][r]||(i.enumerable=!0),i}},Xo=function(e){var t=Mo(to(e)),n=[];return Eo(t,(function(e){Ks(Bo,e)||Ks(go,e)||No(n,e)})),n},Zo=function(e){var t=e===To,n=Mo(t?Fo:to(e)),r=[];return Eo(n,(function(e){!Ks(Bo,e)||t&&!Ks(To,e)||No(r,Bo[e])})),r};(Hs||(mo(Io=(Oo=function(){if(Js(Io,this))throw Po("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ro(arguments[0]):void 0,t=bo(e),n=function(e){this===To&&Fs(n,Fo,e),Ks(this,xo)&&Ks(this[xo],t)&&(this[xo][t]=!1),zo(this,t,io(1,e))};return Ws&&Ho&&zo(To,t,{configurable:!0,set:n}),Ko(t,e)}).prototype,"toString",(function(){return Do(this).tag})),mo(Oo,"withoutSetter",(function(e){return Ko(bo(e),e)})),po.f=Yo,ho.f=$o,lo.f=Jo,oo.f=co.f=Xo,uo.f=Zo,_o.f=function(e){return Ko(yo(e),e)},Ws&&(jo(Io,"description",{configurable:!0,get:function(){return Do(this).description}}),mo(To,"propertyIsEnumerable",Yo,{unsafe:!0}))),Ms({global:!0,wrap:!0,forced:!Hs,sham:!Hs},{Symbol:Oo}),Eo(so(Wo),(function(e){wo(e)})),Ms({target:"Symbol",stat:!0,forced:!Hs},{for:function(e){var t=ro(e);if(Ks(qo,t))return qo[t];var n=Oo(t);return qo[t]=n,Vo[n]=t,n},keyFor:function(e){if(!Xs(e))throw Po(e+" is not a symbol");if(Ks(Vo,e))return Vo[e]},useSetter:function(){Ho=!0},useSimple:function(){Ho=!1}}),Ms({target:"Object",stat:!0,forced:!Hs,sham:!Ws},{create:function(e,t){return void 0===t?ao(e):Qo(ao(e),t)},defineProperty:$o,defineProperties:Qo,getOwnPropertyDescriptor:Jo}),Ms({target:"Object",stat:!0,forced:!Hs},{getOwnPropertyNames:Xo,getOwnPropertySymbols:Zo}),Ms({target:"Object",stat:!0,forced:zs((function(){uo.f(1)}))},{getOwnPropertySymbols:function(e){return uo.f(eo(e))}}),Lo)&&Ms({target:"JSON",stat:!0,forced:!Hs||zs((function(){var e=Oo();return"[null]"!=Lo([e])||"{}"!=Lo({a:e})||"{}"!=Lo(Object(e))}))},{stringify:function(e,t,n){var r=fo(arguments),i=t;if((Ys(t)||void 0!==e)&&!Xs(e))return $s(t)||(t=function(e,t){if(Qs(i)&&(t=Fs(i,this,e,t)),!Xs(t))return t}),r[1]=t,Bs(Lo,null,r)}});if(!Io[Ro]){var ed=Io.valueOf;mo(Io,Ro,(function(e){return Fs(ed,this)}))}Ao(Oo,"Symbol"),go[xo]=!0;var td=Pe,nd=Ie,rd=Ke("species"),id=function(e){return nd>=51||!td((function(){var t=[];return(t.constructor={})[rd]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ad=ui.filter;Ia({target:"Array",proto:!0,forced:!id("filter")},{filter:function(e){return ad(this,e,arguments.length>1?arguments[1]:void 0)}});var sd=Ia,od=Pe,dd=Di,cd=wi.f,ud=Je,ld=od((function(){cd(1)}));sd({target:"Object",stat:!0,forced:!ud||ld,sham:!ud},{getOwnPropertyDescriptor:function(e,t){return cd(dd(e),t)}});var hd=Vt,pd=Xe,fd=Yt,md=function(e,t,n){var r=hd(t);r in e?pd.f(e,r,fd(0,n)):e[r]=n},vd=ca,gd=Di,bd=wi,yd=md;Ia({target:"Object",stat:!0,sham:!Je},{getOwnPropertyDescriptors:function(e){for(var t,n,r=gd(e),i=bd.f,a=vd(r),s={},o=0;a.length>o;)void 0!==(n=i(r,t=a[o++]))&&yd(s,t,n);return s}});var _d=Ia,wd=H,Ad=Ur,kd=$r,Ed=et,xd=qi,Rd=Cr,Sd=Di,Dd=md,Td=Ke,Od=_s,Id=id("slice"),Pd=Td("species"),Cd=wd.Array,Ld=Math.max;_d({target:"Array",proto:!0,forced:!Id},{slice:function(e,t){var n,r,i,a=Sd(this),s=Rd(a),o=xd(e,s),d=xd(void 0===t?s:t,s);if(Ad(a)&&(n=a.constructor,(kd(n)&&(n===Cd||Ad(n.prototype))||Ed(n)&&null===(n=n[Pd]))&&(n=void 0),n===Cd||void 0===n))return Od(a,o,d);for(r=new(void 0===n?Cd:n)(Ld(d-o,0)),i=0;o<d;o++,i++)o in a&&Dd(r,i,a[o]);return r.length=i,r}});var Ud=pt,jd=lt,Md=Dt,Gd=function(e,t,n){var r,i;jd(e);try{if(!(r=Md(e,"return"))){if("throw"===t)throw n;return n}r=Ud(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return jd(r),n},Nd=lt,Bd=Gd,Fd={},qd=Fd,Vd=Ke("iterator"),Wd=Array.prototype,Hd=function(e){return void 0!==e&&(qd.Array===e||Wd[Vd]===e)},zd=or,Kd=Dt,$d=Fd,Qd=Ke("iterator"),Yd=function(e){if(null!=e)return Kd(e,Qd)||Kd(e,"@@iterator")||$d[zd(e)]},Jd=pt,Xd=Rt,Zd=lt,ec=At,tc=Yd,nc=H.TypeError,rc=function(e,t){var n=arguments.length<2?tc(e):t;if(Xd(n))return Zd(Jd(n,e));throw nc(ec(e)+" is not iterable")},ic=yr,ac=pt,sc=ue,oc=function(e,t,n,r){try{return r?t(Nd(n)[0],n[1]):t(n)}catch(t){Bd(e,"throw",t)}},dc=Hd,cc=$r,uc=Cr,lc=md,hc=rc,pc=Yd,fc=H.Array,mc=Ke("iterator"),vc=!1;try{var gc=0,bc={next:function(){return{done:!!gc++}},return:function(){vc=!0}};bc[mc]=function(){return this},Array.from(bc,(function(){throw 2}))}catch(e){}var yc=function(e,t){if(!t&&!vc)return!1;var n=!1;try{var r={};r[mc]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},_c=function(e){var t=sc(e),n=cc(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=ic(i,r>2?arguments[2]:void 0));var s,o,d,c,u,l,h=pc(t),p=0;if(!h||this==fc&&dc(h))for(s=uc(t),o=n?new this(s):fc(s);s>p;p++)l=a?i(t[p],p):t[p],lc(o,p,l);else for(u=(c=hc(t,h)).next,o=n?new this:[];!(d=ac(u,c)).done;p++)l=a?oc(c,i,[d.value,p],!0):d.value,lc(o,p,l);return o.length=p,o};Ia({target:"Array",stat:!0,forced:!yc((function(e){Array.from(e)}))},{from:_c});var wc,Ac,kc,Ec=ae,xc=Dr,Rc=es,Sc=oe,Dc=Ec("".charAt),Tc=Ec("".charCodeAt),Oc=Ec("".slice),Ic=function(e){return function(t,n){var r,i,a=Rc(Sc(t)),s=xc(n),o=a.length;return s<0||s>=o?e?"":void 0:(r=Tc(a,s))<55296||r>56319||s+1===o||(i=Tc(a,s+1))<56320||i>57343?e?Dc(a,s):r:e?Oc(a,s,s+2):i-56320+(r-55296<<10)+65536}},Pc={codeAt:Ic(!1),charAt:Ic(!0)},Cc=!Pe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Lc=H,Uc=pe,jc=ye,Mc=ue,Gc=Cc,Nc=mn("IE_PROTO"),Bc=Lc.Object,Fc=Bc.prototype,qc=Gc?Bc.getPrototypeOf:function(e){var t=Mc(e);if(Uc(t,Nc))return t[Nc];var n=t.constructor;return jc(n)&&t instanceof n?n.prototype:t instanceof Bc?Fc:null},Vc=Pe,Wc=ye,Hc=qc,zc=Ye.exports,Kc=Ke("iterator"),$c=!1;[].keys&&("next"in(kc=[].keys())?(Ac=Hc(Hc(kc)))!==Object.prototype&&(wc=Ac):$c=!0);var Qc=null==wc||Vc((function(){var e={};return wc[Kc].call(e)!==e}));Qc&&(wc={}),Wc(wc[Kc])||zc(wc,Kc,(function(){return this}));var Yc={IteratorPrototype:wc,BUGGY_SAFARI_ITERATORS:$c},Jc=Yc.IteratorPrototype,Xc=bs,Zc=Yt,eu=js,tu=Fd,nu=function(){return this},ru=function(e,t,n){var r=t+" Iterator";return e.prototype=Xc(Jc,{next:Zc(1,n)}),eu(e,r,!1),tu[r]=nu,e},iu=H,au=ye,su=iu.String,ou=iu.TypeError,du=ae,cu=lt,uu=function(e){if("object"==typeof e||au(e))return e;throw ou("Can't set "+su(e)+" as a prototype")},lu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=du(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return cu(n),uu(r),t?e(n,r):n.__proto__=r,n}}():void 0),hu=Ia,pu=pt,fu=Nn,mu=ye,vu=ru,gu=qc,bu=lu,yu=js,_u=Zt,wu=Ye.exports,Au=Fd,ku=fu.PROPER,Eu=fu.CONFIGURABLE,xu=Yc.IteratorPrototype,Ru=Yc.BUGGY_SAFARI_ITERATORS,Su=Ke("iterator"),Du=function(){return this},Tu=function(e,t,n,r,i,a,s){vu(n,t,r);var o,d,c,u=function(e){if(e===i&&m)return m;if(!Ru&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Su]||p["@@iterator"]||i&&p[i],m=!Ru&&f||u(i),v="Array"==t&&p.entries||f;if(v&&(o=gu(v.call(new e)))!==Object.prototype&&o.next&&(gu(o)!==xu&&(bu?bu(o,xu):mu(o[Su])||wu(o,Su,Du)),yu(o,l,!0)),ku&&"values"==i&&f&&"values"!==f.name&&(Eu?_u(p,"name","values"):(h=!0,m=function(){return pu(f,this)})),i)if(d={values:u("values"),keys:a?m:u("keys"),entries:u("entries")},s)for(c in d)(Ru||h||!(c in p))&&wu(p,c,d[c]);else hu({target:t,proto:!0,forced:Ru||h},d);return p[Su]!==m&&wu(p,Su,m,{name:i}),Au[t]=m,d},Ou=Pc.charAt,Iu=es,Pu=Cn,Cu=Tu,Lu=Pu.set,Uu=Pu.getterFor("String Iterator");Cu(String,"String",(function(e){Lu(this,{type:"String Iterator",string:Iu(e),index:0})}),(function(){var e,t=Uu(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Ou(n,r),t.index+=e.length,{value:e,done:!1})}));var ju=lt,Mu=function(){var e=ju(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Gu={},Nu=Pe,Bu=H.RegExp;Gu.UNSUPPORTED_Y=Nu((function(){var e=Bu("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Gu.BROKEN_CARET=Nu((function(){var e=Bu("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Fu=Pe,qu=H.RegExp,Vu=Fu((function(){var e=qu(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Wu=Pe,Hu=H.RegExp,zu=Wu((function(){var e=Hu("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ku=pt,$u=ae,Qu=es,Yu=Mu,Ju=Gu,Xu=z.exports,Zu=bs,el=Cn.get,tl=Vu,nl=zu,rl=Xu("native-string-replace",String.prototype.replace),il=RegExp.prototype.exec,al=il,sl=$u("".charAt),ol=$u("".indexOf),dl=$u("".replace),cl=$u("".slice),ul=function(){var e=/a/,t=/b*/g;return Ku(il,e,"a"),Ku(il,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ll=Ju.UNSUPPORTED_Y||Ju.BROKEN_CARET,hl=void 0!==/()??/.exec("")[1];(ul||hl||ll||tl||nl)&&(al=function(e){var t,n,r,i,a,s,o,d=this,c=el(d),u=Qu(e),l=c.raw;if(l)return l.lastIndex=d.lastIndex,t=Ku(al,l,u),d.lastIndex=l.lastIndex,t;var h=c.groups,p=ll&&d.sticky,f=Ku(Yu,d),m=d.source,v=0,g=u;if(p&&(f=dl(f,"y",""),-1===ol(f,"g")&&(f+="g"),g=cl(u,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==sl(u,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",f)),hl&&(n=new RegExp("^"+m+"$(?!\\s)",f)),ul&&(r=d.lastIndex),i=Ku(il,p?n:d,g),p?i?(i.input=cl(i.input,v),i[0]=cl(i[0],v),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:ul&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),hl&&i&&i.length>1&&Ku(rl,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=s=Zu(null),a=0;a<h.length;a++)s[(o=h[a])[0]]=i[o[1]];return i});var pl=al;Ia({target:"RegExp",proto:!0,forced:/./.exec!==pl},{exec:pl});var fl=Ia,ml=Je,vl=H,gl=ae,bl=pe,yl=ye,_l=ft,wl=es,Al=Xe.f,kl=fa,El=vl.Symbol,xl=El&&El.prototype;if(ml&&yl(El)&&(!("description"in xl)||void 0!==El().description)){var Rl={},Sl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:wl(arguments[0]),t=_l(xl,this)?new El(e):void 0===e?El():El(e);return""===e&&(Rl[t]=!0),t};kl(Sl,El),Sl.prototype=xl,xl.constructor=Sl;var Dl="Symbol(test)"==String(El("test")),Tl=gl(xl.toString),Ol=gl(xl.valueOf),Il=/^Symbol\((.*)\)[^)]+$/,Pl=gl("".replace),Cl=gl("".slice);Al(xl,"description",{configurable:!0,get:function(){var e=Ol(this),t=Tl(e);if(bl(Rl,e))return"";var n=Dl?Cl(t,7,-1):Pl(t,Il,"$1");return""===n?void 0:n}}),fl({global:!0,forced:!0},{Symbol:Sl})}Ps("iterator");var Ll=bs,Ul=Xe,jl=Ke("unscopables"),Ml=Array.prototype;null==Ml[jl]&&Ul.f(Ml,jl,{configurable:!0,value:Ll(null)});var Gl=function(e){Ml[jl][e]=!0},Nl=Di,Bl=Gl,Fl=Fd,ql=Cn,Vl=Tu,Wl=ql.set,Hl=ql.getterFor("Array Iterator"),zl=Vl(Array,"Array",(function(e,t){Wl(this,{type:"Array Iterator",target:Nl(e),index:0,kind:t})}),(function(){var e=Hl(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Fl.Arguments=Fl.Array,Bl("keys"),Bl("values"),Bl("entries");var Kl=H,$l=pr,Ql=vr,Yl=zl,Jl=Zt,Xl=Ke,Zl=Xl("iterator"),eh=Xl("toStringTag"),th=Yl.values,nh=function(e,t){if(e){if(e[Zl]!==th)try{Jl(e,Zl,th)}catch(t){e[Zl]=th}if(e[eh]||Jl(e,eh,t),$l[t])for(var n in Yl)if(e[n]!==Yl[n])try{Jl(e,n,Yl[n])}catch(t){e[n]=Yl[n]}}};for(var rh in $l)nh(Kl[rh]&&Kl[rh].prototype,rh);nh(Ql,"DOMTokenList");var ih,ah,sh,oh,dh=H.Promise,ch=Ye.exports,uh=function(e,t,n){for(var r in t)ch(e,r,t[r],n);return e},lh=ke,hh=Xe,ph=Je,fh=Ke("species"),mh=function(e){var t=lh(e),n=hh.f;ph&&t&&!t[fh]&&n(t,fh,{configurable:!0,get:function(){return this}})},vh=ft,gh=H.TypeError,bh=function(e,t){if(vh(t,e))return e;throw gh("Incorrect invocation")},yh=yr,_h=pt,wh=lt,Ah=At,kh=Hd,Eh=Cr,xh=ft,Rh=rc,Sh=Yd,Dh=Gd,Th=H.TypeError,Oh=function(e,t){this.stopped=e,this.result=t},Ih=Oh.prototype,Ph=$r,Ch=At,Lh=H.TypeError,Uh=lt,jh=function(e){if(Ph(e))return e;throw Lh(Ch(e)+" is not a constructor")},Mh=Ke("species"),Gh=function(e,t){var n,r=Uh(e).constructor;return void 0===r||null==(n=Uh(r)[Mh])?t:jh(n)},Nh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ee),Bh="process"==Zn(H.process),Fh=H,qh=Ja,Vh=yr,Wh=ye,Hh=pe,zh=Pe,Kh=ss,$h=_s,Qh=it,Yh=Nh,Jh=Bh,Xh=Fh.setImmediate,Zh=Fh.clearImmediate,ep=Fh.process,tp=Fh.Dispatch,np=Fh.Function,rp=Fh.MessageChannel,ip=Fh.String,ap=0,sp={};try{ih=Fh.location}catch(e){}var op=function(e){if(Hh(sp,e)){var t=sp[e];delete sp[e],t()}},dp=function(e){return function(){op(e)}},cp=function(e){op(e.data)},up=function(e){Fh.postMessage(ip(e),ih.protocol+"//"+ih.host)};Xh&&Zh||(Xh=function(e){var t=$h(arguments,1);return sp[++ap]=function(){qh(Wh(e)?e:np(e),void 0,t)},ah(ap),ap},Zh=function(e){delete sp[e]},Jh?ah=function(e){ep.nextTick(dp(e))}:tp&&tp.now?ah=function(e){tp.now(dp(e))}:rp&&!Yh?(oh=(sh=new rp).port2,sh.port1.onmessage=cp,ah=Vh(oh.postMessage,oh)):Fh.addEventListener&&Wh(Fh.postMessage)&&!Fh.importScripts&&ih&&"file:"!==ih.protocol&&!zh(up)?(ah=up,Fh.addEventListener("message",cp,!1)):ah="onreadystatechange"in Qh("script")?function(e){Kh.appendChild(Qh("script")).onreadystatechange=function(){Kh.removeChild(this),op(e)}}:function(e){setTimeout(dp(e),0)});var lp,hp,pp,fp,mp,vp,gp,bp,yp={set:Xh,clear:Zh},_p=H,wp=/ipad|iphone|ipod/i.test(Ee)&&void 0!==_p.Pebble,Ap=/web0s(?!.*chrome)/i.test(Ee),kp=H,Ep=yr,xp=wi.f,Rp=yp.set,Sp=Nh,Dp=wp,Tp=Ap,Op=Bh,Ip=kp.MutationObserver||kp.WebKitMutationObserver,Pp=kp.document,Cp=kp.process,Lp=kp.Promise,Up=xp(kp,"queueMicrotask"),jp=Up&&Up.value;jp||(lp=function(){var e,t;for(Op&&(e=Cp.domain)&&e.exit();hp;){t=hp.fn,hp=hp.next;try{t()}catch(e){throw hp?fp():pp=void 0,e}}pp=void 0,e&&e.enter()},Sp||Op||Tp||!Ip||!Pp?!Dp&&Lp&&Lp.resolve?((gp=Lp.resolve(void 0)).constructor=Lp,bp=Ep(gp.then,gp),fp=function(){bp(lp)}):Op?fp=function(){Cp.nextTick(lp)}:(Rp=Ep(Rp,kp),fp=function(){Rp(lp)}):(mp=!0,vp=Pp.createTextNode(""),new Ip(lp).observe(vp,{characterData:!0}),fp=function(){vp.data=mp=!mp}));var Mp=jp||function(e){var t={fn:e,next:void 0};pp&&(pp.next=t),hp||(hp=t,fp()),pp=t},Gp={},Np=Rt,Bp=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Np(t),this.reject=Np(n)};Gp.f=function(e){return new Bp(e)};var Fp,qp,Vp,Wp,Hp=lt,zp=et,Kp=Gp,$p=function(e,t){if(Hp(e),zp(t)&&t.constructor===e)return t;var n=Kp.f(e);return(0,n.resolve)(t),n.promise},Qp=H,Yp="object"==typeof window,Jp=Ia,Xp=H,Zp=ke,ef=pt,tf=dh,nf=Ye.exports,rf=uh,af=lu,sf=js,of=mh,df=Rt,cf=ye,uf=et,lf=bh,hf=on,pf=function(e,t,n){var r,i,a,s,o,d,c,u=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=yh(t,u),m=function(e){return r&&Dh(r,"normal",e),new Oh(!0,e)},v=function(e){return l?(wh(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if(!(i=Sh(e)))throw Th(Ah(e)+" is not iterable");if(kh(i)){for(a=0,s=Eh(e);s>a;a++)if((o=v(e[a]))&&xh(Ih,o))return o;return new Oh(!1)}r=Rh(e,i)}for(d=r.next;!(c=_h(d,r)).done;){try{o=v(c.value)}catch(e){Dh(r,"throw",e)}if("object"==typeof o&&o&&xh(Ih,o))return o}return new Oh(!1)},ff=yc,mf=Gh,vf=yp.set,gf=Mp,bf=$p,yf=function(e,t){var n=Qp.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},_f=Gp,wf=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Af=Cn,kf=ka,Ef=Yp,xf=Bh,Rf=Ie,Sf=Ke("species"),Df=Af.get,Tf=Af.set,Of=Af.getterFor("Promise"),If=tf&&tf.prototype,Pf=tf,Cf=If,Lf=Xp.TypeError,Uf=Xp.document,jf=Xp.process,Mf=_f.f,Gf=Mf,Nf=!!(Uf&&Uf.createEvent&&Xp.dispatchEvent),Bf=cf(Xp.PromiseRejectionEvent),Ff=!1,qf=kf("Promise",(function(){var e=hf(Pf),t=e!==String(Pf);if(!t&&66===Rf)return!0;if(Rf>=51&&/native code/.test(e))return!1;var n=new Pf((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Sf]=r,!(Ff=n.then((function(){}))instanceof r)||!t&&Ef&&!Bf})),Vf=qf||!ff((function(e){Pf.all(e).catch((function(){}))})),Wf=function(e){var t;return!(!uf(e)||!cf(t=e.then))&&t},Hf=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;gf((function(){for(var r=e.value,i=1==e.state,a=0;n.length>a;){var s,o,d,c=n[a++],u=i?c.ok:c.fail,l=c.resolve,h=c.reject,p=c.domain;try{u?(i||(2===e.rejection&&Qf(e),e.rejection=1),!0===u?s=r:(p&&p.enter(),s=u(r),p&&(p.exit(),d=!0)),s===c.promise?h(Lf("Promise-chain cycle")):(o=Wf(s))?ef(o,s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Kf(e)}))}},zf=function(e,t,n){var r,i;Nf?((r=Uf.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Xp.dispatchEvent(r)):r={promise:t,reason:n},!Bf&&(i=Xp["on"+e])?i(r):"unhandledrejection"===e&&yf("Unhandled promise rejection",n)},Kf=function(e){ef(vf,Xp,(function(){var t,n=e.facade,r=e.value;if($f(e)&&(t=wf((function(){xf?jf.emit("unhandledRejection",r,n):zf("unhandledrejection",n,r)})),e.rejection=xf||$f(e)?2:1,t.error))throw t.value}))},$f=function(e){return 1!==e.rejection&&!e.parent},Qf=function(e){ef(vf,Xp,(function(){var t=e.facade;xf?jf.emit("rejectionHandled",t):zf("rejectionhandled",t,e.value)}))},Yf=function(e,t,n){return function(r){e(t,r,n)}},Jf=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Hf(e,!0))},Xf=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Lf("Promise can't be resolved itself");var r=Wf(t);r?gf((function(){var n={done:!1};try{ef(r,t,Yf(Xf,n,e),Yf(Jf,n,e))}catch(t){Jf(n,t,e)}})):(e.value=t,e.state=1,Hf(e,!1))}catch(t){Jf({done:!1},t,e)}}};if(qf&&(Cf=(Pf=function(e){lf(this,Cf),df(e),ef(Fp,this);var t=Df(this);try{e(Yf(Xf,t),Yf(Jf,t))}catch(e){Jf(t,e)}}).prototype,(Fp=function(e){Tf(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=rf(Cf,{then:function(e,t){var n=Of(this),r=n.reactions,i=Mf(mf(this,Pf));return i.ok=!cf(e)||e,i.fail=cf(t)&&t,i.domain=xf?jf.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&Hf(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),qp=function(){var e=new Fp,t=Df(e);this.promise=e,this.resolve=Yf(Xf,t),this.reject=Yf(Jf,t)},_f.f=Mf=function(e){return e===Pf||e===Vp?new qp(e):Gf(e)},cf(tf)&&If!==Object.prototype)){Wp=If.then,Ff||(nf(If,"then",(function(e,t){var n=this;return new Pf((function(e,t){ef(Wp,n,e,t)})).then(e,t)}),{unsafe:!0}),nf(If,"catch",Cf.catch,{unsafe:!0}));try{delete If.constructor}catch(e){}af&&af(If,Cf)}Jp({global:!0,wrap:!0,forced:qf},{Promise:Pf}),sf(Pf,"Promise",!1),of("Promise"),Vp=Zp("Promise"),Jp({target:"Promise",stat:!0,forced:qf},{reject:function(e){var t=Mf(this);return ef(t.reject,void 0,e),t.promise}}),Jp({target:"Promise",stat:!0,forced:qf},{resolve:function(e){return bf(this,e)}}),Jp({target:"Promise",stat:!0,forced:Vf},{all:function(e){var t=this,n=Mf(t),r=n.resolve,i=n.reject,a=wf((function(){var n=df(t.resolve),a=[],s=0,o=1;pf(e,(function(e){var d=s++,c=!1;o++,ef(n,t,e).then((function(e){c||(c=!0,a[d]=e,--o||r(a))}),i)})),--o||r(a)}));return a.error&&i(a.value),n.promise},race:function(e){var t=this,n=Mf(t),r=n.reject,i=wf((function(){var i=df(t.resolve);pf(e,(function(e){ef(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Zf=Ia,em=H,tm=Pe,nm=Ur,rm=et,im=ue,am=Cr,sm=md,om=ni,dm=id,cm=Ie,um=Ke("isConcatSpreadable"),lm=em.TypeError,hm=cm>=51||!tm((function(){var e=[];return e[um]=!1,e.concat()[0]!==e})),pm=dm("concat"),fm=function(e){if(!rm(e))return!1;var t=e[um];return void 0!==t?!!t:nm(e)};Zf({target:"Array",proto:!0,forced:!hm||!pm},{concat:function(e){var t,n,r,i,a,s=im(this),o=om(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(fm(a=-1===t?s:arguments[t])){if(d+(i=am(a))>9007199254740991)throw lm("Maximum allowed index exceeded");for(n=0;n<i;n++,d++)n in a&&sm(o,d,a[n])}else{if(d>=9007199254740991)throw lm("Maximum allowed index exceeded");sm(o,d++,a)}return o.length=d,o}});var mm=Je,vm=Nn.EXISTS,gm=ae,bm=Xe.f,ym=Function.prototype,_m=gm(ym.toString),wm=/^\s*function ([^ (]*)/,Am=gm(wm.exec);function km(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Em(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Em(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function Em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xm(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}mm&&!vm&&bm(ym,"name",{configurable:!0,get:function(){try{return Am(wm,_m(this))[1]}catch(e){return""}}});var Sm,Dm={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Tm={},Om=function(e,t){Tm[e]=Rm(Rm({},t),{},{isLoading:!1})},Im=function(e){var n=this,r=e.id,i=e.src;return new Promise(function(e,a){if(t(this,n),document.getElementById(r))e();else{var s=document.createElement("script");s.onload=function(){e()},s.id=r,s.setAttribute("crossorigin",!0),s.src=i,document.head.appendChild(s)}}.bind(this))},Pm=function(){var t=e(r.mark((function e(t){var n,i,a,s,o,d,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(i=Tm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:i.isLoading=!0,a=km(i.dependencies),e.prev=8,a.s();case 10:if((s=a.n()).done){e.next=26;break}if(o=s.value,e.prev=12,d=Dm[o].name,!window[d]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Im({id:o,src:Dm[o].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),c=o.id,u=o.src,console.log("Could not load external script ".concat(c," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,Im({id:t,src:i.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(i.source,"."),e.t2);case 43:return i.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(e){return t.apply(this,arguments)}}(),Cm=new function t(){var n=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm("Leaderboard");case 2:n.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"showLeaderboard",function(){var t=e(r.mark((function e(t){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=window.GD_OPTIONS.gameId,n.leaderboard){e.next=4;break}return e.next=4,n.load();case 4:n.leaderboard.showLeaderBoard(i,t);case 5:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),D(this,"addScore",function(){var t=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.leaderboard){e.next=3;break}return e.next=3,n.load();case 3:n.leaderboard.addScore(t);case 4:case"end":return e.stop()}}),e)})));return function(e){return t.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Om(this.moduleName,this.moduleConfig)},Lm=et,Um=Zn,jm=Ke("match"),Mm=function(e){var t;return Lm(e)&&(void 0!==(t=e[jm])?!!t:"RegExp"==Um(e))},Gm=Mm,Nm=H.TypeError,Bm=function(e){if(Gm(e))throw Nm("The method doesn't accept regular expressions");return e},Fm=Ke("match"),qm=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Fm]=!1,"/./"[e](t)}catch(e){}}return!1},Vm=Ia,Wm=ae,Hm=wi.f,zm=Ir,Km=es,$m=Bm,Qm=oe,Ym=qm,Jm=Wm("".startsWith),Xm=Wm("".slice),Zm=Math.min,ev=Ym("startsWith");Vm({target:"String",proto:!0,forced:!!(ev||(Sm=Hm(String.prototype,"startsWith"),!Sm||Sm.writable))&&!ev},{startsWith:function(e){var t=Km(Qm(this));$m(e);var n=zm(Zm(arguments.length>1?arguments[1]:void 0,t.length)),r=Km(e);return Jm?Jm(t,r,n):Xm(t,n,n+r.length)===r}});var tv=ae,nv=Nn.PROPER,rv=Ye.exports,iv=lt,av=ft,sv=es,ov=Pe,dv=Mu,cv=RegExp.prototype,uv=cv.toString,lv=tv(dv),hv=ov((function(){return"/a/b"!=uv.call({source:"a",flags:"b"})})),pv=nv&&"toString"!=uv.name;(hv||pv)&&rv(RegExp.prototype,"toString",(function(){var e=iv(this),t=sv(e.source),n=e.flags;return"/"+t+"/"+sv(void 0===n&&av(cv,e)&&!("flags"in cv)?lv(e):n)}),{unsafe:!0});var fv=ae,mv=Ye.exports,vv=pl,gv=Pe,bv=Ke,yv=Zt,_v=bv("species"),wv=RegExp.prototype,Av=function(e,t,n,r){var i=bv(e),a=!gv((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=a&&!gv((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[_v]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!a||!s||n){var o=fv(/./[i]),d=t(i,""[e],(function(e,t,n,r,i){var s=fv(e),d=t.exec;return d===vv||d===wv.exec?a&&!i?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));mv(String.prototype,e,d[0]),mv(wv,i,d[1])}r&&yv(wv[i],"sham",!0)},kv=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ev=pt,xv=lt,Rv=ye,Sv=Zn,Dv=pl,Tv=H.TypeError,Ov=function(e,t){var n=e.exec;if(Rv(n)){var r=Ev(n,e,t);return null!==r&&xv(r),r}if("RegExp"===Sv(e))return Ev(Dv,e,t);throw Tv("RegExp#exec called on incompatible receiver")},Iv=pt,Pv=lt,Cv=oe,Lv=kv,Uv=es,jv=Dt,Mv=Ov;function Gv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gv(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Av("search",(function(e,t,n){return[function(t){var n=Cv(this),r=null==t?void 0:jv(t,e);return r?Iv(r,t,n):new RegExp(t)[e](Uv(n))},function(e){var r=Pv(this),i=Uv(e),a=n(t,r,i);if(a.done)return a.value;var s=r.lastIndex;Lv(s,0)||(r.lastIndex=0);var o=Mv(r,i);return Lv(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var Bv,Fv,qv=function(){function e(){S(this,e)}return T(e,[{key:"getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),c=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?c:d()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:c,topDomain:u&&u.length?u:c,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:c===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new O(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new O(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new O(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(I.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(I.encode(JSON.stringify(e)))}catch(e){}try{var n=new O(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(qs.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new O(e,!0);return n.query=Nv(Nv({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return I.encode(JSON.stringify(e))}}]),e}(),Vv=function(){try{return(new qv).getBridgeContext()}catch(e){return{}}}(),Wv={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Bv=!1,(Fv=c("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Fv.xanthophyll&&(Bv=!0),Bv)},Hv=Pc.charAt,zv=function(e,t,n){return t+(n?Hv(e,t).length:1)},Kv=ae,$v=ue,Qv=Math.floor,Yv=Kv("".charAt),Jv=Kv("".replace),Xv=Kv("".slice),Zv=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,eg=/\$([$&'`]|\d{1,2})/g,tg=Ja,ng=pt,rg=ae,ig=Av,ag=Pe,sg=lt,og=ye,dg=Dr,cg=Ir,ug=es,lg=oe,hg=zv,pg=Dt,fg=function(e,t,n,r,i,a){var s=n+e.length,o=r.length,d=eg;return void 0!==i&&(i=$v(i),d=Zv),Jv(a,d,(function(a,d){var c;switch(Yv(d,0)){case"$":return"$";case"&":return e;case"`":return Xv(t,0,n);case"'":return Xv(t,s);case"<":c=i[Xv(d,1,-1)];break;default:var u=+d;if(0===u)return a;if(u>o){var l=Qv(u/10);return 0===l?a:l<=o?void 0===r[l-1]?Yv(d,1):r[l-1]+Yv(d,1):a}c=r[u-1]}return void 0===c?"":c}))},mg=Ov,vg=Ke("replace"),gg=Math.max,bg=Math.min,yg=rg([].concat),_g=rg([].push),wg=rg("".indexOf),Ag=rg("".slice),kg="$0"==="a".replace(/./,"$0"),Eg=!!/./[vg]&&""===/./[vg]("a","$0");ig("replace",(function(e,t,n){var r=Eg?"$":"$0";return[function(e,n){var r=lg(this),i=null==e?void 0:pg(e,vg);return i?ng(i,e,r,n):ng(t,ug(r),e,n)},function(e,i){var a=sg(this),s=ug(e);if("string"==typeof i&&-1===wg(i,r)&&-1===wg(i,"$<")){var o=n(t,a,s,i);if(o.done)return o.value}var d=og(i);d||(i=ug(i));var c=a.global;if(c){var u=a.unicode;a.lastIndex=0}for(var l=[];;){var h=mg(a,s);if(null===h)break;if(_g(l,h),!c)break;""===ug(h[0])&&(a.lastIndex=hg(s,cg(a.lastIndex),u))}for(var p,f="",m=0,v=0;v<l.length;v++){for(var g=ug((h=l[v])[0]),b=gg(bg(dg(h.index),s.length),0),y=[],_=1;_<h.length;_++)_g(y,void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=yg([g],y,b,s);void 0!==w&&_g(A,w);var k=ug(tg(i,void 0,A))}else k=fg(g,s,b,y,w,i);b>=m&&(f+=Ag(s,m,b)+k,m=b+g.length)}return f+Ag(s,m)}]}),!!ag((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!kg||Eg);var xg=Pe,Rg=Ke("iterator"),Sg=!xg((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Rg]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Dg=_s,Tg=Math.floor,Og=function(e,t){var n=e.length,r=Tg(n/2);return n<8?Ig(e,t):Pg(e,Og(Dg(e,0,r),t),Og(Dg(e,r),t),t)},Ig=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Pg=function(e,t,n,r){for(var i=t.length,a=n.length,s=0,o=0;s<i||o<a;)e[s+o]=s<i&&o<a?r(t[s],n[o])<=0?t[s++]:n[o++]:s<i?t[s++]:n[o++];return e},Cg=Og,Lg=Ia,Ug=H,jg=ke,Mg=pt,Gg=ae,Ng=Sg,Bg=Ye.exports,Fg=uh,qg=js,Vg=ru,Wg=Cn,Hg=bh,zg=ye,Kg=pe,$g=yr,Qg=or,Yg=lt,Jg=et,Xg=es,Zg=bs,eb=Yt,tb=rc,nb=Yd,rb=Cg,ib=Ke("iterator"),ab=Wg.set,sb=Wg.getterFor("URLSearchParams"),ob=Wg.getterFor("URLSearchParamsIterator"),db=jg("fetch"),cb=jg("Request"),ub=jg("Headers"),lb=cb&&cb.prototype,hb=ub&&ub.prototype,pb=Ug.RegExp,fb=Ug.TypeError,mb=Ug.decodeURIComponent,vb=Ug.encodeURIComponent,gb=Gg("".charAt),bb=Gg([].join),yb=Gg([].push),_b=Gg("".replace),wb=Gg([].shift),Ab=Gg([].splice),kb=Gg("".split),Eb=Gg("".slice),xb=/\+/g,Rb=Array(4),Sb=function(e){return Rb[e-1]||(Rb[e-1]=pb("((?:%[\\da-f]{2}){"+e+"})","gi"))},Db=function(e){try{return mb(e)}catch(t){return e}},Tb=function(e){var t=_b(e,xb," "),n=4;try{return mb(t)}catch(e){for(;n;)t=_b(t,Sb(n--),Db);return t}},Ob=/[!'()~]|%20/g,Ib={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Pb=function(e){return Ib[e]},Cb=function(e){return _b(vb(e),Ob,Pb)},Lb=function(e,t){if(t)for(var n,r,i=kb(t,"&"),a=0;a<i.length;)(n=i[a++]).length&&(r=kb(n,"="),yb(e,{key:Tb(wb(r)),value:Tb(bb(r,"="))}))},Ub=function(e){this.entries.length=0,Lb(this.entries,e)},jb=function(e,t){if(e<t)throw fb("Not enough arguments")},Mb=Vg((function(e,t){ab(this,{type:"URLSearchParamsIterator",iterator:tb(sb(e).entries),kind:t})}),"Iterator",(function(){var e=ob(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Gb=function(){Hg(this,Nb);var e,t,n,r,i,a,s,o,d,c=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(ab(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Ub}),void 0!==c)if(Jg(c))if(e=nb(c))for(n=(t=tb(c,e)).next;!(r=Mg(n,t)).done;){if(a=(i=tb(Yg(r.value))).next,(s=Mg(a,i)).done||(o=Mg(a,i)).done||!Mg(a,i).done)throw fb("Expected sequence with length 2");yb(l,{key:Xg(s.value),value:Xg(o.value)})}else for(d in c)Kg(c,d)&&yb(l,{key:d,value:Xg(c[d])});else Lb(l,"string"==typeof c?"?"===gb(c,0)?Eb(c,1):c:Xg(c))},Nb=Gb.prototype;if(Fg(Nb,{append:function(e,t){jb(arguments.length,2);var n=sb(this);yb(n.entries,{key:Xg(e),value:Xg(t)}),n.updateURL()},delete:function(e){jb(arguments.length,1);for(var t=sb(this),n=t.entries,r=Xg(e),i=0;i<n.length;)n[i].key===r?Ab(n,i,1):i++;t.updateURL()},get:function(e){jb(arguments.length,1);for(var t=sb(this).entries,n=Xg(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){jb(arguments.length,1);for(var t=sb(this).entries,n=Xg(e),r=[],i=0;i<t.length;i++)t[i].key===n&&yb(r,t[i].value);return r},has:function(e){jb(arguments.length,1);for(var t=sb(this).entries,n=Xg(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){jb(arguments.length,1);for(var n,r=sb(this),i=r.entries,a=!1,s=Xg(e),o=Xg(t),d=0;d<i.length;d++)(n=i[d]).key===s&&(a?Ab(i,d--,1):(a=!0,n.value=o));a||yb(i,{key:s,value:o}),r.updateURL()},sort:function(){var e=sb(this);rb(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=sb(this).entries,r=$g(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new Mb(this,"keys")},values:function(){return new Mb(this,"values")},entries:function(){return new Mb(this,"entries")}},{enumerable:!0}),Bg(Nb,ib,Nb.entries,{name:"entries"}),Bg(Nb,"toString",(function(){for(var e,t=sb(this).entries,n=[],r=0;r<t.length;)e=t[r++],yb(n,Cb(e.key)+"="+Cb(e.value));return bb(n,"&")}),{enumerable:!0}),qg(Gb,"URLSearchParams"),Lg({global:!0,forced:!Ng},{URLSearchParams:Gb}),!Ng&&zg(ub)){var Bb=Gg(hb.has),Fb=Gg(hb.set),qb=function(e){if(Jg(e)){var t,n=e.body;if("URLSearchParams"===Qg(n))return t=e.headers?new ub(e.headers):new ub,Bb(t,"content-type")||Fb(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Zg(e,{body:eb(0,Xg(n)),headers:eb(0,t)})}return e};if(zg(db)&&Lg({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return db(e,arguments.length>1?qb(arguments[1]):{})}}),zg(cb)){var Vb=function(e){return Hg(this,lb),new cb(e,arguments.length>1?qb(arguments[1]):{})};lb.constructor=Vb,Vb.prototype=lb,Lg({global:!0,forced:!0},{Request:Vb})}}var Wb=Ki.includes,Hb=Gl;Ia({target:"Array",proto:!0},{includes:function(e){return Wb(this,e,arguments.length>1?arguments[1]:void 0)}}),Hb("includes");var zb=Ia,Kb=Bm,$b=oe,Qb=es,Yb=qm,Jb=ae("".indexOf);zb({target:"String",proto:!0,forced:!Yb("includes")},{includes:function(e){return!!~Jb(Qb($b(this)),Qb(Kb(e)),arguments.length>1?arguments[1]:void 0)}});var Xb=Ja,Zb=pt,ey=ae,ty=Av,ny=Mm,ry=lt,iy=oe,ay=Gh,sy=zv,oy=Ir,dy=es,cy=Dt,uy=_s,ly=Ov,hy=pl,py=Pe,fy=Gu.UNSUPPORTED_Y,my=Math.min,vy=[].push,gy=ey(/./.exec),by=ey(vy),yy=ey("".slice);function _y(e){var n=this,r={},i=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,s=(null==e?void 0:e.self_origin)||window.location.origin,o=(null==e?void 0:e.referrer_url)||document.referrer;function d(e){return L(r,e)}function c(e,t){return U(r,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new O(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,o],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var s=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(s&&(s=decodeURIComponent(s),P.isURL(s)))return s}}}return function(){var e;t(this,n),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){c("depth.error",e.message)}c("depth.value",e)}(),function(){var e=i,t=r.depth.value,n=s;if(c("top.domain.from","fallback"),e&&e.length>0)n=e[e.length-1],c("top.domain.from","origins");else if(0===t)n=s,c("top.domain.from","self-top");else if(1===t){var a=u(o);a&&(n=a.origin,c("top.domain.from","referrer"))}c("top.domain.value",n.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(C(e))c("partner.domain.value",e),c("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)c("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),c("partner.domain.from","partner-url");else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","partner-fallback")}else c("partner.domain.value",r.top.domain.value),c("partner.domain.from","fallback")}(),e=l(),0===r.depth.value?(c("partner.url.value",a),c("partner.url.from","self-top")):e?C(e)?(c("partner.url.value",a),c("partner.url.from","partner-domain")):(c("partner.url.value",e),c("partner.url.from","partner-url")):(c("partner.url.value",o),c("partner.url.from","fallback"))}.bind(this)(),{get:d,print:function(e){console.log(d(e))}}}ty("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=dy(iy(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ny(e))return Zb(t,r,e,i);for(var a,s,o,d=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,c+"g");(a=Zb(hy,l,r))&&!((s=l.lastIndex)>u&&(by(d,yy(r,u,a.index)),a.length>1&&a.index<r.length&&Xb(vy,d,uy(a,1)),o=a[0].length,u=s,d.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===r.length?!o&&gy(l,"")||by(d,""):by(d,yy(r,u)),d.length>i?uy(d,0,i):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:Zb(t,this,e,n)}:t,[function(t,n){var i=iy(this),a=null==t?void 0:cy(t,e);return a?Zb(a,t,i,n):Zb(r,dy(i),t,n)},function(e,i){var a=ry(this),s=dy(e),o=n(r,a,s,i,r!==t);if(o.done)return o.value;var d=ay(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(fy?"g":"y"),l=new d(fy?"^(?:"+a.source+")":a,u),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===s.length)return null===ly(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=fy?0:f;var v,g=ly(l,fy?yy(s,f):s);if(null===g||(v=my(oy(l.lastIndex+(fy?f:0)),s.length))===p)f=sy(s,f,c);else{if(by(m,yy(s,p,f)),m.length===h)return m;for(var b=1;b<=g.length-1;b++)if(by(m,g[b]),m.length===h)return m;f=p=v}}return by(m,yy(s,p)),m}]}),!!py((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),fy);var wy="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==wy&&wy,Ay="URLSearchParams"in wy,ky="Symbol"in wy&&"iterator"in Symbol,Ey="FileReader"in wy&&"Blob"in wy&&function(){try{return new Blob,!0}catch(e){return!1}}(),xy="FormData"in wy,Ry="ArrayBuffer"in wy;if(Ry)var Sy=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Dy=ArrayBuffer.isView||function(e){return e&&Sy.indexOf(Object.prototype.toString.call(e))>-1};function Ty(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Oy(e){return"string"!=typeof e&&(e=String(e)),e}function Iy(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return ky&&(t[Symbol.iterator]=function(){return t}),t}function Py(e){this.map={},e instanceof Py?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function Cy(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Ly(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Uy(e){var t=new FileReader,n=Ly(t);return t.readAsArrayBuffer(e),n}function jy(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function My(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Ey&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:xy&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Ay&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ry&&Ey&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=jy(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ry&&(ArrayBuffer.prototype.isPrototypeOf(e)||Dy(e))?this._bodyArrayBuffer=jy(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ay&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ey&&(this.blob=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Cy(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(Uy)}),this.text=function(){var e=Cy(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Ly(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},xy&&(this.formData=function(){return this.text().then(By)}),this.json=function(){return this.text().then(JSON.parse)},this}Py.prototype.append=function(e,t){e=Ty(e),t=Oy(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Py.prototype.delete=function(e){delete this.map[Ty(e)]},Py.prototype.get=function(e){return e=Ty(e),this.has(e)?this.map[e]:null},Py.prototype.has=function(e){return this.map.hasOwnProperty(Ty(e))},Py.prototype.set=function(e,t){this.map[Ty(e)]=Oy(t)},Py.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Py.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Iy(e)},Py.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Iy(e)},Py.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Iy(e)},ky&&(Py.prototype[Symbol.iterator]=Py.prototype.entries);var Gy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ny(e,t){if(!(this instanceof Ny))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Ny){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Py(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Py(t.headers)),this.method=function(e){var t=e.toUpperCase();return Gy.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function By(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function Fy(e,t){if(!(this instanceof Fy))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Py(t.headers),this.url=t.url||"",this._initBody(e)}Ny.prototype.clone=function(){return new Ny(this,{body:this._bodyInit})},My.call(Ny.prototype),My.call(Fy.prototype),Fy.prototype.clone=function(){return new Fy(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Py(this.headers),url:this.url})},Fy.error=function(){var e=new Fy(null,{status:0,statusText:""});return e.type="error",e};var qy=[301,302,303,307,308];Fy.redirect=function(e,t){if(-1===qy.indexOf(t))throw new RangeError("Invalid status code");return new Fy(null,{status:t,headers:{location:e}})};var Vy,Wy=wy.DOMException;try{new Wy}catch(e){Wy=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Wy.prototype=Object.create(Error.prototype),Wy.prototype.constructor=Wy}function Hy(e,t){return new Promise((function(n,r){var i=new Ny(e,t);if(i.signal&&i.signal.aborted)return r(new Wy("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new Py,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){n(new Fy(i,r))}),0)},a.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){r(new Wy("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&wy.location.href?wy.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(Ey?a.responseType="blob":Ry&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Py?i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,Oy(t.headers[e]))})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}Hy.polyfill=!0,wy.fetch||(wy.fetch=Hy,wy.Headers=Py,wy.Request=Ny,wy.Response=Fy);var zy,Ky=function(e){var n=this;if(!Vy){var r={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Vv.topDomain,domain:Vv.parentDomain,referrer:Vv.parentURL,depth:o(),version:Ba.version,byloader:Vv.isTokenGameURL,isTokenGameURL:Vv.isTokenGameURL,isMasterGameURL:Vv.isMasterGameURL,isExtHostedGameURL:Vv.isExtHostedGameURL,byloaderVersion:Vv.version,tracking:Wv.userDeclinedTracking,whitelabel:Wv.whitelabelPartner,platform:u()};Vy=new l(r)}return Vy||{send:function(){t(this,n)}.bind(this)}};var $y,Qy,Yy=[],Jy=function(e){Yy.push(e)},Xy=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if($y){e.next=4;break}return e.next=3,Zy(Qy);case 3:$y=e.sent;case 4:return e.abrupt("return",$y);case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),Zy=function(e){var n=this;zy.send("gdfw.loading",{message:"loading"}),Yy=[],Jy("1"),Jy("2");var r=new _y;Jy("3");var i=r.get("partner.domain.value");Jy("4");var a=function(){return t(this,n),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this);Jy("5");var s=function(){t(this,n);var r=o(),a=r?"&mode=".concat(r):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(i).concat(a,"&v=").concat(Ba.version,"&localTime=").concat((new Date).getHours())}.bind(this);Jy("6");var o=function(){var e=this;t(this,n);var r=new Proxy(new URLSearchParams(window.location.search),{get:function(n,r){return t(this,e),n.get(r)}.bind(this)});return!r.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:r.gd_mode}.bind(this);return Jy("7"),new Promise(function(e){var r=this;if(t(this,n),$y)e($y);else{Jy("7.1");var i=a();try{Jy("7.2");var o=s();Jy("7.3"),fetch(o).then(function(e){return t(this,r),Jy("7.4"),e.json()}.bind(this)).then(function(n){var a=this;if(t(this,r),Jy("7.5"),n.success){var s,o,d,c,u=n.result.game;Jy("7.6");var l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(s=u.enableAds)||void 0===s?void 0:s.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,__t4r:Fa(u.__t4r)||{},block_exts:Fa(u.push_cuda),bloc_gard:Fa(u.bloc_gard),cookie:Fa(u.cookie),gdpr:Fa(u.gdpr),diagnostic:Fa(u.diagnostic),cmp:Fa(u.cmp),gft:Fa(u.gft)||{},sdk:Fa(u.sdk)||{},sdkfw:Fa(u.sdkfw)||{},loader:Fa(u.loader)||{},splash:Fa(u.splash)||{},promo:Fa(u.promo)||{},dAds:Fa(u.dads)||{},pAds:Fa(u.pads)||{},mAds:Fa(u.mads)||{},rAds:Fa(u.rads)||{},lp:Fa(u.lp)||{},extsc:Fa(u.extsc)||{},evnts:Fa(u.evnts)||{},dp:Fa(u.dp)||{},adflw:Fa(u.adflw)||{}};Jy("7.7");var p=h(j(i),l);Jy("7.8"),p.afg_disabled=!1===(null===(o=p.sdk)||void 0===o||null===(d=o.afg)||void 0===d?void 0:d.enabled),function(){t(this,a)}.bind(this),Jy("7.9"),null!==(c=p.pAds)&&void 0!==c&&c.enabled&&(p.preroll=!0),Jy("7.10"),zy.send("gdfw.success",{message:"success"}),e(p)}else{i.failed=!0;var f=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(f,": json error")}),e(i)}}.bind(this)).catch(function(n){t(this,r);var a=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(a,": ").concat(n.message?n.message:n)}),i.failed=!0,e(i)}.bind(this))}catch(t){var d=Yy[Yy.length-1];zy.send("gdfw.err",{message:"".concat(d,": global ").concat(t.message?t.message:t)}),i.failed=!0,e(i)}}}.bind(this))},e_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.abrupt("return",!(null==n||null===(t=n.sdkfw)||void 0===t||!t.enabled));case 4:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),t_=function(){var t=e(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return n=e.sent,e.next=5,e_();case 5:if(e.t0=e.sent,!e.t0){e.next=8;break}e.t0=!(null==n||null===(t=n.sdkfw)||void 0===t||!t.handshake);case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),n_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return d=e.sent,c=!(null==d||null===(t=d.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:c,path:c?null==d||null===(n=d.extsc)||void 0===n?void 0:n.path:"",name:c?null==d||null===(i=d.extsc)||void 0===i?void 0:i.name:"",ref:c?null==d||null===(a=d.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:c?null==d||null===(s=d.extsc)||void 0===s?void 0:s.loadedFlag:void 0,loadedFlagCheck:!!c&&!(null==d||null===(o=d.extsc)||void 0===o||!o.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),r_=function(){var n=e(r.mark((function e(){var n,i,a,s,o,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n_();case 2:if((n=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return i=n.path,a=n.name,s=n.ref,e.prev=6,o={},e.next=10,f(i,a,{error_prefix:"Blocked:",exists:function(){return t(this,d),!!s&&!!window[s]}.bind(this),attrs:o});case 10:e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),console.log("extsc: error on external partner script load",a,e.t0),p("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return n.apply(this,arguments)}}(),i_=!1,a_=!1,s_=function(){return new Promise(function(){var n=e(r.mark((function e(n,i){var a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i_){e.next=4;break}return e.abrupt("return",n(a_));case 4:i_=!0;case 5:return e.next=7,n_();case 7:if((a=e.sent).enabled){e.next=10;break}return e.abrupt("return",n(!1));case 10:if(s=a.loadedFlag,!(o=a.loadedFlagCheck)||s){e.next=13;break}return e.abrupt("return",n(!1));case 13:if(o){e.next=16;break}return a_=!0,e.abrupt("return",n(!0));case 16:d=!0,setTimeout(function(){t(this,u),d&&(d=!1,i_=!0,n(!1))}.bind(this),5e3),c=setInterval(function(){t(this,u),d&&o&&window[s]?(d=!1,i_=!0,a_=!0,clearInterval(c),n(!0)):d||clearInterval(c)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}())},o_=function(e){var n=function(e){var n=this,r=function(e){return t(this,n),h("showAd",{adType:e})}.bind(this),i=function(e){return t(this,n),h("preloadAd",{adType:e})}.bind(this),a=function(e){return t(this,n),h("showDisplayAd",{options:e})}.bind(this),s=function(){return t(this,n),h("cancelAd")}.bind(this),o=function(){return t(this,n),h("openConsole")}.bind(this),d=function(){return t(this,n),h("showBanner")}.bind(this),c=function(){return t(this,n),h("session")}.bind(this),u=function(e){return t(this,n),h("sendGenericEvent",{options:e})}.bind(this),l=function(){t(this,n),console.log("_sendSDKReady")}.bind(this),h=function(e,r){var i=this;return t(this,n),r||(r={}),new Promise(function(n,a){t(this,i);try{var s={type:"gd-sdk",method:e,options:r};window.parent.postMessage(s,"https://html5.gamedistribution.com"),n()}catch(e){console.log("gd:adp:m:s:error",e),n()}}.bind(this))}.bind(this),p=function(){t(this,n),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&r&&m(r)}),!1)}.bind(this),f=function(){t(this,n),p(),h("init")}.bind(this),m=function(r){t(this,n),e.onEvent&&e.onEvent(r)}.bind(this);return{showBanner:d,showAd:r,preloadAd:i,showDisplayAd:a,cancelAd:s,openConsole:o,getSession:c,onEvent:m,init:f,_sendSDKReady:l,sendGenericEvent:u}}(e);return n.init(),n},d_=function(){var e=this;return{isMasterGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){t(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){t(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},c_=function(e){var n=this;return new Promise(function(r,i){var a=this;t(this,n);var s={type:"gd-sdk-frame-handshake-request"},o=!1;window.addEventListener("message",(function(e){var t=e.data,n=e.origin,i=e.source,a=t.type;if("gd-sdk-frame-handshake-request"===a){var s={type:"gd-sdk-frame-handshake-response"};i.postMessage(s,n)}else"gd-sdk-frame-handshake-response"===a&&(o=!0,r({origin:n,source:i}))})),e?r():(setTimeout(function(){t(this,a),o||r()}.bind(this),200),window.parent!==window?window.parent.postMessage(s,"*"):r())}.bind(this))},u_=function(){var t=e(r.mark((function e(){var t,n,i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,e_();case 2:return t=e.sent,n=!t,e.next=6,c_(n);case 6:if(i=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=d_(),s=a.isMasterGameURL,o=s(),e.next=13,t_();case 13:return d=e.sent,c=!1,c=d?!o&&!!i:!o,e.abrupt("return",c);case 17:case"end":return e.stop()}}),e)})));return function(){return t.apply(this,arguments)}}(),l_=Je,h_=ae,p_=La,f_=Di,m_=h_(Ai.f),v_=h_([].push),g_=function(e){return function(t){for(var n,r=f_(t),i=p_(r),a=i.length,s=0,o=[];a>s;)n=i[s++],l_&&!m_(r,n)||v_(o,e?[n,r[n]]:r[n]);return o}},b_={entries:g_(!0),values:g_(!1)}.values;Ia({target:"Object",stat:!0},{values:function(e){return b_(e)}});var y_=Ia,__=dh,w_=Pe,A_=ke,k_=ye,E_=Gh,x_=$p,R_=Ye.exports;if(y_({target:"Promise",proto:!0,real:!0,forced:!!__&&w_((function(){__.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=E_(this,A_("Promise")),n=k_(e);return this.then(n?function(n){return x_(t,e()).then((function(){return n}))}:e,n?function(n){return x_(t,e()).then((function(){throw n}))}:e)}}),k_(__)){var S_=A_("Promise").prototype.finally;__.prototype.finally!==S_&&R_(__.prototype,"finally",S_,{unsafe:!0})}var D_=oe,T_=es,O_=ae("".replace),I_="[\t\n\v\f\r                 \u2028\u2029\ufeff]",P_=RegExp("^"+I_+I_+"*"),C_=RegExp(I_+I_+"*$"),L_=function(e){return function(t){var n=T_(D_(t));return 1&e&&(n=O_(n,P_,"")),2&e&&(n=O_(n,C_,"")),n}},U_={start:L_(1),end:L_(2),trim:L_(3)},j_=Nn.PROPER,M_=Pe,G_="\t\n\v\f\r                 \u2028\u2029\ufeff",N_=U_.trim;Ia({target:"String",proto:!0,forced:function(e){return M_((function(){return!!G_[e]()||"​…᠎"!=="​…᠎"[e]()||j_&&G_[e].name!==e}))}("trim")},{trim:function(){return N_(this)}});var B_=ye,F_=et,q_=lu,V_=Je,W_=H,H_=ae,z_=ka,K_=function(e,t,n){var r,i;return q_&&B_(r=t.constructor)&&r!==n&&F_(i=r.prototype)&&i!==n.prototype&&q_(e,i),e},$_=Zt,Q_=Xe.f,Y_=Gi.f,J_=ft,X_=Mm,Z_=es,ew=Mu,tw=Gu,nw=Ye.exports,rw=Pe,iw=pe,aw=Cn.enforce,sw=mh,ow=Vu,dw=zu,cw=Ke("match"),uw=W_.RegExp,lw=uw.prototype,hw=W_.SyntaxError,pw=H_(ew),fw=H_(lw.exec),mw=H_("".charAt),vw=H_("".replace),gw=H_("".indexOf),bw=H_("".slice),yw=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_w=/a/g,ww=/a/g,Aw=new uw(_w)!==_w,kw=tw.UNSUPPORTED_Y,Ew=V_&&(!Aw||kw||ow||dw||rw((function(){return ww[cw]=!1,uw(_w)!=_w||uw(ww)==ww||"/a/i"!=uw(_w,"i")})));if(z_("RegExp",Ew)){for(var xw=function(e,t){var n,r,i,a,s,o,d=J_(lw,this),c=X_(e),u=void 0===t,l=[],h=e;if(!d&&c&&u&&e.constructor===xw)return e;if((c||J_(lw,e))&&(e=e.source,u&&(t="flags"in h?h.flags:pw(h))),e=void 0===e?"":Z_(e),t=void 0===t?"":Z_(t),h=e,ow&&"dotAll"in _w&&(r=!!t&&gw(t,"s")>-1)&&(t=vw(t,/s/g,"")),n=t,kw&&"sticky"in _w&&(i=!!t&&gw(t,"y")>-1)&&(t=vw(t,/y/g,"")),dw&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],s={},o=!1,d=!1,c=0,u="";r<=n;r++){if("\\"===(t=mw(e,r)))t+=mw(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:fw(yw,bw(e,r+1))&&(r+=2,d=!0),i+=t,c++;continue;case">"===t&&d:if(""===u||iw(s,u))throw new hw("Invalid capture group name");s[u]=!0,a[a.length]=[u,c],d=!1,u="";continue}d?u+=t:i+=t}return[i,a]}(e),e=a[0],l=a[1]),s=K_(uw(e,t),d?this:lw,xw),(r||i||l.length)&&(o=aw(s),r&&(o.dotAll=!0,o.raw=xw(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=mw(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+mw(e,++r);return i}(e),n)),i&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{$_(s,"source",""===h?"(?:)":h)}catch(e){}return s},Rw=function(e){e in xw||Q_(xw,e,{configurable:!0,get:function(){return uw[e]},set:function(t){uw[e]=t}})},Sw=Y_(uw),Dw=0;Sw.length>Dw;)Rw(Sw[Dw++]);lw.constructor=xw,xw.prototype=lw,nw(W_,"RegExp",xw)}sw("RegExp");var Tw=Ia,Ow=ui.find,Iw=Gl,Pw=!0;"find"in[]&&Array(1).find((function(){Pw=!1})),Tw({target:"Array",proto:!0,forced:Pw},{find:function(e){return Ow(this,e,arguments.length>1?arguments[1]:void 0)}}),Iw("find");var Cw=Ia,Lw=xr,Uw=Di,jw=hi,Mw=ae([].join),Gw=Lw!=Object,Nw=jw("join",",");Cw({target:"Array",proto:!0,forced:Gw||!Nw},{join:function(e){return Mw(Uw(this),void 0===e?",":e)}});var Bw=ui.map;Ia({target:"Array",proto:!0,forced:!id("map")},{map:function(e){return Bw(this,e,arguments.length>1?arguments[1]:void 0)}});var Fw=Je,qw=ae,Vw=pt,Ww=Pe,Hw=La,zw=ra,Kw=Ai,$w=ue,Qw=xr,Yw=Object.assign,Jw=Object.defineProperty,Xw=qw([].concat),Zw=!Yw||Ww((function(){if(Fw&&1!==Yw({b:1},Yw(Jw({},"a",{enumerable:!0,get:function(){Jw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Yw({},e)[n]||Hw(Yw({},t)).join("")!=r}))?function(e,t){for(var n=$w(e),r=arguments.length,i=1,a=zw.f,s=Kw.f;r>i;)for(var o,d=Qw(arguments[i++]),c=a?Xw(Hw(d),a(d)):Hw(d),u=c.length,l=0;u>l;)o=c[l++],Fw&&!Vw(s,d,o)||(n[o]=d[o]);return n}:Yw,eA=Zw;Ia({target:"Object",stat:!0,forced:Object.assign!==eA},{assign:eA});var tA=function(){function e(t){S(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){var e=this;try{var n={},r=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,i=new O(location.href,!0);for(var a in i.query)n[a]=i.query[a];return Object.keys(n).filter(function(n){var r=this;return t(this,e),this.customParamKeys.some(function(e){return t(this,r),e===n}.bind(this))}.bind(this)).length>0||r?(console.log("custom-params",n,r),n):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),nA=function(){function e(t,n){S(this,e),this.adContainer=t,this.onResume=n}return T(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var n=document.createElement("div");this.adResumeButton=n,n.id="gd__resume__button",n.setAttribute("title","Resume"),this.addStyles(),n.classList.add("gd__resume__button"),n.addEventListener("click",function(){t(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(n);var r=document.createElement("div");this.adResumeButtonOverlay=r,r.id="gd__resume__button__overlay",r.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(r)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),rA=function(e){if(!e)return!1;var t=iA.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},iA=Object.prototype.toString;function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oA(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}function dA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uA=new F,lA=null,hA=function(){function n(e,r,i){var a=this;if(S(this,n),lA)return lA;lA=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=r?h(s,r):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new _,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=i.parentDomain,this.topDomain=i.topDomain,this.parentURL=i.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=w(),this.atom_display,this.adType_="",this.clickCount={midroll:0,preroll:0,rewarded:0},this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==e?document.getElementById(e):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:d,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){t(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){t(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var i,a,s,o,d,c,u,l,p,A,k,E,x,R,P,C,L,U,F,q,V;return T(n,[{key:"start",value:(V=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),window.eventTest=function(e){t(this,n),this._broadcast(e,{message:"",status:"success"})}.bind(this),e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(0),Wa("gd-adflow error on ads.start",e.t0),new Error(e.t0);case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(){return V.apply(this,arguments)})},{key:"_getAdVast",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p,f,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(m.available&&m.getBoolean("gd_debug_ex")&&m.getBoolean("gd_tag"))){e.next=6;break}return o=a.IMASampleTags[n],d=Math.floor(Math.random()*o.length),c=o[d],s({url:c}),e.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){e.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return e.prev=8,u=a.nextAdPosition(n),a._broadcast("AD_REQUEST",{message:u}),l=a.options,"preroll"===u&&G(l.preroll)?l=l.preroll:"midroll"===u&&G(l.midroll)?l=l.midroll:"rewarded"===u&&G(l.rewarded)&&(l=l.rewarded),h="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",e.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:cA(cA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId})},!(i&&i.retry_on_success&&G(l.retry_on_success)&&G(l.retry_on_success.vast))){e.next=21;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_success.vast,p)));case 21:if(!(i&&i.retry_on_failure&&a.options.retry_on_failure&&G(l.retry_on_failure.vast))){e.next=25;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.retry_on_failure.vast,p)));case 25:if(!G(l.vast)){e.next=27;break}return e.abrupt("return",s(a._createCustomAdVastUrl(l.vast,p)));case 27:return e.next=29,a._create_dp_context(u,i);case 29:f=e.sent,Va("gd-adflow, before idhb",u,h),window.idhb.requestAds({slots:D({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,n){var r=this;t(this,v),!f||null!=n&&n.bidFloorApplied||fetch(f.skip_url).catch(function(e){t(this,r)}.bind(this)),s({tnl_keys:cA(cA({},window.idhb.getAdserverTargetingForAdSlot(h)),{},{tnl_ad_pos:u,tnl_asset_id:a.gameData.gameId}),url:e,dp:f,hl:n})}.bind(this)}),e.next=37;break;case 34:throw e.prev=34,e.t0=e.catch(8),new Error(e.t0);case 37:case"end":return e.stop()}}),e,this,[[8,34]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===v.Rewarded)return this.adRewardedCount++,"rewarded";if(e===v.Interstitial){var t=!1===this.gameData.preroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===v.Rewarded?"rewarded":e===v.Interstitial?!1===this.gameData.preroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestPromo",value:function(e,t){var n=new google.ima.AdsRequest;return n.adsResponse=function(e){return'<VAST version="3.0"> \n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA['.concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,"]]></VASTAdTagURI> \n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),n.linearAdSlotWidth=this.options.width,n.linearAdSlotHeight=this.options.height,n.nonLinearAdSlotWidth=this.options.width,n.nonLinearAdSlotHeight=this.options.height,n.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(n.vastLoadTimeout=this.options.vast_load_timeout),n.setAdWillAutoPlay(t.autoplayAllowed),n.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(n),n}},{key:"_requestAd",value:function(e,n){var r=this;return n=n||{},new Promise(function(i){var a=this;if(t(this,r),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var s,o=null==e||null===(s=e.tnl_keys)||void 0===s?void 0:s.tnl_ad_pos;this.adSuccess=!1;var d=new google.ima.AdsRequest,c=this._transformVast(e,n),u=cA(cA({},n),{},{adTag:c,tnl_ad_pos:o});this.adCounter[o]=this.adCounter[o]||0,this.adCounter[o]++;var l=e.dp,h=e.hl;l&&(l.adtag_url=c.url,this._extend_dp_with_adsense(l,h,null==e?void 0:e.tnl_keys));var p=this._isVMAP(o);if(function(){t(this,a),n.shouldFail&&(l?(l.adtag_url="dp_original_broken",l.fallback_url="dp_fallback_broken"):c.url="original_broken",null==l||l.adtag_url,null==l||l.fallback_url,c.url),p=!1}.bind(this),p){var f=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,i=Date.now(),a=new O(e.adtag_url_1,!0);a.query=sA(sA({},a.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:i,output:"xml_vast3"});var s=a.toString(),o=new O(e.adtag_url_2,!0);o.query=sA(sA({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++i,output:"xml_vast3"});var d=o.toString(),c=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:c++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(c++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(oA({id:c++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:l,adtag:c,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(o)}));d.adsResponse=f}else if(l&&h.bidFloorApplied){var m=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(l);d.adsResponse=m}else if(l&&l.fallback_url){var v=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(l);d.adsResponse=v}else d.adTagUrl=c.url;d.linearAdSlotWidth=this.options.width,d.linearAdSlotHeight=this.options.height,d.nonLinearAdSlotWidth=this.options.width,d.nonLinearAdSlotHeight=this.options.height,d.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(d.vastLoadTimeout=this.options.vast_load_timeout),d.setAdWillAutoPlay(n.autoplayAllowed),d.setAdWillPlayMuted(n.autoplayRequiresMute),this.adsLoader.requestAds(d,u);try{this._broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}i(d)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this._broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(q=e(r.mark((function e(){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,r){var i=this;t(this,n);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):M.video({inline:!0,muted:!1}).then(function(n){t(this,i);var r=n.result;n.error,e(!0===r?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return q.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(F=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return F.apply(this,arguments)})},{key:"startAd",value:(U=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.adType,i=t.params,this.adType_=n,this.adContext=cA({},i),"promo"!==(null==i?void 0:i.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(i,n));case 5:if("adsense"!==(null==i?void 0:i.adapter)){e.next=26;break}if(n!==v.Interstitial){e.next=19;break}if("preroll"!==(null==i?void 0:i.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==i?void 0:i.position)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==i?void 0:i.position)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 17:e.next=24;break;case 19:if(n!==v.Rewarded){e.next=23;break}return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 23:case 34:throw new Error("Unsupported ad type");case 24:e.next=35;break;case 26:if(n!==v.Interstitial){e.next=30;break}return e.abrupt("return",this._startInterstitialAd(i));case 30:if(n!==v.Rewarded){e.next=34;break}return e.abrupt("return",this._startRewardedAd(i));case 35:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"preloadAd",value:(L=e(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==v.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==v.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return L.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,n=function(){t(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new nA(this.adContainer,n),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(C=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,u,l,h,p,f,m,v=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(d=i?i.containerId:null)||s("Container id is not specified"),c=document.getElementById(d),document.getElementById(d)||s("No container is found with this id - ".concat(d)),void 0===window.idhb.requestAds&&s("Prebid.js wrapper script hit an error or didn't exist!"),u=i.slotId?i.slotId:"gd__banner@".concat(d),document.getElementById(u)||(l="\n .gd__banner{\n z-index: ".concat(g.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((h=document.createElement("style")).type="text/css",h.id="gd__banner__style",h.styleSheet?h.styleSheet.cssText=l:h.appendChild(document.createTextNode(l)),c.appendChild(h)),(p=document.createElement("div")).id=u,p.classList.add("gd__banner"),c.appendChild(p)),e.next=10,a._create_dp_display_context();case 10:a.atom_display=e.sent,null!==(o=a.atom_display)&&void 0!==o&&o.params&&window.idhb.setAdserverTargeting(null===(f=a.atom_display)||void 0===f?void 0:f.params),(m={})[u]={maxSize:[c.offsetWidth,c.offsetHeight]},window.idhb.requestAds({slots:m,callback:function(e){t(this,v)}.bind(this)}),n(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),s(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return C.apply(this,arguments)})},{key:"_startInterstitialAd",value:(P=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadInterstitialAd(cA(cA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return P.apply(this,arguments)})},{key:"_startPromo",value:(R=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,this.adSuccess=!1,e.next=8,this._initDisplayContainerWithAutoPlay();case 8:return i=e.sent,e.next=11,this._loadPromo(cA(cA({},i),t),n);case 11:if(e.sent.success){e.next=16;break}return e.abrupt("return");case 16:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),this.msgrt.send("promo.adsense",{message:"".concat(t.position," success")}),e.next=27;break;case 22:throw e.prev=22,e.t0=e.catch(0),this.msgrt.send("promo.adsense.err",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0,", [").concat(this.parentURL,"]")}),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e,t){return R.apply(this,arguments)})},{key:"_loadPromo",value:(x=e(r.mark((function e(t,n){var i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,i=this.nextAdPosition(n),a=this._create_promo_context(i),this._requestPromo(a,cA({adType:v.Interstitial},t)),e.next=7,this._waitOnAdLoad();case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(1),new Error(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t){return x.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(E=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,cA({adType:v.Interstitial},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return E.apply(this,arguments)})},{key:"_waitOnAdLoad",value:function(){var e=this;return new Promise(function(n,r){var i=this;t(this,e);var a="videoad.preloadad";this.eventBus.unsubscribeScope(a);var s=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!0,args:e})}.bind(this),1)}.bind(this),o=function(e){var r=this;t(this,i),setTimeout(function(){t(this,r),this.eventBus.unsubscribeScope(a),n({success:!1,args:e})}.bind(this),1)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",s,a),this.eventBus.subscribe("AD_SDK_CANCELED",o,a),this.eventBus.subscribe("AD_ERROR",o,a)}.bind(this))}},{key:"_startRewardedAd",value:(k=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:if(!void function(){t(this,a)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return i=e.sent,e.next=13,this._loadRewardedAd(cA(cA({},i),n));case 13:if(e.sent.success){e.next=18;break}return e.abrupt("return");case 18:i.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=27;break;case 23:throw e.prev=23,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return k.apply(this,arguments)})},{key:"_loadRewardedAd",value:(A=e(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(v.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,cA({adType:v.Rewarded},t));case 11:return e.next=14,this._waitOnAdLoad();case 14:return e.abrupt("return",e.sent);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return A.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(p=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return p.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(l=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(v.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return l.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player&&(this.video_ad_player.src=""),this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var n=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var r=null==e?void 0:e.mode;e.t4r=this.gameData.__t4r;var i=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===r)this.activeAdContainer.style.opacity=i?.001:1,i&&this.adsManager.setVolume(0),i&&this._broadcast("AD_T4R"),i&&setTimeout(function(){t(this,n),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210));else if("click"===r||"first_quartile"===r){if(i&&"click"===r){var s,o=null===(s=this._adrequest_user_context)||void 0===s?void 0:s.tnl_ad_pos;this.clickCount[o]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,n=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=g.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var r=document.createElement("video");r.setAttribute("playsinline",!0),r.setAttribute("webkit-playsinline",!0),r.id="".concat(this.prefix,"advertisement_video"),r.style.position="absolute",r.style.backgroundColor="#000000",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.video_ad_player=r,this.adContainer.appendChild(r);var i=document.createElement("div");i.id="".concat(this.prefix,"advertisement_slot"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",this.adContainerInner=i,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(i),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(i),n.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){t(this,e);var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:n,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,i.style.width=this.options.width+"px",i.style.height=this.options.height+"px",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var n=this,r=new google.ima.AdsRenderingSettings;r.autoAlign=!1,r.enablePreloading=!1,r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.useStyledNonLinearAds=!0,r.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,r),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){t(this,n),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c="AD_SDK_MANAGER_READY";this._broadcast(c,{name:c,message:"AD SDK is ready",status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var n,r=this,i=new Date,a=i.getHours(),s=i.getDate(),o=i.getMonth(),d=i.getFullYear(),c=b(google.ima.AdEvent.Type,e.type),u=!1,l=(null==e||null===(n=e.getAd())||void 0===n?void 0:n.getContentType())||"",h=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var p="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:p="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:p="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:u=!0,p="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:p="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:e.getAd(),u=this._is_completed(e.getAd()),p="Fired when the ad completes playing.",this.adType_===v.Rewarded&&this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:p="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:p="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",u=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:p="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:p="Fired when the ad playhead crosses first quartile.";var m=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:m});break;case google.ima.AdEvent.Type.IMPRESSION:p="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:p="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:p="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var g=e.getAd().getContentType();p=g,this._show({mode:"loaded",contentType:g});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(p=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:p="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:h&&this.adResume.show(),p="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:p="Fired when the ad is resumed.",h&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:p="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:u=this._is_completed(e.getAd()),p="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),p="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:p="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:u=this._is_completed(e.getAd()),p="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:p="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:p="Fired when the ad volume has been muted."}if(""!==c&&""!==p&&this._broadcast(c,{name:c,message:p,status:"success",analytics:{category:c,action:this.parentDomain,label:"h".concat(a," d").concat(s," m").concat(o," y").concat(d)}}),u&&!this.adSuccess){this.adSuccess=!0;var y=e.getAd(),_="Rainbow"===(null==y?void 0:y.getAdSystem())&&(null==y?void 0:y.getWrapperAdIds().some(function(e){return t(this,r),"promo"===e}.bind(this)));null==y||y.getAdSystem(),null==y||y.getWrapperAdIds(),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success",isPromoSuccess:_}),this.resetForNext(e)}}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),i=this._getInnerErrorCode(n);uA.emit("AD_ERROR",r),this._broadcast(t,{message:r,details:i,status:"warning",analytics:{category:t,action:i,label:r}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{this.adResume&&this.adResume.hide()}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event:e})}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,n){var r=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){t(this,r),this.cancel(),this._clearSafetyTimer(n)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(rA(e.getInnerError)){var t=e.getInnerError();if(t)return rA(t.getErrorCode)&&rA(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,n){var r=this;if(e){var i=this.macros.transform(e,{get:function(e){if(t(this,r),n&&n.tnl_keys)return n.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in i.query||{}){var s=i.query[a];G(s)&&(i.query[a]=N.stringify(s))}var o=new O(i.url,!0);return B(o.query,i.query||{}),cA({url:o.toString()},n)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new O(e.url,!0),i=this._transformQuery(e,t,r);i&&(n.url=r.toString());var a=i?r:new O(e.url,!0);if(a.query.cust_params){var s=N.parse(a.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=a}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,n,r){var i=this;if(e&&n&&e.tnl_keys){var a=this.options.vast_query;if(n.retry_on_success&&this.options.retry_on_success&&G(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:n.retry_on_failure&&this.options.retry_on_failure&&G(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=j(a),G(a)){var s=r.query;if(a.$$remove){for(var o in s){new RegExp(a.$$remove,"i").test(o)&&delete s[o]}delete a.$$remove}var d=N.parse(s.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var c in d){new RegExp(a.cust_params.$$remove,"i").test(c)&&delete d[c]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(n){return t(this,i),e.tnl_keys[n.toLowerCase()]}.bind(this)});return s.cust_params=d,B(s,u),s.cust_params=N.stringify(s.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,i,a=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[a]>=(null===(n=e.t4r[a])||void 0===n?void 0:n.count))return!1;if(null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return a&&(null===(i=e.t4r[a])||void 0===i?void 0:i.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[a])||void 0===s?void 0:s.viper)||0;if(o>0){var d,c=Math.random()<o;return a&&c&&(null===(d=e.t4r[a])||void 0===d?void 0:d.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,i,a,s,o,d,c,u,l,h,p,f,m;if(!e)return!1;var v="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(i=r.pAds)||void 0===i||null===(a=i.vmap)||void 0===a?void 0:a.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(c=d.mAds)||void 0===c||null===(u=c.vmap)||void 0===u?void 0:u.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),b=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?b>=(null==g?void 0:g.start):v}},{key:"_getT4ROptions",value:function(e){var t,n=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;switch(n){case"preroll":case"midroll":case"rewarded":return e.t4r[n]}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,i=e.dp,a=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:i,d=null!=r&&r.vast_2?void 0:i;return{adtag_url_1:null==a?void 0:a.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,i,a,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(i=r.mAds)||void 0===i?void 0:i.vmap;case"rewarded":return null===(a=this.gameData)||void 0===a||null===(s=a.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r;return!!e&&!0===(null===(t=this.gameData)||void 0===t||null===(n=t.dp)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.enabled)}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(n){var r=this;t(this,e);try{var i={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new tA(this.gameData).checkCustomParams();a&&(i.cp=a);var s=encodeURIComponent(I.encode(JSON.stringify(i)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(s)).then(function(e){return t(this,r),e.json()}.bind(this)).then(function(e){if(t(this,r),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),n();this.msgrt.send("dp.fp",{message:e.p/100}),n({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(s),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(s)})}.bind(this)).catch(function(e){t(this,r),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),n()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var n,r=this,i={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(i).map(function(e){return t(this,r),"".concat(e,"=").concat(encodeURIComponent(i[e]))}.bind(this)).join("&");encodeURIComponent(I.encode(JSON.stringify(i)));var s=null===(n=this.gameData.promo)||void 0===n?void 0:n.rainbow,o=null==s?void 0:s.enabled,d="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a);console.log("gd-adflow openPromoUrl",d);var c=o?d:void 0;return function(){t(this,r)}.bind(this),{promo_url:c,promo_imp_blue_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:o?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(n,i){var a=this;return new Promise(function(){var s=e(r.mark((function e(s){var o,d,c,u,l,h,p=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a._isDP(n)){e.next=5;break}return a.msgrt.send("dp.na",{message:"rule"}),e.abrupt("return",s());case 5:d={id:a.topDomain||a.parentDomain,au:n||"unknown",ty:"video",aid:a.gameData.gameId,pgu:a.parentURL},(c=new tA(a.gameData).checkCustomParams())&&(d.cp=c),u=encodeURIComponent(I.encode(JSON.stringify(d))),null==i||i.adapterIndex,null==i||i.isLastAdapter,l=null===(o=a.gameData.promo)||void 0===o?void 0:o.rainbow,h=(null==l?void 0:l.enabled)&&(null==i?void 0:i.isLastAdapter),null==l||l.enabled,null==i||i.isLastAdapter,fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return t(this,p),e.json()}.bind(this)).then(function(e){if(t(this,p),!e||!e.p)return a.msgrt.send("dp.na",{message:"atom"}),s();var n=e.p/100;s({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(u,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(u),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(u),promo_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:h?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){t(this,p),a.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),s()}.bind(this)),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),a.msgrt.send("dp.err",{message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0}),s();case 20:case"end":return e.stop()}}),e,this,[[0,16]])})));return function(e){return s.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new O(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var i=N.parse(r.query.cust_params);if(!i.tnl_asset_id)return;i.adsense=1,r.query.cust_params=N.stringify(i,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(u=e(r.mark((function e(n){var i,a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this._getPrebidScripts(),a=i[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,f(a,"gdsdk_prebid",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,c),window.idhb.requestAds}.bind(this)});case 8:s=y("ch",window.location.href),o=y("ch_date",window.location.href),d={tnl_content_category:this.category.toLowerCase()},s&&(d.channel=s),o&&(d.ch_date=o),window.idhb.setAdserverTargeting(d),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var n=this;t(this,c);try{var r,i=e.slotId.split("@");i=1===i.length?i[0]:i[1],e.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_ERROR",{message:i,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){t(this,n)}.bind(this)),delete this.atom_display),this._broadcast("DISPLAYAD_IMPRESSION",{message:i,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_init_ima_script",value:(c=e(r.mark((function e(n){var i,a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],a=this.options.debug?i[0]:i[1],e.next=4,f(a,"gdsdk_ima",{alternates:i,error_prefix:"Blocked:",exists:function(){return t(this,s),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"_init_afg_script",value:(d=e(r.mark((function e(n){var i,a,s,o,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==n||null===(i=n.adsense_client)||void 0===i?void 0:i.length)>0?n.adsense_client:"ca-pub-2316275586951220",o["data-ad-frequency-hint"]="30s",o.allow="autoplay",(null==n||null===(a=n.adsense_channel)||void 0===a?void 0:a.length)>0&&(o["data-ad-channel"]=n.adsense_channel),(null==n||null===(s=n.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=n.adsense_host),!0===(null==n?void 0:n.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=14,f("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return t(this,d),!!window.adsbygoogle}.bind(this),attrs:o});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(o=e(r.mark((function e(n){var i,a,s,o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,u),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense rewarded error",status:"error",skipForward:!0}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),i=function(){t(this,u),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,u),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(){t(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),o=function(){t(this,u),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),d=function(e){t(this,u),e()}.bind(this),c=function(e){t(this,u),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error",skipForward:!0}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),r={type:"reward",name:"reward-in-game",beforeAd:i,afterAd:a,adDismissed:s,adViewed:o,beforeReward:d,adBreakDone:c},window.adsbygoogle.push(r),e.next=24;break;case 20:throw e.prev=20,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 24:case"end":return e.stop()}var r}),e,this,[[1,20]])}))),function(e){return o.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(s=e(r.mark((function e(n){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,a),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(e){t(this,a),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"}),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"preroll",adBreakDone:i},window.adsbygoogle.push(r),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}var r}),e,this,[[1,15]])}))),function(e){return s.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(a=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense preroll error 2",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),r={type:"start",name:"start-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(i=e(r.mark((function e(n){var i,a,s,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this._broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:if(!void function(){if(t(this,o),n.params.shouldFail)return this._broadcast("AD_ERROR",{message:"fictional adsense midroll error",status:"error"}),!0}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),i=function(){t(this,o),this._broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this._broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),a=function(){t(this,o),this._broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),s=function(e){t(this,o),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this._broadcast("COMPLETE",{message:"",status:"success"}),this._broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this._broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),r={type:"next",name:"next-in-game",beforeAd:i,afterAd:a,adBreakDone:s},window.adsbygoogle.push(r),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var r}),e,this,[[1,17]])}))),function(e){return i.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,i=n._ua,a={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:i.browser.name,brvs:i.browser.version,osnm:i.os.name,osvs:i.os.version,dvmd:i.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(I.encode(JSON.stringify(a)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===v.Rewarded)t="reward";else if(n===v.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}},{key:"_broadcast",value:function(e,n){var r=this,i=!1;["AD_ERROR"].some(function(n){return t(this,r),n===e}.bind(this))&&(i=!this.adContext.isLastAdapter||this.adContext.extraPromoRunOnFail,console.log("gd-adflow skipForward",e,i,this.adContext.adapterIndex,this.adContext.isLastAdapter,this.adContext.extraPromoRunOnFail)),this.eventBus.broadcast(e,cA(cA({},n),{},{skipForward:i}))}}]),n}(),pA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"promo",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-stone-dynamic",s=n.package_version||"1.1.1",o=n.template||"puzzle",d=n.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Om(this.moduleName,this.moduleConfig)},fA=function t(n){var i=this;S(this,t),D(this,"load",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(i.moduleName);case 2:i.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),D(this,"splash",e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.module){e.next=3;break}return e.next=3,i.load();case 3:return e.abrupt("return",i.module[i.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var a=n.package||"gd-sdk-air-dynamic",s=n.package_version||"1.2.0",o=n.template||"pluto",d=n.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=o.charAt(0).toUpperCase()+o.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(a,"/").concat(s,"/dist/").concat(o.toLowerCase(),"/iife/index.js"),dependencies:d},Om(this.moduleName,this.moduleConfig)},mA=function(e,t){console.log(e,t)},vA={},gA={},bA=null;function yA(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return vA.version=r,vA.frame=e,vA.function=n,vA.version}function _A(e){var n=this;return bA||(bA=new Promise(function(r){function i(t,n){if(mA("Received a response from CMP",t),n){var i,a;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(a=(i=t)&&"boolean"==typeof i.gdprApplies?i.gdprApplies:e.defaultGdprScope)||!0===a&&"string"!=typeof i.tcString)&&r({result:"cmpUnexpectedResponse",cmp:vA,consentData:i}),void r({result:"ok",consentData:t})):void 0;r({result:"ok",consentData:t})}else r({result:"cmpCallFailed"})}t(this,n),yA(),vA.frame?2===vA.version?(mA("TCF v2 CMP found. Fetching the consent."),vA.function?(mA("CMP API is directly accessible, calling it now..."),vA.function("addEventListener",vA.version,i)):(mA("CMP API is outside the current iframe, calling it now..."),function(e,n,r){var i=this,a="__tcfapi";function s(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==gA[r.callId]&&gA[r.callId](r.returnValue,r.success)}}window[a]=function(e,r,s,o){t(this,i);var d=Math.random()+"",c="".concat(a,"Call"),u=D({},c,{command:e,parameter:o,callId:d,version:r});gA[d]=s,n.postMessage(u,"*")}.bind(this),window.addEventListener("message",s,!1),window[a](e,vA.version,r)}("addEventListener",vA.frame,i))):r({result:"cmpVersionNotV2",cmp:vA}):r({result:"cmpNotFound"})}.bind(this)),bA)}var wA=new(function(){function t(){S(this,t),this.productName="Game Distribution"}var n;return T(t,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(n=e(r.mark((function e(t,n){var i,a,s,o,d,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(i=t.visitor)||void 0===i?void 0:i.visitorId){e.next=6;break}return e.abrupt("return");case 6:return s=encodeURIComponent(this.productName),o=encodeURIComponent(a),e.prev=8,d="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=12,fetch(d,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,c="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(s,"/user_id/").concat(o),e.next=22,fetch(c,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,t){return n.apply(this,arguments)})}]),t}());function AA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function kA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var EA=function(e){var n=this,r=e.src,i=e.attributes,a=e.target,s=e.isAsync;return new Promise(function(e,o){var d=this;t(this,n);try{var c=document.createElement("script");if(c.async=null==s||s,c.type="text/javascript",c.onload=function(){t(this,d),e()}.bind(this),c.onerror=function(){t(this,d);var e="Error on script load, Error: ".concat(r);console.log(e),o(e)}.bind(this),c.src=r,i){var u,l=AA(i);try{for(l.s();!(u=l.n()).done;){var h=u.value,p=h.key,f=h.value;c.setAttribute(p,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(c)}catch(e){var m="Error on script load catch, Error: ".concat(r);console.log(m,e),o(m)}}.bind(this))},xA=function(){var t=e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,EA({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,EA({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,EA({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,i=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(i=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(i),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 13:case"end":return e.stop()}var t,n,r,i}),e,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),RA=new F,SA={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}window.addEventListener("message",(function(e){var n=this,r=e.data,i=e.origin,a=r.type;if(Object.keys(SA).some(function(e){return t(this,n),e===i}.bind(this))&&(null==r||!r.__tcfapiCall)&&(window.parent&&!r.type.startsWith("gd-sdk")&&window.parent.postMessage(r,"*"),a)){var s=SA[i][a];s&&RA.emit(s,r)}}),!1);var TA=q(),OA=function(e){var n=this;if(!window.__msgr){var r=document.createElement("iframe");if(r.src="https://static.gamedistribution.com/message/index.html",r.style.display="none",r.name="__msgr",document.body.appendChild(r),window!==window.top){var i={gameId:e.gameId,target:e.evnts.domain,token:TA,event_name:"TokenGenerated",timestamp:Date.now()};r.onload=function(){CA(i)},setInterval(function(){t(this,n),i.timestamp=Date.now(),i.event_name="Heartbeat",CA(i)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){t(this,n);try{var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!r.event_name)return;r.token=TA,CA(r)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},IA=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=PA(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},PA=function e(t){try{var n,r,i=null==t?void 0:t.parent;if("game"===(null===(n=i.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return i;e(i)}catch(e){return t}},CA=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function LA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jA(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return MA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function MA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GA=function(){function n(e){var r=this;S(this,n),D(this,"_getAdTypeByAfgPosition",function(e){var n=this;t(this,r);var i={preroll:["preroll","start"],midroll:["next"],rewarded:["reward"]},a=Object.keys(i).find(function(r){var a=this;return t(this,n),i[r].some(function(n){return t(this,a),n===e.params.position}.bind(this))}.bind(this));return a||"midroll"}.bind(this)),this._gameData=e._gameData,this._msgrt=e.msgrt,this._adInstance=e.adInstance,this._eventBus=e.eventBus,this.adsBlocked=e.adsBlocked,this._onResumeGame=e.onResumeGame.bind(e),this._setAdRequestTimer=e._setAdRequestTimer.bind(e),this._giveGift=e._giveGift.bind(e)}var i,a;return T(n,[{key:"runAdFlow",value:(a=e(r.mark((function e(n){var i,a,s,o,d,c,u,l,h,p,f,m,v,g,b,y,_,w,A,k,E,x,R,S,D,T,O,I,P=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d=this._getAdTypeByAfgPosition(n),c=this._getAdFlow(d),u=this._gameData,l=u.afg_disabled,h=null===(i=u.promo)||void 0===i||null===(a=i.rainbow)||void 0===a?void 0:a.enabled,p=null===(s=u.promo)||void 0===s?void 0:s.onadsense,f="reward"===(null===(o=n.params)||void 0===o?void 0:o.position),m=l?c.filter(function(e){return t(this,P),"adsense"!==e}.bind(this)):c,v=!1,g=!1,b=[],y=0,_=!1,this.adsBlocked&&(Va("gd-adflow adsBlocked so changing the flow"),m=[m[0]]),w=jA(m),e.prev=18,w.s();case 20:if((A=w.n()).done){e.next=47;break}return k=A.value,n.params.adapter=k,E=y===m.length-1,h&&E&&"ima"===k&&(n.params.runPromoAsImaFallback=!0),x=E&&"adsense"===k&&h&&p&&f,n.params=UA(UA({},n.params),{},{adapterIndex:y,isLastAdapter:E,shouldFail:!1,extraPromoRunOnFail:x}),function(){t(this,P)}.bind(this),Va("gd-adflow, before adInvoke",y,k,n.params.shouldFail),e.next=31,this.adInvoke(n);case 31:if(R=e.sent,S=R.success,D=R.args,!S){e.next=41;break}return Va("gd-adflow, adapter-result-success",y,k,D),v=!0,g=!(null==D||!D.isPromoSuccess),e.abrupt("break",47);case 41:Va("gd-adflow, adapter-result-failure",y,k,D.message),y++,b.push(D.message),E&&"adsense"===k&&h&&p&&f&&(_=!0);case 45:e.next=20;break;case 47:e.next=52;break;case 49:e.prev=49,e.t0=e.catch(18),w.e(e.t0);case 52:return e.prev=52,w.f(),e.finish(52);case 55:if(!_){e.next=64;break}return n.params.adapter="promo",e.next=60,this.adInvoke(n);case 60:e.sent.success&&(g=!0);case 64:(function(){t(this,P)}).bind(this),T=b.join(" /n"),v?(this._setAdRequestTimer(),this._onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),this._giveGift()):(this._onResumeGame(T,"warning"),this._giveGift()),O="-1",I="none",v&&g?O="promo_ima":v?(O="index_".concat(y),I=m[y]):g&&(O="promo_adsense"),this._msgrt.send("adflow.all.index",{message:"".concat(O)}),this._msgrt.send("adflow.all.success_adapter",{message:"".concat(I)}),this._msgrt.send("adflow.".concat(d,".index"),{message:"".concat(O)}),this._msgrt.send("adflow.".concat(d,".success_adapter"),{message:"".concat(I)});case 76:case"end":return e.stop()}}),e,this,[[18,49,52,55]])}))),function(e){return a.apply(this,arguments)})},{key:"adInvoke",value:(i=e(r.mark((function n(i){var a=this;return r.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(){var n=e(r.mark((function e(n,s){var o,d,c,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="main.showad.".concat(i.params.adapter,".").concat(i.params.adapterIndex),d=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!1,args:e})}.bind(this),c=function(e){t(this,u),a._eventBus.unsubscribeScope(o),n({success:!0,args:e})}.bind(this),a._eventBus.subscribe("AD_ERROR",d,o),a._eventBus.subscribe("AD_SDK_CANCELED",d,o),a._eventBus.subscribe("AD_SUCCESS",c,o),e.prev=6,e.next=9,a._adInstance.startAd(i);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(6),Wa("gd-adflow startAd error",e.t0),n({success:!1,err:e.t0});case 15:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(e,t){return n.apply(this,arguments)}}()));case 1:case"end":return n.stop()}}),n)}))),function(e){return i.apply(this,arguments)})},{key:"_getAdFlow",value:function(e){var n,r,i,a,s,o,d,c,u=this,l=void function(){t(this,u)}.bind(this),h=this._gameData.adflw;l&&(h=l);var p=null!==(n=h)&&void 0!==n&&null!==(r=n.adapters)&&void 0!==r&&r.default?null===(i=h)||void 0===i||null===(a=i.adapters)||void 0===a?void 0:a.default:["ima","adsense"];return p=null!==(s=h)&&void 0!==s&&null!==(o=s.adapters)&&void 0!==o&&o[e]?null===(d=h)||void 0===d||null===(c=d.adapters)||void 0===c?void 0:c[e]:p}}]),n}();function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function BA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NA(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var FA,qA=null,VA=null,WA=function(){function n(e){var r=this;if(S(this,n),qA)return qA;qA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,e),this._version=e.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new _y,this._location.print(),this._parentURL=0===this._bridge.depth?encodeURIComponent(this._bridge.parentURL):this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){t(this,r),this._sdk_ready=!0}.bind(this)).catch(function(e){t(this,r),this._sdk_ready=!1}.bind(this)).finally(function(){var e,n;t(this,r),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(n=this._gameData.evnts)&&void 0!==n&&n.enabled&&this._isLoaderGameURL()&&OA(this._gameData)}.bind(this)),this._registerSGBridge(),this._whichFrame()}var i,g,b,y,w,D,P,C,L,U,M,G;return T(n,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(t(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var n=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];n&&n.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(G=e(r.mark((function e(){var t,n,i,a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(i=new _y,0!==(null==(a=i.get("depth"))?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=6;break}return e.next=6,xA();case 6:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{key:"testConsent",value:function(){try{yA();e(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_A({});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"_registerSGBridge",value:function(){var e=this;RA.on("splash-hidden",function(n){t(this,e),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{key:"_sendLoadedEvent",value:function(){if(!this._isLoaded&&(this._isLoaded=!0,"loader-frame"===this._whichFrame()))try{this._whichFrame(),this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"})}catch(e){}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),this._gameDockGamePlaySent=!0}catch(e){}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(M=e(r.mark((function e(n,i){var a,s=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:return this._gameData=e.sent,e.next=6,this._loadCMP();case 6:this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(a=this._gameData.enableAds)||void 0===a?void 0:a.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){t(this,s);var n="".concat(e).startsWith("Error: Blocked:");Va("gd-adflow adsBlocked",n,e),this.adsBlocked=n,console.error(e.message||e)}.bind(this))),n(this._gameData),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),i(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return M.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=j(e);this.options=t?h(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Ba.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var n=this;void 0===this._topDomain&&(this._topDomain=void 0);var r={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(N.stringify(r))).catch(function(e){t(this,n)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=c("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,p("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!m.available)return;"developer.gamedistribution.com"===this._parentDomain?(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0),m.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(m.set("gd_debug_ex",!0),m.set("gd_disable_midroll_timer",!0)),m.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new l({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:o(),version:Ba.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:u(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var n=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];f(n[0],"GamedockSDK",{alternates:n}).then(function(){var n,r;t(this,e),VA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&VA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),wA.track(VA,this._gameData)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=VA)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var n=["https://ext.minijuegosgratis.com/external-host/main.js"];f(n[0],"MinijuegosSDK",{alternates:n}).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,n=["https://www.google-analytics.com/analytics.js"];f(n[0],"gdsdk_google_analytics",{alternates:n,error_prefix:"Blocked:",exists:function(){return t(this,e),window.ga}.bind(this)}).then(function(){t(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(n){t(this,e),this._sendSDKError(n)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new _,A.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),k.forEach(function(n){var r=this;return t(this,e),this.eventBus.subscribe(n,function(e){return t(this,r),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(t(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var n=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(n,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(n,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return t(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(n){var r,i;t(this,e),this.msgrt.send("ad.impression"),null!==(r=this._gameData.diagnostic)&&void 0!==r&&null!==(i=r.gameDock)&&void 0!==i&&i.adViewEvent&&wA.track(VA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(n){t(this,e),this.msgrt.send("ad.error",{message:n.message,details:n.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(n){t(this,e),this._sendAdRequestContext(n.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(n){t(this,e),n.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:n.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:n.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(n){t(this,e),this.msgrt.send("tunnl.keys.empty",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(n){t(this,e),this.msgrt.send("tunnl.keys.fallback",{message:n.message,details:n.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(n){return t(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(Ba.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(U=e(r.mark((function e(){var n,i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this._gameData,n=void 0===this._gameData.dmain||this._gameData.dmain,(i.bloc_gard&&!0===i.bloc_gard.enabled||!n)&&(this.msgrt.send("blocked"),setTimeout(function(){t(this,a),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(N.stringify({domain:this._parentDomain,id:i.gameId,img:this._get_game_thumbnail_url(),title:i.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return U.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){t(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;m.available&&m.getBoolean("gd_debug_ex")&&(m.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,i=this._gameData,a=i.gdpr&&!0===i.gdpr.consent,s=i.loader,o=null===(e=i.promo)||void 0===e?void 0:e[null===(t=i.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(i.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(i,a):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=o&&o.enabled?this._createPromoBeforeSplash(i,a):!1!==s.enabled&&this._createSplash(i,a):null!=o&&o.enabled&&this._createPromo(i,a))}},{key:"_initializeVideoAd",value:(L=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=h(this.options.advertisementSettings,t.sdk)),this.macros=new E({game:t,bridge:this._bridge}),this.adInstance=new hA(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=Ba,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17:case"end":return e.stop()}}),e,this)}))),function(){return L.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){p(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(C=e(r.mark((function e(){var t;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:return t=e.sent,this.msgrt.setGameData(t),x(t.diagnostic),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"_createSplash",value:(P=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(n);case 2:return a=e.sent,s=new a(BA(BA({},this.options),{},{isConsentDomain:i,version:Ba.version}),n,this._parentDomain),e.next=6,n_();case 6:o=e.sent,d=o.enabled,s.on("playClick",function(){var e=this;if(t(this,c),i){var n=new Date;n.setDate(n.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(n.toUTCString(),"; path=/")}this._hideCMPButton(),d?window.gdsdk.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e),s.hide()}.bind(this)):(function(){t(this,e)}.bind(this),this.showAd(v.Interstitial,{position:"preroll"}).catch(function(n){t(this,e)}.bind(this)))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){t(this,c),s.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){t(this,c),s.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(D=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(BA(BA({},this.options),{},{isConsentDomain:i,version:Ba.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this._createSplash(n,i)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(n,i);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return D.apply(this,arguments)})},{key:"_createPromo",value:(w=e(r.mark((function e(n,i){var a,s,o,d,c=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(n);case 3:o=e.sent,(d=new o(BA(BA({},this.options),{},{isConsentDomain:i,version:Ba.version,template:null===(a=n.promo)||void 0===a||null===(s=a.template)||void 0===s?void 0:s.preroll}),n)).on("done",function(){t(this,c),d.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return w.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(v.Interstitial).catch(function(){t(this,e)}.bind(this))}},{key:"showAd",value:(y=e(r.mark((function t(n){var i,a=this,s=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>1&&void 0!==s[1]?s[1]:{},t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,s){var o,d,c,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d={adType:n,params:i,adTimestamp:a.adRequestTimer},e.next=5,a.sdkReady;case 5:return c=e.sent,e.next=8,a.videoAdReady;case 8:if(null!==(o=a._gameData.lp)&&void 0!==o&&o.load||a._sendLoadedEvent(),a._sendGamedockGamePlay(),a._rejectAdIfGameBlocked({gameData:c,adRequest:d}),a._rejectAdIfAdDisabled({gameData:c,adRequest:d}),a._rejectAdIfUnsupportedType({adRequest:d}),a._rejectAdIfRewardedDisabled({gameData:c,adRequest:d}),null!=i&&i.isGift||a._rejectAdIfAdRateHits({gameData:c,adRequest:d}),a.adInstance.attachAfgPosition(d),!a.adFlowRunning){e.next=18;break}return e.abrupt("return",t());case 18:return a.adFlowRunning=!0,u=new GA(a),e.next=22,u.runAdFlow(d);case 22:a.adFlowRunning=!1,t(),a._post_message({topic:"adrequest.instream"}),e.next=32;break;case 27:e.prev=27,e.t0=e.catch(0),a.adFlowRunning=!1,a.onResumeGame(e.t0.message,"warning"),s(e.t0.message);case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t)}))),function(e){return y.apply(this,arguments)})},{key:"_giveGift",value:function(){var e,t,n,r,i;null!==(e=this._gameData)&&void 0!==e&&null!==(t=e.gft)&&void 0!==t&&t.enabled&&(null===(n=this._gameData)||void 0===n||null===(r=n.gft)||void 0===r||null===(i=r.durations[this._giftCount])||void 0===i?void 0:i.after)===this.adInstance.adMidrollCount&&this.decideToGiveAGift()}},{key:"_setAdRequestTimer",value:function(){this.adRequestTimer=Date.now()}},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{key:"_rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"_rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"_rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==v.Interstitial&&t.adType!==v.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=v.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===v.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,a,s,o=e.gameData,d=e.adRequest,c=null;d.adType===v.Interstitial&&null!==(t=o.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=o.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(a=o.diagnostic)||void 0===a||null===(s=a.useMidrollIndex)||void 0===s?void 0:s.indexes[this.adInstance.adMidrollCount])):c=o.midroll;if(d.adType===v.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(b=e(r.mark((function t(n){var i=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,a){var s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.sdkReady;case 3:return s=e.sent,e.next=6,i.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!i._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(n){e.next=14;break}n=v.Rewarded,e.next=16;break;case 14:if(n===v.Interstitial||n===v.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+n);case 16:if(n!==v.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,i.adInstance.preloadAd(n);case 20:o=e.sent,t(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(e){return b.apply(this,arguments)})},{key:"cancelAd",value:(g=e(r.mark((function t(){var n=this;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(){var t=e(r.mark((function e(t,i){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n.adInstance.cancel(),n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),i()}catch(e){n.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),t(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(e,n){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),function(){return g.apply(this,arguments)})},{key:"showDisplayAd",value:function(t){var n=this;return new Promise(function(){var i=e(r.mark((function e(i,a){var s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.dAds.enabled){e.next=13;break}return e.next=9,n.adInstance.loadDisplayAd(t);case 9:n._post_message({topic:"adrequest.display"}),i(),e.next=14;break;case 13:a("Display-Ads are disabled.");case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),a(e.t0.message||e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(e,t){return i.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){console.log("gd-adflow error onResumeGame",e),p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||IA({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){p("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||IA({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new R(this).start(),m.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var n=this._gameData;n.sdk.fullscreen&&"auto"===n.sdk.fullscreen&&document.addEventListener("click",function(){if(t(this,e),!this._isFullScreen){var n=document.body,r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(r)r.call(n);else if(void 0!==window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var n=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){t(this,n),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var n=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var r=this;t(this,n);var i=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),i||(e.onclick=function(e){return t(this,r),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a()),c=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:s()),u=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===o()?c:d()),l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled,b=(e||n)&&r.loaderEnabled,y=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:l,noLoadedEvent:h,noBlockerEvent:p,noPreroll:b,parentURL:i,parentDomain:c,topDomain:u&&u.length?u:c,noGAPageView:f,noLotamePageView:m,noGamedockSDK:v,noMinijuegosSDK:g,version:r.version,pauseGameOnStartup:y,depth:o(),domainMatched:c===u,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_whichFrame",value:function(){return(this._isMasterGameURL()||this._isExtHostedGameURL())&&!this._isTokenGameURL()?"loader-frame":"game-frame"}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new O(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new O(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var i=new O(location.href,!0);if(!i.query.gd_zone_config)return;e=i.query.gd_zone_config}return JSON.parse(I.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new fA(t).splash()}},{key:"_createPrerollPromoTemplate",value:(i=e(r.mark((function e(t){var n,i,a,s,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(n=t.promo)||void 0===n?void 0:n[null===(i=t.promo)||void 0===i||null===(a=i.template)||void 0===a?void 0:a.preroll],o=new pA(s),e.abrupt("return",o.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(I.encode(JSON.stringify(e)))}catch(e){}try{var n=new O(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(N.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new O(e,!0);return n.query=BA(BA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return I.encode(JSON.stringify(e))}},{key:"session",value:function(){var t=this;return new Promise(function(){var n=e(r.mark((function e(n,i){var a;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.sdkReady;case 3:e.next=7;break;case 5:e.prev=5,e.t0=e.catch(0);case 7:a=t._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:t._bridge.parentDomain,topDomain:t._bridge.topDomain,parentURL:t._bridge.parentURL,depth:t._bridge.depth,loadedByGameZone:t._bridge.isTokenGameURL}});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"sendGenericEvent",value:function(e){console.log("Received generic event",e,this._isMasterGameURL());try{var t,n;if("track-milestone"==e.eventName)VA.tracking.trackEvent("milestoneAchieved",{pageId:this.options.gameId,pageType:"game",isAuthorized:null===(t=e.data)||void 0===t?void 0:t.isAuthorized,milestoneDescription:null===(n=e.data)||void 0===n?void 0:n.milestoneDescription})}catch(e){console.log(e.message)}}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,n=this._gameData,r=n.assets.find(function(n){return t(this,e),n.hasOwnProperty("name")&&512===n.width&&512===n.height}.bind(this));return r||(r=n.assets.length>0?n.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(r.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,i=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var a=window.top||window.parent;a&&a.postMessage({source:"gdsdk",topic:n,data:r},i)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var n=this;try{var i,a=null===(i=this._gameData)||void 0===i?void 0:i.gft,s=setInterval(e(r.mark((function e(){var i=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.adInstance.requestRunning||n.adFlowRunning?console.log("Advertisement already running..."):(n.showAd(v.Interstitial,{position:"midroll",isGift:!0}).catch(function(e){t(this,i)}.bind(this)),clearInterval(s),n._giftCount++);case 1:case"end":return e.stop()}}),e,this)}))),1e3*a.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),n}(),HA={},zA=function(e){try{if(e.skipForward)return;if(HA.source){var t={type:"gd-sdk-on-event",event:e};HA.source.postMessage(t,HA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},KA=function(){zA({name:"SDK_READY",status:"success",message:"Everything is ready."}),zA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),zA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},$A=function(n){window.addEventListener("message",(function(i){var a=i.data,s=i.origin,o=i.source,d=a.type,c=a.method,u=a.options;if("gd-sdk-self"!==d){if("gd-sdk"===d){if(!HA.source&&"init"===c)return function(e){var t=e.source,n=e.origin;HA={source:t,origin:n}}({source:o,origin:s}),void KA();var l=n[c];l&&e(r.mark((function e(){var i,a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,function(){t(this,a),"showAd"===c&&za.firstAdapterModeAdsense&&"rewarded"!==u.adType&&(console.log("promo-test, set first adapter to adssense 3"),u.params=u.params?u.params:{},u.params.adapter="adsense")}.bind(this),!(i=l.apply(n,Object.values(u)))||!i.then){e.next=6;break}return e.next=6,i;case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gd:adp:m:r onFrameMessage error",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})))()}}else{var h={type:"gd-sdk",method:c,options:u};window.postMessage(h,"https://html5.gamedistribution.com")}}),!1)},QA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){zA(e),t.apply(this,arguments)}}(e);var t=new WA(e);return $A(t),t},YA=function(e){try{var t=Ky(e);e.gameId||t.send("nogameid",{message:"".concat(Vv.parentURL)})}catch(e){}},JA={create:function(){var t=e(r.mark((function e(t){var n,i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,YA(t),zy=Ky(Qy=t),e.next=5,u_();case 5:return n=e.sent,i=n?o_(t):QA(t),r_(),e.abrupt("return",i);case 11:return e.prev=11,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",QA(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}()};function XA(){return(XA=e(r.mark((function e(t,n){var i;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s_();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,ek(t);case 9:e.t0=e.sent;case 10:return i=e.t0,e.abrupt("return",n(i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ZA=!1;function ek(e){var n=this;return new Promise(function(r,i){var a=this;if(t(this,n),FA)return r(FA);if(ZA)var s=setInterval(function(){t(this,a),FA&&(ZA=!1,clearInterval(s),r(FA))}.bind(this),100);else ZA=!0,JA.create(e).then(function(e){t(this,a),FA=e,e._sendSDKReady(),ZA=!1,r(FA)}.bind(this))}.bind(this))}var tk,nk=(ek(tk=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":n(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===n(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}()),{invoke:function(e){return function(e,t){return XA.apply(this,arguments)}(tk,e)}});function rk(){var n=this;this.AdType=v,this.preloadAd=function(e){var n=this;return nk.invoke(function(r){return t(this,n),r.preloadAd(e)}.bind(this))},this.showAd=function(){var n=e(r.mark((function e(n,i){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",nk.invoke(function(e){var r=this;if(t(this,a),n===v.Display)return e.showDisplayAd(i);return function(){t(this,r)}.bind(this),e.showAd(n,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(e,t){return n.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return nk.invoke(function(n){return t(this,e),n.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return nk.invoke(function(n){return t(this,e),n.openConsole()}.bind(this))},this.getSession=function(){var e=this;return nk.invoke(function(n){return t(this,e),n.session()}.bind(this))},this.sendEvent=function(e){var n=this;return nk.invoke(function(r){return t(this,n),r.sendGenericEvent(e)}.bind(this))},this.leaderboard={show:function(){t(this,n),Cm.showLeaderboard()}.bind(this),addScore:function(e){t(this,n),Cm.addScore(e)}.bind(this)}}rk.prototype=new function(){this.showBanner=function(){var e=this;return nk.invoke(function(n){return t(this,e),n.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new rk,window.gdApi=window.gdsdk;