@jolibox/implement 1.1.26 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var mc=Object.create;var Fn=Object.defineProperty,vc=Object.defineProperties,_c=Object.getOwnPropertyDescriptor,gc=Object.getOwnPropertyDescriptors,yc=Object.getOwnPropertyNames,Gi=Object.getOwnPropertySymbols,bc=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable;var Ki=(e,t,r)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Wi.call(t,r)&&Ki(e,r,t[r]);if(Gi)for(var r of Gi(t))Ec.call(t,r)&&Ki(e,r,t[r]);return e},pe=(e,t)=>vc(e,gc(t));var Ot=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var sr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yc(t))!Wi.call(e,o)&&o!==r&&Fn(e,o,{get:()=>t[o],enumerable:!(n=_c(t,o))||n.enumerable});return e};var lr=(e,t,r)=>(r=e!=null?mc(bc(e)):{},wc(t||!e||!e.__esModule?Fn(r,"default",{value:e,enumerable:!0}):r,e));var L=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});function kc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Gn(e){return typeof e=="string"}function ta(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ra(e){return typeof e=="object"&&Array.isArray(e)}function Pc(e){return typeof e=="undefined"}function Dc(e){return Pc(e)||e===null}function Nc(e){return typeof e=="function"}function na(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function oa(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(o,i){for(let a in i)if(Object.prototype.hasOwnProperty.call(i,a)){let l=o[a],c=i[a],f=r(l,c,a,o,i);f!==void 0?o[a]=f:Qi(c)&&Qi(l)?o[a]=n(Zi({},l),c):Array.isArray(c)&&Array.isArray(l)?o[a]=[...l,...c]:o[a]=c}return o}return n(e,t)}function Qi(e){return e&&typeof e=="object"&&e.constructor===Object}function ia(e,t){if(Array.isArray(e))return e.concat(t)}function Nt(e,t,r={}){let n=null,o,i,a,{leading:l=!1,trailing:c=!0}=r,f=()=>(a=e.apply(i,o),o=void 0,i=void 0,a),y=function(...p){o=p,i=this;let g=l&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,c&&!g&&f()},t),g)return f()};return y.cancel=()=>{n&&clearTimeout(n),n=null,o=i=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,f()},y}function Mc(e,t){return(...r)=>t(e,...r)}function ca(e){return t=>Mc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(o){e(new Uc(`${o}`))}})}function kt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function ur(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Jc(e){let t=e.location?ur(e.location,Xi):null,r=e.target?ur(e.target,Xi):null;return ur(xc(Zi({},e),{location:t,target:r}),jc)}function Qn(e){let t=e.events.map(n=>Jc(n)),r=ur(e.device,Vc);return[e.protocolVersion,t,r,e.project]}function $c(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Zc(e){return new Promise(t=>ha(e)(t))}function ha(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function ed(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Dt(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function rd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)nd(e[n],t[n])}function nd(e,t){if(Gn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Nc(t)){try{if(e instanceof t)return}catch(r){}if(!Dc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function od(){return typeof globalThis!="undefined"?globalThis[pa]:void 0}function id(e){typeof globalThis!="undefined"&&(globalThis[pa]=e)}function xe(){let e=od();if(e)return e;let t=new cr,r=new Hn,n={registerCommand(o,i,a){t.registerCommand({id:o,handler:i,metadata:a})},executeCommand(o,...i){return r.executeCommand(o,...i)},excuteCommandSync(o,...i){return r.executeCommandThowErr(o,...i)}};return id(n),n}var qn,Ic,Ac,Rc,zi,Sc,Tc,Yi,Zi,xc,Cc,ea,Oc,Lc,Kn,Wn,aa,sa,Uc,la,ua,dr,zn,Te,jn,Fc,Yn,Lt,ct,Bc,Xi,jc,Vc,dt,Hc,Se,qc,Gc,Kc,da,Xn,Zn,Wc,zc,fa,Vn,X,Yc,Qc,Pt,Dt,Pe,$n,Xc,Bn,td,Ut,cr,Hn,pa,K=j(()=>{"use strict";qn=Object.defineProperty,Ic=Object.defineProperties,Ac=Object.getOwnPropertyDescriptor,Rc=Object.getOwnPropertyDescriptors,zi=Object.getOwnPropertySymbols,Sc=Object.prototype.hasOwnProperty,Tc=Object.prototype.propertyIsEnumerable,Yi=(e,t,r)=>t in e?qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zi=(e,t)=>{for(var r in t||(t={}))Sc.call(t,r)&&Yi(e,r,t[r]);if(zi)for(var r of zi(t))Tc.call(t,r)&&Yi(e,r,t[r]);return e},xc=(e,t)=>Ic(e,Rc(t)),Cc=(e,t)=>{for(var r in t)qn(e,r,{get:t[r],enumerable:!0})},ea=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ac(t,r):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(n?a(t,r,o):a(o))||o);return n&&o&&qn(t,r,o),o},Oc=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Lc=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Lc||{}),Kn=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},Wn=class extends Kn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},aa=class extends Kn{constructor(){super(...arguments),this.kind="USER_ERROR"}},sa=class extends aa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Uc=class extends aa{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},la=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},ua=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},dr=class extends Kn{constructor(e,t,r,n,o){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},zn=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Te={log:kt("log"),warn:kt("warn"),info:kt("info"),error:kt("error"),debug:kt("debug")};Object.assign(globalThis,{logger:Te});jn=Symbol.for("Jolibox.canIUseMap"),Fc={};globalThis[jn]||(globalThis[jn]=Fc);Yn={get config(){return globalThis[jn]}},Lt=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Lt||{}),ct=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(ct||{}),Bc=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Bc||{}),Xi=["name","params"],jc=["name","type","location","target","extra","timestamp","userId"],Vc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];dt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});$c();Hc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Se={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},qc=()=>Se.isiOS?"iOS":Se.isAndroid?"Android":Se.isMac?"Mac":Se.isFacebook?"Facebook":"PC",Gc="device_id",Kc="advertising_id",da=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,dt()),window.__joliboxLocalStorage__.getItem(e)),Xn=()=>new URLSearchParams(window.location.search).get("deviceId")||da(Gc),Zn=()=>new URLSearchParams(window.location.search).get("advertisingId")||da(Kc),Wc=e=>e.charAt(0).toUpperCase()+e.slice(1),zc=()=>{var e;let t=new URLSearchParams(window.location.search);return Wc((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},fa=e=>{if(Hc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=qc(),n=navigator.language,o=Xn(),i=Zn();return`${t} (${zc()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${o} adid/${i} version/${e||""}`},Vn=class Jn{constructor(t){this.element=t,this.next=Jn.Undefined,this.prev=Jn.Undefined}};Vn.Undefined=new Vn(void 0);X=Vn,Yc=class{constructor(){this._first=X.Undefined,this._last=X.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===X.Undefined}clear(){let e=this._first;for(;e!==X.Undefined;){let t=e.next;e.prev=X.Undefined,e.next=X.Undefined,e=t}this._first=X.Undefined,this._last=X.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new X(e);if(this._first===X.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==X.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==X.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==X.Undefined&&e.next!==X.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===X.Undefined&&e.next===X.Undefined?(this._first=X.Undefined,this._last=X.Undefined):e.next===X.Undefined?(this._last=this._last.prev,this._last.next=X.Undefined):e.prev===X.Undefined&&(this._first=this._first.next,this._first.prev=X.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==X.Undefined;)yield e.element,e=e.next}},Qc=0,Pt=class{constructor(e){this.value=e,this.id=Qc++}},Dt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Pt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,o,i,a,l,c;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let f=new Pt(t);return this._listeners?this._listeners instanceof Pt?this._listeners=[this._listeners,f]:this._listeners.push(f):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=f,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(c=(l=this.options)==null?void 0:l.onDidAddListener)==null||c.call(l,this),this._size++,()=>{var y,p,g,_;if(!this._disposed){if(this._listeners instanceof Pt)this._listeners.id===f.id&&(this._listeners=void 0,this._size=0,(p=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||p.call(y));else if(this._listeners){let w=this._listeners.indexOf(f);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||_.call(g)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Pt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let o=(n=this.listeners.get(e))!=null?n:new Dt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Yc,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},$n={};Cc($n,{None:()=>Xc,filter:()=>ed,once:()=>ha,toPromise:()=>Zc});Xc=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Bn=Symbol.for("Jolibox.hostEmitter"),td=()=>{let e=new Pe;return globalThis[Bn]||(globalThis[Bn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Bn]},Ut=td();cr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Dt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return rd(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};cr=ea([na],cr);Hn=class{constructor(){this._onWillExecuteCommand=new Dt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Dt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new cr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=kc(3e4)),this._starActivation}executeCommand(e,...t){return Oc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),$n.toPromise($n.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Hn=ea([na],Hn);pa=Symbol.for("Jolibox.commands")});function ke(e,t={}){eo.emit("ERROR_REPORT",{error:e,options:t})}var eo,et,We=j(()=>{"use strict";K();K();eo=new Pe,et=new Pe;ke.debounce=Nt(ke,50,{leading:!0})});var to,ad,ma,va,_a=j(()=>{"use strict";K();We();to=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(o){return{}}},ad=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ma=e=>{var t;try{let o=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(o!=null&&o.length){let[i,a,l]=o;return{headerJson:to(i),payloadJson:to(a),signature:to(l)}}else throw"joli_source is missing"}catch(r){return ke(new la(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},va=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],o=ad(e),i=r[2];return`${n}.${o}.${i}`}return t}});var sd,fr,ga,ro=j(()=>{"use strict";K();sd="1.1.26",fr=()=>sd,ga=()=>{let e=fr();return`${fa(e)}`}});var ld,ya,no,ba,le,ud,P,ge=j(()=>{"use strict";K();_a();ro();K();ld={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Xn(),adId:Zn(),pixelRatio:window.devicePixelRatio||1,platform:Se.isAndroid?"android":Se.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:fr()},schema:window.location.href,platform:Se.isAndroid?"android":Se.isiOS?"ios":"h5"},no=(ya=globalThis.joliboxJSCore)==null?void 0:ya.env,le=Object.assign({},(ba=no==null?void 0:no())!=null?ba:ld),ud=()=>{var g,_,w,I,C,b,k,N,q,Q,S;let{payloadJson:e,headerJson:t,signature:r}=le.schema.length?ma(le.schema):{},n=`${le.deviceInfo.did}-${new Date().getTime()}`,i=new URL(le.schema.length?le.schema:window.location.href).searchParams,a=(w=(_=(g=i.get("mpId"))!=null?g:i.get("appId"))!=null?_:i.get("gameId"))!=null?w:"",l=(b=(C=(I=le.clientSessionId)!=null?I:e==null?void 0:e.sessionId)!=null?C:i.get("sessionId"))!=null?b:n,c=!!((N=(k=e==null?void 0:e.testAdsMode)!=null?k:e==null?void 0:e.__testAdsMode)!=null?N:i.get("testAdsMode")==="true"),f=(S=(Q=(q=e==null?void 0:e.joliboxEnv)!=null?q:e==null?void 0:e.__joliboxEnv)!=null?Q:i.get("joliboxEnv"))!=null?S:"production",y=f==="staging",p=t==null?void 0:t.channel;return{get testMode(){return y},get testAdsMode(){return c},get joliboxEnv(){return f},get joliSource(){var x;return(x=i.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:fr()},get mpType(){var x,U;return(U=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var x;return((x=le.platform)!=null?x:le.deviceInfo.platform).toLowerCase()},get deviceInfo(){return le.deviceInfo},get sdkInfo(){return le.sdkInfo},get hostInfo(){return le.hostInfo},get hostUserInfo(){return le.hostUserInfo},get sessionId(){var x,U;return(U=(x=le.clientSessionId)!=null?x:l)!=null?U:n},get channel(){return p},get webviewId(){var x;return(x=le.webviewId)!=null?x:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var x;return(x=le.deviceInfo.adId)!=null?x:le.deviceInfo.did},get language(){return le.deviceInfo.lang},onEnvConfigChanged:x=>{oa(le,x,ia)},encodeJoliSourceQuery:x=>{var U,V;return t&&r?va(Y(Y({},e),x),(U=i.get("joliSource"))!=null?U:""):(V=i.get("joliSource"))!=null?V:""}}},P=ud()});var oo,wa,cd,dd,Ea,fd,Ia=j(()=>{"use strict";K();We();ge();K();oo=!1,wa=(e,t)=>e==null?!1:t in e,cd=e=>wa(e,"kind"),dd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ea=(e,t={},r)=>{var i,a,l;let n={user_id:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",device_id:(l=P.deviceInfo.did)!=null?l:"",timestamp:Date.now(),tag:dd(e.name)},o=pe(Y({},n),{env:t.environment,isFromUser:r});r?et.emit("GLOBAL_USER_ERROR",e,o):et.emit("GLOBAL_ERROR",e,o)},fd=e=>wa(e,"kind")&&e.kind==="USER_ERROR";eo.on("ERROR_REPORT",({error:e,options:t})=>{if(oo)return;oo=!0;let r=cd(e)&&e.raw?e.raw:e;try{let n=fd(e);Ea(e,t,n)}catch(n){let o=n instanceof Error?n.message:String(n),i=new zn(`${o}, origin error: ${r.message}`);Te.error(i),Ea(new zn(i.message),{environment:t.environment},!1)}finally{oo=!1}})});var io,ao=j(()=>{"use strict";We();K();We();io=e=>new sa(e)});function Aa(e,t){let r=(n,o,i)=>{let a=pe(Y({tag:n},t),{extra:Y({},o)});n=="globalJsError"?ke(new ua(JSON.stringify(a))):e("systemLog",a,i)};return r.debounce=Nt(r,500,{leading:!0}),r}function Ra(e){let t=(r,n,o)=>{var l;let i=(l=o&&JSON.stringify(o))!=null?l:0,a={speed_value_type:r,total_duration:n};i&&Object.assign(a,{extra:i}),e("joliboxSpeedAnalysis",a)};return t.debounce=Nt(t,500,{leading:!0}),t}var Sa=j(()=>{"use strict";K();K();We()});function Ta(e,t){let r=Aa(e,t),n=Ra(r);return{track:r,trackPerformance:n}}var xa=j(()=>{"use strict";Sa()});var so=j(()=>{"use strict"});var hr,Ca=j(()=>{"use strict";ge();K();K();hr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return L(this,null,function*(){let r=`${P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,o]of Object.entries(r))if(o.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,o,i,a,l;let{nativeSDKVersion:t,jssdkVersion:r}=P.sdkInfo;return{platform:1e3,os:P.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(i=(o=P.hostInfo)==null?void 0:o.aid)!=null?i:"1",model:(a=P.deviceInfo.model)!=null?a:"UnknownModel",brand:(l=P.deviceInfo.brand)!=null?l:"UnknownBrand",uuid:P.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return L(this,null,function*(){if(this.checkIsSampled(t))return;let o=t.location?t.location:yield this.getLocation(),i=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let l=this.deviceInfo,f={protocolVersion:"1.0.0",events:[pe(Y({},t),{location:o,target:i,extra:a,timestamp:Date.now(),userId:null})],device:l,project:r};try{n?yield this.doReport(Qn(f),n):yield this.doReport(Qn(f))}catch(y){Te.log("[Jolibox SDK] report API error",y)}})}}});var lo=j(()=>{"use strict";xa();so();Ca()});var uo,Oa,Fe,pr,Be,Mt=j(()=>{"use strict";ro();ge();uo=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Oa=AbortSignal.timeout)!=null||(AbortSignal.timeout=uo);Fe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new pr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},pr=class{constructor(t){this.xua=ga();this.getJoliSource=()=>P.joliSource;var n;let r=P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return L(this,null,function*(){try{let{query:n,timeout:o}=r!=null?r:{},{headers:i}=r!=null?r:{},a=n?new URLSearchParams(n):null,l=a==null?void 0:a.toString(),c=`${this.baseUrl}${t}${l?`?${l}`:""}`,f=this.xua,y=this.getJoliSource();i=Object.assign({},i!=null?i:{},f?{"x-user-agent":f}:{},y?{"x-joli-source":y}:{});let p=yield fetch(c,{method:"GET",headers:i,credentials:"include",signal:uo(o!=null?o:3e4)});return Fe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return L(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"POST",headers:a,body:JSON.stringify(n),signal:uo(i!=null?i:3e4),credentials:"include"});Fe.getInstance().recordNetworkRequest(!0);let _=g.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return g.blob()}catch(w){return yield g.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return g.formData()}catch(w){return yield g.text()}if(_!=null&&_.includes("application/json"))try{return yield g.json()}catch(w){return yield g.text()}return g}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return L(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!g.ok)throw Fe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${g.status}`);return Fe.getInstance().recordNetworkRequest(!0),yield g.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=pr;Be=Fe.getInstance()});var co,mr,fo=j(()=>{"use strict";ge();lo();Mt();co=class extends hr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,o;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(o=P.testMode)!=null&&o?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},mr=new co});var hd,ka=j(()=>{"use strict";Ia();K();ao();K();fo();ge();hd=(e,t)=>{var o,i,a;let r={message:t.message,stack:(o=t.stack)!=null?o:"",errorType:t.name,source:0},n={name:e,type:Lt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:null};mr.trackEvent(n,ct.WebSDK)};et.on("GLOBAL_ERROR",(e,t)=>{hd(t.tag,e)});et.on("GLOBAL_USER_ERROR",(e,t)=>{Te.log("UserError",e,t)})});var vr,Pa=j(()=>{"use strict";vr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,o,i=!1,a=0,l=()=>{if(!i)return;let _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=_),n=requestAnimationFrame(l)},c=()=>{y(),r=Date.now(),o=window.setInterval(()=>{if(!i)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},f=()=>{p(),r=Date.now(),n=requestAnimationFrame(l)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",_=>{i&&(console.log("visible",_),_?f():c())});let g=this.visible;return{start(){i||(i=!0,g?f():c())},stop(){i=!1,y(),p()}}}}});var _r,Da=j(()=>{"use strict";ge();Pa();Mt();_r=class extends vr{constructor(r,n,o){super(n,o);this.httpClient=Be.create();this.gameId=P.mpId,this.sessionId=P.sessionId,this.track=r}reporter(r){return L(this,null,function*(){let{event:n,params:o}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:Y({gameId:this.gameId,sessionId:this.sessionId},o)}})})}tracker(r,n=null){this.track(r,n)}}});var Na,pd,De,md,ho,tt,rt=j(()=>{"use strict";ka();K();K();lo();fo();Da();ge();so();Na=xe(),pd={type:ct.WebSDK,platform:"h5",jssdk_version:P.sdkInfo.jssdkVersion,mp_id:P.mpId,mp_version:P.mpVersion},{track:De,trackPerformance:md}=Ta((...e)=>{var a,l,c,f;let[,t]=e,r=t,n=ta(r.extra)?r.extra:Gn(r.extra)?JSON.parse(r.extra):{},o=pe(Y({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(l=r.mp_version)!=null?l:""}),i={name:t.tag,type:Lt.System,location:null,target:null,extra:o,timestamp:Date.now(),userId:(f=(c=P.hostUserInfo)==null?void 0:c.uid)!=null?f:null};mr.trackEvent(i,ct.WebSDK)},pd);Na.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{md(e,t,r)});Na.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});ho=new Pe,tt=new _r(De,ho)});function La(e){let t=Yn.config[e];return t||(t={},Yn.config[e]=t),(r,n)=>{if(t[r]){Te.warn(`[can i use] ${r} already registered`);return}t[r]=Y({},n)}}var Ua=j(()=>{"use strict";K()});function po(e){Ma=e}function gr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>gr(t)):Object.keys(e).reduce((t,r)=>(t[r]=gr(e[r]),t),{})}function je(e){return typeof e=="number"}function mo(e){let t=vo(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function vo(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ma,oe,yr,br,Er,wr,ft,Ir,Ar,Rr,Sr,Tr,xr,Cr,Or,kr,Pr,Dr,Nr,_o=j(()=>{"use strict";Ma=!1;oe=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ma)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${mo(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return gr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:gr(this._default)}optional(){return this._optional=!0,this}};yr=class extends oe{validate(t){return this._optional&&t===void 0?!0:je(t)?je(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):je(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):je(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},br=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Er=class extends oe{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(je(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(je(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},wr=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ft=class extends oe{validate(t){return!0}},Ir=class extends oe{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Ar=class extends oe{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Rr=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Sr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${mo(t)}`)}return!0}},Tr=class extends oe{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(je(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(je(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(je(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let o=!0;if(r.forEach((i,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,i===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(i)||(n.hasFallback?r[a]=n.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let a in r)i.has(r[a])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(r[a])}] and ${this.path}[${a}] are identical)`):i.set(r[a],a)}return o}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},xr=class extends oe{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(vo(r)!=="object")return this.fail({expect:"object",actual:r});let o=r,i=this._value;i.errors=this.errors;let a=!0;for(let l in o){let c=o[l];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(l)?i.path=`${this.path}.${l}`:i.path=`${this.path}["${l}"]`,!(c===void 0&&i._optional)){if(c===void 0&&i.hasDefault){o[l]=i.defaultValue;continue}i.validate(c)||(i.hasFallback?o[l]=i.fallbackValue:a=!1)}}return a}},Cr=class extends oe{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(vo(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,o=!0;for(let i in this._object){let a=n[i],l=this._object[i];if(l.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?l.path=`${this.path}.${i}`:l.path=`${this.path}["${i}"]`,!(l._optional&&a===void 0)){if(a===void 0&&l.hasDefault){n[i]=l.defaultValue;continue}l.validate(a)||(l.hasFallback?n[i]=l.fallbackValue:o=!1)}}return o}},Or=class extends oe{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:mo(this.value),actual:r}):!0}},kr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,o=this._items.length;for(let i=0;i<o;i++){let a=this._items[i];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let i=r.join(`
2
- or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let o=t[n];if(o._optional||o.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,o)=>{if(n.path=`${this.path}[${o}]`,n.errors=this.errors,t[o]===void 0&&n.hasDefault){t[o]=n.defaultValue;return}n.validate(t[o])||(n.hasFallback?t[o]=n._fallback:r=!1)}),r}},Dr=class extends oe{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Nr=class extends oe{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function go(e,t,r="param"){if(e.errors=[],e.path=r,po(!0),!e.validate(t)){let n=e.errors.join(`
3
- `);throw e.errors.length=0,po(!1),new TypeError(n)}}var F,yo=j(()=>{"use strict";_o();_o();F={object(e){return new Cr(e)},array(e){return new Tr(e)},tuple(...e){return new Pr(...e)},literal(e){return new Or(e)},or(...e){return new kr(...e)},symbol(){return new wr},record(e){return new xr(e)},function(){return new Rr},boolean(){return new br},string(){return new Er},number(){return new yr},undefined(){return new Ir},null(){return new Ar},unknown(){return new ft},any(){return new ft},as(){return new ft},arraybuffer(){return new Dr},enum(...e){return new Sr(...e)},typedarray(e){return new Nr(e)}}});var Lr,Fa,Ba=j(()=>{"use strict";K();We();yo();ao();Lr=1,Fa=e=>{function t(n,o){return(...i)=>{var p,g,_,w;let a=Date.now(),l={method:n,trace_id:Lr};Lr+=1;let c="SUCCESS",f=`${n}:ok`,y=0;try{if(o.paramsSchema)try{go(o.paramsSchema,i,"params")}catch(k){throw io(`${n}:fail ${k.message}`)}let I=o.implement(...i),C=I,b=`${n}:ok`;if(I&&"code"in I){let{code:k,data:N,message:q}=I;c=k,C=N,b=q}return{code:c,message:b,data:C}}catch(I){let C=I;y=(g=(p=C.code)!=null?p:C.errNo)!=null?g:2e3,c="FAILURE";let b=(w=(_=C.message)!=null?_:C.errMsg)!=null?w:`${I}`;return f=`${n}:${c} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new dr(f,y)),{code:c,message:f}}finally{let I=Date.now()-a;e("apiInvoked",pe(Y({},l),{duration:I,status:c}))}}}function r(n,o){return(...i)=>L(this,null,function*(){var g,_,w,I;let a=ra(i)?i:[i],l=Date.now(),c={method:n,trace_id:Lr};Lr+=1;let f=`${n}:ok`,y="SUCCESS",p={code:y,message:f};try{if(o.paramsSchema)try{go(o.paramsSchema,a,"params")}catch(k){throw io(k.message)}let b=yield o.implement(...a);if(b&&"code"in b){let{code:k,data:N,message:q}=b;y=k,f=q,b=N}return Object.assign(p,{code:y,message:f,data:b}),p}catch(C){let b=C,k=(_=(g=b.code)!=null?g:b.errNo)!=null?_:2e3;y="FAILURE";let N=(I=(w=b.message)!=null?w:b.errMsg)!=null?I:`${C}`,q=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:q}),ke(new dr(q,k)),p}finally{let C=Date.now()-l;e("apiInvoked",pe(Y({},c),{duration:C,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ve,nt,me,Ft=j(()=>{"use strict";Ua();rt();Ba();yo();({createAPI:Ve,createSyncAPI:nt}=Fa(De)),me=La("h5")});var $a=sr((Ja,Io)=>{(function(e){if(typeof Ja=="object"&&typeof Io!="undefined")Io.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(o,i,a){function l(y,p){if(!i[y]){if(!o[y]){var g=typeof Ot=="function"&&Ot;if(!p&&g)return g(y,!0);if(c)return c(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=i[y]={exports:{}};o[y][0].call(w.exports,function(I){var C=o[y][1][I];return l(C||I)},w,w.exports,n,o,i,a)}return i[y].exports}for(var c=typeof Ot=="function"&&Ot,f=0;f<a.length;f++)l(a[f]);return l}({1:[function(n,o,i){(function(a){"use strict";var l=a.MutationObserver||a.WebKitMutationObserver,c;if(l){var f=0,y=new l(I),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),c=function(){p.data=f=++f%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var g=new a.MessageChannel;g.port1.onmessage=I,c=function(){g.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?c=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){I(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:c=function(){setTimeout(I,0)};var _,w=[];function I(){_=!0;for(var b,k,N=w.length;N;){for(k=w,w=[],b=-1;++b<N;)k[b]();N=w.length}_=!1}o.exports=C;function C(b){w.push(b)===1&&!_&&c()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,o,i){"use strict";var a=n(1);function l(){}var c={},f=["REJECTED"],y=["FULFILLED"],p=["PENDING"];o.exports=g;function g(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,S!==l&&C(this,S)}g.prototype.catch=function(S){return this.then(null,S)},g.prototype.then=function(S,x){if(typeof S!="function"&&this.state===y||typeof x!="function"&&this.state===f)return this;var U=new this.constructor(l);if(this.state!==p){var V=this.state===y?S:x;w(U,V,this.outcome)}else this.queue.push(new _(U,S,x));return U};function _(S,x,U){this.promise=S,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof U=="function"&&(this.onRejected=U,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(S){c.resolve(this.promise,S)},_.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},_.prototype.callRejected=function(S){c.reject(this.promise,S)},_.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,x,U){a(function(){var V;try{V=x(U)}catch(ee){return c.reject(S,ee)}V===S?c.reject(S,new TypeError("Cannot resolve promise with itself")):c.resolve(S,V)})}c.resolve=function(S,x){var U=b(I,x);if(U.status==="error")return c.reject(S,U.value);var V=U.value;if(V)C(S,V);else{S.state=y,S.outcome=x;for(var ee=-1,z=S.queue.length;++ee<z;)S.queue[ee].callFulfilled(x)}return S},c.reject=function(S,x){S.state=f,S.outcome=x;for(var U=-1,V=S.queue.length;++U<V;)S.queue[U].callRejected(x);return S};function I(S){var x=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof x=="function")return function(){x.apply(S,arguments)}}function C(S,x){var U=!1;function V(Ae){U||(U=!0,c.reject(S,Ae))}function ee(Ae){U||(U=!0,c.resolve(S,Ae))}function z(){x(ee,V)}var se=b(z);se.status==="error"&&V(se.value)}function b(S,x){var U={};try{U.value=S(x),U.status="success"}catch(V){U.status="error",U.value=V}return U}g.resolve=k;function k(S){return S instanceof this?S:c.resolve(new this(l),S)}g.reject=N;function N(S){var x=new this(l);return c.reject(x,S)}g.all=q;function q(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,V=!1;if(!U)return this.resolve([]);for(var ee=new Array(U),z=0,se=-1,Ae=new this(l);++se<U;)Ue(S[se],se);return Ae;function Ue(Tt,or){x.resolve(Tt).then(xn,function(lt){V||(V=!0,c.reject(Ae,lt))});function xn(lt){ee[or]=lt,++z===U&&!V&&(V=!0,c.resolve(Ae,ee))}}}g.race=Q;function Q(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,V=!1;if(!U)return this.resolve([]);for(var ee=-1,z=new this(l);++ee<U;)se(S[ee]);return z;function se(Ae){x.resolve(Ae).then(function(Ue){V||(V=!0,c.resolve(z,Ue))},function(Ue){V||(V=!0,c.reject(z,Ue))})}}},{1:1}],3:[function(n,o,i){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(s,d){if(!(s instanceof d))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(s){return}}var f=c();function y(){try{if(!f||!f.open)return!1;var s=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||d)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function p(s,d){s=s||[],d=d||{};try{return new Blob(s,d)}catch(h){if(h.name!=="TypeError")throw h;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new u,v=0;v<s.length;v+=1)m.append(s[v]);return m.getBlob(d.type)}}typeof Promise=="undefined"&&n(3);var g=Promise;function _(s,d){d&&s.then(function(u){d(null,u)},function(u){d(u)})}function w(s,d,u){typeof d=="function"&&s.then(d),typeof u=="function"&&s.catch(u)}function I(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",k=void 0,N={},q=Object.prototype.toString,Q="readonly",S="readwrite";function x(s){for(var d=s.length,u=new ArrayBuffer(d),m=new Uint8Array(u),v=0;v<d;v++)m[v]=s.charCodeAt(v);return u}function U(s){return new g(function(d){var u=s.transaction(b,S),m=p([""]);u.objectStore(b).put(m,"key"),u.onabort=function(v){v.preventDefault(),v.stopPropagation(),d(!1)},u.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),h=navigator.userAgent.match(/Edge\//);d(h||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function V(s){return typeof k=="boolean"?g.resolve(k):U(s).then(function(d){return k=d,k})}function ee(s){var d=N[s.name],u={};u.promise=new g(function(m,v){u.resolve=m,u.reject=v}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function z(s){var d=N[s.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function se(s,d){var u=N[s.name],m=u.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Ae(s,d){return new g(function(u,m){if(N[s.name]=N[s.name]||Si(),s.db)if(d)ee(s),s.db.close();else return u(s.db);var v=[s.name];d&&v.push(s.version);var h=f.open.apply(f,v);d&&(h.onupgradeneeded=function(E){var A=h.result;try{A.createObjectStore(s.storeName),E.oldVersion<=1&&A.createObjectStore(b)}catch(R){if(R.name==="ConstraintError")console.warn('The database "'+s.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+s.storeName+'" already exists.');else throw R}}),h.onerror=function(E){E.preventDefault(),m(h.error)},h.onsuccess=function(){var E=h.result;E.onversionchange=function(A){A.target.close()},u(E),z(s)}})}function Ue(s){return Ae(s,!1)}function Tt(s){return Ae(s,!0)}function or(s,d){if(!s.db)return!0;var u=!s.db.objectStoreNames.contains(s.storeName),m=s.version<s.db.version,v=s.version>s.db.version;if(m&&(s.version!==d&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),v||u){if(u){var h=s.db.version+1;h>s.version&&(s.version=h)}return!0}return!1}function xn(s){return new g(function(d,u){var m=new FileReader;m.onerror=u,m.onloadend=function(v){var h=btoa(v.target.result||"");d({__local_forage_encoded_blob:!0,data:h,type:s.type})},m.readAsBinaryString(s)})}function lt(s){var d=x(atob(s.data));return p([d],{type:s.type})}function Ri(s){return s&&s.__local_forage_encoded_blob}function vu(s){var d=this,u=d._initReady().then(function(){var m=N[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(u,s,s),u}function _u(s){ee(s);for(var d=N[s.name],u=d.forages,m=0;m<u.length;m++){var v=u[m];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return s.db=null,Ue(s).then(function(h){return s.db=h,or(s)?Tt(s):h}).then(function(h){s.db=d.db=h;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=h}).catch(function(h){throw se(s,h),h})}function Me(s,d,u,m){m===void 0&&(m=1);try{var v=s.db.transaction(s.storeName,d);u(null,v)}catch(h){if(m>0&&(!s.db||h.name==="InvalidStateError"||h.name==="NotFoundError"))return g.resolve().then(function(){if(!s.db||h.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),Tt(s)}).then(function(){return _u(s).then(function(){Me(s,d,u,m-1)})}).catch(u);u(h)}}function Si(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function gu(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=s[m];var v=N[u.name];v||(v=Si(),N[u.name]=v),v.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=vu);var h=[];function E(){return g.resolve()}for(var A=0;A<v.forages.length;A++){var R=v.forages[A];R!==d&&h.push(R._initReady().catch(E))}var T=v.forages.slice(0);return g.all(h).then(function(){return u.db=v.db,Ue(u)}).then(function(O){return u.db=O,or(u,d._defaultConfig.version)?Tt(u):O}).then(function(O){u.db=v.db=O,d._dbInfo=u;for(var D=0;D<T.length;D++){var B=T[D];B!==d&&(B._dbInfo.db=u.db,B._dbInfo.version=u.version)}})}function yu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Me(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.get(s);T.onsuccess=function(){var O=T.result;O===void 0&&(O=null),Ri(O)&&(O=lt(O)),v(O)},T.onerror=function(){h(T.error)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function bu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){Me(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.openCursor(),O=1;T.onsuccess=function(){var D=T.result;if(D){var B=D.value;Ri(B)&&(B=lt(B));var H=s(B,D.key,O++);H!==void 0?v(H):D.continue()}else v()},T.onerror=function(){h(T.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Eu(s,d,u){var m=this;s=I(s);var v=new g(function(h,E){var A;m.ready().then(function(){return A=m._dbInfo,q.call(d)==="[object Blob]"?V(A.db).then(function(R){return R?d:xn(d)}):d}).then(function(R){Me(m._dbInfo,S,function(T,O){if(T)return E(T);try{var D=O.objectStore(m._dbInfo.storeName);R===null&&(R=void 0);var B=D.put(R,s);O.oncomplete=function(){R===void 0&&(R=null),h(R)},O.onabort=O.onerror=function(){var H=B.error?B.error:B.transaction.error;E(H)}}catch(H){E(H)}})}).catch(E)});return _(v,u),v}function wu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Me(u._dbInfo,S,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.delete(s);A.oncomplete=function(){v()},A.onerror=function(){h(T.error)},A.onabort=function(){var O=T.error?T.error:T.transaction.error;h(O)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function Iu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,S,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var T=R.error?R.error:R.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function Au(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.count();R.onsuccess=function(){m(R.result)},R.onerror=function(){v(R.error)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function Ru(s,d){var u=this,m=new g(function(v,h){if(s<0){v(null);return}u.ready().then(function(){Me(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=!1,O=R.openKeyCursor();O.onsuccess=function(){var D=O.result;if(!D){v(null);return}s===0||T?v(D.key):(T=!0,D.advance(s))},O.onerror=function(){h(O.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Su(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Me(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.openKeyCursor(),T=[];R.onsuccess=function(){var O=R.result;if(!O){m(T);return}T.push(O.key),O.continue()},R.onerror=function(){v(R.error)}}catch(O){v(O)}})}).catch(v)});return _(u,s),u}function Tu(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;if(!s.name)v=g.reject("Invalid arguments");else{var h=s.name===u.name&&m._dbInfo.db,E=h?g.resolve(m._dbInfo.db):Ue(s).then(function(A){var R=N[s.name],T=R.forages;R.db=A;for(var O=0;O<T.length;O++)T[O]._dbInfo.db=A;return A});s.storeName?v=E.then(function(A){if(A.objectStoreNames.contains(s.storeName)){var R=A.version+1;ee(s);var T=N[s.name],O=T.forages;A.close();for(var D=0;D<O.length;D++){var B=O[D];B._dbInfo.db=null,B._dbInfo.version=R}var H=new g(function(G,ne){var te=f.open(s.name,R);te.onerror=function(Re){var Ct=te.result;Ct.close(),ne(Re)},te.onupgradeneeded=function(){var Re=te.result;Re.deleteObjectStore(s.storeName)},te.onsuccess=function(){var Re=te.result;Re.close(),G(Re)}});return H.then(function(G){T.db=G;for(var ne=0;ne<O.length;ne++){var te=O[ne];te._dbInfo.db=G,z(te._dbInfo)}}).catch(function(G){throw(se(s,G)||g.resolve()).catch(function(){}),G})}}):v=E.then(function(A){ee(s);var R=N[s.name],T=R.forages;A.close();for(var O=0;O<T.length;O++){var D=T[O];D._dbInfo.db=null}var B=new g(function(H,G){var ne=f.deleteDatabase(s.name);ne.onerror=function(){var te=ne.result;te&&te.close(),G(ne.error)},ne.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},ne.onsuccess=function(){var te=ne.result;te&&te.close(),H(te)}});return B.then(function(H){R.db=H;for(var G=0;G<T.length;G++){var ne=T[G];z(ne._dbInfo)}}).catch(function(H){throw(se(s,H)||g.resolve()).catch(function(){}),H})})}return _(v,d),v}var xu={_driver:"asyncStorage",_initStorage:gu,_support:y(),iterate:bu,getItem:yu,setItem:Eu,removeItem:wu,clear:Iu,length:Au,key:Ru,keys:Su,dropInstance:Tu};function Cu(){return typeof openDatabase=="function"}var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ou="~~local_forage_type~",Ti=/^~~local_forage_type~([^~]+)~/,ir="__lfsc__:",Cn=ir.length,On="arbf",kn="blob",xi="si08",Ci="ui08",Oi="uic8",ki="si16",Pi="si32",Di="ur16",Ni="ui32",Li="fl32",Ui="fl64",Mi=Cn+On.length,Fi=Object.prototype.toString;function Bi(s){var d=s.length*.75,u=s.length,m,v=0,h,E,A,R;s[s.length-1]==="="&&(d--,s[s.length-2]==="="&&d--);var T=new ArrayBuffer(d),O=new Uint8Array(T);for(m=0;m<u;m+=4)h=Ge.indexOf(s[m]),E=Ge.indexOf(s[m+1]),A=Ge.indexOf(s[m+2]),R=Ge.indexOf(s[m+3]),O[v++]=h<<2|E>>4,O[v++]=(E&15)<<4|A>>2,O[v++]=(A&3)<<6|R&63;return T}function Pn(s){var d=new Uint8Array(s),u="",m;for(m=0;m<d.length;m+=3)u+=Ge[d[m]>>2],u+=Ge[(d[m]&3)<<4|d[m+1]>>4],u+=Ge[(d[m+1]&15)<<2|d[m+2]>>6],u+=Ge[d[m+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function ku(s,d){var u="";if(s&&(u=Fi.call(s)),s&&(u==="[object ArrayBuffer]"||s.buffer&&Fi.call(s.buffer)==="[object ArrayBuffer]")){var m,v=ir;s instanceof ArrayBuffer?(m=s,v+=On):(m=s.buffer,u==="[object Int8Array]"?v+=xi:u==="[object Uint8Array]"?v+=Ci:u==="[object Uint8ClampedArray]"?v+=Oi:u==="[object Int16Array]"?v+=ki:u==="[object Uint16Array]"?v+=Di:u==="[object Int32Array]"?v+=Pi:u==="[object Uint32Array]"?v+=Ni:u==="[object Float32Array]"?v+=Li:u==="[object Float64Array]"?v+=Ui:d(new Error("Failed to get type for BinaryArray"))),d(v+Pn(m))}else if(u==="[object Blob]"){var h=new FileReader;h.onload=function(){var E=Ou+s.type+"~"+Pn(this.result);d(ir+kn+E)},h.readAsArrayBuffer(s)}else try{d(JSON.stringify(s))}catch(E){console.error("Couldn't convert value into a JSON string: ",s),d(null,E)}}function Pu(s){if(s.substring(0,Cn)!==ir)return JSON.parse(s);var d=s.substring(Mi),u=s.substring(Cn,Mi),m;if(u===kn&&Ti.test(d)){var v=d.match(Ti);m=v[1],d=d.substring(v[0].length)}var h=Bi(d);switch(u){case On:return h;case kn:return p([h],{type:m});case xi:return new Int8Array(h);case Ci:return new Uint8Array(h);case Oi:return new Uint8ClampedArray(h);case ki:return new Int16Array(h);case Di:return new Uint16Array(h);case Pi:return new Int32Array(h);case Ni:return new Uint32Array(h);case Li:return new Float32Array(h);case Ui:return new Float64Array(h);default:throw new Error("Unkown type: "+u)}}var Dn={serialize:ku,deserialize:Pu,stringToBuffer:Bi,bufferToString:Pn};function ji(s,d,u,m){s.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function Du(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=typeof s[m]!="string"?s[m].toString():s[m];var v=new g(function(h,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(A){return E(A)}u.db.transaction(function(A){ji(A,u,function(){d._dbInfo=u,h()},function(R,T){E(T)})},E)});return u.serializer=Dn,v}function Ke(s,d,u,m,v,h){s.executeSql(u,m,v,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(R,T){T.rows.length?h(R,A):ji(R,d,function(){R.executeSql(u,m,v,h)},h)},h):h(E,A)},h)}function Nu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){Ke(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[s],function(R,T){var O=T.rows.length?T.rows.item(0).value:null;O&&(O=E.serializer.deserialize(O)),v(O)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Lu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){Ke(A,E,"SELECT * FROM "+E.storeName,[],function(R,T){for(var O=T.rows,D=O.length,B=0;B<D;B++){var H=O.item(B),G=H.value;if(G&&(G=E.serializer.deserialize(G)),G=s(G,H.key,B+1),G!==void 0){v(G);return}}v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Vi(s,d,u,m){var v=this;s=I(s);var h=new g(function(E,A){v.ready().then(function(){d===void 0&&(d=null);var R=d,T=v._dbInfo;T.serializer.serialize(d,function(O,D){D?A(D):T.db.transaction(function(B){Ke(B,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[s,O],function(){E(R)},function(H,G){A(G)})},function(B){if(B.code===B.QUOTA_ERR){if(m>0){E(Vi.apply(v,[s,R,u,m-1]));return}A(B)}})})}).catch(A)});return _(h,u),h}function Uu(s,d,u){return Vi.apply(this,[s,d,u,1])}function Mu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){Ke(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[s],function(){v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Fu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ke(E,h,"DELETE FROM "+h.storeName,[],function(){m()},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function Bu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ke(E,h,"SELECT COUNT(key) as c FROM "+h.storeName,[],function(A,R){var T=R.rows.item(0).c;m(T)},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function ju(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){Ke(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[s+1],function(R,T){var O=T.rows.length?T.rows.item(0).key:null;v(O)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Vu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){Ke(E,h,"SELECT key FROM "+h.storeName,[],function(A,R){for(var T=[],O=0;O<R.rows.length;O++)T.push(R.rows.item(O).key);m(T)},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function Ju(s){return new g(function(d,u){s.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,h){for(var E=[],A=0;A<h.rows.length;A++)E.push(h.rows.item(A).name);d({db:s,storeNames:E})},function(v,h){u(h)})},function(m){u(m)})})}function $u(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;return s.name?v=new g(function(h){var E;s.name===u.name?E=m._dbInfo.db:E=openDatabase(s.name,"","",0),s.storeName?h({db:E,storeNames:[s.storeName]}):h(Ju(E))}).then(function(h){return new g(function(E,A){h.db.transaction(function(R){function T(H){return new g(function(G,ne){R.executeSql("DROP TABLE IF EXISTS "+H,[],function(){G()},function(te,Re){ne(Re)})})}for(var O=[],D=0,B=h.storeNames.length;D<B;D++)O.push(T(h.storeNames[D]));g.all(O).then(function(){E()}).catch(function(H){A(H)})},function(R){A(R)})})}):v=g.reject("Invalid arguments"),_(v,d),v}var Hu={_driver:"webSQLStorage",_initStorage:Du,_support:Cu(),iterate:Lu,getItem:Nu,setItem:Uu,removeItem:Mu,clear:Fu,length:Bu,key:ju,keys:Vu,dropInstance:$u};function qu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(s){return!1}}function Ji(s,d){var u=s.name+"/";return s.storeName!==d.storeName&&(u+=s.storeName+"/"),u}function Gu(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch(d){return!0}}function Ku(){return!Gu()||localStorage.length>0}function Wu(s){var d=this,u={};if(s)for(var m in s)u[m]=s[m];return u.keyPrefix=Ji(s,d._defaultConfig),Ku()?(d._dbInfo=u,u.serializer=Dn,g.resolve()):g.reject()}function zu(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var h=localStorage.key(v);h.indexOf(m)===0&&localStorage.removeItem(h)}});return _(u,s),u}function Yu(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo,h=localStorage.getItem(v.keyPrefix+s);return h&&(h=v.serializer.deserialize(h)),h});return _(m,d),m}function Qu(s,d){var u=this,m=u.ready().then(function(){for(var v=u._dbInfo,h=v.keyPrefix,E=h.length,A=localStorage.length,R=1,T=0;T<A;T++){var O=localStorage.key(T);if(O.indexOf(h)===0){var D=localStorage.getItem(O);if(D&&(D=v.serializer.deserialize(D)),D=s(D,O.substring(E),R++),D!==void 0)return D}}});return _(m,d),m}function Xu(s,d){var u=this,m=u.ready().then(function(){var v=u._dbInfo,h;try{h=localStorage.key(s)}catch(E){h=null}return h&&(h=h.substring(v.keyPrefix.length)),h});return _(m,d),m}function Zu(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo,v=localStorage.length,h=[],E=0;E<v;E++){var A=localStorage.key(E);A.indexOf(m.keyPrefix)===0&&h.push(A.substring(m.keyPrefix.length))}return h});return _(u,s),u}function ec(s){var d=this,u=d.keys().then(function(m){return m.length});return _(u,s),u}function tc(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo;localStorage.removeItem(v.keyPrefix+s)});return _(m,d),m}function rc(s,d,u){var m=this;s=I(s);var v=m.ready().then(function(){d===void 0&&(d=null);var h=d;return new g(function(E,A){var R=m._dbInfo;R.serializer.serialize(d,function(T,O){if(O)A(O);else try{localStorage.setItem(R.keyPrefix+s,T),E(h)}catch(D){(D.name==="QuotaExceededError"||D.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(D),A(D)}})})});return _(v,u),v}function nc(s,d){if(d=C.apply(this,arguments),s=typeof s!="function"&&s||{},!s.name){var u=this.config();s.name=s.name||u.name,s.storeName=s.storeName||u.storeName}var m=this,v;return s.name?v=new g(function(h){s.storeName?h(Ji(s,m._defaultConfig)):h(s.name+"/")}).then(function(h){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(h)===0&&localStorage.removeItem(A)}}):v=g.reject("Invalid arguments"),_(v,d),v}var oc={_driver:"localStorageWrapper",_initStorage:Wu,_support:qu(),iterate:Qu,getItem:Yu,setItem:rc,removeItem:tc,clear:zu,length:ec,key:Xu,keys:Zu,dropInstance:nc},ic=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},ac=function(d,u){for(var m=d.length,v=0;v<m;){if(ic(d[v],u))return!0;v++}return!1},$i=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},xt={},Hi={},ut={INDEXEDDB:xu,WEBSQL:Hu,LOCALSTORAGE:oc},sc=[ut.INDEXEDDB._driver,ut.WEBSQL._driver,ut.LOCALSTORAGE._driver],ar=["dropInstance"],Nn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ar),lc={description:"",driver:sc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function uc(s,d){s[d]=function(){var u=arguments;return s.ready().then(function(){return s[d].apply(s,u)})}}function Ln(){for(var s=1;s<arguments.length;s++){var d=arguments[s];if(d)for(var u in d)d.hasOwnProperty(u)&&($i(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var cc=function(){function s(d){l(this,s);for(var u in ut)if(ut.hasOwnProperty(u)){var m=ut[u],v=m._driver;this[u]=v,xt[v]||this.defineDriver(m)}this._defaultConfig=Ln({},lc),this._config=Ln({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(u){if((typeof u=="undefined"?"undefined":a(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in u){if(m==="storeName"&&(u[m]=u[m].replace(/\W/g,"_")),m==="version"&&typeof u[m]!="number")return new Error("Database version must be a number.");this._config[m]=u[m]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},s.prototype.defineDriver=function(u,m,v){var h=new g(function(E,A){try{var R=u._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){A(T);return}for(var O=Nn.concat("_initStorage"),D=0,B=O.length;D<B;D++){var H=O[D],G=!ac(ar,H);if((G||u[H])&&typeof u[H]!="function"){A(T);return}}var ne=function(){for(var Ct=function(hc){return function(){var pc=new Error("Method "+hc+" is not implemented by the current driver"),qi=g.reject(pc);return _(qi,arguments[arguments.length-1]),qi}},Un=0,fc=ar.length;Un<fc;Un++){var Mn=ar[Un];u[Mn]||(u[Mn]=Ct(Mn))}};ne();var te=function(Ct){xt[R]&&console.info("Redefining LocalForage driver: "+R),xt[R]=u,Hi[R]=Ct,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(te,A):te(!!u._support):te(!0)}catch(Re){A(Re)}});return w(h,m,v),h},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(u,m,v){var h=xt[u]?g.resolve(xt[u]):g.reject(new Error("Driver not found."));return w(h,m,v),h},s.prototype.getSerializer=function(u){var m=g.resolve(Dn);return w(m,u),m},s.prototype.ready=function(u){var m=this,v=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(v,u,u),v},s.prototype.setDriver=function(u,m,v){var h=this;$i(u)||(u=[u]);var E=this._getSupportedDrivers(u);function A(){h._config.driver=h.driver()}function R(D){return h._extend(D),A(),h._ready=h._initStorage(h._config),h._ready}function T(D){return function(){var B=0;function H(){for(;B<D.length;){var G=D[B];return B++,h._dbInfo=null,h._ready=null,h.getDriver(G).then(R).catch(H)}A();var ne=new Error("No available storage method found.");return h._driverSet=g.reject(ne),h._driverSet}return H()}}var O=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=O.then(function(){var D=E[0];return h._dbInfo=null,h._ready=null,h.getDriver(D).then(function(B){h._driver=B._driver,A(),h._wrapLibraryMethodsWithReady(),h._initDriver=T(E)})}).catch(function(){A();var D=new Error("No available storage method found.");return h._driverSet=g.reject(D),h._driverSet}),w(this._driverSet,m,v),this._driverSet},s.prototype.supports=function(u){return!!Hi[u]},s.prototype._extend=function(u){Ln(this,u)},s.prototype._getSupportedDrivers=function(u){for(var m=[],v=0,h=u.length;v<h;v++){var E=u[v];this.supports(E)&&m.push(E)}return m},s.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=Nn.length;u<m;u++)uc(this,Nn[u])},s.prototype.createInstance=function(u){return new s(u)},s}(),dc=new cc;o.exports=dc},{3:3}]},{},[4])(4)})});var qa=sr(jr=>{"use strict";K();Ft();rt();var Ro=xe(),Dd=Ve("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>L(jr,null,function*(){let{levelId:t,duration:r,rating:n,score:o}=e;Te.info("onLevelFinished",r,n,o),yield Promise.all([tt.reporter({event:"COMPLETE_GAME_LEVEL"}),tt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:o})])})}),Nd=Ve("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>L(jr,null,function*(){let{duration:t,rating:r,score:n}=e;return Te.info("onGamePlayEnded",t,r,n),tt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Ld=Ve("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>L(jr,[r],function*({levelId:e,name:t}){return tt.tracker("LevelUpgrade",{name:t,levelId:e})})});Ro.registerCommand("TaskTrackerSDK.levelFinished",Dd);Ro.registerCommand("TaskTrackerSDK.gamePlayEnded",Nd);Ro.registerCommand("TaskTrackerSDK.levelUpgrade",Ld);me("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});me("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});me("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,ht,Ga,So,Ud,To,xo=j(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},ht=new Map,Ga=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=ht.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(o){console.warn("Callback execution failed:",o)}})}}catch(t){console.warn("Failed to parse message:",t)}},So=!1,Ud=()=>{So||(window.addEventListener("message",Ga),So=!0)},To=(e,t)=>{Ud(),ht.has(e)||ht.set(e,new Set);let r=ht.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&ht.delete(e),ht.size===0&&(window.removeEventListener("message",Ga),So=!1)}}});var vt,Vr,Jr,$r,Hr,Ka,mt,Md,ce,ot,it=j(()=>{"use strict";K();vt="UNLOCK_OPTIONS_CHANGED",Vr="INVOKE_PAYMENT",Jr="ON_PAYMENT_RESULT",$r="ON_USE_MODAL_EVENT",Hr="ON_USE_MODAL_RESULT",Ka="ON_USE_MODAL_FREQUENCY",mt=new Pe,Md=()=>({on:mt.on.bind(mt),off:mt.off.bind(mt),emit:mt.emit.bind(mt)}),ce=Md(),ot={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});function za(){let e=new Map,t,r;return{registerRewardHandler(o,i){e.set(o,i)},handleReward(o,...i){return L(this,null,function*(){return yield o.reduce((l,c)=>L(this,null,function*(){let f=yield l;if(f===!0)return!0;Wa&&console.log(`handleReward ${c}`);let y=e.get(c),p=y?yield y(...i):f;return Wa&&console.log(`handleReward ${c} ${p}`),p}),Promise.resolve(!1))})},registerRewardsFetcher(o){return L(this,null,function*(){t=(...i)=>L(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(o){return L(this,null,function*(){r=(...i)=>L(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:ot}}})})},getRewardsTypes(...o){return L(this,null,function*(){return t?yield t(...o):["ADS"]})},getRewardFrequencyConfig(...o){return L(this,null,function*(){return r?yield r(...o):{joliCoinUseAndCharge:ot}})}}}var Wa,Ya=j(()=>{"use strict";ge();it();Wa=P.testMode});var Fd,Bd,Qa,Xa,Za=j(()=>{"use strict";it();Fd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Bd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Fd()):["ADS"],Qa=e=>{e.registerRewardsFetcher(t=>L(void 0,null,function*(){var n,o,i,a;let r=["ADS"];try{let l=yield t.post("/api/games/unlock-options",{});if(l.code!=="SUCCESS")return r;ce.emit(vt,{options:((n=l.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((o=l.extra)==null?void 0:o.joliCoin)||{balance:0,enableAutoDeduct:!1}});let c=((a=(i=l.data)==null?void 0:i.unlockOptions)==null?void 0:a.map(f=>f.type))||Array.from(r);return Bd(c)}catch(l){return console.error("getRewardOptions error:",l),r}}))},Xa=e=>{e.registerRewardFrequencyConfigFetcher(t=>L(void 0,null,function*(){var n,o;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return r.code!=="SUCCESS"?{joliCoinUseAndCharge:ot}:(ce.emit(Ka,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||ot}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||ot})}))}});var es,ts=j(()=>{"use strict";es=e=>t=>L(void 0,null,function*(){return e.adBreak(t),!0})});function at(e,t){let r=null,n=null,o=null,i=()=>{if(o){r=Promise.resolve(o);return}r=new Promise(a=>{n=a})};return i(),e.on(t,(...a)=>{let l=a[0];o=l,n&&(n(l),n=null)}),{getData:()=>(r||i(),r),getCachedData:()=>o,clearCache:()=>{o=null,r=null},getFreshData:()=>(o=null,r=null,i(),r)}}var qr=j(()=>{"use strict"});var rs,ns=j(()=>{"use strict";rs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var o;return n.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)}))});var Gr,Kr,os,Wr,zr=j(()=>{"use strict";ge();K();it();ns();qr();Gr=(e,t)=>r=>L(void 0,null,function*(){let n=at(ce,Jr);return ce.emit(Vr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Kr=(e,t)=>r=>L(void 0,null,function*(){let n=at(ce,Hr);return ce.emit($r,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),os=e=>{if(e=="CANCEL")throw new Error("CANCEL")},Wr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i}})=>a=>L(void 0,null,function*(){var l,c,f,y,p,g,_;try{let w=!1,I=yield n.getData(),C=(f=(c=(l=I==null?void 0:I.options)==null?void 0:l.find(N=>N.type==="JOLI_COIN"))==null?void 0:c.joliCoinChoices[0].joliCoinQuantity)!=null?f:0;if(!rs((I==null?void 0:I.options)||[],I==null?void 0:I.userJoliCoin)){let N=yield o({userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(os(N),N!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=I==null?void 0:I.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w){let N=yield i({enableAutoDeduct:b,userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(os(N),N!=="CONFIRM")return r==null||r(a),!1}let k=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${dt()}-${P.mpType}-${Date.now()}`,gameInfo:{gameId:P.mpId}}});return k.code=="SUCCESS"?((g=a.adBreakDone)==null||g.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:k.data.quantity,balance:k.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}finally{n.clearCache()}})});var is,as=j(()=>{"use strict";it();qr();zr();zr();is=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(ce,vt),o=()=>{r==null||r()},i=Kr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Gr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return Wr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var ss,ls=j(()=>{"use strict";it();zr();qr();ss=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(ce,vt),o=c=>{var f;r==null||r(),(f=c.adBreakDone)==null||f.call(c,{breakType:c.type,breakFormat:c.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Kr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Gr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return Wr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var ze,us=j(()=>{"use strict";Ya();Za();ts();as();ls();ze=za();Qa(ze);Xa(ze)});function Je(e,t){for(var r in t)e[r]=t[r];return e}function Do(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Jt(e,t,r){var n,o,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Zr.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Qr(e,a,n,o,null)}function Qr(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++ps:o,__i:-1,__u:0};return o==null&&M.vnode!=null&&M.vnode(i),i}function Ye(e){return e.children}function we(e,t){this.props=e,this.context=t}function _t(e,t){if(t==null)return e.__?_t(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?_t(e):null}function ys(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ys(e)}}function ds(e){(!e.__d&&(e.__d=!0)&&st.push(e)&&!Xr.__r++||cs!==M.debounceRendering)&&((cs=M.debounceRendering)||ms)(Xr)}function Xr(){for(var e,t,r,n,o,i,a,l=1;st.length;)st.length>l&&st.sort(vs),e=st.shift(),l=st.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,i=[],a=[],t.__P&&((r=Je({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),No(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,i,o==null?_t(n):o,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,ws(i,r,a),r.__e!=o&&ys(r)));Xr.__r=0}function bs(e,t,r,n,o,i,a,l,c,f,y){var p,g,_,w,I,C,b=n&&n.__k||gs,k=t.length;for(c=Jd(r,t,b,c,k),p=0;p<k;p++)(_=r.__k[p])!=null&&(g=_.__i===-1?jt:b[_.__i]||jt,_.__i=p,C=No(e,_,g,o,i,a,l,c,f,y),w=_.__e,_.ref&&g.ref!=_.ref&&(g.ref&&Lo(g.ref,null,_),y.push(_.ref,_.__c||w,_)),I==null&&w!=null&&(I=w),4&_.__u||g.__k===_.__k?c=Es(_,c,e):typeof _.type=="function"&&C!==void 0?c=C:w&&(c=w.nextSibling),_.__u&=-7);return r.__e=I,c}function Jd(e,t,r,n,o){var i,a,l,c,f,y=r.length,p=y,g=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=i+g,(a=e.__k[i]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Qr(null,a,null,null,null):Vt(a)?Qr(Ye,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Qr(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(f=a.__i=$d(a,r,c,p))!==-1&&(p--,(l=r[f])&&(l.__u|=2)),l==null||l.__v===null?(f==-1&&(o>y?g--:o<y&&g++),typeof a.type!="function"&&(a.__u|=4)):f!=c&&(f==c-1?g--:f==c+1?g++:(f>c?g--:g++,a.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<y;i++)(l=r[i])!=null&&!(2&l.__u)&&(l.__e==n&&(n=_t(l)),As(l,l));return n}function Es(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=Es(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=_t(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function $t(e,t){return t=t||[],e==null||typeof e=="boolean"||(Vt(e)?e.some(function(r){$t(r,t)}):t.push(e)),t}function $d(e,t,r,n){var o,i,a=e.key,l=e.type,c=t[r];if(c===null&&e.key==null||c&&a==c.key&&l===c.type&&!(2&c.__u))return r;if(n>(c!=null&&!(2&c.__u)?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&a==c.key&&l===c.type)return o;o--}if(i<t.length){if((c=t[i])&&!(2&c.__u)&&a==c.key&&l===c.type)return i;i++}}return-1}function fs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Vd.test(t)?r:r+"px"}function Yr(e,t,r,n,o){var i;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||fs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||fs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(_s,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.t=n.t:(r.t=Po,e.addEventListener(t,i?Oo:Co,i)):e.removeEventListener(t,i?Oo:Co,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function hs(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Po++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function No(e,t,r,n,o,i,a,l,c,f){var y,p,g,_,w,I,C,b,k,N,q,Q,S,x,U,V,ee,z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[l=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof z=="function")try{if(b=t.props,k="prototype"in z&&z.prototype.render,N=(y=z.contextType)&&n[y.__c],q=y?N?N.props.value:y.__:n,r.__c?C=(p=t.__c=r.__c).__=p.__E:(k?t.__c=p=new z(b,q):(t.__c=p=new we(b,q),p.constructor=z,p.render=qd),N&&N.sub(p),p.props=b,p.state||(p.state={}),p.context=q,p.__n=n,g=p.__d=!0,p.__h=[],p._sb=[]),k&&p.__s==null&&(p.__s=p.state),k&&z.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Je({},p.__s)),Je(p.__s,z.getDerivedStateFromProps(b,p.__s))),_=p.props,w=p.state,p.__v=t,g)k&&z.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),k&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(k&&z.getDerivedStateFromProps==null&&b!==_&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,q),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,q)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(se){se&&(se.__=t)}),Q=0;Q<p._sb.length;Q++)p.__h.push(p._sb[Q]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,q),k&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(_,w,I)})}if(p.context=q,p.props=b,p.__P=e,p.__e=!1,S=M.__r,x=0,k){for(p.state=p.__s,p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),U=0;U<p._sb.length;U++)p.__h.push(p._sb[U]);p._sb=[]}else do p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=Je(Je({},n),p.getChildContext())),k&&!g&&p.getSnapshotBeforeUpdate!=null&&(I=p.getSnapshotBeforeUpdate(_,w)),V=y,y!=null&&y.type===Ye&&y.key==null&&(V=Is(y.props.children)),l=bs(e,Vt(V)?V:[V],t,r,n,o,i,a,l,c,f),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),C&&(p.__E=p.__=null)}catch(se){if(t.__v=null,c||i!=null)if(se.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else for(ee=i.length;ee--;)Do(i[ee]);else t.__e=r.__e,t.__k=r.__k;M.__e(se,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Hd(r.__e,t,r,n,o,i,a,c,f);return(y=M.diffed)&&y(t),128&t.__u?void 0:l}function ws(e,t,r){for(var n=0;n<r.length;n++)Lo(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){M.__e(i,o.__v)}})}function Is(e){return typeof e!="object"||e==null?e:Vt(e)?e.map(Is):Je({},e)}function Hd(e,t,r,n,o,i,a,l,c){var f,y,p,g,_,w,I,C=r.props,b=t.props,k=t.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((_=i[f])&&"setAttribute"in _==!!k&&(k?_.localName==k:_.nodeType==3)){e=_,i[f]=null;break}}if(e==null){if(k==null)return document.createTextNode(b);e=document.createElementNS(o,k,b.is&&b),l&&(M.__m&&M.__m(t,i),l=!1),i=null}if(k===null)C===b||l&&e.data===b||(e.data=b);else{if(i=i&&Zr.call(e.childNodes),C=r.props||jt,!l&&i!=null)for(C={},f=0;f<e.attributes.length;f++)C[(_=e.attributes[f]).name]=_.value;for(f in C)if(_=C[f],f!="children"){if(f=="dangerouslySetInnerHTML")p=_;else if(!(f in b)){if(f=="value"&&"defaultValue"in b||f=="checked"&&"defaultChecked"in b)continue;Yr(e,f,null,_,o)}}for(f in b)_=b[f],f=="children"?g=_:f=="dangerouslySetInnerHTML"?y=_:f=="value"?w=_:f=="checked"?I=_:l&&typeof _!="function"||C[f]===_||Yr(e,f,_,C[f],o);if(y)l||p&&(y.__html===p.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(p&&(e.innerHTML=""),bs(t.type==="template"?e.content:e,Vt(g)?g:[g],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:r.__k&&_t(r,0),l,c),i!=null)for(f=i.length;f--;)Do(i[f]);l||(f="value",k=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[f]||k=="progress"&&!w||k=="option"&&w!==C[f])&&Yr(e,f,w,C[f],o),f="checked",I!==void 0&&I!==e[f]&&Yr(e,f,I,C[f],o))}return e}function Lo(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){M.__e(o,r)}}function As(e,t,r){var n,o;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Lo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){M.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&As(n[o],t,r||typeof e.type!="function");r||Do(e.__e),e.__c=e.__=e.__e=void 0}function qd(e,t,r){return this.constructor(e,r)}function Rs(e,t,r){var n,o,i,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],No(t,e=(!n&&r||t).__k=Jt(Ye,null,[e]),o||jt,jt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?Zr.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),ws(i,e,a)}var Zr,M,ps,ko,st,cs,ms,vs,_s,Po,Co,Oo,jd,jt,gs,Vd,Vt,Ht=j(()=>{jt={},gs=[],Vd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vt=Array.isArray;Zr=gs.slice,M={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(l){e=l}throw e}},ps=0,ko=function(e){return e!=null&&e.constructor==null},we.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},r),this.props)),e&&Je(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ds(this))},we.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ds(this))},we.prototype.render=Ye,st=[],ms=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vs=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,_s=/(PointerCapture)$|Capture$/i,Po=0,Co=hs(!1),Oo=hs(!0),jd=0});function Bo(e,t){re.__h&&re.__h(_e,e,Mo||t),Mo=0;var r=_e.__H||(_e.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function jo(e,t){var r=Bo(qt++,3);!re.__s&&$o(r.__H,t)&&(r.__=e,r.u=t,_e.__H.__h.push(r))}function Vo(e,t){var r=Bo(qt++,4);!re.__s&&$o(r.__H,t)&&(r.__=e,r.u=t,_e.__h.push(r))}function Jo(e){return Mo=5,tn(function(){return{current:e}},[])}function tn(e,t){var r=Bo(qt++,7);return $o(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Gd(){for(var e;e=Ns.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(Fo),e.__H.__h=[]}catch(t){e.__H.__h=[],re.__e(t,e.__v)}}function Kd(e){var t,r=function(){clearTimeout(n),Ds&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ds&&(t=requestAnimationFrame(r))}function en(e){var t=_e,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),_e=t}function Fo(e){var t=_e;e.__c=e.__(),_e=t}function $o(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var qt,_e,Uo,Ss,Mo,Ns,re,Ts,xs,Cs,Os,ks,Ps,Ds,Ho=j(()=>{Ht();Mo=0,Ns=[],re=M,Ts=re.__b,xs=re.__r,Cs=re.diffed,Os=re.__c,ks=re.unmount,Ps=re.__;re.__b=function(e){_e=null,Ts&&Ts(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ps&&Ps(e,t)},re.__r=function(e){xs&&xs(e),qt=0;var t=(_e=e.__c).__H;t&&(Uo===_e?(t.__h=[],_e.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(Fo),t.__h=[],qt=0)),Uo=_e},re.diffed=function(e){Cs&&Cs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ns.push(t)!==1&&Ss===re.requestAnimationFrame||((Ss=re.requestAnimationFrame)||Kd)(Gd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Uo=_e=null},re.__c=function(e,t){t.some(function(r){try{r.__h.forEach(en),r.__h=r.__h.filter(function(n){return!n.__||Fo(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],re.__e(n,r.__v)}}),Os&&Os(e,t)},re.unmount=function(e){ks&&ks(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{en(n)}catch(o){t=o}}),r.__H=void 0,t&&re.__e(t,r.__v))};Ds=typeof requestAnimationFrame=="function"});function zd(e,t){for(var r in t)e[r]=t[r];return e}function Ls(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Us(e,t){this.props=e,this.context=t}function qs(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=zd({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return qs(n,t,r)})),e}function Gs(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Gs(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function qo(){this.__u=0,this.o=null,this.__b=null}function Ks(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function rn(){this.i=null,this.l=null}function Ws(e,t,r){return t.__k==null&&(t.textContent=""),Rs(e,t),typeof r=="function"&&r(),e?e.__c:null}function nf(){}function of(){return this.cancelBubble}function af(){return this.defaultPrevented}var Ms,og,Yd,Fs,Bs,Qd,Xd,Zd,ef,tf,rf,js,zs,sf,Vs,Js,$s,Ys=j(()=>{Ht();Ht();Ho();Ho();(Us.prototype=new we).isPureReactComponent=!0,Us.prototype.shouldComponentUpdate=function(e,t){return Ls(this.props,e)||Ls(this.state,t)};Ms=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ms&&Ms(e)};og=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Yd=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Yd(e,t,r,n)};Fs=M.unmount;M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fs&&Fs(e)},(qo.prototype=new we).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=Ks(n.__v),i=!1,a=function(){i||(i=!0,r.__R=null,o?o(l):l())};r.__R=a;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Gs(c,c.__c.__P,c.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},qo.prototype.componentWillUnmount=function(){this.o=[]},qo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=qs(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&Jt(Ye,null,e.fallback);return o&&(o.__u&=-33),[Jt(Ye,null,t.__a?null:e.children),o]};Bs=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(rn.prototype=new we).__a=function(e){var t=this,r=Ks(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Bs(t,e,n)):o()};r?r(i):i()}},rn.prototype.render=function(e){this.i=null,this.l=new Map;var t=$t(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},rn.prototype.componentDidUpdate=rn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Bs(e,r,t)})};Qd=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Xd=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ef=/[A-Z0-9]/g,tf=typeof document!="undefined",rf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};we.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(we.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});js=M.event;M.event=function(e){return js&&(e=js(e)),e.persist=nf,e.isPropagationStopped=of,e.isDefaultPrevented=af,e.nativeEvent=e};sf={enumerable:!1,configurable:!0,get:function(){return this.class}},Vs=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")===-1;for(var a in r){var l=r[a];if(!(a==="value"&&"defaultValue"in r&&l==null||tf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var c=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?a="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||rf(r.type)?c==="onfocus"?a="onfocusin":c==="onblur"?a="onfocusout":Zd.test(a)&&(a=c):c=a="oninput":i&&Xd.test(a)?a=a.replace(ef,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[a=c]&&(a="oninputCapture"),o[a]=l}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=$t(r.children).forEach(function(f){f.props.selected=o.value.indexOf(f.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=$t(r.children).forEach(function(f){f.props.selected=o.multiple?o.defaultValue.indexOf(f.props.value)!=-1:o.defaultValue==f.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",sf)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Qd,Vs&&Vs(e)};Js=M.__r;M.__r=function(e){Js&&Js(e),zs=e.__c};$s=M.diffed;M.diffed=function(e){$s&&$s(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),zs=null}});function Ce(e,t,r){return(t=df(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function df(e){var t=ff(e,"string");return typeof t=="symbol"?t:t+""}function ff(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nn(e,t,r){return(t=hf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hf(e){var t=pf(e,"string");return typeof t=="symbol"?t:t+""}function pf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function If(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Af(e){return typeof e=="string"}function Rf(e){return typeof e=="undefined"}function Sf(e){return Rf(e)||e===null}function Tf(e){return typeof e=="function"}function El(e){let t=e,r=null,n=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Gt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function sn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Df(e){let t=e.location?sn(e.location,tl):null,r=e.target?sn(e.target,tl):null;return sn(bf(yf({},e),{location:t,target:r}),kf)}function Nf(e){let t=e.events.map(n=>Df(n)),r=sn(e.device,Pf);return[e.protocolVersion,t,r,e.project]}function Lf(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function jf(e){return new Promise(t=>Rl(e)(t))}function Rl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Vf(e,t){return(r=>{let n={onWillAddFirstListener(){r(o.fire,o)}},o=new Qt(n);return o.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(o=>t(o)&&r.call(n,o),null)})}function $f(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Hf(e[n],t[n])}function Hf(e,t){if(Af(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Tf(t)){try{if(e instanceof t)return}catch(r){}if(!Sf(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Ko(e,t,r){return(t=qf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qf(e){var t=Gf(e,"string");return typeof t=="symbol"?t:t+""}function Gf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function on(e,t,r){return(t=Kf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kf(e){var t=Wf(e,"string");return typeof t=="symbol"?t:t+""}function Wf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $e(e,t,r){return(t=zf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zf(e){var t=Yf(e,"string");return typeof t=="symbol"?t:t+""}function Yf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qf(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Xf(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}function oh(e,t){return fe(e,0)^45?(((t<<2^fe(e,0))<<2^fe(e,1))<<2^fe(e,2))<<2^fe(e,3):0}function xl(e){return e.trim()}function ih(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function si(e,t){return e.indexOf(t)}function fe(e,t){return e.charCodeAt(t)|0}function Xt(e,t,r){return e.slice(t,r)}function Ne(e){return e.length}function _i(e){return e.length}function an(e,t){return t.push(e),e}function ah(e,t){return e.map(t).join("")}function En(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:bn,column:yt,length:a,return:""}}function Wt(e,t){return nh(En("",null,null,"",null,null,0),e,{length:-e.length},t)}function sh(){return ae}function lh(){return ae=Ee>0?fe(bt,--Ee):0,yt--,ae===10&&(yt=1,bn--),ae}function Ie(){return ae=Ee<Cl?fe(bt,Ee++):0,yt++,ae===10&&(yt=1,bn++),ae}function Le(){return fe(bt,Ee)}function ln(){return Ee}function er(e,t){return Xt(bt,e,t)}function Zt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ol(e){return bn=yt=1,Cl=Ne(bt=e),Ee=0,[]}function kl(e){return bt="",e}function un(e){return xl(er(Ee-1,li(e===91?e+2:e===40?e+1:e)))}function uh(e){for(;(ae=Le())&&ae<33;)Ie();return Zt(e)>2||Zt(ae)>3?"":" "}function ch(e,t){for(;--t&&Ie()&&!(ae<48||ae>102||ae>57&&ae<65||ae>70&&ae<97););return er(e,ln()+(t<6&&Le()==32&&Ie()==32))}function li(e){for(;Ie();)switch(ae){case e:return Ee;case 34:case 39:e!==34&&e!==39&&li(ae);break;case 40:e===41&&li(e);break;case 92:Ie();break}return Ee}function dh(e,t){for(;Ie()&&e+ae!==57&&!(e+ae===84&&Le()===47););return"/*"+er(t,Ee-1)+"*"+yn(e===47?e:Ie())}function fh(e){for(;!Zt(Le());)Ie();return er(e,Ee)}function hh(e){return kl(cn("",null,null,null,[""],e=Ol(e),0,[0],e))}function cn(e,t,r,n,o,i,a,l,c){for(var f=0,y=0,p=a,g=0,_=0,w=0,I=1,C=1,b=1,k=0,N="",q=o,Q=i,S=n,x=N;C;)switch(w=k,k=Ie()){case 40:if(w!=108&&fe(x,p-1)==58){si(x+=$(un(k),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=un(k);break;case 9:case 10:case 13:case 32:x+=uh(w);break;case 92:x+=ch(ln()-1,7);continue;case 47:switch(Le()){case 42:case 47:an(ph(dh(Ie(),ln()),t,r),c);break;default:x+="/"}break;case 123*I:l[f++]=Ne(x)*b;case 125*I:case 59:case 0:switch(k){case 0:case 125:C=0;case 59+y:b==-1&&(x=$(x,/\f/g,"")),_>0&&Ne(x)-p&&an(_>32?ol(x+";",n,r,p-1):ol($(x," ","")+";",n,r,p-2),c);break;case 59:x+=";";default:if(an(S=nl(x,t,r,f,y,o,l,N,q=[],Q=[],p),i),k===123)if(y===0)cn(x,t,S,S,q,i,p,l,Q);else switch(g===99&&fe(x,3)===110?100:g){case 100:case 108:case 109:case 115:cn(e,S,S,n&&an(nl(e,S,S,0,0,o,l,N,o,q=[],p),Q),o,Q,p,l,n?q:Q);break;default:cn(x,S,S,S,[""],Q,0,l,Q)}}f=y=_=0,I=b=1,N=x="",p=a;break;case 58:p=1+Ne(x),_=w;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&lh()==125)continue}switch(x+=yn(k),k*I){case 38:b=y>0?1:(x+="\f",-1);break;case 44:l[f++]=(Ne(x)-1)*b,b=1;break;case 64:Le()===45&&(x+=un(Ie())),g=Le(),y=p=Ne(N=x+=fh(ln())),k++;break;case 45:w===45&&Ne(x)==2&&(I=0)}}return i}function nl(e,t,r,n,o,i,a,l,c,f,y){for(var p=o-1,g=o===0?i:[""],_=_i(g),w=0,I=0,C=0;w<n;++w)for(var b=0,k=Xt(e,p+1,p=rh(I=a[w])),N=e;b<_;++b)(N=xl(I>0?g[b]+" "+k:$(k,/&\f/g,g[b])))&&(c[C++]=N);return En(e,t,r,o===0?mi:l,c,f,y)}function ph(e,t,r){return En(e,t,r,Sl,yn(sh()),Xt(e,2,-2),0)}function ol(e,t,r,n){return En(e,t,r,vi,Xt(e,0,n),Xt(e,n+1,-1),n)}function gt(e,t){for(var r="",n=_i(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function mh(e,t,r,n){switch(e.type){case th:if(e.children.length)break;case eh:case vi:return e.return=e.return||e.value;case Sl:return"";case Tl:return e.return=e.value+"{"+gt(e.children,n)+"}";case mi:e.value=e.props.join(",")}return Ne(r=gt(e.children,n))?e.return=e.value+"{"+r+"}":""}function vh(e){var t=_i(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function _h(e){return function(t){t.root||(t=t.return)&&e(t)}}function gh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function Pl(e,t){switch(oh(e,t)){case 5103:return J+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return J+e+hn+e+ve+e+e;case 6828:case 4268:return J+e+ve+e+e;case 6165:return J+e+ve+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+ve+"flex-$1$2")+e;case 5443:return J+e+ve+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+ve+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+ve+$(e,"shrink","negative")+e;case 5292:return J+e+ve+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+ve+$(e,"grow","positive")+e;case 4554:return J+$(e,/([^-])(transform)/g,"$1"+J+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+ve+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,J+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ne(e)-1-t>6)switch(fe(e,t+1)){case 109:if(fe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+hn+(fe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~si(e,"stretch")?Pl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(fe(e,t+1)!==115)break;case 6444:switch(fe(e,Ne(e)-3-(~si(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(fe(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+ve+"$2box$3")+e}break;case 5936:switch(fe(e,t+11)){case 114:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+ve+e+e}return e}function Th(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function pn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return Xe={name:o.name,styles:o.styles,next:Xe},o.name;var i=r;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)Xe={name:a.name,styles:a.styles,next:Xe},a=a.next;var l=i.styles+";";return l}return kh(e,t,r)}}var c=r;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function kh(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=pn(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object"){var l=a;t!=null&&t[l]!==void 0?n+=i+"{"+t[l]+"}":al(l)&&(n+=Wo(i)+":"+sl(i,l)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var c=0;c<a.length;c++)al(a[c])&&(n+=Wo(i)+":"+sl(i,a[c])+";");else{var f=pn(e,t,a);switch(i){case"animation":case"animationName":{n+=Wo(i)+":"+f+";";break}default:n+=i+"{"+f+"}"}}}return n}function zo(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";Xe=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=pn(r,t,i);else{var a=i;o+=a[0]}for(var l=1;l<e.length;l++)if(o+=pn(r,t,e[l]),n){var c=i;o+=c[l]}ll.lastIndex=0;for(var f="",y;(y=ll.exec(o))!==null;)f+="-"+y[1];var p=Th(o)+f;return{name:p,styles:o,next:Xe}}function Nl(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}function ul(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function cl(e,t,r){var n=[],o=Nl(e,n,r);return n.length<2?r:o+t(n)}function Ul(e,t){ie.__h&&ie.__h(be,e,ui||t),ui=0;var r=be.__H||(be.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Mh(e,t){var r=Ul(mn++,3);!ie.__s&&Ml(r.__H,t)&&(r.__=e,r.u=t,be.__H.__h.push(r))}function Fh(e){return ui=5,gi(function(){return{current:e}},[])}function gi(e,t){var r=Ul(mn++,7);return Ml(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Bh(){for(var e;e=Ll.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(dn),e.__H.__h.forEach(ci),e.__H.__h=[]}catch(t){e.__H.__h=[],ie.__e(t,e.__v)}}function jh(e){var t,r=function(){clearTimeout(n),gl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);gl&&(t=requestAnimationFrame(r))}function dn(e){var t=be,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),be=t}function ci(e){var t=be;e.__c=e.__(),be=t}function Ml(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function wn(){if(Ze>1)Ze--;else{for(var e,t=!1;zt!==void 0;){var r=zt;for(zt=void 0,di++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Bl(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(di=0,Ze--,t)throw e}}function Oe(e){if(Ze>0)return e();Ze++;try{return e()}finally{wn()}}function Fl(e){if(W!==void 0){var t=e.n;if(t===void 0||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},W.s!==void 0&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function he(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function de(e){return new he(e)}function Bl(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jl(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Vl(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Et(e){he.call(this,void 0),this.x=e,this.s=void 0,this.g=vn-1,this.f=4}function Yt(e){return new Et(e)}function Jl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Ze++;var r=W;W=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,yi(e),n}finally{W=r,wn()}}}function yi(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Jl(e)}function Jh(e){if(W!==this)throw new Error("Out-of-order effect");Vl(this),W=e,this.f&=-2,8&this.f&&yi(this),wn()}function rr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function wt(e){var t=new rr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function It(e,t){M[e]=t.bind(null,M[e]||function(){})}function _n(e){Qo&&Qo(),Qo=e&&e.S()}function ql(e){var t=this,r=e.data,n=Gl(r);n.value=r;var o=gi(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var f=Yt(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=Yt(function(){return!Array.isArray(f.value)&&!ko(f.value)}),p=wt(function(){if(this.N=Kl,y.value){var _=f.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=_)}}),g=t.__$u.d;return t.__$u.d=function(){p(),g.call(this)},[y,f]},[]),i=o[0],a=o[1];return i.value?a.peek():a.value}function $h(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=de(r);return{o:function(a,l){i.value=a,n=l},d:wt(function(){this.N=Kl;var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function Gl(e){return gi(function(){return de(e)},[])}function Gh(){Oe(function(){for(var e;e=$l.shift();)bi.call(e)})}function Kh(){$l.push(this)===1&&(M.requestAnimationFrame||Hh)(Gh)}function Wh(){Oe(function(){for(var e;e=Hl.shift();)bi.call(e)})}function Kl(){Hl.push(this)===1&&(M.requestAnimationFrame||qh)(Wh)}function zh(e){var t=Fh(e);t.current=e,Mh(function(){return wt(function(){return this.N=Kh,t.current()})},[])}function Yh(e,t){let r=Jo(e);Vo(()=>{r.current=e},[e]),jo(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function ue(e,t,r,n,o,i){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?a=t[l]:c[l]=t[l];var f={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Qh,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)c[l]===void 0&&(c[l]=a[l]);return M.vnode&&M.vnode(f),f}function He(e,t,r){return(t=up(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function up(e){var t=cp(e,"string");return typeof t=="symbol"?t:t+""}function cp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qe(e,t,r){return(t=dp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dp(e){var t=fp(e,"string");return typeof t=="symbol"?t:t+""}function fp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qs,lf,uf,cf,Xo,Zo,yl,mf,vf,Xs,_f,gf,Zs,yf,bf,Ef,bl,wf,xf,Cf,el,Of,wl,Il,Al,tl,kf,Pf,ei,Z,Uf,Mf,Kt,Qt,Ff,ri,Bf,Go,Jf,ni,rl,oi,ii,ai,Zf,ve,hn,J,Sl,mi,vi,eh,Tl,th,rh,yn,nh,bn,yt,Cl,Ee,ae,bt,yh,bh,Eh,il,wh,Ih,Ah,Rh,Sh,xh,Ch,Oh,Dl,al,Wo,sl,ll,Xe,Ph,Dh,Nh,Lh,Uh,tr,mn,be,Yo,dl,ui,Ll,ie,fl,hl,pl,ml,vl,_l,gl,Vh,W,zt,Ze,di,vn,bi,Qo,$l,Hl,Hh,qh,ye,Qh,Xh,qe,fi,hi,fn,Zh,ep,tp,rp,np,op,ip,ap,sp,lp,pi,gn,cg,Wl=j(()=>{"use strict";Ht();Ys();Qs=Object.getOwnPropertySymbols,lf=Object.prototype.hasOwnProperty,uf=Object.prototype.propertyIsEnumerable,cf=(e,t)=>{var r={};for(var n in e)lf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qs)for(var n of Qs(e))t.indexOf(n)<0&&uf.call(e,n)&&(r[n]=e[n]);return r};Xo=class{constructor(t){Ce(this,"context",void 0),Ce(this,"continueCallback",void 0),Ce(this,"isBeforeAdCalled",!1),Ce(this,"isBeforeRewardCalled",!1),Ce(this,"isAdDismissedCalled",!1),Ce(this,"isAdViewedCalled",!1),Ce(this,"isAfterAdCalled",!1),Ce(this,"currentProvider",void 0),Ce(this,"currentClientParams",void 0),Ce(this,"adsHasResponse",!1),Ce(this,"videoChecker",window.document.createElement("video")),Ce(this,"wrapShowAdFn",r=>()=>{this.adsHasResponse=!0;let n=!1;this.videoChecker.play().catch(()=>{n=!1}),n=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:n},this.paramsToTrack)),r()}),this.context=t}get paramsToTrack(){var t,r,n,o,i,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((o=this.currentClientParams)==null?void 0:o.type)==="preroll"?null:(a=(i=this.currentClientParams)==null?void 0:i.name)!=null?a:""}}wrapBeforeAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t())}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,o,i,a,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(o=(n=this.currentProvider)==null?void 0:n.name)!=null?o:null,breakType:r.breakType,breakName:(i=r.breakName)!=null?i:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.continueCallback)==null||a.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n){return L(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o;let i;switch(r.type){case"preroll":{i={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var a,l,c,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(a=this.currentProvider)==null?void 0:a.name)!=null?l:null}),(f=this.continueCallback)==null||f.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(c=r.name)!=null?c:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(i,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Zo=class{constructor(t){nn(this,"context",void 0),nn(this,"adBreakIsShowing",!1),nn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),nn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}},yl=Object.defineProperty,mf=Object.defineProperties,vf=Object.getOwnPropertyDescriptors,Xs=Object.getOwnPropertySymbols,_f=Object.prototype.hasOwnProperty,gf=Object.prototype.propertyIsEnumerable,Zs=(e,t,r)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yf=(e,t)=>{for(var r in t||(t={}))_f.call(t,r)&&Zs(e,r,t[r]);if(Xs)for(var r of Xs(t))gf.call(t,r)&&Zs(e,r,t[r]);return e},bf=(e,t)=>mf(e,vf(t)),Ef=(e,t)=>{for(var r in t)yl(e,r,{get:t[r],enumerable:!0})},bl=(e,t,r,n)=>{for(var o=t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=a(o)||o);return o},wf=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}xf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(xf||{});Cf={log:Gt("log"),warn:Gt("warn"),info:Gt("info"),error:Gt("error"),debug:Gt("debug")};Object.assign(globalThis,{logger:Cf});el=Symbol.for("Jolibox.canIUseMap"),Of={};globalThis[el]||(globalThis[el]=Of);wl=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(wl||{}),Il=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Il||{}),Al=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Al||{}),tl=["name","params"],kf=["name","type","location","target","extra","timestamp","userId"],Pf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Lf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");ei=class ti{constructor(t){this.element=t,this.next=ti.Undefined,this.prev=ti.Undefined}};ei.Undefined=new ei(void 0);Z=ei,Uf=class{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let e=this._first;for(;e!==Z.Undefined;){let t=e.next;e.prev=Z.Undefined,e.next=Z.Undefined,e=t}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Z(e);if(this._first===Z.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Z.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Z.Undefined&&e.next!==Z.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Z.Undefined&&e.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):e.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):e.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Z.Undefined;)yield e.element,e=e.next}},Mf=0,Kt=class{constructor(e){this.value=e,this.id=Mf++}},Qt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Kt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,o,i,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let c=new Kt(e);return this._listeners?this._listeners instanceof Kt?this._listeners=[this._listeners,c]:this._listeners.push(c):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=c,(i=(o=this.options)==null?void 0:o.onDidFirstListener)==null||i.call(o,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++,()=>{var f,y,p,g;if(!this._disposed){if(this._listeners instanceof Kt)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(y=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||y.call(f));else if(this._listeners){let _=this._listeners.indexOf(c);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((g=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||g.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Kt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ff=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let o=(n=this.listeners.get(e))!=null?n:new Qt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];r||(r=new Uf,this.cachedEventQueue.set(e,r)),r.push({args:o}),t&&t.fire({event:e,args:o})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ri={};Ef(ri,{None:()=>Bf,filter:()=>Vf,once:()=>Rl,toPromise:()=>jf});Bf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Go=Symbol.for("Jolibox.hostEmitter"),Jf=()=>{let e=new Ff;return globalThis[Go]||(globalThis[Go]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Go]};Jf();ni=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Qt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return $f(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};ni=bl([El],ni);rl=class{constructor(){this._onWillExecuteCommand=new Qt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Qt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ni,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=If(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return wf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ri.toPromise(ri.filter(this.registry.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];this._onWillExecuteCommand.fire({commandId:e,args:n});let i=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),i}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};rl=bl([El],rl);oi=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Ko(this,"context",void 0),Ko(this,"placement","GAME"),Ko(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,o;return{platform:(t=this.contextInfo.platform)!=null?t:Al.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(o=this.contextInfo.deviceBrand)!=null?o:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let o={protocolVersion:"1.0.0",events:[{name:t,type:wl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Il.WebSDK};return Nf(o)}};ii=class{constructor(t){on(this,"configs",null),on(this,"firstRun",!0),on(this,"context",void 0),on(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return L(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let o=(t=this.contextInfo.channel)!=null?t:"",i=this.configs[o],a=(r=i==null?void 0:i.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};ai=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let o=n,{onReady:i}=o,a=cf(o,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>L(this,null,function*(){var o,i,a,l;if(this.context.track("CallAdUnit",{adFormat:(i=(o=n.adFormat)==null?void 0:o.toString())!=null?i:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:c,slot:f,adFormat:y,fullWidthResponsive:p,style:g}=n,_;if(!c)throw new Error("targeting element is required");if(typeof c=="string"?_=document.querySelector(c):_=c,!_)throw new Error("targeting element not found");let w=f;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",w),I&&C.setAttribute("data-ad-format",I),p&&C.setAttribute("data-full-width-responsive",p),g&&C.setAttribute("style",g),(l=this.contextInfo.testAdsMode)!=null?l:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",C.style.position="relative",_.appendChild(C),C.appendChild(b)}else _.appendChild(C),new MutationObserver(b=>{b.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let N=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return L(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let o=document.createElement("script");o.id=r,o.async=!0,o.crossOrigin="anonymous",o.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&o.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&o.setAttribute("data-ad-channel",this.initParams.channelId),document.head.appendChild(o),this.context.track("LoadAdsenseCompleted",null)}})}};Zf=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Xf(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Qf(n);try{o.insertRule(r,o.cssRules.length)}catch(i){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),ve="-ms-",hn="-moz-",J="-webkit-",Sl="comm",mi="rule",vi="decl",eh="@import",Tl="@keyframes",th="@layer",rh=Math.abs,yn=String.fromCharCode,nh=Object.assign;bn=1,yt=1,Cl=0,Ee=0,ae=0,bt="";yh=function(e,t,r){for(var n=0,o=0;n=o,o=Le(),n===38&&o===12&&(t[r]=1),!Zt(o);)Ie();return er(e,Ee)},bh=function(e,t){var r=-1,n=44;do switch(Zt(n)){case 0:n===38&&Le()===12&&(t[r]=1),e[r]+=yh(Ee-1,t,r);break;case 2:e[r]+=un(n);break;case 4:if(n===44){e[++r]=Le()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=yn(n)}while(n=Ie());return e},Eh=function(e,t){return kl(bh(Ol(e),t))},il=new WeakMap,wh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!il.get(r))&&!n){il.set(e,!0);for(var o=[],i=Eh(t,o),a=r.props,l=0,c=0;l<i.length;l++)for(var f=0;f<a.length;f++,c++)e.props[c]=o[l]?i[l].replace(/&\f/g,a[f]):a[f]+" "+i[l]}}},Ih=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Ah=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case vi:e.return=Pl(e.value,e.length);break;case Tl:return gt([Wt(e,{value:$(e.value,"@","@"+J)})],n);case mi:if(e.length)return ah(e.props,function(o){switch(ih(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gt([Wt(e,{props:[$(o,/:(read-\w+)/,":"+hn+"$1")]})],n);case"::placeholder":return gt([Wt(e,{props:[$(o,/:(plac\w+)/,":"+J+"input-$1")]}),Wt(e,{props:[$(o,/:(plac\w+)/,":"+hn+"$1")]}),Wt(e,{props:[$(o,/:(plac\w+)/,ve+"input-$1")]})],n)}return""})}},Rh=[Ah],Sh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var I=w.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||Rh,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var I=w.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)o[I[C]]=!0;a.push(w)});var l,c=[wh,Ih];{var f,y=[mh,_h(function(w){f.insert(w)})],p=vh(c.concat(n,y)),g=function(w){return gt(hh(w),p)};l=function(w,I,C,b){f=C,g(w?w+"{"+I.styles+"}":I.styles),b&&(_.inserted[I.name]=!0)}}var _={key:t,sheet:new Zf({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return _.sheet.hydrate(a),_};xh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ch=/[A-Z]|^ms/g,Oh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dl=function(e){return e.charCodeAt(1)===45},al=function(e){return e!=null&&typeof e!="boolean"},Wo=gh(function(e){return Dl(e)?e:e.replace(Ch,"-$&").toLowerCase()}),sl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Oh,function(r,n,o){return Xe={name:n,styles:o,next:Xe},n})}return xh[e]!==1&&!Dl(e)&&typeof t=="number"&&t!==0?t+"px":t};ll=/label:\s*([^\s;{]+)\s*(;|$)/g;Ph=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Dh=function(e,t,r){Ph(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};Nh=function(e){var t=Sh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered,void 0);return Dh(t,f),t.key+"-"+f.name},n=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered),y="animation-"+f.name;return ul(t,{name:f.name,styles:"@keyframes "+y+"{"+f.styles+"}"}),y},o=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered);ul(t,f)},i=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return cl(t.registered,r,Lh(l))};return{css:r,cx:i,injectGlobal:o,keyframes:n,hydrate:function(a){a.forEach(function(l){t.inserted[l]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Nl.bind(null,t.registered),merge:cl.bind(null,t.registered,r)}},Lh=function e(t){for(var r="",n=0;n<t.length;n++){var o=t[n];if(o!=null){var i=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))i=e(o);else{i="";for(var a in o)o[a]&&a&&(i&&(i+=" "),i+=a)}break}default:i=o}i&&(r&&(r+=" "),r+=i)}}return r},Uh=Nh({key:"css"}),tr=Uh.css,ui=0,Ll=[],ie=M,fl=ie.__b,hl=ie.__r,pl=ie.diffed,ml=ie.__c,vl=ie.unmount,_l=ie.__;ie.__b=function(e){be=null,fl&&fl(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_l&&_l(e,t)},ie.__r=function(e){hl&&hl(e),mn=0;var t=(be=e.__c).__H;t&&(Yo===be?(t.__h=[],be.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(dn),t.__h.forEach(ci),t.__h=[],mn=0)),Yo=be},ie.diffed=function(e){pl&&pl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ll.push(t)!==1&&dl===ie.requestAnimationFrame||((dl=ie.requestAnimationFrame)||jh)(Bh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Yo=be=null},ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(dn),r.__h=r.__h.filter(function(n){return!n.__||ci(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ie.__e(n,r.__v)}}),ml&&ml(e,t)},ie.unmount=function(e){vl&&vl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{dn(n)}catch(o){t=o}}),r.__H=void 0,t&&ie.__e(t,r.__v))};gl=typeof requestAnimationFrame=="function";Vh=Symbol.for("preact-signals");W=void 0,zt=void 0,Ze=0,di=0,vn=0;he.prototype.brand=Vh;he.prototype.h=function(){return!0};he.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};he.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};he.prototype.subscribe=function(e){var t=this;return wt(function(){var r=t.value,n=W;W=void 0;try{e(r)}finally{W=n}})};he.prototype.valueOf=function(){return this.value};he.prototype.toString=function(){return this.value+""};he.prototype.toJSON=function(){return this.value};he.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}};Object.defineProperty(he.prototype,"value",{get:function(){var e=Fl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(di>100)throw new Error("Cycle detected");this.v=e,this.i++,vn++,Ze++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{wn()}}}});(Et.prototype=new he).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vn))return!0;if(this.g=vn,this.f|=1,this.i>0&&!Bl(this))return this.f&=-2,!0;var e=W;try{jl(this),W=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return W=e,Vl(this),this.f&=-2,!0};Et.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}he.prototype.S.call(this,e)};Et.prototype.U=function(e){if(this.t!==void 0&&(he.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Et.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Et.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Fl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});rr.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};rr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Jl(this),jl(this),Ze++;var e=W;return W=this,Jh.bind(this,e)};rr.prototype.N=function(){2&this.f||(this.f|=2,this.o=zt,zt=this)};rr.prototype.d=function(){this.f|=8,1&this.f||yi(this)};$l=[],Hl=[];wt(function(){bi=this.N})();ql.displayName="_st";Object.defineProperties(he.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ql},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});It("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof he&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)});It("__r",function(e,t){_n();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return wt(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),_n(r),e(t)});It("__e",function(e,t,r,n){_n(),e(t,r,n)});It("diffed",function(e,t){_n();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props;if(n){var i=r.U;if(i)for(var a in i){var l=i[a];l!==void 0&&!(a in n)&&(l.d(),i[a]=void 0)}else i={},r.U=i;for(var c in n){var f=i[c],y=n[c];f===void 0?(f=$h(r,c,y,o),i[c]=f):f.o(y,o)}}}e(t)});It("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var a=t.__c;if(a){var l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});It("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});we.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(n||i||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};Hh=typeof requestAnimationFrame=="undefined"?setTimeout:function(e){var t=function(){clearTimeout(r),cancelAnimationFrame(n),e()},r=setTimeout(t,100),n=requestAnimationFrame(t)},qh=function(e){queueMicrotask(function(){queueMicrotask(e)})};ye=tr`
1
+ var wc=Object.create;var Hn=Object.defineProperty,Ac=Object.defineProperties,Ic=Object.getOwnPropertyDescriptor,Sc=Object.getOwnPropertyDescriptors,Rc=Object.getOwnPropertyNames,Xo=Object.getOwnPropertySymbols,Tc=Object.getPrototypeOf,ea=Object.prototype.hasOwnProperty,xc=Object.prototype.propertyIsEnumerable;var Zo=(e,t,r)=>t in e?Hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))ea.call(t,r)&&Zo(e,r,t[r]);if(Xo)for(var r of Xo(t))xc.call(t,r)&&Zo(e,r,t[r]);return e},me=(e,t)=>Ac(e,Sc(t));var Lt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var cr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Cc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rc(t))!ea.call(e,i)&&i!==r&&Hn(e,i,{get:()=>t[i],enumerable:!(n=Ic(t,i))||n.enumerable});return e};var dr=(e,t,r)=>(r=e!=null?wc(Tc(e)):{},Cc(t||!e||!e.__esModule?Hn(r,"default",{value:e,enumerable:!0}):r,e));var L=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function Bc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Xn(e){return typeof e=="string"}function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function la(e){return typeof e=="object"&&Array.isArray(e)}function Fc(e){return typeof e=="undefined"}function jc(e){return Fc(e)||e===null}function Vc(e){return typeof e=="function"}function ua(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function ca(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:na(u)&&na(s)?i[a]=n(oa({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function na(e){return e&&typeof e=="object"&&e.constructor===Object}function da(e,t){if(Array.isArray(e))return e.concat(t)}function Ft(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...h){i=h,o=this;let _=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!_&&d()},t),_)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Hc(e,t){return(...r)=>t(e,...r)}function va(e){return t=>Hc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new $c(`${i}`))}})}function Ut(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function fr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Wc(e){let t=e.location?fr(e.location,ia):null,r=e.target?fr(e.target,ia):null;return fr(Lc(oa({},e),{location:t,target:r}),Kc)}function ni(e){let t=e.events.map(n=>Wc(n)),r=fr(e.device,zc);return[e.protocolVersion,t,r,e.project]}function Yc(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function ad(e){return new Promise(t=>ya(e)(t))}function ya(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function sd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Bt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function ud(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)cd(e[n],t[n])}function cd(e,t){if(Xn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Vc(t)){try{if(e instanceof t)return}catch(r){}if(!jc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function dd(){return typeof globalThis!="undefined"?globalThis[ba]:void 0}function fd(e){typeof globalThis!="undefined"&&(globalThis[ba]=e)}function Ce(){let e=dd();if(e)return e;let t=new hr,r=new Yn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return fd(n),n}var Qn,Oc,kc,Pc,ta,Dc,Nc,ra,oa,Lc,Uc,aa,Mc,Jc,Zn,ei,fa,ha,$c,pa,ma,pr,ti,xe,Gn,qc,ri,jt,dt,Gc,ia,Kc,zc,ft,Qc,ye,Xc,Zc,ed,_a,ii,oi,td,rd,ga,Kn,Z,nd,id,Mt,Bt,Pe,Wn,od,qn,ld,Vt,hr,Yn,ba,q=j(()=>{"use strict";Qn=Object.defineProperty,Oc=Object.defineProperties,kc=Object.getOwnPropertyDescriptor,Pc=Object.getOwnPropertyDescriptors,ta=Object.getOwnPropertySymbols,Dc=Object.prototype.hasOwnProperty,Nc=Object.prototype.propertyIsEnumerable,ra=(e,t,r)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oa=(e,t)=>{for(var r in t||(t={}))Dc.call(t,r)&&ra(e,r,t[r]);if(ta)for(var r of ta(t))Nc.call(t,r)&&ra(e,r,t[r]);return e},Lc=(e,t)=>Oc(e,Pc(t)),Uc=(e,t)=>{for(var r in t)Qn(e,r,{get:t[r],enumerable:!0})},aa=(e,t,r,n)=>{for(var i=n>1?void 0:n?kc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Qn(t,r,i),i},Mc=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Jc=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Jc||{}),Zn=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},ei=class extends Zn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},fa=class extends Zn{constructor(){super(...arguments),this.kind="USER_ERROR"}},ha=class extends fa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},$c=class extends fa{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},pa=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},ma=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},pr=class extends Zn{constructor(e,t,r,n,i){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},ti=class extends ei{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};xe={log:Ut("log"),warn:Ut("warn"),info:Ut("info"),error:Ut("error"),debug:Ut("debug")};Object.assign(globalThis,{logger:xe});Gn=Symbol.for("Jolibox.canIUseMap"),qc={};globalThis[Gn]||(globalThis[Gn]=qc);ri={get config(){return globalThis[Gn]}},jt=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(jt||{}),dt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(dt||{}),Gc=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Gc||{}),ia=["name","params"],Kc=["name","type","location","target","extra","timestamp","userId"],zc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ft=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Yc();Qc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),ye={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Xc=()=>ye.isiOS?"iOS":ye.isAndroid?"Android":ye.isMac?"Mac":ye.isFacebook?"Facebook":"PC",Zc="device_id",ed="advertising_id",_a=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ft()),window.__joliboxLocalStorage__.getItem(e)),ii=()=>new URLSearchParams(window.location.search).get("deviceId")||_a(Zc),oi=()=>new URLSearchParams(window.location.search).get("advertisingId")||_a(ed),td=e=>e.charAt(0).toUpperCase()+e.slice(1),rd=()=>{var e;let t=new URLSearchParams(window.location.search);return td((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},ga=e=>{if(Qc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Xc(),n=navigator.language,i=ii(),o=oi();return`${t} (${rd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Kn=class zn{constructor(t){this.element=t,this.next=zn.Undefined,this.prev=zn.Undefined}};Kn.Undefined=new Kn(void 0);Z=Kn,nd=class{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let e=this._first;for(;e!==Z.Undefined;){let t=e.next;e.prev=Z.Undefined,e.next=Z.Undefined,e=t}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Z(e);if(this._first===Z.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Z.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Z.Undefined&&e.next!==Z.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Z.Undefined&&e.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):e.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):e.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Z.Undefined;)yield e.element,e=e.next}},id=0,Mt=class{constructor(e){this.value=e,this.id=id++}},Bt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Mt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Mt(t);return this._listeners?this._listeners instanceof Mt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,h,_,v;if(!this._disposed){if(this._listeners instanceof Mt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let E=this._listeners.indexOf(d);E>=0&&(this._listeners.splice(E,1),this._size--,this._size===0&&((v=(_=this.options)==null?void 0:_.onDidRemoveLastListener)==null||v.call(_)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Mt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Bt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new nd,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Wn={};Uc(Wn,{None:()=>od,filter:()=>sd,once:()=>ya,toPromise:()=>ad});od=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});qn=Symbol.for("Jolibox.hostEmitter"),ld=()=>{let e=new Pe;return globalThis[qn]||(globalThis[qn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[qn]},Vt=ld();hr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Bt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return ud(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};hr=aa([ua],hr);Yn=class{constructor(){this._onWillExecuteCommand=new Bt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Bt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new hr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Bc(3e4)),this._starActivation}executeCommand(e,...t){return Mc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Wn.toPromise(Wn.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Yn=aa([ua],Yn);ba=Symbol.for("Jolibox.commands")});function ke(e,t={}){ai.emit("ERROR_REPORT",{error:e,options:t})}var ai,tt,We=j(()=>{"use strict";q();q();ai=new Pe,tt=new Pe;ke.debounce=Ft(ke,50,{leading:!0})});var si,hd,Ea,wa,Aa=j(()=>{"use strict";q();We();si=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},hd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ea=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:si(o),payloadJson:si(a),signature:si(s)}}else throw"joli_source is missing"}catch(r){return ke(new pa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},wa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=hd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var pd,mr,Ia,li=j(()=>{"use strict";q();pd="1.1.27",mr=()=>pd,Ia=()=>{let e=mr();return`${ga(e)}`}});var md,Sa,ui,Ra,de,vd,D,Ee=j(()=>{"use strict";q();Aa();li();q();md={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ii(),adId:oi(),pixelRatio:window.devicePixelRatio||1,platform:ye.isAndroid?"android":ye.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:mr()},schema:window.location.href,platform:ye.isAndroid?"android":ye.isiOS?"ios":"h5"},ui=(Sa=globalThis.joliboxJSCore)==null?void 0:Sa.env,de=Object.assign({},(Ra=ui==null?void 0:ui())!=null?Ra:md),vd=()=>{var _,v,E,w,x,b,C,P,G,X,R;let{payloadJson:e,headerJson:t,signature:r}=de.schema.length?Ea(de.schema):{},n=`${de.deviceInfo.did}-${new Date().getTime()}`,o=new URL(de.schema.length?de.schema:window.location.href).searchParams,a=(E=(v=(_=o.get("mpId"))!=null?_:o.get("appId"))!=null?v:o.get("gameId"))!=null?E:"",s=(b=(x=(w=de.clientSessionId)!=null?w:e==null?void 0:e.sessionId)!=null?x:o.get("sessionId"))!=null?b:n,u=!!((P=(C=e==null?void 0:e.testAdsMode)!=null?C:e==null?void 0:e.__testAdsMode)!=null?P:o.get("testAdsMode")==="true"),d=(R=(X=(G=e==null?void 0:e.joliboxEnv)!=null?G:e==null?void 0:e.__joliboxEnv)!=null?X:o.get("joliboxEnv"))!=null?R:"production",y=d==="staging",h=t==null?void 0:t.channel;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:mr()},get mpType(){var O,U;return(U=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?U:"game"},get platform(){var O;return((O=de.platform)!=null?O:de.deviceInfo.platform).toLowerCase()},get deviceInfo(){return de.deviceInfo},get sdkInfo(){return de.sdkInfo},get hostInfo(){return de.hostInfo},get hostUserInfo(){return de.hostUserInfo},get sessionId(){var O,U;return(U=(O=de.clientSessionId)!=null?O:s)!=null?U:n},get channel(){return h},get webviewId(){var O;return(O=de.webviewId)!=null?O:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=de.deviceInfo.adId)!=null?O:de.deviceInfo.did},get language(){return de.deviceInfo.lang},onEnvConfigChanged:O=>{ca(de,O,da)},encodeJoliSourceQuery:O=>{var U,V;return t&&r?wa(Q(Q({},e),O),(U=o.get("joliSource"))!=null?U:""):(V=o.get("joliSource"))!=null?V:""}}},D=vd()});var ci,xa,_d,gd,Ta,yd,Ca=j(()=>{"use strict";q();We();Ee();q();ci=!1,xa=(e,t)=>e==null?!1:t in e,_d=e=>xa(e,"kind"),gd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ta=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:gd(e.name)},i=me(Q({},n),{env:t.environment,isFromUser:r});r?tt.emit("GLOBAL_USER_ERROR",e,i):tt.emit("GLOBAL_ERROR",e,i)},yd=e=>xa(e,"kind")&&e.kind==="USER_ERROR";ai.on("ERROR_REPORT",({error:e,options:t})=>{if(ci)return;ci=!0;let r=_d(e)&&e.raw?e.raw:e;try{let n=yd(e);Ta(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ti(`${i}, origin error: ${r.message}`);xe.error(o),Ta(new ti(o.message),{environment:t.environment},!1)}finally{ci=!1}})});var di,fi=j(()=>{"use strict";We();q();We();di=e=>new ha(e)});function Oa(e,t){let r=(n,i,o)=>{let a=me(Q({tag:n},t),{extra:Q({},i)});n=="globalJsError"?ke(new ma(JSON.stringify(a))):e("systemLog",a,o)};return r.debounce=Ft(r,500,{leading:!0}),r}function ka(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Ft(t,500,{leading:!0}),t}var Pa=j(()=>{"use strict";q();q();We()});function Da(e,t){let r=Oa(e,t),n=ka(r);return{track:r,trackPerformance:n}}var Na=j(()=>{"use strict";Pa()});var hi=j(()=>{"use strict"});var vr,La=j(()=>{"use strict";Ee();q();q();vr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return L(this,null,function*(){let r=`${D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return L(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[me(Q({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(ni(d),n):yield this.doReport(ni(d))}catch(y){xe.log("[Jolibox SDK] report API error",y)}})}}});var pi=j(()=>{"use strict";Na();hi();La()});var mi,Ua,Be,_r,Fe,Jt=j(()=>{"use strict";li();Ee();q();mi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Ua=AbortSignal.timeout)!=null||(AbortSignal.timeout=mi);Be=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new _r(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},_r=class{constructor(t){this.xua=Ia();this.getJoliSource=()=>D.joliSource;var n;let r=D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return L(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:mi(i!=null?i:3e4)});return Be.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Be.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return L(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":ye.isAndroid?"ANDROID":ye.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let _=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:mi(o!=null?o:3e4),credentials:"include"});Be.getInstance().recordNetworkRequest(!0);let v=_.headers.get("content-type");if(v!=null&&v.includes("application/octet-stream"))try{return _.blob()}catch(E){return yield _.arrayBuffer()}if(v!=null&&v.includes("multipart/form-data")||v!=null&&v.includes("application/x-www-form-urlencoded"))try{return _.formData()}catch(E){return yield _.text()}if(v!=null&&v.includes("application/json"))try{return yield _.json()}catch(E){return yield _.text()}return _}catch(n){throw Be.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return L(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,y=this.xua,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let _=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!_.ok)throw Be.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${_.status}`);return Be.getInstance().recordNetworkRequest(!0),yield _.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=_r;Fe=Be.getInstance()});var vi,gr,_i=j(()=>{"use strict";Ee();pi();Jt();vi=class extends vr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Fe.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=D.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},gr=new vi});var bd,Ma=j(()=>{"use strict";Ca();q();fi();q();_i();Ee();bd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:jt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};gr.trackEvent(n,dt.WebSDK)};tt.on("GLOBAL_ERROR",(e,t)=>{bd(t.tag,e)});tt.on("GLOBAL_USER_ERROR",(e,t)=>{xe.log("UserError",e,t)})});var yr,Ba=j(()=>{"use strict";yr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let v=Date.now(),E=v-r;E>=this.interval&&(this.visible&&(a+=Math.min(E,this.interval+1e3),t(a)),r=v),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let v=Date.now();v-r>=this.interval&&(r=v)},this.interval)},d=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",v=>{o&&(console.log("visible",v),v?d():u())});let _=this.visible;return{start(){o||(o=!0,_?d():u())},stop(){o=!1,y(),h()}}}}});var br,Fa=j(()=>{"use strict";Ee();Ba();Jt();br=class extends yr{constructor(r,n,i){super(n,i);this.httpClient=Fe.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return L(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var ja,Ed,De,wd,gi,rt,nt=j(()=>{"use strict";Ma();q();q();pi();_i();Fa();Ee();hi();ja=Ce(),Ed={type:dt.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:De,trackPerformance:wd}=Da((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=sa(r.extra)?r.extra:Xn(r.extra)?JSON.parse(r.extra):{},i=me(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:jt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=D.hostUserInfo)==null?void 0:u.uid)!=null?d:null};gr.trackEvent(o,dt.WebSDK)},Ed);ja.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{wd(e,t,r)});ja.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});gi=new Pe,rt=new br(De,gi)});function Va(e){let t=ri.config[e];return t||(t={},ri.config[e]=t),(r,n)=>{if(t[r]){xe.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var Ja=j(()=>{"use strict";q()});function yi(e){$a=e}function Er(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Er(t)):Object.keys(e).reduce((t,r)=>(t[r]=Er(e[r]),t),{})}function je(e){return typeof e=="number"}function bi(e){let t=Ei(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ei(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var $a,se,wr,Ar,Ir,Sr,ht,Rr,Tr,xr,Cr,Or,kr,Pr,Dr,Nr,Lr,Ur,Mr,wi=j(()=>{"use strict";$a=!1;se=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if($a)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${bi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Er(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Er(this._default)}optional(){return this._optional=!0,this}};wr=class extends se{validate(t){return this._optional&&t===void 0?!0:je(t)?je(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):je(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):je(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Ar=class extends se{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Ir=class extends se{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(je(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(je(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Sr=class extends se{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ht=class extends se{validate(t){return!0}},Rr=class extends se{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Tr=class extends se{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},xr=class extends se{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Cr=class extends se{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${bi(t)}`)}return!0}},Or=class extends se{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(je(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(je(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(je(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},kr=class extends se{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ei(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Pr=class extends se{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ei(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},Dr=class extends se{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:bi(this.value),actual:r}):!0}},Nr=class extends se{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
+ or `);this.errors.push(o)}return n}},Lr=class extends se{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},Ur=class extends se{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Mr=class extends se{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function Ai(e,t,r="param"){if(e.errors=[],e.path=r,yi(!0),!e.validate(t)){let n=e.errors.join(`
3
+ `);throw e.errors.length=0,yi(!1),new TypeError(n)}}var B,Ii=j(()=>{"use strict";wi();wi();B={object(e){return new Pr(e)},array(e){return new Or(e)},tuple(...e){return new Lr(...e)},literal(e){return new Dr(e)},or(...e){return new Nr(...e)},symbol(){return new Sr},record(e){return new kr(e)},function(){return new xr},boolean(){return new Ar},string(){return new Ir},number(){return new wr},undefined(){return new Rr},null(){return new Tr},unknown(){return new ht},any(){return new ht},as(){return new ht},arraybuffer(){return new Ur},enum(...e){return new Cr(...e)},typedarray(e){return new Mr(e)}}});var Br,Ha,qa=j(()=>{"use strict";q();We();Ii();fi();Br=1,Ha=e=>{function t(n,i){return(...o)=>{var h,_,v,E;let a=Date.now(),s={method:n,trace_id:Br};Br+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Ai(i.paramsSchema,o,"params")}catch(C){throw di(`${n}:fail ${C.message}`)}let w=i.implement(...o),x=w,b=`${n}:ok`;if(w&&"code"in w){let{code:C,data:P,message:G}=w;u=C,x=P,b=G}return{code:u,message:b,data:x}}catch(w){let x=w;y=(_=(h=x.code)!=null?h:x.errNo)!=null?_:2e3,u="FAILURE";let b=(E=(v=x.message)!=null?v:x.errMsg)!=null?E:`${w}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new pr(d,y)),{code:u,message:d}}finally{let w=Date.now()-a;e("apiInvoked",me(Q({},s),{duration:w,status:u}))}}}function r(n,i){return(...o)=>L(this,null,function*(){var _,v,E,w;let a=la(o)?o:[o],s=Date.now(),u={method:n,trace_id:Br};Br+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Ai(i.paramsSchema,a,"params")}catch(C){throw di(C.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:C,data:P,message:G}=b;y=C,d=G,b=P}return Object.assign(h,{code:y,message:d,data:b}),h}catch(x){let b=x,C=(v=(_=b.code)!=null?_:b.errNo)!=null?v:2e3;y="FAILURE";let P=(w=(E=b.message)!=null?E:b.errMsg)!=null?w:`${x}`,G=`${n}:${y} ${P.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:G}),ke(new pr(G,C)),h}finally{let x=Date.now()-s;e("apiInvoked",me(Q({},u),{duration:x,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ve,it,ve,$t=j(()=>{"use strict";Ja();nt();qa();Ii();({createAPI:Ve,createSyncAPI:it}=Ha(De)),ve=Va("h5")});var Wa=cr((za,xi)=>{(function(e){if(typeof za=="object"&&typeof xi!="undefined")xi.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function s(y,h){if(!o[y]){if(!i[y]){var _=typeof Lt=="function"&&Lt;if(!h&&_)return _(y,!0);if(u)return u(y,!0);var v=new Error("Cannot find module '"+y+"'");throw v.code="MODULE_NOT_FOUND",v}var E=o[y]={exports:{}};i[y][0].call(E.exports,function(w){var x=i[y][1][w];return s(x||w)},E,E.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Lt=="function"&&Lt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(w),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var _=new a.MessageChannel;_.port1.onmessage=w,u=function(){_.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){w(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(w,0)};var v,E=[];function w(){v=!0;for(var b,C,P=E.length;P;){for(C=E,E=[],b=-1;++b<P;)C[b]();P=E.length}v=!1}i.exports=x;function x(b){E.push(b)===1&&!v&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=_;function _(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&x(this,R)}_.prototype.catch=function(R){return this.then(null,R)},_.prototype.then=function(R,O){if(typeof R!="function"&&this.state===y||typeof O!="function"&&this.state===d)return this;var U=new this.constructor(s);if(this.state!==h){var V=this.state===y?R:O;E(U,V,this.outcome)}else this.queue.push(new v(U,R,O));return U};function v(R,O,U){this.promise=R,typeof O=="function"&&(this.onFulfilled=O,this.callFulfilled=this.otherCallFulfilled),typeof U=="function"&&(this.onRejected=U,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},v.prototype.otherCallFulfilled=function(R){E(this.promise,this.onFulfilled,R)},v.prototype.callRejected=function(R){u.reject(this.promise,R)},v.prototype.otherCallRejected=function(R){E(this.promise,this.onRejected,R)};function E(R,O,U){a(function(){var V;try{V=O(U)}catch(re){return u.reject(R,re)}V===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,V)})}u.resolve=function(R,O){var U=b(w,O);if(U.status==="error")return u.reject(R,U.value);var V=U.value;if(V)x(R,V);else{R.state=y,R.outcome=O;for(var re=-1,Y=R.queue.length;++re<Y;)R.queue[re].callFulfilled(O)}return R},u.reject=function(R,O){R.state=d,R.outcome=O;for(var U=-1,V=R.queue.length;++U<V;)R.queue[U].callRejected(O);return R};function w(R){var O=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof O=="function")return function(){O.apply(R,arguments)}}function x(R,O){var U=!1;function V(Re){U||(U=!0,u.reject(R,Re))}function re(Re){U||(U=!0,u.resolve(R,Re))}function Y(){O(re,V)}var ce=b(Y);ce.status==="error"&&V(ce.value)}function b(R,O){var U={};try{U.value=R(O),U.status="success"}catch(V){U.status="error",U.value=V}return U}_.resolve=C;function C(R){return R instanceof this?R:u.resolve(new this(s),R)}_.reject=P;function P(R){var O=new this(s);return u.reject(O,R)}_.all=G;function G(R){var O=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=R.length,V=!1;if(!U)return this.resolve([]);for(var re=new Array(U),Y=0,ce=-1,Re=new this(s);++ce<U;)Ue(R[ce],ce);return Re;function Ue(Pt,sr){O.resolve(Pt).then(Nn,function(ut){V||(V=!0,u.reject(Re,ut))});function Nn(ut){re[sr]=ut,++Y===U&&!V&&(V=!0,u.resolve(Re,re))}}}_.race=X;function X(R){var O=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=R.length,V=!1;if(!U)return this.resolve([]);for(var re=-1,Y=new this(s);++re<U;)ce(R[re]);return Y;function ce(Re){O.resolve(Re).then(function(Ue){V||(V=!0,u.resolve(Y,Ue))},function(Ue){V||(V=!0,u.reject(Y,Ue))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),f=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||f)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,f){l=l||[],f=f||{};try{return new Blob(l,f)}catch(p){if(p.name!=="TypeError")throw p;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new c,g=0;g<l.length;g+=1)m.append(l[g]);return m.getBlob(f.type)}}typeof Promise=="undefined"&&n(3);var _=Promise;function v(l,f){f&&l.then(function(c){f(null,c)},function(c){f(c)})}function E(l,f,c){typeof f=="function"&&l.then(f),typeof c=="function"&&l.catch(c)}function w(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function x(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",C=void 0,P={},G=Object.prototype.toString,X="readonly",R="readwrite";function O(l){for(var f=l.length,c=new ArrayBuffer(f),m=new Uint8Array(c),g=0;g<f;g++)m[g]=l.charCodeAt(g);return c}function U(l){return new _(function(f){var c=l.transaction(b,R),m=h([""]);c.objectStore(b).put(m,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),f(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);f(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function V(l){return typeof C=="boolean"?_.resolve(C):U(l).then(function(f){return C=f,C})}function re(l){var f=P[l.name],c={};c.promise=new _(function(m,g){c.resolve=m,c.reject=g}),f.deferredOperations.push(c),f.dbReady?f.dbReady=f.dbReady.then(function(){return c.promise}):f.dbReady=c.promise}function Y(l){var f=P[l.name],c=f.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ce(l,f){var c=P[l.name],m=c.deferredOperations.pop();if(m)return m.reject(f),m.promise}function Re(l,f){return new _(function(c,m){if(P[l.name]=P[l.name]||Po(),l.db)if(f)re(l),l.db.close();else return c(l.db);var g=[l.name];f&&g.push(l.version);var p=d.open.apply(d,g);f&&(p.onupgradeneeded=function(A){var I=p.result;try{I.createObjectStore(l.storeName),A.oldVersion<=1&&I.createObjectStore(b)}catch(S){if(S.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw S}}),p.onerror=function(A){A.preventDefault(),m(p.error)},p.onsuccess=function(){var A=p.result;A.onversionchange=function(I){I.target.close()},c(A),Y(l)}})}function Ue(l){return Re(l,!1)}function Pt(l){return Re(l,!0)}function sr(l,f){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),m=l.version<l.db.version,g=l.version>l.db.version;if(m&&(l.version!==f&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var p=l.db.version+1;p>l.version&&(l.version=p)}return!0}return!1}function Nn(l){return new _(function(f,c){var m=new FileReader;m.onerror=c,m.onloadend=function(g){var p=btoa(g.target.result||"");f({__local_forage_encoded_blob:!0,data:p,type:l.type})},m.readAsBinaryString(l)})}function ut(l){var f=O(atob(l.data));return h([f],{type:l.type})}function ko(l){return l&&l.__local_forage_encoded_blob}function Au(l){var f=this,c=f._initReady().then(function(){var m=P[f._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return E(c,l,l),c}function Iu(l){re(l);for(var f=P[l.name],c=f.forages,m=0;m<c.length;m++){var g=c[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Ue(l).then(function(p){return l.db=p,sr(l)?Pt(l):p}).then(function(p){l.db=f.db=p;for(var A=0;A<c.length;A++)c[A]._dbInfo.db=p}).catch(function(p){throw ce(l,p),p})}function Me(l,f,c,m){m===void 0&&(m=1);try{var g=l.db.transaction(l.storeName,f);c(null,g)}catch(p){if(m>0&&(!l.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return _.resolve().then(function(){if(!l.db||p.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Pt(l)}).then(function(){return Iu(l).then(function(){Me(l,f,c,m-1)})}).catch(c);c(p)}}function Po(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Su(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=l[m];var g=P[c.name];g||(g=Po(),P[c.name]=g),g.forages.push(f),f._initReady||(f._initReady=f.ready,f.ready=Au);var p=[];function A(){return _.resolve()}for(var I=0;I<g.forages.length;I++){var S=g.forages[I];S!==f&&p.push(S._initReady().catch(A))}var T=g.forages.slice(0);return _.all(p).then(function(){return c.db=g.db,Ue(c)}).then(function(k){return c.db=k,sr(c,f._defaultConfig.version)?Pt(c):k}).then(function(k){c.db=g.db=k,f._dbInfo=c;for(var N=0;N<T.length;N++){var F=T[N];F!==f&&(F._dbInfo.db=c.db,F._dbInfo.version=c.version)}})}function Ru(l,f){var c=this;l=w(l);var m=new _(function(g,p){c.ready().then(function(){Me(c._dbInfo,X,function(A,I){if(A)return p(A);try{var S=I.objectStore(c._dbInfo.storeName),T=S.get(l);T.onsuccess=function(){var k=T.result;k===void 0&&(k=null),ko(k)&&(k=ut(k)),g(k)},T.onerror=function(){p(T.error)}}catch(k){p(k)}})}).catch(p)});return v(m,f),m}function Tu(l,f){var c=this,m=new _(function(g,p){c.ready().then(function(){Me(c._dbInfo,X,function(A,I){if(A)return p(A);try{var S=I.objectStore(c._dbInfo.storeName),T=S.openCursor(),k=1;T.onsuccess=function(){var N=T.result;if(N){var F=N.value;ko(F)&&(F=ut(F));var H=l(F,N.key,k++);H!==void 0?g(H):N.continue()}else g()},T.onerror=function(){p(T.error)}}catch(N){p(N)}})}).catch(p)});return v(m,f),m}function xu(l,f,c){var m=this;l=w(l);var g=new _(function(p,A){var I;m.ready().then(function(){return I=m._dbInfo,G.call(f)==="[object Blob]"?V(I.db).then(function(S){return S?f:Nn(f)}):f}).then(function(S){Me(m._dbInfo,R,function(T,k){if(T)return A(T);try{var N=k.objectStore(m._dbInfo.storeName);S===null&&(S=void 0);var F=N.put(S,l);k.oncomplete=function(){S===void 0&&(S=null),p(S)},k.onabort=k.onerror=function(){var H=F.error?F.error:F.transaction.error;A(H)}}catch(H){A(H)}})}).catch(A)});return v(g,c),g}function Cu(l,f){var c=this;l=w(l);var m=new _(function(g,p){c.ready().then(function(){Me(c._dbInfo,R,function(A,I){if(A)return p(A);try{var S=I.objectStore(c._dbInfo.storeName),T=S.delete(l);I.oncomplete=function(){g()},I.onerror=function(){p(T.error)},I.onabort=function(){var k=T.error?T.error:T.transaction.error;p(k)}}catch(k){p(k)}})}).catch(p)});return v(m,f),m}function Ou(l){var f=this,c=new _(function(m,g){f.ready().then(function(){Me(f._dbInfo,R,function(p,A){if(p)return g(p);try{var I=A.objectStore(f._dbInfo.storeName),S=I.clear();A.oncomplete=function(){m()},A.onabort=A.onerror=function(){var T=S.error?S.error:S.transaction.error;g(T)}}catch(T){g(T)}})}).catch(g)});return v(c,l),c}function ku(l){var f=this,c=new _(function(m,g){f.ready().then(function(){Me(f._dbInfo,X,function(p,A){if(p)return g(p);try{var I=A.objectStore(f._dbInfo.storeName),S=I.count();S.onsuccess=function(){m(S.result)},S.onerror=function(){g(S.error)}}catch(T){g(T)}})}).catch(g)});return v(c,l),c}function Pu(l,f){var c=this,m=new _(function(g,p){if(l<0){g(null);return}c.ready().then(function(){Me(c._dbInfo,X,function(A,I){if(A)return p(A);try{var S=I.objectStore(c._dbInfo.storeName),T=!1,k=S.openKeyCursor();k.onsuccess=function(){var N=k.result;if(!N){g(null);return}l===0||T?g(N.key):(T=!0,N.advance(l))},k.onerror=function(){p(k.error)}}catch(N){p(N)}})}).catch(p)});return v(m,f),m}function Du(l){var f=this,c=new _(function(m,g){f.ready().then(function(){Me(f._dbInfo,X,function(p,A){if(p)return g(p);try{var I=A.objectStore(f._dbInfo.storeName),S=I.openKeyCursor(),T=[];S.onsuccess=function(){var k=S.result;if(!k){m(T);return}T.push(k.key),k.continue()},S.onerror=function(){g(S.error)}}catch(k){g(k)}})}).catch(g)});return v(c,l),c}function Nu(l,f){f=x.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;if(!l.name)g=_.reject("Invalid arguments");else{var p=l.name===c.name&&m._dbInfo.db,A=p?_.resolve(m._dbInfo.db):Ue(l).then(function(I){var S=P[l.name],T=S.forages;S.db=I;for(var k=0;k<T.length;k++)T[k]._dbInfo.db=I;return I});l.storeName?g=A.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var S=I.version+1;re(l);var T=P[l.name],k=T.forages;I.close();for(var N=0;N<k.length;N++){var F=k[N];F._dbInfo.db=null,F._dbInfo.version=S}var H=new _(function(K,ae){var ne=d.open(l.name,S);ne.onerror=function(Te){var Nt=ne.result;Nt.close(),ae(Te)},ne.onupgradeneeded=function(){var Te=ne.result;Te.deleteObjectStore(l.storeName)},ne.onsuccess=function(){var Te=ne.result;Te.close(),K(Te)}});return H.then(function(K){T.db=K;for(var ae=0;ae<k.length;ae++){var ne=k[ae];ne._dbInfo.db=K,Y(ne._dbInfo)}}).catch(function(K){throw(ce(l,K)||_.resolve()).catch(function(){}),K})}}):g=A.then(function(I){re(l);var S=P[l.name],T=S.forages;I.close();for(var k=0;k<T.length;k++){var N=T[k];N._dbInfo.db=null}var F=new _(function(H,K){var ae=d.deleteDatabase(l.name);ae.onerror=function(){var ne=ae.result;ne&&ne.close(),K(ae.error)},ae.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},ae.onsuccess=function(){var ne=ae.result;ne&&ne.close(),H(ne)}});return F.then(function(H){S.db=H;for(var K=0;K<T.length;K++){var ae=T[K];Y(ae._dbInfo)}}).catch(function(H){throw(ce(l,H)||_.resolve()).catch(function(){}),H})})}return v(g,f),g}var Lu={_driver:"asyncStorage",_initStorage:Su,_support:y(),iterate:Tu,getItem:Ru,setItem:xu,removeItem:Cu,clear:Ou,length:ku,key:Pu,keys:Du,dropInstance:Nu};function Uu(){return typeof openDatabase=="function"}var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mu="~~local_forage_type~",Do=/^~~local_forage_type~([^~]+)~/,lr="__lfsc__:",Ln=lr.length,Un="arbf",Mn="blob",No="si08",Lo="ui08",Uo="uic8",Mo="si16",Bo="si32",Fo="ur16",jo="ui32",Vo="fl32",Jo="fl64",$o=Ln+Un.length,Ho=Object.prototype.toString;function qo(l){var f=l.length*.75,c=l.length,m,g=0,p,A,I,S;l[l.length-1]==="="&&(f--,l[l.length-2]==="="&&f--);var T=new ArrayBuffer(f),k=new Uint8Array(T);for(m=0;m<c;m+=4)p=Ke.indexOf(l[m]),A=Ke.indexOf(l[m+1]),I=Ke.indexOf(l[m+2]),S=Ke.indexOf(l[m+3]),k[g++]=p<<2|A>>4,k[g++]=(A&15)<<4|I>>2,k[g++]=(I&3)<<6|S&63;return T}function Bn(l){var f=new Uint8Array(l),c="",m;for(m=0;m<f.length;m+=3)c+=Ke[f[m]>>2],c+=Ke[(f[m]&3)<<4|f[m+1]>>4],c+=Ke[(f[m+1]&15)<<2|f[m+2]>>6],c+=Ke[f[m+2]&63];return f.length%3===2?c=c.substring(0,c.length-1)+"=":f.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Bu(l,f){var c="";if(l&&(c=Ho.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&Ho.call(l.buffer)==="[object ArrayBuffer]")){var m,g=lr;l instanceof ArrayBuffer?(m=l,g+=Un):(m=l.buffer,c==="[object Int8Array]"?g+=No:c==="[object Uint8Array]"?g+=Lo:c==="[object Uint8ClampedArray]"?g+=Uo:c==="[object Int16Array]"?g+=Mo:c==="[object Uint16Array]"?g+=Fo:c==="[object Int32Array]"?g+=Bo:c==="[object Uint32Array]"?g+=jo:c==="[object Float32Array]"?g+=Vo:c==="[object Float64Array]"?g+=Jo:f(new Error("Failed to get type for BinaryArray"))),f(g+Bn(m))}else if(c==="[object Blob]"){var p=new FileReader;p.onload=function(){var A=Mu+l.type+"~"+Bn(this.result);f(lr+Mn+A)},p.readAsArrayBuffer(l)}else try{f(JSON.stringify(l))}catch(A){console.error("Couldn't convert value into a JSON string: ",l),f(null,A)}}function Fu(l){if(l.substring(0,Ln)!==lr)return JSON.parse(l);var f=l.substring($o),c=l.substring(Ln,$o),m;if(c===Mn&&Do.test(f)){var g=f.match(Do);m=g[1],f=f.substring(g[0].length)}var p=qo(f);switch(c){case Un:return p;case Mn:return h([p],{type:m});case No:return new Int8Array(p);case Lo:return new Uint8Array(p);case Uo:return new Uint8ClampedArray(p);case Mo:return new Int16Array(p);case Fo:return new Uint16Array(p);case Bo:return new Int32Array(p);case jo:return new Uint32Array(p);case Vo:return new Float32Array(p);case Jo:return new Float64Array(p);default:throw new Error("Unkown type: "+c)}}var Fn={serialize:Bu,deserialize:Fu,stringToBuffer:qo,bufferToString:Bn};function Go(l,f,c,m){l.executeSql("CREATE TABLE IF NOT EXISTS "+f.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function ju(l){var f=this,c={db:null};if(l)for(var m in l)c[m]=typeof l[m]!="string"?l[m].toString():l[m];var g=new _(function(p,A){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return A(I)}c.db.transaction(function(I){Go(I,c,function(){f._dbInfo=c,p()},function(S,T){A(T)})},A)});return c.serializer=Fn,g}function ze(l,f,c,m,g,p){l.executeSql(c,m,g,function(A,I){I.code===I.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[f.storeName],function(S,T){T.rows.length?p(S,I):Go(S,f,function(){S.executeSql(c,m,g,p)},p)},p):p(A,I)},p)}function Vu(l,f){var c=this;l=w(l);var m=new _(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){ze(I,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[l],function(S,T){var k=T.rows.length?T.rows.item(0).value:null;k&&(k=A.serializer.deserialize(k)),g(k)},function(S,T){p(T)})})}).catch(p)});return v(m,f),m}function Ju(l,f){var c=this,m=new _(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){ze(I,A,"SELECT * FROM "+A.storeName,[],function(S,T){for(var k=T.rows,N=k.length,F=0;F<N;F++){var H=k.item(F),K=H.value;if(K&&(K=A.serializer.deserialize(K)),K=l(K,H.key,F+1),K!==void 0){g(K);return}}g()},function(S,T){p(T)})})}).catch(p)});return v(m,f),m}function Ko(l,f,c,m){var g=this;l=w(l);var p=new _(function(A,I){g.ready().then(function(){f===void 0&&(f=null);var S=f,T=g._dbInfo;T.serializer.serialize(f,function(k,N){N?I(N):T.db.transaction(function(F){ze(F,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[l,k],function(){A(S)},function(H,K){I(K)})},function(F){if(F.code===F.QUOTA_ERR){if(m>0){A(Ko.apply(g,[l,S,c,m-1]));return}I(F)}})})}).catch(I)});return v(p,c),p}function $u(l,f,c){return Ko.apply(this,[l,f,c,1])}function Hu(l,f){var c=this;l=w(l);var m=new _(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){ze(I,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[l],function(){g()},function(S,T){p(T)})})}).catch(p)});return v(m,f),m}function qu(l){var f=this,c=new _(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(A){ze(A,p,"DELETE FROM "+p.storeName,[],function(){m()},function(I,S){g(S)})})}).catch(g)});return v(c,l),c}function Gu(l){var f=this,c=new _(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(A){ze(A,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(I,S){var T=S.rows.item(0).c;m(T)},function(I,S){g(S)})})}).catch(g)});return v(c,l),c}function Ku(l,f){var c=this,m=new _(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){ze(I,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[l+1],function(S,T){var k=T.rows.length?T.rows.item(0).key:null;g(k)},function(S,T){p(T)})})}).catch(p)});return v(m,f),m}function zu(l){var f=this,c=new _(function(m,g){f.ready().then(function(){var p=f._dbInfo;p.db.transaction(function(A){ze(A,p,"SELECT key FROM "+p.storeName,[],function(I,S){for(var T=[],k=0;k<S.rows.length;k++)T.push(S.rows.item(k).key);m(T)},function(I,S){g(S)})})}).catch(g)});return v(c,l),c}function Wu(l){return new _(function(f,c){l.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var A=[],I=0;I<p.rows.length;I++)A.push(p.rows.item(I).name);f({db:l,storeNames:A})},function(g,p){c(p)})},function(m){c(m)})})}function Yu(l,f){f=x.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var m=this,g;return l.name?g=new _(function(p){var A;l.name===c.name?A=m._dbInfo.db:A=openDatabase(l.name,"","",0),l.storeName?p({db:A,storeNames:[l.storeName]}):p(Wu(A))}).then(function(p){return new _(function(A,I){p.db.transaction(function(S){function T(H){return new _(function(K,ae){S.executeSql("DROP TABLE IF EXISTS "+H,[],function(){K()},function(ne,Te){ae(Te)})})}for(var k=[],N=0,F=p.storeNames.length;N<F;N++)k.push(T(p.storeNames[N]));_.all(k).then(function(){A()}).catch(function(H){I(H)})},function(S){I(S)})})}):g=_.reject("Invalid arguments"),v(g,f),g}var Qu={_driver:"webSQLStorage",_initStorage:ju,_support:Uu(),iterate:Ju,getItem:Vu,setItem:$u,removeItem:Hu,clear:qu,length:Gu,key:Ku,keys:zu,dropInstance:Yu};function Xu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function zo(l,f){var c=l.name+"/";return l.storeName!==f.storeName&&(c+=l.storeName+"/"),c}function Zu(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(f){return!0}}function ec(){return!Zu()||localStorage.length>0}function tc(l){var f=this,c={};if(l)for(var m in l)c[m]=l[m];return c.keyPrefix=zo(l,f._defaultConfig),ec()?(f._dbInfo=c,c.serializer=Fn,_.resolve()):_.reject()}function rc(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(m)===0&&localStorage.removeItem(p)}});return v(c,l),c}function nc(l,f){var c=this;l=w(l);var m=c.ready().then(function(){var g=c._dbInfo,p=localStorage.getItem(g.keyPrefix+l);return p&&(p=g.serializer.deserialize(p)),p});return v(m,f),m}function ic(l,f){var c=this,m=c.ready().then(function(){for(var g=c._dbInfo,p=g.keyPrefix,A=p.length,I=localStorage.length,S=1,T=0;T<I;T++){var k=localStorage.key(T);if(k.indexOf(p)===0){var N=localStorage.getItem(k);if(N&&(N=g.serializer.deserialize(N)),N=l(N,k.substring(A),S++),N!==void 0)return N}}});return v(m,f),m}function oc(l,f){var c=this,m=c.ready().then(function(){var g=c._dbInfo,p;try{p=localStorage.key(l)}catch(A){p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return v(m,f),m}function ac(l){var f=this,c=f.ready().then(function(){for(var m=f._dbInfo,g=localStorage.length,p=[],A=0;A<g;A++){var I=localStorage.key(A);I.indexOf(m.keyPrefix)===0&&p.push(I.substring(m.keyPrefix.length))}return p});return v(c,l),c}function sc(l){var f=this,c=f.keys().then(function(m){return m.length});return v(c,l),c}function lc(l,f){var c=this;l=w(l);var m=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return v(m,f),m}function uc(l,f,c){var m=this;l=w(l);var g=m.ready().then(function(){f===void 0&&(f=null);var p=f;return new _(function(A,I){var S=m._dbInfo;S.serializer.serialize(f,function(T,k){if(k)I(k);else try{localStorage.setItem(S.keyPrefix+l,T),A(p)}catch(N){(N.name==="QuotaExceededError"||N.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(N),I(N)}})})});return v(g,c),g}function cc(l,f){if(f=x.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var m=this,g;return l.name?g=new _(function(p){l.storeName?p(zo(l,m._defaultConfig)):p(l.name+"/")}).then(function(p){for(var A=localStorage.length-1;A>=0;A--){var I=localStorage.key(A);I.indexOf(p)===0&&localStorage.removeItem(I)}}):g=_.reject("Invalid arguments"),v(g,f),g}var dc={_driver:"localStorageWrapper",_initStorage:tc,_support:Xu(),iterate:ic,getItem:nc,setItem:uc,removeItem:lc,clear:rc,length:sc,key:oc,keys:ac,dropInstance:cc},fc=function(f,c){return f===c||typeof f=="number"&&typeof c=="number"&&isNaN(f)&&isNaN(c)},hc=function(f,c){for(var m=f.length,g=0;g<m;){if(fc(f[g],c))return!0;g++}return!1},Wo=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Dt={},Yo={},ct={INDEXEDDB:Lu,WEBSQL:Qu,LOCALSTORAGE:dc},pc=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],ur=["dropInstance"],jn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ur),mc={description:"",driver:pc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function vc(l,f){l[f]=function(){var c=arguments;return l.ready().then(function(){return l[f].apply(l,c)})}}function Vn(){for(var l=1;l<arguments.length;l++){var f=arguments[l];if(f)for(var c in f)f.hasOwnProperty(c)&&(Wo(f[c])?arguments[0][c]=f[c].slice():arguments[0][c]=f[c])}return arguments[0]}var _c=function(){function l(f){s(this,l);for(var c in ct)if(ct.hasOwnProperty(c)){var m=ct[c],g=m._driver;this[c]=g,Dt[g]||this.defineDriver(m)}this._defaultConfig=Vn({},mc),this._config=Vn({},this._defaultConfig,f),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in c){if(m==="storeName"&&(c[m]=c[m].replace(/\W/g,"_")),m==="version"&&typeof c[m]!="number")return new Error("Database version must be a number.");this._config[m]=c[m]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,m,g){var p=new _(function(A,I){try{var S=c._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(T);return}for(var k=jn.concat("_initStorage"),N=0,F=k.length;N<F;N++){var H=k[N],K=!hc(ur,H);if((K||c[H])&&typeof c[H]!="function"){I(T);return}}var ae=function(){for(var Nt=function(bc){return function(){var Ec=new Error("Method "+bc+" is not implemented by the current driver"),Qo=_.reject(Ec);return v(Qo,arguments[arguments.length-1]),Qo}},Jn=0,yc=ur.length;Jn<yc;Jn++){var $n=ur[Jn];c[$n]||(c[$n]=Nt($n))}};ae();var ne=function(Nt){Dt[S]&&console.info("Redefining LocalForage driver: "+S),Dt[S]=c,Yo[S]=Nt,A()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ne,I):ne(!!c._support):ne(!0)}catch(Te){I(Te)}});return E(p,m,g),p},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,m,g){var p=Dt[c]?_.resolve(Dt[c]):_.reject(new Error("Driver not found."));return E(p,m,g),p},l.prototype.getSerializer=function(c){var m=_.resolve(Fn);return E(m,c),m},l.prototype.ready=function(c){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return E(g,c,c),g},l.prototype.setDriver=function(c,m,g){var p=this;Wo(c)||(c=[c]);var A=this._getSupportedDrivers(c);function I(){p._config.driver=p.driver()}function S(N){return p._extend(N),I(),p._ready=p._initStorage(p._config),p._ready}function T(N){return function(){var F=0;function H(){for(;F<N.length;){var K=N[F];return F++,p._dbInfo=null,p._ready=null,p.getDriver(K).then(S).catch(H)}I();var ae=new Error("No available storage method found.");return p._driverSet=_.reject(ae),p._driverSet}return H()}}var k=this._driverSet!==null?this._driverSet.catch(function(){return _.resolve()}):_.resolve();return this._driverSet=k.then(function(){var N=A[0];return p._dbInfo=null,p._ready=null,p.getDriver(N).then(function(F){p._driver=F._driver,I(),p._wrapLibraryMethodsWithReady(),p._initDriver=T(A)})}).catch(function(){I();var N=new Error("No available storage method found.");return p._driverSet=_.reject(N),p._driverSet}),E(this._driverSet,m,g),this._driverSet},l.prototype.supports=function(c){return!!Yo[c]},l.prototype._extend=function(c){Vn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var m=[],g=0,p=c.length;g<p;g++){var A=c[g];this.supports(A)&&m.push(A)}return m},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,m=jn.length;c<m;c++)vc(this,jn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),gc=new _c;i.exports=gc},{3:3}]},{},[4])(4)})});var Qa=cr($r=>{"use strict";q();$t();nt();var Oi=Ce(),jd=Ve("levelFinished",{paramsSchema:B.tuple(B.object({levelId:B.or(B.string(),B.number()),duration:B.number().optional(),rating:B.number().optional(),score:B.number().optional()})),implement:e=>L($r,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;xe.info("onLevelFinished",r,n,i),yield Promise.all([rt.reporter({event:"COMPLETE_GAME_LEVEL"}),rt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Vd=Ve("gamePlayEnded",{paramsSchema:B.tuple(B.object({duration:B.number().optional(),rating:B.number().optional(),score:B.number()})),implement:e=>L($r,null,function*(){let{duration:t,rating:r,score:n}=e;return xe.info("onGamePlayEnded",t,r,n),rt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Jd=Ve("levelUpgrade",{paramsSchema:B.tuple(B.object({levelId:B.or(B.string(),B.number()),name:B.string().optional()})),implement:r=>L($r,[r],function*({levelId:e,name:t}){return rt.tracker("LevelUpgrade",{name:t,levelId:e})})});Oi.registerCommand("TaskTrackerSDK.levelFinished",jd);Oi.registerCommand("TaskTrackerSDK.gamePlayEnded",Vd);Oi.registerCommand("TaskTrackerSDK.levelUpgrade",Jd);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var mt,pt,Xa,ki,$d,Pi,Di=j(()=>{"use strict";mt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},pt=new Map,Xa=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=pt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},ki=!1,$d=()=>{ki||(window.addEventListener("message",Xa),ki=!0)},Pi=(e,t)=>{$d(),pt.has(e)||pt.set(e,new Set);let r=pt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&pt.delete(e),pt.size===0&&(window.removeEventListener("message",Xa),ki=!1)}}});var _t,Hr,qr,Gr,Kr,Za,vt,Hd,fe,ot,at=j(()=>{"use strict";q();_t="UNLOCK_OPTIONS_CHANGED",Hr="INVOKE_PAYMENT",qr="ON_PAYMENT_RESULT",Gr="ON_USE_MODAL_EVENT",Kr="ON_USE_MODAL_RESULT",Za="ON_USE_MODAL_FREQUENCY",vt=new Pe,Hd=()=>({on:vt.on.bind(vt),off:vt.off.bind(vt),emit:vt.emit.bind(vt)}),fe=Hd(),ot={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});function ts(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return L(this,null,function*(){return yield i.reduce((s,u)=>L(this,null,function*(){let d=yield s;if(d===!0)return!0;es&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return es&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return L(this,null,function*(){t=(...o)=>L(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return L(this,null,function*(){r=(...o)=>L(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:ot}}})})},getRewardsTypes(...i){return L(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return L(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:ot}})}}}var es,rs=j(()=>{"use strict";Ee();at();es=D.testMode});var qd,Gd,ns,is,os=j(()=>{"use strict";at();qd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Gd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(qd()):["ADS"],ns=e=>{e.registerRewardsFetcher(t=>L(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(_t,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return Gd(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},is=e=>{e.registerRewardFrequencyConfigFetcher(t=>L(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return r.code!=="SUCCESS"?{joliCoinUseAndCharge:ot}:(fe.emit(Za,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||ot}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||ot})}))}});var as,ss=j(()=>{"use strict";as=e=>t=>L(void 0,null,function*(){return e.adBreak(t),!0})});function st(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r)}}var zr=j(()=>{"use strict"});var ls,us=j(()=>{"use strict";ls=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}))});var Wr,Yr,cs,Qr,Xr=j(()=>{"use strict";Ee();q();at();us();zr();Wr=(e,t)=>r=>L(void 0,null,function*(){let n=st(fe,qr);return fe.emit(Hr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Yr=(e,t)=>r=>L(void 0,null,function*(){let n=st(fe,Kr);return fe.emit(Gr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),cs=e=>{if(e=="CANCEL")throw new Error("CANCEL")},Qr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>L(void 0,null,function*(){var s,u,d,y,h,_,v;try{let E=!1,w=yield n.getData(),x=(d=(u=(s=w==null?void 0:w.options)==null?void 0:s.find(P=>P.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!ls((w==null?void 0:w.options)||[],w==null?void 0:w.userJoliCoin)){let P=yield i({userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:x});if(cs(P),P!=="SUCCESS")return r==null||r(a),!1;E=!0}let b=!!((y=w==null?void 0:w.userJoliCoin)!=null&&y.enableAutoDeduct);if(!E){let P=yield o({enableAutoDeduct:b,userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:x});if(cs(P),P!=="CONFIRM")return r==null||r(a),!1}let C=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ft()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});return C.code=="SUCCESS"?((_=a.adBreakDone)==null||_.call(a,{breakType:a.type,breakName:"name"in a&&(h=a.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((v=a.adViewed)==null||v.call(a)),t==null||t({quantity:C.data.quantity,balance:C.data.balance}),!0):(r==null||r(a),!1)}catch(E){if(console.info("JolicoinRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(a),!1}finally{n.clearCache()}})});var ds,fs=j(()=>{"use strict";at();zr();Xr();Xr();ds=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=()=>{r==null||r()},o=Yr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Wr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return Qr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var hs,ps=j(()=>{"use strict";at();Xr();zr();hs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=Yr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Wr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return Qr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})}});var Ye,ms=j(()=>{"use strict";rs();os();ss();fs();ps();Ye=ts();ns(Ye);is(Ye)});function Je(e,t){for(var r in t)e[r]=t[r];return e}function Bi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Kt(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?rn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return en(e,a,n,i,null)}function en(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++bs:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Qe(e){return e.children}function Ie(e,t){this.props=e,this.context=t}function gt(e,t){if(t==null)return e.__?gt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?gt(e):null}function Ss(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Ss(e)}}function _s(e){(!e.__d&&(e.__d=!0)&&lt.push(e)&&!tn.__r++||vs!==M.debounceRendering)&&((vs=M.debounceRendering)||Es)(tn)}function tn(){for(var e,t,r,n,i,o,a,s=1;lt.length;)lt.length>s&&lt.sort(ws),e=lt.shift(),s=lt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Je({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),Fi(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?gt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,xs(o,r,a),r.__e!=i&&Ss(r)));tn.__r=0}function Rs(e,t,r,n,i,o,a,s,u,d,y){var h,_,v,E,w,x,b=n&&n.__k||Is,C=t.length;for(u=Wd(r,t,b,u,C),h=0;h<C;h++)(v=r.__k[h])!=null&&(_=v.__i===-1?qt:b[v.__i]||qt,v.__i=h,x=Fi(e,v,_,i,o,a,s,u,d,y),E=v.__e,v.ref&&_.ref!=v.ref&&(_.ref&&ji(_.ref,null,v),y.push(v.ref,v.__c||E,v)),w==null&&E!=null&&(w=E),4&v.__u||_.__k===v.__k?u=Ts(v,u,e):typeof v.type=="function"&&x!==void 0?u=x:E&&(u=E.nextSibling),v.__u&=-7);return r.__e=w,u}function Wd(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,_=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+_,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?en(null,a,null,null,null):Gt(a)?en(Qe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?en(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=Yd(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?_--:i<y&&_++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?_--:d==u+1?_++:(d>u?_--:_++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=gt(s)),Os(s,s));return n}function Ts(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=Ts(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=gt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function zt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Gt(e)?e.some(function(r){zt(r,t)}):t.push(e)),t}function Yd(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function gs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||zd.test(t)?r:r+"px"}function Zr(e,t,r,n,i){var o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||gs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||gs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(As,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=Mi,e.addEventListener(t,o?Li:Ni,o)):e.removeEventListener(t,o?Li:Ni,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ys(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Mi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function Fi(e,t,r,n,i,o,a,s,u,d){var y,h,_,v,E,w,x,b,C,P,G,X,R,O,U,V,re,Y=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof Y=="function")try{if(b=t.props,C="prototype"in Y&&Y.prototype.render,P=(y=Y.contextType)&&n[y.__c],G=y?P?P.props.value:y.__:n,r.__c?x=(h=t.__c=r.__c).__=h.__E:(C?t.__c=h=new Y(b,G):(t.__c=h=new Ie(b,G),h.constructor=Y,h.render=Xd),P&&P.sub(h),h.props=b,h.state||(h.state={}),h.context=G,h.__n=n,_=h.__d=!0,h.__h=[],h._sb=[]),C&&h.__s==null&&(h.__s=h.state),C&&Y.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Je({},h.__s)),Je(h.__s,Y.getDerivedStateFromProps(b,h.__s))),v=h.props,E=h.state,h.__v=t,_)C&&Y.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),C&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(C&&Y.getDerivedStateFromProps==null&&b!==v&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,G),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,G)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ce){ce&&(ce.__=t)}),X=0;X<h._sb.length;X++)h.__h.push(h._sb[X]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,G),C&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(v,E,w)})}if(h.context=G,h.props=b,h.__P=e,h.__e=!1,R=M.__r,O=0,C){for(h.state=h.__s,h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),U=0;U<h._sb.length;U++)h.__h.push(h._sb[U]);h._sb=[]}else do h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++O<25);h.state=h.__s,h.getChildContext!=null&&(n=Je(Je({},n),h.getChildContext())),C&&!_&&h.getSnapshotBeforeUpdate!=null&&(w=h.getSnapshotBeforeUpdate(v,E)),V=y,y!=null&&y.type===Qe&&y.key==null&&(V=Cs(y.props.children)),s=Rs(e,Gt(V)?V:[V],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),x&&(h.__E=h.__=null)}catch(ce){if(t.__v=null,u||o!=null)if(ce.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(re=o.length;re--;)Bi(o[re]);else t.__e=r.__e,t.__k=r.__k;M.__e(ce,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Qd(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function xs(e,t,r){for(var n=0;n<r.length;n++)ji(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function Cs(e){return typeof e!="object"||e==null?e:Gt(e)?e.map(Cs):Je({},e)}function Qd(e,t,r,n,i,o,a,s,u){var d,y,h,_,v,E,w,x=r.props,b=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((v=o[d])&&"setAttribute"in v==!!C&&(C?v.localName==C:v.nodeType==3)){e=v,o[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(b);e=document.createElementNS(i,C,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(C===null)x===b||s&&e.data===b||(e.data=b);else{if(o=o&&rn.call(e.childNodes),x=r.props||qt,!s&&o!=null)for(x={},d=0;d<e.attributes.length;d++)x[(v=e.attributes[d]).name]=v.value;for(d in x)if(v=x[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=v;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;Zr(e,d,null,v,i)}}for(d in b)v=b[d],d=="children"?_=v:d=="dangerouslySetInnerHTML"?y=v:d=="value"?E=v:d=="checked"?w=v:s&&typeof v!="function"||x[d]===v||Zr(e,d,v,x[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Rs(t.type==="template"?e.content:e,Gt(_)?_:[_],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&gt(r,0),s,u),o!=null)for(d=o.length;d--;)Bi(o[d]);s||(d="value",C=="progress"&&E==null?e.removeAttribute("value"):E!==void 0&&(E!==e[d]||C=="progress"&&!E||C=="option"&&E!==x[d])&&Zr(e,d,E,x[d],i),d="checked",w!==void 0&&w!==e[d]&&Zr(e,d,w,x[d],i))}return e}function ji(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Os(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ji(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Os(n[i],t,r||typeof e.type!="function");r||Bi(e.__e),e.__c=e.__=e.__e=void 0}function Xd(e,t,r){return this.constructor(e,r)}function ks(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Fi(t,e=(!n&&r||t).__k=Kt(Qe,null,[e]),i||qt,qt,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?rn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),xs(o,e,a)}var rn,M,bs,Ui,lt,vs,Es,ws,As,Mi,Ni,Li,Kd,qt,Is,zd,Gt,Wt=j(()=>{qt={},Is=[],zd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Gt=Array.isArray;rn=Is.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},bs=0,Ui=function(e){return e!=null&&e.constructor==null},Ie.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},r),this.props)),e&&Je(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_s(this))},Ie.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_s(this))},Ie.prototype.render=Qe,lt=[],Es=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ws=function(e,t){return e.__v.__b-t.__v.__b},tn.__r=0,As=/(PointerCapture)$|Capture$/i,Mi=0,Ni=ys(!1),Li=ys(!0),Kd=0});function an(e,t){ie.__h&&ie.__h(te,e,on||t),on=0;var r=te.__H||(te.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function $i(e){return on=1,Vs(Js,e)}function Vs(e,t,r){var n=an(yt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Js(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=te,!te.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(_){return!!_.__c});if(y.every(function(_){return!_.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(_){if(_.__N){var v=_.__[0];_.__=_.__N,_.__N=void 0,v!==_.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};te.__f=!0;var o=te.shouldComponentUpdate,a=te.componentWillUpdate;te.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},te.shouldComponentUpdate=i}return n.__N||n.__}function sn(e,t){var r=an(yt++,3);!ie.__s&&Gi(r.__H,t)&&(r.__=e,r.u=t,te.__H.__h.push(r))}function Hi(e,t){var r=an(yt++,4);!ie.__s&&Gi(r.__H,t)&&(r.__=e,r.u=t,te.__h.push(r))}function qi(e){return on=5,ln(function(){return{current:e}},[])}function ln(e,t){var r=an(yt++,7);return Gi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Zd(){for(var e;e=js.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(nn),e.__H.__h.forEach(Ji),e.__H.__h=[]}catch(t){e.__H.__h=[],ie.__e(t,e.__v)}}function ef(e){var t,r=function(){clearTimeout(n),Fs&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Fs&&(t=requestAnimationFrame(r))}function nn(e){var t=te,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),te=t}function Ji(e){var t=te;e.__c=e.__(),te=t}function Gi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Js(e,t){return typeof t=="function"?t(e):t}var yt,te,Vi,Ps,on,js,ie,Ds,Ns,Ls,Us,Ms,Bs,Fs,Ki=j(()=>{Wt();on=0,js=[],ie=M,Ds=ie.__b,Ns=ie.__r,Ls=ie.diffed,Us=ie.__c,Ms=ie.unmount,Bs=ie.__;ie.__b=function(e){te=null,Ds&&Ds(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Bs&&Bs(e,t)},ie.__r=function(e){Ns&&Ns(e),yt=0;var t=(te=e.__c).__H;t&&(Vi===te?(t.__h=[],te.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(nn),t.__h.forEach(Ji),t.__h=[],yt=0)),Vi=te},ie.diffed=function(e){Ls&&Ls(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(js.push(t)!==1&&Ps===ie.requestAnimationFrame||((Ps=ie.requestAnimationFrame)||ef)(Zd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Vi=te=null},ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(nn),r.__h=r.__h.filter(function(n){return!n.__||Ji(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ie.__e(n,r.__v)}}),Us&&Us(e,t)},ie.unmount=function(e){Ms&&Ms(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{nn(n)}catch(i){t=i}}),r.__H=void 0,t&&ie.__e(t,r.__v))};Fs=typeof requestAnimationFrame=="function"});function rf(e,t){for(var r in t)e[r]=t[r];return e}function $s(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Hs(e,t){this.props=e,this.context=t}function Zs(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=rf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Zs(n,t,r)})),e}function el(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return el(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function zi(){this.__u=0,this.o=null,this.__b=null}function tl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function un(){this.i=null,this.l=null}function Wi(e,t,r){return t.__k==null&&(t.textContent=""),ks(e,t),typeof r=="function"&&r(),e?e.__c:null}function df(){}function ff(){return this.cancelBubble}function hf(){return this.defaultPrevented}var qs,mg,nf,Gs,Ks,of,af,sf,lf,uf,cf,zs,rl,pf,Ws,Ys,Qs,nl=j(()=>{Wt();Wt();Ki();Ki();(Hs.prototype=new Ie).isPureReactComponent=!0,Hs.prototype.shouldComponentUpdate=function(e,t){return $s(this.props,e)||$s(this.state,t)};qs=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qs&&qs(e)};mg=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,nf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}nf(e,t,r,n)};Gs=M.unmount;M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Gs&&Gs(e)},(zi.prototype=new Ie).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=tl(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=el(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},zi.prototype.componentWillUnmount=function(){this.o=[]},zi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Zs(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Kt(Qe,null,e.fallback);return i&&(i.__u&=-33),[Kt(Qe,null,t.__a?null:e.children),i]};Ks=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(un.prototype=new Ie).__a=function(e){var t=this,r=tl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Ks(t,e,n)):i()};r?r(o):o()}},un.prototype.render=function(e){this.i=null,this.l=new Map;var t=zt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},un.prototype.componentDidUpdate=un.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Ks(e,r,t)})};of=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,af=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,sf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,lf=/[A-Z0-9]/g,uf=typeof document!="undefined",cf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Ie.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ie.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});zs=M.event;M.event=function(e){return zs&&(e=zs(e)),e.persist=df,e.isPropagationStopped=ff,e.isDefaultPrevented=hf,e.nativeEvent=e};pf={enumerable:!1,configurable:!0,get:function(){return this.class}},Ws=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||uf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||cf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":sf.test(a)&&(a=u):u=a="oninput":o&&af.test(a)?a=a.replace(lf,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=zt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=zt(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",pf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=of,Ws&&Ws(e)};Ys=M.__r;M.__r=function(e){Ys&&Ys(e),rl=e.__c};Qs=M.diffed;M.diffed=function(e){Qs&&Qs(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),rl=null}});function Oe(e,t,r){return(t=gf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gf(e){var t=yf(e,"string");return typeof t=="symbol"?t:t+""}function yf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cn(e,t,r){return(t=bf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bf(e){var t=Ef(e,"string");return typeof t=="symbol"?t:t+""}function Ef(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Of(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function kf(e){return typeof e=="string"}function Pf(e){return typeof e=="undefined"}function Df(e){return Pf(e)||e===null}function Nf(e){return typeof e=="function"}function xl(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function Yt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function hn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function jf(e){let t=e.location?hn(e.location,ll):null,r=e.target?hn(e.target,ll):null;return hn(Tf(Rf({},e),{location:t,target:r}),Bf)}function Vf(e){let t=e.events.map(n=>jf(n)),r=hn(e.device,Ff);return[e.protocolVersion,t,r,e.project]}function Jf(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Kf(e){return new Promise(t=>Pl(e)(t))}function Pl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function zf(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new tr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}function Yf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Qf(e[n],t[n])}function Qf(e,t){if(kf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Nf(t)){try{if(e instanceof t)return}catch(r){}if(!Df(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Qi(e,t,r){return(t=Xf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xf(e){var t=Zf(e,"string");return typeof t=="symbol"?t:t+""}function Zf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dn(e,t,r){return(t=eh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eh(e){var t=th(e,"string");return typeof t=="symbol"?t:t+""}function th(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $e(e,t,r){return(t=rh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rh(e){var t=nh(e,"string");return typeof t=="symbol"?t:t+""}function nh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ih(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function oh(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}function dh(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function Ll(e){return e.trim()}function fh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function fo(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function rr(e,t,r){return e.slice(t,r)}function Ne(e){return e.length}function Ao(e){return e.length}function fn(e,t){return t.push(e),e}function hh(e,t){return e.map(t).join("")}function Tn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Rn,column:At,length:a,return:""}}function Xt(e,t){return ch(Tn("",null,null,"",null,null,0),e,{length:-e.length},t)}function ph(){return ue}function mh(){return ue=Ae>0?he(It,--Ae):0,At--,ue===10&&(At=1,Rn--),ue}function Se(){return ue=Ae<Ul?he(It,Ae++):0,At++,ue===10&&(At=1,Rn++),ue}function Le(){return he(It,Ae)}function pn(){return Ae}function ir(e,t){return rr(It,e,t)}function nr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ml(e){return Rn=At=1,Ul=Ne(It=e),Ae=0,[]}function Bl(e){return It="",e}function mn(e){return Ll(ir(Ae-1,ho(e===91?e+2:e===40?e+1:e)))}function vh(e){for(;(ue=Le())&&ue<33;)Se();return nr(e)>2||nr(ue)>3?"":" "}function _h(e,t){for(;--t&&Se()&&!(ue<48||ue>102||ue>57&&ue<65||ue>70&&ue<97););return ir(e,pn()+(t<6&&Le()==32&&Se()==32))}function ho(e){for(;Se();)switch(ue){case e:return Ae;case 34:case 39:e!==34&&e!==39&&ho(ue);break;case 40:e===41&&ho(e);break;case 92:Se();break}return Ae}function gh(e,t){for(;Se()&&e+ue!==57&&!(e+ue===84&&Le()===47););return"/*"+ir(t,Ae-1)+"*"+Sn(e===47?e:Se())}function yh(e){for(;!nr(Le());)Se();return ir(e,Ae)}function bh(e){return Bl(vn("",null,null,null,[""],e=Ml(e),0,[0],e))}function vn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,_=0,v=0,E=0,w=1,x=1,b=1,C=0,P="",G=i,X=o,R=n,O=P;x;)switch(E=C,C=Se()){case 40:if(E!=108&&he(O,h-1)==58){fo(O+=$(mn(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:O+=mn(C);break;case 9:case 10:case 13:case 32:O+=vh(E);break;case 92:O+=_h(pn()-1,7);continue;case 47:switch(Le()){case 42:case 47:fn(Eh(gh(Se(),pn()),t,r),u);break;default:O+="/"}break;case 123*w:s[d++]=Ne(O)*b;case 125*w:case 59:case 0:switch(C){case 0:case 125:x=0;case 59+y:b==-1&&(O=$(O,/\f/g,"")),v>0&&Ne(O)-h&&fn(v>32?dl(O+";",n,r,h-1):dl($(O," ","")+";",n,r,h-2),u);break;case 59:O+=";";default:if(fn(R=cl(O,t,r,d,y,i,s,P,G=[],X=[],h),o),C===123)if(y===0)vn(O,t,R,R,G,o,h,s,X);else switch(_===99&&he(O,3)===110?100:_){case 100:case 108:case 109:case 115:vn(e,R,R,n&&fn(cl(e,R,R,0,0,i,s,P,i,G=[],h),X),i,X,h,s,n?G:X);break;default:vn(O,R,R,R,[""],X,0,s,X)}}d=y=v=0,w=b=1,P=O="",h=a;break;case 58:h=1+Ne(O),v=E;default:if(w<1){if(C==123)--w;else if(C==125&&w++==0&&mh()==125)continue}switch(O+=Sn(C),C*w){case 38:b=y>0?1:(O+="\f",-1);break;case 44:s[d++]=(Ne(O)-1)*b,b=1;break;case 64:Le()===45&&(O+=mn(Se())),_=Le(),y=h=Ne(P=O+=yh(pn())),C++;break;case 45:E===45&&Ne(O)==2&&(w=0)}}return o}function cl(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,_=i===0?o:[""],v=Ao(_),E=0,w=0,x=0;E<n;++E)for(var b=0,C=rr(e,h+1,h=uh(w=a[E])),P=e;b<v;++b)(P=Ll(w>0?_[b]+" "+C:$(C,/&\f/g,_[b])))&&(u[x++]=P);return Tn(e,t,r,i===0?Eo:s,u,d,y)}function Eh(e,t,r){return Tn(e,t,r,Dl,Sn(ph()),rr(e,2,-2),0)}function dl(e,t,r,n){return Tn(e,t,r,wo,rr(e,0,n),rr(e,n+1,-1),n)}function wt(e,t){for(var r="",n=Ao(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function wh(e,t,r,n){switch(e.type){case lh:if(e.children.length)break;case sh:case wo:return e.return=e.return||e.value;case Dl:return"";case Nl:return e.return=e.value+"{"+wt(e.children,n)+"}";case Eo:e.value=e.props.join(",")}return Ne(r=wt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ah(e){var t=Ao(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function Ih(e){return function(t){t.root||(t=t.return)&&e(t)}}function Sh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function Fl(e,t){switch(dh(e,t)){case 5103:return J+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return J+e+yn+e+_e+e+e;case 6828:case 4268:return J+e+_e+e+e;case 6165:return J+e+_e+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return J+e+_e+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+_e+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+_e+$(e,"shrink","negative")+e;case 5292:return J+e+_e+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+_e+$(e,"grow","positive")+e;case 4554:return J+$(e,/([^-])(transform)/g,"$1"+J+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,J+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ne(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+yn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fo(e,"stretch")?Fl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Ne(e)-3-(~fo(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(he(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+_e+e+e}return e}function Nh(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function bn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return Ze={name:i.name,styles:i.styles,next:Ze},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ze={name:a.name,styles:a.styles,next:Ze},a=a.next;var s=o.styles+";";return s}return Bh(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function Bh(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=bn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":hl(s)&&(n+=Xi(o)+":"+pl(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)hl(a[u])&&(n+=Xi(o)+":"+pl(o,a[u])+";");else{var d=bn(e,t,a);switch(o){case"animation":case"animationName":{n+=Xi(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}function Zi(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";Ze=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=bn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=bn(r,t,e[s]),n){var u=o;i+=u[s]}ml.lastIndex=0;for(var d="",y;(y=ml.exec(i))!==null;)d+="-"+y[1];var h=Nh(i)+d;return{name:h,styles:i,next:Ze}}function Vl(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}function vl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function _l(e,t,r){var n=[],i=Vl(e,n,r);return n.length<2?r:i+t(n)}function $l(e,t){le.__h&&le.__h(we,e,po||t),po=0;var r=we.__H||(we.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Hh(e,t){var r=$l(En++,3);!le.__s&&Hl(r.__H,t)&&(r.__=e,r.u=t,we.__H.__h.push(r))}function qh(e){return po=5,Io(function(){return{current:e}},[])}function Io(e,t){var r=$l(En++,7);return Hl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Gh(){for(var e;e=Jl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_n),e.__H.__h.forEach(mo),e.__H.__h=[]}catch(t){e.__H.__h=[],le.__e(t,e.__v)}}function Kh(e){var t,r=function(){clearTimeout(n),Sl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Sl&&(t=requestAnimationFrame(r))}function _n(e){var t=we,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),we=t}function mo(e){var t=we;e.__c=e.__(),we=t}function Hl(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function xn(){if(et>1)et--;else{for(var e,t=!1;Zt!==void 0;){var r=Zt;for(Zt=void 0,vo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Gl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(vo=0,et--,t)throw e}}function be(e){if(et>0)return e();et++;try{return e()}finally{xn()}}function ql(e){if(z!==void 0){var t=e.n;if(t===void 0||t.t!==z)return t={i:0,S:e,p:z.s,n:void 0,t:z,e:void 0,x:void 0,r:t},z.s!==void 0&&(z.s.n=t),z.s=t,e.n=t,32&z.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=z.s,t.n=void 0,z.s.n=t,z.s=t),t}}function pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function W(e){return new pe(e)}function Gl(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Kl(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function zl(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Rt(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=wn-1,this.f=4}function er(e){return new Rt(e)}function Wl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){et++;var r=z;z=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,So(e),n}finally{z=r,xn()}}}function So(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Wl(e)}function Wh(e){if(z!==this)throw new Error("Out-of-order effect");zl(this),z=e,this.f&=-2,8&this.f&&So(this),xn()}function or(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Tt(e){var t=new or(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function xt(e,t){M[e]=t.bind(null,M[e]||function(){})}function An(e){to&&to(),to=e&&e.S()}function Xl(e){var t=this,r=e.data,n=Zl(r);n.value=r;var i=Io(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=er(function(){var v=n.value.value;return v===0?0:v===!0?"":v||""}),y=er(function(){return!Array.isArray(d.value)&&!Ui(d.value)}),h=Tt(function(){if(this.N=eu,y.value){var v=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=v)}}),_=t.__$u.d;return t.__$u.d=function(){h(),_.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}function Yh(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=W(r);return{o:function(a,s){o.value=a,n=s},d:Tt(function(){this.N=eu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function Zl(e){return Io(function(){return W(e)},[])}function Zh(){be(function(){for(var e;e=Yl.shift();)Ro.call(e)})}function ep(){Yl.push(this)===1&&(M.requestAnimationFrame||Qh)(Zh)}function tp(){be(function(){for(var e;e=Ql.shift();)Ro.call(e)})}function eu(){Ql.push(this)===1&&(M.requestAnimationFrame||Xh)(tp)}function rp(e){var t=qh(e);t.current=e,Hh(function(){return Tt(function(){return this.N=ep,t.current()})},[])}function np(e,t){let r=qi(e);Hi(()=>{r.current=e},[e]),sn(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function oe(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ip,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return M.vnode&&M.vnode(d),d}function He(e,t,r){return(t=vp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vp(e){var t=_p(e,"string");return typeof t=="symbol"?t:t+""}function _p(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qe(e,t,r){return(t=Ep(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ep(e){var t=wp(e,"string");return typeof t=="symbol"?t:t+""}function wp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xe(e,t,r){return(t=Ap(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ap(e){var t=Ip(e,"string");return typeof t=="symbol"?t:t+""}function Ip(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var il,mf,vf,_f,ro,no,Rl,wf,Af,ol,If,Sf,al,Rf,Tf,xf,Tl,Cf,Lf,Uf,sl,Mf,Cl,Ol,kl,ll,Bf,Ff,io,ee,$f,Hf,Qt,tr,qf,ao,Gf,Yi,Wf,so,ul,lo,uo,co,ah,_e,yn,J,Dl,Eo,wo,sh,Nl,lh,uh,Sn,ch,Rn,At,Ul,Ae,ue,It,Rh,Th,xh,fl,Ch,Oh,kh,Ph,Dh,Lh,Uh,Mh,jl,hl,Xi,pl,ml,Ze,Fh,jh,Vh,Jh,$h,St,En,we,eo,gl,po,Jl,le,yl,bl,El,wl,Al,Il,Sl,zh,z,Zt,et,vo,wn,Ro,to,Yl,Ql,Qh,Xh,ge,ip,op,Ge,_o,go,gn,ap,sp,lp,up,cp,dp,fp,hp,pp,mp,yo,Et,bt,gp,yp,bp,bo,In,Eg,tu=j(()=>{"use strict";Wt();nl();il=Object.getOwnPropertySymbols,mf=Object.prototype.hasOwnProperty,vf=Object.prototype.propertyIsEnumerable,_f=(e,t)=>{var r={};for(var n in e)mf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&il)for(var n of il(e))t.indexOf(n)<0&&vf.call(e,n)&&(r[n]=e[n]);return r};ro=class{constructor(t){Oe(this,"context",void 0),Oe(this,"continueCallback",void 0),Oe(this,"isBeforeAdCalled",!1),Oe(this,"isBeforeRewardCalled",!1),Oe(this,"isAdDismissedCalled",!1),Oe(this,"isAdViewedCalled",!1),Oe(this,"isAfterAdCalled",!1),Oe(this,"currentProvider",void 0),Oe(this,"currentClientParams",void 0),Oe(this,"adsHasResponse",!1),Oe(this,"videoChecker",window.document.createElement("video")),Oe(this,"wrapShowAdFn",r=>()=>{this.adsHasResponse=!0;let n=!1;this.videoChecker.play().catch(()=>{n=!1}),n=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:n},this.paramsToTrack)),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t())}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.continueCallback)==null||a.call(this,[!1,r]);break}default:{(s=this.continueCallback)==null||s.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n){return L(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(i=>{this.continueCallback=i;let o;switch(r.type){case"preroll":{o={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{o={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{o={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var a,s,u,d;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(s=(a=this.currentProvider)==null?void 0:a.name)!=null?s:null}),(d=this.continueCallback)==null||d.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(u=r.name)!=null?u:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(o,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};no=class{constructor(t){cn(this,"context",void 0),cn(this,"adBreakIsShowing",!1),cn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),cn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}},Rl=Object.defineProperty,wf=Object.defineProperties,Af=Object.getOwnPropertyDescriptors,ol=Object.getOwnPropertySymbols,If=Object.prototype.hasOwnProperty,Sf=Object.prototype.propertyIsEnumerable,al=(e,t,r)=>t in e?Rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rf=(e,t)=>{for(var r in t||(t={}))If.call(t,r)&&al(e,r,t[r]);if(ol)for(var r of ol(t))Sf.call(t,r)&&al(e,r,t[r]);return e},Tf=(e,t)=>wf(e,Af(t)),xf=(e,t)=>{for(var r in t)Rl(e,r,{get:t[r],enumerable:!0})},Tl=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},Cf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Lf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Lf||{});Uf={log:Yt("log"),warn:Yt("warn"),info:Yt("info"),error:Yt("error"),debug:Yt("debug")};Object.assign(globalThis,{logger:Uf});sl=Symbol.for("Jolibox.canIUseMap"),Mf={};globalThis[sl]||(globalThis[sl]=Mf);Cl=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Cl||{}),Ol=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ol||{}),kl=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(kl||{}),ll=["name","params"],Bf=["name","type","location","target","extra","timestamp","userId"],Ff=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Jf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");io=class oo{constructor(t){this.element=t,this.next=oo.Undefined,this.prev=oo.Undefined}};io.Undefined=new io(void 0);ee=io,$f=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},Hf=0,Qt=class{constructor(e){this.value=e,this.id=Hf++}},tr=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Qt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new Qt(e);return this._listeners?this._listeners instanceof Qt?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,h,_;if(!this._disposed){if(this._listeners instanceof Qt)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let v=this._listeners.indexOf(u);v>=0&&(this._listeners.splice(v,1),this._size--,this._size===0&&((_=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||_.call(h)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Qt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},qf=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let i=(n=this.listeners.get(e))!=null?n:new tr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new $f,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ao={};xf(ao,{None:()=>Gf,filter:()=>zf,once:()=>Pl,toPromise:()=>Kf});Gf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Yi=Symbol.for("Jolibox.hostEmitter"),Wf=()=>{let e=new qf;return globalThis[Yi]||(globalThis[Yi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Yi]};Wf();so=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new tr,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Yf(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};so=Tl([xl],so);ul=class{constructor(){this._onWillExecuteCommand=new tr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new tr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new so,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Of(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Cf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ao.toPromise(ao.filter(this.registry.onDidRegisterCommand,i=>i===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};ul=Tl([xl],ul);lo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Qi(this,"context",void 0),Qi(this,"placement","GAME"),Qi(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:kl.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Cl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Ol.WebSDK};return Vf(i)}};uo=class{constructor(t){dn(this,"configs",null),dn(this,"firstRun",!0),dn(this,"context",void 0),dn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return L(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};co=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=_f(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>L(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:h,style:_}=n,v;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?v=document.querySelector(u):v=u,!v)throw new Error("targeting element not found");let E=d;if(E||(E=this.initParams.unitId),!E)throw new Error("slot is required");let w=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,x=document.createElement("ins");if(x.className="adsbygoogle",x.id="jolibox-ads",x.style.display="block",x.setAttribute("data-ad-client",this.initParams.clientId),x.setAttribute("data-ad-slot",E),w&&x.setAttribute("data-ad-format",w),h&&x.setAttribute("data-full-width-responsive",h),_&&x.setAttribute("style",_),(s=this.contextInfo.testAdsMode)!=null?s:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",x.style.position="relative",v.appendChild(x),x.appendChild(b)}else v.appendChild(x),new MutationObserver(b=>{b.forEach(C=>{if(C.type==="attributes"&&C.attributeName==="data-ad-status"){let P=x.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:P!=null?P:"null"})}})}).observe(x,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return L(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};ah=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(oh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=ih(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),_e="-ms-",yn="-moz-",J="-webkit-",Dl="comm",Eo="rule",wo="decl",sh="@import",Nl="@keyframes",lh="@layer",uh=Math.abs,Sn=String.fromCharCode,ch=Object.assign;Rn=1,At=1,Ul=0,Ae=0,ue=0,It="";Rh=function(e,t,r){for(var n=0,i=0;n=i,i=Le(),n===38&&i===12&&(t[r]=1),!nr(i);)Se();return ir(e,Ae)},Th=function(e,t){var r=-1,n=44;do switch(nr(n)){case 0:n===38&&Le()===12&&(t[r]=1),e[r]+=Rh(Ae-1,t,r);break;case 2:e[r]+=mn(n);break;case 4:if(n===44){e[++r]=Le()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Sn(n)}while(n=Se());return e},xh=function(e,t){return Bl(Th(Ml(e),t))},fl=new WeakMap,Ch=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!fl.get(r))&&!n){fl.set(e,!0);for(var i=[],o=xh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Oh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};kh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case wo:e.return=Fl(e.value,e.length);break;case Nl:return wt([Xt(e,{value:$(e.value,"@","@"+J)})],n);case Eo:if(e.length)return hh(e.props,function(i){switch(fh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wt([Xt(e,{props:[$(i,/:(read-\w+)/,":"+yn+"$1")]})],n);case"::placeholder":return wt([Xt(e,{props:[$(i,/:(plac\w+)/,":"+J+"input-$1")]}),Xt(e,{props:[$(i,/:(plac\w+)/,":"+yn+"$1")]}),Xt(e,{props:[$(i,/:(plac\w+)/,_e+"input-$1")]})],n)}return""})}},Ph=[kh],Dh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(E){var w=E.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var n=e.stylisPlugins||Ph,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(E){for(var w=E.getAttribute("data-emotion").split(" "),x=1;x<w.length;x++)i[w[x]]=!0;a.push(E)});var s,u=[Ch,Oh];{var d,y=[wh,Ih(function(E){d.insert(E)})],h=Ah(u.concat(n,y)),_=function(E){return wt(bh(E),h)};s=function(E,w,x,b){d=x,_(E?E+"{"+w.styles+"}":w.styles),b&&(v.inserted[w.name]=!0)}}var v={key:t,sheet:new ah({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return v.sheet.hydrate(a),v};Lh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Uh=/[A-Z]|^ms/g,Mh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jl=function(e){return e.charCodeAt(1)===45},hl=function(e){return e!=null&&typeof e!="boolean"},Xi=Sh(function(e){return jl(e)?e:e.replace(Uh,"-$&").toLowerCase()}),pl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Mh,function(r,n,i){return Ze={name:n,styles:i,next:Ze},n})}return Lh[e]!==1&&!jl(e)&&typeof t=="number"&&t!==0?t+"px":t};ml=/label:\s*([^\s;{]+)\s*(;|$)/g;Fh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},jh=function(e,t,r){Fh(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};Vh=function(e){var t=Dh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered,void 0);return jh(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered),y="animation-"+d.name;return vl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered);vl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return _l(t.registered,r,Jh(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Vl.bind(null,t.registered),merge:_l.bind(null,t.registered,r)}},Jh=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},$h=Vh({key:"css"}),St=$h.css,po=0,Jl=[],le=M,yl=le.__b,bl=le.__r,El=le.diffed,wl=le.__c,Al=le.unmount,Il=le.__;le.__b=function(e){we=null,yl&&yl(e)},le.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Il&&Il(e,t)},le.__r=function(e){bl&&bl(e),En=0;var t=(we=e.__c).__H;t&&(eo===we?(t.__h=[],we.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(_n),t.__h.forEach(mo),t.__h=[],En=0)),eo=we},le.diffed=function(e){El&&El(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Jl.push(t)!==1&&gl===le.requestAnimationFrame||((gl=le.requestAnimationFrame)||Kh)(Gh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),eo=we=null},le.__c=function(e,t){t.some(function(r){try{r.__h.forEach(_n),r.__h=r.__h.filter(function(n){return!n.__||mo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],le.__e(n,r.__v)}}),wl&&wl(e,t)},le.unmount=function(e){Al&&Al(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{_n(n)}catch(i){t=i}}),r.__H=void 0,t&&le.__e(t,r.__v))};Sl=typeof requestAnimationFrame=="function";zh=Symbol.for("preact-signals");z=void 0,Zt=void 0,et=0,vo=0,wn=0;pe.prototype.brand=zh;pe.prototype.h=function(){return!0};pe.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};pe.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};pe.prototype.subscribe=function(e){var t=this;return Tt(function(){var r=t.value,n=z;z=void 0;try{e(r)}finally{z=n}})};pe.prototype.valueOf=function(){return this.value};pe.prototype.toString=function(){return this.value+""};pe.prototype.toJSON=function(){return this.value};pe.prototype.peek=function(){var e=z;z=void 0;try{return this.value}finally{z=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=ql(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");this.v=e,this.i++,wn++,et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xn()}}}});(Rt.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wn))return!0;if(this.g=wn,this.f|=1,this.i>0&&!Gl(this))return this.f&=-2,!0;var e=z;try{Kl(this),z=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return z=e,zl(this),this.f&=-2,!0};Rt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}pe.prototype.S.call(this,e)};Rt.prototype.U=function(e){if(this.t!==void 0&&(pe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Rt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Rt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ql(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});or.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};or.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Wl(this),Kl(this),et++;var e=z;return z=this,Wh.bind(this,e)};or.prototype.N=function(){2&this.f||(this.f|=2,this.o=Zt,Zt=this)};or.prototype.d=function(){this.f|=8,1&this.f||So(this)};Yl=[],Ql=[];Tt(function(){Ro=this.N})();Xl.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Xl},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});xt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof pe&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});xt("__r",function(e,t){An();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Tt(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),An(r),e(t)});xt("__e",function(e,t,r,n){An(),e(t,r,n)});xt("diffed",function(e,t){An();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=Yh(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});xt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});xt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Ie.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};Qh=typeof requestAnimationFrame=="undefined"?setTimeout:function(e){var t=function(){clearTimeout(r),cancelAnimationFrame(n),e()},r=setTimeout(t,100),n=requestAnimationFrame(t)},Xh=function(e){queueMicrotask(function(){queueMicrotask(e)})};ge=St`
4
4
  inset: 0;
5
5
  clear: none;
6
6
  float: none;
@@ -18,8 +18,8 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
18
18
  text-decoration: none;
19
19
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
20
20
  'Helvetica Neue', sans-serif;
21
- `;Qh=0;Xh=tr`
22
- ${ye}
21
+ `;ip=0;op=St`
22
+ ${ge}
23
23
  position: fixed;
24
24
  top: 0;
25
25
  left: 0;
@@ -32,7 +32,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
32
32
  height: 100vh;
33
33
 
34
34
  .card-wrapper {
35
- ${ye}
35
+ ${ge}
36
36
  position: relative;
37
37
  display: flex;
38
38
  flex-direction: column;
@@ -46,7 +46,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
46
46
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
47
47
 
48
48
  .body {
49
- ${ye}
49
+ ${ge}
50
50
  display: flex;
51
51
  flex-direction: column;
52
52
  width: 100%;
@@ -55,7 +55,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
55
55
  box-sizing: border-box;
56
56
  justify-content: center;
57
57
  .title {
58
- ${ye}
58
+ ${ge}
59
59
  text-align: center;
60
60
  font-size: 16px;
61
61
  font-weight: bold;
@@ -63,7 +63,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
63
63
  }
64
64
 
65
65
  .content {
66
- ${ye}
66
+ ${ge}
67
67
  font-size: 14px;
68
68
  color: #888;
69
69
  margin-bottom: 16px;
@@ -71,13 +71,13 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
71
71
  }
72
72
 
73
73
  .footer {
74
- ${ye}
74
+ ${ge}
75
75
  display: flex;
76
76
  align-items: center;
77
77
  width: 100%;
78
78
  height: 40px;
79
79
  button {
80
- ${ye}
80
+ ${ge}
81
81
  border: none;
82
82
  outline: none;
83
83
  height: 100%;
@@ -93,8 +93,8 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
93
93
  }
94
94
  }
95
95
  }
96
- `,qe=de(null),fi=de(""),hi=de(""),fn=de(!1),Zh=()=>{var e;(e=qe.value)==null||e.call(qe,!1)},ep=()=>{var e;(e=qe.value)==null||e.call(qe,!0)},tp=e=>L(void 0,null,function*(){let{title:t,content:r}=e;return qe.value&&(qe.value(!1),Oe(()=>{qe.value=null,fn.value=!1})),Oe(()=>{fi.value=t||"",hi.value=r||"",fn.value=!0}),new Promise(n=>{qe.value=o=>{Oe(()=>{qe.value=null,fn.value=!1,fi.value="",hi.value=""}),n(o)}})}),rp=()=>fn.value?ue("div",{className:Xh,children:ue("div",{className:"card-wrapper",children:[ue("div",{className:"body",children:[ue("div",{className:"title",children:fi.value}),ue("div",{className:"content",children:hi.value})]}),ue("div",{className:"footer",children:[ue("button",{onClick:Zh,className:"cancel-btn",children:"Cancel"}),ue("button",{onClick:ep,className:"confirm-btm",children:"Confirm"})]})]})}):null,np=tr`
97
- ${ye}
96
+ `,Ge=W(null),_o=W(""),go=W(""),gn=W(!1),ap=()=>{var e;(e=Ge.value)==null||e.call(Ge,!1)},sp=()=>{var e;(e=Ge.value)==null||e.call(Ge,!0)},lp=e=>L(void 0,null,function*(){let{title:t,content:r}=e;return Ge.value&&(Ge.value(!1),be(()=>{Ge.value=null,gn.value=!1})),be(()=>{_o.value=t||"",go.value=r||"",gn.value=!0}),new Promise(n=>{Ge.value=i=>{be(()=>{Ge.value=null,gn.value=!1,_o.value="",go.value=""}),n(i)}})}),up=()=>gn.value?oe("div",{className:op,children:oe("div",{className:"card-wrapper",children:[oe("div",{className:"body",children:[oe("div",{className:"title",children:_o.value}),oe("div",{className:"content",children:go.value})]}),oe("div",{className:"footer",children:[oe("button",{onClick:ap,className:"cancel-btn",children:"Cancel"}),oe("button",{onClick:sp,className:"confirm-btm",children:"Confirm"})]})]})}):null,cp=St`
97
+ ${ge}
98
98
  position: relative;
99
99
  display: flex;
100
100
  align-items: center;
@@ -112,7 +112,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
112
112
  }
113
113
 
114
114
  button {
115
- ${ye}
115
+ ${ge}
116
116
  padding: 0 20px;
117
117
  height: 30px;
118
118
  line-height: 30px;
@@ -126,8 +126,8 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
126
126
  cursor: not-allowed;
127
127
  }
128
128
  }
129
- `,op=()=>{let e=de(!1),t=de(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Oe(()=>{t.value=Date.now(),e.value=!1})}}},ip=e=>{let{countdown:t=0,mode:r,onClose:n,state:o}=e,{startTimestamp:i,timerPaused:a}=o,l=Gl(t);zh(()=>{i.value&&(l.value=t)}),Yh(()=>{l.value>0?l.value-=1:Oe(()=>{a.value=!0,l.value=0})},a.value?null:1e3);let c=Yt(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!i.value)return!1;let _=Date.now()-i.value;return l.value>0&&t-l.value>=5&&_>=5e3}),f=Yt(()=>{if(r==="interstitial")return!0;if(!i.value)return!1;let _=Date.now()-i.value;return l.value<=0&&_>=(t-1)*1e3&&t>5}),y=Yt(()=>r==="interstitial"?!1:!c.value&&!f.value),p=()=>L(void 0,null,function*(){if(a.value=!0,!(yield tp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Oe(()=>{a.value=!0,l.value=0,i.value=null})}),g=()=>{n("viewed"),Oe(()=>{a.value=!0,l.value=0,i.value=null})};return ue("div",{className:np,children:[l.value>0&&r!=="interstitial"&&ue("div",{className:"timer",children:[l.value,"s"]}),ue("button",{onClick:c.value?p:f.value?g:void 0,disabled:y.value,children:ue("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ue("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},ap=()=>{let e=de(),t=de(),r=de(),n=de(),o=de(),i=de(!1),a=de(15),l=de(""),c=de("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:o,visible:i,countdown:a,src:l,mode:c}},sp=tr`
130
- ${ye}
129
+ `,dp=()=>{let e=W(!1),t=W(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{be(()=>{t.value=Date.now(),e.value=!1})}}},fp=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=Zl(t);rp(()=>{o.value&&(s.value=t)}),np(()=>{s.value>0?s.value-=1:be(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=er(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let v=Date.now()-o.value;return s.value>0&&t-s.value>=5&&v>=5e3}),d=er(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let v=Date.now()-o.value;return s.value<=0&&v>=(t-1)*1e3&&t>5}),y=er(()=>r==="interstitial"?!1:!u.value&&!d.value),h=()=>L(void 0,null,function*(){if(a.value=!0,!(yield lp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),be(()=>{a.value=!0,s.value=0,o.value=null})}),_=()=>{n("viewed"),be(()=>{a.value=!0,s.value=0,o.value=null})};return oe("div",{className:cp,children:[s.value>0&&r!=="interstitial"&&oe("div",{className:"timer",children:[s.value,"s"]}),oe("button",{onClick:u.value?h:d.value?_:void 0,disabled:y.value,children:oe("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:oe("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},hp=()=>{let e=W(),t=W(),r=W(),n=W(),i=W(),o=W(!1),a=W(15),s=W(""),u=W("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},pp=St`
130
+ ${ge}
131
131
  position: fixed;
132
132
  z-index: 2147483647;
133
133
  background: white;
@@ -137,7 +137,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
137
137
  flex-direction: column;
138
138
 
139
139
  iframe {
140
- ${ye}
140
+ ${ge}
141
141
  flex: 1;
142
142
  position: relative;
143
143
  display: block;
@@ -145,8 +145,27 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  }
148
- `,lp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:o,adBreakDone:i,adLoaded:a,visible:l,countdown:c,src:f,mode:y}=t,p=tn(()=>op(),[]),g=w=>{var I,C,b,k;l.value=!1,w==="dismiss"?(I=n.value)==null||I.call(n):w==="viewed"&&((C=o.value)==null||C.call(o)),(b=r.value)==null||b.call(r),(k=i.value)==null||k.call(i)},_=()=>{var w;(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{p.startTimer()},100),(w=a.value)==null||w.call(a)};return l.value?ue("div",{className:sp,children:[ue(ip,{mode:y.value,onClose:g,countdown:c.value,state:p}),l.value&&ue("iframe",{src:f.value,onLoad:_,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),ue(rp,{})]}):null};pi=class{constructor(t,r){He(this,"name","OKSPIN"),He(this,"initialized",!1),He(this,"initCompleter",null),He(this,"context",void 0),He(this,"initParams",void 0),He(this,"adsOverlay",null),He(this,"adsIsShowing",!1),He(this,"lastUnDisplayedAdBreak",null),He(this,"state",ap()),this.context=t,this.initParams=r}init(){return L(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Ws(ue(lp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return L(this,null,function*(){var n,o,i,a,l,c,f,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let p=()=>{var _;this.adsIsShowing=!1,(_=t.afterAd)==null||_.call(t)},g=()=>{var _;this.adsIsShowing=!1,(_=t.adBreakDone)==null||_.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Oe(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=g,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((c=(l=this.lastUnDisplayedAdBreak).adBreakDone)==null||c.call(l,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(f=t.beforeAd)==null||f.call(t);let p=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},g={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},_=()=>{var b;this.adsIsShowing=!1,g.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,g.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},I=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,g)};Oe(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=_,this.state.adViewed.value=w,this.state.adBreakDone.value=I});let C=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Oe(()=>{var k;this.state.countdown.value=(k=r.params.countdown)!=null?k:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}})}};gn=class{constructor(t){if(Qe(this,"context",void 0),Qe(this,"contextInfo",void 0),Qe(this,"providers",{}),Qe(this,"channelPolicy",void 0),Qe(this,"adsActionDetection",void 0),Qe(this,"adsTrackSerializer",void 0),Qe(this,"initialized",!1),Qe(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new ii(this.context),this.adsActionDetection=new Zo(this.context),this.adsTrackSerializer=new oi(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand"}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return L(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":{let o=new ai(this.context,n.params);yield o.init(),this.providers.ADSENSE=o;break}case"OKSPIN":{let o=new pi(this.context,n.params);yield o.init(),this.providers.OKSPIN=o;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return L(this,null,function*(){var r,n,o,i,a,l,c,f,y;if(Date.now()-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:p,code:g}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(g!=="SUCCESS"){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let _=p;if(_.length===0){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let w=!0,I=null,C=new Xo(this.context);for((l=this.context.eventEmitter)==null||l.emit("isAdShowing",!0),this.adsActionDetection.adBreakIsShowing=!0;_.length>0;){let b=_.shift(),k=this.providers[b.provider];if(k){let[N,q]=yield C.callAdBreakAndContinue(k,t,b);w=N,I=q}else w=!0,I={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!w)break}w&&I&&((c=t.adBreakDone)==null||c.call(t,I))}}catch(p){(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{(y=this.context.eventEmitter)==null||y.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},cg=tr`
149
- ${ye}
148
+ `,mp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,h=ln(()=>dp(),[]),_=E=>{var w,x,b,C;s.value=!1,E==="dismiss"?(w=n.value)==null||w.call(n):E==="viewed"&&((x=i.value)==null||x.call(i)),(b=r.value)==null||b.call(r),(C=o.value)==null||C.call(o)},v=()=>{var E;(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100),(E=a.value)==null||E.call(a)};return s.value?oe("div",{className:pp,children:[oe(fp,{mode:y.value,onClose:_,countdown:u.value,state:h}),s.value&&oe("iframe",{src:d.value,onLoad:v,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),oe(up,{})]}):null};yo=class{constructor(t,r){He(this,"name","OKSPIN"),He(this,"initialized",!1),He(this,"initCompleter",null),He(this,"context",void 0),He(this,"initParams",void 0),He(this,"adsOverlay",null),He(this,"adsIsShowing",!1),He(this,"lastUnDisplayedAdBreak",null),He(this,"state",hp()),this.context=t,this.initParams=r}init(){return L(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Wi(oe(mp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return L(this,null,function*(){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let h=()=>{var v;this.adsIsShowing=!1,(v=t.afterAd)==null||v.call(t)},_=()=>{var v;this.adsIsShowing=!1,(v=t.adBreakDone)==null||v.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};be(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=_,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let h=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},_={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},v=()=>{var b;this.adsIsShowing=!1,_.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},E=()=>{var b;this.adsIsShowing=!1,_.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,_)};be(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=v,this.state.adViewed.value=E,this.state.adBreakDone.value=w});let x=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,be(()=>{var C;this.state.countdown.value=(C=r.params.countdown)!=null?C:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,x);break}}})}},Et={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Et[e.data.type]&&Et[e.data.type].forEach(t=>{t(e.data.data)})});bt=(e,t)=>{sn(()=>(Et[e]||(Et[e]=new Set),Et[e].add(t),()=>{Et[e].delete(t)}),[e,t])},gp=()=>{let e=W(),t=W(),r=W(),n=W(),i=W(),o=W(),a=W(),s=W(!1),u=W("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},yp=St`
149
+ ${ge}
150
+ position: fixed;
151
+ z-index: 2147483647;
152
+ background: white;
153
+ width: 100vw;
154
+ height: 100vh;
155
+ display: flex;
156
+ flex-direction: column;
157
+
158
+ iframe {
159
+ ${ge}
160
+ flex: 1;
161
+ position: relative;
162
+ display: block;
163
+ background: white;
164
+ width: 100%;
165
+ height: 100%;
166
+ }
167
+ `,bp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,h]=$i(!1),_=E=>{var w,x,b,C;h(!1),u.value=!1,E==="dismiss"?(w=n.value)==null||w.call(n):E==="viewed"&&((x=i.value)==null||x.call(i)),(b=r.value)==null||b.call(r),(C=o.value)==null||C.call(o)},v=()=>{var E;(E=a.value)==null||E.call(a)};return bt("appsrockets_ad_dismissed",()=>_("dismiss")),bt("appsrockets_ad_rewarded",()=>_("viewed")),bt("appsrockets_ad_completed",()=>_("viewed")),bt("appsrockets_ad_skipped",()=>_("viewed")),bt("appsrockets_ad_clicked",E=>{var w;return(w=s.value)==null?void 0:w.call(s,E)}),bt("appsrockets_ad_loaded",()=>h(!0)),u.value?oe("div",{className:yp,style:{display:y?"flex":"none"},children:u.value&&oe("iframe",{src:d.value,onLoad:v,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};bo=class{constructor(t,r){qe(this,"name","APPSROCKETS"),qe(this,"initialized",!1),qe(this,"initCompleter",null),qe(this,"context",void 0),qe(this,"adsOverlay",null),qe(this,"adsIsShowing",!1),qe(this,"lastUnDisplayedAdBreak",null),qe(this,"state",gp()),qe(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return L(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Wi(oe(bp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){var n,i,o,a,s,u,d,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let h=_=>{var v,E;(E=(v=this.context).handleLinkClicked)==null||E.call(v,_)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let _=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},v=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},E=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};be(()=>{this.adsIsShowing=!0,this.state.afterAd.value=_,this.state.adBreakDone.value=v,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=E,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let _=()=>{var P;this.adsIsShowing=!1,(P=t.afterAd)==null||P.call(t)},v={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},E=()=>{var P;this.adsIsShowing=!1,v.breakStatus="dismissed",(P=t.adDismissed)==null||P.call(t)},w=()=>{var P;this.adsIsShowing=!1,v.breakStatus="viewed",(P=t.adViewed)==null||P.call(t)},x=()=>{var P;this.adsIsShowing=!1,(P=t.adBreakDone)==null||P.call(t,v)},b=()=>{this.adsIsShowing=!1,v.breakStatus="noAdPreloaded"};be(()=>{this.state.afterAd.value=_,this.state.adDismissed.value=E,this.state.adViewed.value=w,this.state.adBreakDone.value=x,this.state.adLinkClicked.value=h,this.state.adError.value=b});let C=()=>{var P;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(P=t.adBreakDone)==null||P.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,be(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}}};In=class{constructor(t){if(Xe(this,"context",void 0),Xe(this,"contextInfo",void 0),Xe(this,"providers",{}),Xe(this,"channelPolicy",void 0),Xe(this,"adsActionDetection",void 0),Xe(this,"adsTrackSerializer",void 0),Xe(this,"initialized",!1),Xe(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new uo(this.context),this.adsActionDetection=new no(this.context),this.adsTrackSerializer=new lo(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return L(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":{let i=new co(this.context,n.params);yield i.init(),this.providers.ADSENSE=i;break}case"OKSPIN":{let i=new yo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new bo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return L(this,null,function*(){var r,n,i,o,a,s,u,d,y;if(Date.now()-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:h,code:_}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(_!=="SUCCESS"){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let v=h==null?void 0:h.sort((b,C)=>b.seq-C.seq);if(v.length===0){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let E=!0,w=null,x=new ro(this.context);for((s=this.context.eventEmitter)==null||s.emit("isAdShowing",!0),this.adsActionDetection.adBreakIsShowing=!0;v.length>0;){let b=v.shift(),C=this.providers[b.provider];if(C){let[P,G]=yield x.callAdBreakAndContinue(C,t,b);E=P,w=G}else E=!0,w={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!E)break}E&&w&&((u=t.adBreakDone)==null||u.call(t,w))}}catch(h){(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{(y=this.context.eventEmitter)==null||y.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},Eg=St`
168
+ ${ge}
150
169
  position: fixed;
151
170
  left: 0;
152
171
  top: 0;
@@ -161,7 +180,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
161
180
  }
162
181
 
163
182
  .ads-wrapper {
164
- ${ye}
183
+ ${ge}
165
184
  position: relative;
166
185
  width: 100%;
167
186
  height: 100%;
@@ -184,7 +203,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
184
203
  }
185
204
 
186
205
  .retry-button {
187
- ${ye}
206
+ ${ge}
188
207
  position: absolute;
189
208
  width: 100%;
190
209
  height: 100%;
@@ -194,7 +213,7 @@ or `);this.errors.push(i)}return n}},Pr=class extends oe{constructor(...t){super
194
213
  cursor: pointer;
195
214
  }
196
215
  }
197
- `});var Ql=sr(Yl=>{"use strict";it();xo();K();var zl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};To("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",zl[e.result],e.result),ce.emit(Hr,{useModalResult:zl[e.result]})});ce.on($r,(e,t)=>{var r;pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})});To("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ce.emit(Jr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ce.on(Vr,(e,t)=>L(Yl,null,function*(){var r;pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:dt()})}))});var eu=sr(Ei=>{"use strict";rt();K();Mt();xo();us();Wl();ge();var Ng=lr(Ql()),In=xe(),Xl=new Pe,An=Be.create(),hp={httpClient:An,checkNetwork:()=>Be.getNetworkStatus(),track:De,eventEmitter:Xl,getContextInfo:()=>{var e,t,r,n,o,i,a,l;return{hostAppId:(t=(e=P.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=P.deviceInfo.did)!=null?r:"",adId:(n=P.deviceInfo.adId)!=null?n:"",sessionId:(o=P.sessionId)!=null?o:"",userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",objectType:"GAME",objectId:P.mpId,testAdsMode:P.testAdsMode,channel:(l=P.joliSource)!=null?l:"",deviceBrand:P.deviceInfo.brand,deviceModel:P.deviceInfo.model,osType:Se.isAndroid?"ANDROID":Se.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3}}},Zl=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},nr=new gn(hp);ze.registerRewardHandler("ADS",es(nr));ze.registerRewardHandler("JOLI_COIN",is(An,{onUnlockSuccess:Zl.bind(Ei)}));ze.registerRewardHandler("JOLI_COIN_ONLY",ss(An,{onUnlockSuccess:Zl.bind(Ei)}));Xl.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});In.registerCommand("AdsSDK.init",e=>{nr.init(e)});In.registerCommand("AdsSDK.adConfig",e=>{nr.adConfig(e)});In.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?ze.getRewardsTypes(An).then(t=>{ze.handleReward(t,e).catch(r=>{var n;console.info("handleReward failed",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})})}):nr.adBreak(e)});In.registerCommand("AdsSDK.adUnit",e=>{nr.adUnit(e)})});rt();ge();Ft();K();var ja=xe(),_d="env",gd="getSystemInfoSync",yd=()=>{var o,i,a,l;let e={system:P.deviceInfo.system,platform:P.deviceInfo.platform.toLowerCase(),brand:P.deviceInfo.brand,pixelRatio:P.deviceInfo.pixelRatio,language:P.deviceInfo.lang,version:P.sdkInfo.jssdkVersion,appName:(o=P.hostInfo)==null?void 0:o.appName,SDKVersion:P.sdkInfo.nativeSDKVersion},t=(i=P.hostInfo)==null?void 0:i.version;t&&(e=pe(Y({},e),{version:t}));let r=(a=P.hostInfo)==null?void 0:a.appName;r&&(e=pe(Y({},e),{appName:r}));let n=(l=P.sdkInfo)==null?void 0:l.jssdkVersion;return n&&(e=pe(Y({},e),{SDKVersion:n})),e},bd=nt(gd,{implement:yd}),Ed=nt(_d,{implement:()=>pe(Y({},P.hostInfo),{sdkInfo:P.sdkInfo,platform:P.platform,deviceInfo:P.deviceInfo})});ja.registerCommand("API.env",Ed);ja.registerCommand("API.getSystemInfoSync",bd);me("env",{version:"1.0.0"});me("getSystemInfoSync",{version:"1.0.0"});K();Ft();We();rt();var wd="onJoliboxShow",Id="onJoliboxHide",Ad="onReady",Eo=xe(),wo=ca(ke),bo=!0,Bt=!0,Ur=0,Mr=ho;function Rd(){let e=Date.now();if(e-Ur<100)return;Ur=e;let t=document.visibilityState==="visible";t!==bo&&(bo=t,Mr.emit("visible",bo))}function Va(e){let t=Date.now();t-Ur<100||(Ur=t,e==="focus"&&!Bt?Bt=!0:e==="blur"&&Bt&&(Bt=!1),Mr.emit("visible",Bt))}document.addEventListener("visibilitychange",Rd);window.addEventListener("focus",()=>Va("focus"));window.addEventListener("blur",()=>Va("blur"));var Sd=nt(wd,{paramsSchema:F.tuple(F.function()),implement(e){let t=wo(e);Mr.on("visible",r=>{r&&t()})}}),Td=nt(Id,{paramsSchema:F.tuple(F.function()),implement(e){let t=wo(e);Mr.on("visible",r=>{!r&&t()})}}),xd=nt(Ad,{paramsSchema:F.tuple(F.function()),implement(e){let t=wo(e);Ut.on("LifecycleEvent.onReady",r=>{t(r)})}});Eo.registerCommand("LifecycleSDK.onReady",xd);Eo.registerCommand("LifecycleSDK.onJoliboxShow",Sd);Eo.registerCommand("LifecycleSDK.onJoliboxHide",Td);me("lifeCycle.onReady",{version:"1.0.0"});me("lifeCycle.onJoliboxShow",{version:"1.0.0"});me("lifeCycle.onJoliboxHide",{version:"1.0.0"});Ft();K();Mt();ge();var Ha=lr($a());var Fr=xe(),Ao=class{constructor(){this.httpClient=Be.create({baseUrl:P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>P.mpId;this.getItem=t=>L(this,null,function*(){let{code:r,data:n,message:o}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=n==null?void 0:n.value,a=o;return r!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),a+="fallback to localstorage"),{code:r,message:a,data:i&&i!=="undefined"?i:null}});this.setItem=(t,r)=>L(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:o,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:o,message:i}});this.removeItem=t=>L(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>L(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Ha.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Br=new Ao,Cd=Ve("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return L(this,null,function*(){return yield Br.getItem(e)})}});Fr.registerCommand("StorageSDK.getItem",Cd);me("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Od=Ve("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return L(this,null,function*(){return yield Br.setItem(e,t)})}});Fr.registerCommand("StorageSDK.setItem",Od);me("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var kd=Ve("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return L(this,null,function*(){return yield Br.removeItem(e)})}});Fr.registerCommand("StorageSDK.removeItem",kd);me("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Pd=Ve("clearStorage",{implement(){return L(this,null,function*(){return yield Br.clear()})}});Fr.registerCommand("StorageSDK.clear",Pd);me("storage.clear",{version:"1.0.0"});var Bg=lr(qa()),jg=lr(eu());K();rt();var au=-1,Sn=function(e){addEventListener("pageshow",function(t){t.persisted&&(au=t.timeStamp,e(t))},!0)},Ii=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Tn=function(){var e=Ii();return e&&e.activationStart||0},Rt=function(e,t){var r=Ii(),n="navigate";return au>=0?n="back-forward-cache":r&&(document.prerendering||Tn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},su=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(o){Promise.resolve().then(function(){t(o.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(o){}},St=function(e,t,r,n){var o,i;return function(a){t.value>=0&&(a||n)&&((i=t.value-(o||0))||o===void 0)&&(o=t.value,t.delta=i,t.rating=function(l,c){return l>c[1]?"poor":l>c[0]?"needs-improvement":"good"}(t.value,r),e(t))}},lu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},uu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},cu=function(e){var t=!1;return function(){t||(e(),t=!0)}},At=-1,tu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Rn=function(e){document.visibilityState==="hidden"&&At>-1&&(At=e.type==="visibilitychange"?e.timeStamp:0,pp())},ru=function(){addEventListener("visibilitychange",Rn,!0),addEventListener("prerenderingchange",Rn,!0)},pp=function(){removeEventListener("visibilitychange",Rn,!0),removeEventListener("prerenderingchange",Rn,!0)},du=function(){return At<0&&(At=tu(),ru(),Sn(function(){setTimeout(function(){At=tu(),ru()},0)})),{get firstHiddenTime(){return At}}},Ai=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},nu=[1800,3e3],fu=function(e,t){t=t||{},Ai(function(){var r,n=du(),o=Rt("FCP"),i=su("paint",function(a){a.forEach(function(l){l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(o.value=Math.max(l.startTime-Tn(),0),o.entries.push(l),r(!0)))})});i&&(r=St(e,o,nu,t.reportAllChanges),Sn(function(a){o=Rt("FCP"),r=St(e,o,nu,t.reportAllChanges),lu(function(){o.value=performance.now()-a.timeStamp,r(!0)})}))})};var mp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=cu(e),document.visibilityState==="hidden"?e():(r=t(e),uu(e)),r};var ou=[2500,4e3],wi={},hu=function(e,t){t=t||{},Ai(function(){var r,n=du(),o=Rt("LCP"),i=function(c){t.reportAllChanges||(c=c.slice(-1)),c.forEach(function(f){f.startTime<n.firstHiddenTime&&(o.value=Math.max(f.startTime-Tn(),0),o.entries=[f],r())})},a=su("largest-contentful-paint",i);if(a){r=St(e,o,ou,t.reportAllChanges);var l=cu(function(){wi[o.id]||(i(a.takeRecords()),a.disconnect(),wi[o.id]=!0,r(!0))});["keydown","click"].forEach(function(c){addEventListener(c,function(){return mp(l)},{once:!0,capture:!0})}),uu(l),Sn(function(c){o=Rt("LCP"),r=St(e,o,ou,t.reportAllChanges),lu(function(){o.value=performance.now()-c.timeStamp,wi[o.id]=!0,r(!0)})})}})},iu=[800,1800],vp=function e(t){document.prerendering?Ai(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},pu=function(e,t){t=t||{};var r=Rt("TTFB"),n=St(e,r,iu,t.reportAllChanges);vp(function(){var o=Ii();o&&(r.value=Math.max(o.responseStart-Tn(),0),r.entries=[o],n(!0),Sn(function(){r=Rt("TTFB",0),(n=St(e,r,iu,t.reportAllChanges))(!0)}))})};ge();function _p(){fu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),hu(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),pu(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function gp(){Ut.on("onDocumentReady",e=>{Ut.emit("LifecycleEvent.onReady",{isLogin:!1}),P.mpType==="game"&&tt.start(Date.now()-e)})}function mu(){gp(),_p()}mu();
216
+ `});var iu=cr(nu=>{"use strict";at();Di();q();var ru={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Pi("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",ru[e.result],e.result),fe.emit(Kr,{useModalResult:ru[e.result]})});fe.on(Gr,(e,t)=>{var r;mt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})});Pi("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(qr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(Hr,(e,t)=>L(nu,null,function*(){var r;mt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})}))});var su=cr(To=>{"use strict";nt();q();Jt();Di();ms();tu();Ee();var qg=dr(iu()),Cn=Ce(),ou=new Pe,On=Fe.create(),Sp={httpClient:On,checkNetwork:()=>Fe.getNetworkStatus(),track:De,eventEmitter:ou,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=D.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=D.deviceInfo.did)!=null?r:"",adId:(n=D.deviceInfo.adId)!=null?n:"",sessionId:(i=D.sessionId)!=null?i:"",userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:D.mpId,testAdsMode:D.testAdsMode,channel:(s=D.joliSource)!=null?s:"",deviceBrand:D.deviceInfo.brand,deviceModel:D.deviceInfo.model,osType:ye.isAndroid?"ANDROID":ye.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=D.joliSource)!=null?u:""}}},au=e=>{mt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},ar=new In(Sp);Ye.registerRewardHandler("ADS",as(ar));Ye.registerRewardHandler("JOLI_COIN",ds(On,{onUnlockSuccess:au.bind(To)}));Ye.registerRewardHandler("JOLI_COIN_ONLY",hs(On,{onUnlockSuccess:au.bind(To)}));ou.on("isAdShowing",e=>{mt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Cn.registerCommand("AdsSDK.init",e=>{ar.init(e)});Cn.registerCommand("AdsSDK.adConfig",e=>{ar.adConfig(e)});Cn.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?Ye.getRewardsTypes(On).then(t=>{Ye.handleReward(t,e).catch(r=>{var n;console.info("handleReward failed",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})})}):ar.adBreak(e)});Cn.registerCommand("AdsSDK.adUnit",e=>{ar.adUnit(e)})});nt();Ee();$t();q();var Ga=Ce(),Id="env",Sd="getSystemInfoSync",Rd=()=>{var i,o,a,s;let e={system:D.deviceInfo.system,platform:D.deviceInfo.platform.toLowerCase(),brand:D.deviceInfo.brand,pixelRatio:D.deviceInfo.pixelRatio,language:D.deviceInfo.lang,version:D.sdkInfo.jssdkVersion,appName:(i=D.hostInfo)==null?void 0:i.appName,SDKVersion:D.sdkInfo.nativeSDKVersion},t=(o=D.hostInfo)==null?void 0:o.version;t&&(e=me(Q({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=me(Q({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=me(Q({},e),{SDKVersion:n})),e},Td=it(Sd,{implement:Rd}),xd=it(Id,{implement:()=>me(Q({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});Ga.registerCommand("API.env",xd);Ga.registerCommand("API.getSystemInfoSync",Td);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});q();$t();We();nt();var Cd="onJoliboxShow",Od="onJoliboxHide",kd="onReady",Ri=Ce(),Ti=va(ke),Si=!0,Ht=!0,Fr=0,jr=gi;function Pd(){let e=Date.now();if(e-Fr<100)return;Fr=e;let t=document.visibilityState==="visible";t!==Si&&(Si=t,jr.emit("visible",Si))}function Ka(e){let t=Date.now();t-Fr<100||(Fr=t,e==="focus"&&!Ht?Ht=!0:e==="blur"&&Ht&&(Ht=!1),jr.emit("visible",Ht))}document.addEventListener("visibilitychange",Pd);window.addEventListener("focus",()=>Ka("focus"));window.addEventListener("blur",()=>Ka("blur"));var Dd=it(Cd,{paramsSchema:B.tuple(B.function()),implement(e){let t=Ti(e);jr.on("visible",r=>{r&&t()})}}),Nd=it(Od,{paramsSchema:B.tuple(B.function()),implement(e){let t=Ti(e);jr.on("visible",r=>{!r&&t()})}}),Ld=it(kd,{paramsSchema:B.tuple(B.function()),implement(e){let t=Ti(e);Vt.on("LifecycleEvent.onReady",r=>{t(r)})}});Ri.registerCommand("LifecycleSDK.onReady",Ld);Ri.registerCommand("LifecycleSDK.onJoliboxShow",Dd);Ri.registerCommand("LifecycleSDK.onJoliboxHide",Nd);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});$t();q();Jt();Ee();var Ya=dr(Wa());var Vr=Ce(),Ci=class{constructor(){this.httpClient=Fe.create({baseUrl:D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>D.mpId;this.getItem=t=>L(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>L(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>L(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>L(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Ya.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Jr=new Ci,Ud=Ve("getLocalStorage",{paramsSchema:B.tuple(B.string()),implement(e){return L(this,null,function*(){return yield Jr.getItem(e)})}});Vr.registerCommand("StorageSDK.getItem",Ud);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Md=Ve("setStorage",{paramsSchema:B.tuple(B.string(),B.or(B.string(),B.boolean(),B.number())),implement(e,t){return L(this,null,function*(){return yield Jr.setItem(e,t)})}});Vr.registerCommand("StorageSDK.setItem",Md);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Bd=Ve("removeStorage",{paramsSchema:B.tuple(B.string()),implement(e){return L(this,null,function*(){return yield Jr.removeItem(e)})}});Vr.registerCommand("StorageSDK.removeItem",Bd);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Fd=Ve("clearStorage",{implement(){return L(this,null,function*(){return yield Jr.clear()})}});Vr.registerCommand("StorageSDK.clear",Fd);ve("storage.clear",{version:"1.0.0"});var Yg=dr(Qa()),Qg=dr(su());q();nt();var hu=-1,Pn=function(e){addEventListener("pageshow",function(t){t.persisted&&(hu=t.timeStamp,e(t))},!0)},Co=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Dn=function(){var e=Co();return e&&e.activationStart||0},Ot=function(e,t){var r=Co(),n="navigate";return hu>=0?n="back-forward-cache":r&&(document.prerendering||Dn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},pu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},kt=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},mu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},vu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},_u=function(e){var t=!1;return function(){t||(e(),t=!0)}},Ct=-1,lu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},kn=function(e){document.visibilityState==="hidden"&&Ct>-1&&(Ct=e.type==="visibilitychange"?e.timeStamp:0,Rp())},uu=function(){addEventListener("visibilitychange",kn,!0),addEventListener("prerenderingchange",kn,!0)},Rp=function(){removeEventListener("visibilitychange",kn,!0),removeEventListener("prerenderingchange",kn,!0)},gu=function(){return Ct<0&&(Ct=lu(),uu(),Pn(function(){setTimeout(function(){Ct=lu(),uu()},0)})),{get firstHiddenTime(){return Ct}}},Oo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},cu=[1800,3e3],yu=function(e,t){t=t||{},Oo(function(){var r,n=gu(),i=Ot("FCP"),o=pu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Dn(),0),i.entries.push(s),r(!0)))})});o&&(r=kt(e,i,cu,t.reportAllChanges),Pn(function(a){i=Ot("FCP"),r=kt(e,i,cu,t.reportAllChanges),mu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Tp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=_u(e),document.visibilityState==="hidden"?e():(r=t(e),vu(e)),r};var du=[2500,4e3],xo={},bu=function(e,t){t=t||{},Oo(function(){var r,n=gu(),i=Ot("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Dn(),0),i.entries=[d],r())})},a=pu("largest-contentful-paint",o);if(a){r=kt(e,i,du,t.reportAllChanges);var s=_u(function(){xo[i.id]||(o(a.takeRecords()),a.disconnect(),xo[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return Tp(s)},{once:!0,capture:!0})}),vu(s),Pn(function(u){i=Ot("LCP"),r=kt(e,i,du,t.reportAllChanges),mu(function(){i.value=performance.now()-u.timeStamp,xo[i.id]=!0,r(!0)})})}})},fu=[800,1800],xp=function e(t){document.prerendering?Oo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Eu=function(e,t){t=t||{};var r=Ot("TTFB"),n=kt(e,r,fu,t.reportAllChanges);xp(function(){var i=Co();i&&(r.value=Math.max(i.responseStart-Dn(),0),r.entries=[i],n(!0),Pn(function(){r=Ot("TTFB",0),(n=kt(e,r,fu,t.reportAllChanges))(!0)}))})};Ee();function Cp(){yu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),bu(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Eu(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Op(){Vt.on("onDocumentReady",e=>{Vt.emit("LifecycleEvent.onReady",{isLogin:!1}),D.mpType==="game"&&rt.start(Date.now()-e)})}function wu(){Op(),Cp()}wu();
198
217
  /*! Bundled license information:
199
218
 
200
219
  localforage/dist/localforage.js: