@jolibox/implement 1.3.0 → 1.3.2

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 Rd=Object.create;var So=Object.defineProperty,Od=Object.defineProperties,kd=Object.getOwnPropertyDescriptor,Td=Object.getOwnPropertyDescriptors,xd=Object.getOwnPropertyNames,Jn=Object.getOwnPropertySymbols,os=Object.getPrototypeOf,Co=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,Pd=Reflect.get;var rs=(e,t,n)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))Co.call(t,n)&&rs(e,n,t[n]);if(Jn)for(var n of Jn(t))is.call(t,n)&&rs(e,n,t[n]);return e},Ie=(e,t)=>Od(e,Td(t));var on=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var as=(e,t)=>{var n={};for(var r in e)Co.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jn)for(var r of Jn(e))t.indexOf(r)<0&&is.call(e,r)&&(n[r]=e[r]);return n};var te=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ro=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ld=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xd(t))!Co.call(e,o)&&o!==n&&So(e,o,{get:()=>t[o],enumerable:!(r=kd(t,o))||r.enumerable});return e};var Oo=(e,t,n)=>(n=e!=null?Rd(os(e)):{},Ld(t||!e||!e.__esModule?So(n,"default",{value:e,enumerable:!0}):n,e));var ss=(e,t,n)=>Pd(os(e),n,t);var A=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{s(n.next(l))}catch(d){o(d)}},a=l=>{try{s(n.throw(l))}catch(d){o(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,a);s((n=n.apply(e,t)).next())});function Fd(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Bo(e){return typeof e=="string"}function ms(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ps(e){return typeof e=="object"&&Array.isArray(e)}function Hd(e){return typeof e=="undefined"}function qd(e){return Hd(e)||e===null}function jd(e){return typeof e=="function"}function vs(e){let t=e,n=null,r=function(...o){return n||(n=new t(...o)),n};return r.prototype=t.prototype,r}function gs(e,t,n){if(typeof n!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function r(o,i){for(let a in i)if(Object.prototype.hasOwnProperty.call(i,a)){let s=o[a],l=i[a],d=n(s,l,a,o,i);d!==void 0?o[a]=d:us(l)&&us(s)?o[a]=r(Uo({},s),l):Array.isArray(l)&&Array.isArray(s)?o[a]=[...s,...l]:o[a]=l}return o}return r(e,t)}function us(e){return e&&typeof e=="object"&&e.constructor===Object}function _s(e,t){if(Array.isArray(e))return e.concat(t)}function cn(e,t,n={}){let r=null,o,i,a,{leading:s=!1,trailing:l=!0}=n,d=()=>(a=e.apply(i,o),o=void 0,i=void 0,a),y=function(...f){o=f,i=this;let p=s&&!r;if(r&&clearTimeout(r),r=setTimeout(()=>{r=null,l&&!p&&d()},t),p)return d()};return y.cancel=()=>{r&&clearTimeout(r),r=null,o=i=void 0},y.flush=()=>{if(r)return clearTimeout(r),r=null,d()},y}function Wd(e,t){return(...n)=>t(e,...n)}function Es(e){return t=>Wd(t,function(n,...r){if(typeof n=="function")try{return n.apply(this,r)}catch(o){e(new $d(`${o}`))}})}function an(e){return(...t)=>{var n,r;((r=(n=globalThis.VConsole)==null?void 0:n[e])!=null?r:globalThis.console[e])(...t)}}function Fn(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((o,i)=>(o[i]=String(r[i]),o),{})}return e[n]})}function Zd(e){let t=e.location?Fn(e.location,fs):null,n=e.target?Fn(e.target,fs):null;return Fn(Gd(Uo({},e),{location:t,target:n}),Yd)}function Ho(e){let t=e.events.map(r=>Zd(r)),n=Fn(e.device,Qd);return[e.protocolVersion,t,n,e.project]}function ef(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Vo(e,t,n){let r=window.location.hostname,o=r.split("."),i=n?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(r))return`${i}.jolibox.com`;if(o.length>=2){let a=o.slice(-2).join(".");if(a==="jolibox.com"||a==="pico-game.com"||a==="joyslite.com")return`${i}.${a}`}return`${i}.jolibox.com`}function Ss(e){return Vo("app","stg-app",e)}function Nt(e){return`https://${Vo("api","stg-api",e)}`}function lf(e){return Vo("collect","stg-collect",e)}function Cs(e){return`https://${lf(e)}`}function ff(e){return new Promise(t=>Rs(e)(t))}function Rs(e){return(t,n=null)=>{let r=!1;return e(o=>{if(!r)return r=!0,t.call(n,o)},null)}}function hf(e,t){return(n=>{let r,o={onWillAddFirstListener(){r=n(i.fire,i)}},i=new ln(o);return i.event})((n,r=null)=>e(o=>t(o)&&n.call(r,o),null))}function pf(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)vf(e[r],t[r])}function vf(e,t){if(Bo(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(jd(t)){try{if(e instanceof t)return}catch(n){}if(!qd(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 gf(){return typeof globalThis!="undefined"?globalThis[Os]:void 0}function _f(e){typeof globalThis!="undefined"&&(globalThis[Os]=e)}function ge(e=!1){let t=gf();if(!e&&t)return t;let n=new Hn,r=new Do,o={registerCommand(i,a,s){n.registerCommand({id:i,handler:a,metadata:s})},executeCommand(i,...a){return r.executeCommand(i,...a)},excuteCommandSync(i,...a){return r.executeCommandThowErr(i,...a)}};return _f(o),o}var No,Dd,Nd,Ud,ls,Bd,Md,cs,Uo,Gd,Jd,hs,_t,Vd,Mo,Go,ys,ws,$d,bs,qn,jn,Jo,Pe,To,Kd,Fo,ds,zd,yt,Dt,Xd,fs,Yd,Qd,Je,Lt,tf,Ae,nf,rf,of,Is,qo,jo,af,sf,As,wt,xo,ne,cf,uf,sn,ln,qe,Lo,df,ko,mf,ft,Hn,Do,Os,H=te(()=>{"use strict";No=Object.defineProperty,Dd=Object.defineProperties,Nd=Object.getOwnPropertyDescriptor,Ud=Object.getOwnPropertyDescriptors,ls=Object.getOwnPropertySymbols,Bd=Object.prototype.hasOwnProperty,Md=Object.prototype.propertyIsEnumerable,cs=(e,t,n)=>t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uo=(e,t)=>{for(var n in t||(t={}))Bd.call(t,n)&&cs(e,n,t[n]);if(ls)for(var n of ls(t))Md.call(t,n)&&cs(e,n,t[n]);return e},Gd=(e,t)=>Dd(e,Ud(t)),Jd=(e,t)=>{for(var n in t)No(e,n,{get:t[n],enumerable:!0})},hs=(e,t,n,r)=>{for(var o=r>1?void 0:r?Nd(t,n):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,n,o):a(o))||o);return r&&o&&No(t,n,o),o},_t=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{s(n.next(l))}catch(d){o(d)}},a=l=>{try{s(n.throw(l))}catch(d){o(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,a);s((n=n.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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let o=this._eventListeners[n].indexOf(r);o!==-1&&this._eventListeners[n].splice(o,1)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}Vd=(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))(Vd||{}),Mo=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}},Go=class extends Mo{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},ys=class extends Mo{constructor(){super(...arguments),this.kind="USER_ERROR"}},ws=class extends ys{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},$d=class extends ys{constructor(e,t,n){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,n&&(this.extra=Object.assign({},this.extra,n))}},bs=class extends Go{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},qn=class extends Go{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},jn=class extends Mo{constructor(e,t,n,r,o){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",n&&(this.errorType=n),r!==void 0&&(this.stack=r),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Jo=class extends Go{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pe={log:an("log"),warn:an("warn"),info:an("info"),error:an("error"),debug:an("debug")};Object.assign(globalThis,{logger:Pe});To=Symbol.for("Jolibox.canIUseMap"),Kd={};globalThis[To]||(globalThis[To]=Kd);Fo={get config(){return globalThis[To]}},ds=Symbol.for("Jolibox.canIUseMap.native"),zd={};globalThis[ds]||(globalThis[ds]=zd);yt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(yt||{}),Dt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Dt||{}),Xd=(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))(Xd||{}),fs=["name","params"],Yd=["name","type","location","target","extra","timestamp","userId"],Qd=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Je=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});ef();Lt=typeof window=="undefined",tf=()=>!Lt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ae={isiOS:!Lt&&(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:!Lt&&navigator.userAgent.includes("Android"),isMac:!Lt&&navigator.userAgent.includes("Mac"),isFacebook:!Lt&&navigator.userAgent.includes("FB_IAB"),isPC:!Lt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},nf=()=>Ae.isiOS?"iOS":Ae.isAndroid?"Android":Ae.isMac?"Mac":Ae.isFacebook?"Facebook":"PC",rf="device_id",of="advertising_id",Is=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Je()),window.__joliboxLocalStorage__.getItem(e)),qo=()=>new URLSearchParams(window.location.search).get("deviceId")||Is(rf),jo=()=>new URLSearchParams(window.location.search).get("advertisingId")||Is(of),af=e=>e.charAt(0).toUpperCase()+e.slice(1),sf=()=>{var e;let t=new URLSearchParams(window.location.search);return af((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},As=e=>{if(tf())return window.navigator.userAgent;let t="JoliboxWebSDK",n=nf(),r=navigator.language,o=qo(),i=jo();return`${t} (${sf()}${n}; UnknownModel; UnknownSystemVersion; ${r}) uuid/${o} adid/${i} version/${e||""}`};wt=class{constructor(e,t={}){this.requestAdapter=e,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=Uo({duration:10*60*1e3,timeout:3e3,keyGenerator:(n,r)=>n,consistencyChecker:()=>!0},t)}request(e,t){return _t(this,null,function*(){let n=this.config.keyGenerator(e,t),r=this.pendingRequests.get(n);if(r)return console.log(`[RequestCacheService] Reusing pending request for ${e}`),r;let o=this.requestInternal(e,t),i=this.createTimeoutPromise(),a=Promise.race([o,i]).catch(s=>_t(this,null,function*(){if(s.message.includes("timeout")){let l=this.getValidCachedData(n);if(l)return console.warn(`[RequestCacheService] Request timeout, falling back to cache for ${e}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}throw s}));this.pendingRequests.set(n,a),o.then(s=>{console.log(`[RequestCacheService] Background request completed successfully for ${e}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${e}:`,s)});try{return yield a}finally{this.pendingRequests.delete(n)}})}requestInternal(e,t){return _t(this,null,function*(){var n,r,o,i;let a=this.config.keyGenerator(e,t),s=++this.requestSequence,l=this.getValidCachedData(a);if(console.log("[RequestCacheService] requestInternal start",e,"cached:",l),l){if(this.requestAdapter.extractRealTimeData&&this.requestAdapter.mergeData)try{let f=yield this.requestAdapter.execute(e,t),p=this.requestAdapter.extractRealTimeData(f),h=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,f);return h&&!this.config.consistencyChecker(l,h)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${e}`),this.setCachedDataWithSequence(a,h,s),f):this.requestAdapter.mergeData(l,p)}catch(f){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${e}:`,f),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}return console.log(`[RequestCacheService] use cache for ${e}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}console.log(`[RequestCacheService] Cache miss, fetching fresh data for ${e} (sequence: ${s})`);let d=yield this.requestAdapter.execute(e,t),y=(i=(o=this.requestAdapter).extractCacheableData)==null?void 0:i.call(o,d);return y&&this.setCachedDataWithSequence(a,y,s),d})}createTimeoutPromise(){return new Promise((e,t)=>{setTimeout(()=>{t(new Error(`[RequestCacheService] Request timeout after ${this.config.timeout/1e3} seconds`))},this.config.timeout)})}getValidCachedData(e){let t=this.cache.get(e);return t?Date.now()>t.expiresAt?(this.cache.delete(e),null):t.data:null}setCachedDataWithSequence(e,t,n,r){let o=this.cache.get(e);if(o&&o.sequence>n){console.log(`[RequestCacheService] Ignoring stale cache update for ${e} (current: ${o.sequence}, incoming: ${n})`);return}let i=Date.now();this.cache.set(e,{data:JSON.parse(JSON.stringify(t)),timestamp:i,expiresAt:i+this.config.duration,key:e,sequence:n,metadata:r}),this.cacheSequences.set(e,n),console.log(`[RequestCacheService] Updated cache for ${e} with sequence ${n}`)}refreshCache(e,t){return _t(this,null,function*(){let n=this.config.keyGenerator(e,t);return this.cache.delete(n),this.request(e,t)})}forceRequest(e,t){return _t(this,null,function*(){var n,r;let o=this.config.keyGenerator(e,t),i=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${e} (sequence: ${i})`);let a=yield this.requestAdapter.execute(e,t),s=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,a);return s&&(this.setCachedDataWithSequence(o,s,i),console.log(`[RequestCacheService] Force updated cache for ${e}`)),a})}warmupCache(e,t){return _t(this,null,function*(){let n=this.config.keyGenerator(e,t);if(this.pendingRequests.has(n)){console.log(`[RequestCacheService] Skipping warmup for ${e} - request in progress`);return}if(this.hasValidCache(n)){console.log(`[RequestCacheService] Skipping warmup for ${e} - valid cache exists`);return}try{console.log(`[RequestCacheService] Warming up cache for ${e}`),yield this.forceRequest(e,t)}catch(r){console.warn(`[RequestCacheService] Cache warmup failed for ${e}:`,r)}})}clearCache(e){e?(this.cache.delete(e),this.cacheSequences.delete(e),this.pendingRequests.delete(e),console.log(`[RequestCacheService] Cleared cache for ${e}`)):(this.cache.clear(),this.cacheSequences.clear(),this.pendingRequests.clear(),this.requestSequence=0,console.log("[RequestCacheService] Cleared all cache"))}clearExpiredCache(){let e=Date.now();for(let[t,n]of this.cache)e>n.expiresAt&&(this.cache.delete(t),this.cacheSequences.delete(t));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let e=Date.now(),t=0,n=0;for(let r of this.cache.values())e>r.expiresAt?n++:t++;return{cacheCount:this.cache.size,validCount:t,expiredCount:n,pendingRequestCount:this.pendingRequests.size}}getCacheKeys(){return Array.from(this.cache.keys())}hasValidCache(e){let t=this.cache.get(e);return t?Date.now()<=t.expiresAt:!1}getPendingRequestKeys(){return Array.from(this.pendingRequests.keys())}hasPendingRequest(e){return this.pendingRequests.has(e)}getCacheSequence(e){return this.cacheSequences.get(e)}},xo=class Po{constructor(t){this.element=t,this.next=Po.Undefined,this.prev=Po.Undefined}};xo.Undefined=new xo(void 0);ne=xo,cf=class{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let e=this._first;for(;e!==ne.Undefined;){let t=e.next;e.prev=ne.Undefined,e.next=ne.Undefined,e=t}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new ne(e);if(this._first===ne.Undefined)this._first=n,this._last=n;else if(t){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==ne.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ne.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ne.Undefined&&e.next!==ne.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ne.Undefined&&e.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):e.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):e.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ne.Undefined;)yield e.element,e=e.next}},uf=0,sn=class{constructor(e){this.value=e,this.id=uf++}},ln=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof sn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,n)=>{var r,o,i,a,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};n&&(t=t.bind(n));let d=new sn(t);return this._listeners?this._listeners instanceof sn?this._listeners=[this._listeners,d]:this._listeners.push(d):((o=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||o.call(r,this),this._listeners=d,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,f,p,h;if(!this._disposed){if(this._listeners instanceof sn)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(f=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||f.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((h=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||h.call(p)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(o){r(o)}}fire(e){this._listeners&&(this._listeners instanceof sn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},qe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,n=!0){var r;let o=(r=this.listeners.get(e))!=null?r:new ln,i=l=>t(...l.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let n=this.listeners.get(e),r=this.cachedEventQueue.get(e);r||(r=new cf,this.cachedEventQueue.set(e,r)),r.push({args:t}),n&&n.fire({event:e,args:t})}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};this.on(e,n,!1)}},Lo={};Jd(Lo,{None:()=>df,filter:()=>hf,once:()=>Rs,toPromise:()=>ff});df=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});ko=Symbol.for("Jolibox.hostEmitter"),mf=()=>{let e=new qe;return globalThis[ko]||(globalThis[ko]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[ko]},ft=mf();Hn=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ln,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 n=[];for(let o of e.metadata.args)n.push(o.constraint);let r=e.handler;e.handler=function(...o){return pf(o,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};Hn=hs([vs],Hn);Do=class{constructor(){this._onWillExecuteCommand=new ln,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new ln,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Hn,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Fd(3e4)),this._starActivation}executeCommand(e,...t){return _t(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Lo.toPromise(Lo.filter(this.registry.onDidRegisterCommand,n=>n===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let n=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),r}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e,...t){let n=!1;try{return e(...t)}finally{n=!0}}};Do=hs([vs],Do);Os=Symbol.for("Jolibox.commands")});function Le(e,t={}){$o.emit("ERROR_REPORT",{error:e,options:t})}var $o,bt,Ye=te(()=>{"use strict";H();H();$o=new qe,bt=new qe;Le.debounce=cn(Le,50,{leading:!0})});var Wo,yf,ks,Ts,xs=te(()=>{"use strict";H();Ye();Wo=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n);try{return JSON.parse(r)}catch(o){return{}}},yf=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ks=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,s]=o;return{headerJson:Wo(i),payloadJson:Wo(a),signature:Wo(s)}}else throw"joli_source is missing"}catch(n){return Le(new bs(`${e} not a valid schema: ${n}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ts=(e,t)=>{let n=t.split(".");if(n&&n.length===3){let r=n[0],o=yf(e),i=n[2];return`${r}.${o}.${i}`}return t}});var wf,Vn,Ps,Ko=te(()=>{"use strict";H();wf="1.3.0",Vn=()=>wf,Ps=()=>{let e=Vn();return`${As(e)}`}});function Xo(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var bf,Ls,zo,Ds,re,Ef,P,ue=te(()=>{"use strict";H();xs();Ko();H();bf={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:qo(),adId:jo(),pixelRatio:window.devicePixelRatio||1,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Vn()},schema:window.location.href,platform:Ae.isAndroid?"android":Ae.isiOS?"ios":"h5"},zo=(Ls=globalThis.joliboxJSCore)==null?void 0:Ls.env,re=Object.assign({},(Ds=zo==null?void 0:zo())!=null?Ds:bf);Ef=()=>{var I,C,w,T,L,M,V,S,D,B,F;let{payloadJson:e,headerJson:t,signature:n}=re.schema.length?ks(re.schema):{},r=`${re.deviceInfo.did}-${new Date().getTime()}`,i=new URL(re.schema.length?re.schema:window.location.href).searchParams,a=(w=(C=(I=i.get("mpId"))!=null?I:i.get("appId"))!=null?C:i.get("gameId"))!=null?w:"",s=(M=(L=(T=re.clientSessionId)!=null?T:e==null?void 0:e.sessionId)!=null?L:i.get("sessionId"))!=null?M:r,l=!!((S=(V=e==null?void 0:e.testAdsMode)!=null?V:e==null?void 0:e.__testAdsMode)!=null?S:i.get("testAdsMode")==="true"),d=(F=(B=(D=e==null?void 0:e.joliboxEnv)!=null?D:e==null?void 0:e.__joliboxEnv)!=null?B:i.get("joliboxEnv"))!=null?F:"production",y=d==="staging",f=t==null?void 0:t.channel,h=new URL(window.location.href).searchParams,b=e==null?void 0:e.__shouldInterupt;return{get startTime(){var N;return(N=performance.timeOrigin)!=null?N:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var N,J;return(J=(N=h.get("joliSource"))!=null?N:i.get("joliSource"))!=null?J:null},get mpId(){var N;return(N=a!=null?a:e==null?void 0:e.id)!=null?N:""},get mpVersion(){var N;return(N=t==null?void 0:t.ver)!=null?N:Vn()},get mpType(){var N,J;return(J=(N=t==null?void 0:t.__mpType)!=null?N:e==null?void 0:e.__mpType)!=null?J:"game"},get platform(){var N;return((N=re.platform)!=null?N:re.deviceInfo.platform).toLowerCase()},get deviceInfo(){return re.deviceInfo},get sdkInfo(){return re.sdkInfo},get hostInfo(){return re.hostInfo},get hostUserInfo(){return re.hostUserInfo},get sessionId(){var N,J;return(J=(N=re.clientSessionId)!=null?N:s)!=null?J:r},get channel(){return f},get webviewId(){var N;return(N=re.webviewId)!=null?N:-1},get shouldInterupt(){return b},get from(){return e==null?void 0:e.__from},get baseApiHost(){return Ss(y)},get adId(){var N;return(N=re.deviceInfo.adId)!=null?N:re.deviceInfo.did},get language(){return re.deviceInfo.lang},get sdkEnvironment(){return Xo("dlightek","jolibox")?"dlightek":i.get("huaweiQuick")==="true"?"huaweiQuick":Xo("gamedistribution","jolibox")?"gamedistribution":Xo("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var me,Be,ct;let N=(me=re.deviceInfo.pixelRatio)!=null?me:1,J=(Be=re.deviceInfo.statusBarHeight)!=null?Be:e==null?void 0:e.__androidStatusBarHeight,Y=(ct=re.deviceInfo.navigationBarHeight)!=null?ct:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:J!==void 0?J/N:20,navigationBarHeight:Y!==void 0?Y/N:10}},get abTests(){var N,J;return(J=(N=re.abValues)==null?void 0:N.split(","))!=null?J:[]},get mpInfo(){var N;return(N=re.mpInfo)!=null?N:{mpName:"unknown"}},onEnvConfigChanged:N=>{gs(re,N,_s)},encodeJoliSourceQuery:N=>{var J,Y;return t&&n?Ts($($({},e),N),(J=i.get("joliSource"))!=null?J:""):(Y=i.get("joliSource"))!=null?Y:""},setDoExitDirectly:()=>{b=!1}}},P=Ef()});var Yo,Us,If,Af,Ns,Sf,Bs=te(()=>{"use strict";H();Ye();ue();H();Yo=!1,Us=(e,t)=>e==null?!1:t in e,If=e=>Us(e,"kind"),Af=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")},Ns=(e,t={},n)=>{var i,a,s;let r={user_id:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",device_id:(s=P.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Af(e.name)},o=Ie($({},r),{env:t.environment,isFromUser:n});n?bt.emit("GLOBAL_USER_ERROR",e,o):bt.emit("GLOBAL_ERROR",e,o)},Sf=e=>Us(e,"kind")&&e.kind==="USER_ERROR";$o.on("ERROR_REPORT",({error:e,options:t})=>{if(Yo)return;Yo=!0;let n=If(e)&&e.raw?e.raw:e;try{let r=Sf(e);Ns(e,t,r)}catch(r){let o=r instanceof Error?r.message:String(r),i=new Jo(`${o}, origin error: ${n.message}`);Pe.error(i),Ns(new Jo(i.message),{environment:t.environment},!1)}finally{Yo=!1}})});var Qo,Zo=te(()=>{"use strict";Ye();H();Ye();Qo=e=>new ws(e)});function Ms(e,t){let n=(r,o,i)=>{let d=o!=null?o:{},{eventType:a}=d,s=as(d,["eventType"]),l=Ie($({tag:r,eventType:i!=null?i:a!=null?a:yt.Other},t),{extra:$({},s)});r=="globalJsError"?Le(new qn(JSON.stringify(l))):e("systemLog",l,P.webviewId)};return n.debounce=cn(n,500,{leading:!0}),n}function Gs(e){let t=(n,r,o)=>{var s;let i=(s=o&&JSON.stringify(o))!=null?s:0,a={speed_value_type:n,total_duration:r};i&&Object.assign(a,{extra:i}),e("joliboxSpeedAnalysis",a)};return t.debounce=cn(t,500,{leading:!0}),t}var Js=te(()=>{"use strict";H();H();Ye();ue()});function Fs(e,t){let n=Ms(e,t),r=Gs(n);return{track:n,trackPerformance:r}}var Hs=te(()=>{"use strict";Js()});var ei=te(()=>{"use strict"});var $n,qs=te(()=>{"use strict";ue();H();H();$n=class{constructor(t){this.apiHost=t;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return A(this,null,function*(){let n=`${this.apiHost}/api/fe-configs/js-sdk/samples-config`,r=yield(yield fetch(n)).json();this.samplesConfig=r})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:n}=this.samplesConfig;for(let[r,o]of Object.entries(n))if(o.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(r);return!1}getDevice(){var r,o,i,a,s;let{nativeSDKVersion:t,jssdkVersion:n}=P.sdkInfo;return{platform:1e3,os:P.deviceInfo.platform,appVersion:(r=t!=null?t:n)!=null?r:"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:(s=P.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:P.deviceInfo.did,jsSdkVersion:n,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),n={};return t.forEach((r,o)=>{n[o]=r}),{name:"GamePage",params:n}}trackEvent(t,n,r){return A(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 s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Ie($({},t),{location:o,target:i,extra:a,timestamp:Date.now(),userId:null})],device:s,project:n};try{r?yield this.doReport(Ho(d),r):yield this.doReport(Ho(d))}catch(y){Pe.log("[Jolibox SDK] report API error",y)}})}}});var ti=te(()=>{"use strict";Hs();ei();qs()});var ni,js,Qe,Wn,Fe,Ut=te(()=>{"use strict";Ko();ue();H();ni=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(js=AbortSignal.timeout)!=null||(AbortSignal.timeout=ni);Qe=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(r=>r).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let n=new Wn(t);return e.getInstance().httpClients.add(n),n}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Wn=class{constructor(t){this.xua=Ps();this.getJoliSource=()=>P.joliSource;var r;let n=Nt(P.testMode);this.baseUrl=(r=t==null?void 0:t.baseUrl)!=null?r:n}get(t,n){return A(this,null,function*(){try{let{query:r,timeout:o}=n!=null?n:{},{headers:i}=n!=null?n:{},a=r?new URLSearchParams(r):null,s=a==null?void 0:a.toString(),l=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();i=Object.assign({},i!=null?i:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let f=yield fetch(l,{method:"GET",headers:i,credentials:"include",signal:ni(o!=null?o:3e4)});return Qe.getInstance().recordNetworkRequest(!0),yield f.json()}catch(r){throw Qe.getInstance().recordNetworkRequest(!1),r}})}post(t,n){return A(this,null,function*(){try{let{data:r,query:o,timeout:i}=n!=null?n:{},{headers:a}=n!=null?n:{},s=o?new URLSearchParams(o):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,f=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},f?{"x-joli-source":f}:{},{"x-os-type":Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(r),signal:ni(i!=null?i:3e4),credentials:"include"});Qe.getInstance().recordNetworkRequest(!0);let h=p.headers.get("content-type");if(h!=null&&h.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(h!=null&&h.includes("multipart/form-data")||h!=null&&h.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(h!=null&&h.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(r){throw Qe.getInstance().recordNetworkRequest(!1),r}})}put(t,n){return A(this,null,function*(){try{let{data:r,query:o,timeout:i}=n!=null?n:{},{headers:a}=n!=null?n:{},s=o?new URLSearchParams(o):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,y=this.xua,f=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},f?{"x-joli-source":f}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(r!=null?r:{})});if(!p.ok)throw Qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(r){throw console.error("Error:",r),r}})}};window.JoliboxHttpClient=Wn;Fe=Qe.getInstance()});var ri,Kn,oi=te(()=>{"use strict";ue();ti();Ut();H();ri=class extends $n{constructor(){super(...arguments);this.httpClient=Fe.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n;return Cs((n=P.testMode)!=null?n:!1)}doReport(n){this.httpClient.post("/report",{data:n,timeout:5e3}).catch(r=>{console.info("report error",r)})}},Kn=new ri(Nt(P.testMode))});var Cf,Vs=te(()=>{"use strict";Bs();H();Zo();H();oi();ue();Cf=(e,t)=>{var o,i,a;let n={message:t.message,stack:(o=t.stack)!=null?o:"",errorType:t.name,source:0},r={name:e,type:yt.ErrorTrace,location:null,target:null,extra:n,timestamp:Date.now(),userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:null};Kn.trackEvent(r,Dt.WebSDK)};bt.on("GLOBAL_ERROR",(e,t)=>{Cf(t.tag,e)});bt.on("GLOBAL_USER_ERROR",(e,t)=>{Pe.log("UserError",e,t)})});var zn,$s=te(()=>{"use strict";zn=class{constructor(t,n){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(t,n)=>{window.parent&&window.parent.postMessage({type:t,data:n},"*")};this.playGame=t=>{this.reportCount++,(this.reportCount<=3||(this.reportCount-3)%3===0)&&(this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t}),this.notifyIframeGameEvent("JOLIBOX_GAME_PLAY",{duration:t}))};this.timer=this.createRAFTimer(t=>{this.playGame(t)});this.interval=n!=null?n:5*1e3,t.on("visible",r=>{this.visible=r})}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.notifyIframeGameEvent("JOLIBOX_GAME_OPEN",{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.notifyIframeGameEvent("JOLIBOX_GAME_CLOSE",{duration:t}),this.timer.stop()}createRAFTimer(t){let n=Date.now(),r,o,i=!1,a=0,s=()=>{if(!i)return;let h=Date.now(),b=h-n;b>=this.interval&&(this.visible&&(a+=Math.min(b,this.interval+1e3),t(a)),n=h),r=requestAnimationFrame(s)},l=()=>{y(),n=Date.now(),o=window.setInterval(()=>{if(!i)return;let h=Date.now();h-n>=this.interval&&(n=h)},this.interval)},d=()=>{f(),n=Date.now(),r=requestAnimationFrame(s)},y=()=>{r&&(cancelAnimationFrame(r),r=0)},f=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",h=>{i&&(console.log("visible",h),h?d():l())});let p=this.visible;return{start(){i||(i=!0,p?d():l())},stop(){i=!1,y(),f()}}}}});var Xn,Ws=te(()=>{"use strict";ue();$s();Ut();Xn=class extends zn{constructor(n,r,o){super(r,o);this.httpClient=Fe.create();this.gameId=P.mpId,this.sessionId=P.sessionId,this.track=n}reporter(n){return A(this,null,function*(){let{event:r,params:o,extraParams:i}=n,a={eventType:r,gameInfo:$({gameId:this.gameId,sessionId:this.sessionId},o)};i&&Object.assign(a,i),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(n,r=null){this.track(n,r)}}});var Ks,Rf,Ce,Of,ii,Ze,ht=te(()=>{"use strict";Vs();H();H();ti();oi();Ws();ue();ei();Ks=ge(),Rf={type:Dt.WebSDK,platform:"h5",jssdk_version:P.sdkInfo.jssdkVersion,mp_id:P.mpId,mp_version:P.mpVersion},{track:Ce,trackPerformance:Of}=Fs((...e)=>{var a,s,l,d;let[,t]=e,n=t,r=ms(n.extra)?n.extra:Bo(n.extra)?JSON.parse(n.extra):{},o=Ie($({},r),{mp_id:(a=n.mp_id)!=null?a:"",mp_version:(s=n.mp_version)!=null?s:""}),i={name:t.tag,type:yt.System,location:null,target:null,extra:o,timestamp:Date.now(),userId:(d=(l=P.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Kn.trackEvent(i,Dt.WebSDK)},Rf);Ks.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:n})=>{Of(e,t,n)});Ks.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Ce(e,t)});ii=new qe,Ze=new Xn(Ce,ii)});function zs(e){let t=Fo.config[e];return t||(t={},Fo.config[e]=t),(n,r)=>{if(t[n]){Pe.warn(`[can i use] ${n} already registered`);return}t[n]=$({},r)}}var Xs=te(()=>{"use strict";H()});function ai(e){Ys=e}function Yn(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Yn(t)):Object.keys(e).reduce((t,n)=>(t[n]=Yn(e[n]),t),{})}function et(e){return typeof e=="number"}function si(e){let t=li(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function li(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ys,de,Qn,Zn,er,tr,Bt,nr,rr,or,ir,ar,sr,lr,cr,ur,dr,fr,hr,ci=te(()=>{"use strict";Ys=!1;de=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ys)if(typeof t=="string")this.errors.push(t);else{let n=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?n+=" or undefined, ":n+=", ",n+=`but got ${si(t.actual)}`,this.errors.push(n)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Yn(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Yn(this._default)}optional(){return this._optional=!0,this}};Qn=class extends de{validate(t){return this._optional&&t===void 0?!0:et(t)?et(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):et(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):et(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}},Zn=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},er=class extends de{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(et(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(et(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}},tr=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Bt=class extends de{validate(t){return!0}},nr=class extends de{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},rr=class extends de{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},or=class extends de{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},ir=class extends de{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let n=this._items.map(r=>JSON.stringify(r)).join(", ");return this.fail(`expect ${this.path} to be one of ${n}, but got ${si(t)}`)}return!0}},ar=class extends de{constructor(n){super();this._item=n}validate(n){if(this._optional&&n===void 0)return!0;if(!Array.isArray(n))return this.fail({expect:"array",actual:n});if(et(this._minItems)&&n.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(et(this._maxItems)&&n.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(et(this._length)&&n.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let r=this._item;if(!r)return!0;let o=!0;if(n.forEach((i,a)=>{if(r.path=`${this.path}[${a}]`,r.errors=this.errors,i===void 0&&r.hasDefault){n[a]=r.defaultValue;return}r.validate(i)||(r.hasFallback?n[a]=r.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let a in n)i.has(n[a])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(n[a])}] and ${this.path}[${a}] are identical)`):i.set(n[a],a)}return o}minItems(n){return this._minItems=n,this}maxItems(n){return this._maxItems=n,this}uniqueItems(){return this._uniqueItems=!0,this}length(n){return this._length=n,this}},sr=class extends de{constructor(n){super();this._value=n}validate(n){if(this._optional&&n===void 0)return!0;if(li(n)!=="object")return this.fail({expect:"object",actual:n});let o=n,i=this._value;i.errors=this.errors;let a=!0;for(let s in o){let l=o[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?i.path=`${this.path}.${s}`:i.path=`${this.path}["${s}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){o[s]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?o[s]=i.fallbackValue:a=!1)}}return a}},lr=class extends de{constructor(n={}){super();this._object=n}validate(n){if(this._optional&&n===void 0)return!0;if(li(n)!=="object")return this.fail({expect:"object",actual:n});let r=n,o=!0;for(let i in this._object){let a=r[i],s=this._object[i];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?s.path=`${this.path}.${i}`:s.path=`${this.path}["${i}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){r[i]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?r[i]=s.fallbackValue:o=!1)}}return o}},cr=class extends de{constructor(n){super();this.value=n}validate(n){return n===void 0&&this._optional?!0:n!==this.value?this.fail({expect:si(this.value),actual:n}):!0}},ur=class extends de{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let n=[],r=!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))n.push(a.errors.join("; "));else if(!r){r=!0;break}}if(!r){let i=n.join(`
2
- or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super(),this._items=t;let n=0,r=t.length-1;for(;r>=0;r--){let o=t[r];if(o._optional||o.hasDefault)n+=1;else break}this._minItems=t.length-n}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 n=!0;return this._items.forEach((r,o)=>{if(r.path=`${this.path}[${o}]`,r.errors=this.errors,t[o]===void 0&&r.hasDefault){t[o]=r.defaultValue;return}r.validate(t[o])||(r.hasFallback?t[o]=r._fallback:n=!1)}),n}},fr=class extends de{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},hr=class extends de{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 ui(e,t,n="param"){if(e.errors=[],e.path=n,ai(!0),!e.validate(t)){let r=e.errors.join(`
3
- `);throw e.errors.length=0,ai(!1),new TypeError(r)}}var q,di=te(()=>{"use strict";ci();ci();q={object(e){return new lr(e)},array(e){return new ar(e)},tuple(...e){return new dr(...e)},literal(e){return new cr(e)},or(...e){return new ur(...e)},symbol(){return new tr},record(e){return new sr(e)},function(){return new or},boolean(){return new Zn},string(){return new er},number(){return new Qn},undefined(){return new nr},null(){return new rr},unknown(){return new Bt},any(){return new Bt},as(){return new Bt},arraybuffer(){return new fr},enum(...e){return new ir(...e)},typedarray(e){return new hr(e)}}});var mr,Qs,Zs=te(()=>{"use strict";H();Ye();di();Zo();mr=1,Qs=e=>{function t(r,o){return(...i)=>{var f,p,h,b;let a=Date.now(),s={method:r,trace_id:mr};mr+=1;let l="SUCCESS",d=`${r}:ok`,y=0;try{if(o.paramsSchema)try{ui(o.paramsSchema,i,"params")}catch(T){throw Qo(`${r}:fail ${T.message}`)}let I=o.implement(...i),C=I,w=`${r}:ok`;if(I&&"code"in I){let{code:T,data:L,message:M}=I;l=T,C=L,w=M}return{code:l,message:w,data:C}}catch(I){let C=I;y=(p=(f=C.code)!=null?f:C.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(h=C.message)!=null?h:C.errMsg)!=null?b:`${I}`;return d=`${r}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,Le(new jn(d,y)),{code:l,message:d}}finally{let I=Date.now()-a}}}function n(r,o){return(...i)=>A(this,null,function*(){var p,h,b,I;let a=ps(i)?i:[i],s=Date.now(),l={method:r,trace_id:mr};mr+=1;let d=`${r}:ok`,y="SUCCESS",f={code:y,message:d};try{if(o.paramsSchema)try{ui(o.paramsSchema,a,"params")}catch(T){throw Qo(T.message)}let w=yield o.implement(...a);if(w&&"code"in w){let{code:T,data:L,message:M}=w;y=T,d=M,w=L}return Object.assign(f,{code:y,message:d,data:w}),f}catch(C){let w=C,T=(h=(p=w.code)!=null?p:w.errNo)!=null?h:2e3;y="FAILURE";let L=(I=(b=w.message)!=null?b:w.errMsg)!=null?I:`${C}`,M=`${r}:${y} ${L.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(f,{code:y,message:M}),Le(new jn(M,T)),f}finally{let C=Date.now()-s}})}return{createAPI:n,createSyncAPI:t}}});var tt,Et,_e,un=te(()=>{"use strict";Xs();ht();Zs();di();({createAPI:tt,createSyncAPI:Et}=Qs(Ce)),_e=zs("h5")});var rl=Ro((nl,pi)=>{(function(e){if(typeof nl=="object"&&typeof pi!="undefined")pi.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,n;return function r(o,i,a){function s(y,f){if(!i[y]){if(!o[y]){var p=typeof on=="function"&&on;if(!f&&p)return p(y,!0);if(l)return l(y,!0);var h=new Error("Cannot find module '"+y+"'");throw h.code="MODULE_NOT_FOUND",h}var b=i[y]={exports:{}};o[y][0].call(b.exports,function(I){var C=o[y][1][I];return s(C||I)},b,b.exports,r,o,i,a)}return i[y].exports}for(var l=typeof on=="function"&&on,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(r,o,i){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,l;if(s){var d=0,y=new s(I),f=a.document.createTextNode("");y.observe(f,{characterData:!0}),l=function(){f.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=I,l=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=function(){var w=a.document.createElement("script");w.onreadystatechange=function(){I(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},a.document.documentElement.appendChild(w)}:l=function(){setTimeout(I,0)};var h,b=[];function I(){h=!0;for(var w,T,L=b.length;L;){for(T=b,b=[],w=-1;++w<L;)T[w]();L=b.length}h=!1}o.exports=C;function C(w){b.push(w)===1&&!h&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(r,o,i){"use strict";var a=r(1);function s(){}var l={},d=["REJECTED"],y=["FULFILLED"],f=["PENDING"];o.exports=p;function p(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,S!==s&&C(this,S)}p.prototype.catch=function(S){return this.then(null,S)},p.prototype.then=function(S,D){if(typeof S!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var B=new this.constructor(s);if(this.state!==f){var F=this.state===y?S:D;b(B,F,this.outcome)}else this.queue.push(new h(B,S,D));return B};function h(S,D,B){this.promise=S,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof B=="function"&&(this.onRejected=B,this.callRejected=this.otherCallRejected)}h.prototype.callFulfilled=function(S){l.resolve(this.promise,S)},h.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},h.prototype.callRejected=function(S){l.reject(this.promise,S)},h.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,D,B){a(function(){var F;try{F=D(B)}catch(N){return l.reject(S,N)}F===S?l.reject(S,new TypeError("Cannot resolve promise with itself")):l.resolve(S,F)})}l.resolve=function(S,D){var B=w(I,D);if(B.status==="error")return l.reject(S,B.value);var F=B.value;if(F)C(S,F);else{S.state=y,S.outcome=D;for(var N=-1,J=S.queue.length;++N<J;)S.queue[N].callFulfilled(D)}return S},l.reject=function(S,D){S.state=d,S.outcome=D;for(var B=-1,F=S.queue.length;++B<F;)S.queue[B].callRejected(D);return S};function I(S){var D=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof D=="function")return function(){D.apply(S,arguments)}}function C(S,D){var B=!1;function F(me){B||(B=!0,l.reject(S,me))}function N(me){B||(B=!0,l.resolve(S,me))}function J(){D(N,F)}var Y=w(J);Y.status==="error"&&F(Y.value)}function w(S,D){var B={};try{B.value=S(D),B.status="success"}catch(F){B.status="error",B.value=F}return B}p.resolve=T;function T(S){return S instanceof this?S:l.resolve(new this(s),S)}p.reject=L;function L(S){var D=new this(s);return l.reject(D,S)}p.all=M;function M(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=S.length,F=!1;if(!B)return this.resolve([]);for(var N=new Array(B),J=0,Y=-1,me=new this(s);++Y<B;)Be(S[Y],Y);return me;function Be(ct,Bn){D.resolve(ct).then(po,function(xt){F||(F=!0,l.reject(me,xt))});function po(xt){N[Bn]=xt,++J===B&&!F&&(F=!0,l.resolve(me,N))}}}p.race=V;function V(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var B=S.length,F=!1;if(!B)return this.resolve([]);for(var N=-1,J=new this(s);++N<B;)Y(S[N]);return J;function Y(me){D.resolve(me).then(function(Be){F||(F=!0,l.resolve(J,Be))},function(Be){F||(F=!0,l.reject(J,Be))})}}},{1:1}],3:[function(r,o,i){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=r(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(r,o,i){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function s(c,m){if(!(c instanceof m))throw new TypeError("Cannot call a class as a function")}function l(){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(c){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var c=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function f(c,m){c=c||[],m=m||{};try{return new Blob(c,m)}catch(v){if(v.name!=="TypeError")throw v;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,g=new u,_=0;_<c.length;_+=1)g.append(c[_]);return g.getBlob(m.type)}}typeof Promise=="undefined"&&r(3);var p=Promise;function h(c,m){m&&c.then(function(u){m(null,u)},function(u){m(u)})}function b(c,m,u){typeof m=="function"&&c.then(m),typeof u=="function"&&c.catch(u)}function I(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",T=void 0,L={},M=Object.prototype.toString,V="readonly",S="readwrite";function D(c){for(var m=c.length,u=new ArrayBuffer(m),g=new Uint8Array(u),_=0;_<m;_++)g[_]=c.charCodeAt(_);return u}function B(c){return new p(function(m){var u=c.transaction(w,S),g=f([""]);u.objectStore(w).put(g,"key"),u.onabort=function(_){_.preventDefault(),_.stopPropagation(),m(!1)},u.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function F(c){return typeof T=="boolean"?p.resolve(T):B(c).then(function(m){return T=m,T})}function N(c){var m=L[c.name],u={};u.promise=new p(function(g,_){u.resolve=g,u.reject=_}),m.deferredOperations.push(u),m.dbReady?m.dbReady=m.dbReady.then(function(){return u.promise}):m.dbReady=u.promise}function J(c){var m=L[c.name],u=m.deferredOperations.pop();if(u)return u.resolve(),u.promise}function Y(c,m){var u=L[c.name],g=u.deferredOperations.pop();if(g)return g.reject(m),g.promise}function me(c,m){return new p(function(u,g){if(L[c.name]=L[c.name]||Ba(),c.db)if(m)N(c),c.db.close();else return u(c.db);var _=[c.name];m&&_.push(c.version);var v=d.open.apply(d,_);m&&(v.onupgradeneeded=function(E){var R=v.result;try{R.createObjectStore(c.storeName),E.oldVersion<=1&&R.createObjectStore(w)}catch(O){if(O.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw O}}),v.onerror=function(E){E.preventDefault(),g(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(R){R.target.close()},u(E),J(c)}})}function Be(c){return me(c,!1)}function ct(c){return me(c,!0)}function Bn(c,m){if(!c.db)return!0;var u=!c.db.objectStoreNames.contains(c.storeName),g=c.version<c.db.version,_=c.version>c.db.version;if(g&&(c.version!==m&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),_||u){if(u){var v=c.db.version+1;v>c.version&&(c.version=v)}return!0}return!1}function po(c){return new p(function(m,u){var g=new FileReader;g.onerror=u,g.onloadend=function(_){var v=btoa(_.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:c.type})},g.readAsBinaryString(c)})}function xt(c){var m=D(atob(c.data));return f([m],{type:c.type})}function Ua(c){return c&&c.__local_forage_encoded_blob}function Ou(c){var m=this,u=m._initReady().then(function(){var g=L[m._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return b(u,c,c),u}function ku(c){N(c);for(var m=L[c.name],u=m.forages,g=0;g<u.length;g++){var _=u[g];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,Be(c).then(function(v){return c.db=v,Bn(c)?ct(c):v}).then(function(v){c.db=m.db=v;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=v}).catch(function(v){throw Y(c,v),v})}function Xe(c,m,u,g){g===void 0&&(g=1);try{var _=c.db.transaction(c.storeName,m);u(null,_)}catch(v){if(g>0&&(!c.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!c.db||v.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),ct(c)}).then(function(){return ku(c).then(function(){Xe(c,m,u,g-1)})}).catch(u);u(v)}}function Ba(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Tu(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=c[g];var _=L[u.name];_||(_=Ba(),L[u.name]=_),_.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Ou);var v=[];function E(){return p.resolve()}for(var R=0;R<_.forages.length;R++){var O=_.forages[R];O!==m&&v.push(O._initReady().catch(E))}var k=_.forages.slice(0);return p.all(v).then(function(){return u.db=_.db,Be(u)}).then(function(x){return u.db=x,Bn(u,m._defaultConfig.version)?ct(u):x}).then(function(x){u.db=_.db=x,m._dbInfo=u;for(var U=0;U<k.length;U++){var j=k[U];j!==m&&(j._dbInfo.db=u.db,j._dbInfo.version=u.version)}})}function xu(c,m){var u=this;c=I(c);var g=new p(function(_,v){u.ready().then(function(){Xe(u._dbInfo,V,function(E,R){if(E)return v(E);try{var O=R.objectStore(u._dbInfo.storeName),k=O.get(c);k.onsuccess=function(){var x=k.result;x===void 0&&(x=null),Ua(x)&&(x=xt(x)),_(x)},k.onerror=function(){v(k.error)}}catch(x){v(x)}})}).catch(v)});return h(g,m),g}function Pu(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){Xe(u._dbInfo,V,function(E,R){if(E)return v(E);try{var O=R.objectStore(u._dbInfo.storeName),k=O.openCursor(),x=1;k.onsuccess=function(){var U=k.result;if(U){var j=U.value;Ua(j)&&(j=xt(j));var z=c(j,U.key,x++);z!==void 0?_(z):U.continue()}else _()},k.onerror=function(){v(k.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function Lu(c,m,u){var g=this;c=I(c);var _=new p(function(v,E){var R;g.ready().then(function(){return R=g._dbInfo,M.call(m)==="[object Blob]"?F(R.db).then(function(O){return O?m:po(m)}):m}).then(function(O){Xe(g._dbInfo,S,function(k,x){if(k)return E(k);try{var U=x.objectStore(g._dbInfo.storeName);O===null&&(O=void 0);var j=U.put(O,c);x.oncomplete=function(){O===void 0&&(O=null),v(O)},x.onabort=x.onerror=function(){var z=j.error?j.error:j.transaction.error;E(z)}}catch(z){E(z)}})}).catch(E)});return h(_,u),_}function Du(c,m){var u=this;c=I(c);var g=new p(function(_,v){u.ready().then(function(){Xe(u._dbInfo,S,function(E,R){if(E)return v(E);try{var O=R.objectStore(u._dbInfo.storeName),k=O.delete(c);R.oncomplete=function(){_()},R.onerror=function(){v(k.error)},R.onabort=function(){var x=k.error?k.error:k.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return h(g,m),g}function Nu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Xe(m._dbInfo,S,function(v,E){if(v)return _(v);try{var R=E.objectStore(m._dbInfo.storeName),O=R.clear();E.oncomplete=function(){g()},E.onabort=E.onerror=function(){var k=O.error?O.error:O.transaction.error;_(k)}}catch(k){_(k)}})}).catch(_)});return h(u,c),u}function Uu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Xe(m._dbInfo,V,function(v,E){if(v)return _(v);try{var R=E.objectStore(m._dbInfo.storeName),O=R.count();O.onsuccess=function(){g(O.result)},O.onerror=function(){_(O.error)}}catch(k){_(k)}})}).catch(_)});return h(u,c),u}function Bu(c,m){var u=this,g=new p(function(_,v){if(c<0){_(null);return}u.ready().then(function(){Xe(u._dbInfo,V,function(E,R){if(E)return v(E);try{var O=R.objectStore(u._dbInfo.storeName),k=!1,x=O.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){_(null);return}c===0||k?_(U.key):(k=!0,U.advance(c))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function Mu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Xe(m._dbInfo,V,function(v,E){if(v)return _(v);try{var R=E.objectStore(m._dbInfo.storeName),O=R.openKeyCursor(),k=[];O.onsuccess=function(){var x=O.result;if(!x){g(k);return}k.push(x.key),x.continue()},O.onerror=function(){_(O.error)}}catch(x){_(x)}})}).catch(_)});return h(u,c),u}function Gu(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,_;if(!c.name)_=p.reject("Invalid arguments");else{var v=c.name===u.name&&g._dbInfo.db,E=v?p.resolve(g._dbInfo.db):Be(c).then(function(R){var O=L[c.name],k=O.forages;O.db=R;for(var x=0;x<k.length;x++)k[x]._dbInfo.db=R;return R});c.storeName?_=E.then(function(R){if(R.objectStoreNames.contains(c.storeName)){var O=R.version+1;N(c);var k=L[c.name],x=k.forages;R.close();for(var U=0;U<x.length;U++){var j=x[U];j._dbInfo.db=null,j._dbInfo.version=O}var z=new p(function(X,ce){var ae=d.open(c.name,O);ae.onerror=function(Me){var rn=ae.result;rn.close(),ce(Me)},ae.onupgradeneeded=function(){var Me=ae.result;Me.deleteObjectStore(c.storeName)},ae.onsuccess=function(){var Me=ae.result;Me.close(),X(Me)}});return z.then(function(X){k.db=X;for(var ce=0;ce<x.length;ce++){var ae=x[ce];ae._dbInfo.db=X,J(ae._dbInfo)}}).catch(function(X){throw(Y(c,X)||p.resolve()).catch(function(){}),X})}}):_=E.then(function(R){N(c);var O=L[c.name],k=O.forages;R.close();for(var x=0;x<k.length;x++){var U=k[x];U._dbInfo.db=null}var j=new p(function(z,X){var ce=d.deleteDatabase(c.name);ce.onerror=function(){var ae=ce.result;ae&&ae.close(),X(ce.error)},ce.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},ce.onsuccess=function(){var ae=ce.result;ae&&ae.close(),z(ae)}});return j.then(function(z){O.db=z;for(var X=0;X<k.length;X++){var ce=k[X];J(ce._dbInfo)}}).catch(function(z){throw(Y(c,z)||p.resolve()).catch(function(){}),z})})}return h(_,m),_}var Ju={_driver:"asyncStorage",_initStorage:Tu,_support:y(),iterate:Pu,getItem:xu,setItem:Lu,removeItem:Du,clear:Nu,length:Uu,key:Bu,keys:Mu,dropInstance:Gu};function Fu(){return typeof openDatabase=="function"}var ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hu="~~local_forage_type~",Ma=/^~~local_forage_type~([^~]+)~/,Mn="__lfsc__:",vo=Mn.length,go="arbf",_o="blob",Ga="si08",Ja="ui08",Fa="uic8",Ha="si16",qa="si32",ja="ur16",Va="ui32",$a="fl32",Wa="fl64",Ka=vo+go.length,za=Object.prototype.toString;function Xa(c){var m=c.length*.75,u=c.length,g,_=0,v,E,R,O;c[c.length-1]==="="&&(m--,c[c.length-2]==="="&&m--);var k=new ArrayBuffer(m),x=new Uint8Array(k);for(g=0;g<u;g+=4)v=ut.indexOf(c[g]),E=ut.indexOf(c[g+1]),R=ut.indexOf(c[g+2]),O=ut.indexOf(c[g+3]),x[_++]=v<<2|E>>4,x[_++]=(E&15)<<4|R>>2,x[_++]=(R&3)<<6|O&63;return k}function yo(c){var m=new Uint8Array(c),u="",g;for(g=0;g<m.length;g+=3)u+=ut[m[g]>>2],u+=ut[(m[g]&3)<<4|m[g+1]>>4],u+=ut[(m[g+1]&15)<<2|m[g+2]>>6],u+=ut[m[g+2]&63];return m.length%3===2?u=u.substring(0,u.length-1)+"=":m.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function qu(c,m){var u="";if(c&&(u=za.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&za.call(c.buffer)==="[object ArrayBuffer]")){var g,_=Mn;c instanceof ArrayBuffer?(g=c,_+=go):(g=c.buffer,u==="[object Int8Array]"?_+=Ga:u==="[object Uint8Array]"?_+=Ja:u==="[object Uint8ClampedArray]"?_+=Fa:u==="[object Int16Array]"?_+=Ha:u==="[object Uint16Array]"?_+=ja:u==="[object Int32Array]"?_+=qa:u==="[object Uint32Array]"?_+=Va:u==="[object Float32Array]"?_+=$a:u==="[object Float64Array]"?_+=Wa:m(new Error("Failed to get type for BinaryArray"))),m(_+yo(g))}else if(u==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=Hu+c.type+"~"+yo(this.result);m(Mn+_o+E)},v.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),m(null,E)}}function ju(c){if(c.substring(0,vo)!==Mn)return JSON.parse(c);var m=c.substring(Ka),u=c.substring(vo,Ka),g;if(u===_o&&Ma.test(m)){var _=m.match(Ma);g=_[1],m=m.substring(_[0].length)}var v=Xa(m);switch(u){case go:return v;case _o:return f([v],{type:g});case Ga:return new Int8Array(v);case Ja:return new Uint8Array(v);case Fa:return new Uint8ClampedArray(v);case Ha:return new Int16Array(v);case ja:return new Uint16Array(v);case qa:return new Int32Array(v);case Va:return new Uint32Array(v);case $a:return new Float32Array(v);case Wa:return new Float64Array(v);default:throw new Error("Unkown type: "+u)}}var wo={serialize:qu,deserialize:ju,stringToBuffer:Xa,bufferToString:yo};function Ya(c,m,u,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,g)}function Vu(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=typeof c[g]!="string"?c[g].toString():c[g];var _=new p(function(v,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(R){return E(R)}u.db.transaction(function(R){Ya(R,u,function(){m._dbInfo=u,v()},function(O,k){E(k)})},E)});return u.serializer=wo,_}function dt(c,m,u,g,_,v){c.executeSql(u,g,_,function(E,R){R.code===R.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(O,k){k.rows.length?v(O,R):Ya(O,m,function(){O.executeSql(u,g,_,v)},v)},v):v(E,R)},v)}function $u(c,m){var u=this;c=I(c);var g=new p(function(_,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(R){dt(R,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(O,k){var x=k.rows.length?k.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),_(x)},function(O,k){v(k)})})}).catch(v)});return h(g,m),g}function Wu(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(R){dt(R,E,"SELECT * FROM "+E.storeName,[],function(O,k){for(var x=k.rows,U=x.length,j=0;j<U;j++){var z=x.item(j),X=z.value;if(X&&(X=E.serializer.deserialize(X)),X=c(X,z.key,j+1),X!==void 0){_(X);return}}_()},function(O,k){v(k)})})}).catch(v)});return h(g,m),g}function Qa(c,m,u,g){var _=this;c=I(c);var v=new p(function(E,R){_.ready().then(function(){m===void 0&&(m=null);var O=m,k=_._dbInfo;k.serializer.serialize(m,function(x,U){U?R(U):k.db.transaction(function(j){dt(j,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[c,x],function(){E(O)},function(z,X){R(X)})},function(j){if(j.code===j.QUOTA_ERR){if(g>0){E(Qa.apply(_,[c,O,u,g-1]));return}R(j)}})})}).catch(R)});return h(v,u),v}function Ku(c,m,u){return Qa.apply(this,[c,m,u,1])}function zu(c,m){var u=this;c=I(c);var g=new p(function(_,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(R){dt(R,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){_()},function(O,k){v(k)})})}).catch(v)});return h(g,m),g}function Xu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){dt(E,v,"DELETE FROM "+v.storeName,[],function(){g()},function(R,O){_(O)})})}).catch(_)});return h(u,c),u}function Yu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){dt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(R,O){var k=O.rows.item(0).c;g(k)},function(R,O){_(O)})})}).catch(_)});return h(u,c),u}function Qu(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(R){dt(R,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(O,k){var x=k.rows.length?k.rows.item(0).key:null;_(x)},function(O,k){v(k)})})}).catch(v)});return h(g,m),g}function Zu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){dt(E,v,"SELECT key FROM "+v.storeName,[],function(R,O){for(var k=[],x=0;x<O.rows.length;x++)k.push(O.rows.item(x).key);g(k)},function(R,O){_(O)})})}).catch(_)});return h(u,c),u}function ed(c){return new p(function(m,u){c.transaction(function(g){g.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,v){for(var E=[],R=0;R<v.rows.length;R++)E.push(v.rows.item(R).name);m({db:c,storeNames:E})},function(_,v){u(v)})},function(g){u(g)})})}function td(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,_;return c.name?_=new p(function(v){var E;c.name===u.name?E=g._dbInfo.db:E=openDatabase(c.name,"","",0),c.storeName?v({db:E,storeNames:[c.storeName]}):v(ed(E))}).then(function(v){return new p(function(E,R){v.db.transaction(function(O){function k(z){return new p(function(X,ce){O.executeSql("DROP TABLE IF EXISTS "+z,[],function(){X()},function(ae,Me){ce(Me)})})}for(var x=[],U=0,j=v.storeNames.length;U<j;U++)x.push(k(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(z){R(z)})},function(O){R(O)})})}):_=p.reject("Invalid arguments"),h(_,m),_}var nd={_driver:"webSQLStorage",_initStorage:Vu,_support:Fu(),iterate:Wu,getItem:$u,setItem:Ku,removeItem:zu,clear:Xu,length:Yu,key:Qu,keys:Zu,dropInstance:td};function rd(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function Za(c,m){var u=c.name+"/";return c.storeName!==m.storeName&&(u+=c.storeName+"/"),u}function od(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(m){return!0}}function id(){return!od()||localStorage.length>0}function ad(c){var m=this,u={};if(c)for(var g in c)u[g]=c[g];return u.keyPrefix=Za(c,m._defaultConfig),id()?(m._dbInfo=u,u.serializer=wo,p.resolve()):p.reject()}function sd(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var v=localStorage.key(_);v.indexOf(g)===0&&localStorage.removeItem(v)}});return h(u,c),u}function ld(c,m){var u=this;c=I(c);var g=u.ready().then(function(){var _=u._dbInfo,v=localStorage.getItem(_.keyPrefix+c);return v&&(v=_.serializer.deserialize(v)),v});return h(g,m),g}function cd(c,m){var u=this,g=u.ready().then(function(){for(var _=u._dbInfo,v=_.keyPrefix,E=v.length,R=localStorage.length,O=1,k=0;k<R;k++){var x=localStorage.key(k);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=_.serializer.deserialize(U)),U=c(U,x.substring(E),O++),U!==void 0)return U}}});return h(g,m),g}function ud(c,m){var u=this,g=u.ready().then(function(){var _=u._dbInfo,v;try{v=localStorage.key(c)}catch(E){v=null}return v&&(v=v.substring(_.keyPrefix.length)),v});return h(g,m),g}function dd(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo,_=localStorage.length,v=[],E=0;E<_;E++){var R=localStorage.key(E);R.indexOf(g.keyPrefix)===0&&v.push(R.substring(g.keyPrefix.length))}return v});return h(u,c),u}function fd(c){var m=this,u=m.keys().then(function(g){return g.length});return h(u,c),u}function hd(c,m){var u=this;c=I(c);var g=u.ready().then(function(){var _=u._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return h(g,m),g}function md(c,m,u){var g=this;c=I(c);var _=g.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,R){var O=g._dbInfo;O.serializer.serialize(m,function(k,x){if(x)R(x);else try{localStorage.setItem(O.keyPrefix+c,k),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&R(U),R(U)}})})});return h(_,u),_}function pd(c,m){if(m=C.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var u=this.config();c.name=c.name||u.name,c.storeName=c.storeName||u.storeName}var g=this,_;return c.name?_=new p(function(v){c.storeName?v(Za(c,g._defaultConfig)):v(c.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var R=localStorage.key(E);R.indexOf(v)===0&&localStorage.removeItem(R)}}):_=p.reject("Invalid arguments"),h(_,m),_}var vd={_driver:"localStorageWrapper",_initStorage:ad,_support:rd(),iterate:cd,getItem:ld,setItem:md,removeItem:hd,clear:sd,length:fd,key:ud,keys:dd,dropInstance:pd},gd=function(m,u){return m===u||typeof m=="number"&&typeof u=="number"&&isNaN(m)&&isNaN(u)},_d=function(m,u){for(var g=m.length,_=0;_<g;){if(gd(m[_],u))return!0;_++}return!1},es=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},nn={},ts={},Pt={INDEXEDDB:Ju,WEBSQL:nd,LOCALSTORAGE:vd},yd=[Pt.INDEXEDDB._driver,Pt.WEBSQL._driver,Pt.LOCALSTORAGE._driver],Gn=["dropInstance"],bo=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Gn),wd={description:"",driver:yd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function bd(c,m){c[m]=function(){var u=arguments;return c.ready().then(function(){return c[m].apply(c,u)})}}function Eo(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var u in m)m.hasOwnProperty(u)&&(es(m[u])?arguments[0][u]=m[u].slice():arguments[0][u]=m[u])}return arguments[0]}var Ed=function(){function c(m){s(this,c);for(var u in Pt)if(Pt.hasOwnProperty(u)){var g=Pt[u],_=g._driver;this[u]=_,nn[_]||this.defineDriver(g)}this._defaultConfig=Eo({},wd),this._config=Eo({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.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 g in u){if(g==="storeName"&&(u[g]=u[g].replace(/\W/g,"_")),g==="version"&&typeof u[g]!="number")return new Error("Database version must be a number.");this._config[g]=u[g]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},c.prototype.defineDriver=function(u,g,_){var v=new p(function(E,R){try{var O=u._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){R(k);return}for(var x=bo.concat("_initStorage"),U=0,j=x.length;U<j;U++){var z=x[U],X=!_d(Gn,z);if((X||u[z])&&typeof u[z]!="function"){R(k);return}}var ce=function(){for(var rn=function(Sd){return function(){var Cd=new Error("Method "+Sd+" is not implemented by the current driver"),ns=p.reject(Cd);return h(ns,arguments[arguments.length-1]),ns}},Io=0,Ad=Gn.length;Io<Ad;Io++){var Ao=Gn[Io];u[Ao]||(u[Ao]=rn(Ao))}};ce();var ae=function(rn){nn[O]&&console.info("Redefining LocalForage driver: "+O),nn[O]=u,ts[O]=rn,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(ae,R):ae(!!u._support):ae(!0)}catch(Me){R(Me)}});return b(v,g,_),v},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,g,_){var v=nn[u]?p.resolve(nn[u]):p.reject(new Error("Driver not found."));return b(v,g,_),v},c.prototype.getSerializer=function(u){var g=p.resolve(wo);return b(g,u),g},c.prototype.ready=function(u){var g=this,_=g._driverSet.then(function(){return g._ready===null&&(g._ready=g._initDriver()),g._ready});return b(_,u,u),_},c.prototype.setDriver=function(u,g,_){var v=this;es(u)||(u=[u]);var E=this._getSupportedDrivers(u);function R(){v._config.driver=v.driver()}function O(U){return v._extend(U),R(),v._ready=v._initStorage(v._config),v._ready}function k(U){return function(){var j=0;function z(){for(;j<U.length;){var X=U[j];return j++,v._dbInfo=null,v._ready=null,v.getDriver(X).then(O).catch(z)}R();var ce=new Error("No available storage method found.");return v._driverSet=p.reject(ce),v._driverSet}return z()}}var x=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=x.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(j){v._driver=j._driver,R(),v._wrapLibraryMethodsWithReady(),v._initDriver=k(E)})}).catch(function(){R();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,g,_),this._driverSet},c.prototype.supports=function(u){return!!ts[u]},c.prototype._extend=function(u){Eo(this,u)},c.prototype._getSupportedDrivers=function(u){for(var g=[],_=0,v=u.length;_<v;_++){var E=u[_];this.supports(E)&&g.push(E)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,g=bo.length;u<g;u++)bd(this,bo[u])},c.prototype.createInstance=function(u){return new c(u)},c}(),Id=new Ed;o.exports=Id},{3:3}]},{},[4])(4)})});var il=Ro(yr=>{"use strict";H();un();ht();var gi=(e,t)=>{window.parent&&window.parent.postMessage({type:e,data:t},"*")},_i=ge(),$f=tt("levelFinished",{paramsSchema:q.tuple(q.object({levelId:q.or(q.string(),q.number()),duration:q.number().optional(),rating:q.number().optional(),score:q.number().optional(),variation:q.string().optional()})),implement:e=>A(yr,null,function*(){let{levelId:t,duration:n,rating:r,score:o,variation:i}=e;Pe.info("onLevelFinished",n,r,o,i),gi("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:t,duration:n,rating:r,score:o,variation:i}),yield Promise.all([Ze.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:n,rating:r,score:o}}}),Ze.tracker("LevelFinished",{levelId:t,duration:n,rating:r,score:o,variation:i})])})}),Wf=tt("gamePlayEnded",{paramsSchema:q.tuple(q.object({duration:q.number().optional(),rating:q.number().optional(),score:q.number(),variation:q.string().optional()})),implement:e=>A(yr,null,function*(){let{duration:t,rating:n,score:r,variation:o}=e;Pe.info("onGamePlayEnded",t,n,r,o),gi("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:t,rating:n,score:r,variation:o}),yield Promise.all([Ze.tracker("GamePlayEnded",{duration:t,rating:n,score:r,variation:o}),Ze.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:n,score:r}}})])})}),Kf=tt("levelUpgrade",{paramsSchema:q.tuple(q.object({levelId:q.or(q.string(),q.number()),name:q.string().optional()})),implement:n=>A(yr,[n],function*({levelId:e,name:t}){Pe.info("onLevelUpgrade",e,t),gi("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:e,name:t}),yield Promise.all([Ze.tracker("LevelUpgrade",{name:t,levelId:e}),Ze.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});_i.registerCommand("TaskTrackerSDK.levelFinished",$f);_i.registerCommand("TaskTrackerSDK.gamePlayEnded",Wf);_i.registerCommand("TaskTrackerSDK.levelUpgrade",Kf);_e("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});_e("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});_e("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var je,Mt,al,yi,zf,It,wr=te(()=>{"use strict";je=(e,t)=>{var n;window.dispatchEvent(new CustomEvent(e,{detail:t})),(n=window.parent)==null||n.postMessage({type:e,data:{detail:t}},"*")},Mt=new Map,al=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let n=Mt.get(t.type);n&&n.forEach(r=>{try{r(t.data)}catch(o){console.warn("Callback execution failed:",o)}})}}catch(t){console.warn("Failed to parse message:",t)}},yi=!1,zf=()=>{yi||(window.addEventListener("message",al),yi=!0)},It=(e,t)=>{zf(),Mt.has(e)||Mt.set(e,new Set);let n=Mt.get(e);return n.add(t),()=>{n.delete(t),n.size===0&&Mt.delete(e),Mt.size===0&&(window.removeEventListener("message",al),yi=!1)}}});var br,Er,Ir,Ar,Sr,wi,Cr,Rr,Or,kr,Gt,Xf,Q,nt,rt,Re=te(()=>{"use strict";H();br="UNLOCK_OPTIONS_CHANGED",Er="INVOKE_PAYMENT",Ir="ON_PAYMENT_RESULT",Ar="ON_USE_MODAL_EVENT",Sr="ON_USE_MODAL_RESULT",wi="ON_USE_MODAL_FREQUENCY",Cr="ON_USE_UNLOGIN_MODAL_EVENT",Rr="INVOKE_UNLOGIN_MODAL_EVENT",Or="INVOKE_SUBSCRIPTION_EVENT",kr="ON_USE_SUBSCRIPTION_RESULT",Gt=new qe,Xf=()=>({on:Gt.on.bind(Gt),off:Gt.off.bind(Gt),emit:Gt.emit.bind(Gt)}),Q=Xf(),nt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},joinMember:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},rt={show:!0,minInterval:8*60*60*1e3}});var su=Ro(lo=>{"use strict";ue();Re();wr();H();var au={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};It("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",au[e.result],e.result),Q.emit(Sr,{useModalResult:au[e.result]})});Q.on(Ar,(e,t)=>{var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||je("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Je()})});It("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{Q.emit(Ir,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});Q.on(Er,(e,t)=>A(lo,null,function*(){var n;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||je("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(n=t.sequenceId)!=null?n:Je()})}));It("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,n,r,o,i;Q.emit(Cr,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(o=(r=(n=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:n.reward)==null?void 0:r.rewardValue)!=null?o:0,isFirstLogin:(i=e.isFirstLogin)!=null?i:!1}}),e.result==="SUCCESS"&&P.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});Q.on(Rr,e=>A(lo,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||je("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:Je(),type:e})}));It("ON_JOLIBOX_SUB_RESULT_EVENT",e=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",e),Q.emit(kr,{result:e.result})});Q.on(Or,e=>A(lo,null,function*(){console.log("----notify custom event-----",e),je("JOLIBOX_SUB_EVENT",{sequenceId:Je()})}))});ht();ue();un();H();var el=ge(),Tf="env",xf="getSystemInfoSync",Pf=()=>{var o,i,a,s;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=Ie($({},e),{version:t}));let n=(a=P.hostInfo)==null?void 0:a.appName;n&&(e=Ie($({},e),{appName:n}));let r=(s=P.sdkInfo)==null?void 0:s.jssdkVersion;return r&&(e=Ie($({},e),{SDKVersion:r})),e},Lf=Et(xf,{implement:Pf}),Df=Et(Tf,{implement:()=>Ie($({},P.hostInfo),{sdkInfo:P.sdkInfo,platform:P.platform,deviceInfo:P.deviceInfo})});el.registerCommand("API.env",Df);el.registerCommand("API.getSystemInfoSync",Lf);_e("env",{version:"1.0.0"});_e("getSystemInfoSync",{version:"1.0.0"});H();un();Ye();ht();var Nf="onJoliboxShow",Uf="onJoliboxHide",Bf="onReady",hi=ge(),mi=Es(Le),fi=!0,dn=!0,pr=0,vr=ii;function Mf(){let e=Date.now();if(e-pr<100)return;pr=e;let t=document.visibilityState==="visible";t!==fi&&(fi=t,vr.emit("visible",fi))}function tl(e){let t=Date.now();t-pr<100||(pr=t,e==="focus"&&!dn?dn=!0:e==="blur"&&dn&&(dn=!1),vr.emit("visible",dn))}document.addEventListener("visibilitychange",Mf);window.addEventListener("focus",()=>tl("focus"));window.addEventListener("blur",()=>tl("blur"));var Gf=Et(Nf,{paramsSchema:q.tuple(q.function()),implement(e){let t=mi(e);vr.on("visible",n=>{n&&t()})}}),Jf=Et(Uf,{paramsSchema:q.tuple(q.function()),implement(e){let t=mi(e);vr.on("visible",n=>{!n&&t()})}}),Ff=Et(Bf,{paramsSchema:q.tuple(q.function()),implement(e){let t=mi(e);ft.on("LifecycleEvent.onReady",n=>{t(n)})}});hi.registerCommand("LifecycleSDK.onReady",Ff);hi.registerCommand("LifecycleSDK.onJoliboxShow",Gf);hi.registerCommand("LifecycleSDK.onJoliboxHide",Jf);_e("lifeCycle.onReady",{version:"1.0.0"});_e("lifeCycle.onJoliboxShow",{version:"1.0.0"});_e("lifeCycle.onJoliboxHide",{version:"1.0.0"});un();H();Ut();ue();var ol=Oo(rl());var gr=ge(),vi=class{constructor(){this.httpClient=Fe.create({baseUrl:Nt(P.testMode)});this.getGameId=()=>P.mpId;this.getItem=t=>A(this,null,function*(){let{code:n,data:r,message:o}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=r==null?void 0:r.value,a=o;return n!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),a+="fallback to localstorage"),{code:n,message:a,data:i&&i!=="undefined"?i:null}});this.setItem=(t,n)=>A(this,null,function*(){let r=typeof n=="string"?n:String(n),{code:o,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:r}});return yield this.gameStore.setItem(t,r),{code:o,message:i}});this.removeItem=t=>A(this,null,function*(){yield this.gameStore.removeItem(t);let{code:n,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:n,message:r}});this.clear=()=>A(this,null,function*(){yield this.gameStore.clear();let{code:t,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:n}});this.gameId=this.getGameId(),this.gameStore=ol.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},_r=new vi,Hf=tt("getLocalStorage",{paramsSchema:q.tuple(q.string()),implement(e){return A(this,null,function*(){return yield _r.getItem(e)})}});gr.registerCommand("StorageSDK.getItem",Hf);_e("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var qf=tt("setStorage",{paramsSchema:q.tuple(q.string(),q.or(q.string(),q.boolean(),q.number())),implement(e,t){return A(this,null,function*(){return yield _r.setItem(e,t)})}});gr.registerCommand("StorageSDK.setItem",qf);_e("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var jf=tt("removeStorage",{paramsSchema:q.tuple(q.string()),implement(e){return A(this,null,function*(){return yield _r.removeItem(e)})}});gr.registerCommand("StorageSDK.removeItem",jf);_e("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Vf=tt("clearStorage",{implement(){return A(this,null,function*(){return yield _r.clear()})}});gr.registerCommand("StorageSDK.clear",Vf);_e("storage.clear",{version:"1.0.0"});var mI=Oo(il());ht();H();Ut();wr();ue();Re();var sl=P.testMode;function ll(){let e=new Map,t,n;return{registerRewardHandler(o,i){e.set(o,i)},handleReward(o,...i){return A(this,null,function*(){return yield o.reduce((s,l)=>A(this,null,function*(){let d=yield s;if(d===!0)return!0;sl&&console.log(`handleReward ${l}`);let y=e.get(l),f=y?yield y(...i):d;return sl&&console.log(`handleReward ${l} ${f}`),f}),Promise.resolve(!1))})},registerRewardsFetcher(o){return A(this,null,function*(){t=(...i)=>A(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(o){return A(this,null,function*(){n=(...i)=>A(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:nt,loginGuide:rt}}})})},getRewardsTypes(...o){return A(this,null,function*(){return t?yield t(...o):["ADS"]})},getRewardFrequencyConfig(...o){return A(this,null,function*(){return n?yield n(...o):{joliCoinUseAndCharge:nt,loginGuide:rt}})}}}H();var bi=class{constructor(t){this.httpClient=t}execute(t,n){return A(this,null,function*(){let r=(n==null?void 0:n.method)||"POST",o=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(t,o):yield this.httpClient.post(t,o)})}extractCacheableData(t){var n,r,o;return{unlockOptions:((n=t.data)==null?void 0:n.unlockOptions)||[],joliCoin:((r=t.extra)==null?void 0:r.joliCoin)||{balance:0,enableAutoDeduct:!1},joliGem:((o=t.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(t,n){return{code:"SUCCESS",message:"success",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin||{balance:0,enableAutoDeduct:!1},joliGem:t.joliGem||{balance:0,enableAutoDeduct:!1}}}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{unlockOptions:t.unlockOptions},extra:{joliCoin:t.joliCoin,joliGem:t.joliGem}}}},Ei=class{constructor(t){this.httpClient=t}execute(t,n){return A(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",o=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(t,o):yield this.httpClient.post(t,o)})}extractCacheableData(t){let n=t.data;return $({joliCoinUseAndCharge:n==null?void 0:n.joliCoinUseAndCharge,loginGuide:n==null?void 0:n.loginGuide},n)}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:t}}},Tr=class{constructor(t){this.unlockOptionsService=new wt(new bi(t),{duration:30*60*1e3,timeout:1e3,keyGenerator:n=>n,consistencyChecker:(n,r)=>n.unlockOptions.length!==r.unlockOptions.length?!1:n.unlockOptions.every((o,i)=>{var s,l;let a=r.unlockOptions[i];return o.type===a.type&&((s=o.joliGemChoice)==null?void 0:s.joliGemQuantity)===((l=a.joliGemChoice)==null?void 0:l.joliGemQuantity)})}),this.globalConfigService=new wt(new Ei(t),{duration:60*60*1e3,timeout:1e3,keyGenerator:n=>n})}getUnlockOptions(){return A(this,arguments,function*(t={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}getGlobalConfig(){return A(this,null,function*(){return yield this.globalConfigService.request("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}refreshUnlockOptions(){return A(this,arguments,function*(t={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:t,method:"POST"})})}refreshGlobalConfig(){return A(this,null,function*(){return yield this.globalConfigService.forceRequest("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}warmupCache(){return A(this,null,function*(){yield Promise.all([this.unlockOptionsService.warmupCache("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",method:"POST"}),this.globalConfigService.warmupCache("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})])})}clearAllCache(){this.unlockOptionsService.clearCache(),this.globalConfigService.clearCache()}getCacheStats(){return{unlockOptions:this.unlockOptionsService.getCacheStats(),globalConfig:this.globalConfigService.getCacheStats()}}clearExpiredCache(){this.unlockOptionsService.clearExpiredCache(),this.globalConfigService.clearExpiredCache()}};Re();H();var Yf=()=>(e,t)=>{let n={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return n[t]-n[e]},Qf=["openJolicoinGuide",{method:"getABTest",platforms:["android"],nativeVersionCode:1050100},"userTrackAsync",{method:"openMiniapp",nativeVersionCode:1050100}],Zf=e=>{if(!e.length)return["ADS"];if(e.includes("JOLI_GEM")){if(e.length===1)return["JOLI_GEM_ONLY"];if(e.includes("SUBSCRIPTION")&&e.length===2)return["SUBSCRIPTION","JOLI_GEM_ONLY"]}if(e.includes("JOLI_COIN")){if(e.length===1)return["JOLI_COIN_ONLY"];if(e.includes("SUBSCRIPTION")&&e.length===2)return["SUBSCRIPTION","JOLI_COIN_ONLY"]}return e.sort(Yf())},Ii=null;function Ai(e){return Ii||(Ii=new Tr(e)),Ii}var Si=e=>{e.registerRewardsFetcher(t=>A(void 0,null,function*(){var o,i,a,s,l;let n=["ADS"],r=Ai(t);try{let d=yield r.getUnlockOptions({});if(d.code!=="SUCCESS")return n;Q.emit(br,{options:((o=d.data)==null?void 0:o.unlockOptions)||[],userJoliCoin:((i=d.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((a=d.extra)==null?void 0:a.joliGem)||{balance:0,enableAutoDeduct:!1}});let y=((l=(s=d.data)==null?void 0:s.unlockOptions)==null?void 0:l.map(f=>f.type))||Array.from(n);return Zf(y)}catch(d){return console.error("getRewardOptions error (cached):",d),n}}))},Ci=e=>{e.registerRewardFrequencyConfigFetcher(t=>A(void 0,null,function*(){var r,o,i,a;let n=Ai(t);try{let s=yield n.getGlobalConfig();return Q.emit(wi,{joliCoinUseAndCharge:((r=s.data)==null?void 0:r.joliCoinUseAndCharge)||nt,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||rt}),s.data&&ft.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((i=s.data)==null?void 0:i.joliCoinUseAndCharge)||nt,loginGuide:((a=s.data)==null?void 0:a.loginGuide)||rt}}catch(s){return console.error("getGlobalConfig error (cached):",s),Q.emit(wi,{joliCoinUseAndCharge:nt,loginGuide:rt}),ft.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:nt,loginGuide:rt,supportedHostMethods:Qf}}),{joliCoinUseAndCharge:nt,loginGuide:rt}}}))};var Ri=e=>A(void 0,null,function*(){yield Ai(e).warmupCache(),console.log("Reward cache warmed up")});var cl=e=>t=>A(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(n){console.error("-----createAdsRewardHandler error-----",n)}return!0});Re();function Ve(e,t){let n=null,r=null,o=null,i=()=>{if(o){n=Promise.resolve(o);return}n=new Promise(a=>{r=a})};return i(),e.on(t,(...a)=>{let s=a[0];o=s,r&&(r(s),r=null)}),{getData:()=>(n||i(),n),getCachedData:()=>o,clearCache:()=>{o=null,n=null},getFreshData:()=>(o=null,n=null,i(),n),updateData:a=>{if(o)return o=$($({},o),a),n=Promise.resolve(o),r&&(r(o),r=null),o}}}Re();var ye=Ve(Q,br),fn=(e,t)=>{var r;let n=(r=e.options)==null?void 0:r.some(o=>o.type==="SUBSCRIPTION");return console.log("typeof extraCheck",typeof t,t==null?void 0:t()),n&&(!t||(t==null?void 0:t()))};ue();H();var Oi={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};H();var Ge=ge();Re();Re();H();var Ti=class{constructor(t){this.httpClient=t}execute(t,n){return A(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",o=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(t,{query:o}):yield this.httpClient.post(t,{query:o})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},xi=class{constructor(t){this.balanceService=new wt(new Ti(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let o=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${o}`}})}getBalance(t="JOLI_COIN"){return A(this,null,function*(){return(yield this.balanceService.request("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})).data})}refreshBalance(t="JOLI_COIN"){return A(this,null,function*(){return(yield this.balanceService.forceRequest("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})).data})}warmupBalance(t="JOLI_COIN"){return A(this,null,function*(){yield this.balanceService.warmupCache("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:t},method:"GET"})})}clearBalanceCache(){this.balanceService.clearCache()}getBalanceCacheStats(){return this.balanceService.getCacheStats()}clearExpiredCache(){this.balanceService.clearExpiredCache()}},ki=null;function Pi(e){return ki||(ki=new xi(e)),ki}var Li=(e,t="JOLI_COIN")=>A(void 0,null,function*(){return yield Pi(e).getBalance(t)}),At=(e,t="JOLI_COIN")=>A(void 0,null,function*(){let r=yield Pi(e).refreshBalance(t);return console.log(`Balance cache refreshed for type: ${t}`),r}),xr=(e,t="JOLI_COIN")=>A(void 0,null,function*(){yield Pi(e).warmupBalance(t),console.log(`Balance cache warmed up for type: ${t}`)});H();var Ni=class{constructor(t){this.httpClient=t}execute(t,n){return A(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",o=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(t,{query:o}):yield this.httpClient.post(t,{query:o})})}extractCacheableData(t){var n;return{balance:((n=t.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(t){return{code:"SUCCESS",message:"success from cache",data:{balance:t.balance}}}},Ui=class{constructor(t){this.gemBalanceService=new wt(new Ni(t),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let o=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${o}`}})}getGemBalance(t="GEM"){return A(this,null,function*(){return(yield this.gemBalanceService.request("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})).data})}refreshGemBalance(t="GEM"){return A(this,null,function*(){return(yield this.gemBalanceService.forceRequest("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})).data})}warmupGemBalance(t="GEM"){return A(this,null,function*(){yield this.gemBalanceService.warmupCache("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:t},method:"GET"})})}clearGemBalanceCache(){this.gemBalanceService.clearCache()}getGemBalanceCacheStats(){return this.gemBalanceService.getCacheStats()}clearExpiredCache(){this.gemBalanceService.clearExpiredCache()}},Di=null;function ul(e){return Di||(Di=new Ui(e)),Di}var Bi=(e,t="GEM")=>A(void 0,null,function*(){return yield ul(e).getGemBalance(t)}),Jt=(e,t="GEM")=>A(void 0,null,function*(){let r=yield ul(e).refreshGemBalance(t);return console.log(`Gem balance cache refreshed for type: ${t}`),r});var $e={JOLI_COIN:{fetchBalance:Li,getQuantity:e=>{var t,n,r;return(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(o=>o.type==="JOLI_COIN"))==null?void 0:n.joliCoinChoices[0].joliCoinQuantity)!=null?r:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userJoliCoin)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userJoliCoin",isEnough:(e,t)=>{var n,r;return(r=(n=e==null?void 0:e.options)==null?void 0:n.some(o=>o.type==="JOLI_COIN"&&o.joliCoinChoices.some(i=>{var a;return i.joliCoinQuantity<=((a=t==null?void 0:t.balance)!=null?a:0)})))!=null?r:!1}},JOLI_GEM:{fetchBalance:Bi,getQuantity:e=>{var t,n,r,o;return(o=(r=(n=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_GEM"))==null?void 0:n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?o:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userGem)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userGem",isEnough:(e,t)=>{var r,o,i;let n=e==null?void 0:e.options.find(a=>a.type==="JOLI_GEM");return n?((o=(r=n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?o:0)<=((i=t==null?void 0:t.balance)!=null?i:0):!1}}};var Pr=(e,t,n)=>{let{showUnlockWithCurrencyModal:r}=n;Ge.registerCommand(`Rewards.${e}.useJolicoin`,()=>A(void 0,null,function*(){let o=yield ye.getData(),i=$e[t],a=i.getCurrentUser(o),s=i.getQuantity(o),l=!!(a!=null&&a.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",o,l,s),(yield r({enableAutoDeduct:l,userCurrency:a,quantity:s,currency:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},St=(e,t)=>n=>A(void 0,null,function*(){let r=Ve(Q,Sr);return Q.emit(Ar,e,{enableAutoDeduct:n.enableAutoDeduct,userCurrency:n.userCurrency,quantity:n.quantity,currency:n.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).useModalResult});Re();Re();var Lr=(e,t,n)=>{let{httpClient:r,initiateAndAwaitPayment:o}=n;Ge.registerCommand(`Rewards.${e}.usePayment`,()=>A(void 0,null,function*(){var p;let i=yield ye.getData(),a=$e[t],s=yield a.fetchBalance(r),l=a.getQuantity(i),d=a.getCurrentUser(i),y=a.createUpdatedUser((p=s==null?void 0:s.balance)!=null?p:0,d.enableAutoDeduct),f=a.getUpdateKey();if(ye.updateData({[f]:y}),console.log("-----unlockOptions payment-----",i,y,l,t),!a.isEnough(i,y)){let h=yield o({userCurrency:y,currencyQuantity:l,currency:t});return t==="JOLI_GEM"?Jt(r):At(r),{result:h==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},Ct=(e,t)=>n=>A(void 0,null,function*(){let r=Ve(Q,Ir);return Q.emit(Er,e,{userCurrency:n.userCurrency,quantity:n.currencyQuantity,currency:n.currency,enableAutoDeduct:n.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield r.getFreshData()).paymentResult});ue();Re();Re();H();var Rt=(e,t)=>n=>A(void 0,null,function*(){let r=Ve(Q,Cr);return Q.emit(Rr,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:n}),yield r.getFreshData()});var nh=(e,t,n,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:o,unlockOptionsHandler:i,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:s,showUnloginModal:l,hasSubscription:d}})=>{Lr(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:a}),Pr(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let y=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return f=>A(void 0,null,function*(){var p,h,b,I;try{let C=yield i.getData();if(fn(C,d)){let M=$e.JOLI_COIN,V=yield M.fetchBalance(t),S=M.getCurrentUser(C),D=M.createUpdatedUser((p=V==null?void 0:V.balance)!=null?p:0,S.enableAutoDeduct);if(!M.isEnough(C,D))return o==null||o(f),!1}else{let M=!0;for(let V of y){let S=yield Ge.executeCommand(V);if(M=M&&S.result!=="FAILED",S.result!=="CONTINUE")break}if(!M)return o==null||o(f),!1}let T=Oi[n],L=yield t.post(T.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${Je()}-${P.mpType}-${Date.now()}`,gameInfo:{gameId:P.mpId}}});if(console.log("-----unlockWithCurrency request result-----",L),L.code=="SUCCESS"){try{(b=f.adBreakDone)==null||b.call(f,{breakType:f.type,breakName:"name"in f&&(h=f.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in f&&((I=f.adViewed)==null||I.call(f)),At(t)}catch(M){console.error("-----unlockWithJolicoin adBreakDone error-----",M)}return r==null||r({quantity:L.data.quantity,balance:L.data.balance}),!0}return o==null||o(f),!1}catch(C){if(console.info("JolicoinRewardHandler error:",C),C instanceof Error&&C.message=="CANCEL")throw C;return o==null||o(f),!1}finally{i.clearCache()}})},Dr=(e,t,n)=>nh(e,t,"JOLI_COIN",n);var dl=(e,{onUnlockSuccess:t,onUnlockFailed:n,hasSubscription:r})=>{let o=()=>{n==null||n()},i=St("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Ct("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),s=Rt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Dr("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:ye,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};var fl=(e,{onUnlockSuccess:t,onUnlockFailed:n,hasSubscription:r})=>{let o=d=>{var y;n==null||n(),(y=d.adBreakDone)==null||y.call(d,{breakType:d.type,breakFormat:d.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=St("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Ct("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),s=Rt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Dr("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:ye,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};ue();H();Re();Re();var hl=e=>{let{showSubscriptionModal:t}=e;Ge.registerCommand("Rewards.subscription",()=>A(void 0,null,function*(){var s,l;let n=yield ye.getData(),r=(l=(s=n==null?void 0:n.options)==null?void 0:s.find(d=>d.type==="JOLI_GEM"))==null?void 0:l.type,o=$e[r?"JOLI_GEM":"JOLI_COIN"],i=o.getCurrentUser(n);return o.isEnough(n,i)?{result:"FAILED"}:{result:(yield t())==="SUCCESS"?"SUCCESS":"FAILED"}}))},ml=e=>()=>A(void 0,null,function*(){let t=Ve(Q,kr);return Q.emit(Or,e),(yield t.getFreshData()).result});ue();var pl=(e,t,{handlers:{handleSubSuccess:n,handleSubFailed:r,unlockOptionsHandler:o,showSubscriptionModal:i,hasSubscription:a}})=>{hl({showSubscriptionModal:i});let s=["Rewards.subscription"];return l=>A(void 0,null,function*(){var d,y,f,p,h,b;try{let I=yield o.getData();if(!fn(I,a))return!1;let w=!0;for(let T of s){let L=yield Ge.executeCommand(T);if(w=w&&L.result!=="FAILED",L.result!=="CONTINUE")break}if(At(t),Jt(t),console.log("-----unlockWithSubscription result-----",w),w){try{(y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in l&&((f=l.adViewed)==null||f.call(l)),(b=(h=P).onEnvConfigChanged)==null||b.call(h,{hostUserInfo:Ie($({},(p=P.hostUserInfo)!=null?p:{isLogin:!1}),{isSubUser:!0})})}catch(T){console.error("-----unlockWithSubscription adBreakDone error-----",T)}return n==null||n(),!0}return r==null||r(l),!1}catch(I){if(console.info("SubscriptionRewardHandler error:",I),I instanceof Error&&I.message=="CANCEL")throw I;return r==null||r(l),!1}finally{}})};var vl=(e,{onSubSuccess:t,onSubFailed:n,hasSubscription:r})=>{let o=()=>{n==null||n()},i=ml("SUBSCRIPTION");return pl("SUBSCRIPTION",e,{handlers:{handleSubSuccess:t,handleSubFailed:o,unlockOptionsHandler:ye,showSubscriptionModal:i,hasSubscription:r}})};var We=ll();Si(We);Ci(We);var Mr,G,bl,Ji,Ot,gl,El,Il,Al,Fi,Mi,Gi,oh,hn={},Sl=[],ih=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mn=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function Hi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function pn(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Mr.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Ur(e,a,r,o,null)}function Ur(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++bl:o,__i:-1,__u:0};return o==null&&G.vnode!=null&&G.vnode(i),i}function mt(e){return e.children}function De(e,t){this.props=e,this.context=t}function Ft(e,t){if(t==null)return e.__?Ft(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Ft(e):null}function Cl(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Cl(e)}}function _l(e){(!e.__d&&(e.__d=!0)&&Ot.push(e)&&!Br.__r++||gl!==G.debounceRendering)&&((gl=G.debounceRendering)||El)(Br)}function Br(){for(var e,t,n,r,o,i,a,s=1;Ot.length;)Ot.length>s&&Ot.sort(Il),e=Ot.shift(),s=Ot.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,i=[],a=[],t.__P&&((n=ot({},r)).__v=r.__v+1,G.vnode&&G.vnode(n),qi(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,o==null?Ft(r):o,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,kl(i,n,a),n.__e!=o&&Cl(n)));Br.__r=0}function Rl(e,t,n,r,o,i,a,s,l,d,y){var f,p,h,b,I,C,w=r&&r.__k||Sl,T=t.length;for(l=ah(n,t,w,l,T),f=0;f<T;f++)(h=n.__k[f])!=null&&(p=h.__i===-1?hn:w[h.__i]||hn,h.__i=f,C=qi(e,h,p,o,i,a,s,l,d,y),b=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&ji(p.ref,null,h),y.push(h.ref,h.__c||b,h)),I==null&&b!=null&&(I=b),4&h.__u||p.__k===h.__k?l=Ol(h,l,e):typeof h.type=="function"&&C!==void 0?l=C:b&&(l=b.nextSibling),h.__u&=-7);return n.__e=I,l}function ah(e,t,n,r,o){var i,a,s,l,d,y=n.length,f=y,p=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=i+p,(a=e.__k[i]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Ur(null,a,null,null,null):mn(a)?Ur(mt,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Ur(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=sh(a,n,l,f))!==-1&&(f--,(s=n[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(o>y?p--:o<y&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=l&&(d==l-1?p--:d==l+1?p++:(d>l?p--:p++,a.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<y;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Ft(s)),xl(s,s));return r}function Ol(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Ol(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Ft(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function vn(e,t){return t=t||[],e==null||typeof e=="boolean"||(mn(e)?e.some(function(n){vn(n,t)}):t.push(e)),t}function sh(e,t,n,r){var o,i,a=e.key,s=e.type,l=t[n];if(l===null&&e.key==null||l&&a==l.key&&s===l.type&&!(2&l.__u))return n;if(r>(l!=null&&!(2&l.__u)?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o--}if(i<t.length){if((l=t[i])&&!(2&l.__u)&&a==l.key&&s===l.type)return i;i++}}return-1}function yl(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||ih.test(t)?n:n+"px"}function Nr(e,t,n,r,o){var i;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||yl(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||yl(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Al,"$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]=n,n?r?n.t=r.t:(n.t=Fi,e.addEventListener(t,i?Gi:Mi,i)):e.removeEventListener(t,i?Gi:Mi,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]=n==null?"":n;break e}catch(a){}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function wl(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.u==null)t.u=Fi++;else if(t.u<n.t)return;return n(G.event?G.event(t):t)}}}function qi(e,t,n,r,o,i,a,s,l,d){var y,f,p,h,b,I,C,w,T,L,M,V,S,D,B,F,N,J=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=t.__e=n.__e]),(y=G.__b)&&y(t);e:if(typeof J=="function")try{if(w=t.props,T="prototype"in J&&J.prototype.render,L=(y=J.contextType)&&r[y.__c],M=y?L?L.props.value:y.__:r,n.__c?C=(f=t.__c=n.__c).__=f.__E:(T?t.__c=f=new J(w,M):(t.__c=f=new De(w,M),f.constructor=J,f.render=ch),L&&L.sub(f),f.props=w,f.state||(f.state={}),f.context=M,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&J.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=ot({},f.__s)),ot(f.__s,J.getDerivedStateFromProps(w,f.__s))),h=f.props,b=f.state,f.__v=t,p)T&&J.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&J.getDerivedStateFromProps==null&&w!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(w,f.__s,M)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(f.props=w,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(Y){Y&&(Y.__=t)}),V=0;V<f._sb.length;V++)f.__h.push(f._sb[V]);f._sb=[],f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,M),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,b,I)})}if(f.context=M,f.props=w,f.__P=e,f.__e=!1,S=G.__r,D=0,T){for(f.state=f.__s,f.__d=!1,S&&S(t),y=f.render(f.props,f.state,f.context),B=0;B<f._sb.length;B++)f.__h.push(f._sb[B]);f._sb=[]}else do f.__d=!1,S&&S(t),y=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++D<25);f.state=f.__s,f.getChildContext!=null&&(r=ot(ot({},r),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(I=f.getSnapshotBeforeUpdate(h,b)),F=y,y!=null&&y.type===mt&&y.key==null&&(F=Tl(y.props.children)),s=Rl(e,mn(F)?F:[F],t,n,r,o,i,a,s,l,d),f.base=t.__e,t.__u&=-161,f.__h.length&&a.push(f),C&&(f.__E=f.__=null)}catch(Y){if(t.__v=null,l||i!=null)if(Y.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else for(N=i.length;N--;)Hi(i[N]);else t.__e=n.__e,t.__k=n.__k;G.__e(Y,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=lh(n.__e,t,n,r,o,i,a,l,d);return(y=G.diffed)&&y(t),128&t.__u?void 0:s}function kl(e,t,n){for(var r=0;r<n.length;r++)ji(n[r],n[++r],n[++r]);G.__c&&G.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){G.__e(i,o.__v)}})}function Tl(e){return typeof e!="object"||e==null?e:mn(e)?e.map(Tl):ot({},e)}function lh(e,t,n,r,o,i,a,s,l){var d,y,f,p,h,b,I,C=n.props,w=t.props,T=t.type;if(T=="svg"?o="http://www.w3.org/2000/svg":T=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((h=i[d])&&"setAttribute"in h==!!T&&(T?h.localName==T:h.nodeType==3)){e=h,i[d]=null;break}}if(e==null){if(T==null)return document.createTextNode(w);e=document.createElementNS(o,T,w.is&&w),s&&(G.__m&&G.__m(t,i),s=!1),i=null}if(T===null)C===w||s&&e.data===w||(e.data=w);else{if(i=i&&Mr.call(e.childNodes),C=n.props||hn,!s&&i!=null)for(C={},d=0;d<e.attributes.length;d++)C[(h=e.attributes[d]).name]=h.value;for(d in C)if(h=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")f=h;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;Nr(e,d,null,h,o)}}for(d in w)h=w[d],d=="children"?p=h:d=="dangerouslySetInnerHTML"?y=h:d=="value"?b=h:d=="checked"?I=h:s&&typeof h!="function"||C[d]===h||Nr(e,d,h,C[d],o);if(y)s||f&&(y.__html===f.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(f&&(e.innerHTML=""),Rl(t.type==="template"?e.content:e,mn(p)?p:[p],t,n,r,T=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Ft(n,0),s,l),i!=null)for(d=i.length;d--;)Hi(i[d]);s||(d="value",T=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||T=="progress"&&!b||T=="option"&&b!==C[d])&&Nr(e,d,b,C[d],o),d="checked",I!==void 0&&I!==e[d]&&Nr(e,d,I,C[d],o))}return e}function ji(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){G.__e(o,n)}}function xl(e,t,n){var r,o;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ji(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){G.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&xl(r[o],t,n||typeof e.type!="function");n||Hi(e.__e),e.__c=e.__=e.__e=void 0}function ch(e,t,n){return this.constructor(e,n)}function Pl(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),G.__&&G.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],qi(t,e=(!r&&n||t).__k=pn(mt,null,[e]),o||hn,hn,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?Mr.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),kl(i,e,a)}Mr=Sl.slice,G={__e:function(e,t,n,r){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,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s}throw e}},bl=0,Ji=function(e){return e!=null&&e.constructor==null},De.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ot({},this.state),typeof e=="function"&&(e=e(ot({},n),this.props)),e&&ot(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_l(this))},De.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_l(this))},De.prototype.render=mt,Ot=[],El=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Il=function(e,t){return e.__v.__b-t.__v.__b},Br.__r=0,Al=/(PointerCapture)$|Capture$/i,Fi=0,Mi=wl(!1),Gi=wl(!0),oh=0;var Ht,ie,Vi,Ll,gn=0,Fl=[],se=G,Dl=se.__b,Nl=se.__r,Ul=se.diffed,Bl=se.__c,Ml=se.unmount,Gl=se.__;function Jr(e,t){se.__h&&se.__h(ie,e,gn||t),gn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Fr(e){return gn=1,Hl(ql,e)}function Hl(e,t,n){var r=Jr(Ht++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ql(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],d=r.t(l,s);l!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=ie,!ie.__f)){var o=function(s,l,d){if(!r.__c.__H)return!0;var y=r.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!i||i.call(this,s,l,d);var f=r.__c.props!==s;return y.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(f=!0)}}),i&&i.call(this,s,l,d)||f};ie.__f=!0;var i=ie.shouldComponentUpdate,a=ie.componentWillUpdate;ie.componentWillUpdate=function(s,l,d){if(this.__e){var y=i;i=void 0,o(s,l,d),i=y}a&&a.call(this,s,l,d)},ie.shouldComponentUpdate=o}return r.__N||r.__}function _n(e,t){var n=Jr(Ht++,3);!se.__s&&Xi(n.__H,t)&&(n.__=e,n.u=t,ie.__H.__h.push(n))}function Wi(e,t){var n=Jr(Ht++,4);!se.__s&&Xi(n.__H,t)&&(n.__=e,n.u=t,ie.__h.push(n))}function Ki(e){return gn=5,yn(function(){return{current:e}},[])}function yn(e,t){var n=Jr(Ht++,7);return Xi(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function zi(e,t){return gn=8,yn(function(){return e},t)}function uh(){for(var e;e=Fl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Gr),e.__H.__h.forEach($i),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,Dl&&Dl(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Gl&&Gl(e,t)},se.__r=function(e){Nl&&Nl(e),Ht=0;var t=(ie=e.__c).__H;t&&(Vi===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Gr),t.__h.forEach($i),t.__h=[],Ht=0)),Vi=ie},se.diffed=function(e){Ul&&Ul(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Fl.push(t)!==1&&Ll===se.requestAnimationFrame||((Ll=se.requestAnimationFrame)||dh)(uh)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Vi=ie=null},se.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Gr),n.__h=n.__h.filter(function(r){return!r.__||$i(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],se.__e(r,n.__v)}}),Bl&&Bl(e,t)},se.unmount=function(e){Ml&&Ml(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Gr(r)}catch(o){t=o}}),n.__H=void 0,t&&se.__e(t,n.__v))};var Jl=typeof requestAnimationFrame=="function";function dh(e){var t,n=function(){clearTimeout(r),Jl&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Jl&&(t=requestAnimationFrame(n))}function Gr(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function $i(e){var t=ie;e.__c=e.__(),ie=t}function Xi(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ql(e,t){return typeof t=="function"?t(e):t}function hh(e,t){for(var n in t)e[n]=t[n];return e}function jl(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Vl(e,t){this.props=e,this.context=t}(Vl.prototype=new De).isPureReactComponent=!0,Vl.prototype.shouldComponentUpdate=function(e,t){return jl(this.props,e)||jl(this.state,t)};var $l=G.__b;G.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),$l&&$l(e)};var fE=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var mh=G.__e;G.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}mh(e,t,n,r)};var Wl=G.unmount;function ec(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=hh({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return ec(r,t,n)})),e}function tc(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return tc(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Yi(){this.__u=0,this.o=null,this.__b=null}function nc(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Hr(){this.i=null,this.l=null}G.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Wl&&Wl(e)},(Yi.prototype=new De).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=nc(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=tc(l,l.__c.__P,l.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.o.pop();)d.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Yi.prototype.componentWillUnmount=function(){this.o=[]},Yi.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=ec(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&pn(mt,null,e.fallback);return o&&(o.__u&=-33),[pn(mt,null,t.__a?null:e.children),o]};var Kl=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Hr.prototype=new De).__a=function(e){var t=this,n=nc(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Kl(t,e,r)):o()};n?n(i):i()}},Hr.prototype.render=function(e){this.i=null,this.l=new Map;var t=vn(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Hr.prototype.componentDidUpdate=Hr.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Kl(e,n,t)})};var ph=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,vh=/^(?: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]/,gh=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,_h=/[A-Z0-9]/g,yh=typeof document!="undefined",wh=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Qi(e,t,n){return t.__k==null&&(t.textContent=""),Pl(e,t),typeof n=="function"&&n(),e?e.__c:null}De.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(De.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var zl=G.event;function bh(){}function Eh(){return this.cancelBubble}function Ih(){return this.defaultPrevented}G.event=function(e){return zl&&(e=zl(e)),e.persist=bh,e.isPropagationStopped=Eh,e.isDefaultPrevented=Ih,e.nativeEvent=e};var rc,Ah={enumerable:!1,configurable:!0,get:function(){return this.class}},Xl=G.vnode;G.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},i=r.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||yh&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||wh(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":gh.test(a)&&(a=l):l=a="oninput":i&&vh.test(a)?a=a.replace(_h,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&o[a=l]&&(a="oninputCapture"),o[a]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=vn(n.children).forEach(function(d){d.props.selected=o.value.indexOf(d.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=vn(n.children).forEach(function(d){d.props.selected=o.multiple?o.defaultValue.indexOf(d.props.value)!=-1:o.defaultValue==d.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Ah)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=ph,Xl&&Xl(e)};var Yl=G.__r;G.__r=function(e){Yl&&Yl(e),rc=e.__c};var Ql=G.diffed;G.diffed=function(e){Ql&&Ql(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),rc=null};var Sh=Object.defineProperty,Qr=Object.getOwnPropertySymbols,kc=Object.prototype.hasOwnProperty,Tc=Object.prototype.propertyIsEnumerable,oc=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ch=(e,t)=>{for(var n in t||(t={}))kc.call(t,n)&&oc(e,n,t[n]);if(Qr)for(var n of Qr(t))Tc.call(t,n)&&oc(e,n,t[n]);return e},Rh=(e,t)=>{var n={};for(var r in e)kc.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qr)for(var r of Qr(e))t.indexOf(r)<0&&Tc.call(e,r)&&(n[r]=e[r]);return n},xc=Object.defineProperty,Oh=Object.defineProperties,kh=Object.getOwnPropertyDescriptors,ic=Object.getOwnPropertySymbols,Th=Object.prototype.hasOwnProperty,xh=Object.prototype.propertyIsEnumerable,ac=(e,t,n)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ph=(e,t)=>{for(var n in t||(t={}))Th.call(t,n)&&ac(e,n,t[n]);if(ic)for(var n of ic(t))xh.call(t,n)&&ac(e,n,t[n]);return e},Lh=(e,t)=>Oh(e,kh(t)),Dh=(e,t)=>{for(var n in t)xc(e,n,{get:t[n],enumerable:!0})},Pc=(e,t,n,r)=>{for(var o=t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=a(o)||o);return o},Nh=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{s(n.next(l))}catch(d){o(d)}},a=l=>{try{s(n.throw(l))}catch(d){o(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,a);s((n=n.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 n=new Event("abort");this.signal.dispatchEvent(n)};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(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},t.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let o=this._eventListeners[n].indexOf(r);o!==-1&&this._eventListeners[n].splice(o,1)},t.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=e,window.AbortSignal=t}function Uh(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Bh(e){return typeof e=="string"}function Mh(e){return typeof e=="undefined"}function Gh(e){return Mh(e)||e===null}function Jh(e){return typeof e=="function"}function Lc(e){let t=e,n=null,r=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n||(n=new t(...i)),n};return r.prototype=t.prototype,r}var Fh=(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))(Fh||{});function wn(e){return function(){var t,n;((n=(t=globalThis.VConsole)==null?void 0:t[e])!=null?n:globalThis.console[e])(...arguments)}}var Hh={log:wn("log"),warn:wn("warn"),info:wn("info"),error:wn("error"),debug:wn("debug")};Object.assign(globalThis,{logger:Hh});var sc=Symbol.for("Jolibox.canIUseMap"),qh={};globalThis[sc]||(globalThis[sc]=qh);var lc=Symbol.for("Jolibox.canIUseMap.native"),jh={};globalThis[lc]||(globalThis[lc]=jh);var Dc=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Dc||{}),Nc=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Nc||{}),Uc=(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))(Uc||{}),cc=["name","params"],Vh=["name","type","location","target","extra","timestamp","userId"],$h=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function $r(e,t){return t.map(n=>{if(n==="params"&&e[n]){let r=e[n];return Object.keys(r).reduce((o,i)=>(o[i]=String(r[i]),o),{})}return e[n]})}function Wh(e){let t=e.location?$r(e.location,cc):null,n=e.target?$r(e.target,cc):null;return $r(Lh(Ph({},e),{location:t,target:n}),Vh)}function Kh(e){let t=e.events.map(r=>Wh(r)),n=$r(e.device,$h);return[e.protocolVersion,t,n,e.project]}function zh(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let r=e.get.call(window);return window.__joliboxLocalStorage__=r,r}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,n=Object.getOwnPropertyDescriptor(t,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}zh();var Vt=typeof window=="undefined",uc=()=>!Vt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Vt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Vt&&navigator.userAgent.includes("Android"),!Vt&&navigator.userAgent.includes("Mac"),!Vt&&navigator.userAgent.includes("FB_IAB"),!Vt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var ia=class aa{constructor(t){this.element=t,this.next=aa.Undefined,this.prev=aa.Undefined}};ia.Undefined=new ia(void 0);var oe=ia,Xh=class{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let e=this._first;for(;e!==oe.Undefined;){let t=e.next;e.prev=oe.Undefined,e.next=oe.Undefined,e=t}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new oe(e);if(this._first===oe.Undefined)this._first=n,this._last=n;else if(t){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==oe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oe.Undefined&&e.next!==oe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===oe.Undefined&&e.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):e.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):e.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oe.Undefined;)yield e.element,e=e.next}},Yh=0,bn=class{constructor(e){this.value=e,this.id=Yh++}},Sn=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,n;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof bn&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===e)):(this._listeners=void 0,this._size=0)),(n=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var n,r,o,i,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let l=new bn(e);return this._listeners?this._listeners instanceof bn?this._listeners=[this._listeners,l]:this._listeners.push(l):((r=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||r.call(n,this),this._listeners=l,(i=(o=this.options)==null?void 0:o.onDidFirstListener)==null||i.call(o,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,f,p;if(!this._disposed){if(this._listeners instanceof bn)this._listeners.id===l.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 h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(e,t){var n;if(!e)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){e.value(t);return}try{e.value(t)}catch(o){r(o)}}fire(e){this._listeners&&(this._listeners instanceof bn?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Qh=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var r;let o=(r=this.listeners.get(e))!=null?r:new Sn,i=l=>t(...l.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let s=this.cachedEventQueue.get(e);if(s&&n)for(let l of s)t(...l.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let n=this.listerHandlerMap.get(t);n&&(n.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),n=this.cachedEventQueue.get(e);for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];n||(n=new Xh,this.cachedEventQueue.set(e,n)),n.push({args:o}),t&&t.fire({event:e,args:o})}once(e,t){var n=this;let r=function(){t(...arguments),n.off(e,r)};this.on(e,r,!1)}},sa={};Dh(sa,{None:()=>Zh,filter:()=>tm,once:()=>Bc,toPromise:()=>em});var Zh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function em(e){return new Promise(t=>Bc(e)(t))}function Bc(e){return function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!1;return e(o=>{if(!r)return r=!0,t.call(n,o)},null)}}function tm(e,t){return(n=>{let r={onWillAddFirstListener(){n(o.fire,o)}},o=new Sn(r);return o.event})(function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(o=>t(o)&&n.call(r,o),null)})}var Zi=Symbol.for("Jolibox.hostEmitter"),nm=()=>{let e=new Qh;return globalThis[Zi]||(globalThis[Zi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Zi]};nm();function rm(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)om(e[r],t[r])}function om(e,t){if(Bh(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Jh(t)){try{if(e instanceof t)return}catch(n){}if(!Gh(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")}}var la=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Sn,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 n=[];for(let o of e.metadata.args)n.push(o.constraint);let r=e.handler;e.handler=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return rm(i,n),r(...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 n=this.getCommand(t);n&&e.set(t,n)}return e}};la=Pc([Lc],la);var dc=class{constructor(){this._onWillExecuteCommand=new Sn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Sn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new la,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Uh(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Nh(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,n):(yield Promise.all([Promise.race([this._activateStar(),sa.toPromise(sa.filter(this.registry.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,n))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this._onWillExecuteCommand.fire({commandId:e,args:r});let i=this.invokeFunction(t.handler,...r);return this._onDidExecuteCommand.fire({commandId:e,args:r}),i}_tryExecuteCommand(e,t){let n=this.registry.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let r=this.invokeFunction(n.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e(...n)}finally{}}};dc=Pc([Lc],dc);function Oe(e,t,n){return(t=im(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e){var t=am(e,"string");return typeof t=="symbol"?t:t+""}function am(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qt=e=>e?function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e==null||e(...n)}catch(o){console.error("Error calling function",o)}}:()=>{console.log("wrapUserFunction: fn is undefined")},ca=class{constructor(t){Oe(this,"context",void 0),Oe(this,"continueCallback",void 0),Oe(this,"adIsShowingCallback",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,"contextInfo",void 0),Oe(this,"wrapShowAdFn",n=>()=>{var r,o,i;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_REWARD",Ch({userEvent:a},this.paramsToTrack)),uc()&&this.context.track("mmp_ad_impression",{ad_network:(o=(r=this.currentProvider)==null?void 0:r.name)!=null?o:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(i=this.adIsShowingCallback)==null||i.call(this,!0);let s=qt(n);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}notifyIframeAdsEvent(t,n){window.parent&&window.parent.postMessage({type:t,data:n},"*"),window.dispatchEvent(new CustomEvent(t,{detail:n}))}get paramsToTrack(){var t,n,r,o,i,a;return{provider:(n=(t=this.currentProvider)==null?void 0:t.name)!=null?n:null,type:(r=this.currentClientParams)==null?void 0:r.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()=>{var n,r,o,i;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=qt(t);a==null||a(),((n=this.currentClientParams)==null?void 0:n.type)!=="reward"&&((r=this.adIsShowingCallback)==null||r.call(this,!0),uc()&&this.context.track("mmp_ad_impression",{ad_network:(i=(o=this.currentProvider)==null?void 0:o.name)!=null?i:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return n=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(n)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(n)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let n=qt(t);n==null||n()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let n=qt(t);n==null||n()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AFTER_AD",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let n=qt(t);n==null||n()}}}wrapAdBreakDone(t){return n=>{var r,o,i,a,s,l,d,y,f;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(o=(r=this.currentProvider)==null?void 0:r.name)!=null?o:null,breakType:n.breakType,breakName:(i=n.breakName)!=null?i:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_DONE",{provider:(s=(a=this.currentProvider)==null?void 0:a.name)!=null?s:null,breakType:n.breakType,breakName:(l=n.breakName)!=null?l:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),n.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let p=qt(t);p==null||p(n),(d=this.adIsShowingCallback)==null||d.call(this,!1),(y=this.continueCallback)==null||y.call(this,[!1,n]);break}default:{(f=this.continueCallback)==null||f.call(this,[!0,n]);break}}}}callAdBreakAndContinue(t,n,r,o){return A(this,null,function*(){return this.currentProvider=t,this.currentClientParams=n,this.adsHasResponse=!1,new Promise(i=>{this.continueCallback=i,this.adIsShowingCallback=o;let a;switch(n.type){case"preroll":{a={type:n.type,adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}case"reward":{a={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),beforeReward:this.wrapBeforeReward(n.beforeReward),adDismissed:this.wrapAdDismissed(n.adDismissed),adViewed:this.wrapAdViewed(n.adViewed),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}default:{a={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}}window.setTimeout(()=>{var s,l,d,y,f,p,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:n.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_TIMEOUT",{type:n.type,provider:(y=(d=this.currentProvider)==null?void 0:d.name)!=null?y:null}),(p=this.continueCallback)==null||p.call(this,[!0,{breakType:n.type,breakName:n.type==="preroll"?"":(f=n.name)!=null?f:"",breakFormat:n.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),t.adBreak(a,r),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function qr(e,t,n){return(t=sm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sm(e){var t=lm(e,"string");return typeof t=="symbol"?t:t+""}function lm(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ua=class{constructor(t){qr(this,"context",void 0),qr(this,"adBreakIsShowing",!1),qr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),qr(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",n=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function jr(e,t,n){return(t=cm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cm(e){var t=um(e,"string");return typeof t=="symbol"?t:t+""}function um(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var da=class{constructor(t){jr(this,"configs",null),jr(this,"firstRun",!0),jr(this,"context",void 0),jr(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return A(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,n;let r;if(!this.configs)this.init(),r=!this.firstRun;else{let o=(t=this.contextInfo.channel)!=null?t:"",i=this.configs[o],a=(n=i==null?void 0:i.interstitialRate)!=null?n:1;r=Math.random()<a}return this.firstRun=!1,r}};function it(e,t,n){return(t=dm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dm(e){var t=fm(e,"string");return typeof t=="symbol"?t:t+""}function fm(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fa=class{constructor(t,n){it(this,"name","ADSENSE"),it(this,"context",void 0),it(this,"contextInfo",void 0),it(this,"configured",!1),it(this,"initParams",void 0),it(this,"push",function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(r)}),it(this,"adConfig",r=>{let o=r,{onReady:i}=o,a=Rh(o,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(r))}),it(this,"adBreak",r=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(r)}),it(this,"adUnit",r=>A(this,null,function*(){var o,i,a,s;if(this.context.track("CallAdUnit",{adFormat:(i=(o=r.adFormat)==null?void 0:o.toString())!=null?i:null,fullWidthResponsive:(a=r.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:d,adFormat:y,fullWidthResponsive:f,style:p}=r,h;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?h=document.querySelector(l):h=l,!h)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)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",b),I&&C.setAttribute("data-ad-format",I),f&&C.setAttribute("data-full-width-responsive",f),p&&C.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",C.style.position="relative",h.appendChild(C),C.appendChild(w)}else h.appendChild(C),new MutationObserver(w=>{w.forEach(T=>{if(T.type==="attributes"&&T.attributeName==="data-ad-status"){let L=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:L!=null?L:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=n,window.adsbygoogle=window.adsbygoogle||[]}init(){return A(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let n="google-adsense",r=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(n)&&this.initParams.clientId){let o=document.createElement("script");o.id=n,o.async=!0,o.crossOrigin="anonymous",o.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,r&&o.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&o.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&o.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&o.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&o.setAttribute("data-admob-ads-only","on"),document.head.appendChild(o),this.context.track("LoadAdsenseCompleted",null)}})}};function hm(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 mm(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}var pm=function(){function e(n){var r=this;this._insertTag=function(o){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,i),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(mm(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=hm(r);try{o.insertRule(n,o.cssRules.length)}catch(i){}}else r.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},e}(),be="-ms-",Zr="-moz-",W="-webkit-",Mc="comm",Ra="rule",Oa="decl",vm="@import",Gc="@keyframes",gm="@layer",_m=Math.abs,oo=String.fromCharCode,ym=Object.assign;function wm(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function Jc(e){return e.trim()}function bm(e,t){return(e=t.exec(e))?e[0]:e}function K(e,t,n){return e.replace(t,n)}function ha(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function Cn(e,t,n){return e.slice(t,n)}function Ke(e){return e.length}function ka(e){return e.length}function Vr(e,t){return t.push(e),e}function Em(e,t){return e.map(t).join("")}var io=1,Kt=1,Fc=0,xe=0,fe=0,zt="";function ao(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:io,column:Kt,length:a,return:""}}function En(e,t){return ym(ao("",null,null,"",null,null,0),e,{length:-e.length},t)}function Im(){return fe}function Am(){return fe=xe>0?pe(zt,--xe):0,Kt--,fe===10&&(Kt=1,io--),fe}function Ue(){return fe=xe<Fc?pe(zt,xe++):0,Kt++,fe===10&&(Kt=1,io++),fe}function ze(){return pe(zt,xe)}function Wr(){return xe}function kn(e,t){return Cn(zt,e,t)}function Rn(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 Hc(e){return io=Kt=1,Fc=Ke(zt=e),xe=0,[]}function qc(e){return zt="",e}function Kr(e){return Jc(kn(xe-1,ma(e===91?e+2:e===40?e+1:e)))}function Sm(e){for(;(fe=ze())&&fe<33;)Ue();return Rn(e)>2||Rn(fe)>3?"":" "}function Cm(e,t){for(;--t&&Ue()&&!(fe<48||fe>102||fe>57&&fe<65||fe>70&&fe<97););return kn(e,Wr()+(t<6&&ze()==32&&Ue()==32))}function ma(e){for(;Ue();)switch(fe){case e:return xe;case 34:case 39:e!==34&&e!==39&&ma(fe);break;case 40:e===41&&ma(e);break;case 92:Ue();break}return xe}function Rm(e,t){for(;Ue()&&e+fe!==57&&!(e+fe===84&&ze()===47););return"/*"+kn(t,xe-1)+"*"+oo(e===47?e:Ue())}function Om(e){for(;!Rn(ze());)Ue();return kn(e,xe)}function km(e){return qc(zr("",null,null,null,[""],e=Hc(e),0,[0],e))}function zr(e,t,n,r,o,i,a,s,l){for(var d=0,y=0,f=a,p=0,h=0,b=0,I=1,C=1,w=1,T=0,L="",M=o,V=i,S=r,D=L;C;)switch(b=T,T=Ue()){case 40:if(b!=108&&pe(D,f-1)==58){ha(D+=K(Kr(T),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:D+=Kr(T);break;case 9:case 10:case 13:case 32:D+=Sm(b);break;case 92:D+=Cm(Wr()-1,7);continue;case 47:switch(ze()){case 42:case 47:Vr(Tm(Rm(Ue(),Wr()),t,n),l);break;default:D+="/"}break;case 123*I:s[d++]=Ke(D)*w;case 125*I:case 59:case 0:switch(T){case 0:case 125:C=0;case 59+y:w==-1&&(D=K(D,/\f/g,"")),h>0&&Ke(D)-f&&Vr(h>32?hc(D+";",r,n,f-1):hc(K(D," ","")+";",r,n,f-2),l);break;case 59:D+=";";default:if(Vr(S=fc(D,t,n,d,y,o,s,L,M=[],V=[],f),i),T===123)if(y===0)zr(D,t,S,S,M,i,f,s,V);else switch(p===99&&pe(D,3)===110?100:p){case 100:case 108:case 109:case 115:zr(e,S,S,r&&Vr(fc(e,S,S,0,0,o,s,L,o,M=[],f),V),o,V,f,s,r?M:V);break;default:zr(D,S,S,S,[""],V,0,s,V)}}d=y=h=0,I=w=1,L=D="",f=a;break;case 58:f=1+Ke(D),h=b;default:if(I<1){if(T==123)--I;else if(T==125&&I++==0&&Am()==125)continue}switch(D+=oo(T),T*I){case 38:w=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Ke(D)-1)*w,w=1;break;case 64:ze()===45&&(D+=Kr(Ue())),p=ze(),y=f=Ke(L=D+=Om(Wr())),T++;break;case 45:b===45&&Ke(D)==2&&(I=0)}}return i}function fc(e,t,n,r,o,i,a,s,l,d,y){for(var f=o-1,p=o===0?i:[""],h=ka(p),b=0,I=0,C=0;b<r;++b)for(var w=0,T=Cn(e,f+1,f=_m(I=a[b])),L=e;w<h;++w)(L=Jc(I>0?p[w]+" "+T:K(T,/&\f/g,p[w])))&&(l[C++]=L);return ao(e,t,n,o===0?Ra:s,l,d,y)}function Tm(e,t,n){return ao(e,t,n,Mc,oo(Im()),Cn(e,2,-2),0)}function hc(e,t,n,r){return ao(e,t,n,Oa,Cn(e,0,r),Cn(e,r+1,-1),r)}function Wt(e,t){for(var n="",r=ka(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function xm(e,t,n,r){switch(e.type){case gm:if(e.children.length)break;case vm:case Oa:return e.return=e.return||e.value;case Mc:return"";case Gc:return e.return=e.value+"{"+Wt(e.children,r)+"}";case Ra:e.value=e.props.join(",")}return Ke(n=Wt(e.children,r))?e.return=e.value+"{"+n+"}":""}function Pm(e){var t=ka(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}function Lm(e){return function(t){t.root||(t=t.return)&&e(t)}}function Dm(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Nm=function(e,t,n){for(var r=0,o=0;r=o,o=ze(),r===38&&o===12&&(t[n]=1),!Rn(o);)Ue();return kn(e,xe)},Um=function(e,t){var n=-1,r=44;do switch(Rn(r)){case 0:r===38&&ze()===12&&(t[n]=1),e[n]+=Nm(xe-1,t,n);break;case 2:e[n]+=Kr(r);break;case 4:if(r===44){e[++n]=ze()===58?"&\f":"",t[n]=e[n].length;break}default:e[n]+=oo(r)}while(r=Ue());return e},Bm=function(e,t){return qc(Um(Hc(e),t))},mc=new WeakMap,Mm=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!mc.get(n))&&!r){mc.set(e,!0);for(var o=[],i=Bm(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var d=0;d<a.length;d++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[d]):a[d]+" "+i[s]}}},Gm=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function jc(e,t){switch(wm(e,t)){case 5103:return W+"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 W+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return W+e+Zr+e+be+e+e;case 6828:case 4268:return W+e+be+e+e;case 6165:return W+e+be+"flex-"+e+e;case 5187:return W+e+K(e,/(\w+).+(:[^]+)/,W+"box-$1$2"+be+"flex-$1$2")+e;case 5443:return W+e+be+"flex-item-"+K(e,/flex-|-self/,"")+e;case 4675:return W+e+be+"flex-line-pack"+K(e,/align-content|flex-|-self/,"")+e;case 5548:return W+e+be+K(e,"shrink","negative")+e;case 5292:return W+e+be+K(e,"basis","preferred-size")+e;case 6060:return W+"box-"+K(e,"-grow","")+W+e+be+K(e,"grow","positive")+e;case 4554:return W+K(e,/([^-])(transform)/g,"$1"+W+"$2")+e;case 6187:return K(K(K(e,/(zoom-|grab)/,W+"$1"),/(image-set)/,W+"$1"),e,"")+e;case 5495:case 3959:return K(e,/(image-set\([^]*)/,W+"$1$`$1");case 4968:return K(K(e,/(.+:)(flex-)?(.*)/,W+"box-pack:$3"+be+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+W+e+e;case 4095:case 3583:case 4068:case 2532:return K(e,/(.+)-inline(.+)/,W+"$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(Ke(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return K(e,/(.+:)(.+)-([^]+)/,"$1"+W+"$2-$3$1"+Zr+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ha(e,"stretch")?jc(K(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,Ke(e)-3-(~ha(e,"!important")&&10))){case 107:return K(e,":",":"+W)+e;case 101:return K(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+W+(pe(e,14)===45?"inline-":"")+"box$3$1"+W+"$2$3$1"+be+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return W+e+be+K(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return W+e+be+K(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return W+e+be+K(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return W+e+be+e+e}return e}var Jm=function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Oa:e.return=jc(e.value,e.length);break;case Gc:return Wt([En(e,{value:K(e.value,"@","@"+W)})],r);case Ra:if(e.length)return Em(e.props,function(o){switch(bm(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Wt([En(e,{props:[K(o,/:(read-\w+)/,":"+Zr+"$1")]})],r);case"::placeholder":return Wt([En(e,{props:[K(o,/:(plac\w+)/,":"+W+"input-$1")]}),En(e,{props:[K(o,/:(plac\w+)/,":"+Zr+"$1")]}),En(e,{props:[K(o,/:(plac\w+)/,be+"input-$1")]})],r)}return""})}},Fm=[Jm],Hm=function(e){var t=e.key;if(t==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(b){var I=b.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var r=e.stylisPlugins||Fm,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(b){for(var I=b.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)o[I[C]]=!0;a.push(b)});var s,l=[Mm,Gm];{var d,y=[xm,Lm(function(b){d.insert(b)})],f=Pm(l.concat(r,y)),p=function(b){return Wt(km(b),f)};s=function(b,I,C,w){d=C,p(b?b+"{"+I.styles+"}":I.styles),w&&(h.inserted[I.name]=!0)}}var h={key:t,sheet:new pm({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:s};return h.sheet.hydrate(a),h};function qm(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&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)}var jm={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},Vm=/[A-Z]|^ms/g,$m=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Vc=function(e){return e.charCodeAt(1)===45},pc=function(e){return e!=null&&typeof e!="boolean"},ea=Dm(function(e){return Vc(e)?e:e.replace(Vm,"-$&").toLowerCase()}),vc=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace($m,function(n,r,o){return pt={name:r,styles:o,next:pt},r})}return jm[e]!==1&&!Vc(e)&&typeof t=="number"&&t!==0?t+"px":t};function eo(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return pt={name:o.name,styles:o.styles,next:pt},o.name;var i=n;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)pt={name:a.name,styles:a.styles,next:pt},a=a.next;var s=i.styles+";";return s}return Wm(e,t,n)}}var l=n;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function Wm(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=eo(e,t,n[o])+";";else for(var i in n){var a=n[i];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?r+=i+"{"+t[s]+"}":pc(s)&&(r+=ea(i)+":"+vc(i,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)pc(a[l])&&(r+=ea(i)+":"+vc(i,a[l])+";");else{var d=eo(e,t,a);switch(i){case"animation":case"animationName":{r+=ea(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var gc=/label:\s*([^\s;{]+)\s*(;|$)/g,pt;function ta(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";pt=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,o+=eo(n,t,i);else{var a=i;o+=a[0]}for(var s=1;s<e.length;s++)if(o+=eo(n,t,e[s]),r){var l=i;o+=l[s]}gc.lastIndex=0;for(var d="",y;(y=gc.exec(o))!==null;)d+="-"+y[1];var f=qm(o)+d;return{name:f,styles:o,next:pt}}function $c(e,t,n){var r="";return n.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(r+=o+" ")}),r}var Km=function(e,t,n){var r=e.key+"-"+t.name;e.registered[r]===void 0&&(e.registered[r]=t.styles)},zm=function(e,t,n){Km(e,t);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function _c(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function yc(e,t,n){var r=[],o=$c(e,r,n);return r.length<2?n:o+t(r)}var Xm=function(e){var t=Hm(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=ta(s,t.registered,void 0);return zm(t,d),t.key+"-"+d.name},r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=ta(s,t.registered),y="animation-"+d.name;return _c(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=ta(s,t.registered);_c(t,d)},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return yc(t.registered,n,Ym(s))};return{css:n,cx:i,injectGlobal:o,keyframes:r,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:$c.bind(null,t.registered),merge:yc.bind(null,t.registered,n)}},Ym=function e(t){for(var n="",r=0;r<t.length;r++){var o=t[r];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&&(n&&(n+=" "),n+=i)}}return n},Qm=Xm({key:"css"}),Xt=Qm.css,pa,Ne,na,wc,bc=0,Wc=[],he=G,Ec=he.__b,Ic=he.__r,Ac=he.diffed,Sc=he.__c,Cc=he.unmount,Rc=he.__;function Zm(e,t){he.__h&&he.__h(Ne,e,bc||t),bc=0;var n=Ne.__H||(Ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Kc(e,t){var n=Zm(pa++,7);return np(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ep(){for(var e;e=Wc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Xr),e.__H.__h.forEach(va),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){Ne=null,Ec&&Ec(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rc&&Rc(e,t)},he.__r=function(e){Ic&&Ic(e),pa=0;var t=(Ne=e.__c).__H;t&&(na===Ne?(t.__h=[],Ne.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Xr),t.__h.forEach(va),t.__h=[],pa=0)),na=Ne},he.diffed=function(e){Ac&&Ac(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wc.push(t)!==1&&wc===he.requestAnimationFrame||((wc=he.requestAnimationFrame)||tp)(ep)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),na=Ne=null},he.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Xr),n.__h=n.__h.filter(function(r){return!r.__||va(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],he.__e(r,n.__v)}}),Sc&&Sc(e,t)},he.unmount=function(e){Cc&&Cc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Xr(r)}catch(o){t=o}}),n.__H=void 0,t&&he.__e(t,n.__v))};var Oc=typeof requestAnimationFrame=="function";function tp(e){var t,n=function(){clearTimeout(r),Oc&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Oc&&(t=requestAnimationFrame(n))}function Xr(e){var t=Ne,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Ne=t}function va(e){var t=Ne;e.__c=e.__(),Ne=t}function np(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}var rp=Symbol.for("preact-signals");function so(){if(vt>1)vt--;else{for(var e,t=!1;In!==void 0;){var n=In;for(In=void 0,ga++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Xc(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(ga=0,vt--,t)throw e}}function Te(e){if(vt>0)return e();vt++;try{return e()}finally{so()}}var Z=void 0,In=void 0,vt=0,ga=0,to=0;function zc(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 ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=rp;ve.prototype.h=function(){return!0};ve.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)};ve.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}};ve.prototype.subscribe=function(e){var t=this;return xn(function(){var n=t.value,r=Z;Z=void 0;try{e(n)}finally{Z=r}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Z;Z=void 0;try{return this.value}finally{Z=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=zc(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ga>100)throw new Error("Cycle detected");this.v=e,this.i++,to++,vt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{so()}}}});function ee(e){return new ve(e)}function Xc(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 Yc(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Qc(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Yt(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=to-1,this.f=4}(Yt.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===to))return!0;if(this.g=to,this.f|=1,this.i>0&&!Xc(this))return this.f&=-2,!0;var e=Z;try{Yc(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(n){this.v=n,this.f|=16,this.i++}return Z=e,Qc(this),this.f&=-2,!0};Yt.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)}ve.prototype.S.call(this,e)};Yt.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};Yt.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(Yt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=zc(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function An(e){return new Yt(e)}function Zc(e){var t=e.u;if(e.u=void 0,typeof t=="function"){vt++;var n=Z;Z=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ta(e),r}finally{Z=n,so()}}}function Ta(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Zc(e)}function op(e){if(Z!==this)throw new Error("Out-of-order effect");Qc(this),Z=e,this.f&=-2,8&this.f&&Ta(this),so()}function Tn(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Tn.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()}};Tn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Zc(this),Yc(this),vt++;var e=Z;return Z=this,op.bind(this,e)};Tn.prototype.N=function(){2&this.f||(this.f|=2,this.o=In,In=this)};Tn.prototype.d=function(){this.f|=8,1&this.f||Ta(this)};function xn(e){var t=new Tn(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var eu,ra,tu=[];xn(function(){eu=this.N})();function Qt(e,t){G[e]=t.bind(null,G[e]||function(){})}function no(e){ra&&ra(),ra=e&&e.S()}function nu(e){var t=this,n=e.data,r=ru(n);r.value=n;var o=Kc(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=An(function(){var h=r.value.value;return h===0?0:h===!0?"":h||""}),y=An(function(){return!Array.isArray(d.value)&&!Ji(d.value)}),f=xn(function(){if(this.N=ou,y.value){var h=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),p=t.__$u.d;return t.__$u.d=function(){f(),p.call(this)},[y,d]},[]),i=o[0],a=o[1];return i.value?a.peek():a.value}nu.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:nu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Qt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof ve&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});Qt("__r",function(e,t){no();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(o){var i;return xn(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),no(n),e(t)});Qt("__e",function(e,t,n,r){no(),e(t,n,r)});Qt("diffed",function(e,t){no();var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var a in i){var s=i[a];s!==void 0&&!(a in r)&&(s.d(),i[a]=void 0)}else i={},n.U=i;for(var l in r){var d=i[l],y=r[l];d===void 0?(d=ip(n,l,y,o),i[l]=d):d.o(y,o)}}}e(t)});function ip(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=ee(n);return{o:function(a,s){i.value=a,r=s},d:xn(function(){this.N=ou;var a=i.value.value;r[t]!==a&&(r[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Qt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});Qt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});De.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&n.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(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||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};function ru(e){return Kc(function(){return ee(e)},[])}var ap=function(e){queueMicrotask(function(){queueMicrotask(e)})};function sp(){Te(function(){for(var e;e=tu.shift();)eu.call(e)})}function ou(){tu.push(this)===1&&(G.requestAnimationFrame||ap)(sp)}var Ee=Xt`
1
+ var Td=Object.create;var Oa=Object.defineProperty,xd=Object.defineProperties,Pd=Object.getOwnPropertyDescriptor,Dd=Object.getOwnPropertyDescriptors,Ld=Object.getOwnPropertyNames,jn=Object.getOwnPropertySymbols,os=Object.getPrototypeOf,ka=Object.prototype.hasOwnProperty,ss=Object.prototype.propertyIsEnumerable,Nd=Reflect.get;var is=(t,e,n)=>e in t?Oa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,W=(t,e)=>{for(var n in e||(e={}))ka.call(e,n)&&is(t,n,e[n]);if(jn)for(var n of jn(e))ss.call(e,n)&&is(t,n,e[n]);return t},Ce=(t,e)=>xd(t,Dd(e));var ln=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,n)=>(typeof require!="undefined"?require:e)[n]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ls=(t,e)=>{var n={};for(var r in t)ka.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&jn)for(var r of jn(t))e.indexOf(r)<0&&ss.call(t,r)&&(n[r]=t[r]);return n};var ae=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ta=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ud=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ld(e))!ka.call(t,a)&&a!==n&&Oa(t,a,{get:()=>e[a],enumerable:!(r=Pd(e,a))||r.enumerable});return t};var xa=(t,e,n)=>(n=t!=null?Td(os(t)):{},Ud(e||!t||!t.__esModule?Oa(n,"default",{value:t,enumerable:!0}):n,t));var cs=(t,e,n)=>Nd(os(t),n,e);var S=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});function qd(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function Ja(t){return typeof t=="string"}function vs(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}function gs(t){return typeof t=="object"&&Array.isArray(t)}function Vd(t){return typeof t=="undefined"}function $d(t){return Vd(t)||t===null}function Kd(t){return typeof t=="function"}function _s(t){let e=t,n=null,r=function(...a){return n||(n=new e(...a)),n};return r.prototype=e.prototype,r}function ys(t,e,n){if(typeof n!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function r(a,i){for(let o in i)if(Object.prototype.hasOwnProperty.call(i,o)){let s=a[o],l=i[o],d=n(s,l,o,a,i);d!==void 0?a[o]=d:fs(l)&&fs(s)?a[o]=r(Ga({},s),l):Array.isArray(l)&&Array.isArray(s)?a[o]=[...s,...l]:a[o]=l}return a}return r(t,e)}function fs(t){return t&&typeof t=="object"&&t.constructor===Object}function ws(t,e){if(Array.isArray(t))return t.concat(e)}function fn(t,e,n={}){let r=null,a,i,o,{leading:s=!1,trailing:l=!0}=n,d=()=>(o=t.apply(i,a),a=void 0,i=void 0,o),y=function(...f){a=f,i=this;let p=s&&!r;if(r&&clearTimeout(r),r=setTimeout(()=>{r=null,l&&!p&&d()},e),p)return d()};return y.cancel=()=>{r&&clearTimeout(r),r=null,a=i=void 0},y.flush=()=>{if(r)return clearTimeout(r),r=null,d()},y}function Xd(t,e){return(...n)=>e(t,...n)}function As(t){return e=>Xd(e,function(n,...r){if(typeof n=="function")try{return n.apply(this,r)}catch(a){t(new zd(`${a}`))}})}function cn(t){return(...e)=>{var n,r;((r=(n=globalThis.VConsole)==null?void 0:n[t])!=null?r:globalThis.console[t])(...e)}}function qn(t,e){return e.map(n=>{if(n==="params"&&t[n]){let r=t[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return t[n]})}function nf(t){let e=t.location?qn(t.location,ms):null,n=t.target?qn(t.target,ms):null;return qn(Hd(Ga({},t),{location:e,target:n}),ef)}function Va(t){let e=t.events.map(r=>nf(r)),n=qn(t.device,tf);return[t.protocolVersion,e,n,t.project]}function rf(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let t=Object.getOwnPropertyDescriptor(window,"localStorage");if(t&&t.get){let r=t.get.call(window);return window.__joliboxLocalStorage__=r,r}if(t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),t&&t.get)return t.get.call(window);let e=Window.prototype,n=Object.getOwnPropertyDescriptor(e,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(t){return console.warn("Failed to get original localStorage, fallback to default implementation",t),localStorage}}function Wa(t,e,n){let r=window.location.hostname,a=r.split("."),i=n?e:t;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(r))return`${i}.jolibox.com`;if(a.length>=2){let o=a.slice(-2).join(".");if(o==="jolibox.com"||o==="pico-game.com"||o==="joyslite.com")return`${i}.${o}`}return`${i}.jolibox.com`}function Rs(t){return Wa("app","stg-app",t)}function Gt(t){return`https://${Wa("api","stg-api",t)}`}function df(t){return Wa("collect","stg-collect",t)}function Os(t){return`https://${df(t)}`}function pf(t){return new Promise(e=>ks(t)(e))}function ks(t){return(e,n=null)=>{let r=!1;return t(a=>{if(!r)return r=!0,e.call(n,a)},null)}}function vf(t,e){return(n=>{let r,a={onWillAddFirstListener(){r=n(i.fire,i)}},i=new dn(a);return i.event})((n,r=null)=>t(a=>e(a)&&n.call(r,a),null))}function _f(t,e){let n=Math.min(t.length,e.length);for(let r=0;r<n;r++)yf(t[r],e[r])}function yf(t,e){if(Ja(e)){if(typeof t!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(Kd(e)){try{if(t instanceof e)return}catch(n){}if(!$d(t)&&t.constructor===e||e.length===1&&e.call(void 0,t)===!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 wf(){return typeof globalThis!="undefined"?globalThis[Ts]:void 0}function bf(t){typeof globalThis!="undefined"&&(globalThis[Ts]=t)}function we(t=!1){let e=wf();if(!t&&e)return e;let n=new Vn,r=new Ba,a={registerCommand(i,o,s){n.registerCommand({id:i,handler:o,metadata:s})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return bf(a),a}var Ma,Bd,Md,Gd,us,Jd,Fd,ds,Ga,Hd,jd,ps,bt,Wd,Fa,Ha,bs,Es,zd,Is,$n,Kn,ja,Ne,Da,Yd,qa,hs,Qd,Et,Mt,Zd,ms,ef,tf,je,Bt,af,Re,of,sf,lf,Ss,$a,Ka,cf,uf,Cs,It,La,ie,ff,hf,un,dn,$e,Ua,mf,Pa,gf,pt,Vn,Ba,Ts,q=ae(()=>{"use strict";Ma=Object.defineProperty,Bd=Object.defineProperties,Md=Object.getOwnPropertyDescriptor,Gd=Object.getOwnPropertyDescriptors,us=Object.getOwnPropertySymbols,Jd=Object.prototype.hasOwnProperty,Fd=Object.prototype.propertyIsEnumerable,ds=(t,e,n)=>e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ga=(t,e)=>{for(var n in e||(e={}))Jd.call(e,n)&&ds(t,n,e[n]);if(us)for(var n of us(e))Fd.call(e,n)&&ds(t,n,e[n]);return t},Hd=(t,e)=>Bd(t,Gd(e)),jd=(t,e)=>{for(var n in e)Ma(t,n,{get:e[n],enumerable:!0})},ps=(t,e,n,r)=>{for(var a=r>1?void 0:r?Md(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=(r?o(e,n,a):o(a))||a);return r&&a&&Ma(e,n,a),a},bt=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});if(typeof window!="undefined"&&!window.AbortController){let t=function(){this.signal=new e};t.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let n=new Event("abort");this.signal.dispatchEvent(n)};let e=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(e.prototype,"aborted",{get:function(){return this._aborted}}),e.prototype.addEventListener=function(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},e.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let a=this._eventListeners[n].indexOf(r);a!==-1&&this._eventListeners[n].splice(a,1)},e.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=t,window.AbortSignal=e}Wd=(t=>(t[t.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",t[t.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",t[t.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",t[t.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",t[t.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",t[t.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",t[t.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",t[t.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",t))(Wd||{}),Fa=class extends Error{constructor(t){if(typeof t=="string"){super(t),this.priority="P1";return}super(t.message),this.priority="P1",this.stack=t.stack,this.raw=t}},Ha=class extends Fa{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},bs=class extends Fa{constructor(){super(...arguments),this.kind="USER_ERROR"}},Es=class extends bs{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},zd=class extends bs{constructor(t,e,n){super(t),this.message=t,this.errNo=e,this.name="USER_CUSTOM_ERROR",this.errMsg=t,n&&(this.extra=Object.assign({},this.extra,n))}},Is=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},$n=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Kn=class extends Fa{constructor(t,e,n,r,a){super(t),this.message=t,this.code=e,this.kind="API_ERROR",this.name="API_ERROR",n&&(this.errorType=n),r!==void 0&&(this.stack=r),a&&(this.priority=a)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},ja=class extends Ha{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:cn("log"),warn:cn("warn"),info:cn("info"),error:cn("error"),debug:cn("debug")};Object.assign(globalThis,{logger:Ne});Da=Symbol.for("Jolibox.canIUseMap"),Yd={};globalThis[Da]||(globalThis[Da]=Yd);qa={get config(){return globalThis[Da]}},hs=Symbol.for("Jolibox.canIUseMap.native"),Qd={};globalThis[hs]||(globalThis[hs]=Qd);Et=(t=>(t[t.Other=0]="Other",t[t.Route=1]="Route",t[t.Click=2]="Click",t[t.View=3]="View",t[t.Expose=4]="Expose",t[t.Swipe=5]="Swipe",t[t.Input=6]="Input",t[t.Select=7]="Select",t[t.SwitchOn=8]="SwitchOn",t[t.SwitchOff=9]="SwitchOff",t[t.Submit=10]="Submit",t[t.Scroll=11]="Scroll",t[t.Hide=12]="Hide",t[t.System=1e3]="System",t[t.ErrorTrace=1001]="ErrorTrace",t[t.UserDefined=1002]="UserDefined",t))(Et||{}),Mt=(t=>(t.MiniGame="mini-game",t.MiniDrama="mini-drama",t.App="app",t.WebSDK="web-sdk",t.AppSDK="app-sdk",t))(Mt||{}),Zd=(t=>(t[t.App=0]="App",t[t.H5=1]="H5",t[t.Weapp=2]="Weapp",t[t.Alipay=3]="Alipay",t[t.Gcash=4]="Gcash",t[t.Dana=5]="Dana",t[t.Umma=6]="Umma",t[t.WebSDK=1e3]="WebSDK",t[t.AppSDK=1001]="AppSDK",t[t.Other=9999]="Other",t))(Zd||{}),ms=["name","params"],ef=["name","type","location","target","extra","timestamp","userId"],tf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];je=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)});rf();Bt=typeof window=="undefined",af=()=>!Bt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Re={isiOS:!Bt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),iosVersion:()=>{let t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3]||"0",10)]},isAndroid:!Bt&&navigator.userAgent.includes("Android"),isMac:!Bt&&navigator.userAgent.includes("Mac"),isFacebook:!Bt&&navigator.userAgent.includes("FB_IAB"),isPC:!Bt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},of=()=>Re.isiOS?"iOS":Re.isAndroid?"Android":Re.isMac?"Mac":Re.isFacebook?"Facebook":"PC",sf="device_id",lf="advertising_id",Ss=t=>(window.__joliboxLocalStorage__.getItem(t)||window.__joliboxLocalStorage__.setItem(t,je()),window.__joliboxLocalStorage__.getItem(t)),$a=()=>new URLSearchParams(window.location.search).get("deviceId")||Ss(sf),Ka=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ss(lf),cf=t=>t.charAt(0).toUpperCase()+t.slice(1),uf=()=>{var t;let e=new URLSearchParams(window.location.search);return cf((t=e.get("utm_source"))!=null?t:"")||"JoliboxSDK"},Cs=t=>{if(af())return window.navigator.userAgent;let e="JoliboxWebSDK",n=of(),r=navigator.language,a=$a(),i=Ka();return`${e} (${uf()}${n}; UnknownModel; UnknownSystemVersion; ${r}) uuid/${a} adid/${i} version/${t||""}`};It=class{constructor(t,e={}){this.requestAdapter=t,this.cache=new Map,this.pendingRequests=new Map,this.requestSequence=0,this.cacheSequences=new Map,this.config=Ga({duration:10*60*1e3,timeout:3e3,keyGenerator:(n,r)=>n,consistencyChecker:()=>!0},e)}request(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e),r=this.pendingRequests.get(n);if(r)return console.log(`[RequestCacheService] Reusing pending request for ${t}`),r;let a=this.requestInternal(t,e),i=this.createTimeoutPromise(),o=Promise.race([a,i]).catch(s=>bt(this,null,function*(){if(s.message.includes("timeout")){let l=this.getValidCachedData(n);if(l)return console.warn(`[RequestCacheService] Request timeout, falling back to cache for ${t}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}throw s}));this.pendingRequests.set(n,o),a.then(s=>{console.log(`[RequestCacheService] Background request completed successfully for ${t}`)}).catch(s=>{console.warn(`[RequestCacheService] Background request failed for ${t}:`,s)});try{return yield o}finally{this.pendingRequests.delete(n)}})}requestInternal(t,e){return bt(this,null,function*(){var n,r,a,i;let o=this.config.keyGenerator(t,e),s=++this.requestSequence,l=this.getValidCachedData(o);if(console.log("[RequestCacheService] requestInternal start",t,"cached:",l),l){if(this.requestAdapter.extractRealTimeData&&this.requestAdapter.mergeData)try{let f=yield this.requestAdapter.execute(t,e),p=this.requestAdapter.extractRealTimeData(f),h=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,f);return h&&!this.config.consistencyChecker(l,h)?(console.log(`[RequestCacheService] Cache invalidated due to data change for ${t}`),this.setCachedDataWithSequence(o,h,s),f):this.requestAdapter.mergeData(l,p)}catch(f){return console.warn(`[RequestCacheService] Failed to fetch real-time data, using cache only for ${t}:`,f),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}return console.log(`[RequestCacheService] use cache for ${t}`),this.requestAdapter.processCachedData?this.requestAdapter.processCachedData(l):l}console.log(`[RequestCacheService] Cache miss, fetching fresh data for ${t} (sequence: ${s})`);let d=yield this.requestAdapter.execute(t,e),y=(i=(a=this.requestAdapter).extractCacheableData)==null?void 0:i.call(a,d);return y&&this.setCachedDataWithSequence(o,y,s),d})}createTimeoutPromise(){return new Promise((t,e)=>{setTimeout(()=>{e(new Error(`[RequestCacheService] Request timeout after ${this.config.timeout/1e3} seconds`))},this.config.timeout)})}getValidCachedData(t){let e=this.cache.get(t);return e?Date.now()>e.expiresAt?(this.cache.delete(t),null):e.data:null}setCachedDataWithSequence(t,e,n,r){let a=this.cache.get(t);if(a&&a.sequence>n){console.log(`[RequestCacheService] Ignoring stale cache update for ${t} (current: ${a.sequence}, incoming: ${n})`);return}let i=Date.now();this.cache.set(t,{data:JSON.parse(JSON.stringify(e)),timestamp:i,expiresAt:i+this.config.duration,key:t,sequence:n,metadata:r}),this.cacheSequences.set(t,n),console.log(`[RequestCacheService] Updated cache for ${t} with sequence ${n}`)}refreshCache(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e);return this.cache.delete(n),this.request(t,e)})}forceRequest(t,e){return bt(this,null,function*(){var n,r;let a=this.config.keyGenerator(t,e),i=++this.requestSequence;console.log(`[RequestCacheService] Force request for ${t} (sequence: ${i})`);let o=yield this.requestAdapter.execute(t,e),s=(r=(n=this.requestAdapter).extractCacheableData)==null?void 0:r.call(n,o);return s&&(this.setCachedDataWithSequence(a,s,i),console.log(`[RequestCacheService] Force updated cache for ${t}`)),o})}warmupCache(t,e){return bt(this,null,function*(){let n=this.config.keyGenerator(t,e);if(this.pendingRequests.has(n)){console.log(`[RequestCacheService] Skipping warmup for ${t} - request in progress`);return}if(this.hasValidCache(n)){console.log(`[RequestCacheService] Skipping warmup for ${t} - valid cache exists`);return}try{console.log(`[RequestCacheService] Warming up cache for ${t}`),yield this.forceRequest(t,e)}catch(r){console.warn(`[RequestCacheService] Cache warmup failed for ${t}:`,r)}})}clearCache(t){t?(this.cache.delete(t),this.cacheSequences.delete(t),this.pendingRequests.delete(t),console.log(`[RequestCacheService] Cleared cache for ${t}`)):(this.cache.clear(),this.cacheSequences.clear(),this.pendingRequests.clear(),this.requestSequence=0,console.log("[RequestCacheService] Cleared all cache"))}clearExpiredCache(){let t=Date.now();for(let[e,n]of this.cache)t>n.expiresAt&&(this.cache.delete(e),this.cacheSequences.delete(e));console.log("[RequestCacheService] Cleared expired cache entries")}getCacheStats(){let t=Date.now(),e=0,n=0;for(let r of this.cache.values())t>r.expiresAt?n++:e++;return{cacheCount:this.cache.size,validCount:e,expiredCount:n,pendingRequestCount:this.pendingRequests.size}}getCacheKeys(){return Array.from(this.cache.keys())}hasValidCache(t){let e=this.cache.get(t);return e?Date.now()<=e.expiresAt:!1}getPendingRequestKeys(){return Array.from(this.pendingRequests.keys())}hasPendingRequest(t){return this.pendingRequests.has(t)}getCacheSequence(t){return this.cacheSequences.get(t)}},La=class Na{constructor(e){this.element=e,this.next=Na.Undefined,this.prev=Na.Undefined}};La.Undefined=new La(void 0);ie=La,ff=class{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let t=this._first;for(;t!==ie.Undefined;){let e=t.next;t.prev=ie.Undefined,t.next=ie.Undefined,t=e}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new ie(t);if(this._first===ie.Undefined)this._first=n,this._last=n;else if(e){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==ie.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==ie.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==ie.Undefined&&t.next!==ie.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===ie.Undefined&&t.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):t.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):t.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==ie.Undefined;)yield t.element,t=t.next}},hf=0,un=class{constructor(t){this.value=t,this.id=hf++}},dn=class{constructor(t){this.options=t,this._size=0}dispose(t){var e,n;this._disposed||(this._disposed=!0,this._listeners&&(t?(this._listeners instanceof un&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===t)):(this._listeners=void 0,this._size=0)),(n=(e=this.options)==null?void 0:e.onDidRemoveLastListener)==null||n.call(e))}get event(){var t;return(t=this._event)!=null||(this._event=(e,n)=>{var r,a,i,o,s,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};n&&(e=e.bind(n));let d=new un(e);return this._listeners?this._listeners instanceof un?this._listeners=[this._listeners,d]:this._listeners.push(d):((a=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||a.call(r,this),this._listeners=d,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,f,p,h;if(!this._disposed){if(this._listeners instanceof un)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(f=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||f.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((h=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||h.call(p)))}}}}),this._event}_deliver(t,e){var n;if(!t)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){t.value(e);return}try{t.value(e)}catch(a){r(a)}}fire(t){this._listeners&&(this._listeners instanceof un?this._deliver(this._listeners,t):this._listeners.forEach(e=>this._deliver(e,t)))}hasListeners(){return this._size>0}},$e=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(t,e,n=!0){var r;let a=(r=this.listeners.get(t))!=null?r:new dn,i=l=>e(...l.args),o=a.event(i);this.listerHandlerMap.set(e,{handler:i,dispose:o}),this.listeners.set(t,a);let s=this.cachedEventQueue.get(t);if(s&&n)for(let l of s)e(...l.args)}flushCachedEvent(t){t?this.cachedEventQueue.delete(t):this.cachedEventQueue.clear()}off(t,e){let n=this.listerHandlerMap.get(e);n&&(n.dispose(),this.listerHandlerMap.delete(e))}emit(t,...e){let n=this.listeners.get(t),r=this.cachedEventQueue.get(t);r||(r=new ff,this.cachedEventQueue.set(t,r)),r.push({args:e}),n&&n.fire({event:t,args:e})}once(t,e){let n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n,!1)}},Ua={};jd(Ua,{None:()=>mf,filter:()=>vf,once:()=>ks,toPromise:()=>pf});mf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Pa=Symbol.for("Jolibox.hostEmitter"),gf=()=>{let t=new $e;return globalThis[Pa]||(globalThis[Pa]={on:t.on.bind(t),off:t.off.bind(t),emit:t.emit.bind(t),once:t.once.bind(t)}),globalThis[Pa]},pt=gf();Vn=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new dn,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(t){if(!t)throw new Error("invalid command");if(t.metadata&&Array.isArray(t.metadata.args)){let n=[];for(let a of t.metadata.args)n.push(a.constraint);let r=t.handler;t.handler=function(...a){return _f(a,n),r(...a)}}let{id:e}=t;this._commands.get(e)&&console.info(`[Jolibox SDK] duplicated command is registered ${e}`),this._commands.set(e,t),this._onDidRegisterCommand.fire(e)}getCommand(t){return this._commands.get(t)}getCommands(){let t=new Map;for(let e of this._commands.keys()){let n=this.getCommand(e);n&&t.set(e,n)}return t}};Vn=ps([_s],Vn);Ba=class{constructor(){this._onWillExecuteCommand=new dn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new dn,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Vn,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=qd(3e4)),this._starActivation}executeCommand(t,...e){return bt(this,null,function*(){return this.registry.getCommand(t)?this._tryExecuteCommand(t,e):(yield Promise.all([Promise.race([this._activateStar(),Ua.toPromise(Ua.filter(this.registry.onDidRegisterCommand,n=>n===t))])]),this._tryExecuteCommand(t,e))})}executeCommandThowErr(t,...e){if(!this.registry.getCommand(t))throw new Error(`command '${t}' not found`);let n=this.registry.getCommand(t);this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),r}_tryExecuteCommand(t,e){let n=this.registry.getCommand(t);if(!n)return Promise.reject(new Error(`command '${t}' not found`));try{this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(t,...e){let n=!1;try{return t(...e)}finally{n=!0}}};Ba=ps([_s],Ba);Ts=Symbol.for("Jolibox.commands")});function Ue(t,e={}){za.emit("ERROR_REPORT",{error:t,options:e})}var za,At,et=ae(()=>{"use strict";q();q();za=new $e,At=new $e;Ue.debounce=fn(Ue,50,{leading:!0})});var Xa,Ef,xs,Ps,Ds=ae(()=>{"use strict";q();et();Xa=t=>{let e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4),r=atob(e+n);try{return JSON.parse(r)}catch(a){return{}}},Ef=t=>{let e=JSON.stringify(t);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},xs=t=>{var e;try{let a=(e=new URL(t).searchParams.get("joliSource"))==null?void 0:e.split(".");if(a!=null&&a.length){let[i,o,s]=a;return{headerJson:Xa(i),payloadJson:Xa(o),signature:Xa(s)}}else throw"joli_source is missing"}catch(n){return Ue(new Is(`${t} not a valid schema: ${n}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ps=(t,e)=>{let n=e.split(".");if(n&&n.length===3){let r=n[0],a=Ef(t),i=n[2];return`${r}.${a}.${i}`}return e}});var If,Wn,Ls,Ya=ae(()=>{"use strict";q();If="1.3.2",Wn=()=>If,Ls=()=>{let t=Wn();return`${Cs(t)}`}});function Za(t,e){return(document==null?void 0:document.head.querySelector(`meta[name="${t}"][content="${e}"]`))!==null}var Af,Ns,Qa,Us,oe,Sf,L,fe=ae(()=>{"use strict";q();Ds();Ya();q();Af={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:$a(),adId:Ka(),pixelRatio:window.devicePixelRatio||1,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Wn()},schema:window.location.href,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5"},Qa=(Ns=globalThis.joliboxJSCore)==null?void 0:Ns.env,oe=Object.assign({},(Us=Qa==null?void 0:Qa())!=null?Us:Af);Sf=()=>{var E,C,w,O,k,M,B,I,D,J,j;let{payloadJson:t,headerJson:e,signature:n}=oe.schema.length?xs(oe.schema):{},r=`${oe.deviceInfo.did}-${new Date().getTime()}`,i=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,o=(w=(C=(E=i.get("mpId"))!=null?E:i.get("appId"))!=null?C:i.get("gameId"))!=null?w:"",s=(M=(k=(O=oe.clientSessionId)!=null?O:t==null?void 0:t.sessionId)!=null?k:i.get("sessionId"))!=null?M:r,l=!!((I=(B=t==null?void 0:t.testAdsMode)!=null?B:t==null?void 0:t.__testAdsMode)!=null?I:i.get("testAdsMode")==="true"),d=(j=(J=(D=t==null?void 0:t.joliboxEnv)!=null?D:t==null?void 0:t.__joliboxEnv)!=null?J:i.get("joliboxEnv"))!=null?j:"production",y=d==="staging",f=e==null?void 0:e.channel,h=new URL(window.location.href).searchParams,b=t==null?void 0:t.__shouldInterupt;return{get startTime(){var N;return(N=performance.timeOrigin)!=null?N:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var N,G;return(G=(N=h.get("joliSource"))!=null?N:i.get("joliSource"))!=null?G:null},get mpId(){var N;return(N=o!=null?o:t==null?void 0:t.id)!=null?N:""},get mpVersion(){var N;return(N=e==null?void 0:e.ver)!=null?N:Wn()},get mpType(){var N,G;return(G=(N=e==null?void 0:e.__mpType)!=null?N:t==null?void 0:t.__mpType)!=null?G:"game"},get platform(){var N;return((N=oe.platform)!=null?N:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var N,G;return(G=(N=oe.clientSessionId)!=null?N:s)!=null?G:r},get channel(){return f},get webviewId(){var N;return(N=oe.webviewId)!=null?N:-1},get shouldInterupt(){return b},get from(){return t==null?void 0:t.__from},get baseApiHost(){return Rs(y)},get adId(){var N;return(N=oe.deviceInfo.adId)!=null?N:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Za("dlightek","jolibox")?"dlightek":i.get("huaweiQuick")==="true"?"huaweiQuick":Za("gamedistribution","jolibox")?"gamedistribution":Za("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var X,Z,He;let N=(X=oe.deviceInfo.pixelRatio)!=null?X:1,G=(Z=oe.deviceInfo.statusBarHeight)!=null?Z:t==null?void 0:t.__androidStatusBarHeight,F=(He=oe.deviceInfo.navigationBarHeight)!=null?He:t==null?void 0:t.__androidNavigationBarHeight;return{statusBarHeight:G!==void 0?G/N:20,navigationBarHeight:F!==void 0?F/N:10}},get abTests(){var N,G;return(G=(N=oe.abValues)==null?void 0:N.split(","))!=null?G:[]},get mpInfo(){var N;return(N=oe.mpInfo)!=null?N:{mpName:"unknown"}},onEnvConfigChanged:N=>{ys(oe,N,ws)},encodeJoliSourceQuery:N=>{var G,F;return e&&n?Ps(W(W({},t),N),(G=i.get("joliSource"))!=null?G:""):(F=i.get("joliSource"))!=null?F:""},setDoExitDirectly:()=>{b=!1}}},L=Sf()});var ei,Ms,Cf,Rf,Bs,Of,Gs=ae(()=>{"use strict";q();et();fe();q();ei=!1,Ms=(t,e)=>t==null?!1:e in t,Cf=t=>Ms(t,"kind"),Rf=t=>{let e=t.toLowerCase().split("_");return e[0]+e.slice(1).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")},Bs=(t,e={},n)=>{var i,o,s;let r={user_id:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:"",device_id:(s=L.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Rf(t.name)},a=Ce(W({},r),{env:e.environment,isFromUser:n});n?At.emit("GLOBAL_USER_ERROR",t,a):At.emit("GLOBAL_ERROR",t,a)},Of=t=>Ms(t,"kind")&&t.kind==="USER_ERROR";za.on("ERROR_REPORT",({error:t,options:e})=>{if(ei)return;ei=!0;let n=Cf(t)&&t.raw?t.raw:t;try{let r=Of(t);Bs(t,e,r)}catch(r){let a=r instanceof Error?r.message:String(r),i=new ja(`${a}, origin error: ${n.message}`);Ne.error(i),Bs(new ja(i.message),{environment:e.environment},!1)}finally{ei=!1}})});var ti,ni=ae(()=>{"use strict";et();q();et();ti=t=>new Es(t)});function Js(t,e){let n=(r,a,i)=>{let d=a!=null?a:{},{eventType:o}=d,s=ls(d,["eventType"]),l=Ce(W({tag:r,eventType:i!=null?i:o!=null?o:Et.Other},e),{extra:W({},s)});r=="globalJsError"?Ue(new $n(JSON.stringify(l))):t("systemLog",l,L.webviewId)};return n.debounce=fn(n,500,{leading:!0}),n}function Fs(t){let e=(n,r,a)=>{var s;let i=(s=a&&JSON.stringify(a))!=null?s:0,o={speed_value_type:n,total_duration:r};i&&Object.assign(o,{extra:i}),t("joliboxSpeedAnalysis",o)};return e.debounce=fn(e,500,{leading:!0}),e}var Hs=ae(()=>{"use strict";q();q();et();fe()});function js(t,e){let n=Js(t,e),r=Fs(n);return{track:n,trackPerformance:r}}var qs=ae(()=>{"use strict";Hs()});var ri=ae(()=>{"use strict"});var zn,Vs=ae(()=>{"use strict";fe();q();q();zn=class{constructor(e){this.apiHost=e;this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return S(this,null,function*(){let n=`${this.apiHost}/api/fe-configs/js-sdk/samples-config`,r=yield(yield fetch(n)).json();this.samplesConfig=r})}checkIsSampled(e){if(!this.samplesConfig)return!1;let{samples:n}=this.samplesConfig;for(let[r,a]of Object.entries(n))if(a.includes(e.name))return Math.floor(Math.random()*101)<parseFloat(r);return!1}getDevice(){var r,a,i,o,s;let{nativeSDKVersion:e,jssdkVersion:n}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(r=e!=null?e:n)!=null?r:"1.0.0",appId:(i=(a=L.hostInfo)==null?void 0:a.aid)!=null?i:"1",model:(o=L.deviceInfo.model)!=null?o:"UnknownModel",brand:(s=L.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:L.deviceInfo.did,jsSdkVersion:n,extra:{}}}getLocation(){let e=new URLSearchParams(window.location.search),n={};return e.forEach((r,a)=>{n[a]=r}),{name:"GamePage",params:n}}trackEvent(e,n,r){return S(this,null,function*(){if(this.checkIsSampled(e))return;let a=e.location?e.location:yield this.getLocation(),i=e.target||null,o=e.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[Ce(W({},e),{location:a,target:i,extra:o,timestamp:Date.now(),userId:null})],device:s,project:n};try{r?yield this.doReport(Va(d),r):yield this.doReport(Va(d))}catch(y){Ne.log("[Jolibox SDK] report API error",y)}})}}});var ai=ae(()=>{"use strict";qs();ri();Vs()});var ii,$s,tt,Xn,qe,Jt=ae(()=>{"use strict";Ya();fe();q();ii=t=>{let e=new AbortController;return setTimeout(()=>e.abort(),t),e.signal};($s=AbortSignal.timeout)!=null||(AbortSignal.timeout=ii);tt=class t{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(r=>r).length/this.networkRequests.length>=.6}static getInstance(){return t._instance||(t._instance=new t),t._instance}create(e){let n=new Xn(e);return t.getInstance().httpClients.add(n),n}recordNetworkRequest(e){this.networkRequests.push(e),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Xn=class{constructor(e){this.xua=Ls();this.getJoliSource=()=>L.joliSource;var r;let n=Gt(L.testMode);this.baseUrl=(r=e==null?void 0:e.baseUrl)!=null?r:n}get(e,n){return S(this,null,function*(){try{let{query:r,timeout:a}=n!=null?n:{},{headers:i}=n!=null?n:{},o=r?new URLSearchParams(r):null,s=o==null?void 0:o.toString(),l=`${this.baseUrl}${e}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();i=Object.assign({},i!=null?i:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let f=yield fetch(l,{method:"GET",headers:i,credentials:"include",signal:ii(a!=null?a:3e4)});return tt.getInstance().recordNetworkRequest(!0),yield f.json()}catch(r){throw tt.getInstance().recordNetworkRequest(!1),r}})}post(e,n){return S(this,null,function*(){try{let{data:r,query:a,timeout:i}=n!=null?n:{},{headers:o}=n!=null?n:{},s=a?new URLSearchParams(a):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${e}${l?`?${l}`:""}`,y=this.xua,f=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},f?{"x-joli-source":f}:{},{"x-os-type":Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:o,body:JSON.stringify(r),signal:ii(i!=null?i:3e4),credentials:"include"});tt.getInstance().recordNetworkRequest(!0);let h=p.headers.get("content-type");if(h!=null&&h.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(h!=null&&h.includes("multipart/form-data")||h!=null&&h.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(h!=null&&h.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(r){throw tt.getInstance().recordNetworkRequest(!1),r}})}put(e,n){return S(this,null,function*(){try{let{data:r,query:a,timeout:i}=n!=null?n:{},{headers:o}=n!=null?n:{},s=a?new URLSearchParams(a):null,l=s==null?void 0:s.toString(),d=`${this.baseUrl}${e}${l?`?${l}`:""}`,y=this.xua,f=this.getJoliSource();o=Object.assign({},o!=null?o:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},f?{"x-joli-source":f}:{});let p=yield fetch(d,{method:"PUT",headers:o,credentials:"include",body:JSON.stringify(r!=null?r:{})});if(!p.ok)throw tt.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return tt.getInstance().recordNetworkRequest(!0),yield p.json()}catch(r){throw console.error("Error:",r),r}})}};window.JoliboxHttpClient=Xn;qe=tt.getInstance()});var oi,Yn,si=ae(()=>{"use strict";fe();ai();Jt();q();oi=class extends zn{constructor(){super(...arguments);this.httpClient=qe.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n;return Os((n=L.testMode)!=null?n:!1)}doReport(n){this.httpClient.post("/report",{data:n,timeout:5e3}).catch(r=>{console.info("report error",r)})}},Yn=new oi(Gt(L.testMode))});var kf,Ks=ae(()=>{"use strict";Gs();q();ni();q();si();fe();kf=(t,e)=>{var a,i,o;let n={message:e.message,stack:(a=e.stack)!=null?a:"",errorType:e.name,source:0},r={name:t,type:Et.ErrorTrace,location:null,target:null,extra:n,timestamp:Date.now(),userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:null};Yn.trackEvent(r,Mt.WebSDK)};At.on("GLOBAL_ERROR",(t,e)=>{kf(e.tag,t)});At.on("GLOBAL_USER_ERROR",(t,e)=>{Ne.log("UserError",t,e)})});var Qn,Ws=ae(()=>{"use strict";Qn=class{constructor(e,n){this.eventEmitter=e;this.lastReportTime=0;this.visible=!0;this.reportCount=0;this.notifyIframeGameEvent=(e,n)=>{window.parent&&window.parent.postMessage({type:e,data:n},"*")};this.playGame=e=>{this.reportCount++,(this.reportCount<=3||(this.reportCount-3)%3===0)&&(this.reporter({event:"PLAY_GAME",params:{duration:e}}),this.tracker("PlayGame",{duration:e}),this.notifyIframeGameEvent("JOLIBOX_GAME_PLAY",{duration:e}))};this.timer=this.createRAFTimer(e=>{this.playGame(e)});this.interval=n!=null?n:5*1e3,e.on("visible",r=>{this.visible=r})}start(e){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:e!=null?e:0}}),this.tracker("OpenGame",{duration:e!=null?e:0}),this.notifyIframeGameEvent("JOLIBOX_GAME_OPEN",{duration:e!=null?e:0}),this.timer.start()}close(e){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:e}}),this.tracker("CloseGame",{duration:e}),this.notifyIframeGameEvent("JOLIBOX_GAME_CLOSE",{duration:e}),this.timer.stop()}createRAFTimer(e){let n=Date.now(),r,a,i=!1,o=0,s=()=>{if(!i)return;let h=Date.now(),b=h-n;b>=this.interval&&(this.visible&&(o+=Math.min(b,this.interval+1e3),e(o)),n=h),r=requestAnimationFrame(s)},l=()=>{y(),n=Date.now(),a=window.setInterval(()=>{if(!i)return;let h=Date.now();h-n>=this.interval&&(n=h)},this.interval)},d=()=>{f(),n=Date.now(),r=requestAnimationFrame(s)},y=()=>{r&&(cancelAnimationFrame(r),r=0)},f=()=>{a&&(clearInterval(a),a=0)};this.eventEmitter.on("visible",h=>{i&&(console.log("visible",h),h?d():l())});let p=this.visible;return{start(){i||(i=!0,p?d():l())},stop(){i=!1,y(),f()}}}}});var Zn,zs=ae(()=>{"use strict";fe();Ws();Jt();Zn=class extends Qn{constructor(n,r,a){super(r,a);this.httpClient=qe.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=n}reporter(n){return S(this,null,function*(){let{event:r,params:a,extraParams:i}=n,o={eventType:r,gameInfo:W({gameId:this.gameId,sessionId:this.sessionId},a)};i&&Object.assign(o,i),yield this.httpClient.post("/api/base/app-event",{data:o})})}tracker(n,r=null){this.track(n,r)}}});var Xs,Tf,Te,xf,li,nt,vt=ae(()=>{"use strict";Ks();q();q();ai();si();zs();fe();ri();Xs=we(),Tf={type:Mt.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:Te,trackPerformance:xf}=js((...t)=>{var o,s,l,d;let[,e]=t,n=e,r=vs(n.extra)?n.extra:Ja(n.extra)?JSON.parse(n.extra):{},a=Ce(W({},r),{mp_id:(o=n.mp_id)!=null?o:"",mp_version:(s=n.mp_version)!=null?s:""}),i={name:e.tag,type:Et.System,location:null,target:null,extra:a,timestamp:Date.now(),userId:(d=(l=L.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Yn.trackEvent(i,Mt.WebSDK)},Tf);Xs.registerCommand("ReportSDK.traceSystemTimeline",({event:t,duration:e,extra:n})=>{xf(t,e,n)});Xs.registerCommand("ReportSDK.traceSystem",({event:t,info:e})=>{Te(t,e)});li=new $e,nt=new Zn(Te,li)});function Ys(t){let e=qa.config[t];return e||(e={},qa.config[t]=e),(n,r)=>{if(e[n]){Ne.warn(`[can i use] ${n} already registered`);return}e[n]=W({},r)}}var Qs=ae(()=>{"use strict";q()});function ci(t){Zs=t}function er(t){return t===null||typeof t!="object"?t:Array.isArray(t)?t.map(e=>er(e)):Object.keys(t).reduce((e,n)=>(e[n]=er(t[n]),e),{})}function rt(t){return typeof t=="number"}function ui(t){let e=di(t);switch(e){case"string":return`"${t}"`;case"number":case"boolean":case"null":case"undefined":return String(t);default:return`a(n) ${e}`}}function di(t){return typeof t=="function"?"function":Object.prototype.toString.call(t).slice(8).slice(0,-1).toLowerCase()}var Zs,he,tr,nr,rr,ar,Ft,ir,or,sr,lr,cr,ur,dr,fr,hr,mr,pr,vr,fi=ae(()=>{"use strict";Zs=!1;he=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(e){if(Zs)if(typeof e=="string")this.errors.push(e);else{let n=`${this.path} should be ${e.expect}`;this._optional&&e.expect!=="undefined"?n+=" or undefined, ":n+=", ",n+=`but got ${ui(e.actual)}`,this.errors.push(n)}return!1}fallback(e){return this.hasFallback=!0,this._fallback=e,this}get fallbackValue(){return er(this._fallback)}default(e){return this.hasDefault=!0,this._default=e,this}get defaultValue(){return typeof this._default=="function"?this._default:er(this._default)}optional(){return this._optional=!0,this}};tr=class extends he{validate(e){return this._optional&&e===void 0?!0:rt(e)?rt(this._min)&&e<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):rt(this._max)&&e>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):rt(this._greater)&&e<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&e!==Math.floor(e)?this.fail(`the value of ${this.path} should be integer but got ${e}`):!0:this.fail({expect:"number",actual:e})}min(e){return this._min=e,this}max(e){return this._max=e,this}isInt(e){return this._isInt=e,this}greater(e){return this._greater=e,this}},nr=class extends he{validate(e){return this._optional&&e===void 0?!0:typeof e!="boolean"?this.fail({expect:"boolean",actual:e}):!0}},rr=class extends he{validate(e){if(this._optional&&e===void 0)return!0;if(typeof e!="string")return this.fail({expect:"string",actual:e});if(rt(this._maxLength)&&e.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(rt(this._minLength)&&e.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(e))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(e))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(e){return this._minLength=e,this}maxLength(e){return this._maxLength=e,this}pattern(e){return this._pattern=e,this}},ar=class extends he{validate(e){return this._optional&&e===void 0?!0:typeof e!="symbol"?this.fail({expect:"symbol",actual:e}):!0}},Ft=class extends he{validate(e){return!0}},ir=class extends he{validate(e){return e!==void 0?this.fail({expect:"undefined",actual:e}):!0}},or=class extends he{validate(e){return this._optional&&e===void 0?!0:e!==null?this.fail({expect:"null",actual:e}):!0}},sr=class extends he{validate(e){return this._optional&&e===void 0?!0:typeof e!="function"?this.fail({expect:"function",actual:e}):!0}},lr=class extends he{constructor(...e){super(),this._items=e}validate(e){if(this._optional&&e===void 0)return!0;if(!this._items.includes(e)){let n=this._items.map(r=>JSON.stringify(r)).join(", ");return this.fail(`expect ${this.path} to be one of ${n}, but got ${ui(e)}`)}return!0}},cr=class extends he{constructor(n){super();this._item=n}validate(n){if(this._optional&&n===void 0)return!0;if(!Array.isArray(n))return this.fail({expect:"array",actual:n});if(rt(this._minItems)&&n.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(rt(this._maxItems)&&n.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(rt(this._length)&&n.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let r=this._item;if(!r)return!0;let a=!0;if(n.forEach((i,o)=>{if(r.path=`${this.path}[${o}]`,r.errors=this.errors,i===void 0&&r.hasDefault){n[o]=r.defaultValue;return}r.validate(i)||(r.hasFallback?n[o]=r.fallbackValue:a=!1)}),this._uniqueItems){let i=new Map;for(let o in n)i.has(n[o])?a=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(n[o])}] and ${this.path}[${o}] are identical)`):i.set(n[o],o)}return a}minItems(n){return this._minItems=n,this}maxItems(n){return this._maxItems=n,this}uniqueItems(){return this._uniqueItems=!0,this}length(n){return this._length=n,this}},ur=class extends he{constructor(n){super();this._value=n}validate(n){if(this._optional&&n===void 0)return!0;if(di(n)!=="object")return this.fail({expect:"object",actual:n});let a=n,i=this._value;i.errors=this.errors;let o=!0;for(let s in a){let l=a[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?i.path=`${this.path}.${s}`:i.path=`${this.path}["${s}"]`,!(l===void 0&&i._optional)){if(l===void 0&&i.hasDefault){a[s]=i.defaultValue;continue}i.validate(l)||(i.hasFallback?a[s]=i.fallbackValue:o=!1)}}return o}},dr=class extends he{constructor(n={}){super();this._object=n}validate(n){if(this._optional&&n===void 0)return!0;if(di(n)!=="object")return this.fail({expect:"object",actual:n});let r=n,a=!0;for(let i in this._object){let o=r[i],s=this._object[i];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?s.path=`${this.path}.${i}`:s.path=`${this.path}["${i}"]`,!(s._optional&&o===void 0)){if(o===void 0&&s.hasDefault){r[i]=s.defaultValue;continue}s.validate(o)||(s.hasFallback?r[i]=s.fallbackValue:a=!1)}}return a}},fr=class extends he{constructor(n){super();this.value=n}validate(n){return n===void 0&&this._optional?!0:n!==this.value?this.fail({expect:ui(this.value),actual:n}):!0}},hr=class extends he{constructor(...e){super(),this._items=e}validate(e){if(e===void 0&&this._optional)return!0;let n=[],r=!1,a=this._items.length;for(let i=0;i<a;i++){let o=this._items[i];if(o.errors=[],o.path=this.path,!o.validate(e))n.push(o.errors.join("; "));else if(!r){r=!0;break}}if(!r){let i=n.join(`
2
+ or `);this.errors.push(i)}return r}},mr=class extends he{constructor(...e){super(),this._items=e;let n=0,r=e.length-1;for(;r>=0;r--){let a=e[r];if(a._optional||a.hasDefault)n+=1;else break}this._minItems=e.length-n}validate(e){if(e===void 0&&this._optional)return!0;if(!Array.isArray(e))return this.fail({expect:"array",actual:e});if(e.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let n=!0;return this._items.forEach((r,a)=>{if(r.path=`${this.path}[${a}]`,r.errors=this.errors,e[a]===void 0&&r.hasDefault){e[a]=r.defaultValue;return}r.validate(e[a])||(r.hasFallback?e[a]=r._fallback:n=!1)}),n}},pr=class extends he{validate(e){return e===void 0&&this._optional||e instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:e})}},vr=class extends he{constructor(e){super(),this._ctor=e}validate(e){return e===void 0&&this._optional||e instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:e})}}});function hi(t,e,n="param"){if(t.errors=[],t.path=n,ci(!0),!t.validate(e)){let r=t.errors.join(`
3
+ `);throw t.errors.length=0,ci(!1),new TypeError(r)}}var V,mi=ae(()=>{"use strict";fi();fi();V={object(t){return new dr(t)},array(t){return new cr(t)},tuple(...t){return new mr(...t)},literal(t){return new fr(t)},or(...t){return new hr(...t)},symbol(){return new ar},record(t){return new ur(t)},function(){return new sr},boolean(){return new nr},string(){return new rr},number(){return new tr},undefined(){return new ir},null(){return new or},unknown(){return new Ft},any(){return new Ft},as(){return new Ft},arraybuffer(){return new pr},enum(...t){return new lr(...t)},typedarray(t){return new vr(t)}}});var gr,el,tl=ae(()=>{"use strict";q();et();mi();ni();gr=1,el=t=>{function e(r,a){return(...i)=>{var f,p,h,b;let o=Date.now(),s={method:r,trace_id:gr};gr+=1;let l="SUCCESS",d=`${r}:ok`,y=0;try{if(a.paramsSchema)try{hi(a.paramsSchema,i,"params")}catch(O){throw ti(`${r}:fail ${O.message}`)}let E=a.implement(...i),C=E,w=`${r}:ok`;if(E&&"code"in E){let{code:O,data:k,message:M}=E;l=O,C=k,w=M}return{code:l,message:w,data:C}}catch(E){let C=E;y=(p=(f=C.code)!=null?f:C.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(h=C.message)!=null?h:C.errMsg)!=null?b:`${E}`;return d=`${r}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,Ue(new Kn(d,y)),{code:l,message:d}}finally{let E=Date.now()-o}}}function n(r,a){return(...i)=>S(this,null,function*(){var p,h,b,E;let o=gs(i)?i:[i],s=Date.now(),l={method:r,trace_id:gr};gr+=1;let d=`${r}:ok`,y="SUCCESS",f={code:y,message:d};try{if(a.paramsSchema)try{hi(a.paramsSchema,o,"params")}catch(O){throw ti(O.message)}let w=yield a.implement(...o);if(w&&"code"in w){let{code:O,data:k,message:M}=w;y=O,d=M,w=k}return Object.assign(f,{code:y,message:d,data:w}),f}catch(C){let w=C,O=(h=(p=w.code)!=null?p:w.errNo)!=null?h:2e3;y="FAILURE";let k=(E=(b=w.message)!=null?b:w.errMsg)!=null?E:`${C}`,M=`${r}:${y} ${k.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(f,{code:y,message:M}),Ue(new Kn(M,O)),f}finally{let C=Date.now()-s}})}return{createAPI:n,createSyncAPI:e}}});var at,St,be,hn=ae(()=>{"use strict";Qs();vt();tl();mi();({createAPI:at,createSyncAPI:St}=el(Te)),be=Ys("h5")});var il=Ta((al,_i)=>{(function(t){if(typeof al=="object"&&typeof _i!="undefined")_i.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return function r(a,i,o){function s(y,f){if(!i[y]){if(!a[y]){var p=typeof ln=="function"&&ln;if(!f&&p)return p(y,!0);if(l)return l(y,!0);var h=new Error("Cannot find module '"+y+"'");throw h.code="MODULE_NOT_FOUND",h}var b=i[y]={exports:{}};a[y][0].call(b.exports,function(E){var C=a[y][1][E];return s(C||E)},b,b.exports,r,a,i,o)}return i[y].exports}for(var l=typeof ln=="function"&&ln,d=0;d<o.length;d++)s(o[d]);return s}({1:[function(r,a,i){(function(o){"use strict";var s=o.MutationObserver||o.WebKitMutationObserver,l;if(s){var d=0,y=new s(E),f=o.document.createTextNode("");y.observe(f,{characterData:!0}),l=function(){f.data=d=++d%2}}else if(!o.setImmediate&&typeof o.MessageChannel!="undefined"){var p=new o.MessageChannel;p.port1.onmessage=E,l=function(){p.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?l=function(){var w=o.document.createElement("script");w.onreadystatechange=function(){E(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},o.document.documentElement.appendChild(w)}:l=function(){setTimeout(E,0)};var h,b=[];function E(){h=!0;for(var w,O,k=b.length;k;){for(O=b,b=[],w=-1;++w<k;)O[w]();k=b.length}h=!1}a.exports=C;function C(w){b.push(w)===1&&!h&&l()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(r,a,i){"use strict";var o=r(1);function s(){}var l={},d=["REJECTED"],y=["FULFILLED"],f=["PENDING"];a.exports=p;function p(I){if(typeof I!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,I!==s&&C(this,I)}p.prototype.catch=function(I){return this.then(null,I)},p.prototype.then=function(I,D){if(typeof I!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var J=new this.constructor(s);if(this.state!==f){var j=this.state===y?I:D;b(J,j,this.outcome)}else this.queue.push(new h(J,I,D));return J};function h(I,D,J){this.promise=I,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof J=="function"&&(this.onRejected=J,this.callRejected=this.otherCallRejected)}h.prototype.callFulfilled=function(I){l.resolve(this.promise,I)},h.prototype.otherCallFulfilled=function(I){b(this.promise,this.onFulfilled,I)},h.prototype.callRejected=function(I){l.reject(this.promise,I)},h.prototype.otherCallRejected=function(I){b(this.promise,this.onRejected,I)};function b(I,D,J){o(function(){var j;try{j=D(J)}catch(N){return l.reject(I,N)}j===I?l.reject(I,new TypeError("Cannot resolve promise with itself")):l.resolve(I,j)})}l.resolve=function(I,D){var J=w(E,D);if(J.status==="error")return l.reject(I,J.value);var j=J.value;if(j)C(I,j);else{I.state=y,I.outcome=D;for(var N=-1,G=I.queue.length;++N<G;)I.queue[N].callFulfilled(D)}return I},l.reject=function(I,D){I.state=d,I.outcome=D;for(var J=-1,j=I.queue.length;++J<j;)I.queue[J].callRejected(D);return I};function E(I){var D=I&&I.then;if(I&&(typeof I=="object"||typeof I=="function")&&typeof D=="function")return function(){D.apply(I,arguments)}}function C(I,D){var J=!1;function j(X){J||(J=!0,l.reject(I,X))}function N(X){J||(J=!0,l.resolve(I,X))}function G(){D(N,j)}var F=w(G);F.status==="error"&&j(F.value)}function w(I,D){var J={};try{J.value=I(D),J.status="success"}catch(j){J.status="error",J.value=j}return J}p.resolve=O;function O(I){return I instanceof this?I:l.resolve(new this(s),I)}p.reject=k;function k(I){var D=new this(s);return l.reject(D,I)}p.all=M;function M(I){var D=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=I.length,j=!1;if(!J)return this.resolve([]);for(var N=new Array(J),G=0,F=-1,X=new this(s);++F<J;)Z(I[F],F);return X;function Z(He,Jn){D.resolve(He).then(_a,function(Nt){j||(j=!0,l.reject(X,Nt))});function _a(Nt){N[Jn]=Nt,++G===J&&!j&&(j=!0,l.resolve(X,N))}}}p.race=B;function B(I){var D=this;if(Object.prototype.toString.call(I)!=="[object Array]")return this.reject(new TypeError("must be an array"));var J=I.length,j=!1;if(!J)return this.resolve([]);for(var N=-1,G=new this(s);++N<J;)F(I[N]);return G;function F(X){D.resolve(X).then(function(Z){j||(j=!0,l.resolve(G,Z))},function(Z){j||(j=!0,l.reject(G,Z))})}}},{1:1}],3:[function(r,a,i){(function(o){"use strict";typeof o.Promise!="function"&&(o.Promise=r(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(r,a,i){"use strict";var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function s(c,m){if(!(c instanceof m))throw new TypeError("Cannot call a class as a function")}function l(){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(c){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var c=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function f(c,m){c=c||[],m=m||{};try{return new Blob(c,m)}catch(v){if(v.name!=="TypeError")throw v;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,g=new u,_=0;_<c.length;_+=1)g.append(c[_]);return g.getBlob(m.type)}}typeof Promise=="undefined"&&r(3);var p=Promise;function h(c,m){m&&c.then(function(u){m(null,u)},function(u){m(u)})}function b(c,m,u){typeof m=="function"&&c.then(m),typeof u=="function"&&c.catch(u)}function E(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",O=void 0,k={},M=Object.prototype.toString,B="readonly",I="readwrite";function D(c){for(var m=c.length,u=new ArrayBuffer(m),g=new Uint8Array(u),_=0;_<m;_++)g[_]=c.charCodeAt(_);return u}function J(c){return new p(function(m){var u=c.transaction(w,I),g=f([""]);u.objectStore(w).put(g,"key"),u.onabort=function(_){_.preventDefault(),_.stopPropagation(),m(!1)},u.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function j(c){return typeof O=="boolean"?p.resolve(O):J(c).then(function(m){return O=m,O})}function N(c){var m=k[c.name],u={};u.promise=new p(function(g,_){u.resolve=g,u.reject=_}),m.deferredOperations.push(u),m.dbReady?m.dbReady=m.dbReady.then(function(){return u.promise}):m.dbReady=u.promise}function G(c){var m=k[c.name],u=m.deferredOperations.pop();if(u)return u.resolve(),u.promise}function F(c,m){var u=k[c.name],g=u.deferredOperations.pop();if(g)return g.reject(m),g.promise}function X(c,m){return new p(function(u,g){if(k[c.name]=k[c.name]||Go(),c.db)if(m)N(c),c.db.close();else return u(c.db);var _=[c.name];m&&_.push(c.version);var v=d.open.apply(d,_);m&&(v.onupgradeneeded=function(A){var R=v.result;try{R.createObjectStore(c.storeName),A.oldVersion<=1&&R.createObjectStore(w)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw T}}),v.onerror=function(A){A.preventDefault(),g(v.error)},v.onsuccess=function(){var A=v.result;A.onversionchange=function(R){R.target.close()},u(A),G(c)}})}function Z(c){return X(c,!1)}function He(c){return X(c,!0)}function Jn(c,m){if(!c.db)return!0;var u=!c.db.objectStoreNames.contains(c.storeName),g=c.version<c.db.version,_=c.version>c.db.version;if(g&&(c.version!==m&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),_||u){if(u){var v=c.db.version+1;v>c.version&&(c.version=v)}return!0}return!1}function _a(c){return new p(function(m,u){var g=new FileReader;g.onerror=u,g.onloadend=function(_){var v=btoa(_.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:c.type})},g.readAsBinaryString(c)})}function Nt(c){var m=D(atob(c.data));return f([m],{type:c.type})}function Mo(c){return c&&c.__local_forage_encoded_blob}function xu(c){var m=this,u=m._initReady().then(function(){var g=k[m._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return b(u,c,c),u}function Pu(c){N(c);for(var m=k[c.name],u=m.forages,g=0;g<u.length;g++){var _=u[g];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,Z(c).then(function(v){return c.db=v,Jn(c)?He(c):v}).then(function(v){c.db=m.db=v;for(var A=0;A<u.length;A++)u[A]._dbInfo.db=v}).catch(function(v){throw F(c,v),v})}function Ze(c,m,u,g){g===void 0&&(g=1);try{var _=c.db.transaction(c.storeName,m);u(null,_)}catch(v){if(g>0&&(!c.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!c.db||v.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),He(c)}).then(function(){return Pu(c).then(function(){Ze(c,m,u,g-1)})}).catch(u);u(v)}}function Go(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Du(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=c[g];var _=k[u.name];_||(_=Go(),k[u.name]=_),_.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=xu);var v=[];function A(){return p.resolve()}for(var R=0;R<_.forages.length;R++){var T=_.forages[R];T!==m&&v.push(T._initReady().catch(A))}var x=_.forages.slice(0);return p.all(v).then(function(){return u.db=_.db,Z(u)}).then(function(P){return u.db=P,Jn(u,m._defaultConfig.version)?He(u):P}).then(function(P){u.db=_.db=P,m._dbInfo=u;for(var U=0;U<x.length;U++){var $=x[U];$!==m&&($._dbInfo.db=u.db,$._dbInfo.version=u.version)}})}function Lu(c,m){var u=this;c=E(c);var g=new p(function(_,v){u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.get(c);x.onsuccess=function(){var P=x.result;P===void 0&&(P=null),Mo(P)&&(P=Nt(P)),_(P)},x.onerror=function(){v(x.error)}}catch(P){v(P)}})}).catch(v)});return h(g,m),g}function Nu(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.openCursor(),P=1;x.onsuccess=function(){var U=x.result;if(U){var $=U.value;Mo($)&&($=Nt($));var ee=c($,U.key,P++);ee!==void 0?_(ee):U.continue()}else _()},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function Uu(c,m,u){var g=this;c=E(c);var _=new p(function(v,A){var R;g.ready().then(function(){return R=g._dbInfo,M.call(m)==="[object Blob]"?j(R.db).then(function(T){return T?m:_a(m)}):m}).then(function(T){Ze(g._dbInfo,I,function(x,P){if(x)return A(x);try{var U=P.objectStore(g._dbInfo.storeName);T===null&&(T=void 0);var $=U.put(T,c);P.oncomplete=function(){T===void 0&&(T=null),v(T)},P.onabort=P.onerror=function(){var ee=$.error?$.error:$.transaction.error;A(ee)}}catch(ee){A(ee)}})}).catch(A)});return h(_,u),_}function Bu(c,m){var u=this;c=E(c);var g=new p(function(_,v){u.ready().then(function(){Ze(u._dbInfo,I,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=T.delete(c);R.oncomplete=function(){_()},R.onerror=function(){v(x.error)},R.onabort=function(){var P=x.error?x.error:x.transaction.error;v(P)}}catch(P){v(P)}})}).catch(v)});return h(g,m),g}function Mu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Ze(m._dbInfo,I,function(v,A){if(v)return _(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.clear();A.oncomplete=function(){g()},A.onabort=A.onerror=function(){var x=T.error?T.error:T.transaction.error;_(x)}}catch(x){_(x)}})}).catch(_)});return h(u,c),u}function Gu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Ze(m._dbInfo,B,function(v,A){if(v)return _(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.count();T.onsuccess=function(){g(T.result)},T.onerror=function(){_(T.error)}}catch(x){_(x)}})}).catch(_)});return h(u,c),u}function Ju(c,m){var u=this,g=new p(function(_,v){if(c<0){_(null);return}u.ready().then(function(){Ze(u._dbInfo,B,function(A,R){if(A)return v(A);try{var T=R.objectStore(u._dbInfo.storeName),x=!1,P=T.openKeyCursor();P.onsuccess=function(){var U=P.result;if(!U){_(null);return}c===0||x?_(U.key):(x=!0,U.advance(c))},P.onerror=function(){v(P.error)}}catch(U){v(U)}})}).catch(v)});return h(g,m),g}function Fu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){Ze(m._dbInfo,B,function(v,A){if(v)return _(v);try{var R=A.objectStore(m._dbInfo.storeName),T=R.openKeyCursor(),x=[];T.onsuccess=function(){var P=T.result;if(!P){g(x);return}x.push(P.key),P.continue()},T.onerror=function(){_(T.error)}}catch(P){_(P)}})}).catch(_)});return h(u,c),u}function Hu(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,_;if(!c.name)_=p.reject("Invalid arguments");else{var v=c.name===u.name&&g._dbInfo.db,A=v?p.resolve(g._dbInfo.db):Z(c).then(function(R){var T=k[c.name],x=T.forages;T.db=R;for(var P=0;P<x.length;P++)x[P]._dbInfo.db=R;return R});c.storeName?_=A.then(function(R){if(R.objectStoreNames.contains(c.storeName)){var T=R.version+1;N(c);var x=k[c.name],P=x.forages;R.close();for(var U=0;U<P.length;U++){var $=P[U];$._dbInfo.db=null,$._dbInfo.version=T}var ee=new p(function(te,de){var ce=d.open(c.name,T);ce.onerror=function(Je){var sn=ce.result;sn.close(),de(Je)},ce.onupgradeneeded=function(){var Je=ce.result;Je.deleteObjectStore(c.storeName)},ce.onsuccess=function(){var Je=ce.result;Je.close(),te(Je)}});return ee.then(function(te){x.db=te;for(var de=0;de<P.length;de++){var ce=P[de];ce._dbInfo.db=te,G(ce._dbInfo)}}).catch(function(te){throw(F(c,te)||p.resolve()).catch(function(){}),te})}}):_=A.then(function(R){N(c);var T=k[c.name],x=T.forages;R.close();for(var P=0;P<x.length;P++){var U=x[P];U._dbInfo.db=null}var $=new p(function(ee,te){var de=d.deleteDatabase(c.name);de.onerror=function(){var ce=de.result;ce&&ce.close(),te(de.error)},de.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},de.onsuccess=function(){var ce=de.result;ce&&ce.close(),ee(ce)}});return $.then(function(ee){T.db=ee;for(var te=0;te<x.length;te++){var de=x[te];G(de._dbInfo)}}).catch(function(ee){throw(F(c,ee)||p.resolve()).catch(function(){}),ee})})}return h(_,m),_}var ju={_driver:"asyncStorage",_initStorage:Du,_support:y(),iterate:Nu,getItem:Lu,setItem:Uu,removeItem:Bu,clear:Mu,length:Gu,key:Ju,keys:Fu,dropInstance:Hu};function qu(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vu="~~local_forage_type~",Jo=/^~~local_forage_type~([^~]+)~/,Fn="__lfsc__:",ya=Fn.length,wa="arbf",ba="blob",Fo="si08",Ho="ui08",jo="uic8",qo="si16",Vo="si32",$o="ur16",Ko="ui32",Wo="fl32",zo="fl64",Xo=ya+wa.length,Yo=Object.prototype.toString;function Qo(c){var m=c.length*.75,u=c.length,g,_=0,v,A,R,T;c[c.length-1]==="="&&(m--,c[c.length-2]==="="&&m--);var x=new ArrayBuffer(m),P=new Uint8Array(x);for(g=0;g<u;g+=4)v=ht.indexOf(c[g]),A=ht.indexOf(c[g+1]),R=ht.indexOf(c[g+2]),T=ht.indexOf(c[g+3]),P[_++]=v<<2|A>>4,P[_++]=(A&15)<<4|R>>2,P[_++]=(R&3)<<6|T&63;return x}function Ea(c){var m=new Uint8Array(c),u="",g;for(g=0;g<m.length;g+=3)u+=ht[m[g]>>2],u+=ht[(m[g]&3)<<4|m[g+1]>>4],u+=ht[(m[g+1]&15)<<2|m[g+2]>>6],u+=ht[m[g+2]&63];return m.length%3===2?u=u.substring(0,u.length-1)+"=":m.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function $u(c,m){var u="";if(c&&(u=Yo.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&Yo.call(c.buffer)==="[object ArrayBuffer]")){var g,_=Fn;c instanceof ArrayBuffer?(g=c,_+=wa):(g=c.buffer,u==="[object Int8Array]"?_+=Fo:u==="[object Uint8Array]"?_+=Ho:u==="[object Uint8ClampedArray]"?_+=jo:u==="[object Int16Array]"?_+=qo:u==="[object Uint16Array]"?_+=$o:u==="[object Int32Array]"?_+=Vo:u==="[object Uint32Array]"?_+=Ko:u==="[object Float32Array]"?_+=Wo:u==="[object Float64Array]"?_+=zo:m(new Error("Failed to get type for BinaryArray"))),m(_+Ea(g))}else if(u==="[object Blob]"){var v=new FileReader;v.onload=function(){var A=Vu+c.type+"~"+Ea(this.result);m(Fn+ba+A)},v.readAsArrayBuffer(c)}else try{m(JSON.stringify(c))}catch(A){console.error("Couldn't convert value into a JSON string: ",c),m(null,A)}}function Ku(c){if(c.substring(0,ya)!==Fn)return JSON.parse(c);var m=c.substring(Xo),u=c.substring(ya,Xo),g;if(u===ba&&Jo.test(m)){var _=m.match(Jo);g=_[1],m=m.substring(_[0].length)}var v=Qo(m);switch(u){case wa:return v;case ba:return f([v],{type:g});case Fo:return new Int8Array(v);case Ho:return new Uint8Array(v);case jo:return new Uint8ClampedArray(v);case qo:return new Int16Array(v);case $o:return new Uint16Array(v);case Vo:return new Int32Array(v);case Ko:return new Uint32Array(v);case Wo:return new Float32Array(v);case zo:return new Float64Array(v);default:throw new Error("Unkown type: "+u)}}var Ia={serialize:$u,deserialize:Ku,stringToBuffer:Qo,bufferToString:Ea};function Zo(c,m,u,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,g)}function Wu(c){var m=this,u={db:null};if(c)for(var g in c)u[g]=typeof c[g]!="string"?c[g].toString():c[g];var _=new p(function(v,A){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(R){return A(R)}u.db.transaction(function(R){Zo(R,u,function(){m._dbInfo=u,v()},function(T,x){A(x)})},A)});return u.serializer=Ia,_}function mt(c,m,u,g,_,v){c.executeSql(u,g,_,function(A,R){R.code===R.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(T,x){x.rows.length?v(T,R):Zo(T,m,function(){T.executeSql(u,g,_,v)},v)},v):v(A,R)},v)}function zu(c,m){var u=this;c=E(c);var g=new p(function(_,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[c],function(T,x){var P=x.rows.length?x.rows.item(0).value:null;P&&(P=A.serializer.deserialize(P)),_(P)},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function Xu(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT * FROM "+A.storeName,[],function(T,x){for(var P=x.rows,U=P.length,$=0;$<U;$++){var ee=P.item($),te=ee.value;if(te&&(te=A.serializer.deserialize(te)),te=c(te,ee.key,$+1),te!==void 0){_(te);return}}_()},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function es(c,m,u,g){var _=this;c=E(c);var v=new p(function(A,R){_.ready().then(function(){m===void 0&&(m=null);var T=m,x=_._dbInfo;x.serializer.serialize(m,function(P,U){U?R(U):x.db.transaction(function($){mt($,x,"INSERT OR REPLACE INTO "+x.storeName+" (key, value) VALUES (?, ?)",[c,P],function(){A(T)},function(ee,te){R(te)})},function($){if($.code===$.QUOTA_ERR){if(g>0){A(es.apply(_,[c,T,u,g-1]));return}R($)}})})}).catch(R)});return h(v,u),v}function Yu(c,m,u){return es.apply(this,[c,m,u,1])}function Qu(c,m){var u=this;c=E(c);var g=new p(function(_,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[c],function(){_()},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function Zu(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"DELETE FROM "+v.storeName,[],function(){g()},function(R,T){_(T)})})}).catch(_)});return h(u,c),u}function ed(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(R,T){var x=T.rows.item(0).c;g(x)},function(R,T){_(T)})})}).catch(_)});return h(u,c),u}function td(c,m){var u=this,g=new p(function(_,v){u.ready().then(function(){var A=u._dbInfo;A.db.transaction(function(R){mt(R,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[c+1],function(T,x){var P=x.rows.length?x.rows.item(0).key:null;_(P)},function(T,x){v(x)})})}).catch(v)});return h(g,m),g}function nd(c){var m=this,u=new p(function(g,_){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(A){mt(A,v,"SELECT key FROM "+v.storeName,[],function(R,T){for(var x=[],P=0;P<T.rows.length;P++)x.push(T.rows.item(P).key);g(x)},function(R,T){_(T)})})}).catch(_)});return h(u,c),u}function rd(c){return new p(function(m,u){c.transaction(function(g){g.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,v){for(var A=[],R=0;R<v.rows.length;R++)A.push(v.rows.item(R).name);m({db:c,storeNames:A})},function(_,v){u(v)})},function(g){u(g)})})}function ad(c,m){m=C.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var g=this,_;return c.name?_=new p(function(v){var A;c.name===u.name?A=g._dbInfo.db:A=openDatabase(c.name,"","",0),c.storeName?v({db:A,storeNames:[c.storeName]}):v(rd(A))}).then(function(v){return new p(function(A,R){v.db.transaction(function(T){function x(ee){return new p(function(te,de){T.executeSql("DROP TABLE IF EXISTS "+ee,[],function(){te()},function(ce,Je){de(Je)})})}for(var P=[],U=0,$=v.storeNames.length;U<$;U++)P.push(x(v.storeNames[U]));p.all(P).then(function(){A()}).catch(function(ee){R(ee)})},function(T){R(T)})})}):_=p.reject("Invalid arguments"),h(_,m),_}var id={_driver:"webSQLStorage",_initStorage:Wu,_support:qu(),iterate:Xu,getItem:zu,setItem:Yu,removeItem:Qu,clear:Zu,length:ed,key:td,keys:nd,dropInstance:ad};function od(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function ts(c,m){var u=c.name+"/";return c.storeName!==m.storeName&&(u+=c.storeName+"/"),u}function sd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(m){return!0}}function ld(){return!sd()||localStorage.length>0}function cd(c){var m=this,u={};if(c)for(var g in c)u[g]=c[g];return u.keyPrefix=ts(c,m._defaultConfig),ld()?(m._dbInfo=u,u.serializer=Ia,p.resolve()):p.reject()}function ud(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var v=localStorage.key(_);v.indexOf(g)===0&&localStorage.removeItem(v)}});return h(u,c),u}function dd(c,m){var u=this;c=E(c);var g=u.ready().then(function(){var _=u._dbInfo,v=localStorage.getItem(_.keyPrefix+c);return v&&(v=_.serializer.deserialize(v)),v});return h(g,m),g}function fd(c,m){var u=this,g=u.ready().then(function(){for(var _=u._dbInfo,v=_.keyPrefix,A=v.length,R=localStorage.length,T=1,x=0;x<R;x++){var P=localStorage.key(x);if(P.indexOf(v)===0){var U=localStorage.getItem(P);if(U&&(U=_.serializer.deserialize(U)),U=c(U,P.substring(A),T++),U!==void 0)return U}}});return h(g,m),g}function hd(c,m){var u=this,g=u.ready().then(function(){var _=u._dbInfo,v;try{v=localStorage.key(c)}catch(A){v=null}return v&&(v=v.substring(_.keyPrefix.length)),v});return h(g,m),g}function md(c){var m=this,u=m.ready().then(function(){for(var g=m._dbInfo,_=localStorage.length,v=[],A=0;A<_;A++){var R=localStorage.key(A);R.indexOf(g.keyPrefix)===0&&v.push(R.substring(g.keyPrefix.length))}return v});return h(u,c),u}function pd(c){var m=this,u=m.keys().then(function(g){return g.length});return h(u,c),u}function vd(c,m){var u=this;c=E(c);var g=u.ready().then(function(){var _=u._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return h(g,m),g}function gd(c,m,u){var g=this;c=E(c);var _=g.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(A,R){var T=g._dbInfo;T.serializer.serialize(m,function(x,P){if(P)R(P);else try{localStorage.setItem(T.keyPrefix+c,x),A(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&R(U),R(U)}})})});return h(_,u),_}function _d(c,m){if(m=C.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var u=this.config();c.name=c.name||u.name,c.storeName=c.storeName||u.storeName}var g=this,_;return c.name?_=new p(function(v){c.storeName?v(ts(c,g._defaultConfig)):v(c.name+"/")}).then(function(v){for(var A=localStorage.length-1;A>=0;A--){var R=localStorage.key(A);R.indexOf(v)===0&&localStorage.removeItem(R)}}):_=p.reject("Invalid arguments"),h(_,m),_}var yd={_driver:"localStorageWrapper",_initStorage:cd,_support:od(),iterate:fd,getItem:dd,setItem:gd,removeItem:vd,clear:ud,length:pd,key:hd,keys:md,dropInstance:_d},wd=function(m,u){return m===u||typeof m=="number"&&typeof u=="number"&&isNaN(m)&&isNaN(u)},bd=function(m,u){for(var g=m.length,_=0;_<g;){if(wd(m[_],u))return!0;_++}return!1},ns=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},on={},rs={},Ut={INDEXEDDB:ju,WEBSQL:id,LOCALSTORAGE:yd},Ed=[Ut.INDEXEDDB._driver,Ut.WEBSQL._driver,Ut.LOCALSTORAGE._driver],Hn=["dropInstance"],Aa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Hn),Id={description:"",driver:Ed.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ad(c,m){c[m]=function(){var u=arguments;return c.ready().then(function(){return c[m].apply(c,u)})}}function Sa(){for(var c=1;c<arguments.length;c++){var m=arguments[c];if(m)for(var u in m)m.hasOwnProperty(u)&&(ns(m[u])?arguments[0][u]=m[u].slice():arguments[0][u]=m[u])}return arguments[0]}var Sd=function(){function c(m){s(this,c);for(var u in Ut)if(Ut.hasOwnProperty(u)){var g=Ut[u],_=g._driver;this[u]=_,on[_]||this.defineDriver(g)}this._defaultConfig=Sa({},Id),this._config=Sa({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(u){if((typeof u=="undefined"?"undefined":o(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var g in u){if(g==="storeName"&&(u[g]=u[g].replace(/\W/g,"_")),g==="version"&&typeof u[g]!="number")return new Error("Database version must be a number.");this._config[g]=u[g]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},c.prototype.defineDriver=function(u,g,_){var v=new p(function(A,R){try{var T=u._driver,x=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){R(x);return}for(var P=Aa.concat("_initStorage"),U=0,$=P.length;U<$;U++){var ee=P[U],te=!bd(Hn,ee);if((te||u[ee])&&typeof u[ee]!="function"){R(x);return}}var de=function(){for(var sn=function(Od){return function(){var kd=new Error("Method "+Od+" is not implemented by the current driver"),as=p.reject(kd);return h(as,arguments[arguments.length-1]),as}},Ca=0,Rd=Hn.length;Ca<Rd;Ca++){var Ra=Hn[Ca];u[Ra]||(u[Ra]=sn(Ra))}};de();var ce=function(sn){on[T]&&console.info("Redefining LocalForage driver: "+T),on[T]=u,rs[T]=sn,A()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(ce,R):ce(!!u._support):ce(!0)}catch(Je){R(Je)}});return b(v,g,_),v},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,g,_){var v=on[u]?p.resolve(on[u]):p.reject(new Error("Driver not found."));return b(v,g,_),v},c.prototype.getSerializer=function(u){var g=p.resolve(Ia);return b(g,u),g},c.prototype.ready=function(u){var g=this,_=g._driverSet.then(function(){return g._ready===null&&(g._ready=g._initDriver()),g._ready});return b(_,u,u),_},c.prototype.setDriver=function(u,g,_){var v=this;ns(u)||(u=[u]);var A=this._getSupportedDrivers(u);function R(){v._config.driver=v.driver()}function T(U){return v._extend(U),R(),v._ready=v._initStorage(v._config),v._ready}function x(U){return function(){var $=0;function ee(){for(;$<U.length;){var te=U[$];return $++,v._dbInfo=null,v._ready=null,v.getDriver(te).then(T).catch(ee)}R();var de=new Error("No available storage method found.");return v._driverSet=p.reject(de),v._driverSet}return ee()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=P.then(function(){var U=A[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function($){v._driver=$._driver,R(),v._wrapLibraryMethodsWithReady(),v._initDriver=x(A)})}).catch(function(){R();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,g,_),this._driverSet},c.prototype.supports=function(u){return!!rs[u]},c.prototype._extend=function(u){Sa(this,u)},c.prototype._getSupportedDrivers=function(u){for(var g=[],_=0,v=u.length;_<v;_++){var A=u[_];this.supports(A)&&g.push(A)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,g=Aa.length;u<g;u++)Ad(this,Aa[u])},c.prototype.createInstance=function(u){return new c(u)},c}(),Cd=new Sd;a.exports=Cd},{3:3}]},{},[4])(4)})});var sl=Ta(Er=>{"use strict";q();hn();vt();var wi=(t,e)=>{window.parent&&window.parent.postMessage({type:t,data:e},"*")},bi=we(),zf=at("levelFinished",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),duration:V.number().optional(),rating:V.number().optional(),score:V.number().optional(),variation:V.string().optional()})),implement:t=>S(Er,null,function*(){let{levelId:e,duration:n,rating:r,score:a,variation:i}=t;Ne.info("onLevelFinished",n,r,a,i),wi("JOLIBOX_GAME_TASK_LEVEL_FINISHED",{levelId:e,duration:n,rating:r,score:a,variation:i}),yield Promise.all([nt.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:e,duration:n,rating:r,score:a}}}),nt.tracker("LevelFinished",{levelId:e,duration:n,rating:r,score:a,variation:i})])})}),Xf=at("gamePlayEnded",{paramsSchema:V.tuple(V.object({duration:V.number().optional(),rating:V.number().optional(),score:V.number(),variation:V.string().optional()})),implement:t=>S(Er,null,function*(){let{duration:e,rating:n,score:r,variation:a}=t;Ne.info("onGamePlayEnded",e,n,r,a),wi("JOLIBOX_GAME_TASK_GAME_PLAY_ENDED",{duration:e,rating:n,score:r,variation:a}),yield Promise.all([nt.tracker("GamePlayEnded",{duration:e,rating:n,score:r,variation:a}),nt.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:e,rating:n,score:r}}})])})}),Yf=at("levelUpgrade",{paramsSchema:V.tuple(V.object({levelId:V.or(V.string(),V.number()),name:V.string().optional()})),implement:n=>S(Er,[n],function*({levelId:t,name:e}){Ne.info("onLevelUpgrade",t,e),wi("JOLIBOX_GAME_TASK_LEVEL_UPGRADE",{levelId:t,name:e}),yield Promise.all([nt.tracker("LevelUpgrade",{name:e,levelId:t}),nt.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:t,levelName:e}}})])})});bi.registerCommand("TaskTrackerSDK.levelFinished",zf);bi.registerCommand("TaskTrackerSDK.gamePlayEnded",Xf);bi.registerCommand("TaskTrackerSDK.levelUpgrade",Yf);be("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});be("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});be("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var Ke,Ht,ll,Ei,Qf,Ct,Ir=ae(()=>{"use strict";Ke=(t,e)=>{var n;window.dispatchEvent(new CustomEvent(t,{detail:e})),(n=window.parent)==null||n.postMessage({type:t,data:{detail:e}},"*")},Ht=new Map,ll=t=>{if(t.source===window.parent)try{let e=t.data;if(e&&e.type){let n=Ht.get(e.type);n&&n.forEach(r=>{try{r(e.data)}catch(a){console.warn("Callback execution failed:",a)}})}}catch(e){console.warn("Failed to parse message:",e)}},Ei=!1,Qf=()=>{Ei||(window.addEventListener("message",ll),Ei=!0)},Ct=(t,e)=>{Qf(),Ht.has(t)||Ht.set(t,new Set);let n=Ht.get(t);return n.add(e),()=>{n.delete(e),n.size===0&&Ht.delete(t),Ht.size===0&&(window.removeEventListener("message",ll),Ei=!1)}}});var Ar,Sr,Cr,Rr,Or,Ii,kr,Tr,xr,Pr,jt,Zf,ne,it,ot,xe=ae(()=>{"use strict";q();Ar="UNLOCK_OPTIONS_CHANGED",Sr="INVOKE_PAYMENT",Cr="ON_PAYMENT_RESULT",Rr="ON_USE_MODAL_EVENT",Or="ON_USE_MODAL_RESULT",Ii="ON_USE_MODAL_FREQUENCY",kr="ON_USE_UNLOGIN_MODAL_EVENT",Tr="INVOKE_UNLOGIN_MODAL_EVENT",xr="INVOKE_SUBSCRIPTION_EVENT",Pr="ON_USE_SUBSCRIPTION_RESULT",jt=new $e,Zf=()=>({on:jt.on.bind(jt),off:jt.off.bind(jt),emit:jt.emit.bind(jt)}),ne=Zf(),it={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},joinMember:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},ot={show:!0,minInterval:8*60*60*1e3}});var uu=Ta(fa=>{"use strict";fe();xe();Ir();q();var cu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Ct("ON_JOLIBOX_JOLI_COIN_USE_RESULT",t=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",cu[t.result],t.result),ne.emit(Or,{useModalResult:cu[t.result]})});ne.on(Rr,(t,e)=>{var n;t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:e.quantity,balance:e.userCurrency.balance,enableAutoDeduct:e.enableAutoDeduct},type:t,sequenceId:(n=e.sequenceId)!=null?n:je()})});Ct("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",t=>{ne.emit(Cr,{paymentResult:t.result=="ADS"?"FAILED":t.result,userJoliCoin:t.joliCoin,currency:"JOLI_COIN"})});ne.on(Sr,(t,e)=>S(fa,null,function*(){var n;t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:e.quantity,balance:e.userCurrency.balance,enableAutoDeduct:e.enableAutoDeduct},type:t,sequenceId:(n=e.sequenceId)!=null?n:je()})}));Ct("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",t=>{var e,n,r,a,i;ne.emit(kr,{result:t.result=="ADS"?"FAILED":t.result,rewards:{claimedRewardValue:(a=(r=(n=(e=t.extra)==null?void 0:e.firstLogin)==null?void 0:n.reward)==null?void 0:r.rewardValue)!=null?a:0,isFirstLogin:(i=t.isFirstLogin)!=null?i:!1}}),t.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ne.on(Tr,t=>S(fa,null,function*(){t=="ADS-JOLI_GEM"||t=="JOLI_GEM"||Ke("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:je(),type:t})}));Ct("ON_JOLIBOX_SUB_RESULT_EVENT",t=>{console.log("----on custom event ON_JOLIBOX_SUB_RESULT_EVENT-----",t),ne.emit(Pr,{result:t.result})});ne.on(xr,t=>S(fa,null,function*(){console.log("----notify custom event-----",t),Ke("JOLIBOX_SUB_EVENT",{sequenceId:je()})}))});vt();fe();hn();q();var nl=we(),Df="env",Lf="getSystemInfoSync",Nf=()=>{var a,i,o,s;let t={system:L.deviceInfo.system,platform:L.deviceInfo.platform.toLowerCase(),brand:L.deviceInfo.brand,pixelRatio:L.deviceInfo.pixelRatio,language:L.deviceInfo.lang,version:L.sdkInfo.jssdkVersion,appName:(a=L.hostInfo)==null?void 0:a.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},e=(i=L.hostInfo)==null?void 0:i.version;e&&(t=Ce(W({},t),{version:e}));let n=(o=L.hostInfo)==null?void 0:o.appName;n&&(t=Ce(W({},t),{appName:n}));let r=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return r&&(t=Ce(W({},t),{SDKVersion:r})),t},Uf=St(Lf,{implement:Nf}),Bf=St(Df,{implement:()=>Ce(W({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});nl.registerCommand("API.env",Bf);nl.registerCommand("API.getSystemInfoSync",Uf);be("env",{version:"1.0.0"});be("getSystemInfoSync",{version:"1.0.0"});q();hn();et();vt();var Mf="onJoliboxShow",Gf="onJoliboxHide",Jf="onReady",vi=we(),gi=As(Ue),pi=!0,mn=!0,_r=0,yr=li;function Ff(){let t=Date.now();if(t-_r<100)return;_r=t;let e=document.visibilityState==="visible";e!==pi&&(pi=e,yr.emit("visible",pi))}function rl(t){let e=Date.now();e-_r<100||(_r=e,t==="focus"&&!mn?mn=!0:t==="blur"&&mn&&(mn=!1),yr.emit("visible",mn))}document.addEventListener("visibilitychange",Ff);window.addEventListener("focus",()=>rl("focus"));window.addEventListener("blur",()=>rl("blur"));var Hf=St(Mf,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);yr.on("visible",n=>{n&&e()})}}),jf=St(Gf,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);yr.on("visible",n=>{!n&&e()})}}),qf=St(Jf,{paramsSchema:V.tuple(V.function()),implement(t){let e=gi(t);pt.on("LifecycleEvent.onReady",n=>{e(n)})}});vi.registerCommand("LifecycleSDK.onReady",qf);vi.registerCommand("LifecycleSDK.onJoliboxShow",Hf);vi.registerCommand("LifecycleSDK.onJoliboxHide",jf);be("lifeCycle.onReady",{version:"1.0.0"});be("lifeCycle.onJoliboxShow",{version:"1.0.0"});be("lifeCycle.onJoliboxHide",{version:"1.0.0"});hn();q();Jt();fe();var ol=xa(il());var wr=we(),yi=class{constructor(){this.httpClient=qe.create({baseUrl:Gt(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=e=>S(this,null,function*(){let{code:n,data:r,message:a}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:e}}),i=r==null?void 0:r.value,o=a;return n!=="SUCCESS"&&(i=yield this.gameStore.getItem(e),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),o+="fallback to localstorage"),{code:n,message:o,data:i&&i!=="undefined"?i:null}});this.setItem=(e,n)=>S(this,null,function*(){let r=typeof n=="string"?n:String(n),{code:a,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:e,value:r}});return yield this.gameStore.setItem(e,r),{code:a,message:i}});this.removeItem=e=>S(this,null,function*(){yield this.gameStore.removeItem(e);let{code:n,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:e}});return{code:n,message:r}});this.clear=()=>S(this,null,function*(){yield this.gameStore.clear();let{code:e,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:e,message:n}});this.gameId=this.getGameId(),this.gameStore=ol.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},br=new yi,Vf=at("getLocalStorage",{paramsSchema:V.tuple(V.string()),implement(t){return S(this,null,function*(){return yield br.getItem(t)})}});wr.registerCommand("StorageSDK.getItem",Vf);be("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var $f=at("setStorage",{paramsSchema:V.tuple(V.string(),V.or(V.string(),V.boolean(),V.number())),implement(t,e){return S(this,null,function*(){return yield br.setItem(t,e)})}});wr.registerCommand("StorageSDK.setItem",$f);be("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Kf=at("removeStorage",{paramsSchema:V.tuple(V.string()),implement(t){return S(this,null,function*(){return yield br.removeItem(t)})}});wr.registerCommand("StorageSDK.removeItem",Kf);be("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Wf=at("clearStorage",{implement(){return S(this,null,function*(){return yield br.clear()})}});wr.registerCommand("StorageSDK.clear",Wf);be("storage.clear",{version:"1.0.0"});var TI=xa(sl());vt();q();Jt();Ir();fe();xe();var cl=L.testMode;function ul(){let t=new Map,e,n;return{registerRewardHandler(a,i){t.set(a,i)},handleReward(a,...i){return S(this,null,function*(){return yield a.reduce((s,l)=>S(this,null,function*(){let d=yield s;if(d===!0)return!0;cl&&console.log(`handleReward ${l}`);let y=t.get(l),f=y?yield y(...i):d;return cl&&console.log(`handleReward ${l} ${f}`),f}),Promise.resolve(!1))})},registerRewardsFetcher(a){return S(this,null,function*(){e=(...i)=>S(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),["ADS"]}})})},registerRewardFrequencyConfigFetcher(a){return S(this,null,function*(){n=(...i)=>S(this,null,function*(){try{return yield a(...i)}catch(o){return console.error("getRewardOptions error:",o),{joliCoinUseAndCharge:it,loginGuide:ot}}})})},getRewardsTypes(...a){return S(this,null,function*(){return e?yield e(...a):["ADS"]})},getRewardFrequencyConfig(...a){return S(this,null,function*(){return n?yield n(...a):{joliCoinUseAndCharge:it,loginGuide:ot}})}}}q();var Ai=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"POST",a=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(e,a):yield this.httpClient.post(e,a)})}extractCacheableData(e){var n,r,a;return{unlockOptions:((n=e.data)==null?void 0:n.unlockOptions)||[],joliCoin:((r=e.extra)==null?void 0:r.joliCoin)||{balance:0,enableAutoDeduct:!1},joliGem:((a=e.extra)==null?void 0:a.joliGem)||{balance:0,enableAutoDeduct:!1}}}mergeData(e,n){return{code:"SUCCESS",message:"success",data:{unlockOptions:e.unlockOptions},extra:{joliCoin:e.joliCoin||{balance:0,enableAutoDeduct:!1},joliGem:e.joliGem||{balance:0,enableAutoDeduct:!1}}}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{unlockOptions:e.unlockOptions},extra:{joliCoin:e.joliCoin,joliGem:e.joliGem}}}},Si=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.body)||{};return r==="GET"?yield this.httpClient.get(e,a):yield this.httpClient.post(e,a)})}extractCacheableData(e){let n=e.data;return W({joliCoinUseAndCharge:n==null?void 0:n.joliCoinUseAndCharge,loginGuide:n==null?void 0:n.loginGuide},n)}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:e}}},Dr=class{constructor(e){this.unlockOptionsService=new It(new Ai(e),{duration:30*60*1e3,timeout:1e3,keyGenerator:n=>n,consistencyChecker:(n,r)=>n.unlockOptions.length!==r.unlockOptions.length?!1:n.unlockOptions.every((a,i)=>{var s,l;let o=r.unlockOptions[i];return a.type===o.type&&((s=a.joliGemChoice)==null?void 0:s.joliGemQuantity)===((l=o.joliGemChoice)==null?void 0:l.joliGemQuantity)})}),this.globalConfigService=new It(new Si(e),{duration:60*60*1e3,timeout:1e3,keyGenerator:n=>n})}getUnlockOptions(){return S(this,arguments,function*(e={}){return yield this.unlockOptionsService.request("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:e,method:"POST"})})}getGlobalConfig(){return S(this,null,function*(){return yield this.globalConfigService.request("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}refreshUnlockOptions(){return S(this,arguments,function*(e={}){return yield this.unlockOptionsService.forceRequest("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",body:e,method:"POST"})})}refreshGlobalConfig(){return S(this,null,function*(){return yield this.globalConfigService.forceRequest("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})})}warmupCache(){return S(this,null,function*(){yield Promise.all([this.unlockOptionsService.warmupCache("/api/games/unlock-options",{endpoint:"/api/games/unlock-options",method:"POST"}),this.globalConfigService.warmupCache("/api/fe-configs/web-common/global-config",{endpoint:"/api/fe-configs/web-common/global-config",method:"GET"})])})}clearAllCache(){this.unlockOptionsService.clearCache(),this.globalConfigService.clearCache()}getCacheStats(){return{unlockOptions:this.unlockOptionsService.getCacheStats(),globalConfig:this.globalConfigService.getCacheStats()}}clearExpiredCache(){this.unlockOptionsService.clearExpiredCache(),this.globalConfigService.clearExpiredCache()}};xe();q();var eh=()=>(t,e)=>{let n={SUBSCRIPTION:4,JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return n[e]-n[t]},th=["openJolicoinGuide",{method:"getABTest",platforms:["android"],nativeVersionCode:1050100},"userTrackAsync",{method:"openMiniapp",nativeVersionCode:1050100}],nh=t=>{if(!t.length)return["ADS"];if(t.includes("JOLI_GEM")){if(t.length===1)return["JOLI_GEM_ONLY"];if(t.includes("SUBSCRIPTION")&&t.length===2)return["SUBSCRIPTION","JOLI_GEM_ONLY"]}if(t.includes("JOLI_COIN")){if(t.length===1)return["JOLI_COIN_ONLY"];if(t.includes("SUBSCRIPTION")&&t.length===2)return["SUBSCRIPTION","JOLI_COIN_ONLY"]}return t.sort(eh())},Ci=null;function Ri(t){return Ci||(Ci=new Dr(t)),Ci}var Oi=t=>{t.registerRewardsFetcher(e=>S(void 0,null,function*(){var a,i,o,s,l;let n=["ADS"],r=Ri(e);try{let d=yield r.getUnlockOptions({});if(d.code!=="SUCCESS")return n;ne.emit(Ar,{options:((a=d.data)==null?void 0:a.unlockOptions)||[],userJoliCoin:((i=d.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=d.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let y=((l=(s=d.data)==null?void 0:s.unlockOptions)==null?void 0:l.map(f=>f.type))||Array.from(n);return nh(y)}catch(d){return console.error("getRewardOptions error (cached):",d),n}}))},ki=t=>{t.registerRewardFrequencyConfigFetcher(e=>S(void 0,null,function*(){var r,a,i,o;let n=Ri(e);try{let s=yield n.getGlobalConfig();return ne.emit(Ii,{joliCoinUseAndCharge:((r=s.data)==null?void 0:r.joliCoinUseAndCharge)||it,loginGuide:((a=s.data)==null?void 0:a.loginGuide)||ot}),s.data&&pt.emit("onGlobalConfigChanged",{globalConfig:s.data}),{joliCoinUseAndCharge:((i=s.data)==null?void 0:i.joliCoinUseAndCharge)||it,loginGuide:((o=s.data)==null?void 0:o.loginGuide)||ot}}catch(s){return console.error("getGlobalConfig error (cached):",s),ne.emit(Ii,{joliCoinUseAndCharge:it,loginGuide:ot}),pt.emit("onGlobalConfigChanged",{globalConfig:{joliCoinUseAndCharge:it,loginGuide:ot,supportedHostMethods:th}}),{joliCoinUseAndCharge:it,loginGuide:ot}}}))};var Ti=t=>S(void 0,null,function*(){yield Ri(t).warmupCache(),console.log("Reward cache warmed up")});var dl=t=>e=>S(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",e),yield t.adBreak(e)}catch(n){console.error("-----createAdsRewardHandler error-----",n)}return!0});xe();function We(t,e){let n=null,r=null,a=null,i=()=>{if(a){n=Promise.resolve(a);return}n=new Promise(o=>{r=o})};return i(),t.on(e,(...o)=>{let s=o[0];a=s,r&&(r(s),r=null)}),{getData:()=>(n||i(),n),getCachedData:()=>a,clearCache:()=>{a=null,n=null},getFreshData:()=>(a=null,n=null,i(),n),updateData:o=>{if(a)return a=W(W({},a),o),n=Promise.resolve(a),r&&(r(a),r=null),a}}}xe();var Ee=We(ne,Ar),pn=(t,e)=>{var r;let n=(r=t.options)==null?void 0:r.some(a=>a.type==="SUBSCRIPTION");return console.log("typeof extraCheck",typeof e,e==null?void 0:e()),n&&(!e||(e==null?void 0:e()))};fe();q();var xi={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};q();var Fe=we();xe();xe();q();var Di=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(e,{query:a}):yield this.httpClient.post(e,{query:a})})}extractCacheableData(e){var n;return{balance:((n=e.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{balance:e.balance}}}},Li=class{constructor(e){this.balanceService=new It(new Di(e),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getBalance(e="JOLI_COIN"){return S(this,null,function*(){return(yield this.balanceService.request("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})).data})}refreshBalance(e="JOLI_COIN"){return S(this,null,function*(){return(yield this.balanceService.forceRequest("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})).data})}warmupBalance(e="JOLI_COIN"){return S(this,null,function*(){yield this.balanceService.warmupCache("/api/joli-coin/balance",{endpoint:"/api/joli-coin/balance",query:{type:e},method:"GET"})})}clearBalanceCache(){this.balanceService.clearCache()}getBalanceCacheStats(){return this.balanceService.getCacheStats()}clearExpiredCache(){this.balanceService.clearExpiredCache()}},Pi=null;function Ni(t){return Pi||(Pi=new Li(t)),Pi}var Ui=(t,e="JOLI_COIN")=>S(void 0,null,function*(){return yield Ni(t).getBalance(e)}),Rt=(t,e="JOLI_COIN")=>S(void 0,null,function*(){let r=yield Ni(t).refreshBalance(e);return console.log(`Balance cache refreshed for type: ${e}`),r}),Lr=(t,e="JOLI_COIN")=>S(void 0,null,function*(){yield Ni(t).warmupBalance(e),console.log(`Balance cache warmed up for type: ${e}`)});q();var Mi=class{constructor(e){this.httpClient=e}execute(e,n){return S(this,null,function*(){let r=(n==null?void 0:n.method)||"GET",a=(n==null?void 0:n.query)||{};return r==="GET"?yield this.httpClient.get(e,{query:a}):yield this.httpClient.post(e,{query:a})})}extractCacheableData(e){var n;return{balance:((n=e.data)==null?void 0:n.balance)||0,timestamp:Date.now()}}processCachedData(e){return{code:"SUCCESS",message:"success from cache",data:{balance:e.balance}}}},Gi=class{constructor(e){this.gemBalanceService=new It(new Mi(e),{duration:20*60*1e3,timeout:1e3,keyGenerator:(n,r)=>{let a=r!=null&&r.query?JSON.stringify(r.query):"";return`${n}:${a}`}})}getGemBalance(e="GEM"){return S(this,null,function*(){return(yield this.gemBalanceService.request("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})).data})}refreshGemBalance(e="GEM"){return S(this,null,function*(){return(yield this.gemBalanceService.forceRequest("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})).data})}warmupGemBalance(e="GEM"){return S(this,null,function*(){yield this.gemBalanceService.warmupCache("/api/joli-gem/balance",{endpoint:"/api/joli-gem/balance",query:{type:e},method:"GET"})})}clearGemBalanceCache(){this.gemBalanceService.clearCache()}getGemBalanceCacheStats(){return this.gemBalanceService.getCacheStats()}clearExpiredCache(){this.gemBalanceService.clearExpiredCache()}},Bi=null;function fl(t){return Bi||(Bi=new Gi(t)),Bi}var Ji=(t,e="GEM")=>S(void 0,null,function*(){return yield fl(t).getGemBalance(e)}),qt=(t,e="GEM")=>S(void 0,null,function*(){let r=yield fl(t).refreshGemBalance(e);return console.log(`Gem balance cache refreshed for type: ${e}`),r});var ze={JOLI_COIN:{fetchBalance:Ui,getQuantity:t=>{var e,n,r;return(r=(n=(e=t==null?void 0:t.options)==null?void 0:e.find(a=>a.type==="JOLI_COIN"))==null?void 0:n.joliCoinChoices[0].joliCoinQuantity)!=null?r:0},getCurrentUser:t=>{var e;return(e=t==null?void 0:t.userJoliCoin)!=null?e:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(t,e)=>({balance:t,enableAutoDeduct:e}),getUpdateKey:()=>"userJoliCoin",isEnough:(t,e)=>{var n,r;return(r=(n=t==null?void 0:t.options)==null?void 0:n.some(a=>a.type==="JOLI_COIN"&&a.joliCoinChoices.some(i=>{var o;return i.joliCoinQuantity<=((o=e==null?void 0:e.balance)!=null?o:0)})))!=null?r:!1}},JOLI_GEM:{fetchBalance:Ji,getQuantity:t=>{var e,n,r,a;return(a=(r=(n=(e=t==null?void 0:t.options)==null?void 0:e.find(i=>i.type==="JOLI_GEM"))==null?void 0:n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0},getCurrentUser:t=>{var e;return(e=t==null?void 0:t.userGem)!=null?e:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(t,e)=>({balance:t,enableAutoDeduct:e}),getUpdateKey:()=>"userGem",isEnough:(t,e)=>{var r,a,i;let n=t==null?void 0:t.options.find(o=>o.type==="JOLI_GEM");return n?((a=(r=n.joliGemChoice)==null?void 0:r.joliGemQuantity)!=null?a:0)<=((i=e==null?void 0:e.balance)!=null?i:0):!1}}};var Nr=(t,e,n)=>{let{showUnlockWithCurrencyModal:r}=n;Fe.registerCommand(`Rewards.${t}.useJolicoin`,()=>S(void 0,null,function*(){let a=yield Ee.getData(),i=ze[e],o=i.getCurrentUser(a),s=i.getQuantity(a),l=!!(o!=null&&o.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",a,l,s),(yield r({enableAutoDeduct:l,userCurrency:o,quantity:s,currency:e}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},Ot=(t,e)=>n=>S(void 0,null,function*(){let r=We(ne,Or);return ne.emit(Rr,t,{enableAutoDeduct:n.enableAutoDeduct,userCurrency:n.userCurrency,quantity:n.quantity,currency:n.currency,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText}),(yield r.getFreshData()).useModalResult});xe();xe();var Ur=(t,e,n)=>{let{httpClient:r,initiateAndAwaitPayment:a}=n;Fe.registerCommand(`Rewards.${t}.usePayment`,()=>S(void 0,null,function*(){var p;let i=yield Ee.getData(),o=ze[e],s=yield o.fetchBalance(r),l=o.getQuantity(i),d=o.getCurrentUser(i),y=o.createUpdatedUser((p=s==null?void 0:s.balance)!=null?p:0,d.enableAutoDeduct),f=o.getUpdateKey();if(Ee.updateData({[f]:y}),console.log("-----unlockOptions payment-----",i,y,l,e),!o.isEnough(i,y)){let h=yield a({userCurrency:y,currencyQuantity:l,currency:e});return e==="JOLI_GEM"?qt(r):Rt(r),{result:h==="SUCCESS"?"SUCCESS":"FAILED"}}return{result:"CONTINUE"}}))},kt=(t,e)=>n=>S(void 0,null,function*(){let r=We(ne,Cr);return ne.emit(Sr,t,{userCurrency:n.userCurrency,quantity:n.currencyQuantity,currency:n.currency,enableAutoDeduct:n.userCurrency.enableAutoDeduct,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText}),(yield r.getFreshData()).paymentResult});fe();xe();xe();q();var Tt=(t,e)=>n=>S(void 0,null,function*(){let r=We(ne,kr);return ne.emit(Tr,t,{confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,currency:n}),yield r.getFreshData()});var ih=(t,e,n,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:a,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:s,showUnloginModal:l,hasSubscription:d}})=>{Ur(t,"JOLI_COIN",{httpClient:e,initiateAndAwaitPayment:o}),Nr(t,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let y=[`Rewards.${t}.usePayment`,`Rewards.${t}.useJolicoin`];return f=>S(void 0,null,function*(){var p,h,b,E;try{let C=yield i.getData();if(pn(C,d)){let M=ze.JOLI_COIN,B=yield M.fetchBalance(e),I=M.getCurrentUser(C),D=M.createUpdatedUser((p=B==null?void 0:B.balance)!=null?p:0,I.enableAutoDeduct);if(!M.isEnough(C,D))return a==null||a(f),!1}else{let M=!0;for(let B of y){let I=yield Fe.executeCommand(B);if(M=M&&I.result!=="FAILED",I.result!=="CONTINUE")break}if(!M)return a==null||a(f),!1}let O=xi[n],k=yield e.post(O.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${je()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",k),k.code=="SUCCESS"){try{(b=f.adBreakDone)==null||b.call(f,{breakType:f.type,breakName:"name"in f&&(h=f.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in f&&((E=f.adViewed)==null||E.call(f)),Rt(e)}catch(M){console.error("-----unlockWithJolicoin adBreakDone error-----",M)}return r==null||r({quantity:k.data.quantity,balance:k.data.balance}),!0}return a==null||a(f),!1}catch(C){if(console.info("JolicoinRewardHandler error:",C),C instanceof Error&&C.message=="CANCEL")throw C;return a==null||a(f),!1}finally{i.clearCache()}})},Br=(t,e,n)=>ih(t,e,"JOLI_COIN",n);var hl=(t,{onUnlockSuccess:e,onUnlockFailed:n,hasSubscription:r})=>{let a=()=>{n==null||n()},i=Ot("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=kt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),s=Tt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Br("ADS-JOLI_COIN",t,{handlers:{handleUnlockSuccess:e,handleUnlockFailed:a,unlockOptionsHandler:Ee,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};var ml=(t,{onUnlockSuccess:e,onUnlockFailed:n,hasSubscription:r})=>{let a=d=>{var y;n==null||n(),(y=d.adBreakDone)==null||y.call(d,{breakType:d.type,breakFormat:d.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Ot("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=kt("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),s=Tt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Br("JOLI_COIN",t,{handlers:{handleUnlockSuccess:e,handleUnlockFailed:a,unlockOptionsHandler:Ee,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:s,hasSubscription:r}})};fe();q();xe();xe();var pl=t=>{let{showSubscriptionModal:e}=t;Fe.registerCommand("Rewards.subscription",()=>S(void 0,null,function*(){var s,l;let n=yield Ee.getData(),r=(l=(s=n==null?void 0:n.options)==null?void 0:s.find(d=>d.type==="JOLI_GEM"))==null?void 0:l.type,a=ze[r?"JOLI_GEM":"JOLI_COIN"],i=a.getCurrentUser(n);return a.isEnough(n,i)?{result:"FAILED"}:{result:(yield e())==="SUCCESS"?"SUCCESS":"FAILED"}}))},vl=t=>()=>S(void 0,null,function*(){let e=We(ne,Pr);return ne.emit(xr,t),(yield e.getFreshData()).result});fe();var gl=(t,e,{handlers:{handleSubSuccess:n,handleSubFailed:r,unlockOptionsHandler:a,showSubscriptionModal:i,hasSubscription:o}})=>{pl({showSubscriptionModal:i});let s=["Rewards.subscription"];return l=>S(void 0,null,function*(){var d,y,f,p,h,b;try{let E=yield a.getData();if(!pn(E,o))return!1;let w=!0;for(let O of s){let k=yield Fe.executeCommand(O);if(w=w&&k.result!=="FAILED",k.result!=="CONTINUE")break}if(Rt(e),qt(e),console.log("-----unlockWithSubscription result-----",w),w){try{(y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in l&&((f=l.adViewed)==null||f.call(l)),(b=(h=L).onEnvConfigChanged)==null||b.call(h,{hostUserInfo:Ce(W({},(p=L.hostUserInfo)!=null?p:{isLogin:!1}),{isSubUser:!0})})}catch(O){console.error("-----unlockWithSubscription adBreakDone error-----",O)}return n==null||n(),!0}return r==null||r(l),!1}catch(E){if(console.info("SubscriptionRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(l),!1}finally{}})};var _l=(t,{onSubSuccess:e,onSubFailed:n,hasSubscription:r})=>{let a=()=>{n==null||n()},i=vl("SUBSCRIPTION");return gl("SUBSCRIPTION",t,{handlers:{handleSubSuccess:e,handleSubFailed:a,unlockOptionsHandler:Ee,showSubscriptionModal:i,hasSubscription:r}})};var Xe=ul();Oi(Xe);ki(Xe);var Fr,H,Il,ji,xt,yl,Al,Sl,Cl,qi,Fi,Hi,sh,vn={},Rl=[],lh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,gn=Array.isArray;function st(t,e){for(var n in e)t[n]=e[n];return t}function Vi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function _n(t,e,n){var r,a,i,o={};for(i in e)i=="key"?r=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?Fr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return Gr(t,o,r,a,null)}function Gr(t,e,n,r,a){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a==null?++Il:a,__i:-1,__u:0};return a==null&&H.vnode!=null&&H.vnode(i),i}function gt(t){return t.children}function Be(t,e){this.props=t,this.context=e}function Vt(t,e){if(e==null)return t.__?Vt(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Vt(t):null}function Ol(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Ol(t)}}function wl(t){(!t.__d&&(t.__d=!0)&&xt.push(t)&&!Jr.__r++||yl!==H.debounceRendering)&&((yl=H.debounceRendering)||Al)(Jr)}function Jr(){for(var t,e,n,r,a,i,o,s=1;xt.length;)xt.length>s&&xt.sort(Sl),t=xt.shift(),s=xt.length,t.__d&&(n=void 0,a=(r=(e=t).__v).__e,i=[],o=[],e.__P&&((n=st({},r)).__v=r.__v+1,H.vnode&&H.vnode(n),$i(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[a]:null,i,a==null?Vt(r):a,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,xl(i,n,o),n.__e!=a&&Ol(n)));Jr.__r=0}function kl(t,e,n,r,a,i,o,s,l,d,y){var f,p,h,b,E,C,w=r&&r.__k||Rl,O=e.length;for(l=ch(n,e,w,l,O),f=0;f<O;f++)(h=n.__k[f])!=null&&(p=h.__i===-1?vn:w[h.__i]||vn,h.__i=f,C=$i(t,h,p,a,i,o,s,l,d,y),b=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&Ki(p.ref,null,h),y.push(h.ref,h.__c||b,h)),E==null&&b!=null&&(E=b),4&h.__u||p.__k===h.__k?l=Tl(h,l,t):typeof h.type=="function"&&C!==void 0?l=C:b&&(l=b.nextSibling),h.__u&=-7);return n.__e=E,l}function ch(t,e,n,r,a){var i,o,s,l,d,y=n.length,f=y,p=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=i+p,(o=t.__k[i]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Gr(null,o,null,null,null):gn(o)?Gr(gt,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Gr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,s=null,(d=o.__i=uh(o,n,l,f))!==-1&&(f--,(s=n[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(a>y?p--:a<y&&p++),typeof o.type!="function"&&(o.__u|=4)):d!=l&&(d==l-1?p--:d==l+1?p++:(d>l?p--:p++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<y;i++)(s=n[i])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Vt(s)),Dl(s,s));return r}function Tl(t,e,n){var r,a;if(typeof t.type=="function"){for(r=t.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=t,e=Tl(r[a],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=Vt(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function yn(t,e){return e=e||[],t==null||typeof t=="boolean"||(gn(t)?t.some(function(n){yn(n,e)}):e.push(t)),e}function uh(t,e,n,r){var a,i,o=t.key,s=t.type,l=e[n];if(l===null&&t.key==null||l&&o==l.key&&s===l.type&&!(2&l.__u))return n;if(r>(l!=null&&!(2&l.__u)?1:0))for(a=n-1,i=n+1;a>=0||i<e.length;){if(a>=0){if((l=e[a])&&!(2&l.__u)&&o==l.key&&s===l.type)return a;a--}if(i<e.length){if((l=e[i])&&!(2&l.__u)&&o==l.key&&s===l.type)return i;i++}}return-1}function bl(t,e,n){e[0]=="-"?t.setProperty(e,n==null?"":n):t[e]=n==null?"":typeof n!="number"||lh.test(e)?n:n+"px"}function Mr(t,e,n,r,a){var i;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||bl(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||bl(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Cl,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=qi,t.addEventListener(e,i?Hi:Fi,i)):t.removeEventListener(e,i?Hi:Fi,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n==null?"":n;break e}catch(o){}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function El(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.u==null)e.u=qi++;else if(e.u<n.t)return;return n(H.event?H.event(e):e)}}}function $i(t,e,n,r,a,i,o,s,l,d){var y,f,p,h,b,E,C,w,O,k,M,B,I,D,J,j,N,G=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(y=H.__b)&&y(e);e:if(typeof G=="function")try{if(w=e.props,O="prototype"in G&&G.prototype.render,k=(y=G.contextType)&&r[y.__c],M=y?k?k.props.value:y.__:r,n.__c?C=(f=e.__c=n.__c).__=f.__E:(O?e.__c=f=new G(w,M):(e.__c=f=new Be(w,M),f.constructor=G,f.render=fh),k&&k.sub(f),f.props=w,f.state||(f.state={}),f.context=M,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),O&&f.__s==null&&(f.__s=f.state),O&&G.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=st({},f.__s)),st(f.__s,G.getDerivedStateFromProps(w,f.__s))),h=f.props,b=f.state,f.__v=e,p)O&&G.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),O&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(O&&G.getDerivedStateFromProps==null&&w!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(w,f.__s,M)===!1||e.__v==n.__v)){for(e.__v!=n.__v&&(f.props=w,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(F){F&&(F.__=e)}),B=0;B<f._sb.length;B++)f.__h.push(f._sb[B]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,M),O&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,b,E)})}if(f.context=M,f.props=w,f.__P=t,f.__e=!1,I=H.__r,D=0,O){for(f.state=f.__s,f.__d=!1,I&&I(e),y=f.render(f.props,f.state,f.context),J=0;J<f._sb.length;J++)f.__h.push(f._sb[J]);f._sb=[]}else do f.__d=!1,I&&I(e),y=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++D<25);f.state=f.__s,f.getChildContext!=null&&(r=st(st({},r),f.getChildContext())),O&&!p&&f.getSnapshotBeforeUpdate!=null&&(E=f.getSnapshotBeforeUpdate(h,b)),j=y,y!=null&&y.type===gt&&y.key==null&&(j=Pl(y.props.children)),s=kl(t,gn(j)?j:[j],e,n,r,a,i,o,s,l,d),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),C&&(f.__E=f.__=null)}catch(F){if(e.__v=null,l||i!=null)if(F.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else for(N=i.length;N--;)Vi(i[N]);else e.__e=n.__e,e.__k=n.__k;H.__e(F,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=dh(n.__e,e,n,r,a,i,o,l,d);return(y=H.diffed)&&y(e),128&e.__u?void 0:s}function xl(t,e,n){for(var r=0;r<n.length;r++)Ki(n[r],n[++r],n[++r]);H.__c&&H.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){H.__e(i,a.__v)}})}function Pl(t){return typeof t!="object"||t==null?t:gn(t)?t.map(Pl):st({},t)}function dh(t,e,n,r,a,i,o,s,l){var d,y,f,p,h,b,E,C=n.props,w=e.props,O=e.type;if(O=="svg"?a="http://www.w3.org/2000/svg":O=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((h=i[d])&&"setAttribute"in h==!!O&&(O?h.localName==O:h.nodeType==3)){t=h,i[d]=null;break}}if(t==null){if(O==null)return document.createTextNode(w);t=document.createElementNS(a,O,w.is&&w),s&&(H.__m&&H.__m(e,i),s=!1),i=null}if(O===null)C===w||s&&t.data===w||(t.data=w);else{if(i=i&&Fr.call(t.childNodes),C=n.props||vn,!s&&i!=null)for(C={},d=0;d<t.attributes.length;d++)C[(h=t.attributes[d]).name]=h.value;for(d in C)if(h=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")f=h;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;Mr(t,d,null,h,a)}}for(d in w)h=w[d],d=="children"?p=h:d=="dangerouslySetInnerHTML"?y=h:d=="value"?b=h:d=="checked"?E=h:s&&typeof h!="function"||C[d]===h||Mr(t,d,h,C[d],a);if(y)s||f&&(y.__html===f.__html||y.__html===t.innerHTML)||(t.innerHTML=y.__html),e.__k=[];else if(f&&(t.innerHTML=""),kl(e.type==="template"?t.content:t,gn(p)?p:[p],e,n,r,O=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:n.__k&&Vt(n,0),s,l),i!=null)for(d=i.length;d--;)Vi(i[d]);s||(d="value",O=="progress"&&b==null?t.removeAttribute("value"):b!==void 0&&(b!==t[d]||O=="progress"&&!b||O=="option"&&b!==C[d])&&Mr(t,d,b,C[d],a),d="checked",E!==void 0&&E!==t[d]&&Mr(t,d,E,C[d],a))}return t}function Ki(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(a){H.__e(a,n)}}function Dl(t,e,n){var r,a;if(H.unmount&&H.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Ki(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){H.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(a=0;a<r.length;a++)r[a]&&Dl(r[a],e,n||typeof t.type!="function");n||Vi(t.__e),t.__c=t.__=t.__e=void 0}function fh(t,e,n){return this.constructor(t,n)}function Ll(t,e,n){var r,a,i,o;e==document&&(e=document.documentElement),H.__&&H.__(t,e),a=(r=typeof n=="function")?null:n&&n.__k||e.__k,i=[],o=[],$i(e,t=(!r&&n||e).__k=_n(gt,null,[t]),a||vn,vn,e.namespaceURI,!r&&n?[n]:a?null:e.firstChild?Fr.call(e.childNodes):null,i,!r&&n?n:a?a.__e:e.firstChild,r,o),xl(i,t,o)}Fr=Rl.slice,H={__e:function(t,e,n,r){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,r||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},Il=0,ji=function(t){return t!=null&&t.constructor==null},Be.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=st({},this.state),typeof t=="function"&&(t=t(st({},n),this.props)),t&&st(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),wl(this))},Be.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),wl(this))},Be.prototype.render=gt,xt=[],Al=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sl=function(t,e){return t.__v.__b-e.__v.__b},Jr.__r=0,Cl=/(PointerCapture)$|Capture$/i,qi=0,Fi=El(!1),Hi=El(!0),sh=0;var $t,le,Wi,Nl,wn=0,jl=[],ue=H,Ul=ue.__b,Bl=ue.__r,Ml=ue.diffed,Gl=ue.__c,Jl=ue.unmount,Fl=ue.__;function jr(t,e){ue.__h&&ue.__h(le,t,wn||e),wn=0;var n=le.__H||(le.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function lt(t){return wn=1,ql(Vl,t)}function ql(t,e,n){var r=jr($t++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Vl(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],d=r.t(l,s);l!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=le,!le.__f)){var a=function(s,l,d){if(!r.__c.__H)return!0;var y=r.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!i||i.call(this,s,l,d);var f=r.__c.props!==s;return y.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(f=!0)}}),i&&i.call(this,s,l,d)||f};le.__f=!0;var i=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(s,l,d){if(this.__e){var y=i;i=void 0,a(s,l,d),i=y}o&&o.call(this,s,l,d)},le.shouldComponentUpdate=a}return r.__N||r.__}function Pt(t,e){var n=jr($t++,3);!ue.__s&&Yi(n.__H,e)&&(n.__=t,n.u=e,le.__H.__h.push(n))}function Xi(t,e){var n=jr($t++,4);!ue.__s&&Yi(n.__H,e)&&(n.__=t,n.u=e,le.__h.push(n))}function qr(t){return wn=5,bn(function(){return{current:t}},[])}function bn(t,e){var n=jr($t++,7);return Yi(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function En(t,e){return wn=8,bn(function(){return t},e)}function hh(){for(var t;t=jl.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Hr),t.__H.__h.forEach(zi),t.__H.__h=[]}catch(e){t.__H.__h=[],ue.__e(e,t.__v)}}ue.__b=function(t){le=null,Ul&&Ul(t)},ue.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Fl&&Fl(t,e)},ue.__r=function(t){Bl&&Bl(t),$t=0;var e=(le=t.__c).__H;e&&(Wi===le?(e.__h=[],le.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Hr),e.__h.forEach(zi),e.__h=[],$t=0)),Wi=le},ue.diffed=function(t){Ml&&Ml(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(jl.push(e)!==1&&Nl===ue.requestAnimationFrame||((Nl=ue.requestAnimationFrame)||mh)(hh)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Wi=le=null},ue.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Hr),n.__h=n.__h.filter(function(r){return!r.__||zi(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],ue.__e(r,n.__v)}}),Gl&&Gl(t,e)},ue.unmount=function(t){Jl&&Jl(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Hr(r)}catch(a){e=a}}),n.__H=void 0,e&&ue.__e(e,n.__v))};var Hl=typeof requestAnimationFrame=="function";function mh(t){var e,n=function(){clearTimeout(r),Hl&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Hl&&(e=requestAnimationFrame(n))}function Hr(t){var e=le,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),le=e}function zi(t){var e=le;t.__c=t.__(),le=e}function Yi(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Vl(t,e){return typeof e=="function"?e(t):e}function vh(t,e){for(var n in e)t[n]=e[n];return t}function $l(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function Kl(t,e){this.props=t,this.context=e}(Kl.prototype=new Be).isPureReactComponent=!0,Kl.prototype.shouldComponentUpdate=function(t,e){return $l(this.props,t)||$l(this.state,e)};var Wl=H.__b;H.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Wl&&Wl(t)};var OE=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var gh=H.__e;H.__e=function(t,e,n,r){if(t.then){for(var a,i=e;i=i.__;)if((a=i.__c)&&a.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),a.__c(t,e)}gh(t,e,n,r)};var zl=H.unmount;function nc(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=vh({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return nc(r,e,n)})),t}function rc(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return rc(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Qi(){this.__u=0,this.o=null,this.__b=null}function ac(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Vr(){this.i=null,this.l=null}H.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),zl&&zl(t)},(Qi.prototype=new Be).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=ac(r.__v),i=!1,o=function(){i||(i=!0,n.__R=null,a?a(s):s())};n.__R=o;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=rc(l,l.__c.__P,l.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.o.pop();)d.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(o,o)},Qi.prototype.componentWillUnmount=function(){this.o=[]},Qi.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=nc(this.__b,n,r.__O=r.__P)}this.__b=null}var a=e.__a&&_n(gt,null,t.fallback);return a&&(a.__u&=-33),[_n(gt,null,e.__a?null:t.children),a]};var Xl=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Vr.prototype=new Be).__a=function(t){var e=this,n=ac(e.__v),r=e.l.get(t);return r[0]++,function(a){var i=function(){e.props.revealOrder?(r.push(a),Xl(e,t,r)):a()};n?n(i):i()}},Vr.prototype.render=function(t){this.i=null,this.l=new Map;var e=yn(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Vr.prototype.componentDidUpdate=Vr.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){Xl(t,n,e)})};var _h=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,yh=/^(?: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]/,wh=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,bh=/[A-Z0-9]/g,Eh=typeof document!="undefined",Ih=function(t){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function $r(t,e,n){return e.__k==null&&(e.textContent=""),Ll(t,e),typeof n=="function"&&n(),t?t.__c:null}Be.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Be.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var Yl=H.event;function Ah(){}function Sh(){return this.cancelBubble}function Ch(){return this.defaultPrevented}H.event=function(t){return Yl&&(t=Yl(t)),t.persist=Ah,t.isPropagationStopped=Sh,t.isDefaultPrevented=Ch,t.nativeEvent=t};var ic,Rh={enumerable:!1,configurable:!0,get:function(){return this.class}},Ql=H.vnode;H.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,a={},i=r.indexOf("-")===-1;for(var o in n){var s=n[o];if(!(o==="value"&&"defaultValue"in n&&s==null||Eh&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?o="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||Ih(n.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":wh.test(o)&&(o=l):l=o="oninput":i&&yh.test(o)?o=o.replace(bh,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&a[o=l]&&(o="oninputCapture"),a[o]=s}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.value.indexOf(d.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=yn(n.children).forEach(function(d){d.props.selected=a.multiple?a.defaultValue.indexOf(d.props.value)!=-1:a.defaultValue==d.props.value})),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",Rh)):(n.className&&!n.class||n.class&&n.className)&&(a.class=a.className=n.className),e.props=a}(t),t.$$typeof=_h,Ql&&Ql(t)};var Zl=H.__r;H.__r=function(t){Zl&&Zl(t),ic=t.__c};var ec=H.diffed;H.diffed=function(t){ec&&ec(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),ic=null};var Oh=Object.defineProperty,na=Object.getOwnPropertySymbols,Pc=Object.prototype.hasOwnProperty,Dc=Object.prototype.propertyIsEnumerable,oc=(t,e,n)=>e in t?Oh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,kh=(t,e)=>{for(var n in e||(e={}))Pc.call(e,n)&&oc(t,n,e[n]);if(na)for(var n of na(e))Dc.call(e,n)&&oc(t,n,e[n]);return t},Th=(t,e)=>{var n={};for(var r in t)Pc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&na)for(var r of na(t))e.indexOf(r)<0&&Dc.call(t,r)&&(n[r]=t[r]);return n},Lc=Object.defineProperty,xh=Object.defineProperties,Ph=Object.getOwnPropertyDescriptors,sc=Object.getOwnPropertySymbols,Dh=Object.prototype.hasOwnProperty,Lh=Object.prototype.propertyIsEnumerable,lc=(t,e,n)=>e in t?Lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nh=(t,e)=>{for(var n in e||(e={}))Dh.call(e,n)&&lc(t,n,e[n]);if(sc)for(var n of sc(e))Lh.call(e,n)&&lc(t,n,e[n]);return t},Uh=(t,e)=>xh(t,Ph(e)),Bh=(t,e)=>{for(var n in e)Lc(t,n,{get:e[n],enumerable:!0})},Nc=(t,e,n,r)=>{for(var a=e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(a=o(a)||a);return a},Mh=(t,e,n)=>new Promise((r,a)=>{var i=l=>{try{s(n.next(l))}catch(d){a(d)}},o=l=>{try{s(n.throw(l))}catch(d){a(d)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,o);s((n=n.apply(t,e)).next())});if(typeof window!="undefined"&&!window.AbortController){let t=function(){this.signal=new e};t.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let n=new Event("abort");this.signal.dispatchEvent(n)};let e=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(e.prototype,"aborted",{get:function(){return this._aborted}}),e.prototype.addEventListener=function(n,r){this._eventListeners[n]||(this._eventListeners[n]=[]),this._eventListeners[n].push(r)},e.prototype.removeEventListener=function(n,r){if(!this._eventListeners[n])return;let a=this._eventListeners[n].indexOf(r);a!==-1&&this._eventListeners[n].splice(a,1)},e.prototype.dispatchEvent=function(n){if(this._eventListeners[n.type])for(let r of this._eventListeners[n.type])r.call(this,n)},window.AbortController=t,window.AbortSignal=e}function Gh(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function Jh(t){return typeof t=="string"}function Fh(t){return typeof t=="undefined"}function Hh(t){return Fh(t)||t===null}function jh(t){return typeof t=="function"}function Uc(t){let e=t,n=null,r=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n||(n=new e(...i)),n};return r.prototype=e.prototype,r}var qh=(t=>(t[t.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",t[t.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",t[t.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",t[t.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",t[t.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",t[t.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",t[t.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",t[t.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",t))(qh||{});function In(t){return function(){var e,n;((n=(e=globalThis.VConsole)==null?void 0:e[t])!=null?n:globalThis.console[t])(...arguments)}}var Vh={log:In("log"),warn:In("warn"),info:In("info"),error:In("error"),debug:In("debug")};Object.assign(globalThis,{logger:Vh});var cc=Symbol.for("Jolibox.canIUseMap"),$h={};globalThis[cc]||(globalThis[cc]=$h);var uc=Symbol.for("Jolibox.canIUseMap.native"),Kh={};globalThis[uc]||(globalThis[uc]=Kh);var Bc=(t=>(t[t.Other=0]="Other",t[t.Route=1]="Route",t[t.Click=2]="Click",t[t.View=3]="View",t[t.Expose=4]="Expose",t[t.Swipe=5]="Swipe",t[t.Input=6]="Input",t[t.Select=7]="Select",t[t.SwitchOn=8]="SwitchOn",t[t.SwitchOff=9]="SwitchOff",t[t.Submit=10]="Submit",t[t.Scroll=11]="Scroll",t[t.Hide=12]="Hide",t[t.System=1e3]="System",t[t.ErrorTrace=1001]="ErrorTrace",t[t.UserDefined=1002]="UserDefined",t))(Bc||{}),Mc=(t=>(t.MiniGame="mini-game",t.MiniDrama="mini-drama",t.App="app",t.WebSDK="web-sdk",t.AppSDK="app-sdk",t))(Mc||{}),Gc=(t=>(t[t.App=0]="App",t[t.H5=1]="H5",t[t.Weapp=2]="Weapp",t[t.Alipay=3]="Alipay",t[t.Gcash=4]="Gcash",t[t.Dana=5]="Dana",t[t.Umma=6]="Umma",t[t.WebSDK=1e3]="WebSDK",t[t.AppSDK=1001]="AppSDK",t[t.Other=9999]="Other",t))(Gc||{}),dc=["name","params"],Wh=["name","type","location","target","extra","timestamp","userId"],zh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Xr(t,e){return e.map(n=>{if(n==="params"&&t[n]){let r=t[n];return Object.keys(r).reduce((a,i)=>(a[i]=String(r[i]),a),{})}return t[n]})}function Xh(t){let e=t.location?Xr(t.location,dc):null,n=t.target?Xr(t.target,dc):null;return Xr(Uh(Nh({},t),{location:e,target:n}),Wh)}function Yh(t){let e=t.events.map(r=>Xh(r)),n=Xr(t.device,zh);return[t.protocolVersion,e,n,t.project]}function Qh(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let t=Object.getOwnPropertyDescriptor(window,"localStorage");if(t&&t.get){let r=t.get.call(window);return window.__joliboxLocalStorage__=r,r}if(t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),t&&t.get)return t.get.call(window);let e=Window.prototype,n=Object.getOwnPropertyDescriptor(e,"localStorage");if(n&&n.get){let r=n.get.call(window);return window.__joliboxLocalStorage__=r,r}return localStorage}catch(t){return console.warn("Failed to get original localStorage, fallback to default implementation",t),localStorage}}Qh();var zt=typeof window=="undefined",fc=()=>!zt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!zt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!zt&&navigator.userAgent.includes("Android"),!zt&&navigator.userAgent.includes("Mac"),!zt&&navigator.userAgent.includes("FB_IAB"),!zt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var io=class oo{constructor(e){this.element=e,this.next=oo.Undefined,this.prev=oo.Undefined}};io.Undefined=new io(void 0);var se=io,Zh=class{constructor(){this._first=se.Undefined,this._last=se.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===se.Undefined}clear(){let t=this._first;for(;t!==se.Undefined;){let e=t.next;t.prev=se.Undefined,t.next=se.Undefined,t=e}this._first=se.Undefined,this._last=se.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new se(t);if(this._first===se.Undefined)this._first=n,this._last=n;else if(e){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==se.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==se.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==se.Undefined&&t.next!==se.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===se.Undefined&&t.next===se.Undefined?(this._first=se.Undefined,this._last=se.Undefined):t.next===se.Undefined?(this._last=this._last.prev,this._last.next=se.Undefined):t.prev===se.Undefined&&(this._first=this._first.next,this._first.prev=se.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==se.Undefined;)yield t.element,t=t.next}},em=0,An=class{constructor(t){this.value=t,this.id=em++}},On=class{constructor(t){this.options=t,this._size=0}dispose(t){var e,n;this._disposed||(this._disposed=!0,this._listeners&&(t?(this._listeners instanceof An&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(r=>(r==null?void 0:r.value)===t)):(this._listeners=void 0,this._size=0)),(n=(e=this.options)==null?void 0:e.onDidRemoveLastListener)==null||n.call(e))}get event(){return this._event!=null||(this._event=(t,e)=>{var n,r,a,i,o,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};e&&(t=t.bind(e));let l=new An(t);return this._listeners?this._listeners instanceof An?this._listeners=[this._listeners,l]:this._listeners.push(l):((r=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||r.call(n,this),this._listeners=l,(i=(a=this.options)==null?void 0:a.onDidFirstListener)==null||i.call(a,this)),(s=(o=this.options)==null?void 0:o.onDidAddListener)==null||s.call(o,this),this._size++,()=>{var d,y,f,p;if(!this._disposed){if(this._listeners instanceof An)this._listeners.id===l.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 h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((p=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||p.call(f)))}}}}),this._event}_deliver(t,e){var n;if(!t)return;let r=((n=this.options)==null?void 0:n.onListenerError)||Error.constructor;if(!r){t.value(e);return}try{t.value(e)}catch(a){r(a)}}fire(t){this._listeners&&(this._listeners instanceof An?this._deliver(this._listeners,t):this._listeners.forEach(e=>this._deliver(e,t)))}hasListeners(){return this._size>0}},tm=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var r;let a=(r=this.listeners.get(t))!=null?r:new On,i=l=>e(...l.args),o=a.event(i);this.listerHandlerMap.set(e,{handler:i,dispose:o}),this.listeners.set(t,a);let s=this.cachedEventQueue.get(t);if(s&&n)for(let l of s)e(...l.args)}flushCachedEvent(t){t?this.cachedEventQueue.delete(t):this.cachedEventQueue.clear()}off(t,e){let n=this.listerHandlerMap.get(e);n&&(n.dispose(),this.listerHandlerMap.delete(e))}emit(t){let e=this.listeners.get(t),n=this.cachedEventQueue.get(t);for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];n||(n=new Zh,this.cachedEventQueue.set(t,n)),n.push({args:a}),e&&e.fire({event:t,args:a})}once(t,e){var n=this;let r=function(){e(...arguments),n.off(t,r)};this.on(t,r,!1)}},so={};Bh(so,{None:()=>nm,filter:()=>am,once:()=>Jc,toPromise:()=>rm});var nm=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function rm(t){return new Promise(e=>Jc(t)(e))}function Jc(t){return function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!1;return t(a=>{if(!r)return r=!0,e.call(n,a)},null)}}function am(t,e){return(n=>{let r={onWillAddFirstListener(){n(a.fire,a)}},a=new On(r);return a.event})(function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t(a=>e(a)&&n.call(r,a),null)})}var Zi=Symbol.for("Jolibox.hostEmitter"),im=()=>{let t=new tm;return globalThis[Zi]||(globalThis[Zi]={on:t.on.bind(t),off:t.off.bind(t),emit:t.emit.bind(t),once:t.once.bind(t)}),globalThis[Zi]};im();function om(t,e){let n=Math.min(t.length,e.length);for(let r=0;r<n;r++)sm(t[r],e[r])}function sm(t,e){if(Jh(e)){if(typeof t!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(jh(e)){try{if(t instanceof e)return}catch(n){}if(!Hh(t)&&t.constructor===e||e.length===1&&e.call(void 0,t)===!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")}}var lo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new On,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(t){if(!t)throw new Error("invalid command");if(t.metadata&&Array.isArray(t.metadata.args)){let n=[];for(let a of t.metadata.args)n.push(a.constraint);let r=t.handler;t.handler=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return om(i,n),r(...i)}}let{id:e}=t;this._commands.get(e)&&console.info(`[Jolibox SDK] duplicated command is registered ${e}`),this._commands.set(e,t),this._onDidRegisterCommand.fire(e)}getCommand(t){return this._commands.get(t)}getCommands(){let t=new Map;for(let e of this._commands.keys()){let n=this.getCommand(e);n&&t.set(e,n)}return t}};lo=Nc([Uc],lo);var hc=class{constructor(){this._onWillExecuteCommand=new On,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new On,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new lo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Gh(3e4)),this._starActivation}executeCommand(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Mh(this,null,function*(){return this.registry.getCommand(t)?this._tryExecuteCommand(t,n):(yield Promise.all([Promise.race([this._activateStar(),so.toPromise(so.filter(this.registry.onDidRegisterCommand,a=>a===t))])]),this._tryExecuteCommand(t,n))})}executeCommandThowErr(t){if(!this.registry.getCommand(t))throw new Error(`command '${t}' not found`);let e=this.registry.getCommand(t);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this._onWillExecuteCommand.fire({commandId:t,args:r});let i=this.invokeFunction(e.handler,...r);return this._onDidExecuteCommand.fire({commandId:t,args:r}),i}_tryExecuteCommand(t,e){let n=this.registry.getCommand(t);if(!n)return Promise.reject(new Error(`command '${t}' not found`));try{this._onWillExecuteCommand.fire({commandId:t,args:e});let r=this.invokeFunction(n.handler,...e);return this._onDidExecuteCommand.fire({commandId:t,args:e}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}invokeFunction(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t(...n)}finally{}}};hc=Nc([Uc],hc);function Pe(t,e,n){return(e=lm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lm(t){var e=cm(t,"string");return typeof e=="symbol"?e:e+""}function cm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Kt=t=>t?function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t==null||t(...n)}catch(a){console.error("Error calling function",a)}}:()=>{console.log("wrapUserFunction: fn is undefined")},co=class{constructor(e){Pe(this,"context",void 0),Pe(this,"continueCallback",void 0),Pe(this,"adIsShowingCallback",void 0),Pe(this,"isBeforeAdCalled",!1),Pe(this,"isBeforeRewardCalled",!1),Pe(this,"isAdDismissedCalled",!1),Pe(this,"isAdViewedCalled",!1),Pe(this,"isAfterAdCalled",!1),Pe(this,"currentProvider",void 0),Pe(this,"currentClientParams",void 0),Pe(this,"adsHasResponse",!1),Pe(this,"videoChecker",window.document.createElement("video")),Pe(this,"contextInfo",void 0),Pe(this,"wrapShowAdFn",n=>()=>{var r,a,i;this.adsHasResponse=!0;let o=!1;this.videoChecker.play().catch(()=>{o=!1}),o=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:o},this.paramsToTrack)),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_REWARD",kh({userEvent:o},this.paramsToTrack)),fc()&&this.context.track("mmp_ad_impression",{ad_network:(a=(r=this.currentProvider)==null?void 0:r.name)!=null?a:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(i=this.adIsShowingCallback)==null||i.call(this,!0);let s=Kt(n);s==null||s()}),this.context=e,this.contextInfo=e.getContextInfo()}notifyIframeAdsEvent(e,n){window.parent&&window.parent.postMessage({type:e,data:n},"*"),window.dispatchEvent(new CustomEvent(e,{detail:n}))}get paramsToTrack(){var e,n,r,a,i,o;return{provider:(n=(e=this.currentProvider)==null?void 0:e.name)!=null?n:null,type:(r=this.currentClientParams)==null?void 0:r.type,name:((a=this.currentClientParams)==null?void 0:a.type)==="preroll"?null:(o=(i=this.currentClientParams)==null?void 0:i.name)!=null?o:""}}wrapBeforeAd(e){return()=>{var n,r,a,i;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let o=Kt(e);o==null||o(),((n=this.currentClientParams)==null?void 0:n.type)!=="reward"&&((r=this.adIsShowingCallback)==null||r.call(this,!0),fc()&&this.context.track("mmp_ad_impression",{ad_network:(i=(a=this.currentProvider)==null?void 0:a.name)!=null?i:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(e){return n=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(n)():(this.isBeforeRewardCalled=!0,e==null||e(this.wrapShowAdFn(n)))}}wrapAdDismissed(e){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let n=Kt(e);n==null||n()}}}wrapAdViewed(e){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let n=Kt(e);n==null||n()}}}wrapAfterAd(e){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AFTER_AD",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let n=Kt(e);n==null||n()}}}wrapAdBreakDone(e){return n=>{var r,a,i,o,s,l,d,y,f;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(a=(r=this.currentProvider)==null?void 0:r.name)!=null?a:null,breakType:n.breakType,breakName:(i=n.breakName)!=null?i:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_DONE",{provider:(s=(o=this.currentProvider)==null?void 0:o.name)!=null?s:null,breakType:n.breakType,breakName:(l=n.breakName)!=null?l:"",breakFormat:n.breakFormat,breakStatus:n.breakStatus}),n.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let p=Kt(e);p==null||p(n),(d=this.adIsShowingCallback)==null||d.call(this,!1),(y=this.continueCallback)==null||y.call(this,[!1,n]);break}default:{(f=this.continueCallback)==null||f.call(this,[!0,n]);break}}}}callAdBreakAndContinue(e,n,r,a){return S(this,null,function*(){return this.currentProvider=e,this.currentClientParams=n,this.adsHasResponse=!1,new Promise(i=>{this.continueCallback=i,this.adIsShowingCallback=a;let o;switch(n.type){case"preroll":{o={type:n.type,adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}case"reward":{o={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),beforeReward:this.wrapBeforeReward(n.beforeReward),adDismissed:this.wrapAdDismissed(n.adDismissed),adViewed:this.wrapAdViewed(n.adViewed),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}default:{o={name:n.name,type:n.type,beforeAd:this.wrapBeforeAd(n.beforeAd),afterAd:this.wrapAfterAd(n.afterAd),adBreakDone:this.wrapAdBreakDone(n.adBreakDone)};break}}window.setTimeout(()=>{var s,l,d,y,f,p,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:n.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_TIMEOUT",{type:n.type,provider:(y=(d=this.currentProvider)==null?void 0:d.name)!=null?y:null}),(p=this.continueCallback)==null||p.call(this,[!0,{breakType:n.type,breakName:n.type==="preroll"?"":(f=n.name)!=null?f:"",breakFormat:n.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyIframeAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),e.adBreak(o,r),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Kr(t,e,n){return(e=um(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function um(t){var e=dm(t,"string");return typeof e=="symbol"?e:e+""}function dm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uo=class{constructor(e){Kr(this,"context",void 0),Kr(this,"adBreakIsShowing",!1),Kr(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Kr(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=e,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",n=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}};function Wr(t,e,n){return(e=fm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fm(t){var e=hm(t,"string");return typeof e=="symbol"?e:e+""}function hm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fo=class{constructor(e){Wr(this,"configs",null),Wr(this,"firstRun",!0),Wr(this,"context",void 0),Wr(this,"contextInfo",void 0),this.context=e,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return S(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(e){}})}shouldBypassCallingInterstitial(){var e,n;let r;if(!this.configs)this.init(),r=!this.firstRun;else{let a=(e=this.contextInfo.channel)!=null?e:"",i=this.configs[a],o=(n=i==null?void 0:i.interstitialRate)!=null?n:1;r=Math.random()<o}return this.firstRun=!1,r}};function ct(t,e,n){return(e=mm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mm(t){var e=pm(t,"string");return typeof e=="symbol"?e:e+""}function pm(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ho=class{constructor(e,n){ct(this,"name","ADSENSE"),ct(this,"context",void 0),ct(this,"contextInfo",void 0),ct(this,"configured",!1),ct(this,"initParams",void 0),ct(this,"push",function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(r)}),ct(this,"adConfig",r=>{let a=r,{onReady:i}=a,o=Th(a,["onReady"]);this.context.track("CallAdConfig",o),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(r))}),ct(this,"adBreak",r=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(r)}),ct(this,"adUnit",r=>S(this,null,function*(){var a,i,o,s;if(this.context.track("CallAdUnit",{adFormat:(i=(a=r.adFormat)==null?void 0:a.toString())!=null?i:null,fullWidthResponsive:(o=r.fullWidthResponsive)!=null?o:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:l,slot:d,adFormat:y,fullWidthResponsive:f,style:p}=r,h;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?h=document.querySelector(l):h=l,!h)throw new Error("targeting element not found");let b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let E=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",b),E&&C.setAttribute("data-ad-format",E),f&&C.setAttribute("data-full-width-responsive",f),p&&C.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",C.style.position="relative",h.appendChild(C),C.appendChild(w)}else h.appendChild(C),new MutationObserver(w=>{w.forEach(O=>{if(O.type==="attributes"&&O.attributeName==="data-ad-status"){let k=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:k!=null?k:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=e,this.contextInfo=this.context.getContextInfo(),this.initParams=n,window.adsbygoogle=window.adsbygoogle||[]}init(){return S(this,null,function*(){var e;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let n="google-adsense",r=(e=this.contextInfo.testAdsMode)!=null?e:!1;if(!document.getElementById(n)&&this.initParams.clientId){let a=document.createElement("script");a.id=n,a.async=!0,a.crossOrigin="anonymous",a.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,r&&a.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&a.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&a.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&a.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&a.setAttribute("data-admob-ads-only","on"),document.head.appendChild(a),this.context.track("LoadAdsenseCompleted",null)}})}};function vm(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function gm(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var _m=function(){function t(n){var r=this;this._insertTag=function(a){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,i),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(gm(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var a=vm(r);try{a.insertRule(n,a.cssRules.length)}catch(i){}}else r.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},t}(),Ae="-ms-",ra="-moz-",Y="-webkit-",Fc="comm",ko="rule",To="decl",ym="@import",Hc="@keyframes",wm="@layer",bm=Math.abs,la=String.fromCharCode,Em=Object.assign;function Im(t,e){return ge(t,0)^45?(((e<<2^ge(t,0))<<2^ge(t,1))<<2^ge(t,2))<<2^ge(t,3):0}function jc(t){return t.trim()}function Am(t,e){return(t=e.exec(t))?t[0]:t}function Q(t,e,n){return t.replace(e,n)}function mo(t,e){return t.indexOf(e)}function ge(t,e){return t.charCodeAt(e)|0}function kn(t,e,n){return t.slice(e,n)}function Ye(t){return t.length}function xo(t){return t.length}function zr(t,e){return e.push(t),t}function Sm(t,e){return t.map(e).join("")}var ca=1,Qt=1,qc=0,Le=0,me=0,Zt="";function ua(t,e,n,r,a,i,o){return{value:t,root:e,parent:n,type:r,props:a,children:i,line:ca,column:Qt,length:o,return:""}}function Sn(t,e){return Em(ua("",null,null,"",null,null,0),t,{length:-t.length},e)}function Cm(){return me}function Rm(){return me=Le>0?ge(Zt,--Le):0,Qt--,me===10&&(Qt=1,ca--),me}function Ge(){return me=Le<qc?ge(Zt,Le++):0,Qt++,me===10&&(Qt=1,ca++),me}function Qe(){return ge(Zt,Le)}function Yr(){return Le}function Pn(t,e){return kn(Zt,t,e)}function Tn(t){switch(t){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 Vc(t){return ca=Qt=1,qc=Ye(Zt=t),Le=0,[]}function $c(t){return Zt="",t}function Qr(t){return jc(Pn(Le-1,po(t===91?t+2:t===40?t+1:t)))}function Om(t){for(;(me=Qe())&&me<33;)Ge();return Tn(t)>2||Tn(me)>3?"":" "}function km(t,e){for(;--e&&Ge()&&!(me<48||me>102||me>57&&me<65||me>70&&me<97););return Pn(t,Yr()+(e<6&&Qe()==32&&Ge()==32))}function po(t){for(;Ge();)switch(me){case t:return Le;case 34:case 39:t!==34&&t!==39&&po(me);break;case 40:t===41&&po(t);break;case 92:Ge();break}return Le}function Tm(t,e){for(;Ge()&&t+me!==57&&!(t+me===84&&Qe()===47););return"/*"+Pn(e,Le-1)+"*"+la(t===47?t:Ge())}function xm(t){for(;!Tn(Qe());)Ge();return Pn(t,Le)}function Pm(t){return $c(Zr("",null,null,null,[""],t=Vc(t),0,[0],t))}function Zr(t,e,n,r,a,i,o,s,l){for(var d=0,y=0,f=o,p=0,h=0,b=0,E=1,C=1,w=1,O=0,k="",M=a,B=i,I=r,D=k;C;)switch(b=O,O=Ge()){case 40:if(b!=108&&ge(D,f-1)==58){mo(D+=Q(Qr(O),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:D+=Qr(O);break;case 9:case 10:case 13:case 32:D+=Om(b);break;case 92:D+=km(Yr()-1,7);continue;case 47:switch(Qe()){case 42:case 47:zr(Dm(Tm(Ge(),Yr()),e,n),l);break;default:D+="/"}break;case 123*E:s[d++]=Ye(D)*w;case 125*E:case 59:case 0:switch(O){case 0:case 125:C=0;case 59+y:w==-1&&(D=Q(D,/\f/g,"")),h>0&&Ye(D)-f&&zr(h>32?pc(D+";",r,n,f-1):pc(Q(D," ","")+";",r,n,f-2),l);break;case 59:D+=";";default:if(zr(I=mc(D,e,n,d,y,a,s,k,M=[],B=[],f),i),O===123)if(y===0)Zr(D,e,I,I,M,i,f,s,B);else switch(p===99&&ge(D,3)===110?100:p){case 100:case 108:case 109:case 115:Zr(t,I,I,r&&zr(mc(t,I,I,0,0,a,s,k,a,M=[],f),B),a,B,f,s,r?M:B);break;default:Zr(D,I,I,I,[""],B,0,s,B)}}d=y=h=0,E=w=1,k=D="",f=o;break;case 58:f=1+Ye(D),h=b;default:if(E<1){if(O==123)--E;else if(O==125&&E++==0&&Rm()==125)continue}switch(D+=la(O),O*E){case 38:w=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Ye(D)-1)*w,w=1;break;case 64:Qe()===45&&(D+=Qr(Ge())),p=Qe(),y=f=Ye(k=D+=xm(Yr())),O++;break;case 45:b===45&&Ye(D)==2&&(E=0)}}return i}function mc(t,e,n,r,a,i,o,s,l,d,y){for(var f=a-1,p=a===0?i:[""],h=xo(p),b=0,E=0,C=0;b<r;++b)for(var w=0,O=kn(t,f+1,f=bm(E=o[b])),k=t;w<h;++w)(k=jc(E>0?p[w]+" "+O:Q(O,/&\f/g,p[w])))&&(l[C++]=k);return ua(t,e,n,a===0?ko:s,l,d,y)}function Dm(t,e,n){return ua(t,e,n,Fc,la(Cm()),kn(t,2,-2),0)}function pc(t,e,n,r){return ua(t,e,n,To,kn(t,0,r),kn(t,r+1,-1),r)}function Yt(t,e){for(var n="",r=xo(t),a=0;a<r;a++)n+=e(t[a],a,t,e)||"";return n}function Lm(t,e,n,r){switch(t.type){case wm:if(t.children.length)break;case ym:case To:return t.return=t.return||t.value;case Fc:return"";case Hc:return t.return=t.value+"{"+Yt(t.children,r)+"}";case ko:t.value=t.props.join(",")}return Ye(n=Yt(t.children,r))?t.return=t.value+"{"+n+"}":""}function Nm(t){var e=xo(t);return function(n,r,a,i){for(var o="",s=0;s<e;s++)o+=t[s](n,r,a,i)||"";return o}}function Um(t){return function(e){e.root||(e=e.return)&&t(e)}}function Bm(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var Mm=function(t,e,n){for(var r=0,a=0;r=a,a=Qe(),r===38&&a===12&&(e[n]=1),!Tn(a);)Ge();return Pn(t,Le)},Gm=function(t,e){var n=-1,r=44;do switch(Tn(r)){case 0:r===38&&Qe()===12&&(e[n]=1),t[n]+=Mm(Le-1,e,n);break;case 2:t[n]+=Qr(r);break;case 4:if(r===44){t[++n]=Qe()===58?"&\f":"",e[n]=t[n].length;break}default:t[n]+=la(r)}while(r=Ge());return t},Jm=function(t,e){return $c(Gm(Vc(t),e))},vc=new WeakMap,Fm=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var e=t.value,n=t.parent,r=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&e.charCodeAt(0)!==58&&!vc.get(n))&&!r){vc.set(t,!0);for(var a=[],i=Jm(e,a),o=n.props,s=0,l=0;s<i.length;s++)for(var d=0;d<o.length;d++,l++)t.props[l]=a[s]?i[s].replace(/&\f/g,o[d]):o[d]+" "+i[s]}}},Hm=function(t){if(t.type==="decl"){var e=t.value;e.charCodeAt(0)===108&&e.charCodeAt(2)===98&&(t.return="",t.value="")}};function Kc(t,e){switch(Im(t,e)){case 5103:return Y+"print-"+t+t;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 Y+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Y+t+ra+t+Ae+t+t;case 6828:case 4268:return Y+t+Ae+t+t;case 6165:return Y+t+Ae+"flex-"+t+t;case 5187:return Y+t+Q(t,/(\w+).+(:[^]+)/,Y+"box-$1$2"+Ae+"flex-$1$2")+t;case 5443:return Y+t+Ae+"flex-item-"+Q(t,/flex-|-self/,"")+t;case 4675:return Y+t+Ae+"flex-line-pack"+Q(t,/align-content|flex-|-self/,"")+t;case 5548:return Y+t+Ae+Q(t,"shrink","negative")+t;case 5292:return Y+t+Ae+Q(t,"basis","preferred-size")+t;case 6060:return Y+"box-"+Q(t,"-grow","")+Y+t+Ae+Q(t,"grow","positive")+t;case 4554:return Y+Q(t,/([^-])(transform)/g,"$1"+Y+"$2")+t;case 6187:return Q(Q(Q(t,/(zoom-|grab)/,Y+"$1"),/(image-set)/,Y+"$1"),t,"")+t;case 5495:case 3959:return Q(t,/(image-set\([^]*)/,Y+"$1$`$1");case 4968:return Q(Q(t,/(.+:)(flex-)?(.*)/,Y+"box-pack:$3"+Ae+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Y+t+t;case 4095:case 3583:case 4068:case 2532:return Q(t,/(.+)-inline(.+)/,Y+"$1$2")+t;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(Ye(t)-1-e>6)switch(ge(t,e+1)){case 109:if(ge(t,e+4)!==45)break;case 102:return Q(t,/(.+:)(.+)-([^]+)/,"$1"+Y+"$2-$3$1"+ra+(ge(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~mo(t,"stretch")?Kc(Q(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ge(t,e+1)!==115)break;case 6444:switch(ge(t,Ye(t)-3-(~mo(t,"!important")&&10))){case 107:return Q(t,":",":"+Y)+t;case 101:return Q(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Y+(ge(t,14)===45?"inline-":"")+"box$3$1"+Y+"$2$3$1"+Ae+"$2box$3")+t}break;case 5936:switch(ge(t,e+11)){case 114:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Y+t+Ae+Q(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Y+t+Ae+t+t}return t}var jm=function(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case To:t.return=Kc(t.value,t.length);break;case Hc:return Yt([Sn(t,{value:Q(t.value,"@","@"+Y)})],r);case ko:if(t.length)return Sm(t.props,function(a){switch(Am(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Yt([Sn(t,{props:[Q(a,/:(read-\w+)/,":"+ra+"$1")]})],r);case"::placeholder":return Yt([Sn(t,{props:[Q(a,/:(plac\w+)/,":"+Y+"input-$1")]}),Sn(t,{props:[Q(a,/:(plac\w+)/,":"+ra+"$1")]}),Sn(t,{props:[Q(a,/:(plac\w+)/,Ae+"input-$1")]})],r)}return""})}},qm=[jm],Vm=function(t){var e=t.key;if(e==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(b){var E=b.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var r=t.stylisPlugins||qm,a={},i,o=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),function(b){for(var E=b.getAttribute("data-emotion").split(" "),C=1;C<E.length;C++)a[E[C]]=!0;o.push(b)});var s,l=[Fm,Hm];{var d,y=[Lm,Um(function(b){d.insert(b)})],f=Nm(l.concat(r,y)),p=function(b){return Yt(Pm(b),f)};s=function(b,E,C,w){d=C,p(b?b+"{"+E.styles+"}":E.styles),w&&(h.inserted[E.name]=!0)}}var h={key:e,sheet:new _m({key:e,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:s};return h.sheet.hydrate(o),h};function $m(t){for(var e=0,n,r=0,a=t.length;a>=4;++r,a-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(a){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Km={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},Wm=/[A-Z]|^ms/g,zm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wc=function(t){return t.charCodeAt(1)===45},gc=function(t){return t!=null&&typeof t!="boolean"},eo=Bm(function(t){return Wc(t)?t:t.replace(Wm,"-$&").toLowerCase()}),_c=function(t,e){switch(t){case"animation":case"animationName":if(typeof e=="string")return e.replace(zm,function(n,r,a){return _t={name:r,styles:a,next:_t},r})}return Km[t]!==1&&!Wc(t)&&typeof e=="number"&&e!==0?e+"px":e};function aa(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return _t={name:a.name,styles:a.styles,next:_t},a.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)_t={name:o.name,styles:o.styles,next:_t},o=o.next;var s=i.styles+";";return s}return Xm(t,e,n)}}var l=n;if(e==null)return l;var d=e[l];return d!==void 0?d:l}function Xm(t,e,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=aa(t,e,n[a])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var s=o;e!=null&&e[s]!==void 0?r+=i+"{"+e[s]+"}":gc(s)&&(r+=eo(i)+":"+_c(i,s)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(e==null||e[o[0]]===void 0))for(var l=0;l<o.length;l++)gc(o[l])&&(r+=eo(i)+":"+_c(i,o[l])+";");else{var d=aa(t,e,o);switch(i){case"animation":case"animationName":{r+=eo(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var yc=/label:\s*([^\s;{]+)\s*(;|$)/g,_t;function to(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,a="";_t=void 0;var i=t[0];if(i==null||i.raw===void 0)r=!1,a+=aa(n,e,i);else{var o=i;a+=o[0]}for(var s=1;s<t.length;s++)if(a+=aa(n,e,t[s]),r){var l=i;a+=l[s]}yc.lastIndex=0;for(var d="",y;(y=yc.exec(a))!==null;)d+="-"+y[1];var f=$m(a)+d;return{name:f,styles:a,next:_t}}function zc(t,e,n){var r="";return n.split(" ").forEach(function(a){t[a]!==void 0?e.push(t[a]+";"):a&&(r+=a+" ")}),r}var Ym=function(t,e,n){var r=t.key+"-"+e.name;t.registered[r]===void 0&&(t.registered[r]=e.styles)},Qm=function(t,e,n){Ym(t,e);var r=t.key+"-"+e.name;if(t.inserted[e.name]===void 0){var a=e;do t.insert(e===a?"."+r:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function wc(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function bc(t,e,n){var r=[],a=zc(t,r,n);return r.length<2?n:a+e(r)}var Zm=function(t){var e=Vm(t);e.sheet.speedy=function(o){this.isSpeedy=o},e.compat=!0;var n=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered,void 0);return Qm(e,d),e.key+"-"+d.name},r=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered),y="animation-"+d.name;return wc(e,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},a=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var d=to(s,e.registered);wc(e,d)},i=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return bc(e.registered,n,ep(s))};return{css:n,cx:i,injectGlobal:a,keyframes:r,hydrate:function(o){o.forEach(function(s){e.inserted[s]=!0})},flush:function(){e.registered={},e.inserted={},e.sheet.flush()},sheet:e.sheet,cache:e,getRegisteredStyles:zc.bind(null,e.registered),merge:bc.bind(null,e.registered,n)}},ep=function t(e){for(var n="",r=0;r<e.length;r++){var a=e[r];if(a!=null){var i=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))i=t(a);else{i="";for(var o in a)a[o]&&o&&(i&&(i+=" "),i+=o)}break}default:i=a}i&&(n&&(n+=" "),n+=i)}}return n},tp=Zm({key:"css"}),Se=tp.css,vo,Me,no,Ec,Ic=0,Xc=[],pe=H,Ac=pe.__b,Sc=pe.__r,Cc=pe.diffed,Rc=pe.__c,Oc=pe.unmount,kc=pe.__;function np(t,e){pe.__h&&pe.__h(Me,t,Ic||e),Ic=0;var n=Me.__H||(Me.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Yc(t,e){var n=np(vo++,7);return ip(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function rp(){for(var t;t=Xc.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ea),t.__H.__h.forEach(go),t.__H.__h=[]}catch(e){t.__H.__h=[],pe.__e(e,t.__v)}}pe.__b=function(t){Me=null,Ac&&Ac(t)},pe.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),kc&&kc(t,e)},pe.__r=function(t){Sc&&Sc(t),vo=0;var e=(Me=t.__c).__H;e&&(no===Me?(e.__h=[],Me.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(ea),e.__h.forEach(go),e.__h=[],vo=0)),no=Me},pe.diffed=function(t){Cc&&Cc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Xc.push(e)!==1&&Ec===pe.requestAnimationFrame||((Ec=pe.requestAnimationFrame)||ap)(rp)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),no=Me=null},pe.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ea),n.__h=n.__h.filter(function(r){return!r.__||go(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],pe.__e(r,n.__v)}}),Rc&&Rc(t,e)},pe.unmount=function(t){Oc&&Oc(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ea(r)}catch(a){e=a}}),n.__H=void 0,e&&pe.__e(e,n.__v))};var Tc=typeof requestAnimationFrame=="function";function ap(t){var e,n=function(){clearTimeout(r),Tc&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Tc&&(e=requestAnimationFrame(n))}function ea(t){var e=Me,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Me=e}function go(t){var e=Me;t.__c=t.__(),Me=e}function ip(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}var op=Symbol.for("preact-signals");function da(){if(yt>1)yt--;else{for(var t,e=!1;Cn!==void 0;){var n=Cn;for(Cn=void 0,_o++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Zc(n))try{n.c()}catch(a){e||(t=a,e=!0)}n=r}}if(_o=0,yt--,e)throw t}}function _e(t){if(yt>0)return t();yt++;try{return t()}finally{da()}}var re=void 0,Cn=void 0,yt=0,_o=0,ia=0;function Qc(t){if(re!==void 0){var e=t.n;if(e===void 0||e.t!==re)return e={i:0,S:t,p:re.s,n:void 0,t:re,e:void 0,x:void 0,r:e},re.s!==void 0&&(re.s.n=e),re.s=e,t.n=e,32&re.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=re.s,e.n=void 0,re.s.n=e,re.s=e),e}}function ye(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}ye.prototype.brand=op;ye.prototype.h=function(){return!0};ye.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};ye.prototype.U=function(t){if(this.t!==void 0){var e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}};ye.prototype.subscribe=function(t){var e=this;return Ln(function(){var n=e.value,r=re;re=void 0;try{t(n)}finally{re=r}})};ye.prototype.valueOf=function(){return this.value};ye.prototype.toString=function(){return this.value+""};ye.prototype.toJSON=function(){return this.value};ye.prototype.peek=function(){var t=re;re=void 0;try{return this.value}finally{re=t}};Object.defineProperty(ye.prototype,"value",{get:function(){var t=Qc(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(_o>100)throw new Error("Cycle detected");this.v=t,this.i++,ia++,yt++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{da()}}}});function K(t){return new ye(t)}function Zc(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function eu(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function tu(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function en(t){ye.call(this,void 0),this.x=t,this.s=void 0,this.g=ia-1,this.f=4}(en.prototype=new ye).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ia))return!0;if(this.g=ia,this.f|=1,this.i>0&&!Zc(this))return this.f&=-2,!0;var t=re;try{eu(this),re=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return re=t,tu(this),this.f&=-2,!0};en.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ye.prototype.S.call(this,t)};en.prototype.U=function(t){if(this.t!==void 0&&(ye.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};en.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(en.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Qc(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Rn(t){return new en(t)}function nu(t){var e=t.u;if(t.u=void 0,typeof e=="function"){yt++;var n=re;re=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,Po(t),r}finally{re=n,da()}}}function Po(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,nu(t)}function sp(t){if(re!==this)throw new Error("Out-of-order effect");tu(this),re=t,this.f&=-2,8&this.f&&Po(this),da()}function Dn(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Dn.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};Dn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,nu(this),eu(this),yt++;var t=re;return re=this,sp.bind(this,t)};Dn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Cn,Cn=this)};Dn.prototype.d=function(){this.f|=8,1&this.f||Po(this)};function Ln(t){var e=new Dn(t);try{e.c()}catch(n){throw e.d(),n}return e.d.bind(e)}var ru,ro,au=[];Ln(function(){ru=this.N})();function tn(t,e){H[t]=e.bind(null,H[t]||function(){})}function oa(t){ro&&ro(),ro=t&&t.S()}function iu(t){var e=this,n=t.data,r=ou(n);r.value=n;var a=Yc(function(){for(var s=e,l=e.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=Rn(function(){var h=r.value.value;return h===0?0:h===!0?"":h||""}),y=Rn(function(){return!Array.isArray(d.value)&&!ji(d.value)}),f=Ln(function(){if(this.N=su,y.value){var h=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),p=e.__$u.d;return e.__$u.d=function(){f(),p.call(this)},[y,d]},[]),i=a[0],o=a[1];return i.value?o.peek():o.value}iu.displayName="_st";Object.defineProperties(ye.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:iu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});tn("__b",function(t,e){if(typeof e.type=="string"){var n,r=e.props;for(var a in r)if(a!=="children"){var i=r[a];i instanceof ye&&(n||(e.__np=n={}),n[a]=i,r[a]=i.peek())}}t(e)});tn("__r",function(t,e){oa();var n,r=e.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(a){var i;return Ln(function(){i=this}),i.c=function(){r.__$f|=1,r.setState({})},i}())),oa(n),t(e)});tn("__e",function(t,e,n,r){oa(),t(e,n,r)});tn("diffed",function(t,e){oa();var n;if(typeof e.type=="string"&&(n=e.__e)){var r=e.__np,a=e.props;if(r){var i=n.U;if(i)for(var o in i){var s=i[o];s!==void 0&&!(o in r)&&(s.d(),i[o]=void 0)}else i={},n.U=i;for(var l in r){var d=i[l],y=r[l];d===void 0?(d=lp(n,l,y,a),i[l]=d):d.o(y,a)}}}t(e)});function lp(t,e,n,r){var a=e in t&&t.ownerSVGElement===void 0,i=K(n);return{o:function(o,s){i.value=o,r=s},d:Ln(function(){this.N=su;var o=i.value.value;r[e]!==o&&(r[e]=o,a?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}tn("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var a in r){var i=r[a];i&&i.d()}}}}else{var o=e.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}t(e)});tn("__h",function(t,e,n,r){(r<3||r===9)&&(e.__$f|=2),t(e,n,r)});Be.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,r=n&&n.s!==void 0;for(var a in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function ou(t){return Yc(function(){return K(t)},[])}var cp=function(t){queueMicrotask(function(){queueMicrotask(t)})};function up(){_e(function(){for(var t;t=au.shift();)ru.call(t)})}function su(){au.push(this)===1&&(H.requestAnimationFrame||cp)(up)}var ve=Se`
4
4
  inset: 0;
5
5
  clear: none;
6
6
  float: none;
@@ -18,8 +18,8 @@ or `);this.errors.push(i)}return r}},dr=class extends de{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
- `;function lp(e,t){let n=Ki(e);Wi(()=>{n.current=e},[e]),_n(()=>{if(t===null)return;let r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}var cp=0;function le(e,t,n,r,o,i){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var d={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--cp,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return G.vnode&&G.vnode(d),d}var up=Xt`
22
- ${Ee}
21
+ `;function dp(t,e){let n=qr(t);Xi(()=>{n.current=t},[t]),Pt(()=>{if(e===null)return;let r=setInterval(()=>{n.current()},e);return()=>{clearInterval(r)}},[e])}var fp=0;function z(t,e,n,r,a,i){e||(e={});var o,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?o=e[s]:l[s]=e[s];var d={type:t,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--fp,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return H.vnode&&H.vnode(d),d}var hp=Se`
22
+ ${ve}
23
23
  position: fixed;
24
24
  top: 0;
25
25
  left: 0;
@@ -32,7 +32,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
32
32
  height: 100vh;
33
33
 
34
34
  .card-wrapper {
35
- ${Ee}
35
+ ${ve}
36
36
  position: relative;
37
37
  display: flex;
38
38
  flex-direction: column;
@@ -46,7 +46,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
46
46
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
47
47
 
48
48
  .body {
49
- ${Ee}
49
+ ${ve}
50
50
  display: flex;
51
51
  flex-direction: column;
52
52
  width: 100%;
@@ -55,7 +55,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
55
55
  box-sizing: border-box;
56
56
  justify-content: center;
57
57
  .title {
58
- ${Ee}
58
+ ${ve}
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 r}},dr=class extends de{constructor(...t){super
63
63
  }
64
64
 
65
65
  .content {
66
- ${Ee}
66
+ ${ve}
67
67
  font-size: 14px;
68
68
  color: #888;
69
69
  margin-bottom: 16px;
@@ -71,13 +71,13 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
71
71
  }
72
72
 
73
73
  .footer {
74
- ${Ee}
74
+ ${ve}
75
75
  display: flex;
76
76
  align-items: center;
77
77
  width: 100%;
78
78
  height: 40px;
79
79
  button {
80
- ${Ee}
80
+ ${ve}
81
81
  border: none;
82
82
  outline: none;
83
83
  height: 100%;
@@ -93,8 +93,8 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
93
93
  }
94
94
  }
95
95
  }
96
- `,lt=ee(null),_a=ee(""),ya=ee(""),Yr=ee(!1),dp=()=>{var e;(e=lt.value)==null||e.call(lt,!1)},fp=()=>{var e;(e=lt.value)==null||e.call(lt,!0)},hp=e=>A(void 0,null,function*(){let{title:t,content:n}=e;return lt.value&&(lt.value(!1),Te(()=>{lt.value=null,Yr.value=!1})),Te(()=>{_a.value=t||"",ya.value=n||"",Yr.value=!0}),new Promise(r=>{lt.value=o=>{Te(()=>{lt.value=null,Yr.value=!1,_a.value="",ya.value=""}),r(o)}})}),mp=()=>Yr.value?le("div",{className:up,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:_a.value}),le("div",{className:"content",children:ya.value})]}),le("div",{className:"footer",children:[le("button",{onClick:dp,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:fp,className:"confirm-btm",children:"Confirm"})]})]})}):null,pp=Xt`
97
- ${Ee}
96
+ `,ft=K(null),yo=K(""),wo=K(""),ta=K(!1),mp=()=>{var t;(t=ft.value)==null||t.call(ft,!1)},pp=()=>{var t;(t=ft.value)==null||t.call(ft,!0)},vp=t=>S(void 0,null,function*(){let{title:e,content:n}=t;return ft.value&&(ft.value(!1),_e(()=>{ft.value=null,ta.value=!1})),_e(()=>{yo.value=e||"",wo.value=n||"",ta.value=!0}),new Promise(r=>{ft.value=a=>{_e(()=>{ft.value=null,ta.value=!1,yo.value="",wo.value=""}),r(a)}})}),gp=()=>ta.value?z("div",{className:hp,children:z("div",{className:"card-wrapper",children:[z("div",{className:"body",children:[z("div",{className:"title",children:yo.value}),z("div",{className:"content",children:wo.value})]}),z("div",{className:"footer",children:[z("button",{onClick:mp,className:"cancel-btn",children:"Cancel"}),z("button",{onClick:pp,className:"confirm-btm",children:"Confirm"})]})]})}):null,_p=Se`
97
+ ${ve}
98
98
  position: relative;
99
99
  display: flex;
100
100
  align-items: center;
@@ -112,7 +112,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
112
112
  }
113
113
 
114
114
  button {
115
- ${Ee}
115
+ ${ve}
116
116
  padding: 0 20px;
117
117
  height: 30px;
118
118
  line-height: 30px;
@@ -126,8 +126,8 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
126
126
  cursor: not-allowed;
127
127
  }
128
128
  }
129
- `,vp=()=>{let e=ee(!1),t=ee(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Te(()=>{t.value=Date.now(),e.value=!1})}}},gp=e=>{let{countdown:t=0,mode:n,onClose:r,state:o}=e,{startTimestamp:i,timerPaused:a}=o,s=ru(t);lp(()=>{s.value>0?s.value-=1:Te(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let l=An(()=>{if(n==="interstitial"||n==="rewarded_insterstitial"||!i.value)return!1;let h=Date.now()-i.value;return s.value>0&&t-s.value>=5&&h>=5e3}),d=An(()=>{if(n==="interstitial")return!0;if(!i.value)return!1;let h=Date.now()-i.value;return s.value<=0&&h>=(t-1)*1e3&&t>5}),y=An(()=>n==="interstitial"?!1:!l.value&&!d.value),f=()=>A(void 0,null,function*(){if(a.value=!0,!(yield hp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}r("dismiss"),Te(()=>{a.value=!0,s.value=0,i.value=null})}),p=()=>{r("viewed"),Te(()=>{a.value=!0,s.value=0,i.value=null})};return le("div",{className:pp,children:[s.value>0&&n!=="interstitial"&&le("div",{className:"timer",children:[s.value,"s"]}),le("button",{onClick:l.value?f:d.value?p:void 0,disabled:y.value,children:le("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:le("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"})})})]})},_p=()=>{let e=ee(),t=ee(),n=ee(),r=ee(),o=ee(),i=ee(!1),a=ee(15),s=ee(""),l=ee("reward");return{afterAd:e,adDismissed:t,adViewed:n,adBreakDone:r,adLoaded:o,visible:i,countdown:a,src:s,mode:l}},yp=Xt`
130
- ${Ee}
129
+ `,yp=()=>{let t=K(!1),e=K(null);return{timerPaused:t,startTimestamp:e,startTimer:()=>{_e(()=>{e.value=Date.now(),t.value=!1})}}},wp=t=>{let{countdown:e=0,mode:n,onClose:r,state:a}=t,{startTimestamp:i,timerPaused:o}=a,s=ou(e);dp(()=>{s.value>0?s.value-=1:_e(()=>{o.value=!0,s.value=0})},o.value?null:1e3);let l=Rn(()=>{if(n==="interstitial"||n==="rewarded_insterstitial"||!i.value)return!1;let h=Date.now()-i.value;return s.value>0&&e-s.value>=5&&h>=5e3}),d=Rn(()=>{if(n==="interstitial")return!0;if(!i.value)return!1;let h=Date.now()-i.value;return s.value<=0&&h>=(e-1)*1e3&&e>5}),y=Rn(()=>n==="interstitial"?!1:!l.value&&!d.value),f=()=>S(void 0,null,function*(){if(o.value=!0,!(yield vp({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){o.value=!1;return}r("dismiss"),_e(()=>{o.value=!0,s.value=0,i.value=null})}),p=()=>{r("viewed"),_e(()=>{o.value=!0,s.value=0,i.value=null})};return z("div",{className:_p,children:[s.value>0&&n!=="interstitial"&&z("div",{className:"timer",children:[s.value,"s"]}),z("button",{onClick:l.value?f:d.value?p:void 0,disabled:y.value,children:z("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z("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"})})})]})},bp=()=>{let t=K(),e=K(),n=K(),r=K(),a=K(),i=K(!1),o=K(15),s=K(""),l=K("reward");return{afterAd:t,adDismissed:e,adViewed:n,adBreakDone:r,adLoaded:a,visible:i,countdown:o,src:s,mode:l}},Ep=Se`
130
+ ${ve}
131
131
  position: fixed;
132
132
  z-index: 2147483647;
133
133
  background: white;
@@ -137,7 +137,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
137
137
  flex-direction: column;
138
138
 
139
139
  iframe {
140
- ${Ee}
140
+ ${ve}
141
141
  flex: 1;
142
142
  position: relative;
143
143
  display: block;
@@ -145,8 +145,91 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  }
148
- `,wp=e=>{let{state:t}=e,{afterAd:n,adDismissed:r,adViewed:o,adBreakDone:i,adLoaded:a,visible:s,countdown:l,src:d,mode:y}=t,f=yn(()=>vp(),[]),[p,h]=Fr(!1),b=C=>{var w,T,L,M;s.value=!1,C==="dismiss"?(w=r.value)==null||w.call(r):C==="viewed"&&((T=o.value)==null||T.call(o)),(L=n.value)==null||L.call(n),(M=i.value)==null||M.call(i),h(!1)},I=zi(()=>{var C;p||(h(!0),(C=a.value)==null||C.call(a))},[p]);return _n(()=>{p&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{f.startTimer()},100)},[p,y.value]),s.value?le("div",{className:yp,children:[le(gp,{mode:y.value,onClose:b,countdown:l.value,state:f}),s.value&&le("iframe",{src:d.value,onLoad:I,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"}),le(mp,{})]}):null};function at(e,t,n){return(t=bp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bp(e){var t=Ep(e,"string");return typeof t=="symbol"?t:t+""}function Ep(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wa=class{constructor(t,n){at(this,"name","OKSPIN"),at(this,"initialized",!1),at(this,"initCompleter",null),at(this,"context",void 0),at(this,"initParams",void 0),at(this,"adsOverlay",null),at(this,"adsIsShowing",!1),at(this,"lastUnDisplayedAdBreak",null),at(this,"state",_p()),this.context=t,this.initParams=n}init(){return A(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Qi(le(wp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var n;if(this.initialized){(n=t.onReady)==null||n.call(t);return}this.initCompleter=()=>{var r;(r=t.onReady)==null||r.call(t)}}adBreak(t,n){return A(this,null,function*(){var r,o,i,a,s,l,d,y;if(!this.initialized||!this.adsOverlay||!n.params.url){(r=t.adBreakDone)==null||r.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 f=()=>{var h;this.adsIsShowing=!1,(h=t.afterAd)==null||h.call(t)},p=()=>{var h;this.adsIsShowing=!1,(h=t.adBreakDone)==null||h.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Te(()=>{this.adsIsShowing=!0,this.state.afterAd.value=f,this.state.adBreakDone.value=p,this.state.src.value=n.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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 f=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},p={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},h=()=>{var w;this.adsIsShowing=!1,p.breakStatus="dismissed",(w=t.adDismissed)==null||w.call(t)},b=()=>{var w;this.adsIsShowing=!1,p.breakStatus="viewed",(w=t.adViewed)==null||w.call(t)},I=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,p)};Te(()=>{this.state.afterAd.value=f,this.state.adDismissed.value=h,this.state.adViewed.value=b,this.state.adBreakDone.value=I});let C=()=>{var w;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Te(()=>{var T;this.state.countdown.value=(T=n.params.countdown)!=null?T:15,this.state.src.value=n.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}})}},$t={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||$t[e.data.type]&&$t[e.data.type].forEach(t=>{t(e.data.data)})});var jt=(e,t)=>{_n(()=>($t[e]||($t[e]=new Set),$t[e].add(t),()=>{$t[e].delete(t)}),[e,t])},Ip=()=>{let e=ee(),t=ee(),n=ee(),r=ee(),o=ee(),i=ee(),a=ee(),s=ee(!1),l=ee("");return{afterAd:e,adDismissed:t,adViewed:n,adBreakDone:r,adLoaded:o,adLinkClicked:i,adError:a,visible:s,src:l}},Ap=Xt`
149
- ${Ee}
148
+ `,Ip=t=>{let{state:e}=t,{afterAd:n,adDismissed:r,adViewed:a,adBreakDone:i,adLoaded:o,visible:s,countdown:l,src:d,mode:y}=e,f=bn(()=>yp(),[]),[p,h]=lt(!1),b=C=>{var w,O,k,M;s.value=!1,C==="dismiss"?(w=r.value)==null||w.call(r):C==="viewed"&&((O=a.value)==null||O.call(a)),(k=n.value)==null||k.call(n),(M=i.value)==null||M.call(i),h(!1)},E=En(()=>{var C;p||(h(!0),(C=o.value)==null||C.call(o))},[p]);return Pt(()=>{p&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{f.startTimer()},100)},[p,y.value]),s.value?z("div",{className:Ep,children:[z(wp,{mode:y.value,onClose:b,countdown:l.value,state:f}),s.value&&z("iframe",{src:d.value,onLoad:E,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"}),z(gp,{})]}):null};function ut(t,e,n){return(e=Ap(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ap(t){var e=Sp(t,"string");return typeof e=="symbol"?e:e+""}function Sp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bo=class{constructor(e,n){ut(this,"name","OKSPIN"),ut(this,"initialized",!1),ut(this,"initCompleter",null),ut(this,"context",void 0),ut(this,"initParams",void 0),ut(this,"adsOverlay",null),ut(this,"adsIsShowing",!1),ut(this,"lastUnDisplayedAdBreak",null),ut(this,"state",bp()),this.context=e,this.initParams=n}init(){return S(this,null,function*(){var e;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),$r(z(Ip,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(e=this.initCompleter)==null||e.call(this)})}adConfig(e){var n;if(this.initialized){(n=e.onReady)==null||n.call(e);return}this.initCompleter=()=>{var r;(r=e.onReady)==null||r.call(e)}}adBreak(e,n){return S(this,null,function*(){var r,a,i,o,s,l,d,y;if(!this.initialized||!this.adsOverlay||!n.params.url){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(e.type){case"preroll":{(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(o=e.beforeAd)==null||o.call(e);let f=()=>{var h;this.adsIsShowing=!1,(h=e.afterAd)==null||h.call(e)},p=()=>{var h;this.adsIsShowing=!1,(h=e.adBreakDone)==null||h.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"})};_e(()=>{this.adsIsShowing=!0,this.state.afterAd.value=f,this.state.adBreakDone.value=p,this.state.src.value=n.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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=e.beforeAd)==null||d.call(e);let f=()=>{var w;this.adsIsShowing=!1,(w=e.afterAd)==null||w.call(e)},p={breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"ignored"},h=()=>{var w;this.adsIsShowing=!1,p.breakStatus="dismissed",(w=e.adDismissed)==null||w.call(e)},b=()=>{var w;this.adsIsShowing=!1,p.breakStatus="viewed",(w=e.adViewed)==null||w.call(e)},E=()=>{var w;this.adsIsShowing=!1,(w=e.adBreakDone)==null||w.call(e,p)};_e(()=>{this.state.afterAd.value=f,this.state.adDismissed.value=h,this.state.adViewed.value=b,this.state.adBreakDone.value=E});let C=()=>{var w;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(w=e.adBreakDone)==null||w.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,_e(()=>{var O;this.state.countdown.value=(O=n.params.countdown)!=null?O:15,this.state.src.value=n.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=e,(y=e.beforeReward)==null||y.call(e,C);break}}})}},Cp=()=>{let t=K(null),e=K(null),n=K(null),r=K(null),a=K(null),i=K(null),o=K(!1),s=K(null);return{afterAd:t,adDismissed:e,adViewed:n,adBreakDone:r,adLoaded:a,adError:i,visible:o,payload:s}},Rp=Se`
149
+ ${ve}
150
+ position: fixed;
151
+ inset: 0;
152
+ z-index: 2147483647;
153
+ display: flex;
154
+ background: #000000;
155
+ `,Op=Se`
156
+ ${ve}
157
+ position: relative;
158
+ width: 100%;
159
+ height: 100%;
160
+ display: flex;
161
+ flex-direction: column;
162
+ color: #f7f9fc;
163
+ `,kp=Se`
164
+ position: absolute;
165
+ top: 24px;
166
+ left: 24px;
167
+ display: flex;
168
+ flex-direction: column;
169
+ gap: 6px;
170
+ padding: 12px 16px;
171
+ border-radius: 999px;
172
+ background: rgba(0, 0, 0, 0.65);
173
+ border: 1px solid rgba(255, 255, 255, 0.08);
174
+ `,Tp=Se`
175
+ font-size: 11px;
176
+ letter-spacing: 0.08em;
177
+ text-transform: uppercase;
178
+ color: #c7d4ef;
179
+ `,xp=Se`
180
+ font-size: 14px;
181
+ font-weight: 500;
182
+ `,Pp=Se`
183
+ ${ve}
184
+ flex: 1;
185
+ background: #050505;
186
+ display: flex;
187
+ align-items: center;
188
+ justify-content: center;
189
+ padding: 0;
190
+ `,xc=Se`
191
+ width: 100%;
192
+ height: 100%;
193
+ border: 2px dashed rgba(255, 255, 255, 0.08);
194
+ display: flex;
195
+ align-items: center;
196
+ justify-content: center;
197
+ color: #6e7da1;
198
+ font-size: 14px;
199
+ `,Dp=Se`
200
+ position: absolute;
201
+ bottom: 32px;
202
+ right: 32px;
203
+ display: flex;
204
+ gap: 12px;
205
+ `,Lp=Se`
206
+ min-width: 160px;
207
+ min-height: 48px;
208
+ border-radius: 999px;
209
+ border: none;
210
+ padding: 0 32px;
211
+ font-size: 15px;
212
+ font-weight: 600;
213
+ background: rgba(255, 255, 255, 0.08);
214
+ color: #f1f5ff;
215
+ cursor: pointer;
216
+
217
+ &:disabled {
218
+ opacity: 0.4;
219
+ cursor: not-allowed;
220
+ }
221
+ `,Np=Se`
222
+ min-width: 120px;
223
+ min-height: 44px;
224
+ border-radius: 999px;
225
+ border: 1px solid rgba(255, 255, 255, 0.4);
226
+ background: rgba(0, 0, 0, 0.5);
227
+ color: white;
228
+ font-size: 14px;
229
+ font-weight: 500;
230
+ cursor: pointer;
231
+ `,Up=t=>{let{state:e}=t,{afterAd:n,adDismissed:r,adViewed:a,adBreakDone:i,adLoaded:o,adError:s,visible:l,payload:d}=e,[y,f]=lt(!1),[p,h]=lt(0),[b,E]=lt(!1),[C,w]=lt(!1),[O,k]=lt("Loading next content..."),M=qr(null),B=d.value,I=En(N=>{var G,F,X,Z;f(!1),l.value=!1,N==="dismiss"?(G=r.value)==null||G.call(r):(F=a.value)==null||F.call(a),(X=n.value)==null||X.call(n),(Z=i.value)==null||Z.call(i)},[l,r,a,n,i]),D=En(()=>{var N;f(!1),l.value=!1,(N=s.value)==null||N.call(s)},[l,s]);if(Pt(()=>{var N;if(!l.value||!B){h(0),E(!1),w(!1),k("Loading next content...");return}let G=B.mode==="reward"?15:0,F=Math.max(Math.floor((N=B.countdown)!=null?N:G),0);if(h(F),w(B.mode==="reward"?F===0:!0),E(B.mode==="interstitial"?F===0:!1),F===0)return;let X=F,Z=window.setInterval(()=>{X-=1,h(Math.max(X,0)),X<=0&&(window.clearInterval(Z),B.mode==="reward"?w(!0):E(!0))},1e3);return()=>{window.clearInterval(Z)}},[l.value,B,I]),Pt(()=>{var N;if(!l.value||!B)return;let G=M.current;if(!G)return;if(G.innerHTML="",k("Loading next content..."),f(!1),B.testMode){let Z=document.createElement("div");Z.className=xc,Z.innerText="Preview slot placeholder",G.appendChild(Z),f(!0),(N=o.value)==null||N.call(o);return}if(typeof window=="undefined"){D();return}let F=document.createElement("ins");F.className="adsbygoogle",F.style.display="block",F.style.width="100%",F.style.height="100%",F.setAttribute("data-ad-client",B.clientId),F.setAttribute("data-ad-slot",B.unitId),F.setAttribute("data-ad-format","auto"),F.setAttribute("data-full-width-responsive","true"),B.channelId&&F.setAttribute("data-ad-channel",B.channelId),G.appendChild(F);let X=new MutationObserver(()=>{var Z;let He=F.getAttribute("data-ad-status");He==="filled"?(f(!0),k(""),(Z=o.value)==null||Z.call(o),X.disconnect()):He==="unfilled"&&(k("Slot currently unavailable."),f(!1),X.disconnect())});X.observe(F,{attributes:!0,attributeFilter:["data-ad-status"]});try{let Z=window;Z.adsbygoogle=Z.adsbygoogle||[],Z.adsbygoogle.push({})}catch(Z){X.disconnect(),D()}return()=>{X.disconnect(),G.innerHTML=""}},[l.value,B,o,D]),!l.value||!B)return null;let J=B.mode==="reward"?"Next content unlocking":"Content paused",j=p>0?`Content resumes in ${p}s`:"Content ready";return z("div",{className:Rp,children:z("div",{className:Op,children:[z("div",{className:kp,children:[z("div",{className:Tp,children:J}),z("div",{className:xp,children:j})]}),z("div",{className:Pp,ref:M,children:!y&&z("div",{className:xc,children:O})}),z("div",{className:Dp,children:B.mode==="reward"?z("button",{className:Lp,type:"button",onClick:()=>I("viewed"),disabled:!C,children:C?"Continue":`Continue in ${p}s`}):b&&z("button",{className:Np,type:"button",onClick:()=>I("viewed"),children:"Continue"})})]})})};function Oe(t,e,n){return(e=Bp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bp(t){var e=Mp(t,"string");return typeof e=="symbol"?e:e+""}function Mp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Eo=class{constructor(e,n){if(Oe(this,"name","ADSENSE_BANNER_AS_AFG"),Oe(this,"initialized",!1),Oe(this,"initCompleter",null),Oe(this,"context",void 0),Oe(this,"contextInfo",void 0),Oe(this,"initParams",void 0),Oe(this,"defaultCountdown",5),Oe(this,"adsOverlay",null),Oe(this,"adsIsShowing",!1),Oe(this,"lastUnDisplayedAdBreak",null),Oe(this,"requestCounter",0),Oe(this,"scriptPromise",null),Oe(this,"scriptReady",!1),Oe(this,"scriptFailed",!1),Oe(this,"state",Cp()),this.context=e,this.contextInfo=this.context.getContextInfo(),this.initParams=n,typeof window!="undefined"){let r=window;r.adsbygoogle=r.adsbygoogle||[]}}init(){return S(this,null,function*(){var e;if(typeof document!="undefined"){this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-banner-as-afg"),$r(z(Up,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay);try{yield this.ensureAdSenseScript()}catch(n){this.scriptFailed=!0,console.warn("[BannerAsAFG] Failed to load Google AdSense script",n)}this.initialized=!0,(e=this.initCompleter)==null||e.call(this)}})}ensureAdSenseScript(){var e;if(typeof document=="undefined")return Promise.resolve();if(this.scriptPromise)return this.scriptPromise;if(document.getElementById("google-adsense"))return this.scriptReady=!0,Promise.resolve();if(!this.initParams.clientId)return this.scriptFailed=!0,Promise.reject(new Error("BannerAsAFG requires a Google AdSense clientId."));let n=(e=this.contextInfo.testAdsMode)!=null?e:!1;return this.scriptPromise=new Promise((r,a)=>{let i=document.createElement("script");i.id="google-adsense",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),i.onload=()=>{this.scriptReady=!0,r()},i.onerror=()=>{this.scriptFailed=!0,a(new Error("Failed to fetch Google AdSense script."))},document.head.appendChild(i)}),this.scriptPromise}adConfig(e){var n;if(this.initialized){(n=e.onReady)==null||n.call(e);return}this.initCompleter=()=>{var r;(r=e.onReady)==null||r.call(e)}}resolveOverlayConfig(e){var n,r;let a=(r=(n=e==null?void 0:e.params)==null?void 0:n.countdown)!=null?r:this.defaultCountdown;return{rewardUnitId:this.initParams.rewardUnitId,interstitialUnitId:this.initParams.interstitialUnitId,channelId:this.initParams.channelId,countdown:Math.max(Math.floor(a),0)}}canDisplay(e){return!!e&&!!this.initParams.clientId&&!!this.adsOverlay&&this.initialized&&!this.scriptFailed&&this.scriptReady}showBannerOverlay(e,n){var r,a;let i=Math.max(Math.floor((r=n.countdown)!=null?r:e==="reward"?15:0),0),o={requestId:++this.requestCounter,clientId:this.initParams.clientId,unitId:e==="reward"?this.initParams.rewardUnitId:this.initParams.interstitialUnitId,channelId:n.channelId,countdown:i,mode:e,testMode:(a=this.contextInfo.testAdsMode)!=null?a:!1};this.state.payload.value=o,this.state.visible.value=!0}adBreak(e,n){var r,a,i,o,s,l,d,y,f;let p=e.type==="preroll"?"":e.name,h=e.type==="reward"?"reward":"interstitial";if(!this.initialized||!this.adsOverlay){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:p,breakFormat:h,breakStatus:"notReady"});return}if(this.adsIsShowing){(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:p,breakFormat:h,breakStatus:"frequencyCapped"});return}let b=this.resolveOverlayConfig(n);if(!this.canDisplay(b.rewardUnitId)){(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:p,breakFormat:h,breakStatus:"notReady"});return}switch(e.type){case"preroll":{(o=e.adBreakDone)==null||o.call(e,{breakType:e.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(s=e.beforeAd)==null||s.call(e);let E={breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"},C=()=>{var k;this.adsIsShowing=!1,(k=e.afterAd)==null||k.call(e)},w=()=>{var k;this.adsIsShowing=!1,(k=e.adBreakDone)==null||k.call(e,E)},O=()=>{var k,M;this.adsIsShowing=!1,E.breakStatus="noAdPreloaded",(k=e.afterAd)==null||k.call(e),(M=e.adBreakDone)==null||M.call(e,E)};_e(()=>{this.adsIsShowing=!0,this.state.afterAd.value=C,this.state.adBreakDone.value=w,this.state.adDismissed.value=null,this.state.adViewed.value=null,this.state.adError.value=O,this.showBannerOverlay("interstitial",b)});break}case"reward":{this.lastUnDisplayedAdBreak&&((d=(l=this.lastUnDisplayedAdBreak).adBreakDone)==null||d.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),(y=e.beforeAd)==null||y.call(e);let E={breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"ignored"},C=()=>{var I;this.adsIsShowing=!1,(I=e.afterAd)==null||I.call(e)},w=()=>{var I;this.adsIsShowing=!1,E.breakStatus="dismissed",(I=e.adDismissed)==null||I.call(e)},O=()=>{var I;this.adsIsShowing=!1,E.breakStatus="viewed",(I=e.adViewed)==null||I.call(e)},k=()=>{var I;this.adsIsShowing=!1,(I=e.adBreakDone)==null||I.call(e,E)},M=()=>{var I,D;this.adsIsShowing=!1,E.breakStatus="noAdPreloaded",(I=e.afterAd)==null||I.call(e),(D=e.adBreakDone)==null||D.call(e,E)};_e(()=>{this.state.afterAd.value=C,this.state.adDismissed.value=w,this.state.adViewed.value=O,this.state.adBreakDone.value=k,this.state.adError.value=M});let B=()=>{var I,D;if(!this.canDisplay(b.rewardUnitId)){this.lastUnDisplayedAdBreak=null,(I=e.afterAd)==null||I.call(e),(D=e.adBreakDone)==null||D.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"notReady"});return}this.lastUnDisplayedAdBreak=null,this.adsIsShowing=!0,_e(()=>{this.showBannerOverlay("reward",b)})};this.lastUnDisplayedAdBreak=e,(f=e.beforeReward)==null||f.call(e,B);break}}}},Xt={};window.addEventListener("message",t=>{t.origin!=="https://ads.appsrockets.com"&&t.origin!=="https://stg-ads.appsrockets.com"||Xt[t.data.type]&&Xt[t.data.type].forEach(e=>{e(t.data.data)})});var Wt=(t,e)=>{Pt(()=>(Xt[t]||(Xt[t]=new Set),Xt[t].add(e),()=>{Xt[t].delete(e)}),[t,e])},Gp=()=>{let t=K(),e=K(),n=K(),r=K(),a=K(),i=K(),o=K(),s=K(!1),l=K("");return{afterAd:t,adDismissed:e,adViewed:n,adBreakDone:r,adLoaded:a,adLinkClicked:i,adError:o,visible:s,src:l}},Jp=Se`
232
+ ${ve}
150
233
  position: fixed;
151
234
  z-index: 2147483647;
152
235
  background: white;
@@ -156,7 +239,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
156
239
  flex-direction: column;
157
240
 
158
241
  iframe {
159
- ${Ee}
242
+ ${ve}
160
243
  flex: 1;
161
244
  position: relative;
162
245
  display: block;
@@ -164,8 +247,8 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
164
247
  width: 100%;
165
248
  height: 100%;
166
249
  }
167
- `,Sp=e=>{let{state:t}=e,{afterAd:n,adDismissed:r,adViewed:o,adBreakDone:i,adLoaded:a,adLinkClicked:s,visible:l,src:d}=t,[y,f]=Fr(!1),p=b=>{var I,C,w,T;f(!1),l.value=!1,b==="dismiss"?(I=r.value)==null||I.call(r):b==="viewed"&&((C=o.value)==null||C.call(o)),(w=n.value)==null||w.call(n),(T=i.value)==null||T.call(i)},h=()=>{var b;(b=a.value)==null||b.call(a)};return jt("appsrockets_ad_dismissed",()=>p("dismiss")),jt("appsrockets_ad_rewarded",()=>p("viewed")),jt("appsrockets_ad_completed",()=>p("viewed")),jt("appsrockets_ad_skipped",()=>p("viewed")),jt("appsrockets_ad_clicked",b=>{var I;return(I=s.value)==null?void 0:I.call(s,b)}),jt("appsrockets_ad_loaded",()=>f(!0)),l.value?le("div",{className:Ap,style:{display:y?"flex":"none"},children:l.value&&le("iframe",{src:d.value,onLoad:h,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};function st(e,t,n){return(t=Cp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cp(e){var t=Rp(e,"string");return typeof t=="symbol"?t:t+""}function Rp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ba=class{constructor(t,n){st(this,"name","APPSROCKETS"),st(this,"initialized",!1),st(this,"initCompleter",null),st(this,"context",void 0),st(this,"adsOverlay",null),st(this,"adsIsShowing",!1),st(this,"lastUnDisplayedAdBreak",null),st(this,"state",Ip()),st(this,"processUrl",r=>{var o;let i=this.context.getContextInfo(),a=new URL(r),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",i.joliSource),s.get("osType")||s.set("osType",i.osType),s.get("runtimeType")||s.set("runtimeType",i.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",i.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((o=this.context.getWindowInfo().statusBarHeight)!=null?o:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return A(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Qi(le(Sp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var n;if(this.initialized){(n=t.onReady)==null||n.call(t);return}this.initCompleter=()=>{var r;(r=t.onReady)==null||r.call(t)}}adBreak(t,n){var r,o,i,a,s,l,d,y;if(!this.initialized||!this.adsOverlay||!n.params.url){(r=t.adBreakDone)==null||r.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}let f=p=>{var h,b;(b=(h=this.context).handleLinkClicked)==null||b.call(h,p)};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 I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},h=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Te(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=h,this.state.src.value=this.processUrl(n.params.url),this.state.adLinkClicked.value=f,this.state.adError.value=b,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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 p=()=>{var L;this.adsIsShowing=!1,(L=t.afterAd)==null||L.call(t)},h={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var L;this.adsIsShowing=!1,h.breakStatus="dismissed",(L=t.adDismissed)==null||L.call(t)},I=()=>{var L;this.adsIsShowing=!1,h.breakStatus="viewed",(L=t.adViewed)==null||L.call(t)},C=()=>{var L;this.adsIsShowing=!1,(L=t.adBreakDone)==null||L.call(t,h)},w=()=>{this.adsIsShowing=!1,h.breakStatus="noAdPreloaded"};Te(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=I,this.state.adBreakDone.value=C,this.state.adLinkClicked.value=f,this.state.adError.value=w});let T=()=>{var L;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(L=t.adBreakDone)==null||L.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Te(()=>{this.state.src.value=this.processUrl(n.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,T);break}}}},iu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function we(e,t,n){return(t=Op(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Op(e){var t=kp(e,"string");return typeof t=="symbol"?t:t+""}function kp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ea=class{constructor(t,n,r){we(this,"adUnit",void 0),we(this,"project",void 0),we(this,"keyValue",void 0),we(this,"adsContext",null),we(this,"rewardedSlot",null),we(this,"rewardedPayload",null),we(this,"readyEvent",null),we(this,"withCommand",function(){googletag.cmd.push(...arguments)}),we(this,"init",()=>{var o;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(i=>{var a;(a=this.rewardedSlot)==null||a.setTargeting(i,this.keyValue[i])}),Object.keys(this.keyValue).includes("project")||(o=this.rewardedSlot)==null||o.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),we(this,"destroy",o=>{var i,a;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(a=(i=this.adsContext)==null?void 0:i.adBreakDone)==null||a.call(i,o),this.adsContext=null}),we(this,"reinit",o=>{this.destroy(o),this.init()}),we(this,"handleSlotReady",o=>{o.slot===this.rewardedSlot&&(this.readyEvent=o)}),we(this,"handleSlotClosed",o=>{var i,a;if(this.adsContext&&o.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(a=(i=this.adsContext).afterAd)==null||a.call(i),this.withCommand(()=>{this.reinit(s)})}}),we(this,"handleSlotGranted",o=>{this.adsContext&&o.slot===this.rewardedSlot&&(this.rewardedPayload=o.payload)}),we(this,"handleSlotRenderEnded",o=>{o.slot===this.rewardedSlot&&o.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),we(this,"requestAds",o=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=o,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var i,a,s;(a=(i=this.adsContext)==null?void 0:i.beforeAd)==null||a.call(i),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let i=a=>{a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",i),this.readyEvent=a,this.adsContext.beforeReward(()=>{var s,l,d;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",i),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",i))},500)}})}),this.adUnit=t,this.project=n,this.keyValue=r,iu(),this.withCommand(()=>{this.init()})}};function ke(e,t,n){return(t=Tp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tp(e){var t=xp(e,"string");return typeof t=="symbol"?t:t+""}function xp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ia=class{constructor(t,n,r){var o=this;ke(this,"adUnit",void 0),ke(this,"project",void 0),ke(this,"keyValue",void 0),ke(this,"adsContext",null),ke(this,"gamingInterstitialSlot",null),ke(this,"readyEvent",null),ke(this,"isRetrying",!1),ke(this,"withCommand",function(){googletag.cmd.push(...arguments)}),ke(this,"init",()=>{var i;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(i=this.gamingInterstitialSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),ke(this,"destroy",function(i){var a,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(a=o.adsContext)==null?void 0:a.onEnd)==null||s.call(a,i),o.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",o.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",o.handleSlotClosed),o.gamingInterstitialSlot&&(googletag.destroySlots([o.gamingInterstitialSlot]),o.gamingInterstitialSlot=null,o.readyEvent=null)}),ke(this,"reinit",function(i){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o.destroy(i,a),o.init()}),ke(this,"handleSlotReady",i=>{this.gamingInterstitialSlot===i.slot&&(this.readyEvent=i)}),ke(this,"handleSlotClosed",i=>{var a,s;this.adsContext&&this.gamingInterstitialSlot===i.slot&&((s=(a=this.adsContext).afterAd)==null||s.call(a),this.withCommand(()=>{this.reinit("viewed")}))}),ke(this,"requestAds",i=>{this.withCommand(()=>{var a,s,l;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=i,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((a=i.beforeAd)==null||a.call(i),this.readyEvent.makeGameManualInterstitialVisible()):((l=(s=this.adsContext).onEnd)==null||l.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),iu(),this.adUnit=t,this.project=n,this.keyValue=r,this.withCommand(()=>{this.init()})}};function kt(e,t,n){return(t=Pp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pp(e){var t=Lp(e,"string");return typeof t=="symbol"?t:t+""}function Lp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Aa=class{constructor(t,n){kt(this,"name","GOOGLE_GPT"),kt(this,"context",void 0),kt(this,"contextInfo",void 0),kt(this,"initParams",void 0),kt(this,"rewardAdManager",void 0),kt(this,"interstitialManager",void 0),kt(this,"insertScript",()=>{let r="jolibox-google-gpt",o=document.getElementById(r);o||(o=window.document.createElement("script"),o.id=r,o.async=!0,o.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",o.crossOrigin="anonymous",document.head.appendChild(o))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=n,this.insertScript()}init(){return A(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,n=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,r=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new Ea(t,r,this.initParams.keyValue)),n&&(this.interstitialManager=new Ia(n,r,this.initParams.keyValue))})}adConfig(t,n){}adBreak(t,n){var r,o,i;switch(t.type){case"preroll":{(r=t.adBreakDone)==null||r.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(o=t.adBreakDone)==null||o.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:a})}});break}default:{if(!this.interstitialManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:a})}});break}}}};function oa(e,t,n){return(t=Dp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dp(e){var t=Np(e,"string");return typeof t=="symbol"?t:t+""}function Np(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sa=class{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";oa(this,"context",void 0),oa(this,"placement","GAME"),oa(this,"contextInfo",void 0),this.context=t,this.placement=n,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),n={};return t.forEach((r,o)=>{n[o]=r}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:n}}getDevice(){var t,n,r,o;return{platform:(t=this.contextInfo.platform)!=null?t:Uc.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(n=this.contextInfo.hostAppId)!=null?n:"1",model:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",brand:(o=this.contextInfo.deviceBrand)!=null?o:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,n){var r;let o={protocolVersion:"1.0.0",events:[{name:t,type:Dc.System,location:this.getLocation(),target:null,extra:n,timestamp:Date.now(),userId:(r=this.contextInfo.userId)!=null?r:null}],device:this.getDevice(),project:Nc.WebSDK};return Kh(o)}};function Se(e,t,n){return(t=Up(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Up(e){var t=Bp(e,"string");return typeof t=="symbol"?t:t+""}function Bp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ro=class{constructor(t){Se(this,"context",void 0),Se(this,"adsTrackSerializer",void 0),Se(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new Sa(this.context)}getRequestContextData(t){var n,r;this.contextInfo=this.context.getContextInfo();let{width:o,height:i}=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:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",deviceBrand:(r=this.contextInfo.deviceBrand)!=null?r:"UnknownBrand",dimension:{width:o,height:i}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},Ca=class{constructor(t,n){var r=this;Se(this,"context",void 0),Se(this,"contextInfo",void 0),Se(this,"requestContext",void 0),Se(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Se(this,"pendingAFVAdsInfo",Promise.resolve(null)),Se(this,"doFetchAdsInfo",o=>A(this,null,function*(){let i=o==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",a=o==="afv"?"REWARD_INTERSTITIAL":o==="reward"?"REWARD":"INTERSTITIAL",s=o==="afv"?void 0:"cached",{data:l,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(i),bizParams:this.requestContext.getRequestBizParams(),adsType:a,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:l}:null})),Se(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Se(this,"cacheInterstitialInfo",o=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(o).catch(()=>null)}),Se(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Se(this,"cacheNextAFGAdsInfo",o=>A(this,null,function*(){o==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(o)})),Se(this,"getAFGAdsInfo",o=>A(this,null,function*(){let i=yield o==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(o),i})),Se(this,"getAFVAdsInfo",function(){return A(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let o=yield r.pendingAFVAdsInfo;return r.cacheAFVInfo(),o}else return r.cacheAFVInfo(),yield r.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new ro(t),n!=null&&n.reward&&this.cacheRewardInfo(),n!=null&&n.interstitial&&this.cacheInterstitialInfo("start"),n!=null&&n.afv&&this.cacheAFVInfo()}};function He(e,t,n){return(t=Mp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mp(e){var t=Gp(e,"string");return typeof t=="symbol"?t:t+""}function Gp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var On=class{constructor(t){if(He(this,"context",void 0),He(this,"contextInfo",void 0),He(this,"providers",{}),He(this,"channelPolicy",void 0),He(this,"adsActionDetection",void 0),He(this,"requestContext",void 0),He(this,"adsRequest",void 0),He(this,"initialized",!1),He(this,"adsIsShowing",!1),He(this,"lastAdBreak",void 0),He(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new da(this.context),this.adsActionDetection=new ua(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Ca(t),this.requestContext=new ro(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return A(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:n}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((n==null?void 0:n.length)>0)for(let r of n)switch(r.provider){case"GOOGLE_GPT":{let o=new Aa(this.context,r.params);yield o.init(),this.providers[r.provider]=o;break}case"ADSENSE":case"ADSENSE_ADMOB":{let o=new fa(this.context,r.params);yield o.init(),this.providers[r.provider]=o;break}case"OKSPIN":{let o=new wa(this.context,r.params);yield o.init(),this.providers.OKSPIN=o;break}case"APPSROCKETS":{let o=new ba(this.context,r.params);yield o.init(),this.providers.APPSROCKETS=o;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return A(this,null,function*(){var n,r,o,i,a,s,l,d,y,f,p,h,b,I;let C=Date.now();if(C-this.initializedTimeStamp<3e3){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&C-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(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:"frequencyCapped"});return}if(this.lastAdBreak=C,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(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:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(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}try{let w=yield this.adsRequest.getAFGAdsInfo(t.type),T=w==null?void 0:w.data,L=w==null?void 0:w.code;if(L==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var M,V,S,D;(M=t.beforeAd)==null||M.call(t),(V=t.adViewed)==null||V.call(t),(S=t.afterAd)==null||S.call(t),(D=t.adBreakDone)==null||D.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(l=t.beforeAd)==null||l.call(t),(d=t.afterAd)==null||d.call(t),(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!T||L!=="SUCCESS"){(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let M=T.sort((B,F)=>B.seq-F.seq);if(M.length===0){(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let V=!0,S=null,D=new ca(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;M.length>0;){let B=M.shift(),F=this.providers[B.provider];if(F){let[N,J]=yield D.callAdBreakAndContinue(F,t,B,Y=>{var me;this.adsIsShowing=Y,(me=this.context.eventEmitter)==null||me.emit("isAdShowing",Y)});V=N,S=J}else V=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!V)break}V&&S&&((h=t.adBreakDone)==null||h.call(t,S))}}catch(w){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(I=this.context.eventEmitter)==null||I.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.")}};var _E=Xt`
168
- ${Ee}
250
+ `,Fp=t=>{let{state:e}=t,{afterAd:n,adDismissed:r,adViewed:a,adBreakDone:i,adLoaded:o,adLinkClicked:s,visible:l,src:d}=e,[y,f]=lt(!1),p=b=>{var E,C,w,O;f(!1),l.value=!1,b==="dismiss"?(E=r.value)==null||E.call(r):b==="viewed"&&((C=a.value)==null||C.call(a)),(w=n.value)==null||w.call(n),(O=i.value)==null||O.call(i)},h=()=>{var b;(b=o.value)==null||b.call(o)};return Wt("appsrockets_ad_dismissed",()=>p("dismiss")),Wt("appsrockets_ad_rewarded",()=>p("viewed")),Wt("appsrockets_ad_completed",()=>p("viewed")),Wt("appsrockets_ad_skipped",()=>p("viewed")),Wt("appsrockets_ad_clicked",b=>{var E;return(E=s.value)==null?void 0:E.call(s,b)}),Wt("appsrockets_ad_loaded",()=>f(!0)),l.value?z("div",{className:Jp,style:{display:y?"flex":"none"},children:l.value&&z("iframe",{src:d.value,onLoad:h,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};function dt(t,e,n){return(e=Hp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hp(t){var e=jp(t,"string");return typeof e=="symbol"?e:e+""}function jp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Io=class{constructor(e,n){dt(this,"name","APPSROCKETS"),dt(this,"initialized",!1),dt(this,"initCompleter",null),dt(this,"context",void 0),dt(this,"adsOverlay",null),dt(this,"adsIsShowing",!1),dt(this,"lastUnDisplayedAdBreak",null),dt(this,"state",Gp()),dt(this,"processUrl",r=>{var a;let i=this.context.getContextInfo(),o=new URL(r),s=new URLSearchParams(o.search);return s.has("joliSource")||s.set("joliSource",i.joliSource),s.get("osType")||s.set("osType",i.osType),s.get("runtimeType")||s.set("runtimeType",i.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",i.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((a=this.context.getWindowInfo().statusBarHeight)!=null?a:0).toString()),o.search=s.toString(),o.toString()}),this.context=e}init(){return S(this,null,function*(){var e;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),$r(z(Fp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(e=this.initCompleter)==null||e.call(this)})}adConfig(e){var n;if(this.initialized){(n=e.onReady)==null||n.call(e);return}this.initCompleter=()=>{var r;(r=e.onReady)==null||r.call(e)}}adBreak(e,n){var r,a,i,o,s,l,d,y;if(!this.initialized||!this.adsOverlay||!n.params.url){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.type==="preroll"?"":e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let f=p=>{var h,b;(b=(h=this.context).handleLinkClicked)==null||b.call(h,p)};switch(e.type){case"preroll":{(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(o=e.beforeAd)==null||o.call(e);let p=()=>{var E;this.adsIsShowing=!1,(E=e.afterAd)==null||E.call(e)},h=()=>{var E;this.adsIsShowing=!1,(E=e.adBreakDone)==null||E.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var E;this.adsIsShowing=!1,(E=e.adBreakDone)==null||E.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};_e(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=h,this.state.src.value=this.processUrl(n.params.url),this.state.adLinkClicked.value=f,this.state.adError.value=b,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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=e.beforeAd)==null||d.call(e);let p=()=>{var k;this.adsIsShowing=!1,(k=e.afterAd)==null||k.call(e)},h={breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var k;this.adsIsShowing=!1,h.breakStatus="dismissed",(k=e.adDismissed)==null||k.call(e)},E=()=>{var k;this.adsIsShowing=!1,h.breakStatus="viewed",(k=e.adViewed)==null||k.call(e)},C=()=>{var k;this.adsIsShowing=!1,(k=e.adBreakDone)==null||k.call(e,h)},w=()=>{this.adsIsShowing=!1,h.breakStatus="noAdPreloaded"};_e(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=E,this.state.adBreakDone.value=C,this.state.adLinkClicked.value=f,this.state.adError.value=w});let O=()=>{var k;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(k=e.adBreakDone)==null||k.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,_e(()=>{this.state.src.value=this.processUrl(n.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=e,(y=e.beforeReward)==null||y.call(e,O);break}}}},lu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function Ie(t,e,n){return(e=qp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qp(t){var e=Vp(t,"string");return typeof e=="symbol"?e:e+""}function Vp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ao=class{constructor(e,n,r){Ie(this,"adUnit",void 0),Ie(this,"project",void 0),Ie(this,"keyValue",void 0),Ie(this,"adsContext",null),Ie(this,"rewardedSlot",null),Ie(this,"rewardedPayload",null),Ie(this,"readyEvent",null),Ie(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Ie(this,"init",()=>{var a;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(i=>{var o;(o=this.rewardedSlot)==null||o.setTargeting(i,this.keyValue[i])}),Object.keys(this.keyValue).includes("project")||(a=this.rewardedSlot)==null||a.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),Ie(this,"destroy",a=>{var i,o;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(o=(i=this.adsContext)==null?void 0:i.adBreakDone)==null||o.call(i,a),this.adsContext=null}),Ie(this,"reinit",a=>{this.destroy(a),this.init()}),Ie(this,"handleSlotReady",a=>{a.slot===this.rewardedSlot&&(this.readyEvent=a)}),Ie(this,"handleSlotClosed",a=>{var i,o;if(this.adsContext&&a.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(o=(i=this.adsContext).afterAd)==null||o.call(i),this.withCommand(()=>{this.reinit(s)})}}),Ie(this,"handleSlotGranted",a=>{this.adsContext&&a.slot===this.rewardedSlot&&(this.rewardedPayload=a.payload)}),Ie(this,"handleSlotRenderEnded",a=>{a.slot===this.rewardedSlot&&a.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),Ie(this,"requestAds",a=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=a,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var i,o,s;(o=(i=this.adsContext)==null?void 0:i.beforeAd)==null||o.call(i),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let i=o=>{o.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",i),this.readyEvent=o,this.adsContext.beforeReward(()=>{var s,l,d;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",i),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",i))},500)}})}),this.adUnit=e,this.project=n,this.keyValue=r,lu(),this.withCommand(()=>{this.init()})}};function De(t,e,n){return(e=$p(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $p(t){var e=Kp(t,"string");return typeof e=="symbol"?e:e+""}function Kp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var So=class{constructor(e,n,r){var a=this;De(this,"adUnit",void 0),De(this,"project",void 0),De(this,"keyValue",void 0),De(this,"adsContext",null),De(this,"gamingInterstitialSlot",null),De(this,"readyEvent",null),De(this,"isRetrying",!1),De(this,"withCommand",function(){googletag.cmd.push(...arguments)}),De(this,"init",()=>{var i;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.gamingInterstitialSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),De(this,"destroy",function(i){var o,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(o=a.adsContext)==null?void 0:o.onEnd)==null||s.call(o,i),a.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",a.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",a.handleSlotClosed),a.gamingInterstitialSlot&&(googletag.destroySlots([a.gamingInterstitialSlot]),a.gamingInterstitialSlot=null,a.readyEvent=null)}),De(this,"reinit",function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a.destroy(i,o),a.init()}),De(this,"handleSlotReady",i=>{this.gamingInterstitialSlot===i.slot&&(this.readyEvent=i)}),De(this,"handleSlotClosed",i=>{var o,s;this.adsContext&&this.gamingInterstitialSlot===i.slot&&((s=(o=this.adsContext).afterAd)==null||s.call(o),this.withCommand(()=>{this.reinit("viewed")}))}),De(this,"requestAds",i=>{this.withCommand(()=>{var o,s,l;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=i,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((o=i.beforeAd)==null||o.call(i),this.readyEvent.makeGameManualInterstitialVisible()):((l=(s=this.adsContext).onEnd)==null||l.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),lu(),this.adUnit=e,this.project=n,this.keyValue=r,this.withCommand(()=>{this.init()})}};function Dt(t,e,n){return(e=Wp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wp(t){var e=zp(t,"string");return typeof e=="symbol"?e:e+""}function zp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Co=class{constructor(e,n){Dt(this,"name","GOOGLE_GPT"),Dt(this,"context",void 0),Dt(this,"contextInfo",void 0),Dt(this,"initParams",void 0),Dt(this,"rewardAdManager",void 0),Dt(this,"interstitialManager",void 0),Dt(this,"insertScript",()=>{let r="jolibox-google-gpt",a=document.getElementById(r);a||(a=window.document.createElement("script"),a.id=r,a.async=!0,a.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",a.crossOrigin="anonymous",document.head.appendChild(a))}),this.context=e,this.contextInfo=this.context.getContextInfo(),this.initParams=n,this.insertScript()}init(){return S(this,null,function*(){let e=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,n=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,r=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;e&&(this.rewardAdManager=new Ao(e,r,this.initParams.keyValue)),n&&(this.interstitialManager=new So(n,r,this.initParams.keyValue))})}adConfig(e,n){}adBreak(e,n){var r,a,i;switch(e.type){case"preroll":{(r=e.adBreakDone)==null||r.call(e,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(a=e.adBreakDone)==null||a.call(e,{breakName:e.name,breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:e.beforeAd,afterAd:e.afterAd,adDismissed:e.adDismissed,adViewed:e.adViewed,beforeReward:e.beforeReward,adBreakDone:o=>{var s;(s=e.adBreakDone)==null||s.call(e,{breakName:e.name,breakType:e.type,breakFormat:"reward",breakStatus:o})}});break}default:{if(!this.interstitialManager){(i=e.adBreakDone)==null||i.call(e,{breakName:e.name,breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:e.beforeAd,afterAd:e.afterAd,onEnd:o=>{var s;(s=e.adBreakDone)==null||s.call(e,{breakName:e.name,breakType:e.type,breakFormat:"interstitial",breakStatus:o})}});break}}}};function ao(t,e,n){return(e=Xp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xp(t){var e=Yp(t,"string");return typeof e=="symbol"?e:e+""}function Yp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ro=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";ao(this,"context",void 0),ao(this,"placement","GAME"),ao(this,"contextInfo",void 0),this.context=e,this.placement=n,this.contextInfo=this.context.getContextInfo()}getLocation(){let e=new URLSearchParams(window.location.search),n={};return e.forEach((r,a)=>{n[a]=r}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:n}}getDevice(){var e,n,r,a;return{platform:(e=this.contextInfo.platform)!=null?e:Gc.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(n=this.contextInfo.hostAppId)!=null?n:"1",model:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",brand:(a=this.contextInfo.deviceBrand)!=null?a:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(e,n){var r;let a={protocolVersion:"1.0.0",events:[{name:e,type:Bc.System,location:this.getLocation(),target:null,extra:n,timestamp:Date.now(),userId:(r=this.contextInfo.userId)!=null?r:null}],device:this.getDevice(),project:Mc.WebSDK};return Yh(a)}};function ke(t,e,n){return(e=Qp(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qp(t){var e=Zp(t,"string");return typeof e=="symbol"?e:e+""}function Zp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sa=class{constructor(e){ke(this,"context",void 0),ke(this,"adsTrackSerializer",void 0),ke(this,"contextInfo",void 0),this.context=e,this.contextInfo=e.getContextInfo(),this.adsTrackSerializer=new Ro(this.context)}getRequestContextData(e){var n,r;this.contextInfo=this.context.getContextInfo();let{width:a,height:i}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(e,{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:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",deviceBrand:(r=this.contextInfo.deviceBrand)!=null?r:"UnknownBrand",dimension:{width:a,height:i}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}},Oo=class{constructor(e,n){var r=this;ke(this,"context",void 0),ke(this,"contextInfo",void 0),ke(this,"requestContext",void 0),ke(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),ke(this,"pendingAFVAdsInfo",Promise.resolve(null)),ke(this,"doFetchAdsInfo",a=>S(this,null,function*(){let i=a==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",o=a==="afv"?"REWARD_INTERSTITIAL":a==="reward"?"REWARD":"INTERSTITIAL",s=a==="afv"?void 0:"cached",{data:l,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(i),bizParams:this.requestContext.getRequestBizParams(),adsType:o,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:l}:null})),ke(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),ke(this,"cacheInterstitialInfo",a=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(a).catch(()=>null)}),ke(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),ke(this,"cacheNextAFGAdsInfo",a=>S(this,null,function*(){a==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(a)})),ke(this,"getAFGAdsInfo",a=>S(this,null,function*(){let i=yield a==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(a),i})),ke(this,"getAFVAdsInfo",function(){return S(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let a=yield r.pendingAFVAdsInfo;return r.cacheAFVInfo(),a}else return r.cacheAFVInfo(),yield r.pendingAFVAdsInfo})}),this.context=e,this.contextInfo=this.context.getContextInfo(),this.requestContext=new sa(e),n!=null&&n.reward&&this.cacheRewardInfo(),n!=null&&n.interstitial&&this.cacheInterstitialInfo("start"),n!=null&&n.afv&&this.cacheAFVInfo()}};function Ve(t,e,n){return(e=ev(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ev(t){var e=tv(t,"string");return typeof e=="symbol"?e:e+""}function tv(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xn=class{constructor(e){if(Ve(this,"context",void 0),Ve(this,"contextInfo",void 0),Ve(this,"providers",{}),Ve(this,"channelPolicy",void 0),Ve(this,"adsActionDetection",void 0),Ve(this,"requestContext",void 0),Ve(this,"adsRequest",void 0),Ve(this,"initialized",!1),Ve(this,"adsIsShowing",!1),Ve(this,"lastAdBreak",void 0),Ve(this,"initializedTimeStamp",Date.now()),e)this.context=e,this.channelPolicy=new fo(this.context),this.adsActionDetection=new uo(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Oo(e),this.requestContext=new sa(e);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(e){return S(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:n}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((n==null?void 0:n.length)>0)for(let r of n)switch(r.provider){case"GOOGLE_GPT":{let a=new Co(this.context,r.params);yield a.init(),this.providers[r.provider]=a;break}case"ADSENSE":case"ADSENSE_ADMOB":{let a=new ho(this.context,r.params);yield a.init(),this.providers[r.provider]=a;break}case"OKSPIN":{let a=new bo(this.context,r.params);yield a.init(),this.providers.OKSPIN=a;break}case"APPSROCKETS":{let a=new Io(this.context,r.params);yield a.init(),this.providers.APPSROCKETS=a;break}case"ADSENSE_BANNER_AS_AFG":{let a=new Eo(this.context,r.params);yield a.init(),this.providers.ADSENSE_BANNER_AS_AFG=a;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(e){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(e):window.adsbygoogle.push(e)}adBreak(e){return S(this,null,function*(){var n,r,a,i,o,s,l,d,y,f,p,h,b,E;let C=Date.now();if(C-this.initializedTimeStamp<3e3){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&C-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=C,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),e.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(o=e.adBreakDone)==null||o.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let w=yield this.adsRequest.getAFGAdsInfo(e.type),O=w==null?void 0:w.data,k=w==null?void 0:w.code;if(k==="BYPASS_ADS"){switch(e.type){case"preroll":{(s=e.adBreakDone)==null||s.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{e.beforeReward(()=>{var M,B,I,D;(M=e.beforeAd)==null||M.call(e),(B=e.adViewed)==null||B.call(e),(I=e.afterAd)==null||I.call(e),(D=e.adBreakDone)==null||D.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(l=e.beforeAd)==null||l.call(e),(d=e.afterAd)==null||d.call(e),(y=e.adBreakDone)==null||y.call(e,{breakType:e.type,breakName:e.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!O||k!=="SUCCESS"){(f=e.adBreakDone)==null||f.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let M=O.sort((J,j)=>J.seq-j.seq);if(M.length===0){(p=e.adBreakDone)==null||p.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let B=!0,I=null,D=new co(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;M.length>0;){let J=M.shift(),j=this.providers[J.provider];if(j){let[N,G]=yield D.callAdBreakAndContinue(j,e,J,F=>{var X;this.adsIsShowing=F,(X=this.context.eventEmitter)==null||X.emit("isAdShowing",F)});B=N,I=G}else B=!0,I={breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!B)break}B&&I&&((h=e.adBreakDone)==null||h.call(e,I))}}catch(w){(b=e.adBreakDone)==null||b.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(E=this.context.eventEmitter)==null||E.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(e){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}};var LE=Se`
251
+ ${ve}
169
252
  position: fixed;
170
253
  left: 0;
171
254
  top: 0;
@@ -176,7 +259,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
176
259
  height: 100vh;
177
260
 
178
261
  .ads-wrapper {
179
- ${Ee}
262
+ ${ve}
180
263
  position: relative;
181
264
  width: 100%;
182
265
  height: 100%;
@@ -199,7 +282,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
199
282
  }
200
283
 
201
284
  .retry-button {
202
- ${Ee}
285
+ ${ve}
203
286
  position: absolute;
204
287
  width: 100%;
205
288
  height: 100%;
@@ -209,7 +292,7 @@ or `);this.errors.push(i)}return r}},dr=class extends de{constructor(...t){super
209
292
  cursor: pointer;
210
293
  }
211
294
  }
212
- `;ue();var tI=Oo(su());var Pn=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var n,r;(r=(n=this.ads)==null?void 0:n.adConfig)==null||r.call(n,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Ln=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var n,r,o,i,a,s,l,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&t.data&&t.data.type==null){let f=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${f.type}`),f.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",f);break;case"huawei_quick_ads_on_message_ad_config":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p);(n=h==null?void 0:h.onReady)==null||n.call(h)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",f)}break;case"huawei_quick_ads_on_message_ad_break":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p),b="noAdPreloaded",I=!1;switch(f.adsRes){case"viewed":b="viewed",(r=h==null?void 0:h.adViewed)==null||r.call(h),I=!1;break;case"dismissed":b="dismissed",(o=h==null?void 0:h.adDismissed)==null||o.call(h),I=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=f.adsRes,I=!0;break;case"breakDone":b=f.params,I=!0;break;case"beforeReward":(i=h==null?void 0:h.beforeReward)==null||i.call(h,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),I=!1;break;case"beforeAd":(a=h==null?void 0:h.beforeAd)==null||a.call(h),I=!1;break;case"afterAd":(s=h==null?void 0:h.afterAd)==null||s.call(h),I=!1;break}I&&((y=h==null?void 0:h.adBreakDone)==null||y.call(h,{breakType:(l=h.breakType)!=null?l:"",breakName:h.breakName,breakFormat:(d=h.breakFormat)!=null?d:"interstitial",breakStatus:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",f)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",f);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(n){console.error("init failed",n)}}adConfig(t){try{let n;t.onReady&&(n=++this.callbacksId,this.callbackMap.set(n,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",n,t)}catch(n){console.error("adConfig failed",n)}}adBreak(t){var n;try{let r=++this.callbacksId,o={};o.breakType=t.type,t.type!=="preroll"&&t.name&&(o.breakName=t.name),o.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(o.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(o.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(o.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(o.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(o.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(o.adViewed=t.adViewed),this.callbackMap.set(r,o),this.sendPostMessage("huawei_quick_ads_ad_break",r,t)}catch(r){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(n){console.error("adUnit failed",n)}}sendPostMessage(t,n,r){var o;try{if(!((o=window.system)!=null&&o.postMessage))throw new Error("window.system.postMessage is not available");let i=$($({type:t},n!==void 0&&{callbackId:n}),r!==void 0&&{data:r});window.system.postMessage(JSON.stringify(i))}catch(i){throw console.error("sendPostMessage failed",i),i}}};var Dn=class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}getAdsInstance(){return e.getInstance()}init(){}adConfig(t){t.onReady&&t.onReady()}adBreak(t){var n;try{t.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var r;(r=t.beforeReward)==null||r.call(t,()=>{t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("rewarded").then(o=>{var i,a,s,l,d;(i=o==null?void 0:o.args)!=null&&i.success?(a=t.adViewed)==null||a.call(t):(s=t.adDismissed)==null||s.call(t),t.afterAd&&t.afterAd(),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(l=o==null?void 0:o.args)!=null&&l.success?"viewed":"dismissed"})}).catch(o=>{var i;console.log("showReward error => ",o),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(r=>{var o;console.log("preloadAd error => ",r),(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(t.type!=="preroll"&&t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var r;t.type!=="preroll"&&t.afterAd&&t.afterAd(),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(r){console.log("adBreak error => ",r),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};ue();var Tt=class{constructor(t,n){this.ads=t;this.httpClient=n}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return A(this,null,function*(){var r,o;if((r=P.hostUserInfo)==null?void 0:r.isSubUser){this.wrapAdBreadDoneViewed(t);return}if(t.type==="reward")try{let i=yield We.getRewardsTypes(this.httpClient);if(!(yield We.handleReward(i,t)))throw new Error("handleReward failed: fallback to unlock failed")}catch(i){console.info("handleReward failed",i),(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}wrapAdBreadDoneViewed(t){var n,r,o;(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:"name"in t&&(n=t.name)!=null?n:"",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in t&&((o=t.adViewed)==null||o.call(t))}};var Nn=class e extends Tt{constructor(t,n){super(t,n),this.startTimes=Date.now()}adBreak(t){return A(this,null,function*(){var n,r;if(t.type!=="reward"){if(t.type==="preroll"){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let o=Date.now();if(console.log("FunmaxAdsHandler time => ",o-this.startTimes),o-this.startTimes<4e4){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}ss(e.prototype,this,"adBreak").call(this,t)})}};var xa=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Pn(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Ln.getInstance();break}case"gamedistribution":{this.cacheHandler=Dn.getInstance();break}case"funmax":{let n=new On(this.context);this.cacheHandler=new Nn(n,gt);break}default:{let n=new On(this.context);this.cacheHandler=new Tt(n,gt);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},co=ge(),lu=new qe,gt=Fe.create(),Jp={httpClient:gt,checkNetwork:()=>Fe.getNetworkStatus(),track:Ce,eventEmitter:lu,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,n,r,o,i,a,s,l;return{hostAppId:(t=(e=P.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(n=P.deviceInfo.did)!=null?n:"",adId:(r=P.deviceInfo.adId)!=null?r:"",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:(s=P.joliSource)!=null?s:"",deviceBrand:P.deviceInfo.brand,deviceModel:P.deviceInfo.model,osType:Ae.isAndroid?"ANDROID":Ae.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=P.joliSource)!=null?l:""}}},cu=e=>{je("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e}),Ce("jolicoin_unlock_success",{quantity:e.quantity})},Fp=()=>{Ce("subscription_unlock_success",{})},Hp=new xa(Jp),Un=Hp.getAdsHandler(P.sdkEnvironment);We.registerRewardHandler("ADS",cl(Un.getAdsInstance()));We.registerRewardHandler("JOLI_COIN",dl(gt,{onUnlockSuccess:cu.bind(void 0),hasSubscription:()=>!0}));We.registerRewardHandler("JOLI_COIN_ONLY",fl(gt,{onUnlockSuccess:cu.bind(void 0),hasSubscription:()=>!0}));We.registerRewardHandler("SUBSCRIPTION",vl(gt,{onSubSuccess:Fp.bind(void 0),hasSubscription:()=>!0}));Ri(gt);xr(gt);lu.on("isAdShowing",e=>{je("JOLIBOX_ADS_EVENT",{isAdShowing:e})});co.registerCommand("AdsSDK.init",e=>{Un.init(e)});co.registerCommand("AdsSDK.adConfig",e=>{Un.adConfig(e)});co.registerCommand("AdsSDK.adBreak",e=>{Un.adBreak(e)});co.registerCommand("AdsSDK.adUnit",e=>{Un.adUnit(e)});H();ht();var uu=ge();uu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Ce("loadFinished",{duration:e})});uu.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});H();ht();var vu=-1,fo=function(e){addEventListener("pageshow",function(t){t.persisted&&(vu=t.timeStamp,e(t))},!0)},La=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ho=function(){var e=La();return e&&e.activationStart||0},en=function(e,t){var n=La(),r="navigate";return vu>=0?r="back-forward-cache":n&&(document.prerendering||ho()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.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:r}},gu=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(o){Promise.resolve().then(function(){t(o.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(o){}},tn=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||o===void 0)&&(o=t.value,t.delta=i,t.rating=function(s,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(t.value,n),e(t))}},_u=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},yu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},wu=function(e){var t=!1;return function(){t||(e(),t=!0)}},Zt=-1,du=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},uo=function(e){document.visibilityState==="hidden"&&Zt>-1&&(Zt=e.type==="visibilitychange"?e.timeStamp:0,qp())},fu=function(){addEventListener("visibilitychange",uo,!0),addEventListener("prerenderingchange",uo,!0)},qp=function(){removeEventListener("visibilitychange",uo,!0),removeEventListener("prerenderingchange",uo,!0)},bu=function(){return Zt<0&&(Zt=du(),fu(),fo(function(){setTimeout(function(){Zt=du(),fu()},0)})),{get firstHiddenTime(){return Zt}}},Da=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},hu=[1800,3e3],Eu=function(e,t){t=t||{},Da(function(){var n,r=bu(),o=en("FCP"),i=gu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(i.disconnect(),s.startTime<r.firstHiddenTime&&(o.value=Math.max(s.startTime-ho(),0),o.entries.push(s),n(!0)))})});i&&(n=tn(e,o,hu,t.reportAllChanges),fo(function(a){o=en("FCP"),n=tn(e,o,hu,t.reportAllChanges),_u(function(){o.value=performance.now()-a.timeStamp,n(!0)})}))})};var jp=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=wu(e),document.visibilityState==="hidden"?e():(n=t(e),yu(e)),n};var mu=[2500,4e3],Pa={},Iu=function(e,t){t=t||{},Da(function(){var n,r=bu(),o=en("LCP"),i=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<r.firstHiddenTime&&(o.value=Math.max(d.startTime-ho(),0),o.entries=[d],n())})},a=gu("largest-contentful-paint",i);if(a){n=tn(e,o,mu,t.reportAllChanges);var s=wu(function(){Pa[o.id]||(i(a.takeRecords()),a.disconnect(),Pa[o.id]=!0,n(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return jp(s)},{once:!0,capture:!0})}),yu(s),fo(function(l){o=en("LCP"),n=tn(e,o,mu,t.reportAllChanges),_u(function(){o.value=performance.now()-l.timeStamp,Pa[o.id]=!0,n(!0)})})}})},pu=[800,1800],Vp=function e(t){document.prerendering?Da(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Au=function(e,t){t=t||{};var n=en("TTFB"),r=tn(e,n,pu,t.reportAllChanges);Vp(function(){var o=La();o&&(n.value=Math.max(o.responseStart-ho(),0),n.entries=[o],r(!0),fo(function(){n=en("TTFB",0),(r=tn(e,n,pu,t.reportAllChanges))(!0)}))})};ue();Ut();Ye();H();wr();H();var mo=new Map,Su=!1,$p=()=>{Su||(It("ON_JOLIBOX_GET_USER_SUB_STATUS",e=>{let t=mo.get(e.sequenceId);t&&(clearTimeout(t.timeoutId),t.resolve(e.isSubUser),mo.delete(e.sequenceId))}),Su=!0)};function Na(){return A(this,null,function*(){return $p(),new Promise((e,t)=>{let n=Je(),r=setTimeout(()=>{mo.delete(n),t(new Error("Timeout waiting for user sub status response"))},3e3);mo.set(n,{resolve:e,reject:t,timeoutId:r}),je("JOLIBOX_GET_USER_SUB_STATUS",{sequenceId:n})})})}function Cu(){return A(this,null,function*(){let e=Fe.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return Le(new qn(t)),!1}})}function Wp(){Eu(e=>{Ce("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Iu(e=>{Ce("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Au(e=>{Ce("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Kp(){ft.on("onDocumentReady",e=>A(this,null,function*(){let t=yield Cu(),n=yield Na().catch(()=>!1);P.onEnvConfigChanged({hostUserInfo:{isLogin:t,isSubUser:n}}),ft.emit("LifecycleEvent.onReady",$({},P.hostUserInfo?P.hostUserInfo:{isLogin:!1})),P.mpType==="game"&&Ze.start(Date.now()-e)}))}function Ru(){Kp(),Wp()}Ru();
295
+ `;fe();var gI=xa(uu());var Nn=class{constructor(e){this.ads=e}getAdsInstance(){return this.ads}init(){}adConfig(e){var n,r;(r=(n=this.ads)==null?void 0:n.adConfig)==null||r.call(n,e)}adBreak(e){this.ads.adBreak(e)}adUnit(){}};var Un=class t{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return t.instance||(t.instance=new t),t.instance}initOnMessage(){window.addEventListener("message",e=>{var n,r,a,i,o,s,l,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${e}`),e.origin==window.location.origin&&e.data&&e.data.type==null){let f=JSON.parse(e.data);switch(console.log(`HuaweiQuickAdsHandler type => ${f.type}`),f.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",f);break;case"huawei_quick_ads_on_message_ad_config":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p);(n=h==null?void 0:h.onReady)==null||n.call(h)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",f)}break;case"huawei_quick_ads_on_message_ad_break":{let p=f.callbackId;if(p){let h=this.callbackMap.get(p),b="noAdPreloaded",E=!1;switch(f.adsRes){case"viewed":b="viewed",(r=h==null?void 0:h.adViewed)==null||r.call(h),E=!1;break;case"dismissed":b="dismissed",(a=h==null?void 0:h.adDismissed)==null||a.call(h),E=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=f.adsRes,E=!0;break;case"breakDone":b=f.params,E=!0;break;case"beforeReward":(i=h==null?void 0:h.beforeReward)==null||i.call(h,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),E=!1;break;case"beforeAd":(o=h==null?void 0:h.beforeAd)==null||o.call(h),E=!1;break;case"afterAd":(s=h==null?void 0:h.afterAd)==null||s.call(h),E=!1;break}E&&((y=h==null?void 0:h.adBreakDone)==null||y.call(h,{breakType:(l=h.breakType)!=null?l:"",breakName:h.breakName,breakFormat:(d=h.breakFormat)!=null?d:"interstitial",breakStatus:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",f)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",f);break;default:break}}})}getAdsInstance(){return t.getInstance()}init(e){try{this.sendPostMessage("huawei_quick_ads_init",void 0,e)}catch(n){console.error("init failed",n)}}adConfig(e){try{let n;e.onReady&&(n=++this.callbacksId,this.callbackMap.set(n,{onReady:e.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",n,e)}catch(n){console.error("adConfig failed",n)}}adBreak(e){var n;try{let r=++this.callbacksId,a={};a.breakType=e.type,e.type!=="preroll"&&e.name&&(a.breakName=e.name),a.breakFormat=e.type==="reward"?"reward":"interstitial",e.adBreakDone&&(a.adBreakDone=e.adBreakDone),e.type!=="preroll"&&e.beforeAd&&(a.beforeAd=e.beforeAd),e.type!=="preroll"&&e.afterAd&&(a.afterAd=e.afterAd),e.type==="reward"&&e.beforeReward&&(a.beforeReward=e.beforeReward),e.type==="reward"&&e.adDismissed&&(a.adDismissed=e.adDismissed),e.type==="reward"&&e.adViewed&&(a.adViewed=e.adViewed),this.callbackMap.set(r,a),this.sendPostMessage("huawei_quick_ads_ad_break",r,e)}catch(r){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(e){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,e)}catch(n){console.error("adUnit failed",n)}}sendPostMessage(e,n,r){var a;try{if(!((a=window.system)!=null&&a.postMessage))throw new Error("window.system.postMessage is not available");let i=W(W({type:e},n!==void 0&&{callbackId:n}),r!==void 0&&{data:r});window.system.postMessage(JSON.stringify(i))}catch(i){throw console.error("sendPostMessage failed",i),i}}};var Bn=class t{constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}getAdsInstance(){return t.getInstance()}init(){}adConfig(e){e.onReady&&e.onReady()}adBreak(e){var n;try{e.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var r;(r=e.beforeReward)==null||r.call(e,()=>{e.beforeAd&&e.beforeAd(),window.gdsdk.showAd("rewarded").then(a=>{var i,o,s,l,d;(i=a==null?void 0:a.args)!=null&&i.success?(o=e.adViewed)==null||o.call(e):(s=e.adDismissed)==null||s.call(e),e.afterAd&&e.afterAd(),(d=e.adBreakDone)==null||d.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:(l=a==null?void 0:a.args)!=null&&l.success?"viewed":"dismissed"})}).catch(a=>{var i;console.log("showReward error => ",a),(i=e.adBreakDone)==null||i.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(r=>{var a;console.log("preloadAd error => ",r),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakName:e.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(e.type!=="preroll"&&e.beforeAd&&e.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var r;e.type!=="preroll"&&e.afterAd&&e.afterAd(),(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(r){console.log("adBreak error => ",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakName:e.type==="preroll"?void 0:e.name,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};fe();var Lt=class{constructor(e,n){this.ads=e;this.httpClient=n}getAdsInstance(){return this.ads}init(e){this.ads.init(e)}adConfig(e){this.ads.adConfig(e)}adBreak(e){return S(this,null,function*(){var r,a;if((r=L.hostUserInfo)==null?void 0:r.isSubUser){this.wrapAdBreadDoneViewed(e);return}if(e.type==="reward")try{let i=yield Xe.getRewardsTypes(this.httpClient);if(!(yield Xe.handleReward(i,e)))throw new Error("handleReward failed: fallback to unlock failed")}catch(i){console.info("handleReward failed",i),(a=e.adBreakDone)==null||a.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(e)})}adUnit(e){this.ads.adUnit(e)}wrapAdBreadDoneViewed(e){var n,r,a;(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakName:"name"in e&&(n=e.name)!=null?n:"",breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"viewed"}),"adViewed"in e&&((a=e.adViewed)==null||a.call(e))}};var Mn=class t extends Lt{constructor(e,n){super(e,n),this.startTimes=Date.now()}adBreak(e){return S(this,null,function*(){var n,r;if(e.type!=="reward"){if(e.type==="preroll"){(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let a=Date.now();if(console.log("FunmaxAdsHandler time => ",a-this.startTimes),a-this.startTimes<4e4){(r=e.adBreakDone)==null||r.call(e,{breakType:e.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}cs(t.prototype,this,"adBreak").call(this,e)})}};var Do=class{constructor(e){this.cacheHandler=null;this.context=e}createAdsHandler(e){if(this.cacheHandler)return this.cacheHandler;switch(e){case"dlightek":{this.cacheHandler=new Nn(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Un.getInstance();break}case"gamedistribution":{this.cacheHandler=Bn.getInstance();break}case"funmax":{let n=new xn(this.context);this.cacheHandler=new Mn(n,wt);break}default:{let n=new xn(this.context);this.cacheHandler=new Lt(n,wt);break}}return this.cacheHandler}getAdsHandler(e){return this.createAdsHandler(e)}},ha=we(),du=new $e,wt=qe.create(),nv={httpClient:wt,checkNetwork:()=>qe.getNetworkStatus(),track:Te,eventEmitter:du,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:t=>{window.open(t,"_blank")},getContextInfo:()=>{var t,e,n,r,a,i,o,s,l;return{hostAppId:(e=(t=L.hostInfo)==null?void 0:t.aid)!=null?e:"1",deviceId:(n=L.deviceInfo.did)!=null?n:"",adId:(r=L.deviceInfo.adId)!=null?r:"",sessionId:(a=L.sessionId)!=null?a:"",userId:(o=(i=L.hostUserInfo)==null?void 0:i.uid)!=null?o:"",objectType:"GAME",objectId:L.mpId,testAdsMode:L.testAdsMode,channel:(s=L.joliSource)!=null?s:"",deviceBrand:L.deviceInfo.brand,deviceModel:L.deviceInfo.model,osType:Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=L.joliSource)!=null?l:""}}},fu=t=>{Ke("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:t}),Te("jolicoin_unlock_success",{quantity:t.quantity})},rv=()=>{Te("subscription_unlock_success",{})},av=new Do(nv),Gn=av.getAdsHandler(L.sdkEnvironment);Xe.registerRewardHandler("ADS",dl(Gn.getAdsInstance()));Xe.registerRewardHandler("JOLI_COIN",hl(wt,{onUnlockSuccess:fu.bind(void 0),hasSubscription:()=>!0}));Xe.registerRewardHandler("JOLI_COIN_ONLY",ml(wt,{onUnlockSuccess:fu.bind(void 0),hasSubscription:()=>!0}));Xe.registerRewardHandler("SUBSCRIPTION",_l(wt,{onSubSuccess:rv.bind(void 0),hasSubscription:()=>!0}));Ti(wt);Lr(wt);du.on("isAdShowing",t=>{Ke("JOLIBOX_ADS_EVENT",{isAdShowing:t})});ha.registerCommand("AdsSDK.init",t=>{Gn.init(t)});ha.registerCommand("AdsSDK.adConfig",t=>{Gn.adConfig(t)});ha.registerCommand("AdsSDK.adBreak",t=>{Gn.adBreak(t)});ha.registerCommand("AdsSDK.adUnit",t=>{Gn.adUnit(t)});q();vt();var hu=we();hu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let t=performance.now();Te("loadFinished",{duration:t})});hu.registerCommand("RuntimeSDK.loadProgressEvent",t=>{console.log("RuntimeSDK.loadProgressEvent",t)});q();vt();var yu=-1,pa=function(t){addEventListener("pageshow",function(e){e.persisted&&(yu=e.timeStamp,t(e))},!0)},No=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},va=function(){var t=No();return t&&t.activationStart||0},rn=function(t,e){var n=No(),r="navigate";return yu>=0?r="back-forward-cache":n&&(document.prerendering||va()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},wu=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver(function(a){Promise.resolve().then(function(){e(a.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(a){}},an=function(t,e,n,r){var a,i;return function(o){e.value>=0&&(o||r)&&((i=e.value-(a||0))||a===void 0)&&(a=e.value,e.delta=i,e.rating=function(s,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(e.value,n),t(e))}},bu=function(t){requestAnimationFrame(function(){return requestAnimationFrame(function(){return t()})})},Eu=function(t){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&t()})},Iu=function(t){var e=!1;return function(){e||(t(),e=!0)}},nn=-1,mu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},ma=function(t){document.visibilityState==="hidden"&&nn>-1&&(nn=t.type==="visibilitychange"?t.timeStamp:0,iv())},pu=function(){addEventListener("visibilitychange",ma,!0),addEventListener("prerenderingchange",ma,!0)},iv=function(){removeEventListener("visibilitychange",ma,!0),removeEventListener("prerenderingchange",ma,!0)},Au=function(){return nn<0&&(nn=mu(),pu(),pa(function(){setTimeout(function(){nn=mu(),pu()},0)})),{get firstHiddenTime(){return nn}}},Uo=function(t){document.prerendering?addEventListener("prerenderingchange",function(){return t()},!0):t()},vu=[1800,3e3],Su=function(t,e){e=e||{},Uo(function(){var n,r=Au(),a=rn("FCP"),i=wu("paint",function(o){o.forEach(function(s){s.name==="first-contentful-paint"&&(i.disconnect(),s.startTime<r.firstHiddenTime&&(a.value=Math.max(s.startTime-va(),0),a.entries.push(s),n(!0)))})});i&&(n=an(t,a,vu,e.reportAllChanges),pa(function(o){a=rn("FCP"),n=an(t,a,vu,e.reportAllChanges),bu(function(){a.value=performance.now()-o.timeStamp,n(!0)})}))})};var ov=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=Iu(t),document.visibilityState==="hidden"?t():(n=e(t),Eu(t)),n};var gu=[2500,4e3],Lo={},Cu=function(t,e){e=e||{},Uo(function(){var n,r=Au(),a=rn("LCP"),i=function(l){e.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<r.firstHiddenTime&&(a.value=Math.max(d.startTime-va(),0),a.entries=[d],n())})},o=wu("largest-contentful-paint",i);if(o){n=an(t,a,gu,e.reportAllChanges);var s=Iu(function(){Lo[a.id]||(i(o.takeRecords()),o.disconnect(),Lo[a.id]=!0,n(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return ov(s)},{once:!0,capture:!0})}),Eu(s),pa(function(l){a=rn("LCP"),n=an(t,a,gu,e.reportAllChanges),bu(function(){a.value=performance.now()-l.timeStamp,Lo[a.id]=!0,n(!0)})})}})},_u=[800,1800],sv=function t(e){document.prerendering?Uo(function(){return t(e)}):document.readyState!=="complete"?addEventListener("load",function(){return t(e)},!0):setTimeout(e,0)},Ru=function(t,e){e=e||{};var n=rn("TTFB"),r=an(t,n,_u,e.reportAllChanges);sv(function(){var a=No();a&&(n.value=Math.max(a.responseStart-va(),0),n.entries=[a],r(!0),pa(function(){n=rn("TTFB",0),(r=an(t,n,_u,e.reportAllChanges))(!0)}))})};fe();Jt();et();q();Ir();q();var ga=new Map,Ou=!1,lv=()=>{Ou||(Ct("ON_JOLIBOX_GET_USER_SUB_STATUS",t=>{let e=ga.get(t.sequenceId);e&&(clearTimeout(e.timeoutId),e.resolve(t.isSubUser),ga.delete(t.sequenceId))}),Ou=!0)};function Bo(){return S(this,null,function*(){return lv(),new Promise((t,e)=>{let n=je(),r=setTimeout(()=>{ga.delete(n),e(new Error("Timeout waiting for user sub status response"))},3e3);ga.set(n,{resolve:t,reject:e,timeoutId:r}),Ke("JOLIBOX_GET_USER_SUB_STATUS",{sequenceId:n})})})}function ku(){return S(this,null,function*(){let t=qe.create();try{let e=yield t.get("/api/users/info");return!(e.code!=="SUCCESS"||!e.data)}catch(e){return Ue(new $n(e)),!1}})}function cv(){Su(t=>{Te("GameFCP",{value:t.value,rating:t.rating,navigationType:t.navigationType})}),Cu(t=>{Te("GameLCP",{value:t.value,rating:t.rating,navigationType:t.navigationType})}),Ru(t=>{Te("GameTTFB",{value:t.value,rating:t.rating,navigationType:t.navigationType})})}function uv(){pt.on("onDocumentReady",t=>S(this,null,function*(){let e=yield ku(),n=yield Bo().catch(()=>!1);L.onEnvConfigChanged({hostUserInfo:{isLogin:e,isSubUser:n}}),pt.emit("LifecycleEvent.onReady",W({},L.hostUserInfo?L.hostUserInfo:{isLogin:!1})),L.mpType==="game"&&nt.start(Date.now()-t)}))}function Tu(){uv(),cv()}Tu();
213
296
  /*! Bundled license information:
214
297
 
215
298
  localforage/dist/localforage.js: