@bygd/gd-sdk-pes 1.28.13 → 1.28.14
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
|
-
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/createClass"),u=require("url-parse"),d=require("js-base64"),c=require("validator"),l=require("is-valid-domain"),h=require("get-value"),f=require("set-value"),p=require("lodash.clonedeep"),m=require("can-autoplay"),v=require("is-plain-object"),g=require("querystringify"),y=require("lodash.merge"),b=require("events"),_=require("uuid");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=w(e),k=w(t),E=w(n),x=w(r),S=w(i),R=w(s),T=w(o),D=w(u),I=w(c),O=w(l),P=w(h),C=w(f),L=w(p),U=w(m),j=w(g),M=w(y),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},q=function(e){return e&&e.Math==Math&&e},G=q("object"==typeof globalThis&&globalThis)||q("object"==typeof window&&window)||q("object"==typeof self&&self)||q("object"==typeof B&&B)||Function("return this")(),N={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},F=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},V=F,W=function(e,t,n){if(V(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},K=function(e){try{return!!e()}catch(e){return!0}},H={}.toString,z=function(e){return H.call(e).slice(8,-1)},$=z,Q="".split,Y=K((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==$(e)?Q.call(e,""):Object(e)}:Object,J=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},X=J,Z=function(e){return Object(X(e))},ee=Math.ceil,te=Math.floor,ne=function(e){return isNaN(e=+e)?0:(e>0?te:ee)(e)},re=ne,ae=Math.min,ie=function(e){return e>0?ae(re(e),9007199254740991):0},se=function(e){return"object"==typeof e?null!==e:"function"==typeof e},oe=z,ue=Array.isArray||function(e){return"Array"==oe(e)},de={exports:{}},ce=!K((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),le={},he=se,fe=G.document,pe=he(fe)&&he(fe.createElement),me=function(e){return pe?fe.createElement(e):{}},ve=me,ge=!ce&&!K((function(){return 7!=Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ye=se,be=function(e){if(!ye(e))throw TypeError(String(e)+" is not an object");return e},_e=se,we=function(e,t){if(!_e(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!_e(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ae=ce,ke=ge,Ee=be,xe=we,Se=Object.defineProperty;le.f=Ae?Se:function(e,t,n){if(Ee(e),t=xe(t,!0),Ee(n),ke)try{return Se(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Re=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Te=le,De=Re,Ie=ce?function(e,t,n){return Te.f(e,t,De(1,n))}:function(e,t,n){return e[t]=n,e},Oe=G,Pe=Ie,Ce=function(e,t){try{Pe(Oe,e,t)}catch(n){Oe[e]=t}return t},Le=Ce,Ue=G["__core-js_shared__"]||Le("__core-js_shared__",{}),je=Ue;(de.exports=function(e,t){return je[e]||(je[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Me={}.hasOwnProperty,Be=function(e,t){return Me.call(e,t)},qe=0,Ge=Math.random(),Ne=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++qe+Ge).toString(36)},Fe=K,Ve=!!Object.getOwnPropertySymbols&&!Fe((function(){return!String(Symbol())})),We=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=G,He=de.exports,ze=Be,$e=Ne,Qe=Ve,Ye=We,Je=He("wks"),Xe=Ke.Symbol,Ze=Ye?Xe:Xe&&Xe.withoutSetter||$e,et=function(e){return ze(Je,e)||(Qe&&ze(Xe,e)?Je[e]=Xe[e]:Je[e]=Ze("Symbol."+e)),Je[e]},tt=se,nt=ue,rt=et("species"),at=function(e,t){var n;return nt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!nt(n.prototype)?tt(n)&&null===(n=n[rt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},it=W,st=Y,ot=Z,ut=ie,dt=at,ct=[].push,lt=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=5==e||i;return function(o,u,d,c){for(var l,h,f=ot(o),p=st(f),m=it(u,d,3),v=ut(p.length),g=0,y=c||dt,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in p)&&(h=m(l=p[g],g,f),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return g;case 2:ct.call(b,l)}else if(a)return!1;return i?-1:r||a?a:b}},ht={forEach:lt(0),map:lt(1),filter:lt(2),some:lt(3),every:lt(4),find:lt(5),findIndex:lt(6)},ft=K,pt=function(e,t){var n=[][e];return!!n&&ft((function(){n.call(null,t||function(){throw 1},1)}))},mt=ce,vt=K,gt=Be,yt=Object.defineProperty,bt={},_t=function(e){throw e},wt=function(e,t){if(gt(bt,e))return bt[e];t||(t={});var n=[][e],r=!!gt(t,"ACCESSORS")&&t.ACCESSORS,a=gt(t,0)?t[0]:_t,i=gt(t,1)?t[1]:void 0;return bt[e]=!!n&&!vt((function(){if(r&&!mt)return!0;var e={length:-1};r?yt(e,1,{enumerable:!0,get:_t}):e[1]=1,n.call(e,a,i)}))},At=ht.forEach,kt=wt,Et=pt("forEach"),xt=kt("forEach"),St=G,Rt=N,Tt=Et&&xt?[].forEach:function(e){return At(this,e,arguments.length>1?arguments[1]:void 0)},Dt=Ie;for(var It in Rt){var Ot=St[It],Pt=Ot&&Ot.prototype;if(Pt&&Pt.forEach!==Tt)try{Dt(Pt,"forEach",Tt)}catch(e){Pt.forEach=Tt}}var Ct={},Lt={},Ut={}.propertyIsEnumerable,jt=Object.getOwnPropertyDescriptor,Mt=jt&&!Ut.call({1:2},1);Lt.f=Mt?function(e){var t=jt(this,e);return!!t&&t.enumerable}:Ut;var Bt=Y,qt=J,Gt=function(e){return Bt(qt(e))},Nt=ce,Ft=Lt,Vt=Re,Wt=Gt,Kt=we,Ht=Be,zt=ge,$t=Object.getOwnPropertyDescriptor;Ct.f=Nt?$t:function(e,t){if(e=Wt(e),t=Kt(t,!0),zt)try{return $t(e,t)}catch(e){}if(Ht(e,t))return Vt(!Ft.f.call(e,t),e[t])};var Qt={exports:{}},Yt=Ue,Jt=Function.toString;"function"!=typeof Yt.inspectSource&&(Yt.inspectSource=function(e){return Jt.call(e)});var Xt,Zt,en,tn=Yt.inspectSource,nn=tn,rn=G.WeakMap,an="function"==typeof rn&&/native code/.test(nn(rn)),sn=de.exports,on=Ne,un=sn("keys"),dn=function(e){return un[e]||(un[e]=on(e))},cn={},ln=an,hn=se,fn=Ie,pn=Be,mn=dn,vn=cn,gn=G.WeakMap;if(ln){var yn=new gn,bn=yn.get,_n=yn.has,wn=yn.set;Xt=function(e,t){return wn.call(yn,e,t),t},Zt=function(e){return bn.call(yn,e)||{}},en=function(e){return _n.call(yn,e)}}else{var An=mn("state");vn[An]=!0,Xt=function(e,t){return fn(e,An,t),t},Zt=function(e){return pn(e,An)?e[An]:{}},en=function(e){return pn(e,An)}}var kn={set:Xt,get:Zt,has:en,enforce:function(e){return en(e)?Zt(e):Xt(e,{})},getterFor:function(e){return function(t){var n;if(!hn(t)||(n=Zt(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},En=G,xn=Ie,Sn=Be,Rn=Ce,Tn=tn,Dn=kn.get,In=kn.enforce,On=String(String).split("String");(Qt.exports=function(e,t,n,r){var a=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Sn(n,"name")||xn(n,"name",t),In(n).source=On.join("string"==typeof t?t:"")),e!==En?(a?!s&&e[t]&&(i=!0):delete e[t],i?e[t]=n:xn(e,t,n)):i?e[t]=n:Rn(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Dn(this).source||Tn(this)}));var Pn=G,Cn=Pn,Ln=G,Un=function(e){return"function"==typeof e?e:void 0},jn=function(e,t){return arguments.length<2?Un(Cn[e])||Un(Ln[e]):Cn[e]&&Cn[e][t]||Ln[e]&&Ln[e][t]},Mn={},Bn=ne,qn=Math.max,Gn=Math.min,Nn=function(e,t){var n=Bn(e);return n<0?qn(n+t,0):Gn(n,t)},Fn=Gt,Vn=ie,Wn=Nn,Kn=function(e){return function(t,n,r){var a,i=Fn(t),s=Vn(i.length),o=Wn(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Hn={includes:Kn(!0),indexOf:Kn(!1)},zn=Be,$n=Gt,Qn=Hn.indexOf,Yn=cn,Jn=function(e,t){var n,r=$n(e),a=0,i=[];for(n in r)!zn(Yn,n)&&zn(r,n)&&i.push(n);for(;t.length>a;)zn(r,n=t[a++])&&(~Qn(i,n)||i.push(n));return i},Xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zn=Jn,er=Xn.concat("length","prototype");Mn.f=Object.getOwnPropertyNames||function(e){return Zn(e,er)};var tr={};tr.f=Object.getOwnPropertySymbols;var nr=Mn,rr=tr,ar=be,ir=jn("Reflect","ownKeys")||function(e){var t=nr.f(ar(e)),n=rr.f;return n?t.concat(n(e)):t},sr=Be,or=ir,ur=Ct,dr=le,cr=function(e,t){for(var n=or(t),r=dr.f,a=ur.f,i=0;i<n.length;i++){var s=n[i];sr(e,s)||r(e,s,a(t,s))}},lr=K,hr=/#|\.prototype\./,fr=function(e,t){var n=mr[pr(e)];return n==gr||n!=vr&&("function"==typeof t?lr(t):!!t)},pr=fr.normalize=function(e){return String(e).replace(hr,".").toLowerCase()},mr=fr.data={},vr=fr.NATIVE="N",gr=fr.POLYFILL="P",yr=fr,br=G,_r=Ct.f,wr=Ie,Ar=Qt.exports,kr=Ce,Er=cr,xr=yr,Sr=function(e,t){var n,r,a,i,s,o=e.target,u=e.global,d=e.stat;if(n=u?br:d?br[o]||kr(o,{}):(br[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_r(n,r))&&s.value:n[r],!xr(u?r:o+(d?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Er(i,a)}(e.sham||a&&a.sham)&&wr(i,"sham",!0),Ar(n,r,i,e)}},Rr=Jn,Tr=Xn,Dr=Object.keys||function(e){return Rr(e,Tr)},Ir=Z,Or=Dr;Sr({target:"Object",stat:!0,forced:K((function(){Or(1)}))},{keys:function(e){return Or(Ir(e))}});var Pr,Cr={},Lr=le,Ur=be,jr=Dr,Mr=ce?Object.defineProperties:function(e,t){Ur(e);for(var n,r=jr(t),a=r.length,i=0;a>i;)Lr.f(e,n=r[i++],t[n]);return e},Br=jn("document","documentElement"),qr=be,Gr=Mr,Nr=Xn,Fr=cn,Vr=Br,Wr=me,Kr=dn("IE_PROTO"),Hr=function(){},zr=function(e){return"<script>"+e+"<\/script>"},$r=function(){try{Pr=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;$r=Pr?function(e){e.write(zr("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Pr):((t=Wr("iframe")).style.display="none",Vr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(zr("document.F=Object")),e.close(),e.F);for(var n=Nr.length;n--;)delete $r.prototype[Nr[n]];return $r()};Fr[Kr]=!0;var Qr=Object.create||function(e,t){var n;return null!==e?(Hr.prototype=qr(e),n=new Hr,Hr.prototype=null,n[Kr]=e):n=$r(),void 0===t?n:Gr(n,t)},Yr={},Jr=Gt,Xr=Mn.f,Zr={}.toString,ea="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yr.f=function(e){return ea&&"[object Window]"==Zr.call(e)?function(e){try{return Xr(e)}catch(e){return ea.slice()}}(e):Xr(Jr(e))};var ta={},na=et;ta.f=na;var ra=Pn,aa=Be,ia=ta,sa=le.f,oa=function(e){var t=ra.Symbol||(ra.Symbol={});aa(t,e)||sa(t,e,{value:ia.f(e)})},ua=le.f,da=Be,ca=et("toStringTag"),la=function(e,t,n){e&&!da(e=n?e:e.prototype,ca)&&ua(e,ca,{configurable:!0,value:t})},ha=Sr,fa=G,pa=jn,ma=ce,va=Ve,ga=We,ya=K,ba=Be,_a=ue,wa=se,Aa=be,ka=Z,Ea=Gt,xa=we,Sa=Re,Ra=Qr,Ta=Dr,Da=Mn,Ia=Yr,Oa=tr,Pa=Ct,Ca=le,La=Lt,Ua=Ie,ja=Qt.exports,Ma=de.exports,Ba=cn,qa=Ne,Ga=et,Na=ta,Fa=oa,Va=la,Wa=kn,Ka=ht.forEach,Ha=dn("hidden"),za=Ga("toPrimitive"),$a=Wa.set,Qa=Wa.getterFor("Symbol"),Ya=Object.prototype,Ja=fa.Symbol,Xa=pa("JSON","stringify"),Za=Pa.f,ei=Ca.f,ti=Ia.f,ni=La.f,ri=Ma("symbols"),ai=Ma("op-symbols"),ii=Ma("string-to-symbol-registry"),si=Ma("symbol-to-string-registry"),oi=Ma("wks"),ui=fa.QObject,di=!ui||!ui.prototype||!ui.prototype.findChild,ci=ma&&ya((function(){return 7!=Ra(ei({},"a",{get:function(){return ei(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Za(Ya,t);r&&delete Ya[t],ei(e,t,n),r&&e!==Ya&&ei(Ya,t,r)}:ei,li=function(e,t){var n=ri[e]=Ra(Ja.prototype);return $a(n,{type:"Symbol",tag:e,description:t}),ma||(n.description=t),n},hi=ga?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ja},fi=function(e,t,n){e===Ya&&fi(ai,t,n),Aa(e);var r=xa(t,!0);return Aa(n),ba(ri,r)?(n.enumerable?(ba(e,Ha)&&e[Ha][r]&&(e[Ha][r]=!1),n=Ra(n,{enumerable:Sa(0,!1)})):(ba(e,Ha)||ei(e,Ha,Sa(1,{})),e[Ha][r]=!0),ci(e,r,n)):ei(e,r,n)},pi=function(e,t){Aa(e);var n=Ea(t),r=Ta(n).concat(yi(n));return Ka(r,(function(t){ma&&!mi.call(n,t)||fi(e,t,n[t])})),e},mi=function(e){var t=xa(e,!0),n=ni.call(this,t);return!(this===Ya&&ba(ri,t)&&!ba(ai,t))&&(!(n||!ba(this,t)||!ba(ri,t)||ba(this,Ha)&&this[Ha][t])||n)},vi=function(e,t){var n=Ea(e),r=xa(t,!0);if(n!==Ya||!ba(ri,r)||ba(ai,r)){var a=Za(n,r);return!a||!ba(ri,r)||ba(n,Ha)&&n[Ha][r]||(a.enumerable=!0),a}},gi=function(e){var t=ti(Ea(e)),n=[];return Ka(t,(function(e){ba(ri,e)||ba(Ba,e)||n.push(e)})),n},yi=function(e){var t=e===Ya,n=ti(t?ai:Ea(e)),r=[];return Ka(n,(function(e){!ba(ri,e)||t&&!ba(Ya,e)||r.push(ri[e])})),r};(va||(ja((Ja=function(){if(this instanceof Ja)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=qa(e),n=function(e){this===Ya&&n.call(ai,e),ba(this,Ha)&&ba(this[Ha],t)&&(this[Ha][t]=!1),ci(this,t,Sa(1,e))};return ma&&di&&ci(Ya,t,{configurable:!0,set:n}),li(t,e)}).prototype,"toString",(function(){return Qa(this).tag})),ja(Ja,"withoutSetter",(function(e){return li(qa(e),e)})),La.f=mi,Ca.f=fi,Pa.f=vi,Da.f=Ia.f=gi,Oa.f=yi,Na.f=function(e){return li(Ga(e),e)},ma&&(ei(Ja.prototype,"description",{configurable:!0,get:function(){return Qa(this).description}}),ja(Ya,"propertyIsEnumerable",mi,{unsafe:!0}))),ha({global:!0,wrap:!0,forced:!va,sham:!va},{Symbol:Ja}),Ka(Ta(oi),(function(e){Fa(e)})),ha({target:"Symbol",stat:!0,forced:!va},{for:function(e){var t=String(e);if(ba(ii,t))return ii[t];var n=Ja(t);return ii[t]=n,si[n]=t,n},keyFor:function(e){if(!hi(e))throw TypeError(e+" is not a symbol");if(ba(si,e))return si[e]},useSetter:function(){di=!0},useSimple:function(){di=!1}}),ha({target:"Object",stat:!0,forced:!va,sham:!ma},{create:function(e,t){return void 0===t?Ra(e):pi(Ra(e),t)},defineProperty:fi,defineProperties:pi,getOwnPropertyDescriptor:vi}),ha({target:"Object",stat:!0,forced:!va},{getOwnPropertyNames:gi,getOwnPropertySymbols:yi}),ha({target:"Object",stat:!0,forced:ya((function(){Oa.f(1)}))},{getOwnPropertySymbols:function(e){return Oa.f(ka(e))}}),Xa)&&ha({target:"JSON",stat:!0,forced:!va||ya((function(){var e=Ja();return"[null]"!=Xa([e])||"{}"!=Xa({a:e})||"{}"!=Xa(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(wa(t)||void 0!==e)&&!hi(e))return _a(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!hi(t))return t}),a[1]=t,Xa.apply(null,a)}});Ja.prototype[za]||Ua(Ja.prototype,za,Ja.prototype.valueOf),Va(Ja,"Symbol"),Ba[Ha]=!0;var bi,_i,wi=jn("navigator","userAgent")||"",Ai=wi,ki=G.process,Ei=ki&&ki.versions,xi=Ei&&Ei.v8;xi?_i=(bi=xi.split("."))[0]+bi[1]:Ai&&(!(bi=Ai.match(/Edge\/(\d+)/))||bi[1]>=74)&&(bi=Ai.match(/Chrome\/(\d+)/))&&(_i=bi[1]);var Si=_i&&+_i,Ri=K,Ti=Si,Di=et("species"),Ii=function(e){return Ti>=51||!Ri((function(){var t=[];return(t.constructor={})[Di]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Oi=Sr,Pi=ht.filter,Ci=wt,Li=Ii("filter"),Ui=Ci("filter");Oi({target:"Array",proto:!0,forced:!Li||!Ui},{filter:function(e){return Pi(this,e,arguments.length>1?arguments[1]:void 0)}});var ji=Sr,Mi=K,Bi=Gt,qi=Ct.f,Gi=ce,Ni=Mi((function(){qi(1)}));ji({target:"Object",stat:!0,forced:!Gi||Ni,sham:!Gi},{getOwnPropertyDescriptor:function(e,t){return qi(Bi(e),t)}});var Fi=we,Vi=le,Wi=Re,Ki=function(e,t,n){var r=Fi(t);r in e?Vi.f(e,r,Wi(0,n)):e[r]=n},Hi=ir,zi=Gt,$i=Ct,Qi=Ki;Sr({target:"Object",stat:!0,sham:!ce},{getOwnPropertyDescriptors:function(e){for(var t,n,r=zi(e),a=$i.f,i=Hi(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Qi(s,t,n);return s}});var Yi=Sr,Ji=se,Xi=ue,Zi=Nn,es=ie,ts=Gt,ns=Ki,rs=et,as=wt,is=Ii("slice"),ss=as("slice",{ACCESSORS:!0,0:0,1:2}),os=rs("species"),us=[].slice,ds=Math.max;Yi({target:"Array",proto:!0,forced:!is||!ss},{slice:function(e,t){var n,r,a,i=ts(this),s=es(i.length),o=Zi(e,s),u=Zi(void 0===t?s:t,s);if(Xi(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Xi(n.prototype)?Ji(n)&&null===(n=n[os])&&(n=void 0):n=void 0,n===Array||void 0===n))return us.call(i,o,u);for(r=new(void 0===n?Array:n)(ds(u-o,0)),a=0;o<u;o++,a++)o in i&&ns(r,a,i[o]);return r.length=a,r}});var cs=be,ls=function(e,t,n,r){try{return r?t(cs(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&cs(a.call(e)),t}},hs={},fs=hs,ps=et("iterator"),ms=Array.prototype,vs=function(e){return void 0!==e&&(fs.Array===e||ms[ps]===e)},gs={};gs[et("toStringTag")]="z";var ys="[object z]"===String(gs),bs=ys,_s=z,ws=et("toStringTag"),As="Arguments"==_s(function(){return arguments}()),ks=bs?_s: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=Object(e),ws))?n:As?_s(t):"Object"==(r=_s(t))&&"function"==typeof t.callee?"Arguments":r},Es=ks,xs=hs,Ss=et("iterator"),Rs=function(e){if(null!=e)return e[Ss]||e["@@iterator"]||xs[Es(e)]},Ts=W,Ds=Z,Is=ls,Os=vs,Ps=ie,Cs=Ki,Ls=Rs,Us=function(e){var t,n,r,a,i,s,o=Ds(e),u="function"==typeof this?this:Array,d=arguments.length,c=d>1?arguments[1]:void 0,l=void 0!==c,h=Ls(o),f=0;if(l&&(c=Ts(c,d>2?arguments[2]:void 0,2)),null==h||u==Array&&Os(h))for(n=new u(t=Ps(o.length));t>f;f++)s=l?c(o[f],f):o[f],Cs(n,f,s);else for(i=(a=h.call(o)).next,n=new u;!(r=i.call(a)).done;f++)s=l?Is(a,c,[r.value,f],!0):r.value,Cs(n,f,s);return n.length=f,n},js=et("iterator"),Ms=!1;try{var Bs=0,Gs={next:function(){return{done:!!Bs++}},return:function(){Ms=!0}};Gs[js]=function(){return this},Array.from(Gs,(function(){throw 2}))}catch(e){}var Ns=function(e,t){if(!t&&!Ms)return!1;var n=!1;try{var r={};r[js]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Fs=Us;Sr({target:"Array",stat:!0,forced:!Ns((function(e){Array.from(e)}))},{from:Fs});var Vs,Ws,Ks,Hs=ne,zs=J,$s=function(e){return function(t,n){var r,a,i=String(zs(t)),s=Hs(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},Qs={codeAt:$s(!1),charAt:$s(!0)},Ys=!K((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Js=Be,Xs=Z,Zs=Ys,eo=dn("IE_PROTO"),to=Object.prototype,no=Zs?Object.getPrototypeOf:function(e){return e=Xs(e),Js(e,eo)?e[eo]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?to:null},ro=no,ao=Ie,io=Be,so=et("iterator"),oo=!1;[].keys&&("next"in(Ks=[].keys())?(Ws=ro(ro(Ks)))!==Object.prototype&&(Vs=Ws):oo=!0),null==Vs&&(Vs={}),io(Vs,so)||ao(Vs,so,(function(){return this}));var uo={IteratorPrototype:Vs,BUGGY_SAFARI_ITERATORS:oo},co=uo.IteratorPrototype,lo=Qr,ho=Re,fo=la,po=hs,mo=function(){return this},vo=function(e,t,n){var r=t+" Iterator";return e.prototype=lo(co,{next:ho(1,n)}),fo(e,r,!1),po[r]=mo,e},go=se,yo=be,bo=function(e){if(!go(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},_o=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return yo(n),bo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),wo=Sr,Ao=vo,ko=no,Eo=_o,xo=la,So=Ie,Ro=Qt.exports,To=hs,Do=uo.IteratorPrototype,Io=uo.BUGGY_SAFARI_ITERATORS,Oo=et("iterator"),Po=function(){return this},Co=function(e,t,n,r,a,i,s){Ao(n,t,r);var o,u,d,c=function(e){if(e===a&&m)return m;if(!Io&&e in f)return f[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,f=e.prototype,p=f[Oo]||f["@@iterator"]||a&&f[a],m=!Io&&p||c(a),v="Array"==t&&f.entries||p;if(v&&(o=ko(v.call(new e)),Do!==Object.prototype&&o.next&&(ko(o)!==Do&&(Eo?Eo(o,Do):"function"!=typeof o[Oo]&&So(o,Oo,Po)),xo(o,l,!0))),"values"==a&&p&&"values"!==p.name&&(h=!0,m=function(){return p.call(this)}),f[Oo]!==m&&So(f,Oo,m),To[t]=m,a)if(u={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(d in u)(Io||h||!(d in f))&&Ro(f,d,u[d]);else wo({target:t,proto:!0,forced:Io||h},u);return u},Lo=Qs.charAt,Uo=kn,jo=Co,Mo=Uo.set,Bo=Uo.getterFor("String Iterator");jo(String,"String",(function(e){Mo(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Bo(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Lo(n,r),t.index+=e.length,{value:e,done:!1})}));var qo=Sr,Go=ce,No=G,Fo=Be,Vo=se,Wo=le.f,Ko=cr,Ho=No.Symbol;if(Go&&"function"==typeof Ho&&(!("description"in Ho.prototype)||void 0!==Ho().description)){var zo={},$o=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof $o?new Ho(e):void 0===e?Ho():Ho(e);return""===e&&(zo[t]=!0),t};Ko($o,Ho);var Qo=$o.prototype=Ho.prototype;Qo.constructor=$o;var Yo=Qo.toString,Jo="Symbol(test)"==String(Ho("test")),Xo=/^Symbol\((.*)\)[^)]+$/;Wo(Qo,"description",{configurable:!0,get:function(){var e=Vo(this)?this.valueOf():this,t=Yo.call(e);if(Fo(zo,e))return"";var n=Jo?t.slice(7,-1):t.replace(Xo,"$1");return""===n?void 0:n}}),qo({global:!0,forced:!0},{Symbol:$o})}oa("iterator");var Zo=Qr,eu=le,tu=et("unscopables"),nu=Array.prototype;null==nu[tu]&&eu.f(nu,tu,{configurable:!0,value:Zo(null)});var ru=function(e){nu[tu][e]=!0},au=Gt,iu=ru,su=hs,ou=kn,uu=Co,du=ou.set,cu=ou.getterFor("Array Iterator"),lu=uu(Array,"Array",(function(e,t){du(this,{type:"Array Iterator",target:au(e),index:0,kind:t})}),(function(){var e=cu(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");su.Arguments=su.Array,iu("keys"),iu("values"),iu("entries");var hu=G,fu=N,pu=lu,mu=Ie,vu=et,gu=vu("iterator"),yu=vu("toStringTag"),bu=pu.values;for(var _u in fu){var wu=hu[_u],Au=wu&&wu.prototype;if(Au){if(Au[gu]!==bu)try{mu(Au,gu,bu)}catch(e){Au[gu]=bu}if(Au[yu]||mu(Au,yu,_u),fu[_u])for(var ku in pu)if(Au[ku]!==pu[ku])try{mu(Au,ku,pu[ku])}catch(e){Au[ku]=pu[ku]}}}var Eu=ks,xu=ys?{}.toString:function(){return"[object "+Eu(this)+"]"},Su=ys,Ru=Qt.exports,Tu=xu;Su||Ru(Object.prototype,"toString",Tu,{unsafe:!0});var Du=G.Promise,Iu=Qt.exports,Ou=function(e,t,n){for(var r in t)Iu(e,r,t[r],n);return e},Pu=jn,Cu=le,Lu=ce,Uu=et("species"),ju=function(e){var t=Pu(e),n=Cu.f;Lu&&t&&!t[Uu]&&n(t,Uu,{configurable:!0,get:function(){return this}})},Mu=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Bu={exports:{}},qu=be,Gu=vs,Nu=ie,Fu=W,Vu=Rs,Wu=ls,Ku=function(e,t){this.stopped=e,this.result=t};(Bu.exports=function(e,t,n,r,a){var i,s,o,u,d,c,l,h=Fu(t,n,r?2:1);if(a)i=e;else{if("function"!=typeof(s=Vu(e)))throw TypeError("Target is not iterable");if(Gu(s)){for(o=0,u=Nu(e.length);u>o;o++)if((d=r?h(qu(l=e[o])[0],l[1]):h(e[o]))&&d instanceof Ku)return d;return new Ku(!1)}i=s.call(e)}for(c=i.next;!(l=c.call(i)).done;)if("object"==typeof(d=Wu(i,h,l.value,r))&&d&&d instanceof Ku)return d;return new Ku(!1)}).stop=function(e){return new Ku(!0,e)};var Hu,zu,$u,Qu=be,Yu=F,Ju=et("species"),Xu=function(e,t){var n,r=Qu(e).constructor;return void 0===r||null==(n=Qu(r)[Ju])?t:Yu(n)},Zu=/(iphone|ipod|ipad).*applewebkit/i.test(wi),ed=G,td=K,nd=z,rd=W,ad=Br,id=me,sd=Zu,od=ed.location,ud=ed.setImmediate,dd=ed.clearImmediate,cd=ed.process,ld=ed.MessageChannel,hd=ed.Dispatch,fd=0,pd={},md=function(e){if(pd.hasOwnProperty(e)){var t=pd[e];delete pd[e],t()}},vd=function(e){return function(){md(e)}},gd=function(e){md(e.data)},yd=function(e){ed.postMessage(e+"",od.protocol+"//"+od.host)};ud&&dd||(ud=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return pd[++fd]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Hu(fd),fd},dd=function(e){delete pd[e]},"process"==nd(cd)?Hu=function(e){cd.nextTick(vd(e))}:hd&&hd.now?Hu=function(e){hd.now(vd(e))}:ld&&!sd?($u=(zu=new ld).port2,zu.port1.onmessage=gd,Hu=rd($u.postMessage,$u,1)):!ed.addEventListener||"function"!=typeof postMessage||ed.importScripts||td(yd)||"file:"===od.protocol?Hu="onreadystatechange"in id("script")?function(e){ad.appendChild(id("script")).onreadystatechange=function(){ad.removeChild(this),md(e)}}:function(e){setTimeout(vd(e),0)}:(Hu=yd,ed.addEventListener("message",gd,!1)));var bd,_d,wd,Ad,kd,Ed,xd,Sd,Rd={set:ud,clear:dd},Td=G,Dd=Ct.f,Id=z,Od=Rd.set,Pd=Zu,Cd=Td.MutationObserver||Td.WebKitMutationObserver,Ld=Td.process,Ud=Td.Promise,jd="process"==Id(Ld),Md=Dd(Td,"queueMicrotask"),Bd=Md&&Md.value;Bd||(bd=function(){var e,t;for(jd&&(e=Ld.domain)&&e.exit();_d;){t=_d.fn,_d=_d.next;try{t()}catch(e){throw _d?Ad():wd=void 0,e}}wd=void 0,e&&e.enter()},jd?Ad=function(){Ld.nextTick(bd)}:Cd&&!Pd?(kd=!0,Ed=document.createTextNode(""),new Cd(bd).observe(Ed,{characterData:!0}),Ad=function(){Ed.data=kd=!kd}):Ud&&Ud.resolve?(xd=Ud.resolve(void 0),Sd=xd.then,Ad=function(){Sd.call(xd,bd)}):Ad=function(){Od.call(Td,bd)});var qd=Bd||function(e){var t={fn:e,next:void 0};wd&&(wd.next=t),_d||(_d=t,Ad()),wd=t},Gd={},Nd=F,Fd=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=Nd(t),this.reject=Nd(n)};Gd.f=function(e){return new Fd(e)};var Vd,Wd,Kd,Hd,zd=be,$d=se,Qd=Gd,Yd=function(e,t){if(zd(e),$d(t)&&t.constructor===e)return t;var n=Qd.f(e);return(0,n.resolve)(t),n.promise},Jd=G,Xd=Sr,Zd=G,ec=jn,tc=Du,nc=Qt.exports,rc=Ou,ac=la,ic=ju,sc=se,oc=F,uc=Mu,dc=z,cc=tn,lc=Bu.exports,hc=Ns,fc=Xu,pc=Rd.set,mc=qd,vc=Yd,gc=function(e,t){var n=Jd.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},yc=Gd,bc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},_c=kn,wc=yr,Ac=Si,kc=et("species"),Ec="Promise",xc=_c.get,Sc=_c.set,Rc=_c.getterFor(Ec),Tc=tc,Dc=Zd.TypeError,Ic=Zd.document,Oc=Zd.process,Pc=ec("fetch"),Cc=yc.f,Lc=Cc,Uc="process"==dc(Oc),jc=!!(Ic&&Ic.createEvent&&Zd.dispatchEvent),Mc=wc(Ec,(function(){if(!(cc(Tc)!==String(Tc))){if(66===Ac)return!0;if(!Uc&&"function"!=typeof PromiseRejectionEvent)return!0}if(Ac>=51&&/native code/.test(Tc))return!1;var e=Tc.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[kc]=t,!(e.then((function(){}))instanceof t)})),Bc=Mc||!hc((function(e){Tc.all(e).catch((function(){}))})),qc=function(e){var t;return!(!sc(e)||"function"!=typeof(t=e.then))&&t},Gc=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;mc((function(){for(var a=t.value,i=1==t.state,s=0;r.length>s;){var o,u,d,c=r[s++],l=i?c.ok:c.fail,h=c.resolve,f=c.reject,p=c.domain;try{l?(i||(2===t.rejection&&Wc(e,t),t.rejection=1),!0===l?o=a:(p&&p.enter(),o=l(a),p&&(p.exit(),d=!0)),o===c.promise?f(Dc("Promise-chain cycle")):(u=qc(o))?u.call(o,h,f):h(o)):f(a)}catch(e){p&&!d&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Fc(e,t)}))}},Nc=function(e,t,n){var r,a;jc?((r=Ic.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Zd.dispatchEvent(r)):r={promise:t,reason:n},(a=Zd["on"+e])?a(r):"unhandledrejection"===e&&gc("Unhandled promise rejection",n)},Fc=function(e,t){pc.call(Zd,(function(){var n,r=t.value;if(Vc(t)&&(n=bc((function(){Uc?Oc.emit("unhandledRejection",r,e):Nc("unhandledrejection",e,r)})),t.rejection=Uc||Vc(t)?2:1,n.error))throw n.value}))},Vc=function(e){return 1!==e.rejection&&!e.parent},Wc=function(e,t){pc.call(Zd,(function(){Uc?Oc.emit("rejectionHandled",e):Nc("rejectionhandled",e,t.value)}))},Kc=function(e,t,n,r){return function(a){e(t,n,a,r)}},Hc=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Gc(e,t,!0))},zc=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Dc("Promise can't be resolved itself");var a=qc(n);a?mc((function(){var r={done:!1};try{a.call(n,Kc(zc,e,r,t),Kc(Hc,e,r,t))}catch(n){Hc(e,r,n,t)}})):(t.value=n,t.state=1,Gc(e,t,!1))}catch(n){Hc(e,{done:!1},n,t)}}};Mc&&(Tc=function(e){uc(this,Tc,Ec),oc(e),Vd.call(this);var t=xc(this);try{e(Kc(zc,this,t),Kc(Hc,this,t))}catch(e){Hc(this,t,e)}},(Vd=function(e){Sc(this,{type:Ec,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=rc(Tc.prototype,{then:function(e,t){var n=Rc(this),r=Cc(fc(this,Tc));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Uc?Oc.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Gc(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Wd=function(){var e=new Vd,t=xc(e);this.promise=e,this.resolve=Kc(zc,e,t),this.reject=Kc(Hc,e,t)},yc.f=Cc=function(e){return e===Tc||e===Kd?new Wd(e):Lc(e)},"function"==typeof tc&&(Hd=tc.prototype.then,nc(tc.prototype,"then",(function(e,t){var n=this;return new Tc((function(e,t){Hd.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Pc&&Xd({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return vc(Tc,Pc.apply(Zd,arguments))}}))),Xd({global:!0,wrap:!0,forced:Mc},{Promise:Tc}),ac(Tc,Ec,!1),ic(Ec),Kd=ec(Ec),Xd({target:Ec,stat:!0,forced:Mc},{reject:function(e){var t=Cc(this);return t.reject.call(void 0,e),t.promise}}),Xd({target:Ec,stat:!0,forced:Mc},{resolve:function(e){return vc(this,e)}}),Xd({target:Ec,stat:!0,forced:Bc},{all:function(e){var t=this,n=Cc(t),r=n.resolve,a=n.reject,i=bc((function(){var n=oc(t.resolve),i=[],s=0,o=1;lc(e,(function(e){var u=s++,d=!1;i.push(void 0),o++,n.call(t,e).then((function(e){d||(d=!0,i[u]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Cc(t),r=n.reject,a=bc((function(){var a=oc(t.resolve);lc(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var $c=Sr,Qc=K,Yc=ue,Jc=se,Xc=Z,Zc=ie,el=Ki,tl=at,nl=Ii,rl=Si,al=et("isConcatSpreadable"),il=rl>=51||!Qc((function(){var e=[];return e[al]=!1,e.concat()[0]!==e})),sl=nl("concat"),ol=function(e){if(!Jc(e))return!1;var t=e[al];return void 0!==t?!!t:Yc(e)};$c({target:"Array",proto:!0,forced:!il||!sl},{concat:function(e){var t,n,r,a,i,s=Xc(this),o=tl(s,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(ol(i=-1===t?s:arguments[t])){if(u+(a=Zc(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,u++)n in i&&el(o,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");el(o,u++,i)}return o.length=u,o}});var ul=ce,dl=le.f,cl=Function.prototype,ll=cl.toString,hl=/^\s*function ([^ (]*)/;function fl(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 pl(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 pl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,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,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function pl(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 ml(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 vl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ml(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ul&&!("name"in cl)&&dl(cl,"name",{configurable:!0,get:function(){try{return ll.call(this).match(hl)[1]}catch(e){return""}}});var gl,yl={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"}},bl={},_l=function(e,t){bl[e]=vl(vl({},t),{},{isLoading:!1})},wl=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(k.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Al=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u,d;return x.default.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(!(r=bl[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=fl(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=yl[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,wl({id:s,src:yl[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),u=s.id,d=s.src,console.log("Could not load external script ".concat(u," ").concat(d),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,wl({id:t,src:r.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(r.source,"."),e.t2);case 43:return r.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(t){return e.apply(this,arguments)}}(),kl=new function e(){var t=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"showLeaderboard",function(){var e=A.default(x.default.mark((function e(n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),R.default(this,"addScore",function(){var e=A.default(x.default.mark((function e(n){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.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"]},_l(this.moduleName,this.moduleConfig)},El=se,xl=z,Sl=et("match"),Rl=function(e){var t;return El(e)&&(void 0!==(t=e[Sl])?!!t:"RegExp"==xl(e))},Tl=Rl,Dl=function(e){if(Tl(e))throw TypeError("The method doesn't accept regular expressions");return e},Il=et("match"),Ol=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Il]=!1,"/./"[e](t)}catch(e){}}return!1},Pl=Sr,Cl=Ct.f,Ll=ie,Ul=Dl,jl=J,Ml=Ol,Bl="".startsWith,ql=Math.min,Gl=Ml("startsWith");Pl({target:"String",proto:!0,forced:!!(Gl||(gl=Cl(String.prototype,"startsWith"),!gl||gl.writable))&&!Gl},{startsWith:function(e){var t=String(jl(this));Ul(e);var n=Ll(ql(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Bl?Bl.call(t,r,n):t.slice(n,n+r.length)===r}});var Nl=be,Fl=function(){var e=Nl(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},Vl=Qt.exports,Wl=be,Kl=K,Hl=Fl,zl=RegExp.prototype,$l=zl.toString,Ql=Kl((function(){return"/a/b"!=$l.call({source:"a",flags:"b"})})),Yl="toString"!=$l.name;(Ql||Yl)&&Vl(RegExp.prototype,"toString",(function(){var e=Wl(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in zl)?Hl.call(e):n)}),{unsafe:!0});var Jl={},Xl=K;function Zl(e,t){return RegExp(e,t)}Jl.UNSUPPORTED_Y=Xl((function(){var e=Zl("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Jl.BROKEN_CARET=Xl((function(){var e=Zl("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var eh=Fl,th=Jl,nh=RegExp.prototype.exec,rh=String.prototype.replace,ah=nh,ih=function(){var e=/a/,t=/b*/g;return nh.call(e,"a"),nh.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),sh=th.UNSUPPORTED_Y||th.BROKEN_CARET,oh=void 0!==/()??/.exec("")[1];(ih||oh||sh)&&(ah=function(e){var t,n,r,a,i=this,s=sh&&i.sticky,o=eh.call(i),u=i.source,d=0,c=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),c=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(u="(?: "+u+")",c=" "+c,d++),n=new RegExp("^(?:"+u+")",o)),oh&&(n=new RegExp("^"+u+"$(?!\\s)",o)),ih&&(t=i.lastIndex),r=nh.call(s?n:i,c),s?r?(r.input=r.input.slice(d),r[0]=r[0].slice(d),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:ih&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),oh&&r&&r.length>1&&rh.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var uh=ah;Sr({target:"RegExp",proto:!0,forced:/./.exec!==uh},{exec:uh});var dh=Qt.exports,ch=K,lh=et,hh=uh,fh=Ie,ph=lh("species"),mh=!ch((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),vh="$0"==="a".replace(/./,"$0"),gh=lh("replace"),yh=!!/./[gh]&&""===/./[gh]("a","$0"),bh=!ch((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]})),_h=function(e,t,n,r){var a=lh(e),i=!ch((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!ch((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ph]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!mh||!vh||yh)||"split"===e&&!bh){var o=/./[a],u=n(a,""[e],(function(e,t,n,r,a){return t.exec===hh?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:vh,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:yh}),d=u[0],c=u[1];dh(String.prototype,e,d),dh(RegExp.prototype,a,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}r&&fh(RegExp.prototype[a],"sham",!0)},wh=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ah=z,kh=uh,Eh=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Ah(e))throw TypeError("RegExp#exec called on incompatible receiver");return kh.call(e,t)},xh=be,Sh=J,Rh=wh,Th=Eh;function Dh(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 Ih(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dh(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}_h("search",1,(function(e,t,n){return[function(t){var n=Sh(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=xh(e),i=String(this),s=a.lastIndex;Rh(s,0)||(a.lastIndex=0);var o=Th(a,i);return Rh(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var Oh,Ph,Ch=function(){function e(){S.default(this,e)}return T.default(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.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:v,depth:a.getIframeDepth(),domainMatched:s===o,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 D.default(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 D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(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 D.default(e,!0);return n.query=Ih(Ih({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}}]),e}(),Lh=function(){try{return(new Ch).getBridgeContext()}catch(e){return{}}}(),Uh={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Oh=!1,(Ph=a.getQueryParams("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Ph.xanthophyll&&(Oh=!0),Oh)},jh=Qs.charAt,Mh=function(e,t,n){return t+(n?jh(e,t).length:1)},Bh=_h,qh=be,Gh=Z,Nh=ie,Fh=ne,Vh=J,Wh=Mh,Kh=Eh,Hh=Math.max,zh=Math.min,$h=Math.floor,Qh=/\$([$&'`]|\d\d?|<[^>]*>)/g,Yh=/\$([$&'`]|\d\d?)/g;Bh("replace",2,(function(e,t,n,r){var a=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,s=a?"$":"$0";return[function(n,r){var a=Vh(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,a,r):t.call(String(a),n,r)},function(e,r){if(!a&&i||"string"==typeof r&&-1===r.indexOf(s)){var u=n(t,e,this,r);if(u.done)return u.value}var d=qh(e),c=String(this),l="function"==typeof r;l||(r=String(r));var h=d.global;if(h){var f=d.unicode;d.lastIndex=0}for(var p=[];;){var m=Kh(d,c);if(null===m)break;if(p.push(m),!h)break;""===String(m[0])&&(d.lastIndex=Wh(c,Nh(d.lastIndex),f))}for(var v,g="",y=0,b=0;b<p.length;b++){m=p[b];for(var _=String(m[0]),w=Hh(zh(Fh(m.index),c.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(v=m[k])?v:String(v));var E=m.groups;if(l){var x=[_].concat(A,w,c);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,c,w,A,E,r);w>=y&&(g+=c.slice(y,w)+S,y=w+_.length)}return g+c.slice(y)}];function o(e,n,r,a,i,s){var o=r+e.length,u=a.length,d=Yh;return void 0!==i&&(i=Gh(i),d=Qh),t.call(s,d,(function(t,s){var d;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":d=i[s.slice(1,-1)];break;default:var c=+s;if(0===c)return t;if(c>u){var l=$h(c/10);return 0===l?t:l<=u?void 0===a[l-1]?s.charAt(1):a[l-1]+s.charAt(1):t}d=a[c-1]}return void 0===d?"":d}))}}));var Jh=K,Xh=et("iterator"),Zh=!Jh((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[Xh]||"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})),ef=ce,tf=K,nf=Dr,rf=tr,af=Lt,sf=Z,of=Y,uf=Object.assign,df=Object.defineProperty,cf=!uf||tf((function(){if(ef&&1!==uf({b:1},uf(df({},"a",{enumerable:!0,get:function(){df(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!=uf({},e)[n]||nf(uf({},t)).join("")!=r}))?function(e,t){for(var n=sf(e),r=arguments.length,a=1,i=rf.f,s=af.f;r>a;)for(var o,u=of(arguments[a++]),d=i?nf(u).concat(i(u)):nf(u),c=d.length,l=0;c>l;)o=d[l++],ef&&!s.call(u,o)||(n[o]=u[o]);return n}:uf,lf=/[^\0-\u007E]/,hf=/[.\u3002\uFF0E\uFF61]/g,ff="Overflow: input needs wider integers to process",pf=Math.floor,mf=String.fromCharCode,vf=function(e){return e+22+75*(e<26)},gf=function(e,t,n){var r=0;for(e=n?pf(e/700):e>>1,e+=pf(e/t);e>455;r+=36)e=pf(e/35);return pf(r+36*e/(e+38))},yf=function(e){var t,n,r=[],a=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var a=e.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){var i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&a)<<10)+(1023&i)+65536):(t.push(a),n--)}else t.push(a)}return t}(e)).length,i=128,s=0,o=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(mf(n));var u=r.length,d=u;for(u&&r.push("-");d<a;){var c=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=i&&n<c&&(c=n);var l=d+1;if(c-i>pf((2147483647-s)/l))throw RangeError(ff);for(s+=(c-i)*l,i=c,t=0;t<e.length;t++){if((n=e[t])<i&&++s>2147483647)throw RangeError(ff);if(n==i){for(var h=s,f=36;;f+=36){var p=f<=o?1:f>=o+26?26:f-o;if(h<p)break;var m=h-p,v=36-p;r.push(mf(vf(p+m%v))),h=pf(m/v)}r.push(mf(vf(h))),o=gf(s,l,d==u),s=0,++d}}++s,++i}return r.join("")},bf=be,_f=Rs,wf=Sr,Af=jn,kf=Zh,Ef=Qt.exports,xf=Ou,Sf=la,Rf=vo,Tf=kn,Df=Mu,If=Be,Of=W,Pf=ks,Cf=be,Lf=se,Uf=Qr,jf=Re,Mf=function(e){var t=_f(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return bf(t.call(e))},Bf=Rs,qf=et,Gf=Af("fetch"),Nf=Af("Headers"),Ff=qf("iterator"),Vf=Tf.set,Wf=Tf.getterFor("URLSearchParams"),Kf=Tf.getterFor("URLSearchParamsIterator"),Hf=/\+/g,zf=Array(4),$f=function(e){return zf[e-1]||(zf[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Qf=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Yf=function(e){var t=e.replace(Hf," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace($f(n--),Qf);return t}},Jf=/[!'()~]|%20/g,Xf={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Zf=function(e){return Xf[e]},ep=function(e){return encodeURIComponent(e).replace(Jf,Zf)},tp=function(e,t){if(t)for(var n,r,a=t.split("&"),i=0;i<a.length;)(n=a[i++]).length&&(r=n.split("="),e.push({key:Yf(r.shift()),value:Yf(r.join("="))}))},np=function(e){this.entries.length=0,tp(this.entries,e)},rp=function(e,t){if(e<t)throw TypeError("Not enough arguments")},ap=Rf((function(e,t){Vf(this,{type:"URLSearchParamsIterator",iterator:Mf(Wf(e).entries),kind:t})}),"Iterator",(function(){var e=Kf(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})),ip=function(){Df(this,ip,"URLSearchParams");var e,t,n,r,a,i,s,o,u,d=arguments.length>0?arguments[0]:void 0,c=this,l=[];if(Vf(c,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:np}),void 0!==d)if(Lf(d))if("function"==typeof(e=Bf(d)))for(n=(t=e.call(d)).next;!(r=n.call(t)).done;){if((s=(i=(a=Mf(Cf(r.value))).next).call(a)).done||(o=i.call(a)).done||!i.call(a).done)throw TypeError("Expected sequence with length 2");l.push({key:s.value+"",value:o.value+""})}else for(u in d)If(d,u)&&l.push({key:u,value:d[u]+""});else tp(l,"string"==typeof d?"?"===d.charAt(0)?d.slice(1):d:d+"")},sp=ip.prototype;xf(sp,{append:function(e,t){rp(arguments.length,2);var n=Wf(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){rp(arguments.length,1);for(var t=Wf(this),n=t.entries,r=e+"",a=0;a<n.length;)n[a].key===r?n.splice(a,1):a++;t.updateURL()},get:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=[],a=0;a<t.length;a++)t[a].key===n&&r.push(t[a].value);return r},has:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){rp(arguments.length,1);for(var n,r=Wf(this),a=r.entries,i=!1,s=e+"",o=t+"",u=0;u<a.length;u++)(n=a[u]).key===s&&(i?a.splice(u--,1):(i=!0,n.value=o));i||a.push({key:s,value:o}),r.updateURL()},sort:function(){var e,t,n,r=Wf(this),a=r.entries,i=a.slice();for(a.length=0,n=0;n<i.length;n++){for(e=i[n],t=0;t<n;t++)if(a[t].key>e.key){a.splice(t,0,e);break}t===n&&a.push(e)}r.updateURL()},forEach:function(e){for(var t,n=Wf(this).entries,r=Of(e,arguments.length>1?arguments[1]:void 0,3),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new ap(this,"keys")},values:function(){return new ap(this,"values")},entries:function(){return new ap(this,"entries")}},{enumerable:!0}),Ef(sp,Ff,sp.entries),Ef(sp,"toString",(function(){for(var e,t=Wf(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(ep(e.key)+"="+ep(e.value));return n.join("&")}),{enumerable:!0}),Sf(ip,"URLSearchParams"),wf({global:!0,forced:!kf},{URLSearchParams:ip}),kf||"function"!=typeof Gf||"function"!=typeof Nf||wf({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,a=[e];return arguments.length>1&&(Lf(t=arguments[1])&&(n=t.body,"URLSearchParams"===Pf(n)&&((r=t.headers?new Nf(t.headers):new Nf).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Uf(t,{body:jf(0,String(n)),headers:jf(0,r)}))),a.push(t)),Gf.apply(this,a)}});var op,up={URLSearchParams:ip,getState:Wf},dp=Sr,cp=ce,lp=Zh,hp=G,fp=Mr,pp=Qt.exports,mp=Mu,vp=Be,gp=cf,yp=Us,bp=Qs.codeAt,_p=function(e){var t,n,r=[],a=e.toLowerCase().replace(hf,".").split(".");for(t=0;t<a.length;t++)n=a[t],r.push(lf.test(n)?"xn--"+yf(n):n);return r.join(".")},wp=la,Ap=up,kp=kn,Ep=hp.URL,xp=Ap.URLSearchParams,Sp=Ap.getState,Rp=kp.set,Tp=kp.getterFor("URL"),Dp=Math.floor,Ip=Math.pow,Op=/[A-Za-z]/,Pp=/[\d+-.A-Za-z]/,Cp=/\d/,Lp=/^(0x|0X)/,Up=/^[0-7]+$/,jp=/^\d+$/,Mp=/^[\dA-Fa-f]+$/,Bp=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,qp=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Gp=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Np=/[\u0009\u000A\u000D]/g,Fp=function(e,t){var n,r,a;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Wp(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Xp(e)){if(t=_p(t),Bp.test(t))return"Invalid host";if(null===(n=Vp(t)))return"Invalid host";e.host=n}else{if(qp.test(t))return"Invalid host";for(n="",r=yp(t),a=0;a<r.length;a++)n+=Yp(r[a],Hp);e.host=n}},Vp=function(e){var t,n,r,a,i,s,o,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(a=u[r]))return e;if(i=10,a.length>1&&"0"==a.charAt(0)&&(i=Lp.test(a)?16:8,a=a.slice(8==i?1:2)),""===a)s=0;else{if(!(10==i?jp:8==i?Up:Mp).test(a))return e;s=parseInt(a,i)}n.push(s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=Ip(256,5-t))return null}else if(s>255)return null;for(o=n.pop(),r=0;r<n.length;r++)o+=n[r]*Ip(256,3-r);return o},Wp=function(e){var t,n,r,a,i,s,o,u=[0,0,0,0,0,0,0,0],d=0,c=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,c=++d}for(;h();){if(8==d)return;if(":"!=h()){for(t=n=0;n<4&&Mp.test(h());)t=16*t+parseInt(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,d>6)return;for(r=0;h();){if(a=null,r>0){if(!("."==h()&&r<4))return;l++}if(!Cp.test(h()))return;for(;Cp.test(h());){if(i=parseInt(h(),10),null===a)a=i;else{if(0==a)return;a=10*a+i}if(a>255)return;l++}u[d]=256*u[d]+a,2!=++r&&4!=r||d++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;u[d++]=t}else{if(null!==c)return;l++,c=++d}}if(null!==c)for(s=d-c,d=7;0!=d&&s>0;)o=u[d],u[d--]=u[c+s-1],u[c+--s]=o;else if(8!=d)return;return u},Kp=function(e){var t,n,r,a;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Dp(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,a=0,i=0;i<8;i++)0!==e[i]?(a>n&&(t=r,n=a),r=null,a=0):(null===r&&(r=i),++a);return a>n&&(t=r,n=a),t}(e),n=0;n<8;n++)a&&0===e[n]||(a&&(a=!1),r===n?(t+=n?":":"::",a=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Hp={},zp=gp({},Hp,{" ":1,'"':1,"<":1,">":1,"`":1}),$p=gp({},zp,{"#":1,"?":1,"{":1,"}":1}),Qp=gp({},$p,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Yp=function(e,t){var n=bp(e,0);return n>32&&n<127&&!vp(t,e)?e:encodeURIComponent(e)},Jp={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Xp=function(e){return vp(Jp,e.scheme)},Zp=function(e){return""!=e.username||""!=e.password},em=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},tm=function(e,t){var n;return 2==e.length&&Op.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},nm=function(e){var t;return e.length>1&&tm(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},rm=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&tm(t[0],!0)||t.pop()},am=function(e){return"."===e||"%2e"===e.toLowerCase()},im={},sm={},om={},um={},dm={},cm={},lm={},hm={},fm={},pm={},mm={},vm={},gm={},ym={},bm={},_m={},wm={},Am={},km={},Em={},xm={},Sm=function(e,t,n,r){var a,i,s,o,u,d=n||im,c=0,l="",h=!1,f=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Gp,"")),t=t.replace(Np,""),a=yp(t);c<=a.length;){switch(i=a[c],d){case im:if(!i||!Op.test(i)){if(n)return"Invalid scheme";d=om;continue}l+=i.toLowerCase(),d=sm;break;case sm:if(i&&(Pp.test(i)||"+"==i||"-"==i||"."==i))l+=i.toLowerCase();else{if(":"!=i){if(n)return"Invalid scheme";l="",d=om,c=0;continue}if(n&&(Xp(e)!=vp(Jp,l)||"file"==l&&(Zp(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,n)return void(Xp(e)&&Jp[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?d=ym:Xp(e)&&r&&r.scheme==e.scheme?d=um:Xp(e)?d=hm:"/"==a[c+1]?(d=dm,c++):(e.cannotBeABaseURL=!0,e.path.push(""),d=km)}break;case om:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,d=xm;break}d="file"==r.scheme?ym:cm;continue;case um:if("/"!=i||"/"!=a[c+1]){d=cm;continue}d=fm,c++;break;case dm:if("/"==i){d=pm;break}d=Am;continue;case cm:if(e.scheme=r.scheme,i==op)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==i||"\\"==i&&Xp(e))d=lm;else if("?"==i)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",d=Em;else{if("#"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),d=Am;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=xm}break;case lm:if(!Xp(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,d=Am;continue}d=pm}else d=fm;break;case hm:if(d=fm,"/"!=i||"/"!=l.charAt(c+1))continue;c++;break;case fm:if("/"!=i&&"\\"!=i){d=pm;continue}break;case pm:if("@"==i){h&&(l="%40"+l),h=!0,s=yp(l);for(var m=0;m<s.length;m++){var v=s[m];if(":"!=v||p){var g=Yp(v,Qp);p?e.password+=g:e.username+=g}else p=!0}l=""}else if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)){if(h&&""==l)return"Invalid authority";c-=yp(l).length+1,l="",d=mm}else l+=i;break;case mm:case vm:if(n&&"file"==e.scheme){d=_m;continue}if(":"!=i||f){if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)){if(Xp(e)&&""==l)return"Invalid host";if(n&&""==l&&(Zp(e)||null!==e.port))return;if(o=Fp(e,l))return o;if(l="",d=wm,n)return;continue}"["==i?f=!0:"]"==i&&(f=!1),l+=i}else{if(""==l)return"Invalid host";if(o=Fp(e,l))return o;if(l="",d=gm,n==vm)return}break;case gm:if(!Cp.test(i)){if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)||n){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=Xp(e)&&y===Jp[e.scheme]?null:y,l=""}if(n)return;d=wm;continue}return"Invalid port"}l+=i;break;case ym:if(e.scheme="file","/"==i||"\\"==i)d=bm;else{if(!r||"file"!=r.scheme){d=Am;continue}if(i==op)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==i)e.host=r.host,e.path=r.path.slice(),e.query="",d=Em;else{if("#"!=i){nm(a.slice(c).join(""))||(e.host=r.host,e.path=r.path.slice(),rm(e)),d=Am;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=xm}}break;case bm:if("/"==i||"\\"==i){d=_m;break}r&&"file"==r.scheme&&!nm(a.slice(c).join(""))&&(tm(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),d=Am;continue;case _m:if(i==op||"/"==i||"\\"==i||"?"==i||"#"==i){if(!n&&tm(l))d=Am;else if(""==l){if(e.host="",n)return;d=wm}else{if(o=Fp(e,l))return o;if("localhost"==e.host&&(e.host=""),n)return;l="",d=wm}continue}l+=i;break;case wm:if(Xp(e)){if(d=Am,"/"!=i&&"\\"!=i)continue}else if(n||"?"!=i)if(n||"#"!=i){if(i!=op&&(d=Am,"/"!=i))continue}else e.fragment="",d=xm;else e.query="",d=Em;break;case Am:if(i==op||"/"==i||"\\"==i&&Xp(e)||!n&&("?"==i||"#"==i)){if(".."===(u=(u=l).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(rm(e),"/"==i||"\\"==i&&Xp(e)||e.path.push("")):am(l)?"/"==i||"\\"==i&&Xp(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&tm(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(i==op||"?"==i||"#"==i))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==i?(e.query="",d=Em):"#"==i&&(e.fragment="",d=xm)}else l+=Yp(i,$p);break;case km:"?"==i?(e.query="",d=Em):"#"==i?(e.fragment="",d=xm):i!=op&&(e.path[0]+=Yp(i,Hp));break;case Em:n||"#"!=i?i!=op&&("'"==i&&Xp(e)?e.query+="%27":e.query+="#"==i?"%23":Yp(i,Hp)):(e.fragment="",d=xm);break;case xm:i!=op&&(e.fragment+=Yp(i,zp))}c++}},Rm=function(e){var t,n,r=mp(this,Rm,"URL"),a=arguments.length>1?arguments[1]:void 0,i=String(e),s=Rp(r,{type:"URL"});if(void 0!==a)if(a instanceof Rm)t=Tp(a);else if(n=Sm(t={},String(a)))throw TypeError(n);if(n=Sm(s,i,null,t))throw TypeError(n);var o=s.searchParams=new xp,u=Sp(o);u.updateSearchParams(s.query),u.updateURL=function(){s.query=String(o)||null},cp||(r.href=Dm.call(r),r.origin=Im.call(r),r.protocol=Om.call(r),r.username=Pm.call(r),r.password=Cm.call(r),r.host=Lm.call(r),r.hostname=Um.call(r),r.port=jm.call(r),r.pathname=Mm.call(r),r.search=Bm.call(r),r.searchParams=qm.call(r),r.hash=Gm.call(r))},Tm=Rm.prototype,Dm=function(){var e=Tp(this),t=e.scheme,n=e.username,r=e.password,a=e.host,i=e.port,s=e.path,o=e.query,u=e.fragment,d=t+":";return null!==a?(d+="//",Zp(e)&&(d+=n+(r?":"+r:"")+"@"),d+=Kp(a),null!==i&&(d+=":"+i)):"file"==t&&(d+="//"),d+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==o&&(d+="?"+o),null!==u&&(d+="#"+u),d},Im=function(){var e=Tp(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Xp(e)?t+"://"+Kp(e.host)+(null!==n?":"+n:""):"null"},Om=function(){return Tp(this).scheme+":"},Pm=function(){return Tp(this).username},Cm=function(){return Tp(this).password},Lm=function(){var e=Tp(this),t=e.host,n=e.port;return null===t?"":null===n?Kp(t):Kp(t)+":"+n},Um=function(){var e=Tp(this).host;return null===e?"":Kp(e)},jm=function(){var e=Tp(this).port;return null===e?"":String(e)},Mm=function(){var e=Tp(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Bm=function(){var e=Tp(this).query;return e?"?"+e:""},qm=function(){return Tp(this).searchParams},Gm=function(){var e=Tp(this).fragment;return e?"#"+e:""},Nm=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(cp&&fp(Tm,{href:Nm(Dm,(function(e){var t=Tp(this),n=String(e),r=Sm(t,n);if(r)throw TypeError(r);Sp(t.searchParams).updateSearchParams(t.query)})),origin:Nm(Im),protocol:Nm(Om,(function(e){var t=Tp(this);Sm(t,String(e)+":",im)})),username:Nm(Pm,(function(e){var t=Tp(this),n=yp(String(e));if(!em(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=Yp(n[r],Qp)}})),password:Nm(Cm,(function(e){var t=Tp(this),n=yp(String(e));if(!em(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=Yp(n[r],Qp)}})),host:Nm(Lm,(function(e){var t=Tp(this);t.cannotBeABaseURL||Sm(t,String(e),mm)})),hostname:Nm(Um,(function(e){var t=Tp(this);t.cannotBeABaseURL||Sm(t,String(e),vm)})),port:Nm(jm,(function(e){var t=Tp(this);em(t)||(""==(e=String(e))?t.port=null:Sm(t,e,gm))})),pathname:Nm(Mm,(function(e){var t=Tp(this);t.cannotBeABaseURL||(t.path=[],Sm(t,e+"",wm))})),search:Nm(Bm,(function(e){var t=Tp(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Sm(t,e,Em)),Sp(t.searchParams).updateSearchParams(t.query)})),searchParams:Nm(qm),hash:Nm(Gm,(function(e){var t=Tp(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Sm(t,e,xm)):t.fragment=null}))}),pp(Tm,"toJSON",(function(){return Dm.call(this)}),{enumerable:!0}),pp(Tm,"toString",(function(){return Dm.call(this)}),{enumerable:!0}),Ep){var Fm=Ep.createObjectURL,Vm=Ep.revokeObjectURL;Fm&&pp(Rm,"createObjectURL",(function(e){return Fm.apply(Ep,arguments)})),Vm&&pp(Rm,"revokeObjectURL",(function(e){return Vm.apply(Ep,arguments)}))}wp(Rm,"URL"),dp({global:!0,forced:!lp,sham:!cp},{URL:Rm});var Wm=Hn.includes,Km=ru;Sr({target:"Array",proto:!0,forced:!wt("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return Wm(this,e,arguments.length>1?arguments[1]:void 0)}}),Km("includes");var Hm=Dl,zm=J;Sr({target:"String",proto:!0,forced:!Ol("includes")},{includes:function(e){return!!~String(zm(this)).indexOf(Hm(e),arguments.length>1?arguments[1]:void 0)}});var $m=_h,Qm=Rl,Ym=be,Jm=J,Xm=Xu,Zm=Mh,ev=ie,tv=Eh,nv=uh,rv=K,av=[].push,iv=Math.min,sv=!rv((function(){return!RegExp(4294967295,"y")}));function ov(e){var t=this,n={},r=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function o(e){return P.default(n,e)}function u(e,t){return C.default(n,e,t)}function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new D.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=d(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),I.default.isURL(o)))return o}}}return function(){var e;k.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){u("depth.error",e.message)}u("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(u("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],u("top.domain.from","origins");else if(0===t)a=i,u("top.domain.from","self-top");else if(1===t){var o=d(s);o&&(a=o.origin,u("top.domain.from","referrer"))}u("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(O.default(e))u("partner.domain.value",e),u("partner.domain.from","partner-domain");else{var t=d(e,!1);if(t)u("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),u("partner.domain.from","partner-url");else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","partner-fallback")}else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(u("partner.url.value",a),u("partner.url.from","self-top")):e?O.default(e)?(u("partner.url.value",a),u("partner.url.from","partner-domain")):(u("partner.url.value",e),u("partner.url.from","partner-url")):(u("partner.url.value",s),u("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}$m("split",2,(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=String(Jm(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!Qm(e))return t.call(r,e,a);for(var i,s,o,u=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,d+"g");(i=nv.call(l,r))&&!((s=l.lastIndex)>c&&(u.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&av.apply(u,i.slice(1)),o=i[0].length,c=s,u.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||u.push(""):u.push(r.slice(c)),u.length>a?u.slice(0,a):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=Jm(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(String(a),t,n)},function(e,a){var i=n(r,e,this,a,r!==t);if(i.done)return i.value;var s=Ym(e),o=String(this),u=Xm(s,RegExp),d=s.unicode,c=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(sv?"y":"g"),l=new u(sv?s:"^(?:"+s.source+")",c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===tv(l,o)?[o]:[];for(var f=0,p=0,m=[];p<o.length;){l.lastIndex=sv?p:0;var v,g=tv(l,sv?o:o.slice(p));if(null===g||(v=iv(ev(l.lastIndex+(sv?0:p)),o.length))===f)p=Zm(o,p,d);else{if(m.push(o.slice(f,p)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;p=f=v}}return m.push(o.slice(f)),m}]}),!sv);var uv={name:"@bygd/gd-sdk-pes",version:"1.28.13",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"}},dv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==dv&&dv,cv="URLSearchParams"in dv,lv="Symbol"in dv&&"iterator"in Symbol,hv="FileReader"in dv&&"Blob"in dv&&function(){try{return new Blob,!0}catch(e){return!1}}(),fv="FormData"in dv,pv="ArrayBuffer"in dv;if(pv)var mv=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],vv=ArrayBuffer.isView||function(e){return e&&mv.indexOf(Object.prototype.toString.call(e))>-1};function gv(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function yv(e){return"string"!=typeof e&&(e=String(e)),e}function bv(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return lv&&(t[Symbol.iterator]=function(){return t}),t}function _v(e){this.map={},e instanceof _v?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 wv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Av(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function kv(e){var t=new FileReader,n=Av(t);return t.readAsArrayBuffer(e),n}function Ev(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function xv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:hv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:fv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:cv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():pv&&hv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ev(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):pv&&(ArrayBuffer.prototype.isPrototypeOf(e)||vv(e))?this._bodyArrayBuffer=Ev(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):cv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},hv&&(this.blob=function(){var e=wv(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=wv(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(kv)}),this.text=function(){var e=wv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Av(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)},fv&&(this.formData=function(){return this.text().then(Tv)}),this.json=function(){return this.text().then(JSON.parse)},this}_v.prototype.append=function(e,t){e=gv(e),t=yv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},_v.prototype.delete=function(e){delete this.map[gv(e)]},_v.prototype.get=function(e){return e=gv(e),this.has(e)?this.map[e]:null},_v.prototype.has=function(e){return this.map.hasOwnProperty(gv(e))},_v.prototype.set=function(e,t){this.map[gv(e)]=yv(t)},_v.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},_v.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),bv(e)},_v.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),bv(e)},_v.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),bv(e)},lv&&(_v.prototype[Symbol.iterator]=_v.prototype.entries);var Sv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Rv(e,t){if(!(this instanceof Rv))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,a=(t=t||{}).body;if(e instanceof Rv){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new _v(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=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 _v(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Sv.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Tv(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function Dv(e,t){if(!(this instanceof Dv))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="statusText"in t?t.statusText:"",this.headers=new _v(t.headers),this.url=t.url||"",this._initBody(e)}Rv.prototype.clone=function(){return new Rv(this,{body:this._bodyInit})},xv.call(Rv.prototype),xv.call(Dv.prototype),Dv.prototype.clone=function(){return new Dv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _v(this.headers),url:this.url})},Dv.error=function(){var e=new Dv(null,{status:0,statusText:""});return e.type="error",e};var Iv=[301,302,303,307,308];Dv.redirect=function(e,t){if(-1===Iv.indexOf(t))throw new RangeError("Invalid status code");return new Dv(null,{status:t,headers:{location:e}})};var Ov=dv.DOMException;try{new Ov}catch(e){(Ov=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Ov.prototype.constructor=Ov}function Pv(e,t){return new Promise((function(n,r){var a=new Rv(e,t);if(a.signal&&a.signal.aborted)return r(new Ov("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new _v,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new Dv(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new Ov("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&dv.location.href?dv.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(hv?i.responseType="blob":pv&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof _v?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,yv(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}Pv.polyfill=!0,dv.fetch||(dv.fetch=Pv,dv.Headers=_v,dv.Request=Rv,dv.Response=Dv);var Cv,Lv,Uv,jv,Mv=Array.isArray,Bv=Object.prototype.toString,qv=Mv||function(e){return!!e&&"[object Array]"==Bv.call(e)},Gv=function(e){var t=Nv("object"===E.default(e)?e:a.parseJSON(e));return t&&t.version?uv.version>=t.version?t:void 0:t},Nv=function(e){var t=this;if(!qv(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){k.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}},Fv=function(e){var t=this;if(!Cv){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Lh.topDomain,domain:Lh.parentDomain,referrer:Lh.parentURL,depth:a.getIframeDepth(),version:uv.version,byloader:Lh.isTokenGameURL,isTokenGameURL:Lh.isTokenGameURL,isMasterGameURL:Lh.isMasterGameURL,isExtHostedGameURL:Lh.isExtHostedGameURL,byloaderVersion:Lh.version,tracking:Uh.userDeclinedTracking,whitelabel:Uh.whitelabelPartner,platform:a.getMobilePlatform()};console.log("MESSAGE ROUTER ARGS",n),Cv=new a.MessageRouter(n)}return Cv||{send:function(){k.default(this,t)}.bind(this)}},Vv=[],Wv=function(e){Vv.push(e)},Kv=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Uv){e.next=4;break}return e.next=3,Hv(jv);case 3:Uv=e.sent;case 4:return e.abrupt("return",Uv);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Hv=function(e){var t=this;Lv.send("gdfw.loading",{message:"loading"}),Vv=[],Wv("1"),Wv("2");var n=new ov;Wv("3");var r=n.get("partner.domain.value");Wv("4");var i=function(){return k.default(this,t),{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);Wv("5");var s=function(){k.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(uv.version,"&localTime=").concat((new Date).getHours())}.bind(this);Wv("6");var o=function(){var e=this;k.default(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return k.default(this,e),t.get(n)}.bind(this)});return!n.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:n.gd_mode}.bind(this);return Wv("7"),new Promise(function(e){var n=this;if(k.default(this,t),Uv)e(Uv);else{Wv("7.1");var r=i();try{Wv("7.2");var o=s();Wv("7.3"),fetch(o).then(function(e){return k.default(this,n),Wv("7.4"),e.json()}.bind(this)).then(function(t){var i=this;if(k.default(this,n),Wv("7.5"),t.success){var s,o,u,d,c=t.result.game;Wv("7.6");var l={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(s=c.enableAds)||void 0===s?void 0:s.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,__t4r:c.__t4r||{},block_exts:Gv(c.push_cuda),bloc_gard:Gv(c.bloc_gard),cookie:Gv(c.cookie),gdpr:Gv(c.gdpr),diagnostic:Gv(c.diagnostic),cmp:Gv(c.cmp),gft:Gv(c.gft)||{},sdk:Gv(c.sdk)||{},sdkfw:Gv(c.sdkfw)||{},loader:Gv(c.loader)||{},splash:Gv(c.splash)||{},promo:Gv(c.promo)||{},dAds:Gv(c.dads)||{},pAds:Gv(c.pads)||{},mAds:Gv(c.mads)||{},rAds:Gv(c.rads)||{},lp:Gv(c.lp)||{},extsc:Gv(c.extsc)||{},evnts:Gv(c.evnts)||{},dp:Gv(c.dp)||{}};Wv("7.7");var h=a.extendDefaults(L.default(r),l);Wv("7.8"),h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(u=o.afg)||void 0===u?void 0:u.enabled),function(){k.default(this,i)}.bind(this),Wv("7.9"),null!==(d=h.pAds)&&void 0!==d&&d.enabled&&(h.preroll=!0),Wv("7.10"),Lv.send("gdfw.success",{message:"success"}),e(h)}else{r.failed=!0;var f=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(f,": json error")}),e(r)}}.bind(this)).catch(function(t){k.default(this,n);var a=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}.bind(this))}catch(t){var u=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(u,": global ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}}}.bind(this))},zv=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();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 e.apply(this,arguments)}}(),$v=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return n=e.sent,e.next=5,zv();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 e.apply(this,arguments)}}(),Qv=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return o=e.sent,u=!(null==o||null===(t=o.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:u,path:u?null==o||null===(n=o.extsc)||void 0===n?void 0:n.path:"",name:u?null==o||null===(r=o.extsc)||void 0===r?void 0:r.name:"",ref:u?null==o||null===(a=o.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:u?null==o||null===(i=o.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!u&&!(null==o||null===(s=o.extsc)||void 0===s||!s.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Yv=function(){var e=A.default(x.default.mark((function e(){var t,n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qv();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,r=t.name,i=t.ref,e.prev=6,s={},e.next=10,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});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",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),Jv=!1,Xv=!1,Zv=function(){return new Promise(function(){var e=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Jv){e.next=4;break}return e.abrupt("return",t(Xv));case 4:Jv=!0;case 5:return e.next=7,Qv();case 7:if((r=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=r.loadedFlag,!(i=r.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return Xv=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){k.default(this,u),s&&(s=!1,Jv=!0,t(!1))}.bind(this),5e3),o=setInterval(function(){k.default(this,u),s&&i&&window[a]?(s=!1,Jv=!0,Xv=!0,clearInterval(o),t(!0)):s||clearInterval(o)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}())},eg=function(e){var t=function(e){var t=this,n=function(e){return k.default(this,t),c("showAd",{adType:e})}.bind(this),r=function(e){return k.default(this,t),c("preloadAd",{adType:e})}.bind(this),a=function(e){return k.default(this,t),c("showDisplayAd",{options:e})}.bind(this),i=function(){return k.default(this,t),c("cancelAd")}.bind(this),s=function(){return k.default(this,t),c("openConsole")}.bind(this),o=function(){return k.default(this,t),c("showBanner")}.bind(this),u=function(){return k.default(this,t),c("session")}.bind(this),d=function(){k.default(this,t),console.log("_sendSDKReady")}.bind(this),c=function(e,n){var r=this;return k.default(this,t),n||(n={}),new Promise(function(t,a){k.default(this,r);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),l=function(){k.default(this,t),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&&f(r)}),!1)}.bind(this),h=function(){k.default(this,t),l(),c("init")}.bind(this),f=function(n){k.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:u,onEvent:f,init:h,_sendSDKReady:d}}(e);return t.init(),t},tg=function(){var e=this;return{isMasterGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){k.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},ng=function(e){var t=this;return new Promise(function(n,r){var a=this;k.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){k.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},rg=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zv();case 2:return t=e.sent,n=!t,e.next=6,ng(n);case 6:if(r=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=tg(),i=a.isMasterGameURL,s=i(),e.next=13,$v();case 13:return o=e.sent,u=!1,u=o?!s&&!!r:!s,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ag=ce,ig=Dr,sg=Gt,og=Lt.f,ug=function(e){return function(t){for(var n,r=sg(t),a=ig(r),i=a.length,s=0,o=[];i>s;)n=a[s++],ag&&!og.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},dg={entries:ug(!0),values:ug(!1)}.values;Sr({target:"Object",stat:!0},{values:function(e){return dg(e)}});var cg=Sr,lg=Du,hg=K,fg=jn,pg=Xu,mg=Yd,vg=Qt.exports;cg({target:"Promise",proto:!0,real:!0,forced:!!lg&&hg((function(){lg.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=pg(this,fg("Promise")),n="function"==typeof e;return this.then(n?function(n){return mg(t,e()).then((function(){return n}))}:e,n?function(n){return mg(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof lg||lg.prototype.finally||vg(lg.prototype,"finally",fg("Promise").prototype.finally);var gg=J,yg="[\t\n\v\f\r \u2028\u2029\ufeff]",bg=RegExp("^"+yg+yg+"*"),_g=RegExp(yg+yg+"*$"),wg=function(e){return function(t){var n=String(gg(t));return 1&e&&(n=n.replace(bg,"")),2&e&&(n=n.replace(_g,"")),n}},Ag={start:wg(1),end:wg(2),trim:wg(3)},kg=K,Eg="\t\n\v\f\r \u2028\u2029\ufeff",xg=Ag.trim;Sr({target:"String",proto:!0,forced:function(e){return kg((function(){return!!Eg[e]()||"
"!="
"[e]()||Eg[e].name!==e}))}("trim")},{trim:function(){return xg(this)}});var Sg=se,Rg=_o,Tg=ce,Dg=G,Ig=yr,Og=function(e,t,n){var r,a;return Rg&&"function"==typeof(r=t.constructor)&&r!==n&&Sg(a=r.prototype)&&a!==n.prototype&&Rg(e,a),e},Pg=le.f,Cg=Mn.f,Lg=Rl,Ug=Fl,jg=Jl,Mg=Qt.exports,Bg=K,qg=kn.set,Gg=ju,Ng=et("match"),Fg=Dg.RegExp,Vg=Fg.prototype,Wg=/a/g,Kg=/a/g,Hg=new Fg(Wg)!==Wg,zg=jg.UNSUPPORTED_Y;if(Tg&&Ig("RegExp",!Hg||zg||Bg((function(){return Kg[Ng]=!1,Fg(Wg)!=Wg||Fg(Kg)==Kg||"/a/i"!=Fg(Wg,"i")})))){for(var $g=function(e,t){var n,r=this instanceof $g,a=Lg(e),i=void 0===t;if(!r&&a&&e.constructor===$g&&i)return e;Hg?a&&!i&&(e=e.source):e instanceof $g&&(i&&(t=Ug.call(e)),e=e.source),zg&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Og(Hg?new Fg(e,t):Fg(e,t),r?this:Vg,$g);return zg&&n&&qg(s,{sticky:n}),s},Qg=function(e){e in $g||Pg($g,e,{configurable:!0,get:function(){return Fg[e]},set:function(t){Fg[e]=t}})},Yg=Cg(Fg),Jg=0;Yg.length>Jg;)Qg(Yg[Jg++]);Vg.constructor=$g,$g.prototype=Vg,Mg(Dg,"RegExp",$g)}Gg("RegExp");var Xg=Sr,Zg=ht.find,ey=ru,ty=!0,ny=wt("find");"find"in[]&&Array(1).find((function(){ty=!1})),Xg({target:"Array",proto:!0,forced:ty||!ny},{find:function(e){return Zg(this,e,arguments.length>1?arguments[1]:void 0)}}),ey("find");var ry=Sr,ay=Gt,iy=[].join,sy=Y!=Object,oy=pt("join",",");ry({target:"Array",proto:!0,forced:sy||!oy},{join:function(e){return iy.call(ay(this),void 0===e?",":e)}});var uy=Sr,dy=ht.map,cy=wt,ly=Ii("map"),hy=cy("map");uy({target:"Array",proto:!0,forced:!ly||!hy},{map:function(e){return dy(this,e,arguments.length>1?arguments[1]:void 0)}});var fy=cf;Sr({target:"Object",stat:!0,forced:Object.assign!==fy},{assign:fy});var py=function(){function e(t){S.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T.default(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 t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,r=new D.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return k.default(this,e),this.customParamKeys.some(function(e){return k.default(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),my=function(){function e(t,n){S.default(this,e),this.adContainer=t,this.onResume=n}return T.default(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 t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){k.default(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}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}(),vy=function(e){if(!e)return!1;var t=gy.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)},gy=Object.prototype.toString;function yy(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 by(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _y(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 wy(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 Ay(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ky=new b.EventEmitter,Ey=null,xy=function(){function e(t,n,r){var i=this;if(S.default(this,e),Ey)return Ey;Ey=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.EventBus,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=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=a.getIMASampleTags(),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=""!==t?document.getElementById(t):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,u=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:u,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){k.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){k.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,u,c,l,h,f,p,m,g,y,b,_,w,E,I,O;return T.default(e,[{key:"start",value:(O=A.default(x.default.mark((function e(){var t=this;return x.default.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){k.default(this,t),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 O.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(i){var s,o,u,d,c,l,h,f,p=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),u=s[o],i({url:u}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,d=n.nextAdPosition(e),n.eventBus.broadcast("AD_REQUEST",{message:d}),c=n.options,"preroll"===d&&v.isPlainObject(c.preroll)?c=c.preroll:"midroll"===d&&v.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===d&&v.isPlainObject(c.rewarded)&&(c=c.rewarded),l="rewarded"===d?"rewardedVideo":"gdbanner"===d?"gd__banner":"midroll"===d?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:Ay(Ay({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&v.isPlainObject(c.retry_on_success)&&v.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&v.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_failure.vast,h)));case 25:if(!v.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.vast,h)));case 27:return r.next=29,n._create_dp_context(d,t);case 29:f=r.sent,window.idhb.requestAds({slots:R.default({},l,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;k.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){k.default(this,r)}.bind(this)),i({tnl_keys:Ay(Ay({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=36;break;case 33:throw r.prev=33,r.t0=r.catch(8),new Error(r.t0);case 36:case"end":return r.stop()}}),r,this,[[8,33]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||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,t){var n=this;return t=t||{},new Promise(function(r){if(k.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,o=this._transformVast(e,t),u=Ay(Ay({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var d=e.dp,c=e.hl;if(d&&(d.adtag_url=o.url,this._extend_dp_with_adsense(d,c,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var l=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new D.default(e.adtag_url_1,!0);i.query=by(by({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new D.default(e.adtag_url_2,!0);o.query=by(by({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var u=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(_y({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(_y({id:d++,adtag_url:u,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:d,adtag:o,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=l}else if(d&&c.bidFloorApplied){var h=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()}(d);s.adsResponse=h}else if(d&&d.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()}(d);s.adsResponse=f}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,u);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}r(s)}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:(I=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;k.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):U.default.video({inline:!0,muted:!1}).then(function(t){k.default(this,r);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(E=A.default(x.default.mark((function e(){var t;return x.default.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 E.apply(this,arguments)})},{key:"startAd",value:(w=A.default(x.default.mark((function e(t){var n,r,i;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,"promo"!==(null==i?void 0:i.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(i,r));case 5:if(r!==a.AdType.Interstitial){e.next=25;break}if(!n){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(i));case 10:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(i));case 23:e.next=34;break;case 25:if(r!==a.AdType.Rewarded){e.next=33;break}if(!n){e.next=30;break}return e.abrupt("return",this._startRewardedAd(i));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"preloadAd",value:(_=A.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.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 _.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){k.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new my(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(b=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o,u,d,c,l,h,f,p,m=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),u=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),d=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(d)||(c="\n .gd__banner{\n z-index: ".concat(a.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),u.appendChild(l)),(h=document.createElement("div")).id=d,h.classList.add("gd__banner"),u.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[d]={maxSize:[u.offsetWidth,u.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){k.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadInterstitialAd(Ay(Ay({},n),t));case 13:n.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 y.apply(this,arguments)})},{key:"_startPromo",value:(g=A.default(x.default.mark((function e(t,n){var r;return x.default.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 r=e.sent,e.next=11,this._loadPromo(Ay(Ay({},r),t),n);case 11:r.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",{message:"".concat(t.position," failure,").concat(e.t0.message?e.t0.message:e.t0)}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_loadPromo",value:(m=A.default(x.default.mark((function e(t,n){var r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,r=this.nextAdPosition(n),i=this._create_promo_context(r),s=this._requestPromo(i,Ay({adType:a.AdType.Interstitial},t)),e.next=7,new Promise(function(e,t){var n=this;k.default(this,o);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),i=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",i,r),this.eventBus.subscribe("AD_ERROR",i,r),ky.once("AD_ERROR",function(e){k.default(this,n),i(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",s);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 m.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(p=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Ay({adType:a.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);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 p.apply(this,arguments)})},{key:"_startRewardedAd",value:(f=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadRewardedAd(Ay(Ay({},n),t));case 13:n.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 f.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Ay({adType:a.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);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 h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(l=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(c=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 c.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 t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode;e.t4r=Gv(this.gameData.__t4r)||{};var r=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=r?.001:1,r&&this.adsManager.setVolume(0),r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){k.default(this,t),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"===n||"first_quartile"===n){if(r&&"click"===n){var i,s=null===(i=this._adrequest_user_context)||void 0===i?void 0:i.tnl_ad_pos;this.clickCount[s]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,t=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=a.Layers.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 n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var i=function(){k.default(this,e);var t=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:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",i),window.document.addEventListener("DOMContentLoaded",i)}},{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 t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),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(){k.default(this,t),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 r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),u="AD_SDK_MANAGER_READY";this.eventBus.broadcast(u,{name:u,message:"AD SDK is ready",status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),s=n.getMonth(),o=n.getFullYear(),u=a.getKeyByValue(google.ima.AdEvent.Type,e.type),d=!1,c=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",l=!c.startsWith("image")&&!c.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:d=this._is_completed(e.getAd()),h="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();h=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:l&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",l&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==u&&""!==h&&this.eventBus.broadcast(u,{name:u,message:h,status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(s," y").concat(o)}}),d&&!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(),a=this._getInnerErrorCode(n);ky.emit("AD_ERROR",r),this.eventBus.broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,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,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){k.default(this,n),this.cancel(),this._clearSafetyTimer(t)}.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(vy(e.getInnerError)){var t=e.getInnerError();if(t)return vy(t.getErrorCode)&&vy(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,t){var n=this;if(e){var r=this.macros.transform(e,{get:function(e){if(k.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];v.isPlainObject(i)&&(r.query[a]=j.default.stringify(i))}var s=new D.default(r.url,!0);return M.default(s.query,r.query||{}),Ay({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new D.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new D.default(e.url,!0);if(i.query.cust_params){var s=j.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&v.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&v.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=L.default(a),v.isPlainObject(a)){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var o=j.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var u in o){new RegExp(a.cust_params.$$remove,"i").test(u)&&delete o[u]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(t){return k.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,M.default(i,d),i.cust_params=j.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[i]>=(null===(n=e.t4r[i])||void 0===n?void 0:n.count))return!1;if(console.log("t4r options.contentType",null==e?void 0:e.contentType,i),null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return i&&(null===(a=e.t4r[i])||void 0===a?void 0:a.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[i])||void 0===s?void 0:s.viper)||0;if(o>0){var u,d=Math.random()<o;return i&&d&&(null===(u=e.t4r[i])||void 0===u?void 0:u.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,u,d,c,l,h,f,p,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===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(u=this.gameData)||void 0===u||null===(d=u.mAds)||void 0===d||null===(c=d.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?y>=(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,a=e.dp,i=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:a,u=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:u}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,u;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===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(u=o.pAds)||void 0===u?void 0:u.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(t){var n=this;k.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new py(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(d.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.default(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){k.default(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var t,n=this,r={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(r).map(function(e){return k.default(this,n),"".concat(e,"=").concat(encodeURIComponent(r[e]))}.bind(this)).join("&");encodeURIComponent(d.Base64.encode(JSON.stringify(r)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,o="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),u=s?o:void 0;return function(){k.default(this,n)}.bind(this),{promo_url:u,promo_imp_blue_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(a){var i,s,o,u,c,l,h=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new py(n.gameData).checkCustomParams())&&(s.cp=o),u=encodeURIComponent(d.Base64.encode(JSON.stringify(s))),c=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,l=(null==c?void 0:c.enabled)&&!0!==(null==t?void 0:t.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return k.default(this,h),e.json()}.bind(this)).then(function(e){if(k.default(this,h),!e||!e.p)return n.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,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:l?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){k.default(this,h),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new D.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=j.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=j.default.stringify(a,!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=A.default(x.default.mark((function e(t){var n,r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[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,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,u),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;k.default(this,u);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:r,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:(o=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["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"],r=this.options.debug?n[0]:n[1],e.next=4,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=A.default(x.default.mark((function e(t){var n,r,i,s,o=this;return x.default.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(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});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 s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u=this;return x.default.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(){k.default(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"),n=function(){k.default(this,u),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,u),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){k.default(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){k.default(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),s=function(e){k.default(this,u),e()}.bind(this),o=function(e){k.default(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),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),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 t}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){k.default(this,r),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),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),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 t}),e,this,[[1,15]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.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(){k.default(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(this,i),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),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),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 t}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.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(){k.default(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(this,i),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),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),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 t}),e,this,[[1,17]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={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:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(d.Base64.encode(JSON.stringify(i)))))}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===a.AdType.Rewarded)t="reward";else if(n===a.AdType.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}}]),e}(),Sy=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"promo",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},_l(this.moduleName,this.moduleConfig)},Ry=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"splash",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},_l(this.moduleName,this.moduleConfig)},Ty=function(e,t){console.log(e,t)},Dy={},Iy={},Oy=null;function Py(){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 Dy.version=r,Dy.frame=e,Dy.function=n,Dy.version}function Cy(e){var t=this;return Oy||(Oy=new Promise(function(n){function r(t,r){if(Ty("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:Dy,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}k.default(this,t),Py(),Dy.frame?2===Dy.version?(Ty("TCF v2 CMP found. Fetching the consent."),Dy.function?(Ty("CMP API is directly accessible, calling it now..."),Dy.function("addEventListener",Dy.version,r)):(Ty("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(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!==Iy[r.callId]&&Iy[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){k.default(this,r);var o=Math.random()+"",u="".concat(a,"Call"),d=R.default({},u,{command:e,parameter:s,callId:o,version:n});Iy[o]=i,t.postMessage(d,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Dy.version,n)}("addEventListener",Dy.frame,r))):n({result:"cmpVersionNotV2",cmp:Dy}):n({result:"cmpNotFound"})}.bind(this)))}var Ly=new(function(){function e(){S.default(this,e),this.productName="Game Distribution"}var t;return T.default(e,[{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:(t=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u;return x.default.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===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{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,u="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(u,{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,n){return t.apply(this,arguments)})}]),e}());function Uy(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 jy(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 jy(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,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,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function jy(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 My=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;k.default(this,t);try{var u=document.createElement("script");if(u.async=null==i||i,u.type="text/javascript",u.onload=function(){k.default(this,o),e()}.bind(this),u.onerror=function(){k.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),u.src=n,r){var d,c=Uy(r);try{for(c.s();!(d=c.n()).done;){var l=d.value,h=l.key,f=l.value;u.setAttribute(h,f)}}catch(e){c.e(e)}finally{c.f()}}a||(a=document.head),a.appendChild(u)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},By=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,My({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,My({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,My({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,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),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,a}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),qy=new b.EventEmitter,Gy={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function Ny(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 t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(Gy).some(function(e){return k.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=Gy[r][a];i&&qy.emit(i,n)}}),!1);var Fy=_.v4(),Vy=function(e){var t=this;if(!window.__msgr){var n=document.createElement("iframe");if(n.src="https://static.gamedistribution.com/message/index.html",n.style.display="none",n.name="__msgr",document.body.appendChild(n),window!==window.top){var r={gameId:e.gameId,target:e.evnts.domain,token:Fy,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){Hy(r)},setInterval(function(){k.default(this,t),r.timestamp=Date.now(),r.event_name="Heartbeat",Hy(r)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){k.default(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ny(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=Fy,Hy(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Wy=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Ky(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Ky=function e(t){try{var n,r,a=null==t?void 0:t.parent;if("game"===(null===(n=a.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return a;e(a)}catch(e){return t}},Hy=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function zy(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 $y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qy,Yy=null,Jy=null,Xy=function(){function e(t){var n=this;if(S.default(this,e),Yy)return Yy;Yy=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new ov,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){k.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){k.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;k.default(this,n),!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!==(t=this._gameData.evnts)&&void 0!==t&&t.enabled&&this._isLoaderGameURL()&&Vy(this._gameData)}.bind(this)),this._registerSGBridge()}var t,n,r,i,s,o,u,c,l,h,f,p;return T.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(k.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(p=A.default(x.default.mark((function e(){var t,n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(r=new ov,0!==(null==(a=r.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,By();case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"testConsent",value:function(){try{Py();A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Cy({});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;qy.on("splash-hidden",function(t){k.default(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:(f=A.default(x.default.mark((function e(t,n){var r,a=this;return x.default.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===(r=this._gameData.enableAds)||void 0===r?void 0:r.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 k.default(this,a),console.error(e.message||e)}.bind(this))),t(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"),n(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return f.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=L.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=uv.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 t=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(j.default.stringify(n))).catch(function(e){k.default(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.Ls.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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:uv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.getMobilePlatform(),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 t=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;k.default(this,e),Jy=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Jy.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Ly.track(Jy,this._gameData)}.bind(this)).catch(function(t){k.default(this,e),this._sendSDKError(t)}.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=Jy)||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 t=["https://ext.minijuegosgratis.com/external-host/main.js"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return k.default(this,e),window.ga}.bind(this)}).then(function(){k.default(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(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(k.default(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 t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return k.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;k.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&Ly.track(Jy,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){k.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){k.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){k.default(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){k.default(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){k.default(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return k.default(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(uv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=A.default(x.default.mark((function e(){var t,n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){k.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(j.default.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.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(){k.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.Ls.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,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(l=A.default(x.default.mark((function e(){var t;return x.default.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new xy(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=uv,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){a.dankLog("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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(c=A.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),a.setDankLog(t.diagnostic),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_createSplash",value:(u=A.default(x.default.mark((function e(t,n){var r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return r=e.sent,i=new r($y($y({},this.options),{},{isConsentDomain:n,version:uv.version}),t,this._parentDomain),e.next=6,Qv();case 6:s=e.sent,o=s.enabled,i.on("playClick",function(){var e=this;if(k.default(this,u),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(this,e),i.hide()}.bind(this)):(function(){k.default(this,e)}.bind(this),this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(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(){k.default(this,u),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){k.default(this,u),i.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i($y($y({},this.options),{},{isConsentDomain:n,version:uv.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromo",value:(s=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i($y($y({},this.options),{},{isConsentDomain:n,version:uv.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),s.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 s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(a.AdType.Interstitial).catch(function(){k.default(this,e)}.bind(this))}},{key:"showAd",value:(i=A.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(a,i){var s,o,u,d,c,l,h,f,p,m,v,g,y,b,_=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,l={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return h=e.sent,e.next=7,r.videoAdReady;case 7:return null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:h,adRequest:l}),r._rejectAdIfAdDisabled({gameData:h,adRequest:l}),r._rejectAdIfUnsupportedType({adRequest:l}),r._rejectAdIfRewardedDisabled({gameData:h,adRequest:l}),(null===(o=h.gft)||void 0===o||!o.enabled||null!==(u=h.gft)&&void 0!==u&&u.enabled&&(null==h||null===(d=h.gft)||void 0===d||null===(c=d.durations[r._giftCount])||void 0===c?void 0:c.after)!==r.adInstance.adMidrollCount)&&r._rejectAdIfAdRateHits({gameData:h,adRequest:l}),r.adInstance.attachAfgPosition(l),r._attachAfgFallback({gameData:h,adRequest:l}),f="main.showad",p=function(e){var t,n,a;k.default(this,_),r.eventBus.unsubscribeScope(f),r.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(a=n.durations[r._giftCount])||void 0===a?void 0:a.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),i(e.message)}.bind(this),m=function(e){var t,n,i;k.default(this,_),r.eventBus.unsubscribeScope(f),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(i=n.durations[r._giftCount])||void 0===i?void 0:i.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),a(e.message)}.bind(this),v=function(e){var s=this;k.default(this,_),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,$y($y({},n),{},{adapter:"adsense"})).then(function(e){k.default(this,s),a(e)}.bind(this)).catch(function(e){k.default(this,s),i(e)}.bind(this))}.bind(this),g=function(e){var s=this;k.default(this,_),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,$y($y({},n),{},{adapter:"promo"})).then(function(e){k.default(this,s),a(e)}.bind(this)).catch(function(e){k.default(this,s),i(e)}.bind(this))}.bind(this),y=function(){var e,t,r;k.default(this,_);var a=!("promo"===(null==n?void 0:n.adapter)||("reward"!==(null==n?void 0:n.position)||h.afg_disabled)&&"adsense"!==(null==n?void 0:n.adapter)),i=null===(e=h.promo)||void 0===e||null===(t=e.rainbow)||void 0===t?void 0:t.enabled,s=null===(r=h.promo)||void 0===r?void 0:r.onadsense;return a&&i&&s?g:null!=n&&n.fallback_adsense?v:p}.bind(this),b=y(),r.eventBus.subscribe("AD_ERROR",function(e){k.default(this,_),b(e)}.bind(this),f),r.eventBus.subscribe("AD_SDK_CANCELED",b,f),r.eventBus.subscribe("AD_SUCCESS",m,f),e.next=28,r.adInstance.startAd(l);case 28:r._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,u=e.gameData,d=e.adRequest,c=null;d.adType===a.AdType.Interstitial&&null!==(t=u.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=u.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(s=u.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):c=u.midroll;if(d.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o;return x.default.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.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(n,r){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=A.default(x.default.mark((function n(r,a){var i;return x.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){a.dankLog("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()||Wy({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.dankLog("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()||Wy({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new a.ImplementationTest(this).start(),a.Ls.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 t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(k.default(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var r=new ActiveXObject("WScript.Shell");null!==r&&r.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){k.default(this,t),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 t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;k.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return k.default(this,n),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.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:v,depth:a.getIframeDepth(),domainMatched:s===o,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 D.default(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 D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Ry(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new Sy(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(j.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=$y($y({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=A.default(x.default.mark((function t(n,r){var a;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{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,t=this._gameData,n=t.assets.find(function(t){return k.default(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft,r=setInterval(A.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(a.AdType.Interstitial,{position:"midroll"}).catch(function(e){k.default(this,n)}.bind(this)),clearInterval(r),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),Zy={},eb=function(e){try{if(e.skipForward)return;if(Zy.source){var t={type:"gd-sdk-on-event",event:e};Zy.source.postMessage(t,Zy.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},tb=function(){eb({name:"SDK_READY",status:"success",message:"Everything is ready."}),eb({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),eb({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},nb=function(e){window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"!==i){if("gd-sdk"===i){if(!Zy.source&&"init"===s)return function(e){var t=e.source,n=e.origin;Zy={source:t,origin:n}}({source:a,origin:r}),void tb();var u=e[s];u&&A.default(x.default.mark((function t(){var n,r=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){k.default(this,r),"showAd"===s&&Cr.firstAdapterModeAdsense&&"rewarded"!==o.adType&&(console.log("promo-test, set first adapter to adssense 3"),o.params=o.params?o.params:{},o.params.adapter="adsense")}.bind(this),!(n=u.apply(e,Object.values(o)))||!n.then){t.next=6;break}return t.next=6,n;case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))()}}else{var d={type:"gd-sdk",method:s,options:o};window.postMessage(d,"https://html5.gamedistribution.com")}}),!1)},rb=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){eb(e),t.apply(this,arguments)}}(e);var t=new Xy(e);return nb(t),t},ab=function(e){try{var t=Fv(e);e.gameId||t.send("nogameid",{message:"".concat(Lh.parentURL)})}catch(e){}},ib={create:function(){var e=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ab(t),Lv=Fv(jv=t),e.next=5,rg();case 5:return n=e.sent,r=n?eg(t):rb(t),Yv(),e.abrupt("return",r);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",rb(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function sb(){return(sb=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zv();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,ub(t);case 9:e.t0=e.sent;case 10:return r=e.t0,e.abrupt("return",n(r));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ob=!1;function ub(e){var t=this;return new Promise(function(n,r){var a=this;if(k.default(this,t),Qy)return n(Qy);if(ob)var i=setInterval(function(){k.default(this,a),Qy&&(ob=!1,clearInterval(i),n(Qy))}.bind(this),100);else ob=!0,ib.create(e).then(function(e){k.default(this,a),Qy=e,e._sendSDKReady(),ob=!1,n(Qy)}.bind(this))}.bind(this))}var db,cb=(ub(db=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":E.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===E.default(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 sb.apply(this,arguments)}(db,e)}});function lb(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return cb.invoke(function(n){return k.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=A.default(x.default.mark((function e(t,n){var r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",cb.invoke(function(e){var i=this;if(k.default(this,r),t===a.AdType.Display)return e.showDisplayAd(n);return function(){k.default(this,i)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){k.default(this,e),kl.showLeaderboard()}.bind(this),addScore:function(t){k.default(this,e),kl.addScore(t)}.bind(this)}}lb.prototype=new function(){this.showBanner=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new lb,window.gdApi=window.gdsdk;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/createClass"),u=require("url-parse"),d=require("js-base64"),c=require("validator"),l=require("is-valid-domain"),h=require("get-value"),f=require("set-value"),p=require("lodash.clonedeep"),m=require("can-autoplay"),v=require("is-plain-object"),g=require("querystringify"),y=require("lodash.merge"),b=require("events"),_=require("uuid");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=w(e),k=w(t),E=w(n),x=w(r),S=w(i),R=w(s),T=w(o),D=w(u),I=w(c),O=w(l),P=w(h),C=w(f),L=w(p),U=w(m),j=w(g),M=w(y),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},q=function(e){return e&&e.Math==Math&&e},G=q("object"==typeof globalThis&&globalThis)||q("object"==typeof window&&window)||q("object"==typeof self&&self)||q("object"==typeof B&&B)||Function("return this")(),N={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},F=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},V=F,W=function(e,t,n){if(V(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},K=function(e){try{return!!e()}catch(e){return!0}},H={}.toString,z=function(e){return H.call(e).slice(8,-1)},$=z,Q="".split,Y=K((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==$(e)?Q.call(e,""):Object(e)}:Object,J=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},X=J,Z=function(e){return Object(X(e))},ee=Math.ceil,te=Math.floor,ne=function(e){return isNaN(e=+e)?0:(e>0?te:ee)(e)},re=ne,ae=Math.min,ie=function(e){return e>0?ae(re(e),9007199254740991):0},se=function(e){return"object"==typeof e?null!==e:"function"==typeof e},oe=z,ue=Array.isArray||function(e){return"Array"==oe(e)},de={exports:{}},ce=!K((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),le={},he=se,fe=G.document,pe=he(fe)&&he(fe.createElement),me=function(e){return pe?fe.createElement(e):{}},ve=me,ge=!ce&&!K((function(){return 7!=Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),ye=se,be=function(e){if(!ye(e))throw TypeError(String(e)+" is not an object");return e},_e=se,we=function(e,t){if(!_e(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!_e(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!_e(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ae=ce,ke=ge,Ee=be,xe=we,Se=Object.defineProperty;le.f=Ae?Se:function(e,t,n){if(Ee(e),t=xe(t,!0),Ee(n),ke)try{return Se(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Re=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Te=le,De=Re,Ie=ce?function(e,t,n){return Te.f(e,t,De(1,n))}:function(e,t,n){return e[t]=n,e},Oe=G,Pe=Ie,Ce=function(e,t){try{Pe(Oe,e,t)}catch(n){Oe[e]=t}return t},Le=Ce,Ue=G["__core-js_shared__"]||Le("__core-js_shared__",{}),je=Ue;(de.exports=function(e,t){return je[e]||(je[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var Me={}.hasOwnProperty,Be=function(e,t){return Me.call(e,t)},qe=0,Ge=Math.random(),Ne=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++qe+Ge).toString(36)},Fe=K,Ve=!!Object.getOwnPropertySymbols&&!Fe((function(){return!String(Symbol())})),We=Ve&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ke=G,He=de.exports,ze=Be,$e=Ne,Qe=Ve,Ye=We,Je=He("wks"),Xe=Ke.Symbol,Ze=Ye?Xe:Xe&&Xe.withoutSetter||$e,et=function(e){return ze(Je,e)||(Qe&&ze(Xe,e)?Je[e]=Xe[e]:Je[e]=Ze("Symbol."+e)),Je[e]},tt=se,nt=ue,rt=et("species"),at=function(e,t){var n;return nt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!nt(n.prototype)?tt(n)&&null===(n=n[rt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},it=W,st=Y,ot=Z,ut=ie,dt=at,ct=[].push,lt=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=5==e||i;return function(o,u,d,c){for(var l,h,f=ot(o),p=st(f),m=it(u,d,3),v=ut(p.length),g=0,y=c||dt,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in p)&&(h=m(l=p[g],g,f),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return l;case 6:return g;case 2:ct.call(b,l)}else if(a)return!1;return i?-1:r||a?a:b}},ht={forEach:lt(0),map:lt(1),filter:lt(2),some:lt(3),every:lt(4),find:lt(5),findIndex:lt(6)},ft=K,pt=function(e,t){var n=[][e];return!!n&&ft((function(){n.call(null,t||function(){throw 1},1)}))},mt=ce,vt=K,gt=Be,yt=Object.defineProperty,bt={},_t=function(e){throw e},wt=function(e,t){if(gt(bt,e))return bt[e];t||(t={});var n=[][e],r=!!gt(t,"ACCESSORS")&&t.ACCESSORS,a=gt(t,0)?t[0]:_t,i=gt(t,1)?t[1]:void 0;return bt[e]=!!n&&!vt((function(){if(r&&!mt)return!0;var e={length:-1};r?yt(e,1,{enumerable:!0,get:_t}):e[1]=1,n.call(e,a,i)}))},At=ht.forEach,kt=wt,Et=pt("forEach"),xt=kt("forEach"),St=G,Rt=N,Tt=Et&&xt?[].forEach:function(e){return At(this,e,arguments.length>1?arguments[1]:void 0)},Dt=Ie;for(var It in Rt){var Ot=St[It],Pt=Ot&&Ot.prototype;if(Pt&&Pt.forEach!==Tt)try{Dt(Pt,"forEach",Tt)}catch(e){Pt.forEach=Tt}}var Ct={},Lt={},Ut={}.propertyIsEnumerable,jt=Object.getOwnPropertyDescriptor,Mt=jt&&!Ut.call({1:2},1);Lt.f=Mt?function(e){var t=jt(this,e);return!!t&&t.enumerable}:Ut;var Bt=Y,qt=J,Gt=function(e){return Bt(qt(e))},Nt=ce,Ft=Lt,Vt=Re,Wt=Gt,Kt=we,Ht=Be,zt=ge,$t=Object.getOwnPropertyDescriptor;Ct.f=Nt?$t:function(e,t){if(e=Wt(e),t=Kt(t,!0),zt)try{return $t(e,t)}catch(e){}if(Ht(e,t))return Vt(!Ft.f.call(e,t),e[t])};var Qt={exports:{}},Yt=Ue,Jt=Function.toString;"function"!=typeof Yt.inspectSource&&(Yt.inspectSource=function(e){return Jt.call(e)});var Xt,Zt,en,tn=Yt.inspectSource,nn=tn,rn=G.WeakMap,an="function"==typeof rn&&/native code/.test(nn(rn)),sn=de.exports,on=Ne,un=sn("keys"),dn=function(e){return un[e]||(un[e]=on(e))},cn={},ln=an,hn=se,fn=Ie,pn=Be,mn=dn,vn=cn,gn=G.WeakMap;if(ln){var yn=new gn,bn=yn.get,_n=yn.has,wn=yn.set;Xt=function(e,t){return wn.call(yn,e,t),t},Zt=function(e){return bn.call(yn,e)||{}},en=function(e){return _n.call(yn,e)}}else{var An=mn("state");vn[An]=!0,Xt=function(e,t){return fn(e,An,t),t},Zt=function(e){return pn(e,An)?e[An]:{}},en=function(e){return pn(e,An)}}var kn={set:Xt,get:Zt,has:en,enforce:function(e){return en(e)?Zt(e):Xt(e,{})},getterFor:function(e){return function(t){var n;if(!hn(t)||(n=Zt(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},En=G,xn=Ie,Sn=Be,Rn=Ce,Tn=tn,Dn=kn.get,In=kn.enforce,On=String(String).split("String");(Qt.exports=function(e,t,n,r){var a=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Sn(n,"name")||xn(n,"name",t),In(n).source=On.join("string"==typeof t?t:"")),e!==En?(a?!s&&e[t]&&(i=!0):delete e[t],i?e[t]=n:xn(e,t,n)):i?e[t]=n:Rn(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Dn(this).source||Tn(this)}));var Pn=G,Cn=Pn,Ln=G,Un=function(e){return"function"==typeof e?e:void 0},jn=function(e,t){return arguments.length<2?Un(Cn[e])||Un(Ln[e]):Cn[e]&&Cn[e][t]||Ln[e]&&Ln[e][t]},Mn={},Bn=ne,qn=Math.max,Gn=Math.min,Nn=function(e,t){var n=Bn(e);return n<0?qn(n+t,0):Gn(n,t)},Fn=Gt,Vn=ie,Wn=Nn,Kn=function(e){return function(t,n,r){var a,i=Fn(t),s=Vn(i.length),o=Wn(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Hn={includes:Kn(!0),indexOf:Kn(!1)},zn=Be,$n=Gt,Qn=Hn.indexOf,Yn=cn,Jn=function(e,t){var n,r=$n(e),a=0,i=[];for(n in r)!zn(Yn,n)&&zn(r,n)&&i.push(n);for(;t.length>a;)zn(r,n=t[a++])&&(~Qn(i,n)||i.push(n));return i},Xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zn=Jn,er=Xn.concat("length","prototype");Mn.f=Object.getOwnPropertyNames||function(e){return Zn(e,er)};var tr={};tr.f=Object.getOwnPropertySymbols;var nr=Mn,rr=tr,ar=be,ir=jn("Reflect","ownKeys")||function(e){var t=nr.f(ar(e)),n=rr.f;return n?t.concat(n(e)):t},sr=Be,or=ir,ur=Ct,dr=le,cr=function(e,t){for(var n=or(t),r=dr.f,a=ur.f,i=0;i<n.length;i++){var s=n[i];sr(e,s)||r(e,s,a(t,s))}},lr=K,hr=/#|\.prototype\./,fr=function(e,t){var n=mr[pr(e)];return n==gr||n!=vr&&("function"==typeof t?lr(t):!!t)},pr=fr.normalize=function(e){return String(e).replace(hr,".").toLowerCase()},mr=fr.data={},vr=fr.NATIVE="N",gr=fr.POLYFILL="P",yr=fr,br=G,_r=Ct.f,wr=Ie,Ar=Qt.exports,kr=Ce,Er=cr,xr=yr,Sr=function(e,t){var n,r,a,i,s,o=e.target,u=e.global,d=e.stat;if(n=u?br:d?br[o]||kr(o,{}):(br[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_r(n,r))&&s.value:n[r],!xr(u?r:o+(d?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Er(i,a)}(e.sham||a&&a.sham)&&wr(i,"sham",!0),Ar(n,r,i,e)}},Rr=Jn,Tr=Xn,Dr=Object.keys||function(e){return Rr(e,Tr)},Ir=Z,Or=Dr;Sr({target:"Object",stat:!0,forced:K((function(){Or(1)}))},{keys:function(e){return Or(Ir(e))}});var Pr,Cr={},Lr=le,Ur=be,jr=Dr,Mr=ce?Object.defineProperties:function(e,t){Ur(e);for(var n,r=jr(t),a=r.length,i=0;a>i;)Lr.f(e,n=r[i++],t[n]);return e},Br=jn("document","documentElement"),qr=be,Gr=Mr,Nr=Xn,Fr=cn,Vr=Br,Wr=me,Kr=dn("IE_PROTO"),Hr=function(){},zr=function(e){return"<script>"+e+"<\/script>"},$r=function(){try{Pr=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;$r=Pr?function(e){e.write(zr("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Pr):((t=Wr("iframe")).style.display="none",Vr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(zr("document.F=Object")),e.close(),e.F);for(var n=Nr.length;n--;)delete $r.prototype[Nr[n]];return $r()};Fr[Kr]=!0;var Qr=Object.create||function(e,t){var n;return null!==e?(Hr.prototype=qr(e),n=new Hr,Hr.prototype=null,n[Kr]=e):n=$r(),void 0===t?n:Gr(n,t)},Yr={},Jr=Gt,Xr=Mn.f,Zr={}.toString,ea="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yr.f=function(e){return ea&&"[object Window]"==Zr.call(e)?function(e){try{return Xr(e)}catch(e){return ea.slice()}}(e):Xr(Jr(e))};var ta={},na=et;ta.f=na;var ra=Pn,aa=Be,ia=ta,sa=le.f,oa=function(e){var t=ra.Symbol||(ra.Symbol={});aa(t,e)||sa(t,e,{value:ia.f(e)})},ua=le.f,da=Be,ca=et("toStringTag"),la=function(e,t,n){e&&!da(e=n?e:e.prototype,ca)&&ua(e,ca,{configurable:!0,value:t})},ha=Sr,fa=G,pa=jn,ma=ce,va=Ve,ga=We,ya=K,ba=Be,_a=ue,wa=se,Aa=be,ka=Z,Ea=Gt,xa=we,Sa=Re,Ra=Qr,Ta=Dr,Da=Mn,Ia=Yr,Oa=tr,Pa=Ct,Ca=le,La=Lt,Ua=Ie,ja=Qt.exports,Ma=de.exports,Ba=cn,qa=Ne,Ga=et,Na=ta,Fa=oa,Va=la,Wa=kn,Ka=ht.forEach,Ha=dn("hidden"),za=Ga("toPrimitive"),$a=Wa.set,Qa=Wa.getterFor("Symbol"),Ya=Object.prototype,Ja=fa.Symbol,Xa=pa("JSON","stringify"),Za=Pa.f,ei=Ca.f,ti=Ia.f,ni=La.f,ri=Ma("symbols"),ai=Ma("op-symbols"),ii=Ma("string-to-symbol-registry"),si=Ma("symbol-to-string-registry"),oi=Ma("wks"),ui=fa.QObject,di=!ui||!ui.prototype||!ui.prototype.findChild,ci=ma&&ya((function(){return 7!=Ra(ei({},"a",{get:function(){return ei(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Za(Ya,t);r&&delete Ya[t],ei(e,t,n),r&&e!==Ya&&ei(Ya,t,r)}:ei,li=function(e,t){var n=ri[e]=Ra(Ja.prototype);return $a(n,{type:"Symbol",tag:e,description:t}),ma||(n.description=t),n},hi=ga?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ja},fi=function(e,t,n){e===Ya&&fi(ai,t,n),Aa(e);var r=xa(t,!0);return Aa(n),ba(ri,r)?(n.enumerable?(ba(e,Ha)&&e[Ha][r]&&(e[Ha][r]=!1),n=Ra(n,{enumerable:Sa(0,!1)})):(ba(e,Ha)||ei(e,Ha,Sa(1,{})),e[Ha][r]=!0),ci(e,r,n)):ei(e,r,n)},pi=function(e,t){Aa(e);var n=Ea(t),r=Ta(n).concat(yi(n));return Ka(r,(function(t){ma&&!mi.call(n,t)||fi(e,t,n[t])})),e},mi=function(e){var t=xa(e,!0),n=ni.call(this,t);return!(this===Ya&&ba(ri,t)&&!ba(ai,t))&&(!(n||!ba(this,t)||!ba(ri,t)||ba(this,Ha)&&this[Ha][t])||n)},vi=function(e,t){var n=Ea(e),r=xa(t,!0);if(n!==Ya||!ba(ri,r)||ba(ai,r)){var a=Za(n,r);return!a||!ba(ri,r)||ba(n,Ha)&&n[Ha][r]||(a.enumerable=!0),a}},gi=function(e){var t=ti(Ea(e)),n=[];return Ka(t,(function(e){ba(ri,e)||ba(Ba,e)||n.push(e)})),n},yi=function(e){var t=e===Ya,n=ti(t?ai:Ea(e)),r=[];return Ka(n,(function(e){!ba(ri,e)||t&&!ba(Ya,e)||r.push(ri[e])})),r};(va||(ja((Ja=function(){if(this instanceof Ja)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=qa(e),n=function(e){this===Ya&&n.call(ai,e),ba(this,Ha)&&ba(this[Ha],t)&&(this[Ha][t]=!1),ci(this,t,Sa(1,e))};return ma&&di&&ci(Ya,t,{configurable:!0,set:n}),li(t,e)}).prototype,"toString",(function(){return Qa(this).tag})),ja(Ja,"withoutSetter",(function(e){return li(qa(e),e)})),La.f=mi,Ca.f=fi,Pa.f=vi,Da.f=Ia.f=gi,Oa.f=yi,Na.f=function(e){return li(Ga(e),e)},ma&&(ei(Ja.prototype,"description",{configurable:!0,get:function(){return Qa(this).description}}),ja(Ya,"propertyIsEnumerable",mi,{unsafe:!0}))),ha({global:!0,wrap:!0,forced:!va,sham:!va},{Symbol:Ja}),Ka(Ta(oi),(function(e){Fa(e)})),ha({target:"Symbol",stat:!0,forced:!va},{for:function(e){var t=String(e);if(ba(ii,t))return ii[t];var n=Ja(t);return ii[t]=n,si[n]=t,n},keyFor:function(e){if(!hi(e))throw TypeError(e+" is not a symbol");if(ba(si,e))return si[e]},useSetter:function(){di=!0},useSimple:function(){di=!1}}),ha({target:"Object",stat:!0,forced:!va,sham:!ma},{create:function(e,t){return void 0===t?Ra(e):pi(Ra(e),t)},defineProperty:fi,defineProperties:pi,getOwnPropertyDescriptor:vi}),ha({target:"Object",stat:!0,forced:!va},{getOwnPropertyNames:gi,getOwnPropertySymbols:yi}),ha({target:"Object",stat:!0,forced:ya((function(){Oa.f(1)}))},{getOwnPropertySymbols:function(e){return Oa.f(ka(e))}}),Xa)&&ha({target:"JSON",stat:!0,forced:!va||ya((function(){var e=Ja();return"[null]"!=Xa([e])||"{}"!=Xa({a:e})||"{}"!=Xa(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(wa(t)||void 0!==e)&&!hi(e))return _a(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!hi(t))return t}),a[1]=t,Xa.apply(null,a)}});Ja.prototype[za]||Ua(Ja.prototype,za,Ja.prototype.valueOf),Va(Ja,"Symbol"),Ba[Ha]=!0;var bi,_i,wi=jn("navigator","userAgent")||"",Ai=wi,ki=G.process,Ei=ki&&ki.versions,xi=Ei&&Ei.v8;xi?_i=(bi=xi.split("."))[0]+bi[1]:Ai&&(!(bi=Ai.match(/Edge\/(\d+)/))||bi[1]>=74)&&(bi=Ai.match(/Chrome\/(\d+)/))&&(_i=bi[1]);var Si=_i&&+_i,Ri=K,Ti=Si,Di=et("species"),Ii=function(e){return Ti>=51||!Ri((function(){var t=[];return(t.constructor={})[Di]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Oi=Sr,Pi=ht.filter,Ci=wt,Li=Ii("filter"),Ui=Ci("filter");Oi({target:"Array",proto:!0,forced:!Li||!Ui},{filter:function(e){return Pi(this,e,arguments.length>1?arguments[1]:void 0)}});var ji=Sr,Mi=K,Bi=Gt,qi=Ct.f,Gi=ce,Ni=Mi((function(){qi(1)}));ji({target:"Object",stat:!0,forced:!Gi||Ni,sham:!Gi},{getOwnPropertyDescriptor:function(e,t){return qi(Bi(e),t)}});var Fi=we,Vi=le,Wi=Re,Ki=function(e,t,n){var r=Fi(t);r in e?Vi.f(e,r,Wi(0,n)):e[r]=n},Hi=ir,zi=Gt,$i=Ct,Qi=Ki;Sr({target:"Object",stat:!0,sham:!ce},{getOwnPropertyDescriptors:function(e){for(var t,n,r=zi(e),a=$i.f,i=Hi(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Qi(s,t,n);return s}});var Yi=Sr,Ji=se,Xi=ue,Zi=Nn,es=ie,ts=Gt,ns=Ki,rs=et,as=wt,is=Ii("slice"),ss=as("slice",{ACCESSORS:!0,0:0,1:2}),os=rs("species"),us=[].slice,ds=Math.max;Yi({target:"Array",proto:!0,forced:!is||!ss},{slice:function(e,t){var n,r,a,i=ts(this),s=es(i.length),o=Zi(e,s),u=Zi(void 0===t?s:t,s);if(Xi(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Xi(n.prototype)?Ji(n)&&null===(n=n[os])&&(n=void 0):n=void 0,n===Array||void 0===n))return us.call(i,o,u);for(r=new(void 0===n?Array:n)(ds(u-o,0)),a=0;o<u;o++,a++)o in i&&ns(r,a,i[o]);return r.length=a,r}});var cs=be,ls=function(e,t,n,r){try{return r?t(cs(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&cs(a.call(e)),t}},hs={},fs=hs,ps=et("iterator"),ms=Array.prototype,vs=function(e){return void 0!==e&&(fs.Array===e||ms[ps]===e)},gs={};gs[et("toStringTag")]="z";var ys="[object z]"===String(gs),bs=ys,_s=z,ws=et("toStringTag"),As="Arguments"==_s(function(){return arguments}()),ks=bs?_s: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=Object(e),ws))?n:As?_s(t):"Object"==(r=_s(t))&&"function"==typeof t.callee?"Arguments":r},Es=ks,xs=hs,Ss=et("iterator"),Rs=function(e){if(null!=e)return e[Ss]||e["@@iterator"]||xs[Es(e)]},Ts=W,Ds=Z,Is=ls,Os=vs,Ps=ie,Cs=Ki,Ls=Rs,Us=function(e){var t,n,r,a,i,s,o=Ds(e),u="function"==typeof this?this:Array,d=arguments.length,c=d>1?arguments[1]:void 0,l=void 0!==c,h=Ls(o),f=0;if(l&&(c=Ts(c,d>2?arguments[2]:void 0,2)),null==h||u==Array&&Os(h))for(n=new u(t=Ps(o.length));t>f;f++)s=l?c(o[f],f):o[f],Cs(n,f,s);else for(i=(a=h.call(o)).next,n=new u;!(r=i.call(a)).done;f++)s=l?Is(a,c,[r.value,f],!0):r.value,Cs(n,f,s);return n.length=f,n},js=et("iterator"),Ms=!1;try{var Bs=0,Gs={next:function(){return{done:!!Bs++}},return:function(){Ms=!0}};Gs[js]=function(){return this},Array.from(Gs,(function(){throw 2}))}catch(e){}var Ns=function(e,t){if(!t&&!Ms)return!1;var n=!1;try{var r={};r[js]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Fs=Us;Sr({target:"Array",stat:!0,forced:!Ns((function(e){Array.from(e)}))},{from:Fs});var Vs,Ws,Ks,Hs=ne,zs=J,$s=function(e){return function(t,n){var r,a,i=String(zs(t)),s=Hs(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},Qs={codeAt:$s(!1),charAt:$s(!0)},Ys=!K((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Js=Be,Xs=Z,Zs=Ys,eo=dn("IE_PROTO"),to=Object.prototype,no=Zs?Object.getPrototypeOf:function(e){return e=Xs(e),Js(e,eo)?e[eo]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?to:null},ro=no,ao=Ie,io=Be,so=et("iterator"),oo=!1;[].keys&&("next"in(Ks=[].keys())?(Ws=ro(ro(Ks)))!==Object.prototype&&(Vs=Ws):oo=!0),null==Vs&&(Vs={}),io(Vs,so)||ao(Vs,so,(function(){return this}));var uo={IteratorPrototype:Vs,BUGGY_SAFARI_ITERATORS:oo},co=uo.IteratorPrototype,lo=Qr,ho=Re,fo=la,po=hs,mo=function(){return this},vo=function(e,t,n){var r=t+" Iterator";return e.prototype=lo(co,{next:ho(1,n)}),fo(e,r,!1),po[r]=mo,e},go=se,yo=be,bo=function(e){if(!go(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},_o=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return yo(n),bo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),wo=Sr,Ao=vo,ko=no,Eo=_o,xo=la,So=Ie,Ro=Qt.exports,To=hs,Do=uo.IteratorPrototype,Io=uo.BUGGY_SAFARI_ITERATORS,Oo=et("iterator"),Po=function(){return this},Co=function(e,t,n,r,a,i,s){Ao(n,t,r);var o,u,d,c=function(e){if(e===a&&m)return m;if(!Io&&e in f)return f[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,f=e.prototype,p=f[Oo]||f["@@iterator"]||a&&f[a],m=!Io&&p||c(a),v="Array"==t&&f.entries||p;if(v&&(o=ko(v.call(new e)),Do!==Object.prototype&&o.next&&(ko(o)!==Do&&(Eo?Eo(o,Do):"function"!=typeof o[Oo]&&So(o,Oo,Po)),xo(o,l,!0))),"values"==a&&p&&"values"!==p.name&&(h=!0,m=function(){return p.call(this)}),f[Oo]!==m&&So(f,Oo,m),To[t]=m,a)if(u={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(d in u)(Io||h||!(d in f))&&Ro(f,d,u[d]);else wo({target:t,proto:!0,forced:Io||h},u);return u},Lo=Qs.charAt,Uo=kn,jo=Co,Mo=Uo.set,Bo=Uo.getterFor("String Iterator");jo(String,"String",(function(e){Mo(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Bo(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Lo(n,r),t.index+=e.length,{value:e,done:!1})}));var qo=Sr,Go=ce,No=G,Fo=Be,Vo=se,Wo=le.f,Ko=cr,Ho=No.Symbol;if(Go&&"function"==typeof Ho&&(!("description"in Ho.prototype)||void 0!==Ho().description)){var zo={},$o=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof $o?new Ho(e):void 0===e?Ho():Ho(e);return""===e&&(zo[t]=!0),t};Ko($o,Ho);var Qo=$o.prototype=Ho.prototype;Qo.constructor=$o;var Yo=Qo.toString,Jo="Symbol(test)"==String(Ho("test")),Xo=/^Symbol\((.*)\)[^)]+$/;Wo(Qo,"description",{configurable:!0,get:function(){var e=Vo(this)?this.valueOf():this,t=Yo.call(e);if(Fo(zo,e))return"";var n=Jo?t.slice(7,-1):t.replace(Xo,"$1");return""===n?void 0:n}}),qo({global:!0,forced:!0},{Symbol:$o})}oa("iterator");var Zo=Qr,eu=le,tu=et("unscopables"),nu=Array.prototype;null==nu[tu]&&eu.f(nu,tu,{configurable:!0,value:Zo(null)});var ru=function(e){nu[tu][e]=!0},au=Gt,iu=ru,su=hs,ou=kn,uu=Co,du=ou.set,cu=ou.getterFor("Array Iterator"),lu=uu(Array,"Array",(function(e,t){du(this,{type:"Array Iterator",target:au(e),index:0,kind:t})}),(function(){var e=cu(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");su.Arguments=su.Array,iu("keys"),iu("values"),iu("entries");var hu=G,fu=N,pu=lu,mu=Ie,vu=et,gu=vu("iterator"),yu=vu("toStringTag"),bu=pu.values;for(var _u in fu){var wu=hu[_u],Au=wu&&wu.prototype;if(Au){if(Au[gu]!==bu)try{mu(Au,gu,bu)}catch(e){Au[gu]=bu}if(Au[yu]||mu(Au,yu,_u),fu[_u])for(var ku in pu)if(Au[ku]!==pu[ku])try{mu(Au,ku,pu[ku])}catch(e){Au[ku]=pu[ku]}}}var Eu=ks,xu=ys?{}.toString:function(){return"[object "+Eu(this)+"]"},Su=ys,Ru=Qt.exports,Tu=xu;Su||Ru(Object.prototype,"toString",Tu,{unsafe:!0});var Du=G.Promise,Iu=Qt.exports,Ou=function(e,t,n){for(var r in t)Iu(e,r,t[r],n);return e},Pu=jn,Cu=le,Lu=ce,Uu=et("species"),ju=function(e){var t=Pu(e),n=Cu.f;Lu&&t&&!t[Uu]&&n(t,Uu,{configurable:!0,get:function(){return this}})},Mu=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Bu={exports:{}},qu=be,Gu=vs,Nu=ie,Fu=W,Vu=Rs,Wu=ls,Ku=function(e,t){this.stopped=e,this.result=t};(Bu.exports=function(e,t,n,r,a){var i,s,o,u,d,c,l,h=Fu(t,n,r?2:1);if(a)i=e;else{if("function"!=typeof(s=Vu(e)))throw TypeError("Target is not iterable");if(Gu(s)){for(o=0,u=Nu(e.length);u>o;o++)if((d=r?h(qu(l=e[o])[0],l[1]):h(e[o]))&&d instanceof Ku)return d;return new Ku(!1)}i=s.call(e)}for(c=i.next;!(l=c.call(i)).done;)if("object"==typeof(d=Wu(i,h,l.value,r))&&d&&d instanceof Ku)return d;return new Ku(!1)}).stop=function(e){return new Ku(!0,e)};var Hu,zu,$u,Qu=be,Yu=F,Ju=et("species"),Xu=function(e,t){var n,r=Qu(e).constructor;return void 0===r||null==(n=Qu(r)[Ju])?t:Yu(n)},Zu=/(iphone|ipod|ipad).*applewebkit/i.test(wi),ed=G,td=K,nd=z,rd=W,ad=Br,id=me,sd=Zu,od=ed.location,ud=ed.setImmediate,dd=ed.clearImmediate,cd=ed.process,ld=ed.MessageChannel,hd=ed.Dispatch,fd=0,pd={},md=function(e){if(pd.hasOwnProperty(e)){var t=pd[e];delete pd[e],t()}},vd=function(e){return function(){md(e)}},gd=function(e){md(e.data)},yd=function(e){ed.postMessage(e+"",od.protocol+"//"+od.host)};ud&&dd||(ud=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return pd[++fd]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Hu(fd),fd},dd=function(e){delete pd[e]},"process"==nd(cd)?Hu=function(e){cd.nextTick(vd(e))}:hd&&hd.now?Hu=function(e){hd.now(vd(e))}:ld&&!sd?($u=(zu=new ld).port2,zu.port1.onmessage=gd,Hu=rd($u.postMessage,$u,1)):!ed.addEventListener||"function"!=typeof postMessage||ed.importScripts||td(yd)||"file:"===od.protocol?Hu="onreadystatechange"in id("script")?function(e){ad.appendChild(id("script")).onreadystatechange=function(){ad.removeChild(this),md(e)}}:function(e){setTimeout(vd(e),0)}:(Hu=yd,ed.addEventListener("message",gd,!1)));var bd,_d,wd,Ad,kd,Ed,xd,Sd,Rd={set:ud,clear:dd},Td=G,Dd=Ct.f,Id=z,Od=Rd.set,Pd=Zu,Cd=Td.MutationObserver||Td.WebKitMutationObserver,Ld=Td.process,Ud=Td.Promise,jd="process"==Id(Ld),Md=Dd(Td,"queueMicrotask"),Bd=Md&&Md.value;Bd||(bd=function(){var e,t;for(jd&&(e=Ld.domain)&&e.exit();_d;){t=_d.fn,_d=_d.next;try{t()}catch(e){throw _d?Ad():wd=void 0,e}}wd=void 0,e&&e.enter()},jd?Ad=function(){Ld.nextTick(bd)}:Cd&&!Pd?(kd=!0,Ed=document.createTextNode(""),new Cd(bd).observe(Ed,{characterData:!0}),Ad=function(){Ed.data=kd=!kd}):Ud&&Ud.resolve?(xd=Ud.resolve(void 0),Sd=xd.then,Ad=function(){Sd.call(xd,bd)}):Ad=function(){Od.call(Td,bd)});var qd=Bd||function(e){var t={fn:e,next:void 0};wd&&(wd.next=t),_d||(_d=t,Ad()),wd=t},Gd={},Nd=F,Fd=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=Nd(t),this.reject=Nd(n)};Gd.f=function(e){return new Fd(e)};var Vd,Wd,Kd,Hd,zd=be,$d=se,Qd=Gd,Yd=function(e,t){if(zd(e),$d(t)&&t.constructor===e)return t;var n=Qd.f(e);return(0,n.resolve)(t),n.promise},Jd=G,Xd=Sr,Zd=G,ec=jn,tc=Du,nc=Qt.exports,rc=Ou,ac=la,ic=ju,sc=se,oc=F,uc=Mu,dc=z,cc=tn,lc=Bu.exports,hc=Ns,fc=Xu,pc=Rd.set,mc=qd,vc=Yd,gc=function(e,t){var n=Jd.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},yc=Gd,bc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},_c=kn,wc=yr,Ac=Si,kc=et("species"),Ec="Promise",xc=_c.get,Sc=_c.set,Rc=_c.getterFor(Ec),Tc=tc,Dc=Zd.TypeError,Ic=Zd.document,Oc=Zd.process,Pc=ec("fetch"),Cc=yc.f,Lc=Cc,Uc="process"==dc(Oc),jc=!!(Ic&&Ic.createEvent&&Zd.dispatchEvent),Mc=wc(Ec,(function(){if(!(cc(Tc)!==String(Tc))){if(66===Ac)return!0;if(!Uc&&"function"!=typeof PromiseRejectionEvent)return!0}if(Ac>=51&&/native code/.test(Tc))return!1;var e=Tc.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[kc]=t,!(e.then((function(){}))instanceof t)})),Bc=Mc||!hc((function(e){Tc.all(e).catch((function(){}))})),qc=function(e){var t;return!(!sc(e)||"function"!=typeof(t=e.then))&&t},Gc=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;mc((function(){for(var a=t.value,i=1==t.state,s=0;r.length>s;){var o,u,d,c=r[s++],l=i?c.ok:c.fail,h=c.resolve,f=c.reject,p=c.domain;try{l?(i||(2===t.rejection&&Wc(e,t),t.rejection=1),!0===l?o=a:(p&&p.enter(),o=l(a),p&&(p.exit(),d=!0)),o===c.promise?f(Dc("Promise-chain cycle")):(u=qc(o))?u.call(o,h,f):h(o)):f(a)}catch(e){p&&!d&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Fc(e,t)}))}},Nc=function(e,t,n){var r,a;jc?((r=Ic.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Zd.dispatchEvent(r)):r={promise:t,reason:n},(a=Zd["on"+e])?a(r):"unhandledrejection"===e&&gc("Unhandled promise rejection",n)},Fc=function(e,t){pc.call(Zd,(function(){var n,r=t.value;if(Vc(t)&&(n=bc((function(){Uc?Oc.emit("unhandledRejection",r,e):Nc("unhandledrejection",e,r)})),t.rejection=Uc||Vc(t)?2:1,n.error))throw n.value}))},Vc=function(e){return 1!==e.rejection&&!e.parent},Wc=function(e,t){pc.call(Zd,(function(){Uc?Oc.emit("rejectionHandled",e):Nc("rejectionhandled",e,t.value)}))},Kc=function(e,t,n,r){return function(a){e(t,n,a,r)}},Hc=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Gc(e,t,!0))},zc=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Dc("Promise can't be resolved itself");var a=qc(n);a?mc((function(){var r={done:!1};try{a.call(n,Kc(zc,e,r,t),Kc(Hc,e,r,t))}catch(n){Hc(e,r,n,t)}})):(t.value=n,t.state=1,Gc(e,t,!1))}catch(n){Hc(e,{done:!1},n,t)}}};Mc&&(Tc=function(e){uc(this,Tc,Ec),oc(e),Vd.call(this);var t=xc(this);try{e(Kc(zc,this,t),Kc(Hc,this,t))}catch(e){Hc(this,t,e)}},(Vd=function(e){Sc(this,{type:Ec,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=rc(Tc.prototype,{then:function(e,t){var n=Rc(this),r=Cc(fc(this,Tc));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Uc?Oc.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Gc(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Wd=function(){var e=new Vd,t=xc(e);this.promise=e,this.resolve=Kc(zc,e,t),this.reject=Kc(Hc,e,t)},yc.f=Cc=function(e){return e===Tc||e===Kd?new Wd(e):Lc(e)},"function"==typeof tc&&(Hd=tc.prototype.then,nc(tc.prototype,"then",(function(e,t){var n=this;return new Tc((function(e,t){Hd.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Pc&&Xd({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return vc(Tc,Pc.apply(Zd,arguments))}}))),Xd({global:!0,wrap:!0,forced:Mc},{Promise:Tc}),ac(Tc,Ec,!1),ic(Ec),Kd=ec(Ec),Xd({target:Ec,stat:!0,forced:Mc},{reject:function(e){var t=Cc(this);return t.reject.call(void 0,e),t.promise}}),Xd({target:Ec,stat:!0,forced:Mc},{resolve:function(e){return vc(this,e)}}),Xd({target:Ec,stat:!0,forced:Bc},{all:function(e){var t=this,n=Cc(t),r=n.resolve,a=n.reject,i=bc((function(){var n=oc(t.resolve),i=[],s=0,o=1;lc(e,(function(e){var u=s++,d=!1;i.push(void 0),o++,n.call(t,e).then((function(e){d||(d=!0,i[u]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Cc(t),r=n.reject,a=bc((function(){var a=oc(t.resolve);lc(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var $c=Sr,Qc=K,Yc=ue,Jc=se,Xc=Z,Zc=ie,el=Ki,tl=at,nl=Ii,rl=Si,al=et("isConcatSpreadable"),il=rl>=51||!Qc((function(){var e=[];return e[al]=!1,e.concat()[0]!==e})),sl=nl("concat"),ol=function(e){if(!Jc(e))return!1;var t=e[al];return void 0!==t?!!t:Yc(e)};$c({target:"Array",proto:!0,forced:!il||!sl},{concat:function(e){var t,n,r,a,i,s=Xc(this),o=tl(s,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(ol(i=-1===t?s:arguments[t])){if(u+(a=Zc(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,u++)n in i&&el(o,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");el(o,u++,i)}return o.length=u,o}});var ul=ce,dl=le.f,cl=Function.prototype,ll=cl.toString,hl=/^\s*function ([^ (]*)/;function fl(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 pl(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 pl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,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,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function pl(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 ml(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 vl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ml(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ul&&!("name"in cl)&&dl(cl,"name",{configurable:!0,get:function(){try{return ll.call(this).match(hl)[1]}catch(e){return""}}});var gl,yl={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"}},bl={},_l=function(e,t){bl[e]=vl(vl({},t),{},{isLoading:!1})},wl=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(k.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Al=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u,d;return x.default.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(!(r=bl[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=fl(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=yl[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,wl({id:s,src:yl[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),u=s.id,d=s.src,console.log("Could not load external script ".concat(u," ").concat(d),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,wl({id:t,src:r.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(r.source,"."),e.t2);case 43:return r.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(t){return e.apply(this,arguments)}}(),kl=new function e(){var t=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"showLeaderboard",function(){var e=A.default(x.default.mark((function e(n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),R.default(this,"addScore",function(){var e=A.default(x.default.mark((function e(n){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.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"]},_l(this.moduleName,this.moduleConfig)},El=se,xl=z,Sl=et("match"),Rl=function(e){var t;return El(e)&&(void 0!==(t=e[Sl])?!!t:"RegExp"==xl(e))},Tl=Rl,Dl=function(e){if(Tl(e))throw TypeError("The method doesn't accept regular expressions");return e},Il=et("match"),Ol=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Il]=!1,"/./"[e](t)}catch(e){}}return!1},Pl=Sr,Cl=Ct.f,Ll=ie,Ul=Dl,jl=J,Ml=Ol,Bl="".startsWith,ql=Math.min,Gl=Ml("startsWith");Pl({target:"String",proto:!0,forced:!!(Gl||(gl=Cl(String.prototype,"startsWith"),!gl||gl.writable))&&!Gl},{startsWith:function(e){var t=String(jl(this));Ul(e);var n=Ll(ql(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Bl?Bl.call(t,r,n):t.slice(n,n+r.length)===r}});var Nl=be,Fl=function(){var e=Nl(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},Vl=Qt.exports,Wl=be,Kl=K,Hl=Fl,zl=RegExp.prototype,$l=zl.toString,Ql=Kl((function(){return"/a/b"!=$l.call({source:"a",flags:"b"})})),Yl="toString"!=$l.name;(Ql||Yl)&&Vl(RegExp.prototype,"toString",(function(){var e=Wl(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in zl)?Hl.call(e):n)}),{unsafe:!0});var Jl={},Xl=K;function Zl(e,t){return RegExp(e,t)}Jl.UNSUPPORTED_Y=Xl((function(){var e=Zl("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Jl.BROKEN_CARET=Xl((function(){var e=Zl("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var eh=Fl,th=Jl,nh=RegExp.prototype.exec,rh=String.prototype.replace,ah=nh,ih=function(){var e=/a/,t=/b*/g;return nh.call(e,"a"),nh.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),sh=th.UNSUPPORTED_Y||th.BROKEN_CARET,oh=void 0!==/()??/.exec("")[1];(ih||oh||sh)&&(ah=function(e){var t,n,r,a,i=this,s=sh&&i.sticky,o=eh.call(i),u=i.source,d=0,c=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),c=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(u="(?: "+u+")",c=" "+c,d++),n=new RegExp("^(?:"+u+")",o)),oh&&(n=new RegExp("^"+u+"$(?!\\s)",o)),ih&&(t=i.lastIndex),r=nh.call(s?n:i,c),s?r?(r.input=r.input.slice(d),r[0]=r[0].slice(d),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:ih&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),oh&&r&&r.length>1&&rh.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var uh=ah;Sr({target:"RegExp",proto:!0,forced:/./.exec!==uh},{exec:uh});var dh=Qt.exports,ch=K,lh=et,hh=uh,fh=Ie,ph=lh("species"),mh=!ch((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),vh="$0"==="a".replace(/./,"$0"),gh=lh("replace"),yh=!!/./[gh]&&""===/./[gh]("a","$0"),bh=!ch((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]})),_h=function(e,t,n,r){var a=lh(e),i=!ch((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!ch((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ph]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!mh||!vh||yh)||"split"===e&&!bh){var o=/./[a],u=n(a,""[e],(function(e,t,n,r,a){return t.exec===hh?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:vh,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:yh}),d=u[0],c=u[1];dh(String.prototype,e,d),dh(RegExp.prototype,a,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}r&&fh(RegExp.prototype[a],"sham",!0)},wh=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ah=z,kh=uh,Eh=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Ah(e))throw TypeError("RegExp#exec called on incompatible receiver");return kh.call(e,t)},xh=be,Sh=J,Rh=wh,Th=Eh;function Dh(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 Ih(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dh(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}_h("search",1,(function(e,t,n){return[function(t){var n=Sh(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=xh(e),i=String(this),s=a.lastIndex;Rh(s,0)||(a.lastIndex=0);var o=Th(a,i);return Rh(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var Oh,Ph,Ch=function(){function e(){S.default(this,e)}return T.default(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.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:v,depth:a.getIframeDepth(),domainMatched:s===o,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 D.default(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 D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(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 D.default(e,!0);return n.query=Ih(Ih({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}}]),e}(),Lh=function(){try{return(new Ch).getBridgeContext()}catch(e){return{}}}(),Uh={userDeclinedTracking:document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0,whitelabelPartner:(Oh=!1,(Ph=a.getQueryParams("xanthophyll")).hasOwnProperty("xanthophyll")&&"true"===Ph.xanthophyll&&(Oh=!0),Oh)},jh=Qs.charAt,Mh=function(e,t,n){return t+(n?jh(e,t).length:1)},Bh=_h,qh=be,Gh=Z,Nh=ie,Fh=ne,Vh=J,Wh=Mh,Kh=Eh,Hh=Math.max,zh=Math.min,$h=Math.floor,Qh=/\$([$&'`]|\d\d?|<[^>]*>)/g,Yh=/\$([$&'`]|\d\d?)/g;Bh("replace",2,(function(e,t,n,r){var a=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,s=a?"$":"$0";return[function(n,r){var a=Vh(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,a,r):t.call(String(a),n,r)},function(e,r){if(!a&&i||"string"==typeof r&&-1===r.indexOf(s)){var u=n(t,e,this,r);if(u.done)return u.value}var d=qh(e),c=String(this),l="function"==typeof r;l||(r=String(r));var h=d.global;if(h){var f=d.unicode;d.lastIndex=0}for(var p=[];;){var m=Kh(d,c);if(null===m)break;if(p.push(m),!h)break;""===String(m[0])&&(d.lastIndex=Wh(c,Nh(d.lastIndex),f))}for(var v,g="",y=0,b=0;b<p.length;b++){m=p[b];for(var _=String(m[0]),w=Hh(zh(Fh(m.index),c.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(v=m[k])?v:String(v));var E=m.groups;if(l){var x=[_].concat(A,w,c);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,c,w,A,E,r);w>=y&&(g+=c.slice(y,w)+S,y=w+_.length)}return g+c.slice(y)}];function o(e,n,r,a,i,s){var o=r+e.length,u=a.length,d=Yh;return void 0!==i&&(i=Gh(i),d=Qh),t.call(s,d,(function(t,s){var d;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":d=i[s.slice(1,-1)];break;default:var c=+s;if(0===c)return t;if(c>u){var l=$h(c/10);return 0===l?t:l<=u?void 0===a[l-1]?s.charAt(1):a[l-1]+s.charAt(1):t}d=a[c-1]}return void 0===d?"":d}))}}));var Jh=K,Xh=et("iterator"),Zh=!Jh((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[Xh]||"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})),ef=ce,tf=K,nf=Dr,rf=tr,af=Lt,sf=Z,of=Y,uf=Object.assign,df=Object.defineProperty,cf=!uf||tf((function(){if(ef&&1!==uf({b:1},uf(df({},"a",{enumerable:!0,get:function(){df(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!=uf({},e)[n]||nf(uf({},t)).join("")!=r}))?function(e,t){for(var n=sf(e),r=arguments.length,a=1,i=rf.f,s=af.f;r>a;)for(var o,u=of(arguments[a++]),d=i?nf(u).concat(i(u)):nf(u),c=d.length,l=0;c>l;)o=d[l++],ef&&!s.call(u,o)||(n[o]=u[o]);return n}:uf,lf=/[^\0-\u007E]/,hf=/[.\u3002\uFF0E\uFF61]/g,ff="Overflow: input needs wider integers to process",pf=Math.floor,mf=String.fromCharCode,vf=function(e){return e+22+75*(e<26)},gf=function(e,t,n){var r=0;for(e=n?pf(e/700):e>>1,e+=pf(e/t);e>455;r+=36)e=pf(e/35);return pf(r+36*e/(e+38))},yf=function(e){var t,n,r=[],a=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var a=e.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){var i=e.charCodeAt(n++);56320==(64512&i)?t.push(((1023&a)<<10)+(1023&i)+65536):(t.push(a),n--)}else t.push(a)}return t}(e)).length,i=128,s=0,o=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(mf(n));var u=r.length,d=u;for(u&&r.push("-");d<a;){var c=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=i&&n<c&&(c=n);var l=d+1;if(c-i>pf((2147483647-s)/l))throw RangeError(ff);for(s+=(c-i)*l,i=c,t=0;t<e.length;t++){if((n=e[t])<i&&++s>2147483647)throw RangeError(ff);if(n==i){for(var h=s,f=36;;f+=36){var p=f<=o?1:f>=o+26?26:f-o;if(h<p)break;var m=h-p,v=36-p;r.push(mf(vf(p+m%v))),h=pf(m/v)}r.push(mf(vf(h))),o=gf(s,l,d==u),s=0,++d}}++s,++i}return r.join("")},bf=be,_f=Rs,wf=Sr,Af=jn,kf=Zh,Ef=Qt.exports,xf=Ou,Sf=la,Rf=vo,Tf=kn,Df=Mu,If=Be,Of=W,Pf=ks,Cf=be,Lf=se,Uf=Qr,jf=Re,Mf=function(e){var t=_f(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return bf(t.call(e))},Bf=Rs,qf=et,Gf=Af("fetch"),Nf=Af("Headers"),Ff=qf("iterator"),Vf=Tf.set,Wf=Tf.getterFor("URLSearchParams"),Kf=Tf.getterFor("URLSearchParamsIterator"),Hf=/\+/g,zf=Array(4),$f=function(e){return zf[e-1]||(zf[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Qf=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Yf=function(e){var t=e.replace(Hf," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace($f(n--),Qf);return t}},Jf=/[!'()~]|%20/g,Xf={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Zf=function(e){return Xf[e]},ep=function(e){return encodeURIComponent(e).replace(Jf,Zf)},tp=function(e,t){if(t)for(var n,r,a=t.split("&"),i=0;i<a.length;)(n=a[i++]).length&&(r=n.split("="),e.push({key:Yf(r.shift()),value:Yf(r.join("="))}))},np=function(e){this.entries.length=0,tp(this.entries,e)},rp=function(e,t){if(e<t)throw TypeError("Not enough arguments")},ap=Rf((function(e,t){Vf(this,{type:"URLSearchParamsIterator",iterator:Mf(Wf(e).entries),kind:t})}),"Iterator",(function(){var e=Kf(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})),ip=function(){Df(this,ip,"URLSearchParams");var e,t,n,r,a,i,s,o,u,d=arguments.length>0?arguments[0]:void 0,c=this,l=[];if(Vf(c,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:np}),void 0!==d)if(Lf(d))if("function"==typeof(e=Bf(d)))for(n=(t=e.call(d)).next;!(r=n.call(t)).done;){if((s=(i=(a=Mf(Cf(r.value))).next).call(a)).done||(o=i.call(a)).done||!i.call(a).done)throw TypeError("Expected sequence with length 2");l.push({key:s.value+"",value:o.value+""})}else for(u in d)If(d,u)&&l.push({key:u,value:d[u]+""});else tp(l,"string"==typeof d?"?"===d.charAt(0)?d.slice(1):d:d+"")},sp=ip.prototype;xf(sp,{append:function(e,t){rp(arguments.length,2);var n=Wf(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){rp(arguments.length,1);for(var t=Wf(this),n=t.entries,r=e+"",a=0;a<n.length;)n[a].key===r?n.splice(a,1):a++;t.updateURL()},get:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=[],a=0;a<t.length;a++)t[a].key===n&&r.push(t[a].value);return r},has:function(e){rp(arguments.length,1);for(var t=Wf(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){rp(arguments.length,1);for(var n,r=Wf(this),a=r.entries,i=!1,s=e+"",o=t+"",u=0;u<a.length;u++)(n=a[u]).key===s&&(i?a.splice(u--,1):(i=!0,n.value=o));i||a.push({key:s,value:o}),r.updateURL()},sort:function(){var e,t,n,r=Wf(this),a=r.entries,i=a.slice();for(a.length=0,n=0;n<i.length;n++){for(e=i[n],t=0;t<n;t++)if(a[t].key>e.key){a.splice(t,0,e);break}t===n&&a.push(e)}r.updateURL()},forEach:function(e){for(var t,n=Wf(this).entries,r=Of(e,arguments.length>1?arguments[1]:void 0,3),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new ap(this,"keys")},values:function(){return new ap(this,"values")},entries:function(){return new ap(this,"entries")}},{enumerable:!0}),Ef(sp,Ff,sp.entries),Ef(sp,"toString",(function(){for(var e,t=Wf(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(ep(e.key)+"="+ep(e.value));return n.join("&")}),{enumerable:!0}),Sf(ip,"URLSearchParams"),wf({global:!0,forced:!kf},{URLSearchParams:ip}),kf||"function"!=typeof Gf||"function"!=typeof Nf||wf({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,a=[e];return arguments.length>1&&(Lf(t=arguments[1])&&(n=t.body,"URLSearchParams"===Pf(n)&&((r=t.headers?new Nf(t.headers):new Nf).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Uf(t,{body:jf(0,String(n)),headers:jf(0,r)}))),a.push(t)),Gf.apply(this,a)}});var op,up={URLSearchParams:ip,getState:Wf},dp=Sr,cp=ce,lp=Zh,hp=G,fp=Mr,pp=Qt.exports,mp=Mu,vp=Be,gp=cf,yp=Us,bp=Qs.codeAt,_p=function(e){var t,n,r=[],a=e.toLowerCase().replace(hf,".").split(".");for(t=0;t<a.length;t++)n=a[t],r.push(lf.test(n)?"xn--"+yf(n):n);return r.join(".")},wp=la,Ap=up,kp=kn,Ep=hp.URL,xp=Ap.URLSearchParams,Sp=Ap.getState,Rp=kp.set,Tp=kp.getterFor("URL"),Dp=Math.floor,Ip=Math.pow,Op=/[A-Za-z]/,Pp=/[\d+-.A-Za-z]/,Cp=/\d/,Lp=/^(0x|0X)/,Up=/^[0-7]+$/,jp=/^\d+$/,Mp=/^[\dA-Fa-f]+$/,Bp=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,qp=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Gp=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Np=/[\u0009\u000A\u000D]/g,Fp=function(e,t){var n,r,a;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=Wp(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Xp(e)){if(t=_p(t),Bp.test(t))return"Invalid host";if(null===(n=Vp(t)))return"Invalid host";e.host=n}else{if(qp.test(t))return"Invalid host";for(n="",r=yp(t),a=0;a<r.length;a++)n+=Yp(r[a],Hp);e.host=n}},Vp=function(e){var t,n,r,a,i,s,o,u=e.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(a=u[r]))return e;if(i=10,a.length>1&&"0"==a.charAt(0)&&(i=Lp.test(a)?16:8,a=a.slice(8==i?1:2)),""===a)s=0;else{if(!(10==i?jp:8==i?Up:Mp).test(a))return e;s=parseInt(a,i)}n.push(s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=Ip(256,5-t))return null}else if(s>255)return null;for(o=n.pop(),r=0;r<n.length;r++)o+=n[r]*Ip(256,3-r);return o},Wp=function(e){var t,n,r,a,i,s,o,u=[0,0,0,0,0,0,0,0],d=0,c=null,l=0,h=function(){return e.charAt(l)};if(":"==h()){if(":"!=e.charAt(1))return;l+=2,c=++d}for(;h();){if(8==d)return;if(":"!=h()){for(t=n=0;n<4&&Mp.test(h());)t=16*t+parseInt(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,d>6)return;for(r=0;h();){if(a=null,r>0){if(!("."==h()&&r<4))return;l++}if(!Cp.test(h()))return;for(;Cp.test(h());){if(i=parseInt(h(),10),null===a)a=i;else{if(0==a)return;a=10*a+i}if(a>255)return;l++}u[d]=256*u[d]+a,2!=++r&&4!=r||d++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;u[d++]=t}else{if(null!==c)return;l++,c=++d}}if(null!==c)for(s=d-c,d=7;0!=d&&s>0;)o=u[d],u[d--]=u[c+s-1],u[c+--s]=o;else if(8!=d)return;return u},Kp=function(e){var t,n,r,a;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Dp(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,a=0,i=0;i<8;i++)0!==e[i]?(a>n&&(t=r,n=a),r=null,a=0):(null===r&&(r=i),++a);return a>n&&(t=r,n=a),t}(e),n=0;n<8;n++)a&&0===e[n]||(a&&(a=!1),r===n?(t+=n?":":"::",a=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Hp={},zp=gp({},Hp,{" ":1,'"':1,"<":1,">":1,"`":1}),$p=gp({},zp,{"#":1,"?":1,"{":1,"}":1}),Qp=gp({},$p,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Yp=function(e,t){var n=bp(e,0);return n>32&&n<127&&!vp(t,e)?e:encodeURIComponent(e)},Jp={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Xp=function(e){return vp(Jp,e.scheme)},Zp=function(e){return""!=e.username||""!=e.password},em=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},tm=function(e,t){var n;return 2==e.length&&Op.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},nm=function(e){var t;return e.length>1&&tm(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},rm=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&tm(t[0],!0)||t.pop()},am=function(e){return"."===e||"%2e"===e.toLowerCase()},im={},sm={},om={},um={},dm={},cm={},lm={},hm={},fm={},pm={},mm={},vm={},gm={},ym={},bm={},_m={},wm={},Am={},km={},Em={},xm={},Sm=function(e,t,n,r){var a,i,s,o,u,d=n||im,c=0,l="",h=!1,f=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Gp,"")),t=t.replace(Np,""),a=yp(t);c<=a.length;){switch(i=a[c],d){case im:if(!i||!Op.test(i)){if(n)return"Invalid scheme";d=om;continue}l+=i.toLowerCase(),d=sm;break;case sm:if(i&&(Pp.test(i)||"+"==i||"-"==i||"."==i))l+=i.toLowerCase();else{if(":"!=i){if(n)return"Invalid scheme";l="",d=om,c=0;continue}if(n&&(Xp(e)!=vp(Jp,l)||"file"==l&&(Zp(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,n)return void(Xp(e)&&Jp[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?d=ym:Xp(e)&&r&&r.scheme==e.scheme?d=um:Xp(e)?d=hm:"/"==a[c+1]?(d=dm,c++):(e.cannotBeABaseURL=!0,e.path.push(""),d=km)}break;case om:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,d=xm;break}d="file"==r.scheme?ym:cm;continue;case um:if("/"!=i||"/"!=a[c+1]){d=cm;continue}d=fm,c++;break;case dm:if("/"==i){d=pm;break}d=Am;continue;case cm:if(e.scheme=r.scheme,i==op)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==i||"\\"==i&&Xp(e))d=lm;else if("?"==i)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",d=Em;else{if("#"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),d=Am;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=xm}break;case lm:if(!Xp(e)||"/"!=i&&"\\"!=i){if("/"!=i){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,d=Am;continue}d=pm}else d=fm;break;case hm:if(d=fm,"/"!=i||"/"!=l.charAt(c+1))continue;c++;break;case fm:if("/"!=i&&"\\"!=i){d=pm;continue}break;case pm:if("@"==i){h&&(l="%40"+l),h=!0,s=yp(l);for(var m=0;m<s.length;m++){var v=s[m];if(":"!=v||p){var g=Yp(v,Qp);p?e.password+=g:e.username+=g}else p=!0}l=""}else if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)){if(h&&""==l)return"Invalid authority";c-=yp(l).length+1,l="",d=mm}else l+=i;break;case mm:case vm:if(n&&"file"==e.scheme){d=_m;continue}if(":"!=i||f){if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)){if(Xp(e)&&""==l)return"Invalid host";if(n&&""==l&&(Zp(e)||null!==e.port))return;if(o=Fp(e,l))return o;if(l="",d=wm,n)return;continue}"["==i?f=!0:"]"==i&&(f=!1),l+=i}else{if(""==l)return"Invalid host";if(o=Fp(e,l))return o;if(l="",d=gm,n==vm)return}break;case gm:if(!Cp.test(i)){if(i==op||"/"==i||"?"==i||"#"==i||"\\"==i&&Xp(e)||n){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=Xp(e)&&y===Jp[e.scheme]?null:y,l=""}if(n)return;d=wm;continue}return"Invalid port"}l+=i;break;case ym:if(e.scheme="file","/"==i||"\\"==i)d=bm;else{if(!r||"file"!=r.scheme){d=Am;continue}if(i==op)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==i)e.host=r.host,e.path=r.path.slice(),e.query="",d=Em;else{if("#"!=i){nm(a.slice(c).join(""))||(e.host=r.host,e.path=r.path.slice(),rm(e)),d=Am;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",d=xm}}break;case bm:if("/"==i||"\\"==i){d=_m;break}r&&"file"==r.scheme&&!nm(a.slice(c).join(""))&&(tm(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),d=Am;continue;case _m:if(i==op||"/"==i||"\\"==i||"?"==i||"#"==i){if(!n&&tm(l))d=Am;else if(""==l){if(e.host="",n)return;d=wm}else{if(o=Fp(e,l))return o;if("localhost"==e.host&&(e.host=""),n)return;l="",d=wm}continue}l+=i;break;case wm:if(Xp(e)){if(d=Am,"/"!=i&&"\\"!=i)continue}else if(n||"?"!=i)if(n||"#"!=i){if(i!=op&&(d=Am,"/"!=i))continue}else e.fragment="",d=xm;else e.query="",d=Em;break;case Am:if(i==op||"/"==i||"\\"==i&&Xp(e)||!n&&("?"==i||"#"==i)){if(".."===(u=(u=l).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(rm(e),"/"==i||"\\"==i&&Xp(e)||e.path.push("")):am(l)?"/"==i||"\\"==i&&Xp(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&tm(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(i==op||"?"==i||"#"==i))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==i?(e.query="",d=Em):"#"==i&&(e.fragment="",d=xm)}else l+=Yp(i,$p);break;case km:"?"==i?(e.query="",d=Em):"#"==i?(e.fragment="",d=xm):i!=op&&(e.path[0]+=Yp(i,Hp));break;case Em:n||"#"!=i?i!=op&&("'"==i&&Xp(e)?e.query+="%27":e.query+="#"==i?"%23":Yp(i,Hp)):(e.fragment="",d=xm);break;case xm:i!=op&&(e.fragment+=Yp(i,zp))}c++}},Rm=function(e){var t,n,r=mp(this,Rm,"URL"),a=arguments.length>1?arguments[1]:void 0,i=String(e),s=Rp(r,{type:"URL"});if(void 0!==a)if(a instanceof Rm)t=Tp(a);else if(n=Sm(t={},String(a)))throw TypeError(n);if(n=Sm(s,i,null,t))throw TypeError(n);var o=s.searchParams=new xp,u=Sp(o);u.updateSearchParams(s.query),u.updateURL=function(){s.query=String(o)||null},cp||(r.href=Dm.call(r),r.origin=Im.call(r),r.protocol=Om.call(r),r.username=Pm.call(r),r.password=Cm.call(r),r.host=Lm.call(r),r.hostname=Um.call(r),r.port=jm.call(r),r.pathname=Mm.call(r),r.search=Bm.call(r),r.searchParams=qm.call(r),r.hash=Gm.call(r))},Tm=Rm.prototype,Dm=function(){var e=Tp(this),t=e.scheme,n=e.username,r=e.password,a=e.host,i=e.port,s=e.path,o=e.query,u=e.fragment,d=t+":";return null!==a?(d+="//",Zp(e)&&(d+=n+(r?":"+r:"")+"@"),d+=Kp(a),null!==i&&(d+=":"+i)):"file"==t&&(d+="//"),d+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==o&&(d+="?"+o),null!==u&&(d+="#"+u),d},Im=function(){var e=Tp(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Xp(e)?t+"://"+Kp(e.host)+(null!==n?":"+n:""):"null"},Om=function(){return Tp(this).scheme+":"},Pm=function(){return Tp(this).username},Cm=function(){return Tp(this).password},Lm=function(){var e=Tp(this),t=e.host,n=e.port;return null===t?"":null===n?Kp(t):Kp(t)+":"+n},Um=function(){var e=Tp(this).host;return null===e?"":Kp(e)},jm=function(){var e=Tp(this).port;return null===e?"":String(e)},Mm=function(){var e=Tp(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Bm=function(){var e=Tp(this).query;return e?"?"+e:""},qm=function(){return Tp(this).searchParams},Gm=function(){var e=Tp(this).fragment;return e?"#"+e:""},Nm=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(cp&&fp(Tm,{href:Nm(Dm,(function(e){var t=Tp(this),n=String(e),r=Sm(t,n);if(r)throw TypeError(r);Sp(t.searchParams).updateSearchParams(t.query)})),origin:Nm(Im),protocol:Nm(Om,(function(e){var t=Tp(this);Sm(t,String(e)+":",im)})),username:Nm(Pm,(function(e){var t=Tp(this),n=yp(String(e));if(!em(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=Yp(n[r],Qp)}})),password:Nm(Cm,(function(e){var t=Tp(this),n=yp(String(e));if(!em(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=Yp(n[r],Qp)}})),host:Nm(Lm,(function(e){var t=Tp(this);t.cannotBeABaseURL||Sm(t,String(e),mm)})),hostname:Nm(Um,(function(e){var t=Tp(this);t.cannotBeABaseURL||Sm(t,String(e),vm)})),port:Nm(jm,(function(e){var t=Tp(this);em(t)||(""==(e=String(e))?t.port=null:Sm(t,e,gm))})),pathname:Nm(Mm,(function(e){var t=Tp(this);t.cannotBeABaseURL||(t.path=[],Sm(t,e+"",wm))})),search:Nm(Bm,(function(e){var t=Tp(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Sm(t,e,Em)),Sp(t.searchParams).updateSearchParams(t.query)})),searchParams:Nm(qm),hash:Nm(Gm,(function(e){var t=Tp(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Sm(t,e,xm)):t.fragment=null}))}),pp(Tm,"toJSON",(function(){return Dm.call(this)}),{enumerable:!0}),pp(Tm,"toString",(function(){return Dm.call(this)}),{enumerable:!0}),Ep){var Fm=Ep.createObjectURL,Vm=Ep.revokeObjectURL;Fm&&pp(Rm,"createObjectURL",(function(e){return Fm.apply(Ep,arguments)})),Vm&&pp(Rm,"revokeObjectURL",(function(e){return Vm.apply(Ep,arguments)}))}wp(Rm,"URL"),dp({global:!0,forced:!lp,sham:!cp},{URL:Rm});var Wm=Hn.includes,Km=ru;Sr({target:"Array",proto:!0,forced:!wt("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return Wm(this,e,arguments.length>1?arguments[1]:void 0)}}),Km("includes");var Hm=Dl,zm=J;Sr({target:"String",proto:!0,forced:!Ol("includes")},{includes:function(e){return!!~String(zm(this)).indexOf(Hm(e),arguments.length>1?arguments[1]:void 0)}});var $m=_h,Qm=Rl,Ym=be,Jm=J,Xm=Xu,Zm=Mh,ev=ie,tv=Eh,nv=uh,rv=K,av=[].push,iv=Math.min,sv=!rv((function(){return!RegExp(4294967295,"y")}));function ov(e){var t=this,n={},r=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function o(e){return P.default(n,e)}function u(e,t){return C.default(n,e,t)}function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new D.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=d(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),I.default.isURL(o)))return o}}}return function(){var e;k.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){u("depth.error",e.message)}u("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(u("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],u("top.domain.from","origins");else if(0===t)a=i,u("top.domain.from","self-top");else if(1===t){var o=d(s);o&&(a=o.origin,u("top.domain.from","referrer"))}u("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(O.default(e))u("partner.domain.value",e),u("partner.domain.from","partner-domain");else{var t=d(e,!1);if(t)u("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),u("partner.domain.from","partner-url");else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","partner-fallback")}else u("partner.domain.value",n.top.domain.value),u("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(u("partner.url.value",a),u("partner.url.from","self-top")):e?O.default(e)?(u("partner.url.value",a),u("partner.url.from","partner-domain")):(u("partner.url.value",e),u("partner.url.from","partner-url")):(u("partner.url.value",s),u("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}$m("split",2,(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=String(Jm(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!Qm(e))return t.call(r,e,a);for(var i,s,o,u=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,d+"g");(i=nv.call(l,r))&&!((s=l.lastIndex)>c&&(u.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&av.apply(u,i.slice(1)),o=i[0].length,c=s,u.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||u.push(""):u.push(r.slice(c)),u.length>a?u.slice(0,a):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=Jm(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(String(a),t,n)},function(e,a){var i=n(r,e,this,a,r!==t);if(i.done)return i.value;var s=Ym(e),o=String(this),u=Xm(s,RegExp),d=s.unicode,c=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(sv?"y":"g"),l=new u(sv?s:"^(?:"+s.source+")",c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===tv(l,o)?[o]:[];for(var f=0,p=0,m=[];p<o.length;){l.lastIndex=sv?p:0;var v,g=tv(l,sv?o:o.slice(p));if(null===g||(v=iv(ev(l.lastIndex+(sv?0:p)),o.length))===f)p=Zm(o,p,d);else{if(m.push(o.slice(f,p)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;p=f=v}}return m.push(o.slice(f)),m}]}),!sv);var uv={name:"@bygd/gd-sdk-pes",version:"1.28.14",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"}},dv="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==dv&&dv,cv="URLSearchParams"in dv,lv="Symbol"in dv&&"iterator"in Symbol,hv="FileReader"in dv&&"Blob"in dv&&function(){try{return new Blob,!0}catch(e){return!1}}(),fv="FormData"in dv,pv="ArrayBuffer"in dv;if(pv)var mv=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],vv=ArrayBuffer.isView||function(e){return e&&mv.indexOf(Object.prototype.toString.call(e))>-1};function gv(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function yv(e){return"string"!=typeof e&&(e=String(e)),e}function bv(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return lv&&(t[Symbol.iterator]=function(){return t}),t}function _v(e){this.map={},e instanceof _v?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 wv(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Av(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function kv(e){var t=new FileReader,n=Av(t);return t.readAsArrayBuffer(e),n}function Ev(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function xv(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:hv&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:fv&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:cv&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():pv&&hv&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ev(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):pv&&(ArrayBuffer.prototype.isPrototypeOf(e)||vv(e))?this._bodyArrayBuffer=Ev(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):cv&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},hv&&(this.blob=function(){var e=wv(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=wv(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(kv)}),this.text=function(){var e=wv(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Av(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)},fv&&(this.formData=function(){return this.text().then(Tv)}),this.json=function(){return this.text().then(JSON.parse)},this}_v.prototype.append=function(e,t){e=gv(e),t=yv(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},_v.prototype.delete=function(e){delete this.map[gv(e)]},_v.prototype.get=function(e){return e=gv(e),this.has(e)?this.map[e]:null},_v.prototype.has=function(e){return this.map.hasOwnProperty(gv(e))},_v.prototype.set=function(e,t){this.map[gv(e)]=yv(t)},_v.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},_v.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),bv(e)},_v.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),bv(e)},_v.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),bv(e)},lv&&(_v.prototype[Symbol.iterator]=_v.prototype.entries);var Sv=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Rv(e,t){if(!(this instanceof Rv))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,a=(t=t||{}).body;if(e instanceof Rv){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new _v(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=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 _v(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Sv.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Tv(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function Dv(e,t){if(!(this instanceof Dv))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="statusText"in t?t.statusText:"",this.headers=new _v(t.headers),this.url=t.url||"",this._initBody(e)}Rv.prototype.clone=function(){return new Rv(this,{body:this._bodyInit})},xv.call(Rv.prototype),xv.call(Dv.prototype),Dv.prototype.clone=function(){return new Dv(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _v(this.headers),url:this.url})},Dv.error=function(){var e=new Dv(null,{status:0,statusText:""});return e.type="error",e};var Iv=[301,302,303,307,308];Dv.redirect=function(e,t){if(-1===Iv.indexOf(t))throw new RangeError("Invalid status code");return new Dv(null,{status:t,headers:{location:e}})};var Ov=dv.DOMException;try{new Ov}catch(e){(Ov=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Ov.prototype.constructor=Ov}function Pv(e,t){return new Promise((function(n,r){var a=new Rv(e,t);if(a.signal&&a.signal.aborted)return r(new Ov("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new _v,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new Dv(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new Ov("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&dv.location.href?dv.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(hv?i.responseType="blob":pv&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof _v?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,yv(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}Pv.polyfill=!0,dv.fetch||(dv.fetch=Pv,dv.Headers=_v,dv.Request=Rv,dv.Response=Dv);var Cv,Lv,Uv,jv,Mv=Array.isArray,Bv=Object.prototype.toString,qv=Mv||function(e){return!!e&&"[object Array]"==Bv.call(e)},Gv=function(e){var t=Nv("object"===E.default(e)?e:a.parseJSON(e));return t&&t.version?uv.version>=t.version?t:void 0:t},Nv=function(e){var t=this;if(!qv(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){k.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}},Fv=function(e){var t=this;if(!Cv){var n={gameId:e.gameId,hours:(new Date).getHours(),topDomain:Lh.topDomain,domain:Lh.parentDomain,referrer:Lh.parentURL,depth:a.getIframeDepth(),version:uv.version,byloader:Lh.isTokenGameURL,isTokenGameURL:Lh.isTokenGameURL,isMasterGameURL:Lh.isMasterGameURL,isExtHostedGameURL:Lh.isExtHostedGameURL,byloaderVersion:Lh.version,tracking:Uh.userDeclinedTracking,whitelabel:Uh.whitelabelPartner,platform:a.getMobilePlatform()};console.log("MESSAGE ROUTER ARGS",n),Cv=new a.MessageRouter(n)}return Cv||{send:function(){k.default(this,t)}.bind(this)}},Vv=[],Wv=function(e){Vv.push(e)},Kv=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Uv){e.next=4;break}return e.next=3,Hv(jv);case 3:Uv=e.sent;case 4:return e.abrupt("return",Uv);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Hv=function(e){var t=this;Lv.send("gdfw.loading",{message:"loading"}),Vv=[],Wv("1"),Wv("2");var n=new ov;Wv("3");var r=n.get("partner.domain.value");Wv("4");var i=function(){return k.default(this,t),{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);Wv("5");var s=function(){k.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(uv.version,"&localTime=").concat((new Date).getHours())}.bind(this);Wv("6");var o=function(){var e=this;k.default(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return k.default(this,e),t.get(n)}.bind(this)});return!n.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:n.gd_mode}.bind(this);return Wv("7"),new Promise(function(e){var n=this;if(k.default(this,t),Uv)e(Uv);else{Wv("7.1");var r=i();try{Wv("7.2");var o=s();Wv("7.3"),fetch(o).then(function(e){return k.default(this,n),Wv("7.4"),e.json()}.bind(this)).then(function(t){var i=this;if(k.default(this,n),Wv("7.5"),t.success){var s,o,u,d,c=t.result.game;Wv("7.6");var l={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(s=c.enableAds)||void 0===s?void 0:s.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,__t4r:c.__t4r||{},block_exts:Gv(c.push_cuda),bloc_gard:Gv(c.bloc_gard),cookie:Gv(c.cookie),gdpr:Gv(c.gdpr),diagnostic:Gv(c.diagnostic),cmp:Gv(c.cmp),gft:Gv(c.gft)||{},sdk:Gv(c.sdk)||{},sdkfw:Gv(c.sdkfw)||{},loader:Gv(c.loader)||{},splash:Gv(c.splash)||{},promo:Gv(c.promo)||{},dAds:Gv(c.dads)||{},pAds:Gv(c.pads)||{},mAds:Gv(c.mads)||{},rAds:Gv(c.rads)||{},lp:Gv(c.lp)||{},extsc:Gv(c.extsc)||{},evnts:Gv(c.evnts)||{},dp:Gv(c.dp)||{}};Wv("7.7");var h=a.extendDefaults(L.default(r),l);Wv("7.8"),h.afg_disabled=!1===(null===(o=h.sdk)||void 0===o||null===(u=o.afg)||void 0===u?void 0:u.enabled),function(){k.default(this,i)}.bind(this),Wv("7.9"),null!==(d=h.pAds)&&void 0!==d&&d.enabled&&(h.preroll=!0),Wv("7.10"),Lv.send("gdfw.success",{message:"success"}),e(h)}else{r.failed=!0;var f=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(f,": json error")}),e(r)}}.bind(this)).catch(function(t){k.default(this,n);var a=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(a,": ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}.bind(this))}catch(t){var u=Vv[Vv.length-1];Lv.send("gdfw.err",{message:"".concat(u,": global ").concat(t.message?t.message:t)}),r.failed=!0,e(r)}}}.bind(this))},zv=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();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 e.apply(this,arguments)}}(),$v=function(){var e=A.default(x.default.mark((function e(){var t,n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return n=e.sent,e.next=5,zv();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 e.apply(this,arguments)}}(),Qv=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return o=e.sent,u=!(null==o||null===(t=o.extsc)||void 0===t||!t.enabled),e.abrupt("return",{enabled:u,path:u?null==o||null===(n=o.extsc)||void 0===n?void 0:n.path:"",name:u?null==o||null===(r=o.extsc)||void 0===r?void 0:r.name:"",ref:u?null==o||null===(a=o.extsc)||void 0===a?void 0:a.ref:"",loadedFlag:u?null==o||null===(i=o.extsc)||void 0===i?void 0:i.loadedFlag:void 0,loadedFlagCheck:!!u&&!(null==o||null===(s=o.extsc)||void 0===s||!s.loadedFlagCheck)});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Yv=function(){var e=A.default(x.default.mark((function e(){var t,n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qv();case 2:if((t=e.sent).enabled){e.next=5;break}return e.abrupt("return");case 5:return n=t.path,r=t.name,i=t.ref,e.prev=6,s={},e.next=10,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});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",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 16:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(){return e.apply(this,arguments)}}(),Jv=!1,Xv=!1,Zv=function(){return new Promise(function(){var e=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Jv){e.next=4;break}return e.abrupt("return",t(Xv));case 4:Jv=!0;case 5:return e.next=7,Qv();case 7:if((r=e.sent).enabled){e.next=10;break}return e.abrupt("return",t(!1));case 10:if(a=r.loadedFlag,!(i=r.loadedFlagCheck)||a){e.next=13;break}return e.abrupt("return",t(!1));case 13:if(i){e.next=16;break}return Xv=!0,e.abrupt("return",t(!0));case 16:s=!0,setTimeout(function(){k.default(this,u),s&&(s=!1,Jv=!0,t(!1))}.bind(this),5e3),o=setInterval(function(){k.default(this,u),s&&i&&window[a]?(s=!1,Jv=!0,Xv=!0,clearInterval(o),t(!0)):s||clearInterval(o)}.bind(this),100);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}())},eg=function(e){var t=function(e){var t=this,n=function(e){return k.default(this,t),c("showAd",{adType:e})}.bind(this),r=function(e){return k.default(this,t),c("preloadAd",{adType:e})}.bind(this),a=function(e){return k.default(this,t),c("showDisplayAd",{options:e})}.bind(this),i=function(){return k.default(this,t),c("cancelAd")}.bind(this),s=function(){return k.default(this,t),c("openConsole")}.bind(this),o=function(){return k.default(this,t),c("showBanner")}.bind(this),u=function(){return k.default(this,t),c("session")}.bind(this),d=function(){k.default(this,t),console.log("_sendSDKReady")}.bind(this),c=function(e,n){var r=this;return k.default(this,t),n||(n={}),new Promise(function(t,a){k.default(this,r);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),l=function(){k.default(this,t),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&&f(r)}),!1)}.bind(this),h=function(){k.default(this,t),l(),c("init")}.bind(this),f=function(n){k.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:u,onEvent:f,init:h,_sendSDKReady:d}}(e);return t.init(),t},tg=function(){var e=this;return{isMasterGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){k.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},ng=function(e){var t=this;return new Promise(function(n,r){var a=this;k.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){k.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},rg=function(){var e=A.default(x.default.mark((function e(){var t,n,r,a,i,s,o,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zv();case 2:return t=e.sent,n=!t,e.next=6,ng(n);case 6:if(r=e.sent,t){e.next=9;break}return e.abrupt("return",!1);case 9:return a=tg(),i=a.isMasterGameURL,s=i(),e.next=13,$v();case 13:return o=e.sent,u=!1,u=o?!s&&!!r:!s,e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ag=ce,ig=Dr,sg=Gt,og=Lt.f,ug=function(e){return function(t){for(var n,r=sg(t),a=ig(r),i=a.length,s=0,o=[];i>s;)n=a[s++],ag&&!og.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},dg={entries:ug(!0),values:ug(!1)}.values;Sr({target:"Object",stat:!0},{values:function(e){return dg(e)}});var cg=Sr,lg=Du,hg=K,fg=jn,pg=Xu,mg=Yd,vg=Qt.exports;cg({target:"Promise",proto:!0,real:!0,forced:!!lg&&hg((function(){lg.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=pg(this,fg("Promise")),n="function"==typeof e;return this.then(n?function(n){return mg(t,e()).then((function(){return n}))}:e,n?function(n){return mg(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof lg||lg.prototype.finally||vg(lg.prototype,"finally",fg("Promise").prototype.finally);var gg=J,yg="[\t\n\v\f\r \u2028\u2029\ufeff]",bg=RegExp("^"+yg+yg+"*"),_g=RegExp(yg+yg+"*$"),wg=function(e){return function(t){var n=String(gg(t));return 1&e&&(n=n.replace(bg,"")),2&e&&(n=n.replace(_g,"")),n}},Ag={start:wg(1),end:wg(2),trim:wg(3)},kg=K,Eg="\t\n\v\f\r \u2028\u2029\ufeff",xg=Ag.trim;Sr({target:"String",proto:!0,forced:function(e){return kg((function(){return!!Eg[e]()||"
"!="
"[e]()||Eg[e].name!==e}))}("trim")},{trim:function(){return xg(this)}});var Sg=se,Rg=_o,Tg=ce,Dg=G,Ig=yr,Og=function(e,t,n){var r,a;return Rg&&"function"==typeof(r=t.constructor)&&r!==n&&Sg(a=r.prototype)&&a!==n.prototype&&Rg(e,a),e},Pg=le.f,Cg=Mn.f,Lg=Rl,Ug=Fl,jg=Jl,Mg=Qt.exports,Bg=K,qg=kn.set,Gg=ju,Ng=et("match"),Fg=Dg.RegExp,Vg=Fg.prototype,Wg=/a/g,Kg=/a/g,Hg=new Fg(Wg)!==Wg,zg=jg.UNSUPPORTED_Y;if(Tg&&Ig("RegExp",!Hg||zg||Bg((function(){return Kg[Ng]=!1,Fg(Wg)!=Wg||Fg(Kg)==Kg||"/a/i"!=Fg(Wg,"i")})))){for(var $g=function(e,t){var n,r=this instanceof $g,a=Lg(e),i=void 0===t;if(!r&&a&&e.constructor===$g&&i)return e;Hg?a&&!i&&(e=e.source):e instanceof $g&&(i&&(t=Ug.call(e)),e=e.source),zg&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Og(Hg?new Fg(e,t):Fg(e,t),r?this:Vg,$g);return zg&&n&&qg(s,{sticky:n}),s},Qg=function(e){e in $g||Pg($g,e,{configurable:!0,get:function(){return Fg[e]},set:function(t){Fg[e]=t}})},Yg=Cg(Fg),Jg=0;Yg.length>Jg;)Qg(Yg[Jg++]);Vg.constructor=$g,$g.prototype=Vg,Mg(Dg,"RegExp",$g)}Gg("RegExp");var Xg=Sr,Zg=ht.find,ey=ru,ty=!0,ny=wt("find");"find"in[]&&Array(1).find((function(){ty=!1})),Xg({target:"Array",proto:!0,forced:ty||!ny},{find:function(e){return Zg(this,e,arguments.length>1?arguments[1]:void 0)}}),ey("find");var ry=Sr,ay=Gt,iy=[].join,sy=Y!=Object,oy=pt("join",",");ry({target:"Array",proto:!0,forced:sy||!oy},{join:function(e){return iy.call(ay(this),void 0===e?",":e)}});var uy=Sr,dy=ht.map,cy=wt,ly=Ii("map"),hy=cy("map");uy({target:"Array",proto:!0,forced:!ly||!hy},{map:function(e){return dy(this,e,arguments.length>1?arguments[1]:void 0)}});var fy=cf;Sr({target:"Object",stat:!0,forced:Object.assign!==fy},{assign:fy});var py=function(){function e(t){S.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return T.default(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 t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,r=new D.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return k.default(this,e),this.customParamKeys.some(function(e){return k.default(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),my=function(){function e(t,n){S.default(this,e),this.adContainer=t,this.onResume=n}return T.default(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 t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){k.default(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}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}(),vy=function(e){if(!e)return!1;var t=gy.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)},gy=Object.prototype.toString;function yy(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 by(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _y(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 wy(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 Ay(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ky=new b.EventEmitter,Ey=null,xy=function(){function e(t,n,r){var i=this;if(S.default(this,e),Ey)return Ey;Ey=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.EventBus,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=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=a.getIMASampleTags(),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=""!==t?document.getElementById(t):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,u=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:u,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){k.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){k.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,u,c,l,h,f,p,m,g,y,b,_,w,E,I,O;return T.default(e,[{key:"start",value:(O=A.default(x.default.mark((function e(){var t=this;return x.default.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){k.default(this,t),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 O.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(i){var s,o,u,d,c,l,h,f,p=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),u=s[o],i({url:u}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,d=n.nextAdPosition(e),n.eventBus.broadcast("AD_REQUEST",{message:d}),c=n.options,"preroll"===d&&v.isPlainObject(c.preroll)?c=c.preroll:"midroll"===d&&v.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===d&&v.isPlainObject(c.rewarded)&&(c=c.rewarded),l="rewarded"===d?"rewardedVideo":"gdbanner"===d?"gd__banner":"midroll"===d?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:Ay(Ay({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&v.isPlainObject(c.retry_on_success)&&v.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&v.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_failure.vast,h)));case 25:if(!v.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.vast,h)));case 27:return r.next=29,n._create_dp_context(d,t);case 29:f=r.sent,window.idhb.requestAds({slots:R.default({},l,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;k.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){k.default(this,r)}.bind(this)),i({tnl_keys:Ay(Ay({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:d,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=36;break;case 33:throw r.prev=33,r.t0=r.catch(8),new Error(r.t0);case 36:case"end":return r.stop()}}),r,this,[[8,33]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||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,t){var n=this;return t=t||{},new Promise(function(r){if(k.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,o=this._transformVast(e,t),u=Ay(Ay({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var d=e.dp,c=e.hl;if(d&&(d.adtag_url=o.url,this._extend_dp_with_adsense(d,c,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var l=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new D.default(e.adtag_url_1,!0);i.query=by(by({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new D.default(e.adtag_url_2,!0);o.query=by(by({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var u=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(_y({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(_y({id:d++,adtag_url:u,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:d,adtag:o,position:"preroll"===u.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=l}else if(d&&c.bidFloorApplied){var h=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()}(d);s.adsResponse=h}else if(d&&d.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()}(d);s.adsResponse=f}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,u);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:u})}catch(e){}r(s)}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:(I=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;k.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):U.default.video({inline:!0,muted:!1}).then(function(t){k.default(this,r);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return I.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(E=A.default(x.default.mark((function e(){var t;return x.default.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 E.apply(this,arguments)})},{key:"startAd",value:(w=A.default(x.default.mark((function e(t){var n,r,i;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,"promo"!==(null==i?void 0:i.adapter)){e.next=5;break}return e.abrupt("return",this._startPromo(i,r));case 5:if(r!==a.AdType.Interstitial){e.next=25;break}if(!n){e.next=10;break}return e.abrupt("return",this._startInterstitialAd(i));case 10:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=14;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 14:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=18;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 18:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=22;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 22:return e.abrupt("return",this._startInterstitialAd(i));case 23:e.next=34;break;case 25:if(r!==a.AdType.Rewarded){e.next=33;break}if(!n){e.next=30;break}return e.abrupt("return",this._startRewardedAd(i));case 30:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 31:e.next=34;break;case 33:throw new Error("Unsupported ad type");case 34:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"preloadAd",value:(_=A.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.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 _.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){k.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new my(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(b=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o,u,d,c,l,h,f,p,m=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),u=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),d=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(d)||(c="\n .gd__banner{\n z-index: ".concat(a.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),u.appendChild(l)),(h=document.createElement("div")).id=d,h.classList.add("gd__banner"),u.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[d]={maxSize:[u.offsetWidth,u.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){k.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return b.apply(this,arguments)})},{key:"_startInterstitialAd",value:(y=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadInterstitialAd(Ay(Ay({},n),t));case 13:n.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 y.apply(this,arguments)})},{key:"_startPromo",value:(g=A.default(x.default.mark((function e(t,n){var r;return x.default.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 r=e.sent,e.next=11,this._loadPromo(Ay(Ay({},r),t),n);case 11:r.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(location.parentURL,"]")}),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(e,t){return g.apply(this,arguments)})},{key:"_loadPromo",value:(m=A.default(x.default.mark((function e(t,n){var r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._resetAdsLoader(),e.prev=1,r=this.nextAdPosition(n),i=this._create_promo_context(r),s=this._requestPromo(i,Ay({adType:a.AdType.Interstitial},t)),e.next=7,new Promise(function(e,t){var n=this;k.default(this,o);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),i=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",i,r),this.eventBus.subscribe("AD_ERROR",i,r),ky.once("AD_ERROR",function(e){k.default(this,n),i(e)}.bind(this))}.bind(this));case 7:return e.abrupt("return",s);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 m.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(p=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Ay({adType:a.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);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 p.apply(this,arguments)})},{key:"_startRewardedAd",value:(f=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=7;break}return e.abrupt("return");case 7:return this.requestRunning=!0,e.next=10,this._initDisplayContainerWithAutoPlay();case 10:return n=e.sent,e.next=13,this._loadRewardedAd(Ay(Ay({},n),t));case 13:n.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 f.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Ay({adType:a.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);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 h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(l=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(c=A.default(x.default.mark((function e(){return x.default.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(a.AdType.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 c.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 t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode;e.t4r=Gv(this.gameData.__t4r)||{};var r=this._isT4R(e),a=this._getT4ROptions(e);if("loaded"===n)this.activeAdContainer.style.opacity=r?.001:1,r&&this.adsManager.setVolume(0),r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){k.default(this,t),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"===n||"first_quartile"===n){if(r&&"click"===n){var i,s=null===(i=this._adrequest_user_context)||void 0===i?void 0:i.tnl_ad_pos;this.clickCount[s]++}this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(1)}}}},{key:"_createPlayer",value:function(){var e=this,t=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=a.Layers.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 n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,window.activeAdContainer=this.activeAdContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var i=function(){k.default(this,e);var t=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:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",i),window.document.addEventListener("DOMContentLoaded",i)}},{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 t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),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(){k.default(this,t),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 r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),u="AD_SDK_MANAGER_READY";this.eventBus.broadcast(u,{name:u,message:"AD SDK is ready",status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t,n=new Date,r=n.getHours(),i=n.getDate(),s=n.getMonth(),o=n.getFullYear(),u=a.getKeyByValue(google.ima.AdEvent.Type,e.type),d=!1,c=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",l=!c.startsWith("image")&&!c.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:d=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:d=this._is_completed(e.getAd()),h="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",d=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();h=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:l&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",l&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:d=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:d=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==u&&""!==h&&this.eventBus.broadcast(u,{name:u,message:h,status:"success",analytics:{category:u,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(s," y").concat(o)}}),d&&!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(),a=this._getInnerErrorCode(n);ky.emit("AD_ERROR",r),this.eventBus.broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,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,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){k.default(this,n),this.cancel(),this._clearSafetyTimer(t)}.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(vy(e.getInnerError)){var t=e.getInnerError();if(t)return vy(t.getErrorCode)&&vy(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,t){var n=this;if(e){var r=this.macros.transform(e,{get:function(e){if(k.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];v.isPlainObject(i)&&(r.query[a]=j.default.stringify(i))}var s=new D.default(r.url,!0);return M.default(s.query,r.query||{}),Ay({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new D.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new D.default(e.url,!0);if(i.query.cust_params){var s=j.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&v.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&v.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=L.default(a),v.isPlainObject(a)){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var o=j.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var u in o){new RegExp(a.cust_params.$$remove,"i").test(u)&&delete o[u]}delete a.cust_params.$$remove}var d=this.macros.transform(a,{get:function(t){return k.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,M.default(i,d),i.cust_params=j.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(this.clickCount[i]>=(null===(n=e.t4r[i])||void 0===n?void 0:n.count))return!1;if(console.log("t4r options.contentType",null==e?void 0:e.contentType,i),null!=e&&null!==(r=e.contentType)&&void 0!==r&&r.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return i&&(null===(a=e.t4r[i])||void 0===a?void 0:a.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o=(null===(s=e.t4r[i])||void 0===s?void 0:s.viper)||0;if(o>0){var u,d=Math.random()<o;return i&&d&&(null===(u=e.t4r[i])||void 0===u?void 0:u.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,u,d,c,l,h,f,p,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===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(u=this.gameData)||void 0===u||null===(d=u.mAds)||void 0===d||null===(c=d.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?y>=(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,a=e.dp,i=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:a,u=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:u}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,u;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===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(u=o.pAds)||void 0===u?void 0:u.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(t){var n=this;k.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new py(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(d.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.default(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){k.default(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_promo_context",value:function(e){var t,n=this,r={id:this.topDomain||this.parentDomain,au:e||"unknown",ty:"video",aid:this.gameData.gameId,pgu:this.parentURL},a=Object.keys(r).map(function(e){return k.default(this,n),"".concat(e,"=").concat(encodeURIComponent(r[e]))}.bind(this)).join("&");encodeURIComponent(d.Base64.encode(JSON.stringify(r)));var i=null===(t=this.gameData.promo)||void 0===t?void 0:t.rainbow,s=null==i?void 0:i.enabled,o="https://tag.atom.gamedistribution.com/v1/rainbow/?".concat(a),u=s?o:void 0;return function(){k.default(this,n)}.bind(this),{promo_url:u,promo_imp_blue_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:s?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0}}},{key:"_create_dp_context",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(a){var i,s,o,u,c,l,h=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new py(n.gameData).checkCustomParams())&&(s.cp=o),u=encodeURIComponent(d.Base64.encode(JSON.stringify(s))),c=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,l=(null==c?void 0:c.enabled)&&!0!==(null==t?void 0:t.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(u)).then(function(e){return k.default(this,h),e.json()}.bind(this)).then(function(e){if(k.default(this,h),!e||!e.p)return n.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,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:l?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(u):void 0,promo_imp_blue_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){k.default(this,h),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new D.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=j.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=j.default.stringify(a,!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=A.default(x.default.mark((function e(t){var n,r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[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,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,u),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;k.default(this,u);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:r,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:(o=A.default(x.default.mark((function e(t){var n,r,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["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"],r=this.options.debug?n[0]:n[1],e.next=4,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=A.default(x.default.mark((function e(t){var n,r,i,s,o=this;return x.default.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(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});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 s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,u=this;return x.default.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(){k.default(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"),n=function(){k.default(this,u),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,u),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){k.default(this,u),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){k.default(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),s=function(e){k.default(this,u),e()}.bind(this),o=function(e){k.default(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),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),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 t}),e,this,[[1,20]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=A.default(x.default.mark((function e(t){var n,r=this;return x.default.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(){k.default(this,r)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){k.default(this,r),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),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),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 t}),e,this,[[1,15]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.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(){k.default(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(this,i),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),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),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 t}),e,this,[[1,17]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.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(){k.default(this,i)}.bind(this)){e.next=8;break}return e.abrupt("return");case 8:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.default(this,i),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),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),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 t}),e,this,[[1,17]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={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:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(d.Base64.encode(JSON.stringify(i)))))}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===a.AdType.Rewarded)t="reward";else if(n===a.AdType.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}}]),e}(),Sy=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"promo",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},_l(this.moduleName,this.moduleConfig)},Ry=function e(t){var n=this;S.default(this,e),R.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Al(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),R.default(this,"splash",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},_l(this.moduleName,this.moduleConfig)},Ty=function(e,t){console.log(e,t)},Dy={},Iy={},Oy=null;function Py(){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 Dy.version=r,Dy.frame=e,Dy.function=n,Dy.version}function Cy(e){var t=this;return Oy||(Oy=new Promise(function(n){function r(t,r){if(Ty("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:Dy,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}k.default(this,t),Py(),Dy.frame?2===Dy.version?(Ty("TCF v2 CMP found. Fetching the consent."),Dy.function?(Ty("CMP API is directly accessible, calling it now..."),Dy.function("addEventListener",Dy.version,r)):(Ty("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(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!==Iy[r.callId]&&Iy[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){k.default(this,r);var o=Math.random()+"",u="".concat(a,"Call"),d=R.default({},u,{command:e,parameter:s,callId:o,version:n});Iy[o]=i,t.postMessage(d,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Dy.version,n)}("addEventListener",Dy.frame,r))):n({result:"cmpVersionNotV2",cmp:Dy}):n({result:"cmpNotFound"})}.bind(this)))}var Ly=new(function(){function e(){S.default(this,e),this.productName="Game Distribution"}var t;return T.default(e,[{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:(t=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,u;return x.default.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===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{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,u="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(u,{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,n){return t.apply(this,arguments)})}]),e}());function Uy(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 jy(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 jy(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 i,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,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function jy(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 My=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;k.default(this,t);try{var u=document.createElement("script");if(u.async=null==i||i,u.type="text/javascript",u.onload=function(){k.default(this,o),e()}.bind(this),u.onerror=function(){k.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),u.src=n,r){var d,c=Uy(r);try{for(c.s();!(d=c.n()).done;){var l=d.value,h=l.key,f=l.value;u.setAttribute(h,f)}}catch(e){c.e(e)}finally{c.f()}}a||(a=document.head),a.appendChild(u)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},By=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,My({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,My({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,My({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,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),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,a}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),qy=new b.EventEmitter,Gy={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function Ny(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 t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(Gy).some(function(e){return k.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&window.parent.postMessage(n,"*"),a)){var i=Gy[r][a];i&&qy.emit(i,n)}}),!1);var Fy=_.v4(),Vy=function(e){var t=this;if(!window.__msgr){var n=document.createElement("iframe");if(n.src="https://static.gamedistribution.com/message/index.html",n.style.display="none",n.name="__msgr",document.body.appendChild(n),window!==window.top){var r={gameId:e.gameId,target:e.evnts.domain,token:Fy,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){Hy(r)},setInterval(function(){k.default(this,t),r.timestamp=Date.now(),r.event_name="Heartbeat",Hy(r)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){k.default(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ny(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=Fy,Hy(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Wy=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Ky(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Ky=function e(t){try{var n,r,a=null==t?void 0:t.parent;if("game"===(null===(n=a.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return a;e(a)}catch(e){return t}},Hy=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function zy(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 $y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zy(Object(n),!0).forEach((function(t){R.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qy,Yy=null,Jy=null,Xy=function(){function e(t){var n=this;if(S.default(this,e),Yy)return Yy;Yy=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new ov,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){k.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){k.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;k.default(this,n),!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!==(t=this._gameData.evnts)&&void 0!==t&&t.enabled&&this._isLoaderGameURL()&&Vy(this._gameData)}.bind(this)),this._registerSGBridge()}var t,n,r,i,s,o,u,c,l,h,f,p;return T.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(k.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this))}},{key:"_loadCMP",value:(p=A.default(x.default.mark((function e(){var t,n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=6;break}if(r=new ov,0!==(null==(a=r.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,By();case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"testConsent",value:function(){try{Py();A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Cy({});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;qy.on("splash-hidden",function(t){k.default(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:(f=A.default(x.default.mark((function e(t,n){var r,a=this;return x.default.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===(r=this._gameData.enableAds)||void 0===r?void 0:r.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 k.default(this,a),console.error(e.message||e)}.bind(this))),t(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"),n(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e,t){return f.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=L.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=uv.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 t=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(j.default.stringify(n))).catch(function(e){k.default(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.Ls.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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:uv.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.getMobilePlatform(),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 t=["https://cdn.gamedock.io/gamedock-web-tracker/4.4.0/script/gamedock-sdk.min.js"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;k.default(this,e),Jy=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Jy.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Ly.track(Jy,this._gameData)}.bind(this)).catch(function(t){k.default(this,e),this._sendSDKError(t)}.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=Jy)||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 t=["https://ext.minijuegosgratis.com/external-host/main.js"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return k.default(this,e),window.ga}.bind(this)}).then(function(){k.default(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(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(k.default(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 t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return k.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;k.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&Ly.track(Jy,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){k.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){k.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){k.default(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){k.default(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){k.default(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return k.default(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(uv.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(h=A.default(x.default.mark((function e(){var t,n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){k.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(j.default.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.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(){k.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.Ls.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,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(l=A.default(x.default.mark((function e(){var t;return x.default.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new xy(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=uv,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){a.dankLog("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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status,skipForward:e.skipForward})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:(c=A.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kv();case 2:return t=e.sent,this._bridge.noPreroll=(!this._getisMobile()||!1!==t.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(t),a.setDankLog(t.diagnostic),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_createSplash",value:(u=A.default(x.default.mark((function e(t,n){var r,i,s,o,u=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:return r=e.sent,i=new r($y($y({},this.options),{},{isConsentDomain:n,version:uv.version}),t,this._parentDomain),e.next=6,Qv();case 6:s=e.sent,o=s.enabled,i.on("playClick",function(){var e=this;if(k.default(this,u),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(this,e),i.hide()}.bind(this)):(function(){k.default(this,e)}.bind(this),this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(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(){k.default(this,u),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){k.default(this,u),i.hide()}.bind(this));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i($y($y({},this.options),{},{isConsentDomain:n,version:uv.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromo",value:(s=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i($y($y({},this.options),{},{isConsentDomain:n,version:uv.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.default(this,o),s.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 s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(a.AdType.Interstitial).catch(function(){k.default(this,e)}.bind(this))}},{key:"showAd",value:(i=A.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(a,i){var s,o,u,d,c,l,h,f,p,m,v,g,y,b,_=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,l={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return h=e.sent,e.next=7,r.videoAdReady;case 7:return null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:h,adRequest:l}),r._rejectAdIfAdDisabled({gameData:h,adRequest:l}),r._rejectAdIfUnsupportedType({adRequest:l}),r._rejectAdIfRewardedDisabled({gameData:h,adRequest:l}),(null===(o=h.gft)||void 0===o||!o.enabled||null!==(u=h.gft)&&void 0!==u&&u.enabled&&(null==h||null===(d=h.gft)||void 0===d||null===(c=d.durations[r._giftCount])||void 0===c?void 0:c.after)!==r.adInstance.adMidrollCount)&&r._rejectAdIfAdRateHits({gameData:h,adRequest:l}),r.adInstance.attachAfgPosition(l),r._attachAfgFallback({gameData:h,adRequest:l}),f="main.showad",p=function(e){var t,n,a;k.default(this,_),r.eventBus.unsubscribeScope(f),r.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(a=n.durations[r._giftCount])||void 0===a?void 0:a.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),i(e.message)}.bind(this),m=function(e){var t,n,i;k.default(this,_),r.eventBus.unsubscribeScope(f),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(i=n.durations[r._giftCount])||void 0===i?void 0:i.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),a(e.message)}.bind(this),v=function(e){var s=this;k.default(this,_),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,$y($y({},n),{},{adapter:"adsense"})).then(function(e){k.default(this,s),a(e)}.bind(this)).catch(function(e){k.default(this,s),i(e)}.bind(this))}.bind(this),g=function(e){var s=this;k.default(this,_),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,$y($y({},n),{},{adapter:"promo"})).then(function(e){k.default(this,s),a(e)}.bind(this)).catch(function(e){k.default(this,s),i(e)}.bind(this))}.bind(this),y=function(){var e,t,r;k.default(this,_);var a=!("promo"===(null==n?void 0:n.adapter)||("reward"!==(null==n?void 0:n.position)||h.afg_disabled)&&"adsense"!==(null==n?void 0:n.adapter)),i=null===(e=h.promo)||void 0===e||null===(t=e.rainbow)||void 0===t?void 0:t.enabled,s=null===(r=h.promo)||void 0===r?void 0:r.onadsense;return a&&i&&s?g:null!=n&&n.fallback_adsense?v:p}.bind(this),b=y(),r.eventBus.subscribe("AD_ERROR",function(e){k.default(this,_),b(e)}.bind(this),f),r.eventBus.subscribe("AD_SDK_CANCELED",b,f),r.eventBus.subscribe("AD_SUCCESS",m,f),e.next=28,r.adInstance.startAd(l);case 28:r._post_message({topic:"adrequest.instream"}),e.next=35;break;case 31:e.prev=31,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 35:case"end":return e.stop()}}),e,this,[[0,31]])})));return function(t,n){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)}))),function(e){return i.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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,u=e.gameData,d=e.adRequest,c=null;d.adType===a.AdType.Interstitial&&null!==(t=u.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=u.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(s=u.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):c=u.midroll;if(d.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o;return x.default.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.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(n,r){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=A.default(x.default.mark((function n(r,a){var i;return x.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){a.dankLog("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()||Wy({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.dankLog("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()||Wy({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new a.ImplementationTest(this).start(),a.Ls.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 t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(k.default(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var r=new ActiveXObject("WScript.Shell");null!==r&&r.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){k.default(this,t),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 t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;k.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return k.default(this,n),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.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),u=(e||n)&&r.loaderEnabled,d=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:u,noLoadedEvent:d,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:v,depth:a.getIframeDepth(),domainMatched:s===o,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 D.default(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 D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(d.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Ry(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new Sy(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(d.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(j.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=$y($y({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return d.Base64.encode(JSON.stringify(e))}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=A.default(x.default.mark((function t(n,r){var a;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{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,t=this._gameData,n=t.assets.find(function(t){return k.default(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft,r=setInterval(A.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(a.AdType.Interstitial,{position:"midroll"}).catch(function(e){k.default(this,n)}.bind(this)),clearInterval(r),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),Zy={},eb=function(e){try{if(e.skipForward)return;if(Zy.source){var t={type:"gd-sdk-on-event",event:e};Zy.source.postMessage(t,Zy.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},tb=function(){eb({name:"SDK_READY",status:"success",message:"Everything is ready."}),eb({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),eb({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},nb=function(e){window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"!==i){if("gd-sdk"===i){if(!Zy.source&&"init"===s)return function(e){var t=e.source,n=e.origin;Zy={source:t,origin:n}}({source:a,origin:r}),void tb();var u=e[s];u&&A.default(x.default.mark((function t(){var n,r=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,function(){k.default(this,r),"showAd"===s&&Cr.firstAdapterModeAdsense&&"rewarded"!==o.adType&&(console.log("promo-test, set first adapter to adssense 3"),o.params=o.params?o.params:{},o.params.adapter="adsense")}.bind(this),!(n=u.apply(e,Object.values(o)))||!n.then){t.next=6;break}return t.next=6,n;case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))()}}else{var d={type:"gd-sdk",method:s,options:o};window.postMessage(d,"https://html5.gamedistribution.com")}}),!1)},rb=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){eb(e),t.apply(this,arguments)}}(e);var t=new Xy(e);return nb(t),t},ab=function(e){try{var t=Fv(e);e.gameId||t.send("nogameid",{message:"".concat(Lh.parentURL)})}catch(e){}},ib={create:function(){var e=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ab(t),Lv=Fv(jv=t),e.next=5,rg();case 5:return n=e.sent,r=n?eg(t):rb(t),Yv(),e.abrupt("return",r);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",rb(t));case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}()};function sb(){return(sb=A.default(x.default.mark((function e(t,n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zv();case 2:if(!e.sent){e.next=7;break}e.t0=window.gdsdk,e.next=10;break;case 7:return e.next=9,ub(t);case 9:e.t0=e.sent;case 10:return r=e.t0,e.abrupt("return",n(r));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ob=!1;function ub(e){var t=this;return new Promise(function(n,r){var a=this;if(k.default(this,t),Qy)return n(Qy);if(ob)var i=setInterval(function(){k.default(this,a),Qy&&(ob=!1,clearInterval(i),n(Qy))}.bind(this),100);else ob=!0,ib.create(e).then(function(e){k.default(this,a),Qy=e,e._sendSDKReady(),ob=!1,n(Qy)}.bind(this))}.bind(this))}var db,cb=(ub(db=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":E.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===E.default(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 sb.apply(this,arguments)}(db,e)}});function lb(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return cb.invoke(function(n){return k.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=A.default(x.default.mark((function e(t,n){var r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",cb.invoke(function(e){var i=this;if(k.default(this,r),t===a.AdType.Display)return e.showDisplayAd(n);return function(){k.default(this,i)}.bind(this),e.showAd(t,{})}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){k.default(this,e),kl.showLeaderboard()}.bind(this),addScore:function(t){k.default(this,e),kl.addScore(t)}.bind(this)}}lb.prototype=new function(){this.showBanner=function(){var e=this;return cb.invoke(function(t){return k.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new lb,window.gdApi=window.gdsdk;
|