@kalamba/sdk 0.8.0 → 0.8.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/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +49 -45
- package/dist/plugins.d.ts +9 -0
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +10 -0
- package/dist/wrapper.js +245 -235
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),
|
|
5
|
+
"use strict";var b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),e=(r,i,t)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,t)},u=(r,i,t,n)=>(b(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./errors-358575c3.cjs");function I(r){const i=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&i==="[object Date]"?new r.constructor(+r):typeof r=="number"||i==="[object Number]"||typeof r=="string"||i==="[object String]"?new Date(r):new Date(NaN)}function U(r){const i=I(r);return i.setHours(23,59,59,999),i}function k(){return U(Date.now())}function L(r){const i=I(r);return i.setHours(0,0,0,0),i}function P(){return L(Date.now())}const $=3e4;var F,S;class G{constructor(i){e(this,F,void 0);e(this,S,$);u(this,F,i)}buildHeaders(){const i={};return m(this,F).token&&(i.Authorization=`Bearer ${m(this,F).token}`),i}async request(i,t){const n=new URL(i,m(this,F).apiUrl??window.location.origin);return n.search=new URLSearchParams({...t}).toString(),await(await fetch(n,{signal:AbortSignal.timeout(m(this,S)),headers:this.buildHeaders()})).json()}async getRounds(i){return this.request("/rounds",i)}async getRound(i,t){return this.request(`/rounds/${i}`,t)}}F=new WeakMap,S=new WeakMap;const N={limit:100,page:0};var s,l;class A{constructor({config:i}){e(this,s,void 0);e(this,l,void 0);u(this,s,i),u(this,l,new G({apiUrl:i.api.gameHistoryUrl}))}async getRound(i,{pagination:t=N}={}){return m(this,l).getRound(i,{gameCode:m(this,s).api.game,operatorCode:m(this,s).api.brand,username:m(this,s).api.user,...t})}async getLastRound(){return m(this,s).api.lastRoundId?this.getRound(m(this,s).api.lastRoundId):null}async getRounds({searchPeriod:i={fromDateTime:P(),toDateTime:k()},pagination:t=N}={}){const n=m(this,s).api.user.replace(/^user_/,"").replace(new RegExp(`_${m(this,s).api.integration}$`),"");return m(this,l).getRounds({gameCode:m(this,s).api.game,operatorCode:m(this,s).api.integration,username:n,fromDataTime:i.fromDateTime.toISOString(),toDateTime:i.toDateTime.toISOString(),...t})}}s=new WeakMap,l=new WeakMap;function _(r,i){return r*i/100}function O(r,i,t){if(!["string","number"].includes(typeof i))return"NaN";const{locales:n}=r;try{return new Intl.NumberFormat(n,{...t,numberingSystem:"latn",style:"decimal"}).format(+i)}catch{return`${i}`}}const w="XTS";var y=(r=>(r.Currency="Currency",r.Number="Number",r))(y||{}),f=(r=>(r.Coins="Coins",r.Money="Money",r))(f||{});const T={ARSB:{displayAs:"ARS",maximumFractionDigits:2,minimumFractionDigits:2},CHIPS:{maximumFractionDigits:0,minimumFractionDigits:0},BNB:{maximumFractionDigits:6,minimumFractionDigits:6},BUSD:{maximumFractionDigits:4,minimumFractionDigits:4},BTC:{maximumFractionDigits:8,minimumFractionDigits:2},mBTC:{maximumFractionDigits:5,minimumFractionDigits:2},uBTC:{maximumFractionDigits:2,minimumFractionDigits:2},BCH:{maximumFractionDigits:8,minimumFractionDigits:2},mBCH:{maximumFractionDigits:2,minimumFractionDigits:2},ETH:{maximumFractionDigits:8,minimumFractionDigits:2},mETH:{maximumFractionDigits:5,minimumFractionDigits:2},uETH:{maximumFractionDigits:2,minimumFractionDigits:2},SOC:{maximumFractionDigits:8,minimumFractionDigits:2},LTC:{maximumFractionDigits:8,minimumFractionDigits:2},mLTC:{maximumFractionDigits:5,minimumFractionDigits:2},uLTC:{maximumFractionDigits:2,minimumFractionDigits:2},DOG:{maximumFractionDigits:4,minimumFractionDigits:2},USDC:{maximumFractionDigits:4,minimumFractionDigits:4},USDT:{maximumFractionDigits:4,minimumFractionDigits:2},TRX:{maximumFractionDigits:2,minimumFractionDigits:2},TUSD:{maximumFractionDigits:2,minimumFractionDigits:2},DAI:{maximumFractionDigits:2,minimumFractionDigits:2},XMR:{maximumFractionDigits:4,minimumFractionDigits:4},CBET:{maximumFractionDigits:0,minimumFractionDigits:0},kCBET:{maximumFractionDigits:2,minimumFractionDigits:2},SHIB:{maximumFractionDigits:0,minimumFractionDigits:0},kSHIB:{maximumFractionDigits:4,minimumFractionDigits:2},NEO:{maximumFractionDigits:4,minimumFractionDigits:4},BSV:{maximumFractionDigits:4,minimumFractionDigits:4},EOS:{maximumFractionDigits:4,minimumFractionDigits:4},DASH:{maximumFractionDigits:4,minimumFractionDigits:4},XLM:{maximumFractionDigits:2,minimumFractionDigits:2},KRW:{maximumFractionDigits:2,minimumFractionDigits:2},kVND:{maximumFractionDigits:4,minimumFractionDigits:2},kIDR:{maximumFractionDigits:4,minimumFractionDigits:2},RSD:{maximumFractionDigits:2,minimumFractionDigits:2},STAKEGC:{displayAs:"GC",maximumFractionDigits:0,minimumFractionDigits:0},STAKESC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},"BK.":{maximumFractionDigits:2,minimumFractionDigits:2},"BT.":{maximumFractionDigits:2,minimumFractionDigits:2},"FC.":{maximumFractionDigits:2,minimumFractionDigits:2},"GC.":{maximumFractionDigits:2,minimumFractionDigits:2},"SC.":{maximumFractionDigits:2,minimumFractionDigits:2},GLD:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SS1:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},SVC:{maximumFractionDigits:2,minimumFractionDigits:2},DOT:{maximumFractionDigits:4,minimumFractionDigits:4},SOL:{maximumFractionDigits:4,minimumFractionDigits:4},XRP:{maximumFractionDigits:4,minimumFractionDigits:4},ADA:{maximumFractionDigits:4,minimumFractionDigits:4},TON:{maximumFractionDigits:4,minimumFractionDigits:4},FTN:{maximumFractionDigits:4,minimumFractionDigits:4}};function M(r){return r in T}function j(r){return M(r)?{...T[r],currency:w}:{currency:r}}function q(r,i,t){const n=i.format(+r);return M(t)?n.replace(w,T[t].displayAs??t):n}function K(r,i,t){const{maximumFractionDigits:n,minimumFractionDigits:o}=t.resolvedOptions();return O(r,i,{maximumFractionDigits:n,minimumFractionDigits:o})}function V(r,i,{as:t}={as:"Currency"}){const{canShowCurrency:n,currency:o}=r;return t==="Number"||!n?`${i}`:`${i} ${o}`}function v(r,i,{as:t,from:n}={as:"Currency",from:"Money"},o){if(!["string","number"].includes(typeof i))return"NaN";const{canShowCurrency:a=!0,coinValueInCents:g,currency:x,locales:R}=r;n==="Coins"&&(i=_(+i,g));try{const H=j(x),E=new Intl.NumberFormat(R,{...H,...o,currencyDisplay:"symbol",numberingSystem:"latn",style:"currency"});return t==="Number"||!a?K(r,i,E):q(i,E,x)}catch{return V(r,i,{as:t})}}var c;class B{constructor({config:i}){e(this,c,void 0);u(this,c,i)}formatNumber(i,t){const n={locales:[m(this,c).ui.language]};return O(n,i,t)}formatCurrency(i,t={as:y.Currency,from:f.Money},n){const o=m(this,c).ui.feature.showCurrency,a=m(this,c).api.coinValueInCents,g=m(this,c).api.currency||w,x=[m(this,c).ui.language];return v({canShowCurrency:o,coinValueInCents:a,currency:g,locales:x},i,t,n)}formatCoins(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Coins},t)}formatCoinsWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Coins},t)}formatMoney(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Money},t)}formatMoneyWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Money},t)}}c=new WeakMap;const X=()=>{};var d,h,p,C;class z{constructor({messagePort:i}){e(this,d,void 0);e(this,h,void 0);e(this,p,void 0);e(this,C,void 0);u(this,C,i),this.on("configured",t=>{u(this,d,t),u(this,p,new B({config:t})),u(this,h,new A({config:t}))}),this.on("playResponse",t=>{this.config.api.lastRoundId=t.contract.roundId})}get config(){if(!m(this,d))throw new Error("config is not initialized, you must open game first");return m(this,d)}get history(){if(!m(this,h))throw new Error("config is not initialized, you must open game first");return m(this,h)}get i18n(){if(!m(this,p))throw new Error("i18n is not initialized, you must open game first");return m(this,p)}request(i,...[t]){return new Promise(n=>{this.on(`${i}Response`,o=>n({type:"response",response:o}),{once:!0}),this.on(`${i}Error`,o=>n({type:"error",error:o}),{once:!0}),this.send(i,t)})}on(i,t,n){const o=function a(g){g.data.message===`kalamba:wrapper:${i}`&&(X("on",g.data.message.replace(/^kalamba:/,""),g.data.payload),t(g.data.payload),n!=null&&n.once&&window.removeEventListener("message",a))};window.addEventListener("message",o)}send(i,...[t]){m(this,C).postMessage({message:`kalamba:sdk:${i}`,payload:t},"*")}configure(i){this.send("configure",i)}async openGame(){const i=new Promise(n=>this.on("configured",n,{once:!0})),t=await this.request("openGame");if(t.type==="response")return await i,t.response;throw t.error.type==="timeout"?new D.TimeoutError:new D.RgsError(t.error.data)}async play(i,t,n="SPIN"){const o={contract:i,extra:t,actionType:n},a=await this.request("play",o);if(a.type==="response")return a.response;throw a.error.type==="timeout"?new D.TimeoutError:new D.RgsError(a.error.data)}}d=new WeakMap,h=new WeakMap,p=new WeakMap,C=new WeakMap;exports.RgsError=D.RgsError;exports.RgsErrorCode=D.RgsErrorCode;exports.TimeoutError=D.TimeoutError;exports.History=A;exports.I18n=B;exports.KalambaSdk=z;
|
package/dist/index.d.ts
CHANGED
|
@@ -402,6 +402,12 @@ export declare interface SdkConfig {
|
|
|
402
402
|
maximumBet?: number;
|
|
403
403
|
minimumSpinDuration: number;
|
|
404
404
|
requestTimeoutMs: number;
|
|
405
|
+
incompleteGameResolution: {
|
|
406
|
+
type: 'NONE' | 'MANUAL';
|
|
407
|
+
} | {
|
|
408
|
+
daysToAutoResolution: number;
|
|
409
|
+
type: 'AUTOMATIC';
|
|
410
|
+
};
|
|
405
411
|
realityCheck: RealityCheckConfig;
|
|
406
412
|
skipInsufficientFundsCheck: boolean;
|
|
407
413
|
skipSplash: boolean;
|
|
@@ -473,6 +479,9 @@ export declare type SdkOnlyMessagePayloadMap = {
|
|
|
473
479
|
name: string;
|
|
474
480
|
};
|
|
475
481
|
'telemetry.orientationChange': never;
|
|
482
|
+
freeRoundsOffer: any;
|
|
483
|
+
freeRoundsInfo: any;
|
|
484
|
+
freeRoundsComplete: any;
|
|
476
485
|
};
|
|
477
486
|
|
|
478
487
|
export declare interface SearchPeriod {
|
package/dist/index.js
CHANGED
|
@@ -13,23 +13,23 @@ var m = (n, i, t) => (N(n, i, "read from private field"), t ? t.call(n) : i.get(
|
|
|
13
13
|
}, u = (n, i, t, r) => (N(n, i, "write to private field"), r ? r.call(n, t) : i.set(n, t), t);
|
|
14
14
|
import { T as b, R as E } from "./errors-afd9f527.js";
|
|
15
15
|
import { a as ii } from "./errors-afd9f527.js";
|
|
16
|
-
function
|
|
16
|
+
function I(n) {
|
|
17
17
|
const i = Object.prototype.toString.call(n);
|
|
18
18
|
return n instanceof Date || typeof n == "object" && i === "[object Date]" ? new n.constructor(+n) : typeof n == "number" || i === "[object Number]" || typeof n == "string" || i === "[object String]" ? new Date(n) : /* @__PURE__ */ new Date(NaN);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const i =
|
|
20
|
+
function H(n) {
|
|
21
|
+
const i = I(n);
|
|
22
22
|
return i.setHours(23, 59, 59, 999), i;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function U() {
|
|
25
|
+
return H(Date.now());
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const i =
|
|
27
|
+
function L(n) {
|
|
28
|
+
const i = I(n);
|
|
29
29
|
return i.setHours(0, 0, 0, 0), i;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function k() {
|
|
32
|
+
return L(Date.now());
|
|
33
33
|
}
|
|
34
34
|
const P = 3e4;
|
|
35
35
|
var D, x;
|
|
@@ -60,12 +60,12 @@ class $ {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
D = new WeakMap(), x = new WeakMap();
|
|
63
|
-
const
|
|
63
|
+
const A = {
|
|
64
64
|
limit: 100,
|
|
65
65
|
page: 0
|
|
66
66
|
};
|
|
67
67
|
var s, y;
|
|
68
|
-
class
|
|
68
|
+
class G {
|
|
69
69
|
constructor({
|
|
70
70
|
config: i
|
|
71
71
|
}) {
|
|
@@ -76,7 +76,7 @@ class _ {
|
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
78
|
async getRound(i, {
|
|
79
|
-
pagination: t =
|
|
79
|
+
pagination: t = A
|
|
80
80
|
} = {}) {
|
|
81
81
|
return m(this, y).getRound(i, {
|
|
82
82
|
gameCode: m(this, s).api.game,
|
|
@@ -90,10 +90,10 @@ class _ {
|
|
|
90
90
|
}
|
|
91
91
|
async getRounds({
|
|
92
92
|
searchPeriod: i = {
|
|
93
|
-
fromDateTime:
|
|
94
|
-
toDateTime:
|
|
93
|
+
fromDateTime: k(),
|
|
94
|
+
toDateTime: U()
|
|
95
95
|
},
|
|
96
|
-
pagination: t =
|
|
96
|
+
pagination: t = A
|
|
97
97
|
} = {}) {
|
|
98
98
|
const r = m(this, s).api.user.replace(/^user_/, "").replace(new RegExp(`_${m(this, s).api.integration}$`), "");
|
|
99
99
|
return m(this, y).getRounds({
|
|
@@ -107,7 +107,7 @@ class _ {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
s = new WeakMap(), y = new WeakMap();
|
|
110
|
-
function
|
|
110
|
+
function _(n, i) {
|
|
111
111
|
return n * i / 100;
|
|
112
112
|
}
|
|
113
113
|
function O(n, i, t) {
|
|
@@ -126,9 +126,9 @@ function O(n, i, t) {
|
|
|
126
126
|
return `${i}`;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const S = "XTS";
|
|
130
130
|
var F = /* @__PURE__ */ ((n) => (n.Currency = "Currency", n.Number = "Number", n))(F || {}), f = /* @__PURE__ */ ((n) => (n.Coins = "Coins", n.Money = "Money", n))(f || {});
|
|
131
|
-
const
|
|
131
|
+
const w = {
|
|
132
132
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
133
133
|
// ARSB is the internal currency relevant for invoicing purposes, players should see it as ARS
|
|
134
134
|
ARSB: { displayAs: "ARS", maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
@@ -203,9 +203,13 @@ const S = {
|
|
|
203
203
|
STAKEGC: { displayAs: "GC", maximumFractionDigits: 0, minimumFractionDigits: 0 },
|
|
204
204
|
STAKESC: { displayAs: "SC", maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
205
205
|
// Social currency on Relax
|
|
206
|
+
"BK.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
207
|
+
"BT.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
206
208
|
"FC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
207
209
|
"GC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
208
210
|
"SC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
211
|
+
GLD: { displayAs: "GC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
212
|
+
SS1: { displayAs: "SC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
209
213
|
// Silvercash
|
|
210
214
|
SVC: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
|
|
211
215
|
// Polkadot
|
|
@@ -222,33 +226,33 @@ const S = {
|
|
|
222
226
|
FTN: { maximumFractionDigits: 4, minimumFractionDigits: 4 }
|
|
223
227
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
224
228
|
};
|
|
225
|
-
function
|
|
226
|
-
return n in
|
|
229
|
+
function B(n) {
|
|
230
|
+
return n in w;
|
|
227
231
|
}
|
|
228
232
|
function j(n) {
|
|
229
|
-
return
|
|
230
|
-
...
|
|
231
|
-
currency:
|
|
233
|
+
return B(n) ? {
|
|
234
|
+
...w[n],
|
|
235
|
+
currency: S
|
|
232
236
|
} : {
|
|
233
237
|
currency: n
|
|
234
238
|
};
|
|
235
239
|
}
|
|
236
240
|
function q(n, i, t) {
|
|
237
241
|
const r = i.format(+n);
|
|
238
|
-
return
|
|
242
|
+
return B(t) ? r.replace(S, w[t].displayAs ?? t) : r;
|
|
239
243
|
}
|
|
240
244
|
function V(n, i, t) {
|
|
241
245
|
const { maximumFractionDigits: r, minimumFractionDigits: o } = t.resolvedOptions();
|
|
242
246
|
return O(n, i, { maximumFractionDigits: r, minimumFractionDigits: o });
|
|
243
247
|
}
|
|
244
|
-
function
|
|
248
|
+
function K(n, i, { as: t } = {
|
|
245
249
|
as: "Currency"
|
|
246
250
|
/* Currency */
|
|
247
251
|
}) {
|
|
248
252
|
const { canShowCurrency: r, currency: o } = n;
|
|
249
253
|
return t === "Number" || !r ? `${i}` : `${i} ${o}`;
|
|
250
254
|
}
|
|
251
|
-
function
|
|
255
|
+
function X(n, i, { as: t, from: r } = {
|
|
252
256
|
as: "Currency",
|
|
253
257
|
from: "Money"
|
|
254
258
|
/* Money */
|
|
@@ -256,10 +260,10 @@ function v(n, i, { as: t, from: r } = {
|
|
|
256
260
|
if (!["string", "number"].includes(typeof i))
|
|
257
261
|
return "NaN";
|
|
258
262
|
const { canShowCurrency: a = !0, coinValueInCents: g, currency: C, locales: T } = n;
|
|
259
|
-
r === "Coins" && (i =
|
|
263
|
+
r === "Coins" && (i = _(+i, g));
|
|
260
264
|
try {
|
|
261
|
-
const
|
|
262
|
-
...
|
|
265
|
+
const M = j(C), R = new Intl.NumberFormat(T, {
|
|
266
|
+
...M,
|
|
263
267
|
...o,
|
|
264
268
|
currencyDisplay: "symbol",
|
|
265
269
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -269,11 +273,11 @@ function v(n, i, { as: t, from: r } = {
|
|
|
269
273
|
});
|
|
270
274
|
return t === "Number" || !a ? V(n, i, R) : q(i, R, C);
|
|
271
275
|
} catch {
|
|
272
|
-
return
|
|
276
|
+
return K(n, i, { as: t });
|
|
273
277
|
}
|
|
274
278
|
}
|
|
275
279
|
var c;
|
|
276
|
-
class
|
|
280
|
+
class v {
|
|
277
281
|
constructor({ config: i }) {
|
|
278
282
|
e(this, c, void 0);
|
|
279
283
|
u(this, c, i);
|
|
@@ -283,8 +287,8 @@ class z {
|
|
|
283
287
|
return O(r, i, t);
|
|
284
288
|
}
|
|
285
289
|
formatCurrency(i, t = { as: F.Currency, from: f.Money }, r) {
|
|
286
|
-
const o = m(this, c).ui.feature.showCurrency, a = m(this, c).api.coinValueInCents, g = m(this, c).api.currency ||
|
|
287
|
-
return
|
|
290
|
+
const o = m(this, c).ui.feature.showCurrency, a = m(this, c).api.coinValueInCents, g = m(this, c).api.currency || S, C = [m(this, c).ui.language];
|
|
291
|
+
return X({
|
|
288
292
|
canShowCurrency: o,
|
|
289
293
|
coinValueInCents: a,
|
|
290
294
|
currency: g,
|
|
@@ -305,30 +309,30 @@ class z {
|
|
|
305
309
|
}
|
|
306
310
|
}
|
|
307
311
|
c = new WeakMap();
|
|
308
|
-
const
|
|
312
|
+
const z = () => {
|
|
309
313
|
};
|
|
310
|
-
var
|
|
314
|
+
var l, h, p, d;
|
|
311
315
|
class Y {
|
|
312
316
|
constructor({ messagePort: i }) {
|
|
313
|
-
e(this, h, void 0);
|
|
314
317
|
e(this, l, void 0);
|
|
318
|
+
e(this, h, void 0);
|
|
315
319
|
e(this, p, void 0);
|
|
316
320
|
e(this, d, void 0);
|
|
317
321
|
u(this, d, i), this.on("configured", (t) => {
|
|
318
|
-
u(this,
|
|
322
|
+
u(this, l, t), u(this, p, new v({ config: t })), u(this, h, new G({ config: t }));
|
|
319
323
|
}), this.on("playResponse", (t) => {
|
|
320
324
|
this.config.api.lastRoundId = t.contract.roundId;
|
|
321
325
|
});
|
|
322
326
|
}
|
|
323
327
|
get config() {
|
|
324
|
-
if (!m(this,
|
|
328
|
+
if (!m(this, l))
|
|
325
329
|
throw new Error("config is not initialized, you must open game first");
|
|
326
|
-
return m(this,
|
|
330
|
+
return m(this, l);
|
|
327
331
|
}
|
|
328
332
|
get history() {
|
|
329
|
-
if (!m(this,
|
|
333
|
+
if (!m(this, h))
|
|
330
334
|
throw new Error("config is not initialized, you must open game first");
|
|
331
|
-
return m(this,
|
|
335
|
+
return m(this, h);
|
|
332
336
|
}
|
|
333
337
|
get i18n() {
|
|
334
338
|
if (!m(this, p))
|
|
@@ -344,7 +348,7 @@ class Y {
|
|
|
344
348
|
}
|
|
345
349
|
on(i, t, r) {
|
|
346
350
|
const o = function a(g) {
|
|
347
|
-
g.data.message === `kalamba:wrapper:${i}` && (
|
|
351
|
+
g.data.message === `kalamba:wrapper:${i}` && (z("on", g.data.message.replace(/^kalamba:/, ""), g.data.payload), t(g.data.payload), r != null && r.once && window.removeEventListener("message", a));
|
|
348
352
|
};
|
|
349
353
|
window.addEventListener("message", o);
|
|
350
354
|
}
|
|
@@ -374,10 +378,10 @@ class Y {
|
|
|
374
378
|
throw a.error.type === "timeout" ? new b() : new E(a.error.data);
|
|
375
379
|
}
|
|
376
380
|
}
|
|
377
|
-
|
|
381
|
+
l = new WeakMap(), h = new WeakMap(), p = new WeakMap(), d = new WeakMap();
|
|
378
382
|
export {
|
|
379
|
-
|
|
380
|
-
|
|
383
|
+
G as History,
|
|
384
|
+
v as I18n,
|
|
381
385
|
Y as KalambaSdk,
|
|
382
386
|
E as RgsError,
|
|
383
387
|
ii as RgsErrorCode,
|
package/dist/plugins.d.ts
CHANGED
|
@@ -544,6 +544,12 @@ declare interface SdkConfig {
|
|
|
544
544
|
maximumBet?: number;
|
|
545
545
|
minimumSpinDuration: number;
|
|
546
546
|
requestTimeoutMs: number;
|
|
547
|
+
incompleteGameResolution: {
|
|
548
|
+
type: 'NONE' | 'MANUAL';
|
|
549
|
+
} | {
|
|
550
|
+
daysToAutoResolution: number;
|
|
551
|
+
type: 'AUTOMATIC';
|
|
552
|
+
};
|
|
547
553
|
realityCheck: RealityCheckConfig;
|
|
548
554
|
skipInsufficientFundsCheck: boolean;
|
|
549
555
|
skipSplash: boolean;
|
|
@@ -615,6 +621,9 @@ declare type SdkOnlyMessagePayloadMap = {
|
|
|
615
621
|
name: string;
|
|
616
622
|
};
|
|
617
623
|
'telemetry.orientationChange': never;
|
|
624
|
+
freeRoundsOffer: any;
|
|
625
|
+
freeRoundsInfo: any;
|
|
626
|
+
freeRoundsComplete: any;
|
|
618
627
|
};
|
|
619
628
|
|
|
620
629
|
declare type Settings = {
|
package/dist/wrapper.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var Sa=Object.defineProperty;var Ca=(e,r,a)=>r in e?Sa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a;var Ne=(e,r,a)=>(Ca(e,typeof r!="symbol"?r+"":r,a),a),je=(e,r,a)=>{if(!r.has(e))throw TypeError("Cannot "+a)};var _=(e,r,a)=>(je(e,r,"read from private field"),a?a.call(e):r.get(e)),P=(e,r,a)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,a)},U=(e,r,a,t)=>(je(e,r,"write to private field"),t?t.call(e,a):r.set(e,a),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ue=require("./errors-358575c3.cjs"),b=require("./noop-b3c54b76.cjs"),Be=()=>{},Ta=()=>{};var L,ee,E,M,I;class Aa{constructor({messagePort:r,plugins:a,sdkConfigManager:t}){P(this,L,void 0);P(this,ee,void 0);P(this,E,{gameName:"UNKNOWN",gameVersion:"unknown",showErrors:!0,showFreeRounds:!0,showRealityCheck:!0,showBars:!0,skipErrors:[]});P(this,M,{balance:0,bet:{base:0,multiplier:0}});P(this,I,void 0);U(this,L,r),U(this,I,new t),U(this,ee,{rgs:new a.rgs(this.config,this.sdkConfig),casino:a.casino.map(n=>new n(this.config,this.sdkConfig)),telemetry:a.telemetry.map(({plugin:n,trackers:s})=>new n(s.map(i=>new i(this.config,this.sdkConfig)),this.config,this.sdkConfig))}),this.on("balance",({balance:n})=>{this.setState(s=>({...s,balance:n}))}),this.on("sdk:bet",n=>{this.setState(s=>({...s,bet:n}))}),this.on("sdk:playCycleStart",()=>{this.setState(n=>({...n,balance:n.balance-n.bet.base*n.bet.multiplier}))}),this.on("sdk:configure",n=>{Object.assign(_(this,E),n)}),this.on("rgs:openGameResponse",async n=>{this.setState(s=>({...s,balance:n.contract.balance.coins})),this.sdkConfig.ui=await _(this,I).getConfig(),this.send("configured",this.sdkConfig)}),this.on("rgs:openGameError",async n=>{n.type==="timeout"&&!this.config.skipErrors.includes("TIMEOUT")&&this.send("error",{messageKey:"Error.TIMEOUT",messageCode:"TIMEOUT",type:"RELOAD"}),n.type==="error"&&!this.config.skipErrors.includes(n.data.code)&&this.send("error",{messageKey:`RgsError.${n.data.code}`,messageCode:n.data.code,type:Ue.RgsErrorAction[n.data.code]})}),this.on("rgs:playError",async n=>{n.type==="timeout"&&!this.config.skipErrors.includes("TIMEOUT")&&this.send("error",{messageKey:"Error.TIMEOUT",messageCode:"TIMEOUT",type:"RELOAD"}),n.type==="error"&&!this.config.skipErrors.includes(n.data.code)&&this.send("error",{messageKey:`RgsError.${n.data.code}`,messageCode:n.data.code,type:Ue.RgsErrorAction[n.data.code]})}),this.forwardMessages()}setState(r){U(this,M,r(_(this,M))),this.send("state",_(this,M))}forwardMessages(){this.forwardToPlugins("casino",["sdk:autoplay","sdk:balance","sdk:bet","sdk:cashier","sdk:choice","sdk:close","sdk:error","sdk:history","sdk:loadEnd","sdk:loadProgress","sdk:loadStart","sdk:openGame","sdk:play","sdk:playCycleEnd","sdk:playCycleStart","sdk:playEnd","sdk:playStart","sdk:settings"]),this.forwardToPlugins("casino",["rgs:playResponse","rgs:openGameResponse"]),this.forwardToPlugins("rgs",["sdk:openGame","sdk:play","sdk:history"]),this.forwardToPlugins("rgs",["casino:play","casino:cashier","casino:close","casino:history"]),this.forwardToPlugins("telemetry",["sdk:autoplay","sdk:error","sdk:playCycleStart","sdk:playCycleEnd","sdk:loadStart","sdk:loadProgress","sdk:loadEnd","sdk:telemetry.click","sdk:telemetry.orientationChange"]),this.forwardToPlugins("telemetry",["rgs:openGameResponse","rgs:playResponse"]),this.forwardToSdk(["casino:balance","casino:bet","casino:choice","casino:freeze","casino:help","casino:paytable","casino:resume","casino:settings","casino:suspend","casino:unfreeze"]),this.forwardToSdk(["rgs:openGameError","rgs:openGameResponse","rgs:playError","rgs:playResponse","rgs:realityCheck"])}get config(){const r=this;return new Proxy({},{get(a,t){return Reflect.get(_(r,E),t)},set(a,t,n){return Reflect.set(_(r,E),t,n)}})}get sdkConfig(){return _(this,I).config}forwardToPlugins(r,a){a.forEach(t=>{const n=s=>{s.data.message===`kalamba:${t}`&&(Be("wrapper:forwardToPlugins",r,s.data.message.replace(/^kalamba:/,""),s.data.payload),window.postMessage({message:`kalamba:wrapper-${r}:${t.replace(/^(.+):/,"")}`,payload:s.data.payload}))};window.addEventListener("message",n)})}forwardToSdk(r){r.forEach(a=>{const t=n=>{n.data.message===`kalamba:${a}`&&(Ta("wrapper:forwardToSdk",n.data.message.replace(/^kalamba:/,""),n.data.payload),_(this,L).postMessage({message:`kalamba:wrapper:${a.replace(/^(.+):/,"")}`,payload:n.data.payload},"*"))};window.addEventListener("message",t)})}on(r,a,t){const n=function s(i){!new RegExp(`^kalamba:${r.includes(":")?"":"(.+):"}${r}$`).test(i.data.message)||new RegExp(`^kalamba:wrapper-(.+):${r}`).test(i.data.message)||new RegExp(`^kalamba:(.+)-wrapper:${r}`).test(i.data.message)||(Be("on",i.data.message.replace(/^kalamba:/,""),i.data.payload),a(i.data.payload),t!=null&&t.once&&window.removeEventListener("message",s))};window.addEventListener("message",n)}send(r,...[a]){window.postMessage({message:`kalamba:wrapper:${r}`,payload:a}),_(this,L).postMessage({message:`kalamba:wrapper:${r}`,payload:a},"*")}}L=new WeakMap,ee=new WeakMap,E=new WeakMap,M=new WeakMap,I=new WeakMap;function Oa(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var w=Oa,Pa=w,Ke=Object.create,La=function(){function e(){}return function(r){if(!Pa(r))return{};if(Ke)return Ke(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}(),be=La;function Ea(){}var me=Ea,Ma=be,Ia=me;function z(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}z.prototype=Ma(Ia.prototype);z.prototype.constructor=z;var we=z;function Fa(e,r){for(var a=-1,t=r.length,n=e.length;++a<t;)e[n+a]=r[a];return e}var Gr=Fa,xa=typeof b.commonjsGlobal=="object"&&b.commonjsGlobal&&b.commonjsGlobal.Object===Object&&b.commonjsGlobal,Nr=xa,Ra=Nr,Da=typeof self=="object"&&self&&self.Object===Object&&self,ka=Ra||Da||Function("return this")(),$=ka,Ga=$,Na=Ga.Symbol,K=Na,He=K,jr=Object.prototype,ja=jr.hasOwnProperty,Ua=jr.toString,B=He?He.toStringTag:void 0;function Ba(e){var r=ja.call(e,B),a=e[B];try{e[B]=void 0;var t=!0}catch{}var n=Ua.call(e);return t&&(r?e[B]=a:delete e[B]),n}var Ka=Ba,Ha=Object.prototype,qa=Ha.toString;function Wa(e){return qa.call(e)}var za=Wa,qe=K,Qa=Ka,Xa=za,Ya="[object Null]",Va="[object Undefined]",We=qe?qe.toStringTag:void 0;function Za(e){return e==null?e===void 0?Va:Ya:We&&We in Object(e)?Qa(e):Xa(e)}var F=Za;function Ja(e){return e!=null&&typeof e=="object"}var S=Ja,et=F,rt=S,at="[object Arguments]";function tt(e){return rt(e)&&et(e)==at}var nt=tt,ze=nt,st=S,Ur=Object.prototype,it=Ur.hasOwnProperty,ot=Ur.propertyIsEnumerable,ut=ze(function(){return arguments}())?ze:function(e){return st(e)&&it.call(e,"callee")&&!ot.call(e,"callee")},re=ut,lt=Array.isArray,d=lt,Qe=K,ft=re,ct=d,Xe=Qe?Qe.isConcatSpreadable:void 0;function pt(e){return ct(e)||ft(e)||!!(Xe&&e&&e[Xe])}var ht=pt,gt=Gr,vt=ht;function Br(e,r,a,t,n){var s=-1,i=e.length;for(a||(a=vt),n||(n=[]);++s<i;){var o=e[s];r>0&&a(o)?r>1?Br(o,r-1,a,t,n):gt(n,o):t||(n[n.length]=o)}return n}var Kr=Br,dt=Kr;function yt(e){var r=e==null?0:e.length;return r?dt(e,1):[]}var _t=yt;function $t(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}var bt=$t,mt=bt,Ye=Math.max;function wt(e,r,a){return r=Ye(r===void 0?e.length-1:r,0),function(){for(var t=arguments,n=-1,s=Ye(t.length-r,0),i=Array(s);++n<s;)i[n]=t[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=t[n];return o[r]=a(i),mt(e,this,o)}}var Hr=wt;function St(e){return function(){return e}}var Ct=St,Tt=F,At=w,Ot="[object AsyncFunction]",Pt="[object Function]",Lt="[object GeneratorFunction]",Et="[object Proxy]";function Mt(e){if(!At(e))return!1;var r=Tt(e);return r==Pt||r==Lt||r==Ot||r==Et}var Se=Mt,It=$,Ft=It["__core-js_shared__"],xt=Ft,le=xt,Ve=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Rt(e){return!!Ve&&Ve in e}var Dt=Rt,kt=Function.prototype,Gt=kt.toString;function Nt(e){if(e!=null){try{return Gt.call(e)}catch{}try{return e+""}catch{}}return""}var qr=Nt,jt=Se,Ut=Dt,Bt=w,Kt=qr,Ht=/[\\^$.*+?()[\]{}|]/g,qt=/^\[object .+?Constructor\]$/,Wt=Function.prototype,zt=Object.prototype,Qt=Wt.toString,Xt=zt.hasOwnProperty,Yt=RegExp("^"+Qt.call(Xt).replace(Ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vt(e){if(!Bt(e)||Ut(e))return!1;var r=jt(e)?Yt:qt;return r.test(Kt(e))}var Zt=Vt;function Jt(e,r){return e==null?void 0:e[r]}var en=Jt,rn=Zt,an=en;function tn(e,r){var a=an(e,r);return rn(a)?a:void 0}var O=tn,nn=O,sn=function(){try{var e=nn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Wr=sn;function on(e){return e}var ae=on,un=Ct,Ze=Wr,ln=ae,fn=Ze?function(e,r){return Ze(e,"toString",{configurable:!0,enumerable:!1,value:un(r),writable:!0})}:ln,cn=fn,pn=800,hn=16,gn=Date.now;function vn(e){var r=0,a=0;return function(){var t=gn(),n=hn-(t-a);if(a=t,n>0){if(++r>=pn)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var dn=vn,yn=cn,_n=dn,$n=_n(yn),zr=$n,bn=_t,mn=Hr,wn=zr;function Sn(e){return wn(mn(e,void 0,bn),e+"")}var Cn=Sn,Tn=O,An=$,On=Tn(An,"WeakMap"),Qr=On,Je=Qr,Pn=Je&&new Je,Ln=Pn,er=Ln,En=b.noop_1,Mn=er?function(e){return er.get(e)}:En,Xr=Mn,In={},Fn=In,rr=Fn,xn=Object.prototype,Rn=xn.hasOwnProperty;function Dn(e){for(var r=e.name+"",a=rr[r],t=Rn.call(rr,r)?a.length:0;t--;){var n=a[t],s=n.func;if(s==null||s==e)return n.name}return r}var Yr=Dn,kn=be,Gn=me,Nn=4294967295;function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nn,this.__views__=[]}Q.prototype=kn(Gn.prototype);Q.prototype.constructor=Q;var Ce=Q;function jn(e,r){var a=-1,t=e.length;for(r||(r=Array(t));++a<t;)r[a]=e[a];return r}var Vr=jn,Un=Ce,Bn=we,Kn=Vr;function Hn(e){if(e instanceof Un)return e.clone();var r=new Bn(e.__wrapped__,e.__chain__);return r.__actions__=Kn(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var qn=Hn,Wn=Ce,ar=we,zn=me,Qn=d,Xn=S,Yn=qn,Vn=Object.prototype,Zn=Vn.hasOwnProperty;function X(e){if(Xn(e)&&!Qn(e)&&!(e instanceof Wn)){if(e instanceof ar)return e;if(Zn.call(e,"__wrapped__"))return Yn(e)}return new ar(e)}X.prototype=zn.prototype;X.prototype.constructor=X;var Jn=X,es=Ce,rs=Xr,as=Yr,ts=Jn;function ns(e){var r=as(e),a=ts[r];if(typeof a!="function"||!(r in es.prototype))return!1;if(e===a)return!0;var t=rs(a);return!!t&&e===t[0]}var ss=ns,tr=we,is=Cn,os=Xr,fe=Yr,us=d,nr=ss,ls="Expected a function",fs=8,cs=32,ps=128,hs=256;function gs(e){return is(function(r){var a=r.length,t=a,n=tr.prototype.thru;for(e&&r.reverse();t--;){var s=r[t];if(typeof s!="function")throw new TypeError(ls);if(n&&!i&&fe(s)=="wrapper")var i=new tr([],!0)}for(t=i?t:a;++t<a;){s=r[t];var o=fe(s),u=o=="wrapper"?os(s):void 0;u&&nr(u[0])&&u[1]==(ps|fs|cs|hs)&&!u[4].length&&u[9]==1?i=i[fe(u[0])].apply(i,u[3]):i=s.length==1&&nr(s)?i[o]():i.thru(s)}return function(){var l=arguments,f=l[0];if(i&&l.length==1&&us(f))return i.plant(f).value();for(var p=0,c=a?r[p].apply(this,l):f;++p<a;)c=r[p].call(this,c);return c}})}var vs=gs,ds=vs,ys=ds(),_s=ys;const $s=b.getDefaultExportFromCjs(_s);function bs(){this.__data__=[],this.size=0}var ms=bs;function ws(e,r){return e===r||e!==e&&r!==r}var x=ws,Ss=x;function Cs(e,r){for(var a=e.length;a--;)if(Ss(e[a][0],r))return a;return-1}var te=Cs,Ts=te,As=Array.prototype,Os=As.splice;function Ps(e){var r=this.__data__,a=Ts(r,e);if(a<0)return!1;var t=r.length-1;return a==t?r.pop():Os.call(r,a,1),--this.size,!0}var Ls=Ps,Es=te;function Ms(e){var r=this.__data__,a=Es(r,e);return a<0?void 0:r[a][1]}var Is=Ms,Fs=te;function xs(e){return Fs(this.__data__,e)>-1}var Rs=xs,Ds=te;function ks(e,r){var a=this.__data__,t=Ds(a,e);return t<0?(++this.size,a.push([e,r])):a[t][1]=r,this}var Gs=ks,Ns=ms,js=Ls,Us=Is,Bs=Rs,Ks=Gs;function R(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}R.prototype.clear=Ns;R.prototype.delete=js;R.prototype.get=Us;R.prototype.has=Bs;R.prototype.set=Ks;var ne=R,Hs=ne;function qs(){this.__data__=new Hs,this.size=0}var Ws=qs;function zs(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}var Qs=zs;function Xs(e){return this.__data__.get(e)}var Ys=Xs;function Vs(e){return this.__data__.has(e)}var Zs=Vs,Js=O,ei=$,ri=Js(ei,"Map"),Te=ri,ai=O,ti=ai(Object,"create"),se=ti,sr=se;function ni(){this.__data__=sr?sr(null):{},this.size=0}var si=ni;function ii(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var oi=ii,ui=se,li="__lodash_hash_undefined__",fi=Object.prototype,ci=fi.hasOwnProperty;function pi(e){var r=this.__data__;if(ui){var a=r[e];return a===li?void 0:a}return ci.call(r,e)?r[e]:void 0}var hi=pi,gi=se,vi=Object.prototype,di=vi.hasOwnProperty;function yi(e){var r=this.__data__;return gi?r[e]!==void 0:di.call(r,e)}var _i=yi,$i=se,bi="__lodash_hash_undefined__";function mi(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=$i&&r===void 0?bi:r,this}var wi=mi,Si=si,Ci=oi,Ti=hi,Ai=_i,Oi=wi;function D(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}D.prototype.clear=Si;D.prototype.delete=Ci;D.prototype.get=Ti;D.prototype.has=Ai;D.prototype.set=Oi;var Pi=D,ir=Pi,Li=ne,Ei=Te;function Mi(){this.size=0,this.__data__={hash:new ir,map:new(Ei||Li),string:new ir}}var Ii=Mi;function Fi(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var xi=Fi,Ri=xi;function Di(e,r){var a=e.__data__;return Ri(r)?a[typeof r=="string"?"string":"hash"]:a.map}var ie=Di,ki=ie;function Gi(e){var r=ki(this,e).delete(e);return this.size-=r?1:0,r}var Ni=Gi,ji=ie;function Ui(e){return ji(this,e).get(e)}var Bi=Ui,Ki=ie;function Hi(e){return Ki(this,e).has(e)}var qi=Hi,Wi=ie;function zi(e,r){var a=Wi(this,e),t=a.size;return a.set(e,r),this.size+=a.size==t?0:1,this}var Qi=zi,Xi=Ii,Yi=Ni,Vi=Bi,Zi=qi,Ji=Qi;function k(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}k.prototype.clear=Xi;k.prototype.delete=Yi;k.prototype.get=Vi;k.prototype.has=Zi;k.prototype.set=Ji;var Ae=k,eo=ne,ro=Te,ao=Ae,to=200;function no(e,r){var a=this.__data__;if(a instanceof eo){var t=a.__data__;if(!ro||t.length<to-1)return t.push([e,r]),this.size=++a.size,this;a=this.__data__=new ao(t)}return a.set(e,r),this.size=a.size,this}var so=no,io=ne,oo=Ws,uo=Qs,lo=Ys,fo=Zs,co=so;function G(e){var r=this.__data__=new io(e);this.size=r.size}G.prototype.clear=oo;G.prototype.delete=uo;G.prototype.get=lo;G.prototype.has=fo;G.prototype.set=co;var Oe=G,or=Wr;function po(e,r,a){r=="__proto__"&&or?or(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}var Pe=po,ho=Pe,go=x;function vo(e,r,a){(a!==void 0&&!go(e[r],a)||a===void 0&&!(r in e))&&ho(e,r,a)}var Zr=vo;function yo(e){return function(r,a,t){for(var n=-1,s=Object(r),i=t(r),o=i.length;o--;){var u=i[e?o:++n];if(a(s[u],u,s)===!1)break}return r}}var _o=yo,$o=_o,bo=$o(),Jr=bo,Y={exports:{}};Y.exports;(function(e,r){var a=$,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,i=s?a.Buffer:void 0,o=i?i.allocUnsafe:void 0;function u(l,f){if(f)return l.slice();var p=l.length,c=o?o(p):new l.constructor(p);return l.copy(c),c}e.exports=u})(Y,Y.exports);var mo=Y.exports,wo=$,So=wo.Uint8Array,ea=So,ur=ea;function Co(e){var r=new e.constructor(e.byteLength);return new ur(r).set(new ur(e)),r}var To=Co,Ao=To;function Oo(e,r){var a=r?Ao(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Po=Oo;function Lo(e,r){return function(a){return e(r(a))}}var ra=Lo,Eo=ra,Mo=Eo(Object.getPrototypeOf,Object),aa=Mo,Io=Object.prototype;function Fo(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||Io;return e===a}var Le=Fo,xo=be,Ro=aa,Do=Le;function ko(e){return typeof e.constructor=="function"&&!Do(e)?xo(Ro(e)):{}}var Go=ko,No=9007199254740991;function jo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=No}var Ee=jo,Uo=Se,Bo=Ee;function Ko(e){return e!=null&&Bo(e.length)&&!Uo(e)}var N=Ko,Ho=N,qo=S;function Wo(e){return qo(e)&&Ho(e)}var zo=Wo,V={exports:{}};function Qo(){return!1}var Xo=Qo;V.exports;(function(e,r){var a=$,t=Xo,n=r&&!r.nodeType&&r,s=n&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===n,o=i?a.Buffer:void 0,u=o?o.isBuffer:void 0,l=u||t;e.exports=l})(V,V.exports);var Me=V.exports,Yo=F,Vo=aa,Zo=S,Jo="[object Object]",eu=Function.prototype,ru=Object.prototype,ta=eu.toString,au=ru.hasOwnProperty,tu=ta.call(Object);function nu(e){if(!Zo(e)||Yo(e)!=Jo)return!1;var r=Vo(e);if(r===null)return!0;var a=au.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&ta.call(a)==tu}var su=nu,iu=F,ou=Ee,uu=S,lu="[object Arguments]",fu="[object Array]",cu="[object Boolean]",pu="[object Date]",hu="[object Error]",gu="[object Function]",vu="[object Map]",du="[object Number]",yu="[object Object]",_u="[object RegExp]",$u="[object Set]",bu="[object String]",mu="[object WeakMap]",wu="[object ArrayBuffer]",Su="[object DataView]",Cu="[object Float32Array]",Tu="[object Float64Array]",Au="[object Int8Array]",Ou="[object Int16Array]",Pu="[object Int32Array]",Lu="[object Uint8Array]",Eu="[object Uint8ClampedArray]",Mu="[object Uint16Array]",Iu="[object Uint32Array]",h={};h[Cu]=h[Tu]=h[Au]=h[Ou]=h[Pu]=h[Lu]=h[Eu]=h[Mu]=h[Iu]=!0;h[lu]=h[fu]=h[wu]=h[cu]=h[Su]=h[pu]=h[hu]=h[gu]=h[vu]=h[du]=h[yu]=h[_u]=h[$u]=h[bu]=h[mu]=!1;function Fu(e){return uu(e)&&ou(e.length)&&!!h[iu(e)]}var xu=Fu;function Ru(e){return function(r){return e(r)}}var na=Ru,Z={exports:{}};Z.exports;(function(e,r){var a=Nr,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,i=s&&a.process,o=function(){try{var u=n&&n.require&&n.require("util").types;return u||i&&i.binding&&i.binding("util")}catch{}}();e.exports=o})(Z,Z.exports);var Du=Z.exports,ku=xu,Gu=na,lr=Du,fr=lr&&lr.isTypedArray,Nu=fr?Gu(fr):ku,Ie=Nu;function ju(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var sa=ju,Uu=Pe,Bu=x,Ku=Object.prototype,Hu=Ku.hasOwnProperty;function qu(e,r,a){var t=e[r];(!(Hu.call(e,r)&&Bu(t,a))||a===void 0&&!(r in e))&&Uu(e,r,a)}var Wu=qu,zu=Wu,Qu=Pe;function Xu(e,r,a,t){var n=!a;a||(a={});for(var s=-1,i=r.length;++s<i;){var o=r[s],u=t?t(a[o],e[o],o,a,e):void 0;u===void 0&&(u=e[o]),n?Qu(a,o,u):zu(a,o,u)}return a}var Yu=Xu;function Vu(e,r){for(var a=-1,t=Array(e);++a<e;)t[a]=r(a);return t}var Zu=Vu,Ju=9007199254740991,el=/^(?:0|[1-9]\d*)$/;function rl(e,r){var a=typeof e;return r=r??Ju,!!r&&(a=="number"||a!="symbol"&&el.test(e))&&e>-1&&e%1==0&&e<r}var Fe=rl,al=Zu,tl=re,nl=d,sl=Me,il=Fe,ol=Ie,ul=Object.prototype,ll=ul.hasOwnProperty;function fl(e,r){var a=nl(e),t=!a&&tl(e),n=!a&&!t&&sl(e),s=!a&&!t&&!n&&ol(e),i=a||t||n||s,o=i?al(e.length,String):[],u=o.length;for(var l in e)(r||ll.call(e,l))&&!(i&&(l=="length"||n&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||il(l,u)))&&o.push(l);return o}var ia=fl;function cl(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var pl=cl,hl=w,gl=Le,vl=pl,dl=Object.prototype,yl=dl.hasOwnProperty;function _l(e){if(!hl(e))return vl(e);var r=gl(e),a=[];for(var t in e)t=="constructor"&&(r||!yl.call(e,t))||a.push(t);return a}var $l=_l,bl=ia,ml=$l,wl=N;function Sl(e){return wl(e)?bl(e,!0):ml(e)}var oa=Sl,Cl=Yu,Tl=oa;function Al(e){return Cl(e,Tl(e))}var Ol=Al,cr=Zr,Pl=mo,Ll=Po,El=Vr,Ml=Go,pr=re,hr=d,Il=zo,Fl=Me,xl=Se,Rl=w,Dl=su,kl=Ie,gr=sa,Gl=Ol;function Nl(e,r,a,t,n,s,i){var o=gr(e,a),u=gr(r,a),l=i.get(u);if(l){cr(e,a,l);return}var f=s?s(o,u,a+"",e,r,i):void 0,p=f===void 0;if(p){var c=hr(u),v=!c&&Fl(u),g=!c&&!v&&kl(u);f=u,c||v||g?hr(o)?f=o:Il(o)?f=El(o):v?(p=!1,f=Pl(u,!0)):g?(p=!1,f=Ll(u,!0)):f=[]:Dl(u)||pr(u)?(f=o,pr(o)?f=Gl(o):(!Rl(o)||xl(o))&&(f=Ml(u))):p=!1}p&&(i.set(u,f),n(f,u,t,s,i),i.delete(u)),cr(e,a,f)}var jl=Nl,Ul=Oe,Bl=Zr,Kl=Jr,Hl=jl,ql=w,Wl=oa,zl=sa;function ua(e,r,a,t,n){e!==r&&Kl(r,function(s,i){if(n||(n=new Ul),ql(s))Hl(e,r,i,a,ua,t,n);else{var o=t?t(zl(e,i),s,i+"",e,r,n):void 0;o===void 0&&(o=s),Bl(e,i,o)}},Wl)}var Ql=ua,Xl=ae,Yl=Hr,Vl=zr;function Zl(e,r){return Vl(Yl(e,r,Xl),e+"")}var la=Zl,Jl=x,ef=N,rf=Fe,af=w;function tf(e,r,a){if(!af(a))return!1;var t=typeof r;return(t=="number"?ef(a)&&rf(r,a.length):t=="string"&&r in a)?Jl(a[r],e):!1}var fa=tf,nf=la,sf=fa;function of(e){return nf(function(r,a){var t=-1,n=a.length,s=n>1?a[n-1]:void 0,i=n>2?a[2]:void 0;for(s=e.length>3&&typeof s=="function"?(n--,s):void 0,i&&sf(a[0],a[1],i)&&(s=n<3?void 0:s,n=1),r=Object(r);++t<n;){var o=a[t];o&&e(r,o,t,s)}return r})}var uf=of,lf=Ql,ff=uf,cf=ff(function(e,r,a){lf(e,r,a)}),pf=cf;const ce=b.getDefaultExportFromCjs(pf);function hf(e,r){for(var a=-1,t=e==null?0:e.length,n=Array(t);++a<t;)n[a]=r(e[a],a,e);return n}var ca=hf,gf=F,vf=S,df="[object Symbol]";function yf(e){return typeof e=="symbol"||vf(e)&&gf(e)==df}var oe=yf,_f=d,$f=oe,bf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mf=/^\w*$/;function wf(e,r){if(_f(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||$f(e)?!0:mf.test(e)||!bf.test(e)||r!=null&&e in Object(r)}var xe=wf,pa=Ae,Sf="Expected a function";function Re(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Sf);var a=function(){var t=arguments,n=r?r.apply(this,t):t[0],s=a.cache;if(s.has(n))return s.get(n);var i=e.apply(this,t);return a.cache=s.set(n,i)||s,i};return a.cache=new(Re.Cache||pa),a}Re.Cache=pa;var Cf=Re,Tf=Cf,Af=500;function Of(e){var r=Tf(e,function(t){return a.size===Af&&a.clear(),t}),a=r.cache;return r}var Pf=Of,Lf=Pf,Ef=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mf=/\\(\\)?/g,If=Lf(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Ef,function(a,t,n,s){r.push(n?s.replace(Mf,"$1"):t||a)}),r}),Ff=If,vr=K,xf=ca,Rf=d,Df=oe,kf=1/0,dr=vr?vr.prototype:void 0,yr=dr?dr.toString:void 0;function ha(e){if(typeof e=="string")return e;if(Rf(e))return xf(e,ha)+"";if(Df(e))return yr?yr.call(e):"";var r=e+"";return r=="0"&&1/e==-kf?"-0":r}var Gf=ha,Nf=Gf;function jf(e){return e==null?"":Nf(e)}var Uf=jf,Bf=d,Kf=xe,Hf=Ff,qf=Uf;function Wf(e,r){return Bf(e)?e:Kf(e,r)?[e]:Hf(qf(e))}var ga=Wf,zf=oe,Qf=1/0;function Xf(e){if(typeof e=="string"||zf(e))return e;var r=e+"";return r=="0"&&1/e==-Qf?"-0":r}var ue=Xf,Yf=ga,Vf=ue;function Zf(e,r){r=Yf(r,e);for(var a=0,t=r.length;e!=null&&a<t;)e=e[Vf(r[a++])];return a&&a==t?e:void 0}var De=Zf,Jf="__lodash_hash_undefined__";function ec(e){return this.__data__.set(e,Jf),this}var rc=ec;function ac(e){return this.__data__.has(e)}var tc=ac,nc=Ae,sc=rc,ic=tc;function J(e){var r=-1,a=e==null?0:e.length;for(this.__data__=new nc;++r<a;)this.add(e[r])}J.prototype.add=J.prototype.push=sc;J.prototype.has=ic;var oc=J;function uc(e,r){for(var a=-1,t=e==null?0:e.length;++a<t;)if(r(e[a],a,e))return!0;return!1}var lc=uc;function fc(e,r){return e.has(r)}var cc=fc,pc=oc,hc=lc,gc=cc,vc=1,dc=2;function yc(e,r,a,t,n,s){var i=a&vc,o=e.length,u=r.length;if(o!=u&&!(i&&u>o))return!1;var l=s.get(e),f=s.get(r);if(l&&f)return l==r&&f==e;var p=-1,c=!0,v=a&dc?new pc:void 0;for(s.set(e,r),s.set(r,e);++p<o;){var g=e[p],y=r[p];if(t)var m=i?t(y,g,p,r,e,s):t(g,y,p,e,r,s);if(m!==void 0){if(m)continue;c=!1;break}if(v){if(!hc(r,function(C,T){if(!gc(v,T)&&(g===C||n(g,C,a,t,s)))return v.push(T)})){c=!1;break}}else if(!(g===y||n(g,y,a,t,s))){c=!1;break}}return s.delete(e),s.delete(r),c}var va=yc;function _c(e){var r=-1,a=Array(e.size);return e.forEach(function(t,n){a[++r]=[n,t]}),a}var $c=_c;function bc(e){var r=-1,a=Array(e.size);return e.forEach(function(t){a[++r]=t}),a}var mc=bc,_r=K,$r=ea,wc=x,Sc=va,Cc=$c,Tc=mc,Ac=1,Oc=2,Pc="[object Boolean]",Lc="[object Date]",Ec="[object Error]",Mc="[object Map]",Ic="[object Number]",Fc="[object RegExp]",xc="[object Set]",Rc="[object String]",Dc="[object Symbol]",kc="[object ArrayBuffer]",Gc="[object DataView]",br=_r?_r.prototype:void 0,pe=br?br.valueOf:void 0;function Nc(e,r,a,t,n,s,i){switch(a){case Gc:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case kc:return!(e.byteLength!=r.byteLength||!s(new $r(e),new $r(r)));case Pc:case Lc:case Ic:return wc(+e,+r);case Ec:return e.name==r.name&&e.message==r.message;case Fc:case Rc:return e==r+"";case Mc:var o=Cc;case xc:var u=t&Ac;if(o||(o=Tc),e.size!=r.size&&!u)return!1;var l=i.get(e);if(l)return l==r;t|=Oc,i.set(e,r);var f=Sc(o(e),o(r),t,n,s,i);return i.delete(e),f;case Dc:if(pe)return pe.call(e)==pe.call(r)}return!1}var jc=Nc,Uc=Gr,Bc=d;function Kc(e,r,a){var t=r(e);return Bc(e)?t:Uc(t,a(e))}var Hc=Kc;function qc(e,r){for(var a=-1,t=e==null?0:e.length,n=0,s=[];++a<t;){var i=e[a];r(i,a,e)&&(s[n++]=i)}return s}var Wc=qc;function zc(){return[]}var Qc=zc,Xc=Wc,Yc=Qc,Vc=Object.prototype,Zc=Vc.propertyIsEnumerable,mr=Object.getOwnPropertySymbols,Jc=mr?function(e){return e==null?[]:(e=Object(e),Xc(mr(e),function(r){return Zc.call(e,r)}))}:Yc,ep=Jc,rp=ra,ap=rp(Object.keys,Object),tp=ap,np=Le,sp=tp,ip=Object.prototype,op=ip.hasOwnProperty;function up(e){if(!np(e))return sp(e);var r=[];for(var a in Object(e))op.call(e,a)&&a!="constructor"&&r.push(a);return r}var lp=up,fp=ia,cp=lp,pp=N;function hp(e){return pp(e)?fp(e):cp(e)}var ke=hp,gp=Hc,vp=ep,dp=ke;function yp(e){return gp(e,dp,vp)}var _p=yp,wr=_p,$p=1,bp=Object.prototype,mp=bp.hasOwnProperty;function wp(e,r,a,t,n,s){var i=a&$p,o=wr(e),u=o.length,l=wr(r),f=l.length;if(u!=f&&!i)return!1;for(var p=u;p--;){var c=o[p];if(!(i?c in r:mp.call(r,c)))return!1}var v=s.get(e),g=s.get(r);if(v&&g)return v==r&&g==e;var y=!0;s.set(e,r),s.set(r,e);for(var m=i;++p<u;){c=o[p];var C=e[c],T=r[c];if(t)var Ge=i?t(T,C,c,r,e,s):t(C,T,c,e,r,s);if(!(Ge===void 0?C===T||n(C,T,a,t,s):Ge)){y=!1;break}m||(m=c=="constructor")}if(y&&!m){var H=e.constructor,q=r.constructor;H!=q&&"constructor"in e&&"constructor"in r&&!(typeof H=="function"&&H instanceof H&&typeof q=="function"&&q instanceof q)&&(y=!1)}return s.delete(e),s.delete(r),y}var Sp=wp,Cp=O,Tp=$,Ap=Cp(Tp,"DataView"),Op=Ap,Pp=O,Lp=$,Ep=Pp(Lp,"Promise"),Mp=Ep,Ip=O,Fp=$,xp=Ip(Fp,"Set"),Rp=xp,ve=Op,de=Te,ye=Mp,_e=Rp,$e=Qr,da=F,j=qr,Sr="[object Map]",Dp="[object Object]",Cr="[object Promise]",Tr="[object Set]",Ar="[object WeakMap]",Or="[object DataView]",kp=j(ve),Gp=j(de),Np=j(ye),jp=j(_e),Up=j($e),A=da;(ve&&A(new ve(new ArrayBuffer(1)))!=Or||de&&A(new de)!=Sr||ye&&A(ye.resolve())!=Cr||_e&&A(new _e)!=Tr||$e&&A(new $e)!=Ar)&&(A=function(e){var r=da(e),a=r==Dp?e.constructor:void 0,t=a?j(a):"";if(t)switch(t){case kp:return Or;case Gp:return Sr;case Np:return Cr;case jp:return Tr;case Up:return Ar}return r});var Bp=A,he=Oe,Kp=va,Hp=jc,qp=Sp,Pr=Bp,Lr=d,Er=Me,Wp=Ie,zp=1,Mr="[object Arguments]",Ir="[object Array]",W="[object Object]",Qp=Object.prototype,Fr=Qp.hasOwnProperty;function Xp(e,r,a,t,n,s){var i=Lr(e),o=Lr(r),u=i?Ir:Pr(e),l=o?Ir:Pr(r);u=u==Mr?W:u,l=l==Mr?W:l;var f=u==W,p=l==W,c=u==l;if(c&&Er(e)){if(!Er(r))return!1;i=!0,f=!1}if(c&&!f)return s||(s=new he),i||Wp(e)?Kp(e,r,a,t,n,s):Hp(e,r,u,a,t,n,s);if(!(a&zp)){var v=f&&Fr.call(e,"__wrapped__"),g=p&&Fr.call(r,"__wrapped__");if(v||g){var y=v?e.value():e,m=g?r.value():r;return s||(s=new he),n(y,m,a,t,s)}}return c?(s||(s=new he),qp(e,r,a,t,n,s)):!1}var Yp=Xp,Vp=Yp,xr=S;function ya(e,r,a,t,n){return e===r?!0:e==null||r==null||!xr(e)&&!xr(r)?e!==e&&r!==r:Vp(e,r,a,t,ya,n)}var _a=ya,Zp=Oe,Jp=_a,eh=1,rh=2;function ah(e,r,a,t){var n=a.length,s=n,i=!t;if(e==null)return!s;for(e=Object(e);n--;){var o=a[n];if(i&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++n<s;){o=a[n];var u=o[0],l=e[u],f=o[1];if(i&&o[2]){if(l===void 0&&!(u in e))return!1}else{var p=new Zp;if(t)var c=t(l,f,u,e,r,p);if(!(c===void 0?Jp(f,l,eh|rh,t,p):c))return!1}}return!0}var th=ah,nh=w;function sh(e){return e===e&&!nh(e)}var $a=sh,ih=$a,oh=ke;function uh(e){for(var r=oh(e),a=r.length;a--;){var t=r[a],n=e[t];r[a]=[t,n,ih(n)]}return r}var lh=uh;function fh(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==void 0||e in Object(a))}}var ba=fh,ch=th,ph=lh,hh=ba;function gh(e){var r=ph(e);return r.length==1&&r[0][2]?hh(r[0][0],r[0][1]):function(a){return a===e||ch(a,e,r)}}var vh=gh,dh=De;function yh(e,r,a){var t=e==null?void 0:dh(e,r);return t===void 0?a:t}var _h=yh;function $h(e,r){return e!=null&&r in Object(e)}var bh=$h,mh=ga,wh=re,Sh=d,Ch=Fe,Th=Ee,Ah=ue;function Oh(e,r,a){r=mh(r,e);for(var t=-1,n=r.length,s=!1;++t<n;){var i=Ah(r[t]);if(!(s=e!=null&&a(e,i)))break;e=e[i]}return s||++t!=n?s:(n=e==null?0:e.length,!!n&&Th(n)&&Ch(i,n)&&(Sh(e)||wh(e)))}var Ph=Oh,Lh=bh,Eh=Ph;function Mh(e,r){return e!=null&&Eh(e,r,Lh)}var Ih=Mh,Fh=_a,xh=_h,Rh=Ih,Dh=xe,kh=$a,Gh=ba,Nh=ue,jh=1,Uh=2;function Bh(e,r){return Dh(e)&&kh(r)?Gh(Nh(e),r):function(a){var t=xh(a,e);return t===void 0&&t===r?Rh(a,e):Fh(r,t,jh|Uh)}}var Kh=Bh;function Hh(e){return function(r){return r==null?void 0:r[e]}}var qh=Hh,Wh=De;function zh(e){return function(r){return Wh(r,e)}}var Qh=zh,Xh=qh,Yh=Qh,Vh=xe,Zh=ue;function Jh(e){return Vh(e)?Xh(Zh(e)):Yh(e)}var eg=Jh,rg=vh,ag=Kh,tg=ae,ng=d,sg=eg;function ig(e){return typeof e=="function"?e:e==null?tg:typeof e=="object"?ng(e)?ag(e[0],e[1]):rg(e):sg(e)}var og=ig,ug=Jr,lg=ke;function fg(e,r){return e&&ug(e,r,lg)}var cg=fg,pg=N;function hg(e,r){return function(a,t){if(a==null)return a;if(!pg(a))return e(a,t);for(var n=a.length,s=r?n:-1,i=Object(a);(r?s--:++s<n)&&t(i[s],s,i)!==!1;);return a}}var gg=hg,vg=cg,dg=gg,yg=dg(vg),_g=yg,$g=_g,bg=N;function mg(e,r){var a=-1,t=bg(e)?Array(e.length):[];return $g(e,function(n,s,i){t[++a]=r(n,s,i)}),t}var wg=mg;function Sg(e,r){var a=e.length;for(e.sort(r);a--;)e[a]=e[a].value;return e}var Cg=Sg,Rr=oe;function Tg(e,r){if(e!==r){var a=e!==void 0,t=e===null,n=e===e,s=Rr(e),i=r!==void 0,o=r===null,u=r===r,l=Rr(r);if(!o&&!l&&!s&&e>r||s&&i&&u&&!o&&!l||t&&i&&u||!a&&u||!n)return 1;if(!t&&!s&&!l&&e<r||l&&a&&n&&!t&&!s||o&&a&&n||!i&&n||!u)return-1}return 0}var Ag=Tg,Og=Ag;function Pg(e,r,a){for(var t=-1,n=e.criteria,s=r.criteria,i=n.length,o=a.length;++t<i;){var u=Og(n[t],s[t]);if(u){if(t>=o)return u;var l=a[t];return u*(l=="desc"?-1:1)}}return e.index-r.index}var Lg=Pg,ge=ca,Eg=De,Mg=og,Ig=wg,Fg=Cg,xg=na,Rg=Lg,Dg=ae,kg=d;function Gg(e,r,a){r.length?r=ge(r,function(s){return kg(s)?function(i){return Eg(i,s.length===1?s[0]:s)}:s}):r=[Dg];var t=-1;r=ge(r,xg(Mg));var n=Ig(e,function(s,i,o){var u=ge(r,function(l){return l(s)});return{criteria:u,index:++t,value:s}});return Fg(n,function(s,i){return Rg(s,i,a)})}var Ng=Gg,jg=Kr,Ug=Ng,Bg=la,Dr=fa,Kg=Bg(function(e,r){if(e==null)return[];var a=r.length;return a>1&&Dr(e,r[0],r[1])?r=[]:a>2&&Dr(r[0],r[1],r[2])&&(r=[r[0]]),Ug(e,jg(r,1),[])}),Hg=Kg;const qg=b.getDefaultExportFromCjs(Hg);var Wg=x;function zg(e,r){for(var a=-1,t=e.length,n=0,s=[];++a<t;){var i=e[a],o=r?r(i):i;if(!a||!Wg(o,u)){var u=o;s[n++]=i===0?0:i}}return s}var Qg=zg,Xg=Qg;function Yg(e){return e&&e.length?Xg(e):[]}var Vg=Yg;const Zg=b.getDefaultExportFromCjs(Vg);class ma{constructor(){Ne(this,"config");this.config={api:{brand:"",cashierUrl:void 0,coinValueInCents:1,country:"",currency:"",game:"",gameHistoryUrl:"",homeUrl:void 0,integration:"",jurisdiction:"",playMode:"FUN",user:"",sessionId:"",lastRoundId:void 0},ui:{autoplay:{enabled:!1,rounds:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},lossLimit:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},winLimit:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},simple:!1,stopOnFeature:!1},cashier:{enabled:!1,balanceThreshold:[0]},feature:{allowTelemetry:!1,allowFullscreen:!1,allowQuickStop:!1,showCashier:!1,showClock:!1,showCloseGame:!1,showCurrency:!0,showFastPlay:!1,showFeatureBuy:!1,showFeatureIntro:!1,showFeatureOutro:!1,showFunModeBanner:!1,showHistory:!1,showLowWinCelebration:!1,showMaximumWin:!1,showNetPosition:!1,showPaylineLines:!1,showPaytable:!1,showRoundId:!1,showRtp:!1,showRules:!1,showSessionDuration:!1,showUi:!0},language:"en",maximumBet:void 0,minimumSpinDuration:0,requestTimeoutMs:1e4,realityCheck:{sessionDurationPeriodFormat:"minutes",showCloseGame:!1,showHistory:!1,showNetPosition:!1,showSessionDuration:!1,showSumBets:!1,showSumWins:!1},skipInsufficientFundsCheck:!1,skipSplash:!1}}}}var wa=(e=>(e.BG="BG",e.CA="CA",e.CO="CO",e.CW="CW",e.DE="DE",e.DK="DK",e.ES="ES",e.GR="GR",e.IM="IM",e.IT="IT",e.MT="MT",e.NL="NL",e.NOT_APPLICABLE="NOT_APPLICABLE",e.PT="PT",e.SE="SE",e.SK="SK",e.UK="UK",e.UNKNOWN="UNKNOWN",e.US="US",e.SOCIAL="SOCIAL",e))(wa||{});const kr={CA_BC:"CA",CA_ON:"CA",GER:"DE",HR:"ES",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"},Jg=e=>{const r=e&&e in wa,a=e&&e in kr;return!e||!(r||a)?"UNKNOWN":kr[e]??e};function ev(e,r){function a(t,{maxCount:n}){const s=u=>(u==null?void 0:u.filter(l=>l<=n))??[],i=u=>(u==null?void 0:u.map(l=>Number(l)))??[],o=[...t,n];return $s([i,s,qg,Zg])(o)}switch(r){case"BG":return{autoplay:{lossLimit:{enabled:!0,showNoLimit:!1},winLimit:{enabled:!0}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"CA":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:2.5};case"CO":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"DE":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:5};case"ES":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"GR":return{feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:3};case"IT":return{feature:{showPaylineLines:!0}};case"NL":return{autoplay:{enabled:!1},feature:{showFeatureBuy:!1}};case"PT":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"SE":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"UK":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:2.5};case"US":return{feature:{showPaylineLines:!0}};case"MT":return{feature:{showClock:!0}};case"SOCIAL":return{feature:{showGameHistory:!1}}}return{}}class rv extends ma{async getConfig(){let r=this.config.ui;const a=await this.fetchOperatorConfig();r=ce({},r,a);const t=new URLSearchParams(window.location.search),n=JSON.parse(t.get("badgeParameters")??"{}");r=ce({},r,n);const s=Jg(this.config.api.jurisdiction),i=ev(r,s);return r=ce({},r,i),r}get mappedIntegration(){const r=this.config.api.integration.toLowerCase(),a=this.config.api.brand.toLowerCase();if(r==="spinomenal"){if(a.startsWith("gg-"))return"groovegaming"}else if(r==="pariplay"){if(a.startsWith("8x1"))return"pariplay-8x1"}else{if(/openbox-.*/.test(r))return"openbox";if(/oryx-.*/.test(r))return"oryx";if(/relax-.*/.test(r))return"relax"}return r}get mappedBrand(){const r=this.config.api.integration.toLowerCase(),a=this.config.api.brand.toLowerCase();return r==="bspot"&&this.config.api.playMode.toLowerCase()==="fun"?"demo":a}mapUiConfig(r){return r?{autoplay:{enabled:r.badge.autoplayType!==5,rounds:{enabled:r.badge.autoplayType!==5,showNoLimit:!1,showCustomLimit:!1,options:r.badge.autoplayRounds??[5,10,25,75,100]},lossLimit:{enabled:r.badge.autoplayType===1||r.badge.autoplayType===4,showNoLimit:r.badge.autoplayType===1,showCustomLimit:!0,options:[5,25,50]},winLimit:{enabled:r.badge.autoplayType===1||r.badge.autoplayType===4,showNoLimit:!0,showCustomLimit:!0,options:[10,20,75]},simple:r.badge.autoplayType===3},cashier:{enabled:r.badge.showQuickDeposit,balanceThreshold:r.badge.quickDepositBalanceThresholds},feature:{allowTelemetry:!0,allowFullscreen:r.defaults.fullscreen==="true",allowQuickStop:r.badge.minimumSpinDuration===0,showCashier:r.badge.showQuickDeposit,showClock:r.badge.showClock,showCloseGame:r.badge.showCloseGameButton,showCurrency:r.badge.showCurrency,showFastPlay:r.badge.showTurboButton,showFeatureBuy:r.badge.showHyperBonus,showFunModeBanner:r.badge.showFunBanner,showHistory:r.badge.showGameHistory,showPaylineLines:r.badge.showPaylineLines,showRoundId:r.badge.showRoundId,showRules:r.badge.showGameRules,showSessionDuration:r.badge.realityCheckShowSessionDuration,showUi:r.badge.showGameUi},minimumSpinDuration:r.badge.minimumSpinDuration,requestTimeoutMs:r.badge.requestTimeoutMs,realityCheck:{sessionDurationPeriodFormat:r.badge.realityCheckPeriodFormat,showCloseGame:r.badge.realityCheckShowCloseGame,showHistory:r.badge.realityCheckShowHistoryLink,showNetPosition:r.badge.realityCheckShowNetGamingActivity,showSessionDuration:r.badge.realityCheckShowSessionDuration,showSumBets:r.badge.realityCheckShowSumBets,showSumWins:r.badge.realityCheckShowSumWins},skipInsufficientFundsCheck:r.badge.skipInsufficientFundsCheck,skipSplash:r.badge.loaderAutoContinue}:{}}async fetchOperatorConfig(){const r="https://awscdn.kalamba.net/games/games/build/",a=this.mappedIntegration,t=this.mappedBrand;let n={};try{n=await fetch(`${r}config/${a}/cage/${t}.json`).then(s=>s.json())}catch{try{n=await fetch(`${r}config/${a}/operator.json`).then(i=>i.json())}catch{n=await fetch(`${r}config/fun/operator.json`).then(o=>o.json())}}return this.mapUiConfig(n)}}exports.KalambaSdkConfigManager=rv;exports.KalambaSdkWrapper=Aa;exports.SdkConfigManager=ma;
|
|
5
|
+
"use strict";var Sa=Object.defineProperty;var Ta=(e,r,a)=>r in e?Sa(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a;var Ne=(e,r,a)=>(Ta(e,typeof r!="symbol"?r+"":r,a),a),je=(e,r,a)=>{if(!r.has(e))throw TypeError("Cannot "+a)};var _=(e,r,a)=>(je(e,r,"read from private field"),a?a.call(e):r.get(e)),L=(e,r,a)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,a)},U=(e,r,a,t)=>(je(e,r,"write to private field"),t?t.call(e,a):r.set(e,a),a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ue=require("./errors-358575c3.cjs"),b=require("./noop-b3c54b76.cjs"),Be=()=>{},Ca=()=>{};var E,ee,M,O,I;class Aa{constructor({messagePort:r,plugins:a,sdkConfigManager:t}){L(this,E,void 0);L(this,ee,void 0);L(this,M,{gameName:"UNKNOWN",gameVersion:"unknown",showErrors:!0,showFreeRounds:!0,showRealityCheck:!0,showBars:!0,skipErrors:[]});L(this,O,{balance:0,bet:{base:0,multiplier:0}});L(this,I,void 0);U(this,E,r),U(this,I,new t),U(this,ee,{rgs:new a.rgs(this.config,this.sdkConfig),casino:a.casino.map(n=>new n(this.config,this.sdkConfig)),telemetry:a.telemetry.map(({plugin:n,trackers:s})=>new n(s.map(i=>new i(this.config,this.sdkConfig)),this.config,this.sdkConfig))}),this.on("balance",({balance:n})=>{this.setState(s=>({...s,balance:n}))}),this.on("sdk:bet",n=>{this.setState(s=>({...s,bet:n}))}),this.on("sdk:playCycleStart",()=>{this.setState(n=>({...n,balance:n.balance-n.bet.base*n.bet.multiplier}))}),this.on("sdk:configure",n=>{Object.assign(_(this,M),n)}),this.on("rgs:openGameResponse",async n=>{this.setState(s=>({...s,openGameResponse:n,balance:n.contract.balance.coins})),this.sdkConfig.ui=await _(this,I).getConfig(),this.send("configured",this.sdkConfig)}),this.on("rgs:openGameError",async n=>{n.type==="timeout"&&!this.config.skipErrors.includes("TIMEOUT")&&this.send("error",{messageKey:"Error.TIMEOUT",messageCode:"TIMEOUT",type:"RELOAD"}),n.type==="error"&&!this.config.skipErrors.includes(n.data.code)&&this.send("error",{messageKey:`RgsError.${n.data.code}`,messageCode:n.data.code,type:Ue.RgsErrorAction[n.data.code]})}),this.on("rgs:playError",async n=>{n.type==="timeout"&&!this.config.skipErrors.includes("TIMEOUT")&&this.send("error",{messageKey:"Error.TIMEOUT",messageCode:"TIMEOUT",type:"RELOAD"}),n.type==="error"&&!this.config.skipErrors.includes(n.data.code)&&this.send("error",{messageKey:`RgsError.${n.data.code}`,messageCode:n.data.code,type:Ue.RgsErrorAction[n.data.code]})}),this.forwardMessages()}get state(){return _(this,O)}setState(r){U(this,O,r(_(this,O))),this.send("state",_(this,O))}forwardMessages(){this.forwardToPlugins("casino",["sdk:autoplay","sdk:balance","sdk:bet","sdk:cashier","sdk:choice","sdk:close","sdk:error","sdk:history","sdk:loadEnd","sdk:loadProgress","sdk:loadStart","sdk:openGame","sdk:play","sdk:playCycleEnd","sdk:playCycleStart","sdk:playEnd","sdk:playStart","sdk:settings"]),this.forwardToPlugins("casino",["rgs:playResponse","rgs:openGameResponse"]),this.forwardToPlugins("rgs",["sdk:openGame","sdk:play","sdk:history"]),this.forwardToPlugins("rgs",["casino:play","casino:cashier","casino:close","casino:history"]),this.forwardToPlugins("telemetry",["sdk:autoplay","sdk:error","sdk:playCycleStart","sdk:playCycleEnd","sdk:loadStart","sdk:loadProgress","sdk:loadEnd","sdk:telemetry.click","sdk:telemetry.orientationChange"]),this.forwardToPlugins("telemetry",["rgs:openGameResponse","rgs:playResponse"]),this.forwardToSdk(["casino:balance","casino:bet","casino:choice","casino:freeze","casino:help","casino:paytable","casino:resume","casino:settings","casino:suspend","casino:unfreeze"]),this.forwardToSdk(["rgs:openGameError","rgs:openGameResponse","rgs:playError","rgs:playResponse","rgs:realityCheck"])}get config(){const r=this;return new Proxy({},{get(a,t){return Reflect.get(_(r,M),t)},set(a,t,n){return Reflect.set(_(r,M),t,n)}})}get sdkConfig(){return _(this,I).config}forwardToPlugins(r,a){a.forEach(t=>{const n=s=>{s.data.message===`kalamba:${t}`&&(Be("wrapper:forwardToPlugins",r,s.data.message.replace(/^kalamba:/,""),s.data.payload),window.postMessage({message:`kalamba:wrapper-${r}:${t.replace(/^(.+):/,"")}`,payload:s.data.payload}))};window.addEventListener("message",n)})}forwardToSdk(r){r.forEach(a=>{const t=n=>{n.data.message===`kalamba:${a}`&&(Ca("wrapper:forwardToSdk",n.data.message.replace(/^kalamba:/,""),n.data.payload),_(this,E).postMessage({message:`kalamba:wrapper:${a.replace(/^(.+):/,"")}`,payload:n.data.payload},"*"))};window.addEventListener("message",t)})}on(r,a,t){const n=function s(i){!new RegExp(`^kalamba:${r.includes(":")?"":"(.+):"}${r}$`).test(i.data.message)||new RegExp(`^kalamba:wrapper-(.+):${r}`).test(i.data.message)||new RegExp(`^kalamba:(.+)-wrapper:${r}`).test(i.data.message)||(Be("on",i.data.message.replace(/^kalamba:/,""),i.data.payload),a(i.data.payload),t!=null&&t.once&&window.removeEventListener("message",s))};window.addEventListener("message",n)}send(r,...[a]){window.postMessage({message:`kalamba:wrapper:${r}`,payload:a}),_(this,E).postMessage({message:`kalamba:wrapper:${r}`,payload:a},"*")}}E=new WeakMap,ee=new WeakMap,M=new WeakMap,O=new WeakMap,I=new WeakMap;function Oa(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var w=Oa,Pa=w,Ke=Object.create,La=function(){function e(){}return function(r){if(!Pa(r))return{};if(Ke)return Ke(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}(),be=La;function Ea(){}var me=Ea,Ma=be,Ia=me;function z(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}z.prototype=Ma(Ia.prototype);z.prototype.constructor=z;var we=z;function Ra(e,r){for(var a=-1,t=r.length,n=e.length;++a<t;)e[n+a]=r[a];return e}var kr=Ra,Fa=typeof b.commonjsGlobal=="object"&&b.commonjsGlobal&&b.commonjsGlobal.Object===Object&&b.commonjsGlobal,Nr=Fa,xa=Nr,Da=typeof self=="object"&&self&&self.Object===Object&&self,Ga=xa||Da||Function("return this")(),$=Ga,ka=$,Na=ka.Symbol,K=Na,He=K,jr=Object.prototype,ja=jr.hasOwnProperty,Ua=jr.toString,B=He?He.toStringTag:void 0;function Ba(e){var r=ja.call(e,B),a=e[B];try{e[B]=void 0;var t=!0}catch{}var n=Ua.call(e);return t&&(r?e[B]=a:delete e[B]),n}var Ka=Ba,Ha=Object.prototype,qa=Ha.toString;function Wa(e){return qa.call(e)}var za=Wa,qe=K,Qa=Ka,Xa=za,Ya="[object Null]",Va="[object Undefined]",We=qe?qe.toStringTag:void 0;function Za(e){return e==null?e===void 0?Va:Ya:We&&We in Object(e)?Qa(e):Xa(e)}var R=Za;function Ja(e){return e!=null&&typeof e=="object"}var S=Ja,et=R,rt=S,at="[object Arguments]";function tt(e){return rt(e)&&et(e)==at}var nt=tt,ze=nt,st=S,Ur=Object.prototype,it=Ur.hasOwnProperty,ot=Ur.propertyIsEnumerable,ut=ze(function(){return arguments}())?ze:function(e){return st(e)&&it.call(e,"callee")&&!ot.call(e,"callee")},re=ut,lt=Array.isArray,d=lt,Qe=K,ft=re,ct=d,Xe=Qe?Qe.isConcatSpreadable:void 0;function pt(e){return ct(e)||ft(e)||!!(Xe&&e&&e[Xe])}var ht=pt,gt=kr,vt=ht;function Br(e,r,a,t,n){var s=-1,i=e.length;for(a||(a=vt),n||(n=[]);++s<i;){var o=e[s];r>0&&a(o)?r>1?Br(o,r-1,a,t,n):gt(n,o):t||(n[n.length]=o)}return n}var Kr=Br,dt=Kr;function yt(e){var r=e==null?0:e.length;return r?dt(e,1):[]}var _t=yt;function $t(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}var bt=$t,mt=bt,Ye=Math.max;function wt(e,r,a){return r=Ye(r===void 0?e.length-1:r,0),function(){for(var t=arguments,n=-1,s=Ye(t.length-r,0),i=Array(s);++n<s;)i[n]=t[r+n];n=-1;for(var o=Array(r+1);++n<r;)o[n]=t[n];return o[r]=a(i),mt(e,this,o)}}var Hr=wt;function St(e){return function(){return e}}var Tt=St,Ct=R,At=w,Ot="[object AsyncFunction]",Pt="[object Function]",Lt="[object GeneratorFunction]",Et="[object Proxy]";function Mt(e){if(!At(e))return!1;var r=Ct(e);return r==Pt||r==Lt||r==Ot||r==Et}var Se=Mt,It=$,Rt=It["__core-js_shared__"],Ft=Rt,le=Ft,Ve=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xt(e){return!!Ve&&Ve in e}var Dt=xt,Gt=Function.prototype,kt=Gt.toString;function Nt(e){if(e!=null){try{return kt.call(e)}catch{}try{return e+""}catch{}}return""}var qr=Nt,jt=Se,Ut=Dt,Bt=w,Kt=qr,Ht=/[\\^$.*+?()[\]{}|]/g,qt=/^\[object .+?Constructor\]$/,Wt=Function.prototype,zt=Object.prototype,Qt=Wt.toString,Xt=zt.hasOwnProperty,Yt=RegExp("^"+Qt.call(Xt).replace(Ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vt(e){if(!Bt(e)||Ut(e))return!1;var r=jt(e)?Yt:qt;return r.test(Kt(e))}var Zt=Vt;function Jt(e,r){return e==null?void 0:e[r]}var en=Jt,rn=Zt,an=en;function tn(e,r){var a=an(e,r);return rn(a)?a:void 0}var P=tn,nn=P,sn=function(){try{var e=nn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Wr=sn;function on(e){return e}var ae=on,un=Tt,Ze=Wr,ln=ae,fn=Ze?function(e,r){return Ze(e,"toString",{configurable:!0,enumerable:!1,value:un(r),writable:!0})}:ln,cn=fn,pn=800,hn=16,gn=Date.now;function vn(e){var r=0,a=0;return function(){var t=gn(),n=hn-(t-a);if(a=t,n>0){if(++r>=pn)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var dn=vn,yn=cn,_n=dn,$n=_n(yn),zr=$n,bn=_t,mn=Hr,wn=zr;function Sn(e){return wn(mn(e,void 0,bn),e+"")}var Tn=Sn,Cn=P,An=$,On=Cn(An,"WeakMap"),Qr=On,Je=Qr,Pn=Je&&new Je,Ln=Pn,er=Ln,En=b.noop_1,Mn=er?function(e){return er.get(e)}:En,Xr=Mn,In={},Rn=In,rr=Rn,Fn=Object.prototype,xn=Fn.hasOwnProperty;function Dn(e){for(var r=e.name+"",a=rr[r],t=xn.call(rr,r)?a.length:0;t--;){var n=a[t],s=n.func;if(s==null||s==e)return n.name}return r}var Yr=Dn,Gn=be,kn=me,Nn=4294967295;function Q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nn,this.__views__=[]}Q.prototype=Gn(kn.prototype);Q.prototype.constructor=Q;var Te=Q;function jn(e,r){var a=-1,t=e.length;for(r||(r=Array(t));++a<t;)r[a]=e[a];return r}var Vr=jn,Un=Te,Bn=we,Kn=Vr;function Hn(e){if(e instanceof Un)return e.clone();var r=new Bn(e.__wrapped__,e.__chain__);return r.__actions__=Kn(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var qn=Hn,Wn=Te,ar=we,zn=me,Qn=d,Xn=S,Yn=qn,Vn=Object.prototype,Zn=Vn.hasOwnProperty;function X(e){if(Xn(e)&&!Qn(e)&&!(e instanceof Wn)){if(e instanceof ar)return e;if(Zn.call(e,"__wrapped__"))return Yn(e)}return new ar(e)}X.prototype=zn.prototype;X.prototype.constructor=X;var Jn=X,es=Te,rs=Xr,as=Yr,ts=Jn;function ns(e){var r=as(e),a=ts[r];if(typeof a!="function"||!(r in es.prototype))return!1;if(e===a)return!0;var t=rs(a);return!!t&&e===t[0]}var ss=ns,tr=we,is=Tn,os=Xr,fe=Yr,us=d,nr=ss,ls="Expected a function",fs=8,cs=32,ps=128,hs=256;function gs(e){return is(function(r){var a=r.length,t=a,n=tr.prototype.thru;for(e&&r.reverse();t--;){var s=r[t];if(typeof s!="function")throw new TypeError(ls);if(n&&!i&&fe(s)=="wrapper")var i=new tr([],!0)}for(t=i?t:a;++t<a;){s=r[t];var o=fe(s),u=o=="wrapper"?os(s):void 0;u&&nr(u[0])&&u[1]==(ps|fs|cs|hs)&&!u[4].length&&u[9]==1?i=i[fe(u[0])].apply(i,u[3]):i=s.length==1&&nr(s)?i[o]():i.thru(s)}return function(){var l=arguments,f=l[0];if(i&&l.length==1&&us(f))return i.plant(f).value();for(var p=0,c=a?r[p].apply(this,l):f;++p<a;)c=r[p].call(this,c);return c}})}var vs=gs,ds=vs,ys=ds(),_s=ys;const $s=b.getDefaultExportFromCjs(_s);function bs(){this.__data__=[],this.size=0}var ms=bs;function ws(e,r){return e===r||e!==e&&r!==r}var F=ws,Ss=F;function Ts(e,r){for(var a=e.length;a--;)if(Ss(e[a][0],r))return a;return-1}var te=Ts,Cs=te,As=Array.prototype,Os=As.splice;function Ps(e){var r=this.__data__,a=Cs(r,e);if(a<0)return!1;var t=r.length-1;return a==t?r.pop():Os.call(r,a,1),--this.size,!0}var Ls=Ps,Es=te;function Ms(e){var r=this.__data__,a=Es(r,e);return a<0?void 0:r[a][1]}var Is=Ms,Rs=te;function Fs(e){return Rs(this.__data__,e)>-1}var xs=Fs,Ds=te;function Gs(e,r){var a=this.__data__,t=Ds(a,e);return t<0?(++this.size,a.push([e,r])):a[t][1]=r,this}var ks=Gs,Ns=ms,js=Ls,Us=Is,Bs=xs,Ks=ks;function x(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}x.prototype.clear=Ns;x.prototype.delete=js;x.prototype.get=Us;x.prototype.has=Bs;x.prototype.set=Ks;var ne=x,Hs=ne;function qs(){this.__data__=new Hs,this.size=0}var Ws=qs;function zs(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}var Qs=zs;function Xs(e){return this.__data__.get(e)}var Ys=Xs;function Vs(e){return this.__data__.has(e)}var Zs=Vs,Js=P,ei=$,ri=Js(ei,"Map"),Ce=ri,ai=P,ti=ai(Object,"create"),se=ti,sr=se;function ni(){this.__data__=sr?sr(null):{},this.size=0}var si=ni;function ii(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var oi=ii,ui=se,li="__lodash_hash_undefined__",fi=Object.prototype,ci=fi.hasOwnProperty;function pi(e){var r=this.__data__;if(ui){var a=r[e];return a===li?void 0:a}return ci.call(r,e)?r[e]:void 0}var hi=pi,gi=se,vi=Object.prototype,di=vi.hasOwnProperty;function yi(e){var r=this.__data__;return gi?r[e]!==void 0:di.call(r,e)}var _i=yi,$i=se,bi="__lodash_hash_undefined__";function mi(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=$i&&r===void 0?bi:r,this}var wi=mi,Si=si,Ti=oi,Ci=hi,Ai=_i,Oi=wi;function D(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}D.prototype.clear=Si;D.prototype.delete=Ti;D.prototype.get=Ci;D.prototype.has=Ai;D.prototype.set=Oi;var Pi=D,ir=Pi,Li=ne,Ei=Ce;function Mi(){this.size=0,this.__data__={hash:new ir,map:new(Ei||Li),string:new ir}}var Ii=Mi;function Ri(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Fi=Ri,xi=Fi;function Di(e,r){var a=e.__data__;return xi(r)?a[typeof r=="string"?"string":"hash"]:a.map}var ie=Di,Gi=ie;function ki(e){var r=Gi(this,e).delete(e);return this.size-=r?1:0,r}var Ni=ki,ji=ie;function Ui(e){return ji(this,e).get(e)}var Bi=Ui,Ki=ie;function Hi(e){return Ki(this,e).has(e)}var qi=Hi,Wi=ie;function zi(e,r){var a=Wi(this,e),t=a.size;return a.set(e,r),this.size+=a.size==t?0:1,this}var Qi=zi,Xi=Ii,Yi=Ni,Vi=Bi,Zi=qi,Ji=Qi;function G(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var t=e[r];this.set(t[0],t[1])}}G.prototype.clear=Xi;G.prototype.delete=Yi;G.prototype.get=Vi;G.prototype.has=Zi;G.prototype.set=Ji;var Ae=G,eo=ne,ro=Ce,ao=Ae,to=200;function no(e,r){var a=this.__data__;if(a instanceof eo){var t=a.__data__;if(!ro||t.length<to-1)return t.push([e,r]),this.size=++a.size,this;a=this.__data__=new ao(t)}return a.set(e,r),this.size=a.size,this}var so=no,io=ne,oo=Ws,uo=Qs,lo=Ys,fo=Zs,co=so;function k(e){var r=this.__data__=new io(e);this.size=r.size}k.prototype.clear=oo;k.prototype.delete=uo;k.prototype.get=lo;k.prototype.has=fo;k.prototype.set=co;var Oe=k,or=Wr;function po(e,r,a){r=="__proto__"&&or?or(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}var Pe=po,ho=Pe,go=F;function vo(e,r,a){(a!==void 0&&!go(e[r],a)||a===void 0&&!(r in e))&&ho(e,r,a)}var Zr=vo;function yo(e){return function(r,a,t){for(var n=-1,s=Object(r),i=t(r),o=i.length;o--;){var u=i[e?o:++n];if(a(s[u],u,s)===!1)break}return r}}var _o=yo,$o=_o,bo=$o(),Jr=bo,Y={exports:{}};Y.exports;(function(e,r){var a=$,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,i=s?a.Buffer:void 0,o=i?i.allocUnsafe:void 0;function u(l,f){if(f)return l.slice();var p=l.length,c=o?o(p):new l.constructor(p);return l.copy(c),c}e.exports=u})(Y,Y.exports);var mo=Y.exports,wo=$,So=wo.Uint8Array,ea=So,ur=ea;function To(e){var r=new e.constructor(e.byteLength);return new ur(r).set(new ur(e)),r}var Co=To,Ao=Co;function Oo(e,r){var a=r?Ao(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Po=Oo;function Lo(e,r){return function(a){return e(r(a))}}var ra=Lo,Eo=ra,Mo=Eo(Object.getPrototypeOf,Object),aa=Mo,Io=Object.prototype;function Ro(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||Io;return e===a}var Le=Ro,Fo=be,xo=aa,Do=Le;function Go(e){return typeof e.constructor=="function"&&!Do(e)?Fo(xo(e)):{}}var ko=Go,No=9007199254740991;function jo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=No}var Ee=jo,Uo=Se,Bo=Ee;function Ko(e){return e!=null&&Bo(e.length)&&!Uo(e)}var N=Ko,Ho=N,qo=S;function Wo(e){return qo(e)&&Ho(e)}var zo=Wo,V={exports:{}};function Qo(){return!1}var Xo=Qo;V.exports;(function(e,r){var a=$,t=Xo,n=r&&!r.nodeType&&r,s=n&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===n,o=i?a.Buffer:void 0,u=o?o.isBuffer:void 0,l=u||t;e.exports=l})(V,V.exports);var Me=V.exports,Yo=R,Vo=aa,Zo=S,Jo="[object Object]",eu=Function.prototype,ru=Object.prototype,ta=eu.toString,au=ru.hasOwnProperty,tu=ta.call(Object);function nu(e){if(!Zo(e)||Yo(e)!=Jo)return!1;var r=Vo(e);if(r===null)return!0;var a=au.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&ta.call(a)==tu}var su=nu,iu=R,ou=Ee,uu=S,lu="[object Arguments]",fu="[object Array]",cu="[object Boolean]",pu="[object Date]",hu="[object Error]",gu="[object Function]",vu="[object Map]",du="[object Number]",yu="[object Object]",_u="[object RegExp]",$u="[object Set]",bu="[object String]",mu="[object WeakMap]",wu="[object ArrayBuffer]",Su="[object DataView]",Tu="[object Float32Array]",Cu="[object Float64Array]",Au="[object Int8Array]",Ou="[object Int16Array]",Pu="[object Int32Array]",Lu="[object Uint8Array]",Eu="[object Uint8ClampedArray]",Mu="[object Uint16Array]",Iu="[object Uint32Array]",h={};h[Tu]=h[Cu]=h[Au]=h[Ou]=h[Pu]=h[Lu]=h[Eu]=h[Mu]=h[Iu]=!0;h[lu]=h[fu]=h[wu]=h[cu]=h[Su]=h[pu]=h[hu]=h[gu]=h[vu]=h[du]=h[yu]=h[_u]=h[$u]=h[bu]=h[mu]=!1;function Ru(e){return uu(e)&&ou(e.length)&&!!h[iu(e)]}var Fu=Ru;function xu(e){return function(r){return e(r)}}var na=xu,Z={exports:{}};Z.exports;(function(e,r){var a=Nr,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,i=s&&a.process,o=function(){try{var u=n&&n.require&&n.require("util").types;return u||i&&i.binding&&i.binding("util")}catch{}}();e.exports=o})(Z,Z.exports);var Du=Z.exports,Gu=Fu,ku=na,lr=Du,fr=lr&&lr.isTypedArray,Nu=fr?ku(fr):Gu,Ie=Nu;function ju(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var sa=ju,Uu=Pe,Bu=F,Ku=Object.prototype,Hu=Ku.hasOwnProperty;function qu(e,r,a){var t=e[r];(!(Hu.call(e,r)&&Bu(t,a))||a===void 0&&!(r in e))&&Uu(e,r,a)}var Wu=qu,zu=Wu,Qu=Pe;function Xu(e,r,a,t){var n=!a;a||(a={});for(var s=-1,i=r.length;++s<i;){var o=r[s],u=t?t(a[o],e[o],o,a,e):void 0;u===void 0&&(u=e[o]),n?Qu(a,o,u):zu(a,o,u)}return a}var Yu=Xu;function Vu(e,r){for(var a=-1,t=Array(e);++a<e;)t[a]=r(a);return t}var Zu=Vu,Ju=9007199254740991,el=/^(?:0|[1-9]\d*)$/;function rl(e,r){var a=typeof e;return r=r??Ju,!!r&&(a=="number"||a!="symbol"&&el.test(e))&&e>-1&&e%1==0&&e<r}var Re=rl,al=Zu,tl=re,nl=d,sl=Me,il=Re,ol=Ie,ul=Object.prototype,ll=ul.hasOwnProperty;function fl(e,r){var a=nl(e),t=!a&&tl(e),n=!a&&!t&&sl(e),s=!a&&!t&&!n&&ol(e),i=a||t||n||s,o=i?al(e.length,String):[],u=o.length;for(var l in e)(r||ll.call(e,l))&&!(i&&(l=="length"||n&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||il(l,u)))&&o.push(l);return o}var ia=fl;function cl(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var pl=cl,hl=w,gl=Le,vl=pl,dl=Object.prototype,yl=dl.hasOwnProperty;function _l(e){if(!hl(e))return vl(e);var r=gl(e),a=[];for(var t in e)t=="constructor"&&(r||!yl.call(e,t))||a.push(t);return a}var $l=_l,bl=ia,ml=$l,wl=N;function Sl(e){return wl(e)?bl(e,!0):ml(e)}var oa=Sl,Tl=Yu,Cl=oa;function Al(e){return Tl(e,Cl(e))}var Ol=Al,cr=Zr,Pl=mo,Ll=Po,El=Vr,Ml=ko,pr=re,hr=d,Il=zo,Rl=Me,Fl=Se,xl=w,Dl=su,Gl=Ie,gr=sa,kl=Ol;function Nl(e,r,a,t,n,s,i){var o=gr(e,a),u=gr(r,a),l=i.get(u);if(l){cr(e,a,l);return}var f=s?s(o,u,a+"",e,r,i):void 0,p=f===void 0;if(p){var c=hr(u),v=!c&&Rl(u),g=!c&&!v&&Gl(u);f=u,c||v||g?hr(o)?f=o:Il(o)?f=El(o):v?(p=!1,f=Pl(u,!0)):g?(p=!1,f=Ll(u,!0)):f=[]:Dl(u)||pr(u)?(f=o,pr(o)?f=kl(o):(!xl(o)||Fl(o))&&(f=Ml(u))):p=!1}p&&(i.set(u,f),n(f,u,t,s,i),i.delete(u)),cr(e,a,f)}var jl=Nl,Ul=Oe,Bl=Zr,Kl=Jr,Hl=jl,ql=w,Wl=oa,zl=sa;function ua(e,r,a,t,n){e!==r&&Kl(r,function(s,i){if(n||(n=new Ul),ql(s))Hl(e,r,i,a,ua,t,n);else{var o=t?t(zl(e,i),s,i+"",e,r,n):void 0;o===void 0&&(o=s),Bl(e,i,o)}},Wl)}var Ql=ua,Xl=ae,Yl=Hr,Vl=zr;function Zl(e,r){return Vl(Yl(e,r,Xl),e+"")}var la=Zl,Jl=F,ef=N,rf=Re,af=w;function tf(e,r,a){if(!af(a))return!1;var t=typeof r;return(t=="number"?ef(a)&&rf(r,a.length):t=="string"&&r in a)?Jl(a[r],e):!1}var fa=tf,nf=la,sf=fa;function of(e){return nf(function(r,a){var t=-1,n=a.length,s=n>1?a[n-1]:void 0,i=n>2?a[2]:void 0;for(s=e.length>3&&typeof s=="function"?(n--,s):void 0,i&&sf(a[0],a[1],i)&&(s=n<3?void 0:s,n=1),r=Object(r);++t<n;){var o=a[t];o&&e(r,o,t,s)}return r})}var uf=of,lf=Ql,ff=uf,cf=ff(function(e,r,a){lf(e,r,a)}),pf=cf;const ce=b.getDefaultExportFromCjs(pf);function hf(e,r){for(var a=-1,t=e==null?0:e.length,n=Array(t);++a<t;)n[a]=r(e[a],a,e);return n}var ca=hf,gf=R,vf=S,df="[object Symbol]";function yf(e){return typeof e=="symbol"||vf(e)&&gf(e)==df}var oe=yf,_f=d,$f=oe,bf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mf=/^\w*$/;function wf(e,r){if(_f(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||$f(e)?!0:mf.test(e)||!bf.test(e)||r!=null&&e in Object(r)}var Fe=wf,pa=Ae,Sf="Expected a function";function xe(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Sf);var a=function(){var t=arguments,n=r?r.apply(this,t):t[0],s=a.cache;if(s.has(n))return s.get(n);var i=e.apply(this,t);return a.cache=s.set(n,i)||s,i};return a.cache=new(xe.Cache||pa),a}xe.Cache=pa;var Tf=xe,Cf=Tf,Af=500;function Of(e){var r=Cf(e,function(t){return a.size===Af&&a.clear(),t}),a=r.cache;return r}var Pf=Of,Lf=Pf,Ef=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mf=/\\(\\)?/g,If=Lf(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Ef,function(a,t,n,s){r.push(n?s.replace(Mf,"$1"):t||a)}),r}),Rf=If,vr=K,Ff=ca,xf=d,Df=oe,Gf=1/0,dr=vr?vr.prototype:void 0,yr=dr?dr.toString:void 0;function ha(e){if(typeof e=="string")return e;if(xf(e))return Ff(e,ha)+"";if(Df(e))return yr?yr.call(e):"";var r=e+"";return r=="0"&&1/e==-Gf?"-0":r}var kf=ha,Nf=kf;function jf(e){return e==null?"":Nf(e)}var Uf=jf,Bf=d,Kf=Fe,Hf=Rf,qf=Uf;function Wf(e,r){return Bf(e)?e:Kf(e,r)?[e]:Hf(qf(e))}var ga=Wf,zf=oe,Qf=1/0;function Xf(e){if(typeof e=="string"||zf(e))return e;var r=e+"";return r=="0"&&1/e==-Qf?"-0":r}var ue=Xf,Yf=ga,Vf=ue;function Zf(e,r){r=Yf(r,e);for(var a=0,t=r.length;e!=null&&a<t;)e=e[Vf(r[a++])];return a&&a==t?e:void 0}var De=Zf,Jf="__lodash_hash_undefined__";function ec(e){return this.__data__.set(e,Jf),this}var rc=ec;function ac(e){return this.__data__.has(e)}var tc=ac,nc=Ae,sc=rc,ic=tc;function J(e){var r=-1,a=e==null?0:e.length;for(this.__data__=new nc;++r<a;)this.add(e[r])}J.prototype.add=J.prototype.push=sc;J.prototype.has=ic;var oc=J;function uc(e,r){for(var a=-1,t=e==null?0:e.length;++a<t;)if(r(e[a],a,e))return!0;return!1}var lc=uc;function fc(e,r){return e.has(r)}var cc=fc,pc=oc,hc=lc,gc=cc,vc=1,dc=2;function yc(e,r,a,t,n,s){var i=a&vc,o=e.length,u=r.length;if(o!=u&&!(i&&u>o))return!1;var l=s.get(e),f=s.get(r);if(l&&f)return l==r&&f==e;var p=-1,c=!0,v=a&dc?new pc:void 0;for(s.set(e,r),s.set(r,e);++p<o;){var g=e[p],y=r[p];if(t)var m=i?t(y,g,p,r,e,s):t(g,y,p,e,r,s);if(m!==void 0){if(m)continue;c=!1;break}if(v){if(!hc(r,function(T,C){if(!gc(v,C)&&(g===T||n(g,T,a,t,s)))return v.push(C)})){c=!1;break}}else if(!(g===y||n(g,y,a,t,s))){c=!1;break}}return s.delete(e),s.delete(r),c}var va=yc;function _c(e){var r=-1,a=Array(e.size);return e.forEach(function(t,n){a[++r]=[n,t]}),a}var $c=_c;function bc(e){var r=-1,a=Array(e.size);return e.forEach(function(t){a[++r]=t}),a}var mc=bc,_r=K,$r=ea,wc=F,Sc=va,Tc=$c,Cc=mc,Ac=1,Oc=2,Pc="[object Boolean]",Lc="[object Date]",Ec="[object Error]",Mc="[object Map]",Ic="[object Number]",Rc="[object RegExp]",Fc="[object Set]",xc="[object String]",Dc="[object Symbol]",Gc="[object ArrayBuffer]",kc="[object DataView]",br=_r?_r.prototype:void 0,pe=br?br.valueOf:void 0;function Nc(e,r,a,t,n,s,i){switch(a){case kc:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case Gc:return!(e.byteLength!=r.byteLength||!s(new $r(e),new $r(r)));case Pc:case Lc:case Ic:return wc(+e,+r);case Ec:return e.name==r.name&&e.message==r.message;case Rc:case xc:return e==r+"";case Mc:var o=Tc;case Fc:var u=t&Ac;if(o||(o=Cc),e.size!=r.size&&!u)return!1;var l=i.get(e);if(l)return l==r;t|=Oc,i.set(e,r);var f=Sc(o(e),o(r),t,n,s,i);return i.delete(e),f;case Dc:if(pe)return pe.call(e)==pe.call(r)}return!1}var jc=Nc,Uc=kr,Bc=d;function Kc(e,r,a){var t=r(e);return Bc(e)?t:Uc(t,a(e))}var Hc=Kc;function qc(e,r){for(var a=-1,t=e==null?0:e.length,n=0,s=[];++a<t;){var i=e[a];r(i,a,e)&&(s[n++]=i)}return s}var Wc=qc;function zc(){return[]}var Qc=zc,Xc=Wc,Yc=Qc,Vc=Object.prototype,Zc=Vc.propertyIsEnumerable,mr=Object.getOwnPropertySymbols,Jc=mr?function(e){return e==null?[]:(e=Object(e),Xc(mr(e),function(r){return Zc.call(e,r)}))}:Yc,ep=Jc,rp=ra,ap=rp(Object.keys,Object),tp=ap,np=Le,sp=tp,ip=Object.prototype,op=ip.hasOwnProperty;function up(e){if(!np(e))return sp(e);var r=[];for(var a in Object(e))op.call(e,a)&&a!="constructor"&&r.push(a);return r}var lp=up,fp=ia,cp=lp,pp=N;function hp(e){return pp(e)?fp(e):cp(e)}var Ge=hp,gp=Hc,vp=ep,dp=Ge;function yp(e){return gp(e,dp,vp)}var _p=yp,wr=_p,$p=1,bp=Object.prototype,mp=bp.hasOwnProperty;function wp(e,r,a,t,n,s){var i=a&$p,o=wr(e),u=o.length,l=wr(r),f=l.length;if(u!=f&&!i)return!1;for(var p=u;p--;){var c=o[p];if(!(i?c in r:mp.call(r,c)))return!1}var v=s.get(e),g=s.get(r);if(v&&g)return v==r&&g==e;var y=!0;s.set(e,r),s.set(r,e);for(var m=i;++p<u;){c=o[p];var T=e[c],C=r[c];if(t)var ke=i?t(C,T,c,r,e,s):t(T,C,c,e,r,s);if(!(ke===void 0?T===C||n(T,C,a,t,s):ke)){y=!1;break}m||(m=c=="constructor")}if(y&&!m){var H=e.constructor,q=r.constructor;H!=q&&"constructor"in e&&"constructor"in r&&!(typeof H=="function"&&H instanceof H&&typeof q=="function"&&q instanceof q)&&(y=!1)}return s.delete(e),s.delete(r),y}var Sp=wp,Tp=P,Cp=$,Ap=Tp(Cp,"DataView"),Op=Ap,Pp=P,Lp=$,Ep=Pp(Lp,"Promise"),Mp=Ep,Ip=P,Rp=$,Fp=Ip(Rp,"Set"),xp=Fp,ve=Op,de=Ce,ye=Mp,_e=xp,$e=Qr,da=R,j=qr,Sr="[object Map]",Dp="[object Object]",Tr="[object Promise]",Cr="[object Set]",Ar="[object WeakMap]",Or="[object DataView]",Gp=j(ve),kp=j(de),Np=j(ye),jp=j(_e),Up=j($e),A=da;(ve&&A(new ve(new ArrayBuffer(1)))!=Or||de&&A(new de)!=Sr||ye&&A(ye.resolve())!=Tr||_e&&A(new _e)!=Cr||$e&&A(new $e)!=Ar)&&(A=function(e){var r=da(e),a=r==Dp?e.constructor:void 0,t=a?j(a):"";if(t)switch(t){case Gp:return Or;case kp:return Sr;case Np:return Tr;case jp:return Cr;case Up:return Ar}return r});var Bp=A,he=Oe,Kp=va,Hp=jc,qp=Sp,Pr=Bp,Lr=d,Er=Me,Wp=Ie,zp=1,Mr="[object Arguments]",Ir="[object Array]",W="[object Object]",Qp=Object.prototype,Rr=Qp.hasOwnProperty;function Xp(e,r,a,t,n,s){var i=Lr(e),o=Lr(r),u=i?Ir:Pr(e),l=o?Ir:Pr(r);u=u==Mr?W:u,l=l==Mr?W:l;var f=u==W,p=l==W,c=u==l;if(c&&Er(e)){if(!Er(r))return!1;i=!0,f=!1}if(c&&!f)return s||(s=new he),i||Wp(e)?Kp(e,r,a,t,n,s):Hp(e,r,u,a,t,n,s);if(!(a&zp)){var v=f&&Rr.call(e,"__wrapped__"),g=p&&Rr.call(r,"__wrapped__");if(v||g){var y=v?e.value():e,m=g?r.value():r;return s||(s=new he),n(y,m,a,t,s)}}return c?(s||(s=new he),qp(e,r,a,t,n,s)):!1}var Yp=Xp,Vp=Yp,Fr=S;function ya(e,r,a,t,n){return e===r?!0:e==null||r==null||!Fr(e)&&!Fr(r)?e!==e&&r!==r:Vp(e,r,a,t,ya,n)}var _a=ya,Zp=Oe,Jp=_a,eh=1,rh=2;function ah(e,r,a,t){var n=a.length,s=n,i=!t;if(e==null)return!s;for(e=Object(e);n--;){var o=a[n];if(i&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++n<s;){o=a[n];var u=o[0],l=e[u],f=o[1];if(i&&o[2]){if(l===void 0&&!(u in e))return!1}else{var p=new Zp;if(t)var c=t(l,f,u,e,r,p);if(!(c===void 0?Jp(f,l,eh|rh,t,p):c))return!1}}return!0}var th=ah,nh=w;function sh(e){return e===e&&!nh(e)}var $a=sh,ih=$a,oh=Ge;function uh(e){for(var r=oh(e),a=r.length;a--;){var t=r[a],n=e[t];r[a]=[t,n,ih(n)]}return r}var lh=uh;function fh(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==void 0||e in Object(a))}}var ba=fh,ch=th,ph=lh,hh=ba;function gh(e){var r=ph(e);return r.length==1&&r[0][2]?hh(r[0][0],r[0][1]):function(a){return a===e||ch(a,e,r)}}var vh=gh,dh=De;function yh(e,r,a){var t=e==null?void 0:dh(e,r);return t===void 0?a:t}var _h=yh;function $h(e,r){return e!=null&&r in Object(e)}var bh=$h,mh=ga,wh=re,Sh=d,Th=Re,Ch=Ee,Ah=ue;function Oh(e,r,a){r=mh(r,e);for(var t=-1,n=r.length,s=!1;++t<n;){var i=Ah(r[t]);if(!(s=e!=null&&a(e,i)))break;e=e[i]}return s||++t!=n?s:(n=e==null?0:e.length,!!n&&Ch(n)&&Th(i,n)&&(Sh(e)||wh(e)))}var Ph=Oh,Lh=bh,Eh=Ph;function Mh(e,r){return e!=null&&Eh(e,r,Lh)}var Ih=Mh,Rh=_a,Fh=_h,xh=Ih,Dh=Fe,Gh=$a,kh=ba,Nh=ue,jh=1,Uh=2;function Bh(e,r){return Dh(e)&&Gh(r)?kh(Nh(e),r):function(a){var t=Fh(a,e);return t===void 0&&t===r?xh(a,e):Rh(r,t,jh|Uh)}}var Kh=Bh;function Hh(e){return function(r){return r==null?void 0:r[e]}}var qh=Hh,Wh=De;function zh(e){return function(r){return Wh(r,e)}}var Qh=zh,Xh=qh,Yh=Qh,Vh=Fe,Zh=ue;function Jh(e){return Vh(e)?Xh(Zh(e)):Yh(e)}var eg=Jh,rg=vh,ag=Kh,tg=ae,ng=d,sg=eg;function ig(e){return typeof e=="function"?e:e==null?tg:typeof e=="object"?ng(e)?ag(e[0],e[1]):rg(e):sg(e)}var og=ig,ug=Jr,lg=Ge;function fg(e,r){return e&&ug(e,r,lg)}var cg=fg,pg=N;function hg(e,r){return function(a,t){if(a==null)return a;if(!pg(a))return e(a,t);for(var n=a.length,s=r?n:-1,i=Object(a);(r?s--:++s<n)&&t(i[s],s,i)!==!1;);return a}}var gg=hg,vg=cg,dg=gg,yg=dg(vg),_g=yg,$g=_g,bg=N;function mg(e,r){var a=-1,t=bg(e)?Array(e.length):[];return $g(e,function(n,s,i){t[++a]=r(n,s,i)}),t}var wg=mg;function Sg(e,r){var a=e.length;for(e.sort(r);a--;)e[a]=e[a].value;return e}var Tg=Sg,xr=oe;function Cg(e,r){if(e!==r){var a=e!==void 0,t=e===null,n=e===e,s=xr(e),i=r!==void 0,o=r===null,u=r===r,l=xr(r);if(!o&&!l&&!s&&e>r||s&&i&&u&&!o&&!l||t&&i&&u||!a&&u||!n)return 1;if(!t&&!s&&!l&&e<r||l&&a&&n&&!t&&!s||o&&a&&n||!i&&n||!u)return-1}return 0}var Ag=Cg,Og=Ag;function Pg(e,r,a){for(var t=-1,n=e.criteria,s=r.criteria,i=n.length,o=a.length;++t<i;){var u=Og(n[t],s[t]);if(u){if(t>=o)return u;var l=a[t];return u*(l=="desc"?-1:1)}}return e.index-r.index}var Lg=Pg,ge=ca,Eg=De,Mg=og,Ig=wg,Rg=Tg,Fg=na,xg=Lg,Dg=ae,Gg=d;function kg(e,r,a){r.length?r=ge(r,function(s){return Gg(s)?function(i){return Eg(i,s.length===1?s[0]:s)}:s}):r=[Dg];var t=-1;r=ge(r,Fg(Mg));var n=Ig(e,function(s,i,o){var u=ge(r,function(l){return l(s)});return{criteria:u,index:++t,value:s}});return Rg(n,function(s,i){return xg(s,i,a)})}var Ng=kg,jg=Kr,Ug=Ng,Bg=la,Dr=fa,Kg=Bg(function(e,r){if(e==null)return[];var a=r.length;return a>1&&Dr(e,r[0],r[1])?r=[]:a>2&&Dr(r[0],r[1],r[2])&&(r=[r[0]]),Ug(e,jg(r,1),[])}),Hg=Kg;const qg=b.getDefaultExportFromCjs(Hg);var Wg=F;function zg(e,r){for(var a=-1,t=e.length,n=0,s=[];++a<t;){var i=e[a],o=r?r(i):i;if(!a||!Wg(o,u)){var u=o;s[n++]=i===0?0:i}}return s}var Qg=zg,Xg=Qg;function Yg(e){return e&&e.length?Xg(e):[]}var Vg=Yg;const Zg=b.getDefaultExportFromCjs(Vg);class ma{constructor(){Ne(this,"config");this.config={api:{brand:"",cashierUrl:void 0,coinValueInCents:1,country:"",currency:"",game:"",gameHistoryUrl:"",homeUrl:void 0,integration:"",jurisdiction:"",playMode:"FUN",user:"",sessionId:"",lastRoundId:void 0},ui:{autoplay:{enabled:!1,rounds:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},lossLimit:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},winLimit:{enabled:!1,showNoLimit:!1,showCustomLimit:!1,options:[]},simple:!1,stopOnFeature:!1},cashier:{enabled:!1,balanceThreshold:[0]},feature:{allowTelemetry:!1,allowFullscreen:!1,allowQuickStop:!1,showCashier:!1,showClock:!1,showCloseGame:!1,showCurrency:!0,showFastPlay:!1,showFeatureBuy:!1,showFeatureIntro:!1,showFeatureOutro:!1,showFunModeBanner:!1,showHistory:!1,showLowWinCelebration:!1,showMaximumWin:!1,showNetPosition:!1,showPaylineLines:!1,showPaytable:!1,showRoundId:!1,showRtp:!1,showRules:!1,showSessionDuration:!1,showUi:!0},language:"en",maximumBet:void 0,minimumSpinDuration:0,requestTimeoutMs:1e4,incompleteGameResolution:{type:"NONE"},realityCheck:{sessionDurationPeriodFormat:"minutes",showCloseGame:!1,showHistory:!1,showNetPosition:!1,showSessionDuration:!1,showSumBets:!1,showSumWins:!1},skipInsufficientFundsCheck:!1,skipSplash:!1}}}}var wa=(e=>(e.BG="BG",e.CA="CA",e.CO="CO",e.CW="CW",e.DE="DE",e.DK="DK",e.ES="ES",e.GR="GR",e.IM="IM",e.IT="IT",e.MT="MT",e.NL="NL",e.NOT_APPLICABLE="NOT_APPLICABLE",e.PT="PT",e.SE="SE",e.SK="SK",e.UK="UK",e.UNKNOWN="UNKNOWN",e.US="US",e.SOCIAL="SOCIAL",e))(wa||{});const Gr={CA_BC:"CA",CA_ON:"CA",GER:"DE",HR:"ES",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"},Jg=e=>{const r=e&&e in wa,a=e&&e in Gr;return!e||!(r||a)?"UNKNOWN":Gr[e]??e};function ev(e,r){function a(t,{maxCount:n}){const s=u=>(u==null?void 0:u.filter(l=>l<=n))??[],i=u=>(u==null?void 0:u.map(l=>Number(l)))??[],o=[...t,n];return $s([i,s,qg,Zg])(o)}switch(r){case"BG":return{autoplay:{lossLimit:{enabled:!0,showNoLimit:!1},winLimit:{enabled:!0}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"CA":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:2.5};case"CO":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"DE":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:5};case"ES":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"GR":return{feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:3};case"IT":return{feature:{showPaylineLines:!0}};case"NL":return{autoplay:{enabled:!1},feature:{showFeatureBuy:!1}};case"PT":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"SE":return{autoplay:{rounds:{showNoLimit:!1,showCustomLimit:!1,options:a(e.autoplay.rounds.options,{maxCount:100})}},feature:{showFastPlay:!1,allowQuickStop:!1},minimumSpinDuration:3};case"UK":return{autoplay:{enabled:!1},feature:{showFastPlay:!1,allowQuickStop:!1,showFeatureBuy:!1},minimumSpinDuration:2.5};case"US":return{feature:{showPaylineLines:!0}};case"MT":return{feature:{showClock:!0}};case"SOCIAL":return{feature:{showGameHistory:!1}}}return{}}class rv extends ma{async getConfig(){let r=this.config.ui;const a=await this.fetchOperatorConfig();r=ce({},r,a);const t=new URLSearchParams(window.location.search),n=JSON.parse(t.get("badgeParameters")??"{}");r=ce({},r,n);const s=Jg(this.config.api.jurisdiction),i=ev(r,s);return r=ce({},r,i),r}get mappedIntegration(){const r=this.config.api.integration.toLowerCase(),a=this.config.api.brand.toLowerCase();if(r==="spinomenal"){if(a.startsWith("gg-"))return"groovegaming"}else if(r==="pariplay"){if(a.startsWith("8x1"))return"pariplay-8x1"}else{if(/openbox-.*/.test(r))return"openbox";if(/oryx-.*/.test(r))return"oryx";if(/relax-.*/.test(r))return"relax"}return r}get mappedBrand(){const r=this.config.api.integration.toLowerCase(),a=this.config.api.brand.toLowerCase();return r==="bspot"&&this.config.api.playMode.toLowerCase()==="fun"?"demo":a}mapUiConfig(r){return r?{autoplay:{enabled:r.badge.autoplayType!==5,rounds:{enabled:r.badge.autoplayType!==5,showNoLimit:!1,showCustomLimit:!1,options:r.badge.autoplayRounds??[5,10,25,75,100]},lossLimit:{enabled:r.badge.autoplayType===1||r.badge.autoplayType===4,showNoLimit:r.badge.autoplayType===1,showCustomLimit:r.badge.autoplayType!==6,options:[5,25,50]},winLimit:{enabled:r.badge.autoplayType===1||r.badge.autoplayType===4,showNoLimit:!0,showCustomLimit:r.badge.autoplayType!==6,options:[10,20,75]},simple:r.badge.autoplayType===3},cashier:{enabled:r.badge.showQuickDeposit,balanceThreshold:r.badge.quickDepositBalanceThresholds},feature:{allowTelemetry:!0,allowFullscreen:r.defaults.fullscreen==="true",allowQuickStop:r.badge.minimumSpinDuration===0,showCashier:r.badge.showQuickDeposit,showClock:r.badge.showClock,showCloseGame:r.badge.showCloseGameButton,showCurrency:r.badge.showCurrency,showFastPlay:r.badge.showTurboButton,showFeatureBuy:r.badge.showHyperBonus,showFunModeBanner:r.badge.showFunBanner,showHistory:r.badge.showGameHistory,showPaylineLines:r.badge.showPaylineLines,showRoundId:r.badge.showRoundId,showRules:r.badge.showGameRules,showSessionDuration:r.badge.realityCheckShowSessionDuration,showUi:r.badge.showGameUi},minimumSpinDuration:r.badge.minimumSpinDuration,requestTimeoutMs:r.badge.requestTimeoutMs,incompleteGameResolution:{daysToAutoResolution:r.badge.incompleteGamesResolutionType===3?r.badge.daysToAutoResolution??90:void 0,type:r.badge.incompleteGamesResolutionType===2?"MANUAL":r.badge.incompleteGamesResolutionType===3?"AUTOMATIC":void 0},realityCheck:{sessionDurationPeriodFormat:r.badge.realityCheckPeriodFormat,showCloseGame:r.badge.realityCheckShowCloseGame,showHistory:r.badge.realityCheckShowHistoryLink,showNetPosition:r.badge.realityCheckShowNetGamingActivity,showSessionDuration:r.badge.realityCheckShowSessionDuration,showSumBets:r.badge.realityCheckShowSumBets,showSumWins:r.badge.realityCheckShowSumWins},skipInsufficientFundsCheck:r.badge.skipInsufficientFundsCheck,skipSplash:r.badge.loaderAutoContinue}:{}}async fetchOperatorConfig(){const r="https://awscdn.kalamba.net/games/games/build/",a=this.mappedIntegration,t=this.mappedBrand;let n={};try{n=await fetch(`${r}config/${a}/cage/${t}.json`).then(s=>s.json())}catch{try{n=await fetch(`${r}config/${a}/operator.json`).then(i=>i.json())}catch{n=await fetch(`${r}config/fun/operator.json`).then(o=>o.json())}}return this.mapUiConfig(n)}}exports.KalambaSdkConfigManager=rv;exports.KalambaSdkWrapper=Aa;exports.SdkConfigManager=ma;
|
package/dist/wrapper.d.ts
CHANGED
|
@@ -111,6 +111,7 @@ export declare class KalambaSdkWrapper {
|
|
|
111
111
|
plugins: Plugins;
|
|
112
112
|
sdkConfigManager: new (...args: ConstructorParameters<typeof SdkConfigManager>) => SdkConfigManager;
|
|
113
113
|
});
|
|
114
|
+
get state(): WrapperState;
|
|
114
115
|
setState(setter: (currentState: WrapperState) => WrapperState): void;
|
|
115
116
|
forwardMessages(): void;
|
|
116
117
|
get config(): WrapperConfig;
|
|
@@ -352,6 +353,12 @@ declare interface SdkConfig {
|
|
|
352
353
|
maximumBet?: number;
|
|
353
354
|
minimumSpinDuration: number;
|
|
354
355
|
requestTimeoutMs: number;
|
|
356
|
+
incompleteGameResolution: {
|
|
357
|
+
type: 'NONE' | 'MANUAL';
|
|
358
|
+
} | {
|
|
359
|
+
daysToAutoResolution: number;
|
|
360
|
+
type: 'AUTOMATIC';
|
|
361
|
+
};
|
|
355
362
|
realityCheck: RealityCheckConfig;
|
|
356
363
|
skipInsufficientFundsCheck: boolean;
|
|
357
364
|
skipSplash: boolean;
|
|
@@ -429,6 +436,9 @@ declare type SdkOnlyMessagePayloadMap = {
|
|
|
429
436
|
name: string;
|
|
430
437
|
};
|
|
431
438
|
'telemetry.orientationChange': never;
|
|
439
|
+
freeRoundsOffer: any;
|
|
440
|
+
freeRoundsInfo: any;
|
|
441
|
+
freeRoundsComplete: any;
|
|
432
442
|
};
|
|
433
443
|
|
|
434
444
|
declare type Settings = {
|