@jolibox/implement 1.3.2 → 1.3.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +3 -2
- package/dist/index.js +1 -1
- package/dist/index.native.js +41 -41
- package/dist/native/api/index.d.ts +1 -0
- package/dist/native/api/rewards.d.ts +1 -0
- package/implement.build.log +2 -2
- package/package.json +7 -7
- package/src/native/api/index.ts +1 -0
- package/src/native/api/rewards.ts +85 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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(`
|
|
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.3-beta.1",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
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
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;
|