@getenginex/sdk-igaming 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,106 +1,16 @@
1
+ import { createClubApi, LOCALE, rejectInput, pageInputProblem, nonNegativeMinorUnits, optionalTimestamp, nullableList, protoEnum, optionalText, currencyOrEmpty, minorUnits, integerText, list, text, count, durationSeconds } from './chunk-LMBQDSFV.js';
2
+ export { keepsClubIdempotencyKey } from './chunk-LMBQDSFV.js';
1
3
  import { EnginexError } from '@getenginex/sdk';
2
4
  import * as extension from '@getenginex/sdk/extension';
3
- import { lazy, wire, decimalPlaces, currencyCode, money as money$1, strictValue, moneyText } from '@getenginex/sdk/extension';
4
- import * as z4 from 'zod/mini';
5
+ import { lazy, wire, decimalPlaces, currencyCode, money as money$1 } from '@getenginex/sdk/extension';
6
+ import * as z2 from 'zod/mini';
5
7
 
6
- // src/client.ts
7
-
8
- // src/internal/input.ts
9
- function rejectInput(transport, message, route) {
10
- return Promise.reject(
11
- transport.reportError({ code: "CONFIGURATION_ERROR", message, status: 0 }, { ...route, attempt: 0 })
12
- );
13
- }
14
- function pageInputProblem(name, input) {
15
- if (input === void 0) return void 0;
16
- if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be an object.`;
17
- const { page, perPage } = input;
18
- if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
19
- return `${name}: page must be an integer \u2265 1.`;
20
- if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > 100))
21
- return `${name}: perPage must be an integer from 1 to 100.`;
22
- return void 0;
23
- }
24
- function optionalTimestamp() {
25
- return z4.pipe(
26
- z4.nullish(z4.string().check(z4.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
27
- z4.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
28
- );
29
- }
30
- function optionalText() {
31
- return z4.pipe(
32
- z4.nullish(z4.string()),
33
- z4.transform((value) => value == null || value === "" ? null : value)
34
- );
35
- }
36
- function nullableList(item) {
37
- return z4.pipe(
38
- z4.nullish(z4.array(item)),
39
- z4.transform((value) => value ?? [])
40
- );
41
- }
42
- function protoEnum(prefix) {
43
- return z4.pipe(
44
- z4.optional(z4.union([z4.string(), z4.number()])),
45
- z4.transform((value) => {
46
- if (value === void 0 || value === 0) return "unspecified";
47
- if (typeof value === "number") return String(value);
48
- return (value.startsWith(prefix) ? value.slice(prefix.length) : value).toLowerCase();
49
- })
50
- );
51
- }
52
- function minorUnits() {
53
- return moneyText();
54
- }
55
- function currencyOrEmpty() {
56
- return currencyCode({ allowEmpty: true });
57
- }
58
- var NON_NEGATIVE_MONEY = "Expected money in minor units: a non-negative integer within the safe range of number";
59
- function nonNegativeMinorUnits() {
60
- return z4.pipe(
61
- strictValue(
62
- (v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0 || typeof v === "string" && /^\d+$/.test(v) && Number.isSafeInteger(Number(v)),
63
- NON_NEGATIVE_MONEY
64
- ),
65
- // `|| 0`: a JSON `-0` comes out as `0`.
66
- z4.transform((v) => Number(v) || 0)
67
- );
68
- }
69
- var INTEGER_TEXT = "Expected an integer within the safe range of number";
70
- function integerText() {
71
- return z4.pipe(
72
- z4.union([
73
- z4.string().check(
74
- z4.refine((value) => /^-?\d+$/.test(value) && Number.isSafeInteger(Number(value)), { message: INTEGER_TEXT })
75
- ),
76
- z4.number().check(z4.refine((value) => Number.isSafeInteger(value), { message: INTEGER_TEXT }))
77
- ]),
78
- z4.transform(Number)
79
- );
80
- }
81
- function text() {
82
- return z4._default(z4.string(), "");
83
- }
84
- function count() {
85
- return z4._default(z4.number(), 0);
86
- }
87
- function list(item) {
88
- return nullableList(item);
89
- }
90
- function durationSeconds() {
91
- return z4.pipe(
92
- z4.string().check(z4.regex(/^-?\d+(\.\d+)?s$/, { message: 'Expected a protobuf duration, e.g. "86400s"' })),
93
- z4.transform((value) => Number(value.slice(0, -1)))
94
- );
95
- }
96
-
97
- // src/modules/bets.ts
98
8
  var betFields = () => ({
99
- id: z4.string(),
9
+ id: z2.string(),
100
10
  status: protoEnum("BET_STATUS_"),
101
11
  stake: nonNegativeMinorUnits(),
102
12
  potential_return: nonNegativeMinorUnits(),
103
- total_odds: z4.number(),
13
+ total_odds: z2.number(),
104
14
  created_at: optionalTimestamp()
105
15
  });
106
16
  var betSchema = /* @__PURE__ */ lazy(() => wire(betFields()));
@@ -109,10 +19,10 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
109
19
  ...betFields(),
110
20
  selections: nullableList(
111
21
  wire({
112
- event_name: z4.string(),
113
- market_name: z4.string(),
114
- selection_name: z4.string(),
115
- odds: z4.number(),
22
+ event_name: z2.string(),
23
+ market_name: z2.string(),
24
+ selection_name: z2.string(),
25
+ odds: z2.number(),
116
26
  result: protoEnum("SELECTION_RESULT_")
117
27
  })
118
28
  )
@@ -120,14 +30,14 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
120
30
  );
121
31
  var offerSchema = /* @__PURE__ */ lazy(
122
32
  () => wire({
123
- bet_id: z4.string(),
124
- available: z4.boolean(),
33
+ bet_id: z2.string(),
34
+ available: z2.boolean(),
125
35
  cashout_amount: nonNegativeMinorUnits(),
126
36
  expires_at: optionalTimestamp()
127
37
  })
128
38
  );
129
39
  var cashoutSchema = /* @__PURE__ */ lazy(
130
- () => wire({ bet_id: z4.string(), cashout_amount: nonNegativeMinorUnits(), status: z4.string() })
40
+ () => wire({ bet_id: z2.string(), cashout_amount: nonNegativeMinorUnits(), status: z2.string() })
131
41
  );
132
42
  var LIST_ROUTE = { method: "GET", path: "/bets" };
133
43
  var GET_ROUTE = { method: "GET", path: "/bets/{betId}" };
@@ -199,148 +109,148 @@ function createBetsApi(transport) {
199
109
  }
200
110
  };
201
111
  }
202
- var campaignCurrency = () => z4._default(currencyOrEmpty(), "");
203
- var money = () => wire({ amount: z4._default(minorUnits(), 0), currency: campaignCurrency() });
204
- var timeWindow = () => wire({ starts_at: z4.optional(z4.string()), ends_at: z4.optional(z4.string()) });
205
- var ratio = () => wire({ decimal: z4.optional(z4.string()), basis_points: z4.optional(z4.number()), maximum_scale: count() });
112
+ var campaignCurrency = () => z2._default(currencyOrEmpty(), "");
113
+ var money = () => wire({ amount: z2._default(minorUnits(), 0), currency: campaignCurrency() });
114
+ var timeWindow = () => wire({ starts_at: z2.optional(z2.string()), ends_at: z2.optional(z2.string()) });
115
+ var ratio = () => wire({ decimal: z2.optional(z2.string()), basis_points: z2.optional(z2.number()), maximum_scale: count() });
206
116
  var empty = () => wire({});
207
117
  var policy = (prefix) => wire({ code: protoEnum(prefix), version: count() });
208
118
  var casinoSelector = () => wire({
209
119
  provider_instance_id: text(),
210
- software_ids: list(z4.string()),
211
- game_ids: list(z4.string()),
212
- category_codes: list(z4.string())
120
+ software_ids: list(z2.string()),
121
+ game_ids: list(z2.string()),
122
+ category_codes: list(z2.string())
213
123
  });
214
124
  var sportsSelector = () => wire({
215
- sport_codes: list(z4.string()),
216
- competition_ids: list(z4.string()),
217
- event_ids: list(z4.string()),
218
- market_codes: list(z4.string()),
219
- live: z4.optional(z4.boolean()),
125
+ sport_codes: list(z2.string()),
126
+ competition_ids: list(z2.string()),
127
+ event_ids: list(z2.string()),
128
+ market_codes: list(z2.string()),
129
+ live: z2.optional(z2.boolean()),
220
130
  bet_types: list(protoEnum("SPORTS_BET_TYPE_"))
221
131
  });
222
132
  var qualification = () => wire({
223
133
  version: count(),
224
- immediate: z4.optional(empty()),
225
- user_event: z4.optional(
134
+ immediate: z2.optional(empty()),
135
+ user_event: z2.optional(
226
136
  wire({
227
137
  event_code: text(),
228
138
  event_version: count(),
229
139
  source_authority: text(),
230
- identity_fields: list(z4.string())
140
+ identity_fields: list(z2.string())
231
141
  })
232
142
  ),
233
- deposit_settled: z4.optional(
143
+ deposit_settled: z2.optional(
234
144
  wire({
235
145
  currency: campaignCurrency(),
236
- eligible_method_codes: list(z4.string()),
146
+ eligible_method_codes: list(z2.string()),
237
147
  first_deposit_policy: protoEnum("FIRST_DEPOSIT_POLICY_"),
238
- minimum_settled_net_amount: z4.optional(money()),
239
- maximum_settled_net_amount: z4.optional(money()),
148
+ minimum_settled_net_amount: z2.optional(money()),
149
+ maximum_settled_net_amount: z2.optional(money()),
240
150
  amount_basis: protoEnum("DEPOSIT_AMOUNT_BASIS_")
241
151
  })
242
152
  ),
243
- activity_aggregate: z4.optional(
153
+ activity_aggregate: z2.optional(
244
154
  wire({
245
155
  basis: protoEnum("BASIS_"),
246
156
  product_scope: protoEnum("PRODUCT_SCOPE_"),
247
157
  currency: campaignCurrency(),
248
- window: z4.optional(durationSeconds()),
158
+ window: z2.optional(durationSeconds()),
249
159
  timezone: text(),
250
- late_event_grace: z4.optional(durationSeconds()),
251
- casino: z4.optional(casinoSelector()),
252
- sportsbook: z4.optional(sportsSelector())
160
+ late_event_grace: z2.optional(durationSeconds()),
161
+ casino: z2.optional(casinoSelector()),
162
+ sportsbook: z2.optional(sportsSelector())
253
163
  })
254
164
  )
255
165
  });
256
166
  var validity = () => wire({
257
- no_expiry: z4.optional(empty()),
258
- absolute_expiry: z4.optional(wire({ expires_at: z4.optional(z4.string()) })),
259
- duration_from_grant: z4.optional(wire({ duration: z4.optional(durationSeconds()) }))
167
+ no_expiry: z2.optional(empty()),
168
+ absolute_expiry: z2.optional(wire({ expires_at: z2.optional(z2.string()) })),
169
+ duration_from_grant: z2.optional(wire({ duration: z2.optional(durationSeconds()) }))
260
170
  });
261
171
  var rounding = () => protoEnum("ROUNDING_MODE_");
262
172
  var proceedsClass = () => protoEnum("PROCEEDS_CLASS_");
263
173
  var percent = () => wire({
264
- percentage: z4.optional(ratio()),
174
+ percentage: z2.optional(ratio()),
265
175
  rounding: rounding(),
266
- minimum_reward: z4.optional(money()),
267
- maximum_reward: z4.optional(money())
176
+ minimum_reward: z2.optional(money()),
177
+ maximum_reward: z2.optional(money())
268
178
  });
269
179
  var balanceCredit = () => wire({
270
- fixed_amount: z4.optional(wire({ amount: z4.optional(money()) })),
271
- percent_of_source_amount: z4.optional(percent()),
272
- aggregate_rebate: z4.optional(
180
+ fixed_amount: z2.optional(wire({ amount: z2.optional(money()) })),
181
+ percent_of_source_amount: z2.optional(percent()),
182
+ aggregate_rebate: z2.optional(
273
183
  wire({
274
- percentage: z4.optional(ratio()),
184
+ percentage: z2.optional(ratio()),
275
185
  rounding: rounding(),
276
- minimum_basis: z4.optional(money()),
277
- maximum_reward: z4.optional(money())
186
+ minimum_basis: z2.optional(money()),
187
+ maximum_reward: z2.optional(money())
278
188
  })
279
189
  ),
280
190
  balance_class: protoEnum("BALANCE_CLASS_"),
281
191
  proceeds_class: proceedsClass(),
282
- validity: z4.optional(validity())
192
+ validity: z2.optional(validity())
283
193
  });
284
- var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z4.optional(money()) });
194
+ var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z2.optional(money()) });
285
195
  var oddsPolicy = () => wire({
286
196
  mode: protoEnum("MODE_"),
287
- minimum_total_odds_decimal: z4.optional(z4.string()),
288
- minimum_odds_per_leg_decimal: z4.optional(z4.string()),
289
- minimum_legs: z4.optional(z4.number()),
290
- maximum_legs: z4.optional(z4.number())
197
+ minimum_total_odds_decimal: z2.optional(z2.string()),
198
+ minimum_odds_per_leg_decimal: z2.optional(z2.string()),
199
+ minimum_legs: z2.optional(z2.number()),
200
+ maximum_legs: z2.optional(z2.number())
291
201
  });
292
202
  var cashoutMode = () => protoEnum("RESTRICTED_CASHOUT_MODE_");
293
203
  var usePolicy = () => wire({
294
204
  version: count(),
295
- funds_consumption: z4.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
296
- casino: z4.optional(wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z4.optional(maximumBet()) })),
297
- sportsbook: z4.optional(
205
+ funds_consumption: z2.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
206
+ casino: z2.optional(wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z2.optional(maximumBet()) })),
207
+ sportsbook: z2.optional(
298
208
  wire({
299
209
  allowed_scopes: list(sportsSelector()),
300
210
  excluded_scopes: list(sportsSelector()),
301
- maximum_bet: z4.optional(maximumBet()),
302
- funding_odds: z4.optional(oddsPolicy()),
211
+ maximum_bet: z2.optional(maximumBet()),
212
+ funding_odds: z2.optional(oddsPolicy()),
303
213
  cashout_mode: cashoutMode()
304
214
  })
305
215
  ),
306
- casino_and_sportsbook: z4.optional(
216
+ casino_and_sportsbook: z2.optional(
307
217
  wire({
308
218
  allowed_casino_scopes: list(casinoSelector()),
309
219
  allowed_sportsbook_scopes: list(sportsSelector()),
310
220
  excluded_sportsbook_scopes: list(sportsSelector()),
311
- maximum_casino_bet: z4.optional(maximumBet()),
312
- maximum_sportsbook_bet: z4.optional(maximumBet()),
313
- sportsbook_funding_odds: z4.optional(oddsPolicy()),
221
+ maximum_casino_bet: z2.optional(maximumBet()),
222
+ maximum_sportsbook_bet: z2.optional(maximumBet()),
223
+ sportsbook_funding_odds: z2.optional(oddsPolicy()),
314
224
  sportsbook_cashout_mode: cashoutMode()
315
225
  })
316
226
  ),
317
- payout_allocation: z4.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
227
+ payout_allocation: z2.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
318
228
  });
319
229
  var wageringPolicy = () => wire({
320
230
  version: count(),
321
- none: z4.optional(empty()),
322
- multiplier: z4.optional(
231
+ none: z2.optional(empty()),
232
+ multiplier: z2.optional(
323
233
  wire({
324
234
  requirement_basis: protoEnum("REQUIREMENT_BASIS_"),
325
- multiplier: z4.optional(ratio()),
235
+ multiplier: z2.optional(ratio()),
326
236
  contribution_rates: list(
327
237
  wire({
328
- casino: z4.optional(casinoSelector()),
329
- sportsbook: z4.optional(sportsSelector()),
330
- rate: z4.optional(ratio())
238
+ casino: z2.optional(casinoSelector()),
239
+ sportsbook: z2.optional(sportsSelector()),
240
+ rate: z2.optional(ratio())
331
241
  })
332
242
  ),
333
- deadline: z4.optional(validity()),
243
+ deadline: z2.optional(validity()),
334
244
  rounding: rounding(),
335
- sportsbook_contribution_odds: z4.optional(oddsPolicy()),
336
- maximum_conversion: z4.optional(money())
245
+ sportsbook_contribution_odds: z2.optional(oddsPolicy()),
246
+ maximum_conversion: z2.optional(money())
337
247
  })
338
248
  )
339
249
  });
340
250
  var stackingPolicy = () => wire({
341
251
  version: count(),
342
- exclusive_in_group: z4.optional(wire({ stacking_group_key: text() })),
343
- multiple_in_group: z4.optional(wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
252
+ exclusive_in_group: z2.optional(wire({ stacking_group_key: text() })),
253
+ multiple_in_group: z2.optional(wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
344
254
  });
345
255
  var reward = () => wire({
346
256
  reward_key: text(),
@@ -348,49 +258,49 @@ var reward = () => wire({
348
258
  reward_kind_version: count(),
349
259
  execution_profile_code: protoEnum("EXECUTION_PROFILE_CODE_"),
350
260
  execution_profile_version: count(),
351
- balance_credit: z4.optional(balanceCredit()),
352
- provider_managed_balance: z4.optional(wire({ provider_code: text() })),
353
- casino_free_spins: z4.optional(
261
+ balance_credit: z2.optional(balanceCredit()),
262
+ provider_managed_balance: z2.optional(wire({ provider_code: text() })),
263
+ casino_free_spins: z2.optional(
354
264
  wire({
355
265
  provider_code: text(),
356
- casino_scope: z4.optional(casinoSelector()),
266
+ casino_scope: z2.optional(casinoSelector()),
357
267
  quantity: count(),
358
- denomination: z4.optional(money()),
268
+ denomination: z2.optional(money()),
359
269
  currency: campaignCurrency(),
360
- grant_window: z4.optional(timeWindow()),
270
+ grant_window: z2.optional(timeWindow()),
361
271
  proceeds_class: proceedsClass(),
362
- maximum_winnings: z4.optional(money())
272
+ maximum_winnings: z2.optional(money())
363
273
  })
364
274
  ),
365
- sports_bonus_bet: z4.optional(
275
+ sports_bonus_bet: z2.optional(
366
276
  wire({
367
277
  provider_code: text(),
368
- sportsbook_scope: z4.optional(sportsSelector()),
369
- amount: z4.optional(money()),
278
+ sportsbook_scope: z2.optional(sportsSelector()),
279
+ amount: z2.optional(money()),
370
280
  quantity: count(),
371
- validity: z4.optional(validity())
281
+ validity: z2.optional(validity())
372
282
  })
373
283
  ),
374
- sports_bet_coverage: z4.optional(
284
+ sports_bet_coverage: z2.optional(
375
285
  wire({
376
286
  provider_code: text(),
377
- qualifying_bet_scope: z4.optional(sportsSelector()),
378
- coverage_cap: z4.optional(money()),
379
- validity: z4.optional(validity())
287
+ qualifying_bet_scope: z2.optional(sportsSelector()),
288
+ coverage_cap: z2.optional(money()),
289
+ validity: z2.optional(validity())
380
290
  })
381
291
  ),
382
- use_policy: z4.optional(usePolicy()),
383
- wagering_policy: z4.optional(wageringPolicy()),
384
- stacking_policy: z4.optional(stackingPolicy()),
385
- restricted_position_selection_policy: z4.optional(
292
+ use_policy: z2.optional(usePolicy()),
293
+ wagering_policy: z2.optional(wageringPolicy()),
294
+ stacking_policy: z2.optional(stackingPolicy()),
295
+ restricted_position_selection_policy: z2.optional(
386
296
  wire({
387
297
  version: count(),
388
- priority_then_earliest_expiry: z4.optional(wire({ selection_priority: z4.optional(z4.number()) }))
298
+ priority_then_earliest_expiry: z2.optional(wire({ selection_priority: z2.optional(z2.number()) }))
389
299
  })
390
300
  )
391
301
  });
392
302
  var localizedContent = () => wire({ locale: text(), display_name: text(), description: text(), terms: text(), terms_revision: text() });
393
- var content = () => wire({ default_locale: text(), supported_locales: list(z4.string()), localized_content: list(localizedContent()) });
303
+ var content = () => wire({ default_locale: text(), supported_locales: list(z2.string()), localized_content: list(localizedContent()) });
394
304
  var offerSchema2 = /* @__PURE__ */ lazy(
395
305
  () => wire({
396
306
  campaign_id: text(),
@@ -398,33 +308,33 @@ var offerSchema2 = /* @__PURE__ */ lazy(
398
308
  publication_id: text(),
399
309
  product_scope: protoEnum("PRODUCT_SCOPE_"),
400
310
  timezone: text(),
401
- enrollment_window: z4.optional(timeWindow()),
402
- qualification_window: z4.optional(timeWindow()),
403
- claim_window: z4.optional(timeWindow()),
404
- entry_policy: z4.optional(policy("ENTRY_POLICY_CODE_")),
405
- reward_claim_policy: z4.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
406
- qualification: z4.optional(qualification()),
407
- reward: z4.optional(reward()),
408
- publication_starts_at: z4.optional(z4.string()),
409
- publication_ends_at: z4.optional(z4.string()),
410
- content: z4.optional(content())
311
+ enrollment_window: z2.optional(timeWindow()),
312
+ qualification_window: z2.optional(timeWindow()),
313
+ claim_window: z2.optional(timeWindow()),
314
+ entry_policy: z2.optional(policy("ENTRY_POLICY_CODE_")),
315
+ reward_claim_policy: z2.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
316
+ qualification: z2.optional(qualification()),
317
+ reward: z2.optional(reward()),
318
+ publication_starts_at: z2.optional(z2.string()),
319
+ publication_ends_at: z2.optional(z2.string()),
320
+ content: z2.optional(content())
411
321
  })
412
322
  );
413
323
  function grantMoney(value, currency) {
414
324
  return { amount: value?.amount ?? 0, currency: value?.currency || currency };
415
325
  }
416
- var rewardGrant = () => z4.pipe(
326
+ var rewardGrant = () => z2.pipe(
417
327
  wire({
418
328
  state: protoEnum("CAMPAIGN_PLAYER_REWARD_GRANT_STATE_"),
419
- granted: z4.optional(money()),
420
- balance: z4.optional(money()),
421
- converted: z4.optional(money()),
422
- expires_at: z4.optional(z4.string()),
423
- wagering: z4.optional(
424
- wire({ required: z4.optional(money()), accumulated: z4.optional(money()), completed_at: z4.optional(z4.string()) })
329
+ granted: z2.optional(money()),
330
+ balance: z2.optional(money()),
331
+ converted: z2.optional(money()),
332
+ expires_at: z2.optional(z2.string()),
333
+ wagering: z2.optional(
334
+ wire({ required: z2.optional(money()), accumulated: z2.optional(money()), completed_at: z2.optional(z2.string()) })
425
335
  )
426
336
  }),
427
- z4.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
337
+ z2.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
428
338
  const currency = [granted, balance, converted, wagering?.required, wagering?.accumulated].find((m) => m?.currency)?.currency ?? "";
429
339
  const out = {
430
340
  state,
@@ -444,40 +354,40 @@ var rewardGrant = () => z4.pipe(
444
354
  })
445
355
  );
446
356
  var participationSchema = /* @__PURE__ */ lazy(
447
- () => z4.pipe(
357
+ () => z2.pipe(
448
358
  wire({
449
359
  id: text(),
450
360
  campaign_id: text(),
451
361
  campaign_version_id: text(),
452
362
  reward_key: text(),
453
- qualification_snapshot: z4.optional(qualification()),
363
+ qualification_snapshot: z2.optional(qualification()),
454
364
  // oneof `state`: only one of the cases is filled in.
455
- enrolled: z4.optional(empty()),
456
- qualifying: z4.optional(empty()),
457
- qualified: z4.optional(wire({ qualified_at: z4.optional(z4.string()) })),
458
- reward_pending: z4.optional(empty()),
459
- completed: z4.optional(wire({ completed_at: z4.optional(z4.string()) })),
460
- reward_failed: z4.optional(empty()),
461
- expired: z4.optional(wire({ expired_at: z4.optional(z4.string()) })),
462
- cancelled: z4.optional(empty()),
463
- reward_grant: z4.optional(rewardGrant()),
464
- snapshot: z4.optional(
365
+ enrolled: z2.optional(empty()),
366
+ qualifying: z2.optional(empty()),
367
+ qualified: z2.optional(wire({ qualified_at: z2.optional(z2.string()) })),
368
+ reward_pending: z2.optional(empty()),
369
+ completed: z2.optional(wire({ completed_at: z2.optional(z2.string()) })),
370
+ reward_failed: z2.optional(empty()),
371
+ expired: z2.optional(wire({ expired_at: z2.optional(z2.string()) })),
372
+ cancelled: z2.optional(empty()),
373
+ reward_grant: z2.optional(rewardGrant()),
374
+ snapshot: z2.optional(
465
375
  wire({
466
- reward: z4.optional(reward()),
467
- content: z4.optional(content()),
468
- terms_acceptance: z4.optional(
376
+ reward: z2.optional(reward()),
377
+ content: z2.optional(content()),
378
+ terms_acceptance: z2.optional(
469
379
  wire({
470
380
  locale: text(),
471
381
  terms_revision: text(),
472
382
  terms_digest_sha256_hex: text(),
473
- accepted_at: z4.optional(z4.string())
383
+ accepted_at: z2.optional(z2.string())
474
384
  })
475
385
  )
476
386
  })
477
387
  )
478
388
  }),
479
389
  // The oneof becomes `status` (+ the timestamp of the case); the oneof's keys are not passed on.
480
- z4.transform(
390
+ z2.transform(
481
391
  ({ enrolled, qualifying, qualified, rewardPending, completed, rewardFailed, expired, cancelled, ...rest }) => {
482
392
  const out = { ...rest, status: "unspecified" };
483
393
  if (enrolled) out.status = "enrolled";
@@ -499,7 +409,7 @@ var participationSchema = /* @__PURE__ */ lazy(
499
409
  )
500
410
  )
501
411
  );
502
- var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor: z4.optional(z4.string()) });
412
+ var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor: z2.optional(z2.string()) });
503
413
  var offersPage = /* @__PURE__ */ lazy(() => cursorPageSchema("offers", offerSchema2()));
504
414
  var participationsPage = /* @__PURE__ */ lazy(() => cursorPageSchema("participations", participationSchema()));
505
415
  var offerEnvelope = /* @__PURE__ */ lazy(() => wire({ offer: offerSchema2() }));
@@ -513,64 +423,64 @@ function toCursorPage(key, data) {
513
423
  if (data.nextCursor) page.nextCursor = data.nextCursor;
514
424
  return page;
515
425
  }
516
- var nullableDate = () => z4.pipe(
517
- z4.nullish(z4.string()),
518
- z4.transform((value) => value ?? void 0)
426
+ var nullableDate = () => z2.pipe(
427
+ z2.nullish(z2.string()),
428
+ z2.transform((value) => value ?? void 0)
519
429
  );
520
430
  function compact(value) {
521
431
  return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
522
432
  }
523
433
  var overviewSchema = /* @__PURE__ */ lazy(
524
- () => z4.pipe(
434
+ () => z2.pipe(
525
435
  wire({
526
436
  currencies: list(
527
- z4.pipe(
437
+ z2.pipe(
528
438
  wire({
529
439
  currency: currencyOrEmpty(),
530
- decimal_places: z4.number(),
440
+ decimal_places: z2.number(),
531
441
  restricted_total: minorUnits(),
532
442
  expiring_7d: minorUnits(),
533
- open_positions: z4.number(),
443
+ open_positions: z2.number(),
534
444
  next_expires_at: nullableDate(),
535
445
  converted: minorUnits(),
536
- converted_campaigns: z4.number()
446
+ converted_campaigns: z2.number()
537
447
  }),
538
- z4.transform(compact)
448
+ z2.transform(compact)
539
449
  )
540
450
  ),
541
451
  as_of: nullableDate()
542
452
  }),
543
- z4.transform(compact)
453
+ z2.transform(compact)
544
454
  )
545
455
  );
546
456
  var positionsPage = /* @__PURE__ */ lazy(
547
457
  () => wire({
548
458
  rows: list(
549
- z4.pipe(
459
+ z2.pipe(
550
460
  wire({
551
- position_id: z4.string(),
552
- campaign_id: z4.string(),
461
+ position_id: z2.string(),
462
+ campaign_id: z2.string(),
553
463
  currency: currencyOrEmpty(),
554
- decimal_places: z4.number(),
464
+ decimal_places: z2.number(),
555
465
  granted: minorUnits(),
556
466
  restricted: minorUnits(),
557
467
  converted: minorUnits(),
558
468
  required: minorUnits(),
559
469
  wagered: minorUnits(),
560
470
  remaining: minorUnits(),
561
- state: z4.string(),
471
+ state: z2.string(),
562
472
  // The gateway answers `null` for an action it does not know; known ones are uppercase (`CONVERT`).
563
- terminal_action: z4.pipe(
564
- z4.nullish(z4.string()),
565
- z4.transform((value) => value ? value.toLowerCase() : void 0)
473
+ terminal_action: z2.pipe(
474
+ z2.nullish(z2.string()),
475
+ z2.transform((value) => value ? value.toLowerCase() : void 0)
566
476
  ),
567
477
  expires_at: nullableDate(),
568
478
  created_at: nullableDate()
569
479
  }),
570
- z4.transform((row) => compact(row))
480
+ z2.transform((row) => compact(row))
571
481
  )
572
482
  ),
573
- next_cursor: z4.optional(z4.string())
483
+ next_cursor: z2.optional(z2.string())
574
484
  })
575
485
  );
576
486
  var terms = (acceptance) => acceptance && { locale: acceptance.locale, terms_revision: acceptance.termsRevision };
@@ -664,51 +574,51 @@ function createBonusApi(transport) {
664
574
  }
665
575
  var gameSchema = /* @__PURE__ */ lazy(
666
576
  () => wire({
667
- id: z4.string(),
668
- name: z4.string(),
669
- provider: z4.string(),
670
- category: z4.string(),
671
- type: z4.string(),
672
- thumbnail: z4.string(),
673
- is_new: z4.boolean(),
674
- is_popular: z4.boolean(),
675
- is_live: z4.boolean(),
676
- demo_available: z4.boolean(),
677
- rtp: z4.number(),
678
- volatility: z4.string(),
679
- priority: z4.number()
577
+ id: z2.string(),
578
+ name: z2.string(),
579
+ provider: z2.string(),
580
+ category: z2.string(),
581
+ type: z2.string(),
582
+ thumbnail: z2.string(),
583
+ is_new: z2.boolean(),
584
+ is_popular: z2.boolean(),
585
+ is_live: z2.boolean(),
586
+ demo_available: z2.boolean(),
587
+ rtp: z2.number(),
588
+ volatility: z2.string(),
589
+ priority: z2.number()
680
590
  })
681
591
  );
682
592
  var categoriesSchema = /* @__PURE__ */ lazy(
683
593
  () => nullableList(
684
- wire({ slug: z4.string(), name: z4.string(), icon: z4.string(), game_count: z4.number(), priority: z4.number() })
594
+ wire({ slug: z2.string(), name: z2.string(), icon: z2.string(), game_count: z2.number(), priority: z2.number() })
685
595
  )
686
596
  );
687
597
  var providersSchema = /* @__PURE__ */ lazy(
688
- () => nullableList(wire({ id: z4.string(), name: z4.string(), game_count: z4.number() }))
598
+ () => nullableList(wire({ id: z2.string(), name: z2.string(), game_count: z2.number() }))
689
599
  );
690
600
  var launchSchema = /* @__PURE__ */ lazy(
691
- () => z4.pipe(
601
+ () => z2.pipe(
692
602
  wire({
693
- session_id: z4.string().check(z4.minLength(1)),
694
- game_url: z4.string().check(z4.minLength(1)),
603
+ session_id: z2.string().check(z2.minLength(1)),
604
+ game_url: z2.string().check(z2.minLength(1)),
695
605
  // Any text: a target the SDK does not know yet must not fail the (strict) launch.
696
- launch_target: z4.optional(z4.string()),
697
- provider_code: z4.optional(z4.string()),
698
- expires_at: z4.optional(z4.string())
606
+ launch_target: z2.optional(z2.string()),
607
+ provider_code: z2.optional(z2.string()),
608
+ expires_at: z2.optional(z2.string())
699
609
  }),
700
610
  // Without a target (an older gateway, or a custom mock), the launch keeps the behavior the SDK documented
701
611
  // before the field existed: an iframe.
702
- z4.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
612
+ z2.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
703
613
  )
704
614
  );
705
615
  var sessionSchema = /* @__PURE__ */ lazy(
706
616
  () => wire({
707
- id: z4.string(),
708
- game_id: z4.string(),
709
- game_name: z4.string(),
710
- provider: z4.string(),
711
- start_time: z4.string(),
617
+ id: z2.string(),
618
+ game_id: z2.string(),
619
+ game_name: z2.string(),
620
+ provider: z2.string(),
621
+ start_time: z2.string(),
712
622
  total_bet: money$1(),
713
623
  total_win: money$1(),
714
624
  status: protoEnum("SESSION_STATUS_")
@@ -716,63 +626,63 @@ var sessionSchema = /* @__PURE__ */ lazy(
716
626
  );
717
627
  var transactionSchema = /* @__PURE__ */ lazy(
718
628
  () => wire({
719
- id: z4.string(),
720
- game_id: z4.string(),
721
- game_name: z4.string(),
722
- round_id: z4.string(),
629
+ id: z2.string(),
630
+ game_id: z2.string(),
631
+ game_name: z2.string(),
632
+ round_id: z2.string(),
723
633
  type: protoEnum("CASINO_TRANSACTION_TYPE_"),
724
634
  amount: minorUnits(),
725
635
  currency: currencyCode(),
726
636
  currency_decimal_places: decimalPlaces(),
727
- created_at: z4.string()
637
+ created_at: z2.string()
728
638
  })
729
639
  );
730
640
  var winnersSchema = /* @__PURE__ */ lazy(
731
641
  () => nullableList(
732
642
  wire({
733
- player: z4.string(),
643
+ player: z2.string(),
734
644
  amount: minorUnits(),
735
645
  currency: currencyCode(),
736
646
  currency_decimal_places: decimalPlaces(),
737
- game_id: z4.string(),
738
- game_name: z4.string(),
739
- won_at: z4.string()
647
+ game_id: z2.string(),
648
+ game_name: z2.string(),
649
+ won_at: z2.string()
740
650
  })
741
651
  )
742
652
  );
743
653
  var gamesEnvelopeSchema = /* @__PURE__ */ lazy(
744
654
  () => wire({
745
- availability: z4.pipe(
746
- z4.nullish(
655
+ availability: z2.pipe(
656
+ z2.nullish(
747
657
  wire({
748
658
  // The gateway reports an unset status as `available`; the SDK does the same for an absent/empty one.
749
- status: z4.pipe(
750
- z4.nullish(z4.string()),
751
- z4.transform((value) => value ? value.toLowerCase() : "available")
659
+ status: z2.pipe(
660
+ z2.nullish(z2.string()),
661
+ z2.transform((value) => value ? value.toLowerCase() : "available")
752
662
  ),
753
663
  primary_provider_code: optionalText(),
754
- missing: nullableList(z4.string())
664
+ missing: nullableList(z2.string())
755
665
  })
756
666
  ),
757
- z4.transform((value) => value ?? null)
667
+ z2.transform((value) => value ?? null)
758
668
  )
759
669
  })
760
670
  );
761
671
  var CURRENCY = /^[A-Z]{3}$/;
762
672
  var DECIMAL_PLACES_MAX = 20;
763
673
  var jackpotSchema = /* @__PURE__ */ lazy(
764
- () => z4.pipe(
765
- z4.object({
766
- id: z4.string().check(z4.refine((value) => value.trim() !== "")),
767
- name: z4.string().check(z4.refine((value) => value.trim() !== "")),
768
- currency: z4.string().check(z4.regex(CURRENCY)),
769
- amount_minor: z4.union([
770
- z4.string().check(z4.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
771
- z4.number().check(z4.refine((value) => Number.isSafeInteger(value) && value >= 0))
674
+ () => z2.pipe(
675
+ z2.object({
676
+ id: z2.string().check(z2.refine((value) => value.trim() !== "")),
677
+ name: z2.string().check(z2.refine((value) => value.trim() !== "")),
678
+ currency: z2.string().check(z2.regex(CURRENCY)),
679
+ amount_minor: z2.union([
680
+ z2.string().check(z2.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
681
+ z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0))
772
682
  ]),
773
- decimal_places: z4.number().check(z4.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
683
+ decimal_places: z2.number().check(z2.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
774
684
  }),
775
- z4.transform((raw) => ({
685
+ z2.transform((raw) => ({
776
686
  id: raw.id,
777
687
  name: raw.name,
778
688
  currency: raw.currency,
@@ -782,24 +692,24 @@ var jackpotSchema = /* @__PURE__ */ lazy(
782
692
  )
783
693
  );
784
694
  var jackpotsSchema = /* @__PURE__ */ lazy(
785
- () => wire({ items: nullableList(z4.unknown()), featured_id: optionalText() })
695
+ () => wire({ items: nullableList(z2.unknown()), featured_id: optionalText() })
786
696
  );
787
697
  var jackpotGamesSchema = /* @__PURE__ */ lazy(
788
- () => z4.pipe(
698
+ () => z2.pipe(
789
699
  wire({
790
700
  games: nullableList(gameSchema()),
791
- mode: z4.pipe(
792
- z4.string(),
793
- z4.transform((value) => value.toLowerCase())
701
+ mode: z2.pipe(
702
+ z2.string(),
703
+ z2.transform((value) => value.toLowerCase())
794
704
  ),
795
705
  pagination: wire({
796
- page: z4.number(),
797
- per_page: z4.number(),
798
- has_next: z4.boolean(),
706
+ page: z2.number(),
707
+ per_page: z2.number(),
708
+ has_next: z2.boolean(),
799
709
  next_cursor: optionalText()
800
710
  })
801
711
  }),
802
- z4.transform(({ games, mode, pagination }) => ({
712
+ z2.transform(({ games, mode, pagination }) => ({
803
713
  items: games,
804
714
  mode,
805
715
  page: pagination.page,
@@ -931,7 +841,7 @@ function createCasinoApi(transport) {
931
841
  });
932
842
  const items = [];
933
843
  for (const entry of Array.isArray(raw.items) ? raw.items : []) {
934
- const parsed = z4.safeParse(jackpotSchema(), entry);
844
+ const parsed = z2.safeParse(jackpotSchema(), entry);
935
845
  if (!parsed.success || parsed.data.currency !== currency) continue;
936
846
  if (items.some((item) => item.id === parsed.data.id)) continue;
937
847
  items.push(parsed.data);
@@ -965,9 +875,9 @@ var ParsedBenefits = class {
965
875
  }
966
876
  value;
967
877
  };
968
- var tierBenefits = () => z4.pipe(
969
- z4.nullish(z4.string()),
970
- z4.transform((text2, ctx) => {
878
+ var tierBenefits = () => z2.pipe(
879
+ z2.nullish(z2.string()),
880
+ z2.transform((text2, ctx) => {
971
881
  if (text2 == null || text2.trim() === "") return null;
972
882
  let parsed;
973
883
  try {
@@ -981,43 +891,43 @@ var tierBenefits = () => z4.pipe(
981
891
  message: "tier_benefits_json is not a JSON object or array",
982
892
  input: void 0
983
893
  });
984
- return z4.NEVER;
894
+ return z2.NEVER;
985
895
  })
986
896
  );
987
897
  var loyaltySchema = /* @__PURE__ */ lazy(
988
- () => z4.pipe(
898
+ () => z2.pipe(
989
899
  wire({
990
900
  total_points_earned: integerText(),
991
901
  current_points: integerText(),
992
902
  points_redeemed: integerText(),
993
903
  current_tier: optionalText(),
994
904
  tier_points: integerText(),
995
- lifetime_wagered: z4._default(minorUnits(), 0),
996
- lifetime_deposited: z4._default(minorUnits(), 0),
905
+ lifetime_wagered: z2._default(minorUnits(), 0),
906
+ lifetime_deposited: z2._default(minorUnits(), 0),
997
907
  tier_benefits_json: tierBenefits(),
998
908
  tier_expires_at: optionalTimestamp()
999
909
  }),
1000
- z4.transform(({ tierBenefitsJson, ...rest }) => {
910
+ z2.transform(({ tierBenefitsJson, ...rest }) => {
1001
911
  const benefits = tierBenefitsJson instanceof ParsedBenefits ? tierBenefitsJson.value : null;
1002
912
  return { ...rest, tierBenefits: benefits };
1003
913
  })
1004
914
  )
1005
915
  );
1006
916
  var redeemSchema = /* @__PURE__ */ lazy(
1007
- () => z4.pipe(
917
+ () => z2.pipe(
1008
918
  wire({
1009
- success: z4.optional(z4.boolean()),
1010
- message: z4.optional(z4.string()),
919
+ success: z2.optional(z2.boolean()),
920
+ message: z2.optional(z2.string()),
1011
921
  redeemed_points: integerText(),
1012
- value: z4.nullish(minorUnits()),
922
+ value: z2.nullish(minorUnits()),
1013
923
  // Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
1014
- currency: z4.pipe(
1015
- z4.nullish(currencyOrEmpty()),
1016
- z4.transform((value) => value == null || value === "" ? null : value)
924
+ currency: z2.pipe(
925
+ z2.nullish(currencyOrEmpty()),
926
+ z2.transform((value) => value == null || value === "" ? null : value)
1017
927
  ),
1018
928
  bonus_id: optionalText()
1019
929
  }),
1020
- z4.transform((data) => ({
930
+ z2.transform((data) => ({
1021
931
  success: data.success,
1022
932
  message: data.message,
1023
933
  redeemedPoints: data.redeemedPoints,
@@ -1061,12 +971,12 @@ function createLoyaltyApi(transport) {
1061
971
  };
1062
972
  }
1063
973
  function openUnion(values) {
1064
- return z4.pipe(
1065
- z4.pipe(
1066
- z4.string(),
1067
- z4.transform((value) => value.toLowerCase())
974
+ return z2.pipe(
975
+ z2.pipe(
976
+ z2.string(),
977
+ z2.transform((value) => value.toLowerCase())
1068
978
  ),
1069
- z4.enum(values)
979
+ z2.enum(values)
1070
980
  );
1071
981
  }
1072
982
 
@@ -1077,14 +987,14 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
1077
987
  var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
1078
988
  var missionSchema = /* @__PURE__ */ lazy(
1079
989
  () => wire({
1080
- id: z4.string(),
1081
- name: z4.string(),
1082
- description: z4._default(z4.string(), ""),
990
+ id: z2.string(),
991
+ name: z2.string(),
992
+ description: z2._default(z2.string(), ""),
1083
993
  mission_type: openUnion(MISSION_TYPES),
1084
994
  objective_type: openUnion(OBJECTIVE_TYPES),
1085
995
  target_value: integerText(),
1086
996
  target_game_category: optionalText(),
1087
- target_games: nullableList(z4.string()),
997
+ target_games: nullableList(z2.string()),
1088
998
  reward_type: openUnion(REWARD_TYPES),
1089
999
  reward_value: minorUnits(),
1090
1000
  valid_from: optionalTimestamp(),
@@ -1092,16 +1002,16 @@ var missionSchema = /* @__PURE__ */ lazy(
1092
1002
  })
1093
1003
  );
1094
1004
  var userMissionsSchema = /* @__PURE__ */ lazy(
1095
- () => z4.pipe(
1005
+ () => z2.pipe(
1096
1006
  wire({
1097
1007
  missions: nullableList(
1098
1008
  wire({
1099
- id: z4.string(),
1100
- mission_id: z4.string(),
1101
- mission_name: z4._default(z4.string(), ""),
1009
+ id: z2.string(),
1010
+ mission_id: z2.string(),
1011
+ mission_name: z2._default(z2.string(), ""),
1102
1012
  current_progress: integerText(),
1103
1013
  target_value: integerText(),
1104
- progress_percentage: z4.number(),
1014
+ progress_percentage: z2.number(),
1105
1015
  status: openUnion(USER_MISSION_STATUSES),
1106
1016
  reward_type: openUnion(REWARD_TYPES),
1107
1017
  reward_value: minorUnits(),
@@ -1110,7 +1020,7 @@ var userMissionsSchema = /* @__PURE__ */ lazy(
1110
1020
  })
1111
1021
  )
1112
1022
  }),
1113
- z4.transform((data) => data.missions)
1023
+ z2.transform((data) => data.missions)
1114
1024
  )
1115
1025
  );
1116
1026
  function createMissionsApi(transport) {
@@ -1140,25 +1050,25 @@ function createMissionsApi(transport) {
1140
1050
  }
1141
1051
  var DEFAULT_PER_PAGE = 20;
1142
1052
  var HISTORY_PATH = "/referrals/history";
1143
- var count2 = () => z4._default(z4.number().check(z4.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
1144
- var money3 = () => z4.pipe(
1145
- z4.nullish(wire({ minor_units: minorUnits(), currency: z4._default(currencyOrEmpty(), "") })),
1146
- z4.transform(
1053
+ var count2 = () => z2._default(z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
1054
+ var money3 = () => z2.pipe(
1055
+ z2.nullish(wire({ minor_units: minorUnits(), currency: z2._default(currencyOrEmpty(), "") })),
1056
+ z2.transform(
1147
1057
  (value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
1148
1058
  )
1149
1059
  );
1150
- var rulesSchema = () => z4.pipe(
1151
- z4.nullish(
1060
+ var rulesSchema = () => z2.pipe(
1061
+ z2.nullish(
1152
1062
  wire({
1153
1063
  reward: money3(),
1154
1064
  minimum_real_net_loss: money3(),
1155
1065
  referee_window_days: count2(),
1156
1066
  hold_hours: count2(),
1157
- wagering_multiplier: z4._default(z4.string(), ""),
1067
+ wagering_multiplier: z2._default(z2.string(), ""),
1158
1068
  maximum_conversion: money3()
1159
1069
  })
1160
1070
  ),
1161
- z4.transform((rules) => {
1071
+ z2.transform((rules) => {
1162
1072
  if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
1163
1073
  return {
1164
1074
  reward: rules.reward,
@@ -1171,12 +1081,12 @@ var rulesSchema = () => z4.pipe(
1171
1081
  })
1172
1082
  );
1173
1083
  var infoSchema = /* @__PURE__ */ lazy(
1174
- () => z4.pipe(
1084
+ () => z2.pipe(
1175
1085
  wire({
1176
- enabled: z4._default(z4.boolean(), false),
1086
+ enabled: z2._default(z2.boolean(), false),
1177
1087
  referral_code: optionalText(),
1178
1088
  rules: rulesSchema(),
1179
- totals: z4._default(
1089
+ totals: z2._default(
1180
1090
  wire({
1181
1091
  registered: count2(),
1182
1092
  deposited: count2(),
@@ -1189,7 +1099,7 @@ var infoSchema = /* @__PURE__ */ lazy(
1189
1099
  { registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
1190
1100
  )
1191
1101
  }),
1192
- z4.transform(
1102
+ z2.transform(
1193
1103
  ({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
1194
1104
  )
1195
1105
  )
@@ -1198,16 +1108,16 @@ function remainingOf(target, loss) {
1198
1108
  const missing = BigInt(target.amount) - BigInt(loss.amount);
1199
1109
  return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
1200
1110
  }
1201
- var progressSchema = () => z4.pipe(
1202
- z4.nullish(
1111
+ var progressSchema = () => z2.pipe(
1112
+ z2.nullish(
1203
1113
  wire({
1204
- deposit_done: z4._default(z4.boolean(), false),
1114
+ deposit_done: z2._default(z2.boolean(), false),
1205
1115
  real_net_loss: money3(),
1206
1116
  target: money3(),
1207
1117
  remaining: money3()
1208
1118
  })
1209
1119
  ),
1210
- z4.transform((progress) => {
1120
+ z2.transform((progress) => {
1211
1121
  if (progress == null || progress.target === null) return null;
1212
1122
  const { target } = progress;
1213
1123
  const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
@@ -1224,9 +1134,9 @@ function statusOf(playerStatus, legacy) {
1224
1134
  if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
1225
1135
  return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
1226
1136
  }
1227
- var referralSchema = () => z4.pipe(
1137
+ var referralSchema = () => z2.pipe(
1228
1138
  wire({
1229
- id: z4.string(),
1139
+ id: z2.string(),
1230
1140
  referee_name: optionalText(),
1231
1141
  status: optionalText(),
1232
1142
  player_status: optionalText(),
@@ -1234,7 +1144,7 @@ var referralSchema = () => z4.pipe(
1234
1144
  deadline_at: optionalTimestamp(),
1235
1145
  progress: progressSchema()
1236
1146
  }),
1237
- z4.transform(
1147
+ z2.transform(
1238
1148
  (r) => ({
1239
1149
  id: r.id,
1240
1150
  refereeName: r.refereeName,
@@ -1250,9 +1160,9 @@ var historySchema = /* @__PURE__ */ lazy(
1250
1160
  referral_code: optionalText(),
1251
1161
  referrals: nullableList(referralSchema()),
1252
1162
  // A nil pointer (`null`) reads as absent, like an omitted pagination.
1253
- pagination: z4.pipe(
1254
- z4.nullish(wire({ page: count2(), limit: count2(), total_items: count2() })),
1255
- z4.transform((value) => value ?? void 0)
1163
+ pagination: z2.pipe(
1164
+ z2.nullish(wire({ page: count2(), limit: count2(), total_items: count2() })),
1165
+ z2.transform((value) => value ?? void 0)
1256
1166
  )
1257
1167
  })
1258
1168
  );
@@ -1293,12 +1203,12 @@ function createReferralsApi(transport) {
1293
1203
  }
1294
1204
  var HTTP_URL = "Expected an absolute http(s) URL";
1295
1205
  var sessionSchema2 = /* @__PURE__ */ lazy(
1296
- () => z4.pipe(
1206
+ () => z2.pipe(
1297
1207
  wire({
1298
1208
  // The separate token only exists on the wire: the schema declares it (strict contract) and the output drops it.
1299
- operator_token: z4.string(),
1300
- launch_url: z4.string().check(
1301
- z4.refine(
1209
+ operator_token: z2.string(),
1210
+ launch_url: z2.string().check(
1211
+ z2.refine(
1302
1212
  (value) => {
1303
1213
  try {
1304
1214
  const { protocol } = new URL(value);
@@ -1310,10 +1220,10 @@ var sessionSchema2 = /* @__PURE__ */ lazy(
1310
1220
  { message: HTTP_URL }
1311
1221
  )
1312
1222
  ),
1313
- expires_in_seconds: z4.number().check(z4.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
1223
+ expires_in_seconds: z2.number().check(z2.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
1314
1224
  }),
1315
1225
  // The clock is read when the response is interpreted (= moment of the response).
1316
- z4.transform(({ launchUrl, expiresInSeconds }) => ({
1226
+ z2.transform(({ launchUrl, expiresInSeconds }) => ({
1317
1227
  launchUrl,
1318
1228
  expiresInSeconds,
1319
1229
  expiresAt: Date.now() + expiresInSeconds * 1e3
@@ -1340,6 +1250,7 @@ function createIgaming(client) {
1340
1250
  const transport = extension.getExtensionTransport(client);
1341
1251
  const igaming = {
1342
1252
  casino: createCasinoApi(transport),
1253
+ club: createClubApi(transport),
1343
1254
  bonus: createBonusApi(transport),
1344
1255
  missions: createMissionsApi(transport),
1345
1256
  loyalty: createLoyaltyApi(transport),
@@ -1355,6 +1266,9 @@ function createIgaming(client) {
1355
1266
  });
1356
1267
  }
1357
1268
  extension.registerProductClient(igaming, client);
1269
+ Object.defineProperty(igaming, LOCALE, {
1270
+ value: () => typeof transport.getLocale === "function" ? transport.getLocale() : void 0
1271
+ });
1358
1272
  return igaming;
1359
1273
  }
1360
1274