@tma.js/sdk-react 2.2.6 → 2.2.8

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,21 +1,21 @@
1
- import { jsx as Rt } from "react/jsx-runtime";
2
- import { createContext as re, useContext as ie, useState as rt, useEffect as R, useRef as bt, useCallback as oe, useMemo as ae } from "react";
3
- var ce = Object.defineProperty, he = (e, t, s) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, c = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s);
4
- function xt(e, t) {
1
+ import { jsx as Pt } from "react/jsx-runtime";
2
+ import { createContext as ne, useContext as re, useState as rt, useEffect as R, useRef as mt, useCallback as ie, useMemo as oe } from "react";
3
+ var ae = Object.defineProperty, ce = (e, t, s) => t in e ? ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, c = (e, t, s) => ce(e, typeof t != "symbol" ? t + "" : t, s);
4
+ function Rt(e, t) {
5
5
  let s;
6
6
  const n = () => {
7
7
  s !== void 0 && t && t(s), s = void 0;
8
8
  };
9
9
  return [() => s === void 0 ? s = e(n) : s, n];
10
10
  }
11
- function Ct(e) {
11
+ function xt(e) {
12
12
  const t = j(), { count: s } = t;
13
- t.unsubscribe(e), s && !t.count && Ae();
13
+ t.unsubscribe(e), s && !t.count && Se();
14
14
  }
15
- function pe(e) {
16
- return j().subscribe(e), () => Ct(e);
15
+ function he(e) {
16
+ return j().subscribe(e), () => xt(e);
17
17
  }
18
- class ue {
18
+ class pe {
19
19
  constructor(t, s = {}) {
20
20
  this.scope = t, this.options = s;
21
21
  }
@@ -55,18 +55,18 @@ class ue {
55
55
  this.print("log", ...t);
56
56
  }
57
57
  }
58
- const it = new ue("SDK", {
58
+ const it = new pe("SDK", {
59
59
  bgColor: "forestgreen",
60
60
  textColor: "white"
61
61
  });
62
62
  let X = !1;
63
- const vt = ({ name: e, payload: t }) => {
63
+ const bt = ({ name: e, payload: t }) => {
64
64
  it.log("Event received:", t ? { name: e, payload: t } : { name: e });
65
65
  };
66
- function le(e) {
67
- X !== e && (X = e, e ? pe(vt) : Ct(vt));
66
+ function ue(e) {
67
+ X !== e && (X = e, e ? he(bt) : xt(bt));
68
68
  }
69
- function de(...e) {
69
+ function le(...e) {
70
70
  X && it.log(...e);
71
71
  }
72
72
  class D {
@@ -144,7 +144,7 @@ function tt(e, t, s) {
144
144
  }
145
145
  function ot(...e) {
146
146
  let t = !1;
147
- const s = [...e];
147
+ const s = e.flat(1);
148
148
  return [
149
149
  (n) => !t && s.push(n),
150
150
  () => {
@@ -158,12 +158,12 @@ class W extends Error {
158
158
  super(s, { cause: n }), this.type = t, Object.setPrototypeOf(this, W.prototype);
159
159
  }
160
160
  }
161
- function b(e, t, s) {
161
+ function m(e, t, s) {
162
162
  return new W(e, t, s);
163
163
  }
164
- const _e = "ERR_METHOD_UNSUPPORTED", we = "ERR_METHOD_PARAMETER_UNSUPPORTED", ge = "ERR_UNKNOWN_ENV", fe = "ERR_INVOKE_CUSTOM_METHOD_RESPONSE", me = "ERR_TIMED_OUT", be = "ERR_UNEXPECTED_TYPE", St = "ERR_PARSE", ve = "ERR_NAVIGATION_LIST_EMPTY", ye = "ERR_NAVIGATION_CURSOR_INVALID", dn = "ERR_NAVIGATION_ITEM_INVALID", _n = "ERR_SSR_INIT", Ee = "ERR_INVALID_PATH_BASE";
164
+ const de = "ERR_METHOD_UNSUPPORTED", _e = "ERR_METHOD_PARAMETER_UNSUPPORTED", ge = "ERR_UNKNOWN_ENV", we = "ERR_INVOKE_CUSTOM_METHOD_RESPONSE", fe = "ERR_TIMED_OUT", me = "ERR_UNEXPECTED_TYPE", Ct = "ERR_PARSE", be = "ERR_NAVIGATION_LIST_EMPTY", ve = "ERR_NAVIGATION_CURSOR_INVALID", _n = "ERR_NAVIGATION_ITEM_INVALID", gn = "ERR_SSR_INIT", ye = "ERR_INVALID_PATH_BASE";
165
165
  function T() {
166
- return b(be, "Value has unexpected type");
166
+ return m(me, "Value has unexpected type");
167
167
  }
168
168
  class G {
169
169
  constructor(t, s, n) {
@@ -180,8 +180,8 @@ class G {
180
180
  try {
181
181
  return this.parser(t);
182
182
  } catch (s) {
183
- throw b(
184
- St,
183
+ throw m(
184
+ Ct,
185
185
  `Unable to parse value${this.type ? ` as ${this.type}` : ""}`,
186
186
  s
187
187
  );
@@ -204,7 +204,7 @@ const E = A((e) => {
204
204
  return !1;
205
205
  throw T();
206
206
  }, "boolean");
207
- function Tt(e, t) {
207
+ function St(e, t) {
208
208
  const s = {};
209
209
  for (const n in e) {
210
210
  const r = e[n];
@@ -221,21 +221,21 @@ function Tt(e, t) {
221
221
  const a = o(t(i));
222
222
  a !== void 0 && (s[n] = a);
223
223
  } catch (a) {
224
- throw b(St, `Unable to parse field "${n}"`, a);
224
+ throw m(Ct, `Unable to parse field "${n}"`, a);
225
225
  }
226
226
  }
227
227
  return s;
228
228
  }
229
- function at(e) {
229
+ function Tt(e) {
230
230
  let t = e;
231
231
  if (typeof t == "string" && (t = JSON.parse(t)), typeof t != "object" || t === null || Array.isArray(t))
232
232
  throw T();
233
233
  return t;
234
234
  }
235
- function w(e, t) {
235
+ function v(e, t) {
236
236
  return new G((s) => {
237
- const n = at(s);
238
- return Tt(e, (r) => n[r]);
237
+ const n = Tt(s);
238
+ return St(e, (r) => n[r]);
239
239
  }, !1, t);
240
240
  }
241
241
  const x = A((e) => {
@@ -247,43 +247,18 @@ const x = A((e) => {
247
247
  return t;
248
248
  }
249
249
  throw T();
250
- }, "number");
251
- function ct(e) {
252
- return /^#[\da-f]{6}$/i.test(e);
253
- }
254
- function Pe(e) {
255
- return /^#[\da-f]{3}$/i.test(e);
256
- }
257
- function At(e) {
258
- const t = e.replace(/\s/g, "").toLowerCase();
259
- if (ct(t))
260
- return t;
261
- if (Pe(t)) {
262
- let n = "#";
263
- for (let r = 0; r < 3; r += 1)
264
- n += t[1 + r].repeat(2);
265
- return n;
266
- }
267
- const s = t.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/) || t.match(/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),\d{1,3}\)$/);
268
- if (!s)
269
- throw new Error(`Value "${e}" does not satisfy any of known RGB formats.`);
270
- return s.slice(1).reduce((n, r) => {
271
- const i = parseInt(r, 10).toString(16);
272
- return n + (i.length === 1 ? "0" : "") + i;
273
- }, "#");
274
- }
275
- const h = A((e) => {
250
+ }, "number"), u = A((e) => {
276
251
  if (typeof e == "string" || typeof e == "number")
277
252
  return e.toString();
278
253
  throw T();
279
- }, "string"), It = A((e) => At(h().parse(e)), "rgb");
280
- function kt(e) {
281
- return w({
282
- eventType: h(),
254
+ }, "string");
255
+ function At(e) {
256
+ return v({
257
+ eventType: u(),
283
258
  eventData: (t) => t
284
259
  }).parse(e);
285
260
  }
286
- function Re() {
261
+ function Ee() {
287
262
  ["TelegramGameProxy_receiveEvent", "TelegramGameProxy", "Telegram"].forEach((e) => {
288
263
  delete window[e];
289
264
  });
@@ -295,7 +270,7 @@ function et(e, t) {
295
270
  source: window.parent
296
271
  }));
297
272
  }
298
- function xe() {
273
+ function Pe() {
299
274
  [
300
275
  ["TelegramGameProxy_receiveEvent"],
301
276
  // Windows Phone.
@@ -314,48 +289,38 @@ function xe() {
314
289
  });
315
290
  });
316
291
  }
317
- const Ce = {
318
- clipboard_text_received: w({
319
- req_id: h(),
320
- data: (e) => e === null ? e : h().optional().parse(e)
292
+ const Re = {
293
+ clipboard_text_received: v({
294
+ req_id: u(),
295
+ data: (e) => e === null ? e : u().optional().parse(e)
321
296
  }),
322
- custom_method_invoked: w({
323
- req_id: h(),
297
+ custom_method_invoked: v({
298
+ req_id: u(),
324
299
  result: (e) => e,
325
- error: h().optional()
300
+ error: u().optional()
326
301
  }),
327
- invoice_closed: w({ slug: h(), status: h() }),
328
- phone_requested: w({ status: h() }),
329
302
  popup_closed: {
330
303
  parse(e) {
331
- return w({
332
- button_id: (t) => t == null ? void 0 : h().parse(t)
304
+ return v({
305
+ button_id: (t) => t == null ? void 0 : u().parse(t)
333
306
  }).parse(e ?? {});
334
307
  }
335
308
  },
336
- qr_text_received: w({ data: h().optional() }),
337
- theme_changed: w({
338
- theme_params: (e) => {
339
- const t = It().optional();
340
- return Object.entries(at(e)).reduce((s, [n, r]) => (s[n] = t.parse(r), s), {});
341
- }
342
- }),
343
- viewport_changed: w({
309
+ viewport_changed: v({
344
310
  height: x(),
345
311
  width: (e) => e == null ? window.innerWidth : x().parse(e),
346
312
  is_state_stable: E(),
347
313
  is_expanded: E()
348
- }),
349
- write_access_requested: w({ status: h() })
314
+ })
350
315
  };
351
- function Se() {
316
+ function xe() {
352
317
  const e = new D(), t = new D();
353
318
  t.subscribe((n) => {
354
319
  e.emit("event", { name: n.event, payload: n.args[0] });
355
- }), xe();
320
+ }), Pe();
356
321
  const [, s] = ot(
357
322
  // Don't forget to remove created handlers.
358
- Re,
323
+ Ee,
359
324
  // Add "resize" event listener to make sure, we always have fresh viewport information.
360
325
  // Desktop version of Telegram is sometimes not sending the viewport_changed
361
326
  // event. For example, when the MainButton is shown. That's why we should
@@ -376,19 +341,21 @@ function Se() {
376
341
  return;
377
342
  let r;
378
343
  try {
379
- r = kt(n.data);
344
+ r = At(n.data);
380
345
  } catch {
381
346
  return;
382
347
  }
383
- const { eventType: i, eventData: o } = r, a = Ce[i];
348
+ const { eventType: i, eventData: o } = r, a = Re[i];
384
349
  try {
385
- const p = a ? a.parse(o) : o;
386
- t.emit(...p ? [i, p] : [i]);
387
- } catch (p) {
350
+ const h = a ? a.parse(o) : o;
351
+ t.emit(...h ? [i, h] : [i]);
352
+ } catch (h) {
388
353
  it.error(
389
- `An error occurred processing the "${i}" event from the Telegram application. Please, file an issue here: https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose`,
354
+ `An error occurred processing the "${i}" event from the Telegram application.
355
+ Please, file an issue here:
356
+ https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose`,
390
357
  r,
391
- p
358
+ h
392
359
  );
393
360
  }
394
361
  }),
@@ -410,9 +377,9 @@ function Se() {
410
377
  }
411
378
  }, s];
412
379
  }
413
- const [Te, Ae] = xt(
380
+ const [Ce, Se] = Rt(
414
381
  (e) => {
415
- const [t, s] = Se(), n = t.off.bind(t);
382
+ const [t, s] = xe(), n = t.off.bind(t);
416
383
  return t.off = (r, i) => {
417
384
  const { count: o } = t;
418
385
  n(r, i), o && !t.count && e();
@@ -421,7 +388,7 @@ const [Te, Ae] = xt(
421
388
  ([, e]) => e()
422
389
  );
423
390
  function j() {
424
- return Te()[0];
391
+ return Ce()[0];
425
392
  }
426
393
  function z(e, t) {
427
394
  j().off(e, t);
@@ -429,10 +396,10 @@ function z(e, t) {
429
396
  function y(e, t, s) {
430
397
  return j().on(e, t, s);
431
398
  }
432
- function V(e) {
399
+ function L(e) {
433
400
  return typeof e == "object" && e !== null && !Array.isArray(e);
434
401
  }
435
- function Ie(e, t) {
402
+ function Te(e, t) {
436
403
  const s = e.split("."), n = t.split("."), r = Math.max(s.length, n.length);
437
404
  for (let i = 0; i < r; i += 1) {
438
405
  const o = parseInt(s[i] || "0", 10), a = parseInt(n[i] || "0", 10);
@@ -441,21 +408,21 @@ function Ie(e, t) {
441
408
  }
442
409
  return 0;
443
410
  }
444
- function m(e, t) {
445
- return Ie(e, t) <= 0;
411
+ function f(e, t) {
412
+ return Te(e, t) <= 0;
446
413
  }
447
414
  function C(e, t, s) {
448
415
  if (typeof s == "string") {
449
416
  if (e === "web_app_open_link") {
450
417
  if (t === "try_instant_view")
451
- return m("6.4", s);
418
+ return f("6.4", s);
452
419
  if (t === "try_browser")
453
- return m("7.6", s);
420
+ return f("7.6", s);
454
421
  }
455
422
  if (e === "web_app_set_header_color" && t === "color")
456
- return m("6.9", s);
423
+ return f("6.9", s);
457
424
  if (e === "web_app_close" && t === "return_back")
458
- return m("7.6", s);
425
+ return f("7.6", s);
459
426
  }
460
427
  switch (e) {
461
428
  case "web_app_open_tg_link":
@@ -464,27 +431,27 @@ function C(e, t, s) {
464
431
  case "web_app_set_background_color":
465
432
  case "web_app_set_header_color":
466
433
  case "web_app_trigger_haptic_feedback":
467
- return m("6.1", t);
434
+ return f("6.1", t);
468
435
  case "web_app_open_popup":
469
- return m("6.2", t);
436
+ return f("6.2", t);
470
437
  case "web_app_close_scan_qr_popup":
471
438
  case "web_app_open_scan_qr_popup":
472
439
  case "web_app_read_text_from_clipboard":
473
- return m("6.4", t);
440
+ return f("6.4", t);
474
441
  case "web_app_switch_inline_query":
475
- return m("6.7", t);
442
+ return f("6.7", t);
476
443
  case "web_app_invoke_custom_method":
477
444
  case "web_app_request_write_access":
478
445
  case "web_app_request_phone":
479
- return m("6.9", t);
446
+ return f("6.9", t);
480
447
  case "web_app_setup_settings_button":
481
- return m("6.10", t);
448
+ return f("6.10", t);
482
449
  case "web_app_biometry_get_info":
483
450
  case "web_app_biometry_open_settings":
484
451
  case "web_app_biometry_request_access":
485
452
  case "web_app_biometry_request_auth":
486
453
  case "web_app_biometry_update_token":
487
- return m("7.2", t);
454
+ return f("7.2", t);
488
455
  default:
489
456
  return [
490
457
  "iframe_ready",
@@ -501,94 +468,93 @@ function C(e, t, s) {
501
468
  ].includes(e);
502
469
  }
503
470
  }
504
- function qt(e) {
505
- return "external" in e && V(e.external) && "notify" in e.external && typeof e.external.notify == "function";
471
+ function It(e) {
472
+ return "external" in e && L(e.external) && "notify" in e.external && typeof e.external.notify == "function";
506
473
  }
507
- function Ot(e) {
508
- return "TelegramWebviewProxy" in e && V(e.TelegramWebviewProxy) && "postEvent" in e.TelegramWebviewProxy && typeof e.TelegramWebviewProxy.postEvent == "function";
474
+ function kt(e) {
475
+ return "TelegramWebviewProxy" in e && L(e.TelegramWebviewProxy) && "postEvent" in e.TelegramWebviewProxy && typeof e.TelegramWebviewProxy.postEvent == "function";
509
476
  }
510
- function ht() {
477
+ function at() {
511
478
  try {
512
479
  return window.self !== window.top;
513
480
  } catch {
514
481
  return !0;
515
482
  }
516
483
  }
517
- let Nt = "https://web.telegram.org";
484
+ const Ae = "https://web.telegram.org";
485
+ let Ot = Ae;
518
486
  function wn(e) {
519
- Nt = e;
487
+ Ot = e;
520
488
  }
521
- function ke() {
522
- return Nt;
489
+ function Ie() {
490
+ return Ot;
523
491
  }
524
- function B(e, t, s) {
492
+ function V(e, t, s) {
525
493
  let n = {}, r;
526
- t === void 0 && s === void 0 ? n = {} : t !== void 0 && s !== void 0 ? (n = s, r = t) : t !== void 0 && ("targetOrigin" in t ? n = t : r = t);
527
- const { targetOrigin: i = ke() } = n;
528
- if (de("Posting event:", r ? { event: e, data: r } : { event: e }), ht()) {
529
- window.parent.postMessage(JSON.stringify({ eventType: e, eventData: r }), i);
530
- return;
531
- }
532
- if (qt(window)) {
494
+ if (!t && !s ? n = {} : t && s ? (n = s, r = t) : t && ("targetOrigin" in t ? n = t : r = t), le("Posting event:", r ? { event: e, data: r } : { event: e }), at())
495
+ return window.parent.postMessage(
496
+ JSON.stringify({ eventType: e, eventData: r }),
497
+ n.targetOrigin || Ie()
498
+ );
499
+ if (It(window)) {
533
500
  window.external.notify(JSON.stringify({ eventType: e, eventData: r }));
534
501
  return;
535
502
  }
536
- if (Ot(window)) {
503
+ if (kt(window)) {
537
504
  window.TelegramWebviewProxy.postEvent(e, JSON.stringify(r));
538
505
  return;
539
506
  }
540
- throw b(
507
+ throw m(
541
508
  ge,
542
- "Unable to determine current environment and possible way to send event. You are probably trying to use Mini Apps method outside of Telegram application environment."
509
+ "Unable to determine current environment and possible way to send event. You are probably trying to use Mini Apps method outside the Telegram application environment."
543
510
  );
544
511
  }
545
- function qe(e) {
512
+ function ke(e) {
546
513
  return (t, s) => {
547
514
  if (!C(t, e))
548
- throw b(_e, `Method "${t}" is unsupported in Mini Apps version ${e}`);
549
- if (V(s)) {
550
- let n;
551
- if (t === "web_app_open_link" && "try_instant_view" in s ? n = "try_instant_view" : t === "web_app_set_header_color" && "color" in s && (n = "color"), n && !C(t, n, e))
552
- throw b(
553
- we,
554
- `Parameter "${n}" of "${t}" method is unsupported in Mini Apps version ${e}`
555
- );
556
- }
557
- return B(t, s);
515
+ throw m(de, `Method "${t}" is unsupported in Mini Apps version ${e}`);
516
+ if (L(s) && t === "web_app_set_header_color" && "color" in s && !C(t, "color", e))
517
+ throw m(
518
+ _e,
519
+ `Parameter "color" of "${t}" method is unsupported in Mini Apps version ${e}`
520
+ );
521
+ return V(t, s);
558
522
  };
559
523
  }
560
- function Dt(e) {
524
+ function qt(e) {
561
525
  return ({ req_id: t }) => t === e;
562
526
  }
563
- function Bt(e) {
564
- return b(me, `Timeout reached: ${e}ms`);
527
+ function Nt(e) {
528
+ return m(fe, `Timeout reached: ${e}ms`);
565
529
  }
566
- function Mt(e, t) {
530
+ function Dt(e, t) {
567
531
  return Promise.race([
568
532
  typeof e == "function" ? e() : e,
569
533
  new Promise((s, n) => {
570
534
  setTimeout(() => {
571
- n(Bt(t));
535
+ n(Nt(t));
572
536
  }, t);
573
537
  })
574
538
  ]);
575
539
  }
576
540
  async function g(e) {
577
541
  let t;
578
- const s = new Promise((a) => {
579
- t = a;
580
- }), { event: n, capture: r, timeout: i } = e, [, o] = ot(
581
- ...(Array.isArray(n) ? n : [n]).map(
582
- (a) => y(a, (p) => (!r || r(p)) && t(p))
583
- )
542
+ const s = new Promise((a) => t = a), { event: n, capture: r, timeout: i } = e, [, o] = ot(
543
+ // We need to iterate over all tracked events, and create their event listeners.
544
+ (Array.isArray(n) ? n : [n]).map((a) => y(a, (h) => {
545
+ (!r || (Array.isArray(n) ? r({
546
+ event: a,
547
+ payload: h
548
+ }) : r(h))) && t(h);
549
+ }))
584
550
  );
585
551
  try {
586
- return (e.postEvent || B)(e.method, e.params), await (i ? Mt(s, i) : s);
552
+ return (e.postEvent || V)(e.method, e.params), await (i ? Dt(s, i) : s);
587
553
  } finally {
588
554
  o();
589
555
  }
590
556
  }
591
- async function O(e, t, s, n = {}) {
557
+ async function q(e, t, s, n = {}) {
592
558
  const {
593
559
  result: r,
594
560
  error: i
@@ -601,30 +567,54 @@ async function O(e, t, s, n = {}) {
601
567
  params: t,
602
568
  req_id: s
603
569
  },
604
- capture: Dt(s)
570
+ capture: qt(s)
605
571
  });
606
572
  if (i)
607
- throw b(fe, i);
573
+ throw m(we, i);
608
574
  return r;
609
575
  }
610
576
  function st(...e) {
611
577
  return e.map((t) => {
612
578
  if (typeof t == "string")
613
579
  return t;
614
- if (V(t))
580
+ if (L(t))
615
581
  return st(Object.entries(t).map((s) => s[1] && s[0]));
616
582
  if (Array.isArray(t))
617
583
  return st(...t);
618
584
  }).filter(Boolean).join(" ");
619
585
  }
620
- function gn(...e) {
621
- return e.reduce((t, s) => (V(s) && Object.entries(s).forEach(([n, r]) => {
586
+ function fn(...e) {
587
+ return e.reduce((t, s) => (L(s) && Object.entries(s).forEach(([n, r]) => {
622
588
  const i = st(t[n], r);
623
589
  i.length && (t[n] = i);
624
590
  }), t), {});
625
591
  }
592
+ function ct(e) {
593
+ return /^#[\da-f]{6}$/i.test(e);
594
+ }
595
+ function Oe(e) {
596
+ return /^#[\da-f]{3}$/i.test(e);
597
+ }
626
598
  function Vt(e) {
627
- const t = At(e);
599
+ const t = e.replace(/\s/g, "").toLowerCase();
600
+ if (ct(t))
601
+ return t;
602
+ if (Oe(t)) {
603
+ let n = "#";
604
+ for (let r = 0; r < 3; r += 1)
605
+ n += t[1 + r].repeat(2);
606
+ return n;
607
+ }
608
+ const s = t.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/) || t.match(/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),\d{1,3}\)$/);
609
+ if (!s)
610
+ throw new Error(`Value "${e}" does not satisfy any of known RGB formats.`);
611
+ return s.slice(1).reduce((n, r) => {
612
+ const i = parseInt(r, 10).toString(16);
613
+ return n + (i.length === 1 ? "0" : "") + i;
614
+ }, "#");
615
+ }
616
+ function Bt(e) {
617
+ const t = Vt(e);
628
618
  return Math.sqrt(
629
619
  [0.299, 0.587, 0.114].reduce((s, n, r) => {
630
620
  const i = parseInt(t.slice(1 + r * 2, 1 + (r + 1) * 2), 16);
@@ -632,7 +622,7 @@ function Vt(e) {
632
622
  }, 0)
633
623
  ) < 120;
634
624
  }
635
- class Oe {
625
+ class qe {
636
626
  constructor(t) {
637
627
  c(this, "ee", new D()), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.state = t;
638
628
  }
@@ -653,20 +643,20 @@ class Oe {
653
643
  return this.state[t];
654
644
  }
655
645
  }
656
- class pt {
646
+ class ht {
657
647
  constructor(t) {
658
- c(this, "state"), c(this, "get"), c(this, "set"), c(this, "clone"), this.state = new Oe(t), this.set = this.state.set.bind(this.state), this.get = this.state.get.bind(this.state), this.clone = this.state.clone.bind(this.state);
648
+ c(this, "state"), c(this, "get"), c(this, "set"), c(this, "clone"), this.state = new qe(t), this.set = this.state.set.bind(this.state), this.get = this.state.get.bind(this.state), this.clone = this.state.clone.bind(this.state);
659
649
  }
660
650
  }
661
- function Lt(e, t) {
651
+ function Mt(e, t) {
662
652
  return (s) => C(t[s], e);
663
653
  }
664
- class ut extends pt {
654
+ class pt extends ht {
665
655
  constructor(t, s, n) {
666
- super(t), c(this, "supports"), this.supports = Lt(s, n);
656
+ super(t), c(this, "supports"), this.supports = Mt(s, n);
667
657
  }
668
658
  }
669
- class Ne extends ut {
659
+ class Ne extends pt {
670
660
  constructor(t, s, n) {
671
661
  super({ isVisible: t }, s, {
672
662
  show: "web_app_setup_back_button",
@@ -695,28 +685,28 @@ class Ne extends ut {
695
685
  this.isVisible = !0;
696
686
  }
697
687
  }
698
- const $t = A((e) => e instanceof Date ? e : new Date(x().parse(e) * 1e3), "Date");
699
- function lt(e, t) {
688
+ const Lt = A((e) => e instanceof Date ? e : new Date(x().parse(e) * 1e3), "Date");
689
+ function ut(e, t) {
700
690
  return new G((s) => {
701
691
  if (typeof s != "string" && !(s instanceof URLSearchParams))
702
692
  throw T();
703
693
  const n = typeof s == "string" ? new URLSearchParams(s) : s;
704
- return Tt(e, (r) => {
694
+ return St(e, (r) => {
705
695
  const i = n.get(r);
706
696
  return i === null ? void 0 : i;
707
697
  });
708
698
  }, !1, t);
709
699
  }
710
- const De = w({
700
+ const De = v({
711
701
  id: x(),
712
- type: h(),
713
- title: h(),
702
+ type: u(),
703
+ title: u(),
714
704
  photoUrl: {
715
- type: h().optional(),
705
+ type: u().optional(),
716
706
  from: "photo_url"
717
707
  },
718
- username: h().optional()
719
- }, "Chat").optional(), yt = w({
708
+ username: u().optional()
709
+ }, "Chat").optional(), vt = v({
720
710
  addedToAttachmentMenu: {
721
711
  type: E().optional(),
722
712
  from: "added_to_attachment_menu"
@@ -726,7 +716,7 @@ const De = w({
726
716
  from: "allows_write_to_pm"
727
717
  },
728
718
  firstName: {
729
- type: h(),
719
+ type: u(),
730
720
  from: "first_name"
731
721
  },
732
722
  id: x(),
@@ -739,23 +729,23 @@ const De = w({
739
729
  from: "is_premium"
740
730
  },
741
731
  languageCode: {
742
- type: h().optional(),
732
+ type: u().optional(),
743
733
  from: "language_code"
744
734
  },
745
735
  lastName: {
746
- type: h().optional(),
736
+ type: u().optional(),
747
737
  from: "last_name"
748
738
  },
749
739
  photoUrl: {
750
- type: h().optional(),
740
+ type: u().optional(),
751
741
  from: "photo_url"
752
742
  },
753
- username: h().optional()
743
+ username: u().optional()
754
744
  }, "User").optional();
755
- function Ht() {
756
- return lt({
745
+ function $t() {
746
+ return ut({
757
747
  authDate: {
758
- type: $t(),
748
+ type: Lt(),
759
749
  from: "auth_date"
760
750
  },
761
751
  canSendAfter: {
@@ -764,55 +754,56 @@ function Ht() {
764
754
  },
765
755
  chat: De,
766
756
  chatInstance: {
767
- type: h().optional(),
757
+ type: u().optional(),
768
758
  from: "chat_instance"
769
759
  },
770
760
  chatType: {
771
- type: h().optional(),
761
+ type: u().optional(),
772
762
  from: "chat_type"
773
763
  },
774
- hash: h(),
764
+ hash: u(),
775
765
  queryId: {
776
- type: h().optional(),
766
+ type: u().optional(),
777
767
  from: "query_id"
778
768
  },
779
- receiver: yt,
769
+ receiver: vt,
780
770
  startParam: {
781
- type: h().optional(),
771
+ type: u().optional(),
782
772
  from: "start_param"
783
773
  },
784
- user: yt
774
+ user: vt
785
775
  }, "InitData");
786
776
  }
777
+ const Ve = A((e) => Vt(u().parse(e)), "rgb");
787
778
  function Be(e) {
788
779
  return e.replace(/_[a-z]/g, (t) => t[1].toUpperCase());
789
780
  }
790
781
  function Me(e) {
791
782
  return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
792
783
  }
793
- const Ut = A(
784
+ const Ht = A(
794
785
  (e) => {
795
- const t = It().optional();
796
- return Object.entries(at(e)).reduce((s, [n, r]) => (s[Be(n)] = t.parse(r), s), {});
786
+ const t = Ve().optional();
787
+ return Object.entries(Tt(e)).reduce((s, [n, r]) => (s[Be(n)] = t.parse(r), s), {});
797
788
  },
798
789
  "ThemeParams"
799
790
  );
800
- function dt(e) {
801
- return lt({
791
+ function lt(e) {
792
+ return ut({
802
793
  botInline: {
803
794
  type: E().optional(),
804
795
  from: "tgWebAppBotInline"
805
796
  },
806
797
  initData: {
807
- type: Ht().optional(),
798
+ type: $t().optional(),
808
799
  from: "tgWebAppData"
809
800
  },
810
801
  initDataRaw: {
811
- type: h().optional(),
802
+ type: u().optional(),
812
803
  from: "tgWebAppData"
813
804
  },
814
805
  platform: {
815
- type: h(),
806
+ type: u(),
816
807
  from: "tgWebAppPlatform"
817
808
  },
818
809
  showSettings: {
@@ -820,60 +811,60 @@ function dt(e) {
820
811
  from: "tgWebAppShowSettings"
821
812
  },
822
813
  startParam: {
823
- type: h().optional(),
814
+ type: u().optional(),
824
815
  from: "tgWebAppStartParam"
825
816
  },
826
817
  themeParams: {
827
- type: Ut(),
818
+ type: Ht(),
828
819
  from: "tgWebAppThemeParams"
829
820
  },
830
821
  version: {
831
- type: h(),
822
+ type: u(),
832
823
  from: "tgWebAppVersion"
833
824
  }
834
825
  }).parse(e);
835
826
  }
836
- function Wt(e) {
837
- return dt(
827
+ function Ut(e) {
828
+ return lt(
838
829
  e.replace(/^[^?#]*[?#]/, "").replace(/[?#]/g, "&")
839
830
  );
840
831
  }
841
- function Ve() {
842
- return Wt(window.location.href);
832
+ function Le() {
833
+ return Ut(window.location.href);
843
834
  }
844
- function Gt() {
835
+ function Wt() {
845
836
  return performance.getEntriesByType("navigation")[0];
846
837
  }
847
- function Le() {
848
- const e = Gt();
838
+ function $e() {
839
+ const e = Wt();
849
840
  if (!e)
850
841
  throw new Error("Unable to get first navigation entry.");
851
- return Wt(e.name);
842
+ return Ut(e.name);
852
843
  }
853
- function jt(e) {
844
+ function Gt(e) {
854
845
  return `tma.js/${e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`)}`;
855
846
  }
856
- function zt(e, t) {
857
- sessionStorage.setItem(jt(e), JSON.stringify(t));
847
+ function jt(e, t) {
848
+ sessionStorage.setItem(Gt(e), JSON.stringify(t));
858
849
  }
859
- function Kt(e) {
860
- const t = sessionStorage.getItem(jt(e));
850
+ function zt(e) {
851
+ const t = sessionStorage.getItem(Gt(e));
861
852
  try {
862
853
  return t ? JSON.parse(t) : void 0;
863
854
  } catch {
864
855
  }
865
856
  }
866
- function $e() {
867
- return dt(Kt("launchParams") || "");
857
+ function He() {
858
+ return lt(zt("launchParams") || "");
868
859
  }
869
- function Jt(e) {
860
+ function Kt(e) {
870
861
  return JSON.stringify(
871
862
  Object.fromEntries(
872
863
  Object.entries(e).map(([t, s]) => [Me(t), s])
873
864
  )
874
865
  );
875
866
  }
876
- function He(e) {
867
+ function Ue(e) {
877
868
  const {
878
869
  initDataRaw: t,
879
870
  themeParams: s,
@@ -882,44 +873,44 @@ function He(e) {
882
873
  showSettings: i,
883
874
  startParam: o,
884
875
  botInline: a
885
- } = e, p = new URLSearchParams();
886
- return p.set("tgWebAppPlatform", n), p.set("tgWebAppThemeParams", Jt(s)), p.set("tgWebAppVersion", r), t && p.set("tgWebAppData", t), o && p.set("tgWebAppStartParam", o), typeof i == "boolean" && p.set("tgWebAppShowSettings", i ? "1" : "0"), typeof a == "boolean" && p.set("tgWebAppBotInline", a ? "1" : "0"), p.toString();
876
+ } = e, h = new URLSearchParams();
877
+ return h.set("tgWebAppPlatform", n), h.set("tgWebAppThemeParams", Kt(s)), h.set("tgWebAppVersion", r), t && h.set("tgWebAppData", t), o && h.set("tgWebAppStartParam", o), typeof i == "boolean" && h.set("tgWebAppShowSettings", i ? "1" : "0"), typeof a == "boolean" && h.set("tgWebAppBotInline", a ? "1" : "0"), h.toString();
887
878
  }
888
- function Ft(e) {
889
- zt("launchParams", He(e));
879
+ function Jt(e) {
880
+ jt("launchParams", Ue(e));
890
881
  }
891
882
  function nt() {
892
883
  for (const e of [
893
884
  // Try to retrieve launch parameters from the current location. This method can return
894
885
  // nothing in case, location was changed and then page was reloaded.
895
- Ve,
896
- // Then, try using the lower level API - window.performance.
897
886
  Le,
887
+ // Then, try using the lower level API - window.performance.
888
+ $e,
898
889
  // Finally, try to extract launch parameters from the session storage.
899
- $e
890
+ He
900
891
  ])
901
892
  try {
902
893
  const t = e();
903
- return Ft(t), t;
894
+ return Jt(t), t;
904
895
  } catch {
905
896
  }
906
897
  throw new Error("Unable to retrieve launch parameters from any known source.");
907
898
  }
908
- function Qt() {
909
- const e = Gt();
899
+ function Ft() {
900
+ const e = Wt();
910
901
  return !!(e && e.type === "reload");
911
902
  }
912
- function Ue() {
903
+ function We() {
913
904
  let e = 0;
914
905
  return () => (e += 1).toString();
915
906
  }
916
- const [We] = xt(Ue);
907
+ const [Ge] = Rt(We);
917
908
  function l(e, t) {
918
909
  return () => {
919
910
  const s = nt(), n = {
920
911
  ...s,
921
- postEvent: qe(s.version),
922
- createRequestId: We()
912
+ postEvent: ke(s.version),
913
+ createRequestId: Ge()
923
914
  };
924
915
  if (typeof e == "function")
925
916
  return e(n);
@@ -928,30 +919,30 @@ function l(e, t) {
928
919
  // State should only be passed only in case, current page was reloaded. If we don't add
929
920
  // this check, state restoration will work improperly in the web version of Telegram,
930
921
  // when we are always working in the same "session" (tab).
931
- state: Qt() ? Kt(e) : void 0,
922
+ state: Ft() ? zt(e) : void 0,
932
923
  addCleanup: r
933
- }), p = (u) => (o || r(
934
- u.on("change", (S) => {
935
- zt(e, S);
924
+ }), h = (p) => (o || r(
925
+ p.on("change", (S) => {
926
+ jt(e, S);
936
927
  })
937
- ), u);
928
+ ), p);
938
929
  return [
939
- a instanceof Promise ? a.then(p) : p(a),
930
+ a instanceof Promise ? a.then(h) : h(a),
940
931
  i
941
932
  ];
942
933
  };
943
934
  }
944
- const Ge = l("backButton", ({
935
+ const je = l("backButton", ({
945
936
  postEvent: e,
946
937
  version: t,
947
938
  state: s = { isVisible: !1 }
948
939
  }) => new Ne(s.isVisible, t, e));
949
- class L extends ut {
940
+ class $ extends pt {
950
941
  constructor() {
951
942
  super(...arguments), c(this, "on", this.state.on.bind(this.state)), c(this, "off", this.state.off.bind(this.state));
952
943
  }
953
944
  }
954
- function Yt(e) {
945
+ function Qt(e) {
955
946
  const t = e.available ? e : {
956
947
  available: !1,
957
948
  device_id: "",
@@ -969,7 +960,7 @@ function Yt(e) {
969
960
  accessGranted: t.access_granted
970
961
  };
971
962
  }
972
- class je extends L {
963
+ class ze extends $ {
973
964
  constructor({ postEvent: t, version: s, ...n }) {
974
965
  super(n, s, {
975
966
  auth: "web_app_biometry_request_auth",
@@ -1047,7 +1038,7 @@ class je extends L {
1047
1038
  event: "biometry_info_received",
1048
1039
  params: { reason: t || "" }
1049
1040
  }).then((n) => {
1050
- const r = Yt(n);
1041
+ const r = Qt(n);
1051
1042
  return this.set(r), r.accessGranted;
1052
1043
  }).finally(() => this.accessPromise = void 0)), this.accessPromise;
1053
1044
  }
@@ -1079,8 +1070,8 @@ class je extends L {
1079
1070
  );
1080
1071
  }
1081
1072
  }
1082
- async function ze(e) {
1083
- return Yt(
1073
+ async function Ke(e) {
1074
+ return Qt(
1084
1075
  await g({
1085
1076
  ...e || {},
1086
1077
  method: "web_app_biometry_get_info",
@@ -1088,10 +1079,10 @@ async function ze(e) {
1088
1079
  })
1089
1080
  );
1090
1081
  }
1091
- const Ke = l(
1082
+ const Je = l(
1092
1083
  "biometryManager",
1093
- async ({ postEvent: e, version: t, state: s }) => new je({
1094
- ...s || C("web_app_biometry_get_info", t) ? s || await ze({ timeout: 1e3 }) : {
1084
+ async ({ postEvent: e, version: t, state: s }) => new ze({
1085
+ ...s || C("web_app_biometry_get_info", t) ? s || await Ke({ timeout: 1e3 }) : {
1095
1086
  available: !1,
1096
1087
  accessGranted: !1,
1097
1088
  accessRequested: !1,
@@ -1102,12 +1093,12 @@ const Ke = l(
1102
1093
  postEvent: e
1103
1094
  })
1104
1095
  );
1105
- class _t extends pt {
1096
+ class dt extends ht {
1106
1097
  constructor() {
1107
1098
  super(...arguments), c(this, "on", this.state.on.bind(this.state)), c(this, "off", this.state.off.bind(this.state));
1108
1099
  }
1109
1100
  }
1110
- class Je extends _t {
1101
+ class Fe extends dt {
1111
1102
  constructor(t, s) {
1112
1103
  super({ isConfirmationNeeded: t }), this.postEvent = s;
1113
1104
  }
@@ -1134,19 +1125,19 @@ class Je extends _t {
1134
1125
  this.isConfirmationNeeded = !0;
1135
1126
  }
1136
1127
  }
1137
- const Fe = l(
1128
+ const Qe = l(
1138
1129
  "closingBehavior",
1139
1130
  ({
1140
1131
  postEvent: e,
1141
1132
  state: t = { isConfirmationNeeded: !1 }
1142
- }) => new Je(t.isConfirmationNeeded, e)
1133
+ }) => new Fe(t.isConfirmationNeeded, e)
1143
1134
  );
1144
- class wt {
1135
+ class _t {
1145
1136
  constructor(t, s) {
1146
- c(this, "supports"), this.supports = Lt(t, s);
1137
+ c(this, "supports"), this.supports = Mt(t, s);
1147
1138
  }
1148
1139
  }
1149
- function Qe(e) {
1140
+ function Ye(e) {
1150
1141
  if (Array.isArray(e))
1151
1142
  return e;
1152
1143
  if (typeof e == "string")
@@ -1158,9 +1149,9 @@ function Qe(e) {
1158
1149
  }
1159
1150
  throw T();
1160
1151
  }
1161
- class Ye extends G {
1152
+ class Ze extends G {
1162
1153
  constructor(t, s, n) {
1163
- super(Qe, s, n), c(this, "itemParser"), this.itemParser = typeof t == "function" ? t : t.parse.bind(t);
1154
+ super(Ye, s, n), c(this, "itemParser"), this.itemParser = typeof t == "function" ? t : t.parse.bind(t);
1164
1155
  }
1165
1156
  /**
1166
1157
  * Attempts to parse passed value
@@ -1176,13 +1167,13 @@ class Ye extends G {
1176
1167
  return this.itemParser = typeof t == "function" ? t : t.parse.bind(t), this;
1177
1168
  }
1178
1169
  }
1179
- function Ze(e) {
1180
- return new Ye((t) => t, !1, e);
1170
+ function Xe(e) {
1171
+ return new Ze((t) => t, !1, e);
1181
1172
  }
1182
- function Et(e, t) {
1173
+ function yt(e, t) {
1183
1174
  return Object.fromEntries(e.map((s) => [s, t]));
1184
1175
  }
1185
- class Xe extends wt {
1176
+ class ts extends _t {
1186
1177
  constructor(t, s, n) {
1187
1178
  super(t, {
1188
1179
  delete: "web_app_invoke_custom_method",
@@ -1198,7 +1189,7 @@ class Xe extends wt {
1198
1189
  */
1199
1190
  async delete(t, s = {}) {
1200
1191
  const n = Array.isArray(t) ? t : [t];
1201
- n.length && await O(
1192
+ n.length && await q(
1202
1193
  "deleteStorageValues",
1203
1194
  { keys: n },
1204
1195
  this.createRequestId(),
@@ -1210,8 +1201,8 @@ class Xe extends wt {
1210
1201
  * @param options - request execution options.
1211
1202
  */
1212
1203
  async getKeys(t = {}) {
1213
- return Ze().of(h()).parse(
1214
- await O(
1204
+ return Xe().of(u()).parse(
1205
+ await q(
1215
1206
  "getStorageKeys",
1216
1207
  {},
1217
1208
  this.createRequestId(),
@@ -1222,13 +1213,13 @@ class Xe extends wt {
1222
1213
  async get(t, s = {}) {
1223
1214
  const n = Array.isArray(t) ? t : [t];
1224
1215
  if (!n.length)
1225
- return Et(n, "");
1226
- const r = await O(
1216
+ return yt(n, "");
1217
+ const r = await q(
1227
1218
  "getStorageValues",
1228
1219
  { keys: n },
1229
1220
  this.createRequestId(),
1230
1221
  { ...s, postEvent: this.postEvent }
1231
- ), i = w(Et(n, h()), "CloudStorageData").parse(r);
1222
+ ), i = v(yt(n, u()), "CloudStorageData").parse(r);
1232
1223
  return Array.isArray(t) ? i : i[t];
1233
1224
  }
1234
1225
  /**
@@ -1238,7 +1229,7 @@ class Xe extends wt {
1238
1229
  * @param options - request execution options.
1239
1230
  */
1240
1231
  async set(t, s, n = {}) {
1241
- await O(
1232
+ await q(
1242
1233
  "saveStorageValue",
1243
1234
  { key: t, value: s },
1244
1235
  this.createRequestId(),
@@ -1246,10 +1237,10 @@ class Xe extends wt {
1246
1237
  );
1247
1238
  }
1248
1239
  }
1249
- const ts = l(
1250
- ({ createRequestId: e, postEvent: t, version: s }) => new Xe(s, e, t)
1240
+ const es = l(
1241
+ ({ createRequestId: e, postEvent: t, version: s }) => new ts(s, e, t)
1251
1242
  );
1252
- class es extends wt {
1243
+ class ss extends _t {
1253
1244
  constructor(t, s) {
1254
1245
  super(t, {
1255
1246
  impactOccurred: "web_app_trigger_haptic_feedback",
@@ -1291,10 +1282,10 @@ class es extends wt {
1291
1282
  this.postEvent("web_app_trigger_haptic_feedback", { type: "selection_change" });
1292
1283
  }
1293
1284
  }
1294
- const ss = l(
1295
- ({ version: e, postEvent: t }) => new es(e, t)
1285
+ const ns = l(
1286
+ ({ version: e, postEvent: t }) => new ss(e, t)
1296
1287
  );
1297
- class ns {
1288
+ class rs {
1298
1289
  constructor(t) {
1299
1290
  this.initData = t;
1300
1291
  }
@@ -1367,13 +1358,13 @@ class ns {
1367
1358
  return this.initData.user;
1368
1359
  }
1369
1360
  }
1370
- const rs = l(
1371
- ({ initData: e }) => e ? new ns(e) : void 0
1361
+ const is = l(
1362
+ ({ initData: e }) => e ? new rs(e) : void 0
1372
1363
  );
1373
- function fn(e) {
1374
- return Ht().parse(e);
1364
+ function mn(e) {
1365
+ return $t().parse(e);
1375
1366
  }
1376
- class is extends L {
1367
+ class os extends $ {
1377
1368
  constructor(t, s, n) {
1378
1369
  super({ isOpened: t }, s, { open: "web_app_open_invoice" }), this.postEvent = n;
1379
1370
  }
@@ -1417,10 +1408,10 @@ class is extends L {
1417
1408
  }
1418
1409
  }
1419
1410
  }
1420
- const os = l(
1421
- ({ version: e, postEvent: t }) => new is(!1, e, t)
1411
+ const as = l(
1412
+ ({ version: e, postEvent: t }) => new os(!1, e, t)
1422
1413
  );
1423
- class as extends pt {
1414
+ class cs extends ht {
1424
1415
  constructor({ postEvent: t, ...s }) {
1425
1416
  super(s), c(this, "postEvent"), c(this, "on", (n, r) => n === "click" ? y("main_button_pressed", r) : this.state.on(n, r)), c(this, "off", (n, r) => n === "click" ? z("main_button_pressed", r) : this.state.off(n, r)), this.postEvent = t;
1426
1417
  }
@@ -1551,7 +1542,7 @@ class as extends pt {
1551
1542
  return this.get("textColor");
1552
1543
  }
1553
1544
  }
1554
- const cs = l(
1545
+ const hs = l(
1555
1546
  "mainButton",
1556
1547
  ({
1557
1548
  postEvent: e,
@@ -1564,47 +1555,47 @@ const cs = l(
1564
1555
  textColor: t.buttonTextColor || "#ffffff",
1565
1556
  bgColor: t.buttonColor || "#000000"
1566
1557
  }
1567
- }) => new as({ ...s, postEvent: e })
1558
+ }) => new cs({ ...s, postEvent: e })
1568
1559
  );
1569
- function hs() {
1570
- return lt({
1571
- contact: w({
1560
+ function ps() {
1561
+ return ut({
1562
+ contact: v({
1572
1563
  userId: {
1573
1564
  type: x(),
1574
1565
  from: "user_id"
1575
1566
  },
1576
1567
  phoneNumber: {
1577
- type: h(),
1568
+ type: u(),
1578
1569
  from: "phone_number"
1579
1570
  },
1580
1571
  firstName: {
1581
- type: h(),
1572
+ type: u(),
1582
1573
  from: "first_name"
1583
1574
  },
1584
1575
  lastName: {
1585
- type: h().optional(),
1576
+ type: u().optional(),
1586
1577
  from: "last_name"
1587
1578
  }
1588
1579
  }),
1589
1580
  authDate: {
1590
- type: $t(),
1581
+ type: Lt(),
1591
1582
  from: "auth_date"
1592
1583
  },
1593
- hash: h()
1584
+ hash: u()
1594
1585
  }, "RequestedContact");
1595
1586
  }
1596
- function Zt(e, t) {
1587
+ function Yt(e, t) {
1597
1588
  return (s) => {
1598
1589
  const [n, r] = t[s];
1599
1590
  return C(n, r, e);
1600
1591
  };
1601
1592
  }
1602
- function ps(e) {
1593
+ function us(e) {
1603
1594
  return new Promise((t) => {
1604
1595
  setTimeout(t, e);
1605
1596
  });
1606
1597
  }
1607
- class us extends L {
1598
+ class ls extends $ {
1608
1599
  constructor({ postEvent: t, createRequestId: s, version: n, botInline: r, ...i }) {
1609
1600
  super(i, n, {
1610
1601
  requestPhoneAccess: "web_app_request_phone",
@@ -1614,7 +1605,7 @@ class us extends L {
1614
1605
  setBackgroundColor: "web_app_set_background_color"
1615
1606
  }), c(this, "botInline"), c(this, "postEvent"), c(this, "createRequestId"), c(this, "requestPhoneAccessPromise"), c(this, "requestWriteAccessPromise"), c(this, "supportsParam"), this.createRequestId = s, this.postEvent = t, this.botInline = r;
1616
1607
  const o = this.supports.bind(this);
1617
- this.supports = (a) => o(a) ? a !== "switchInlineQuery" || r : !1, this.supportsParam = Zt(n, {
1608
+ this.supports = (a) => o(a) ? a !== "switchInlineQuery" || r : !1, this.supportsParam = Yt(n, {
1618
1609
  "setHeaderColor.color": ["web_app_set_header_color", "color"]
1619
1610
  });
1620
1611
  }
@@ -1625,8 +1616,8 @@ class us extends L {
1625
1616
  async getRequestedContact({
1626
1617
  timeout: t = 1e4
1627
1618
  } = {}) {
1628
- return hs().parse(
1629
- await O(
1619
+ return ps().parse(
1620
+ await q(
1630
1621
  "getRequestedContact",
1631
1622
  {},
1632
1623
  this.createRequestId(),
@@ -1643,9 +1634,10 @@ class us extends L {
1643
1634
  }
1644
1635
  /**
1645
1636
  * Closes the Mini App.
1637
+ * @param returnBack - should the application be wrapped into the bottom bar.
1646
1638
  */
1647
- close() {
1648
- this.postEvent("web_app_close");
1639
+ close(t) {
1640
+ this.postEvent("web_app_close", { return_back: t });
1649
1641
  }
1650
1642
  /**
1651
1643
  * The Mini App header color.
@@ -1662,10 +1654,10 @@ class us extends L {
1662
1654
  return this.botInline;
1663
1655
  }
1664
1656
  /**
1665
- * True if current Mini App background color is recognized as dark.
1657
+ * True if the current Mini App background color is recognized as dark.
1666
1658
  */
1667
1659
  get isDark() {
1668
- return Vt(this.bgColor);
1660
+ return Bt(this.bgColor);
1669
1661
  }
1670
1662
  /**
1671
1663
  * Informs the Telegram app that the Mini App is ready to be displayed.
@@ -1694,15 +1686,15 @@ class us extends L {
1694
1686
  throw new Error("Access denied.");
1695
1687
  const s = Date.now() + t;
1696
1688
  let n = 50;
1697
- return Mt(async () => {
1689
+ return Dt(async () => {
1698
1690
  for (; Date.now() < s; ) {
1699
1691
  try {
1700
1692
  return await this.getRequestedContact();
1701
1693
  } catch {
1702
1694
  }
1703
- await ps(n), n += 50;
1695
+ await us(n), n += 50;
1704
1696
  }
1705
- throw Bt(t);
1697
+ throw Nt(t);
1706
1698
  }, t);
1707
1699
  }
1708
1700
  /**
@@ -1785,7 +1777,7 @@ class us extends L {
1785
1777
  this.postEvent("web_app_switch_inline_query", { query: t, chat_types: s });
1786
1778
  }
1787
1779
  }
1788
- const ls = l(
1780
+ const ds = l(
1789
1781
  "miniApp",
1790
1782
  ({
1791
1783
  themeParams: e,
@@ -1795,9 +1787,9 @@ const ls = l(
1795
1787
  headerColor: e.headerBgColor || "#000000"
1796
1788
  },
1797
1789
  ...n
1798
- }) => new us({ ...n, ...s, botInline: t })
1790
+ }) => new ls({ ...n, ...s, botInline: t })
1799
1791
  );
1800
- function ds(e) {
1792
+ function _s(e) {
1801
1793
  const t = e.message.trim(), s = (e.title || "").trim(), n = e.buttons || [];
1802
1794
  let r;
1803
1795
  if (s.length > 64)
@@ -1813,15 +1805,15 @@ function ds(e) {
1813
1805
  if (!i.type || i.type === "default" || i.type === "destructive") {
1814
1806
  const a = i.text.trim();
1815
1807
  if (!a.length || a.length > 64) {
1816
- const p = i.type || "default";
1817
- throw new Error(`Button text with type "${p}" has incorrect size: ${i.text.length}`);
1808
+ const h = i.type || "default";
1809
+ throw new Error(`Button text with type "${h}" has incorrect size: ${i.text.length}`);
1818
1810
  }
1819
1811
  return { ...i, text: a, id: o };
1820
1812
  }
1821
1813
  return { ...i, id: o };
1822
1814
  }) : r = [{ type: "close", id: "" }], { title: s, message: t, buttons: r };
1823
1815
  }
1824
- class _s extends L {
1816
+ class gs extends $ {
1825
1817
  constructor(t, s, n) {
1826
1818
  super({ isOpened: t }, s, { open: "web_app_open_popup" }), this.postEvent = n;
1827
1819
  }
@@ -1854,7 +1846,7 @@ class _s extends L {
1854
1846
  event: "popup_closed",
1855
1847
  method: "web_app_open_popup",
1856
1848
  postEvent: this.postEvent,
1857
- params: ds(t)
1849
+ params: _s(t)
1858
1850
  });
1859
1851
  return s;
1860
1852
  } finally {
@@ -1863,9 +1855,9 @@ class _s extends L {
1863
1855
  }
1864
1856
  }
1865
1857
  const ws = l(
1866
- ({ postEvent: e, version: t }) => new _s(!1, t, e)
1858
+ ({ postEvent: e, version: t }) => new gs(!1, t, e)
1867
1859
  );
1868
- class gs extends L {
1860
+ class fs extends $ {
1869
1861
  constructor(t, s, n) {
1870
1862
  super({ isOpened: t }, s, {
1871
1863
  close: "web_app_close_scan_qr_popup",
@@ -1873,7 +1865,7 @@ class gs extends L {
1873
1865
  }), this.postEvent = n;
1874
1866
  }
1875
1867
  /**
1876
- * Closes scanner.
1868
+ * Closes the scanner.
1877
1869
  */
1878
1870
  close() {
1879
1871
  this.postEvent("web_app_close_scan_qr_popup"), this.isOpened = !1;
@@ -1882,14 +1874,14 @@ class gs extends L {
1882
1874
  this.set("isOpened", t);
1883
1875
  }
1884
1876
  /**
1885
- * Returns true in case, QR scanner is currently opened.
1877
+ * Returns true if the scanner is currently opened.
1886
1878
  */
1887
1879
  get isOpened() {
1888
1880
  return this.get("isOpened");
1889
1881
  }
1890
1882
  async open(t) {
1891
1883
  if (this.isOpened)
1892
- throw new Error("QR scanner is already opened.");
1884
+ throw new Error("The scanner is already opened");
1893
1885
  const { text: s, capture: n } = (typeof t == "string" ? { text: t } : t) || {};
1894
1886
  this.isOpened = !0;
1895
1887
  try {
@@ -1903,15 +1895,16 @@ class gs extends L {
1903
1895
  }
1904
1896
  }) || {}).data || null;
1905
1897
  return r && this.close(), r;
1906
- } catch (r) {
1907
- throw this.isOpened = !1, r;
1898
+ } finally {
1899
+ this.isOpened = !1;
1908
1900
  }
1909
1901
  }
1902
+ // TODO: Streaming mode, allowing to scan several QRs until closed.
1910
1903
  }
1911
- const fs = l(
1912
- ({ version: e, postEvent: t }) => new gs(!1, e, t)
1904
+ const ms = l(
1905
+ ({ version: e, postEvent: t }) => new fs(!1, e, t)
1913
1906
  );
1914
- class ms extends ut {
1907
+ class bs extends pt {
1915
1908
  constructor(t, s, n) {
1916
1909
  super({ isVisible: t }, s, {
1917
1910
  show: "web_app_setup_settings_button",
@@ -1940,18 +1933,18 @@ class ms extends ut {
1940
1933
  this.isVisible = !0;
1941
1934
  }
1942
1935
  }
1943
- const bs = l(
1936
+ const vs = l(
1944
1937
  "settingsButton",
1945
1938
  ({
1946
1939
  version: e,
1947
1940
  postEvent: t,
1948
1941
  state: s = { isVisible: !1 }
1949
- }) => new ms(s.isVisible, e, t)
1942
+ }) => new bs(s.isVisible, e, t)
1950
1943
  );
1951
- function Xt(e) {
1952
- return Ut().parse(e);
1944
+ function Zt(e) {
1945
+ return Ht().parse(e);
1953
1946
  }
1954
- class vs extends _t {
1947
+ class ys extends dt {
1955
1948
  /**
1956
1949
  * @since v6.10
1957
1950
  */
@@ -1990,7 +1983,7 @@ class vs extends _t {
1990
1983
  * value is calculated according to theme bg color.
1991
1984
  */
1992
1985
  get isDark() {
1993
- return !this.bgColor || Vt(this.bgColor);
1986
+ return !this.bgColor || Bt(this.bgColor);
1994
1987
  }
1995
1988
  get linkColor() {
1996
1989
  return this.get("linkColor");
@@ -2022,7 +2015,7 @@ class vs extends _t {
2022
2015
  */
2023
2016
  listen() {
2024
2017
  return y("theme_changed", (t) => {
2025
- this.set(Xt(t.theme_params));
2018
+ this.set(Zt(t.theme_params));
2026
2019
  });
2027
2020
  }
2028
2021
  /**
@@ -2035,44 +2028,46 @@ class vs extends _t {
2035
2028
  return this.get("textColor");
2036
2029
  }
2037
2030
  }
2038
- const ys = l(
2031
+ const Es = l(
2039
2032
  "themeParams",
2040
2033
  ({ themeParams: e, state: t = e, addCleanup: s }) => {
2041
- const n = new vs(t);
2034
+ const n = new ys(t);
2042
2035
  return s(n.listen()), n;
2043
2036
  }
2044
2037
  );
2045
- function mn(e = {}) {
2038
+ function bn(e = {}) {
2046
2039
  return g({
2047
2040
  ...e,
2048
2041
  method: "web_app_request_theme",
2049
2042
  event: "theme_changed"
2050
- }).then(Xt);
2043
+ }).then(Zt);
2044
+ }
2045
+ function B(e, t) {
2046
+ return e.startsWith(t) ? e : `${t}${e}`;
2051
2047
  }
2052
- class Es extends wt {
2048
+ function M(e) {
2049
+ return new URL(
2050
+ typeof e == "string" ? e : `${e.pathname || ""}${B(e.search || "", "?")}${B(e.hash || "", "#")}`,
2051
+ "http://a"
2052
+ );
2053
+ }
2054
+ class Ps extends _t {
2053
2055
  constructor(t, s, n) {
2054
- super(t, { readTextFromClipboard: "web_app_read_text_from_clipboard" }), c(this, "supportsParam"), this.version = t, this.createRequestId = s, this.postEvent = n, this.supportsParam = Zt(t, {
2056
+ super(t, { readTextFromClipboard: "web_app_read_text_from_clipboard" }), c(this, "supportsParam"), this.version = t, this.createRequestId = s, this.postEvent = n, this.supportsParam = Yt(t, {
2055
2057
  "openLink.tryInstantView": ["web_app_open_link", "try_instant_view"]
2056
2058
  });
2057
2059
  }
2058
- /**
2059
- * Opens a link in an external browser. The Mini App will not be closed.
2060
- *
2061
- * Note that this method can be called only in response to the user
2062
- * interaction with the Mini App interface (e.g. click inside the Mini App
2063
- * or on the main button).
2064
- * @param url - URL to be opened.
2065
- * @param tryInstantView
2066
- */
2067
2060
  openLink(t, s) {
2068
- const n = new URL(t, window.location.href).toString();
2061
+ const n = M(t).toString();
2069
2062
  if (!C("web_app_open_link", this.version)) {
2070
2063
  window.open(n, "_blank");
2071
2064
  return;
2072
2065
  }
2066
+ const r = typeof s == "boolean" ? { tryInstantView: s } : s || {};
2073
2067
  this.postEvent("web_app_open_link", {
2074
2068
  url: n,
2075
- ...typeof s == "boolean" ? { try_instant_view: s } : {}
2069
+ try_browser: r.tryBrowser,
2070
+ try_instant_view: r.tryInstantView
2076
2071
  });
2077
2072
  }
2078
2073
  /**
@@ -2105,7 +2100,7 @@ class Es extends wt {
2105
2100
  event: "clipboard_text_received",
2106
2101
  postEvent: this.postEvent,
2107
2102
  params: { req_id: t },
2108
- capture: Dt(t)
2103
+ capture: qt(t)
2109
2104
  });
2110
2105
  return s;
2111
2106
  }
@@ -2121,14 +2116,14 @@ class Es extends wt {
2121
2116
  */
2122
2117
  shareURL(t, s) {
2123
2118
  this.openTelegramLink(
2124
- "https://t.me/share/url?" + new URLSearchParams({ url: t, text: s || "" }).toString()
2119
+ "https://t.me/share/url?" + new URLSearchParams({ url: t, text: s || "" }).toString().replace(/\+/g, "%20")
2125
2120
  );
2126
2121
  }
2127
2122
  }
2128
- const Ps = l(
2129
- ({ version: e, postEvent: t, createRequestId: s }) => new Es(e, s, t)
2123
+ const Rs = l(
2124
+ ({ version: e, postEvent: t, createRequestId: s }) => new Ps(e, s, t)
2130
2125
  );
2131
- async function te(e = {}) {
2126
+ async function Xt(e = {}) {
2132
2127
  const {
2133
2128
  is_expanded: t,
2134
2129
  is_state_stable: s,
@@ -2140,16 +2135,16 @@ async function te(e = {}) {
2140
2135
  });
2141
2136
  return { ...n, isExpanded: t, isStateStable: s };
2142
2137
  }
2143
- function q(e) {
2138
+ function O(e) {
2144
2139
  return e < 0 ? 0 : e;
2145
2140
  }
2146
- class Rs extends _t {
2141
+ class xs extends dt {
2147
2142
  constructor({ postEvent: t, stableHeight: s, height: n, width: r, isExpanded: i }) {
2148
2143
  super({
2149
- height: q(n),
2144
+ height: O(n),
2150
2145
  isExpanded: i,
2151
- stableHeight: q(s),
2152
- width: q(r)
2146
+ stableHeight: O(s),
2147
+ width: O(r)
2153
2148
  }), c(this, "postEvent"), this.postEvent = t;
2154
2149
  }
2155
2150
  /**
@@ -2158,7 +2153,7 @@ class Rs extends _t {
2158
2153
  * @param options - options to request fresh data.
2159
2154
  */
2160
2155
  async sync(t) {
2161
- const { isStateStable: s, ...n } = await te(t);
2156
+ const { isStateStable: s, ...n } = await Xt(t);
2162
2157
  this.set({
2163
2158
  ...n,
2164
2159
  stableHeight: s ? n.height : this.get("stableHeight")
@@ -2211,11 +2206,11 @@ class Rs extends _t {
2211
2206
  width: n,
2212
2207
  is_expanded: r,
2213
2208
  is_state_stable: i
2214
- } = t, o = q(s);
2209
+ } = t, o = O(s);
2215
2210
  this.set({
2216
2211
  height: o,
2217
2212
  isExpanded: r,
2218
- width: q(n),
2213
+ width: O(n),
2219
2214
  ...i ? { stableHeight: o } : {}
2220
2215
  });
2221
2216
  });
@@ -2250,7 +2245,7 @@ class Rs extends _t {
2250
2245
  return this.stableHeight === this.height;
2251
2246
  }
2252
2247
  }
2253
- const xs = l(
2248
+ const Cs = l(
2254
2249
  "viewport",
2255
2250
  async ({ state: e, platform: t, postEvent: s, addCleanup: n }) => {
2256
2251
  let r = !1, i = 0, o = 0, a = 0;
@@ -2259,31 +2254,31 @@ const xs = l(
2259
2254
  else if (["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(t))
2260
2255
  r = !0, i = window.innerHeight, o = window.innerWidth, a = window.innerHeight;
2261
2256
  else {
2262
- const u = await te({ timeout: 1e3, postEvent: s });
2263
- r = u.isExpanded, i = u.height, o = u.width, a = u.isStateStable ? i : 0;
2257
+ const p = await Xt({ timeout: 1e3, postEvent: s });
2258
+ r = p.isExpanded, i = p.height, o = p.width, a = p.isStateStable ? i : 0;
2264
2259
  }
2265
- const p = new Rs({
2260
+ const h = new xs({
2266
2261
  postEvent: s,
2267
2262
  height: i,
2268
2263
  width: o,
2269
2264
  stableHeight: a,
2270
2265
  isExpanded: r
2271
2266
  });
2272
- return n(p.listen()), p;
2267
+ return n(h.listen()), h;
2273
2268
  }
2274
2269
  );
2275
2270
  function P(e, t) {
2276
2271
  document.documentElement.style.setProperty(e, t);
2277
2272
  }
2278
- function bn(e, t, s) {
2273
+ function vn(e, t, s) {
2279
2274
  s || (s = (a) => `--tg-${a}-color`);
2280
2275
  const n = s("header"), r = s("bg"), i = () => {
2281
2276
  const { headerColor: a } = e;
2282
2277
  if (ct(a))
2283
2278
  P(n, a);
2284
2279
  else {
2285
- const { bgColor: p, secondaryBgColor: u } = t;
2286
- a === "bg_color" && p ? P(n, p) : a === "secondary_bg_color" && u && P(n, u);
2280
+ const { bgColor: h, secondaryBgColor: p } = t;
2281
+ a === "bg_color" && h ? P(n, h) : a === "secondary_bg_color" && p && P(n, p);
2287
2282
  }
2288
2283
  P(r, e.bgColor);
2289
2284
  }, o = [
@@ -2292,7 +2287,7 @@ function bn(e, t, s) {
2292
2287
  ];
2293
2288
  return i(), () => o.forEach((a) => a());
2294
2289
  }
2295
- function vn(e, t) {
2290
+ function yn(e, t) {
2296
2291
  t || (t = (n) => `--tg-theme-${n.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)}`);
2297
2292
  const s = () => {
2298
2293
  Object.entries(e.getState()).forEach(([n, r]) => {
@@ -2301,23 +2296,23 @@ function vn(e, t) {
2301
2296
  };
2302
2297
  return s(), e.on("change", s);
2303
2298
  }
2304
- function yn(e, t) {
2305
- t || (t = (u) => `--tg-viewport-${u}`);
2299
+ function En(e, t) {
2300
+ t || (t = (p) => `--tg-viewport-${p}`);
2306
2301
  const [
2307
2302
  s,
2308
2303
  n,
2309
2304
  r
2310
- ] = ["height", "width", "stable-height"].map((u) => t(u)), i = () => P(s, `${e.height}px`), o = () => P(n, `${e.width}px`), a = () => P(r, `${e.stableHeight}px`), p = [
2305
+ ] = ["height", "width", "stable-height"].map((p) => t(p)), i = () => P(s, `${e.height}px`), o = () => P(n, `${e.width}px`), a = () => P(r, `${e.stableHeight}px`), h = [
2311
2306
  e.on("change:height", i),
2312
2307
  e.on("change:width", o),
2313
2308
  e.on("change:stableHeight", a)
2314
2309
  ];
2315
- return i(), o(), a(), () => p.forEach((u) => u());
2310
+ return i(), o(), a(), () => h.forEach((p) => p());
2316
2311
  }
2317
- function Cs(e = !0) {
2312
+ function Ss(e = !0) {
2318
2313
  const t = [
2319
2314
  y("reload_iframe", () => {
2320
- B("iframe_will_reload"), window.location.reload();
2315
+ V("iframe_will_reload"), window.location.reload();
2321
2316
  })
2322
2317
  ], s = () => t.forEach((n) => n());
2323
2318
  if (e) {
@@ -2329,13 +2324,13 @@ function Cs(e = !0) {
2329
2324
  () => document.head.removeChild(n)
2330
2325
  );
2331
2326
  }
2332
- return B("iframe_ready", { reload_supported: !0 }), s;
2327
+ return V("iframe_ready", { reload_supported: !0 }), s;
2333
2328
  }
2334
- function Ss() {
2329
+ function Ts() {
2335
2330
  return typeof window > "u";
2336
2331
  }
2337
- async function En() {
2338
- if (Ot(window))
2332
+ async function Pn() {
2333
+ if (kt(window))
2339
2334
  return !0;
2340
2335
  try {
2341
2336
  return await g({ method: "web_app_request_theme", event: "theme_changed", timeout: 100 }), !0;
@@ -2343,15 +2338,15 @@ async function En() {
2343
2338
  return !1;
2344
2339
  }
2345
2340
  }
2346
- function Pn(e) {
2347
- const t = typeof e == "string" ? dt(e) : e;
2348
- Ft(t);
2341
+ function Rn(e) {
2342
+ const t = typeof e == "string" ? lt(e) : e;
2343
+ Jt(t);
2349
2344
  function s(r) {
2350
2345
  if (typeof r == "string")
2351
2346
  try {
2352
- const { eventType: i } = kt(r);
2347
+ const { eventType: i } = At(r);
2353
2348
  i === "web_app_request_theme" && et("theme_changed", {
2354
- theme_params: JSON.parse(Jt(t.themeParams))
2349
+ theme_params: JSON.parse(Kt(t.themeParams))
2355
2350
  }), i === "web_app_request_viewport" && et("viewport_changed", {
2356
2351
  width: window.innerWidth,
2357
2352
  height: window.innerHeight,
@@ -2361,14 +2356,14 @@ function Pn(e) {
2361
2356
  } catch {
2362
2357
  }
2363
2358
  }
2364
- if (ht()) {
2359
+ if (at()) {
2365
2360
  const r = window.parent.postMessage.bind(window.parent);
2366
2361
  window.parent.postMessage = (i) => {
2367
2362
  s(i), r(i);
2368
2363
  };
2369
2364
  return;
2370
2365
  }
2371
- if (qt(window)) {
2366
+ if (It(window)) {
2372
2367
  const r = window.external.notify.bind(window.external);
2373
2368
  window.external.notify = (i) => {
2374
2369
  s(i), r(i);
@@ -2383,11 +2378,11 @@ function Pn(e) {
2383
2378
  }
2384
2379
  };
2385
2380
  }
2386
- function Ts(e) {
2381
+ function As(e) {
2387
2382
  return e instanceof W;
2388
2383
  }
2389
- function Rn(e, t) {
2390
- return Ts(e) && e.type === t;
2384
+ function xn(e, t) {
2385
+ return As(e) && e.type === t;
2391
2386
  }
2392
2387
  function J(e, t) {
2393
2388
  let s, n, r;
@@ -2397,13 +2392,13 @@ function J(e, t) {
2397
2392
  params: n
2398
2393
  });
2399
2394
  }
2400
- class As {
2401
- constructor(t, s, n = B) {
2395
+ class Is {
2396
+ constructor(t, s, n = V) {
2402
2397
  if (c(this, "history"), c(this, "ee", new D()), c(this, "attached", !1), c(this, "back", () => this.go(-1)), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this._index = s, this.postEvent = n, t.length === 0)
2403
- throw b(ve, "History should not be empty.");
2398
+ throw m(be, "History should not be empty.");
2404
2399
  if (s < 0 || s >= t.length)
2405
- throw b(
2406
- ye,
2400
+ throw m(
2401
+ ve,
2407
2402
  "Index should not be zero and higher or equal than history size."
2408
2403
  );
2409
2404
  this.history = t.map((r) => J(r, ""));
@@ -2524,23 +2519,14 @@ function F({
2524
2519
  }) {
2525
2520
  return { ...e || { hash: "", search: "" }, ...t };
2526
2521
  }
2527
- function M(e, t) {
2528
- return e.startsWith(t) ? e : `${t}${e}`;
2529
- }
2530
- function H(e) {
2531
- return new URL(
2532
- typeof e == "string" ? e : `${e.pathname || ""}${M(e.search || "", "?")}${M(e.hash || "", "#")}`,
2533
- "http://a"
2534
- );
2535
- }
2536
2522
  function U(e) {
2537
- const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = H(e);
2523
+ const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = M(e);
2538
2524
  return `${t ? s.pathname : s.pathname.slice(1)}${s.search}${s.hash}`;
2539
2525
  }
2540
2526
  function Q(e, t, s) {
2541
2527
  let n, r;
2542
2528
  typeof e == "string" ? n = e : (n = U(e), s = e.state, r = e.id);
2543
- const { pathname: i, search: o, hash: a } = new URL(n, `http://a${M(t, "/")}`);
2529
+ const { pathname: i, search: o, hash: a } = new URL(n, `http://a${B(t, "/")}`);
2544
2530
  return { id: r, pathname: i, params: { hash: a, search: o, state: s } };
2545
2531
  }
2546
2532
  async function N(e) {
@@ -2557,41 +2543,41 @@ async function N(e) {
2557
2543
  })
2558
2544
  ]);
2559
2545
  }
2560
- async function Is() {
2546
+ async function ks() {
2561
2547
  if (window.history.length <= 1 || (window.history.pushState(null, ""), await N(1 - window.history.length)))
2562
2548
  return;
2563
2549
  let e = await N(-1);
2564
2550
  for (; e; )
2565
2551
  e = await N(-1);
2566
2552
  }
2567
- function ee(e) {
2568
- return H(e).pathname;
2553
+ function te(e) {
2554
+ return M(e).pathname;
2569
2555
  }
2570
- const Pt = 0, Y = 1, Z = 2;
2571
- class se {
2556
+ const Et = 0, Y = 1, Z = 2;
2557
+ class ee {
2572
2558
  constructor(t, s, { postEvent: n, hashMode: r = "classic", base: i } = {}) {
2573
2559
  c(this, "navigator"), c(this, "ee", new D()), c(this, "hashMode"), c(this, "base"), c(this, "attached", !1), c(this, "onPopState", ({ state: o }) => {
2574
2560
  if (o === null)
2575
2561
  return this.push(this.parsePath(window.location.href));
2576
- o === Pt ? window.history.forward() : o === Y && this.back(), o === Z && this.forward();
2562
+ o === Et ? window.history.forward() : o === Y && this.back(), o === Z && this.forward();
2577
2563
  }), c(this, "onNavigatorChange", async ({
2578
2564
  to: o,
2579
2565
  from: a,
2580
- delta: p
2566
+ delta: h
2581
2567
  }) => {
2582
2568
  this.attached && await this.syncHistory(), this.ee.emit("change", {
2583
- delta: p,
2569
+ delta: h,
2584
2570
  from: F(a),
2585
2571
  to: F(o),
2586
2572
  navigator: this
2587
2573
  });
2588
- }), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.navigator = new As(
2574
+ }), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.navigator = new Is(
2589
2575
  t.map((o) => Q(o, "/")),
2590
2576
  s,
2591
2577
  n
2592
2578
  ), this.navigator.on("change", (o) => {
2593
2579
  this.onNavigatorChange(o);
2594
- }), this.hashMode = r, this.base = ee(i || "");
2580
+ }), this.hashMode = r, this.base = te(i || "");
2595
2581
  }
2596
2582
  /**
2597
2583
  * Attaches current navigator to the browser history allowing navigator to manipulate it.
@@ -2718,8 +2704,8 @@ class se {
2718
2704
  * // { pathname: '/tma', search: '?is=cool', hash: '#yeah' }
2719
2705
  */
2720
2706
  parsePath(t) {
2721
- let s = H(t);
2722
- return this.hashMode && (s = H(s.hash.slice(1))), {
2707
+ let s = M(t);
2708
+ return this.hashMode && (s = M(s.hash.slice(1))), {
2723
2709
  pathname: s.pathname,
2724
2710
  search: s.search,
2725
2711
  hash: s.hash
@@ -2739,8 +2725,8 @@ class se {
2739
2725
  * @param value - path presented as string or URLLike.
2740
2726
  */
2741
2727
  renderPath(t) {
2742
- const s = (this.base.length === 1 ? "" : this.base) + M(U(t), "/");
2743
- return this.hashMode ? M(s.slice(1), this.hashMode === "classic" ? "#" : "#/") : s;
2728
+ const s = (this.base.length === 1 ? "" : this.base) + B(U(t), "/");
2729
+ return this.hashMode ? B(s.slice(1), this.hashMode === "classic" ? "#" : "#/") : s;
2744
2730
  }
2745
2731
  /**
2746
2732
  * Synchronizes current navigator state with browser history.
@@ -2748,7 +2734,7 @@ class se {
2748
2734
  async syncHistory() {
2749
2735
  window.removeEventListener("popstate", this.onPopState);
2750
2736
  const { state: t } = this, s = this.renderPath(this);
2751
- await Is(), this.hasPrev && this.hasNext ? (window.history.replaceState(Y, ""), window.history.pushState(t, "", s), window.history.pushState(Z, ""), await N(-1)) : this.hasPrev ? (window.history.replaceState(Y, ""), window.history.pushState(t, "", s)) : this.hasNext ? (window.history.replaceState(t, s), window.history.pushState(Z, ""), await N(-1)) : (window.history.replaceState(Pt, ""), window.history.pushState(t, "", s)), window.addEventListener("popstate", this.onPopState);
2737
+ await ks(), this.hasPrev && this.hasNext ? (window.history.replaceState(Y, ""), window.history.pushState(t, "", s), window.history.pushState(Z, ""), await N(-1)) : this.hasPrev ? (window.history.replaceState(Y, ""), window.history.pushState(t, "", s)) : this.hasNext ? (window.history.replaceState(t, s), window.history.pushState(Z, ""), await N(-1)) : (window.history.replaceState(Et, ""), window.history.pushState(t, "", s)), window.addEventListener("popstate", this.onPopState);
2752
2738
  }
2753
2739
  /**
2754
2740
  * Current query parameters.
@@ -2766,34 +2752,34 @@ class se {
2766
2752
  return (this.navigator.current.params || {}).state;
2767
2753
  }
2768
2754
  }
2769
- function ks(e) {
2755
+ function Os(e) {
2770
2756
  e || (e = {});
2771
2757
  const { href: t, hash: s } = window.location;
2772
2758
  let n = U(
2773
2759
  e.hashMode === null ? t : s.includes("?") ? s.slice(1) : `?${s.slice(1)}`
2774
2760
  );
2775
- const r = e.base ? ee(e.base) : void 0;
2761
+ const r = e.base ? te(e.base) : void 0;
2776
2762
  if (r) {
2777
2763
  if (!n.startsWith(r))
2778
- throw b(
2779
- Ee,
2764
+ throw m(
2765
+ ye,
2780
2766
  `Path "${n}" expected to be starting with "${r}"`
2781
2767
  );
2782
2768
  n = n.slice(r.length);
2783
2769
  }
2784
- return new se([n], 0, e);
2770
+ return new ee([n], 0, e);
2785
2771
  }
2786
- function xn(e) {
2772
+ function Cn(e) {
2787
2773
  const t = e.match(/#(.+)/);
2788
2774
  return t ? t[1] : null;
2789
2775
  }
2790
2776
  function qs(e, t) {
2791
- if (Qt()) {
2777
+ if (Ft()) {
2792
2778
  const s = sessionStorage.getItem(e);
2793
2779
  if (s)
2794
2780
  try {
2795
2781
  const { index: n, history: r } = JSON.parse(s);
2796
- return new se(
2782
+ return new ee(
2797
2783
  r,
2798
2784
  n,
2799
2785
  t
@@ -2802,9 +2788,9 @@ function qs(e, t) {
2802
2788
  console.error("Unable to restore hash navigator state.", n);
2803
2789
  }
2804
2790
  }
2805
- return ks(t);
2791
+ return Os(t);
2806
2792
  }
2807
- function Cn(e, t) {
2793
+ function Sn(e, t) {
2808
2794
  const s = qs(e, t), n = () => sessionStorage.setItem(e, JSON.stringify({
2809
2795
  index: s.index,
2810
2796
  history: s.history
@@ -2814,29 +2800,29 @@ function Cn(e, t) {
2814
2800
  function d(e, t) {
2815
2801
  function s(n) {
2816
2802
  return function(i, o, a) {
2817
- return (p) => {
2818
- const u = {
2819
- ...p,
2803
+ return (h) => {
2804
+ const p = {
2805
+ ...h,
2820
2806
  [i]: n(o)
2821
2807
  };
2822
- return /* @__PURE__ */ Rt(a, { ...u });
2808
+ return /* @__PURE__ */ Pt(a, { ...p });
2823
2809
  };
2824
2810
  };
2825
2811
  }
2826
2812
  return [s(e), s(t)];
2827
2813
  }
2828
- const ne = re(void 0);
2829
- function Os() {
2830
- const e = ie(ne);
2814
+ const se = ne(void 0);
2815
+ function Ns() {
2816
+ const e = re(se);
2831
2817
  if (!e)
2832
2818
  throw new Error("useSDK was used outside the SDKProvider.");
2833
2819
  return e;
2834
2820
  }
2835
2821
  function _(e) {
2836
2822
  function t(n) {
2837
- const r = Os(), [i, o] = rt(
2823
+ const r = Ns(), [i, o] = rt(
2838
2824
  n ? void 0 : () => {
2839
- if (Ss())
2825
+ if (Ts())
2840
2826
  throw new Error("Using hooks on the server side, you must explicitly specify ssr = true option");
2841
2827
  return r.use(e);
2842
2828
  }
@@ -2855,252 +2841,252 @@ function _(e) {
2855
2841
  }
2856
2842
  return [t, s];
2857
2843
  }
2858
- const [Ns, Ds] = _(Ge), [Sn, Tn] = d(
2859
- Ns,
2860
- Ds
2861
- ), [Bs, Ms] = _(Ke), [An, In] = d(
2844
+ const [Ds, Vs] = _(je), [Tn, An] = d(
2845
+ Ds,
2846
+ Vs
2847
+ ), [Bs, Ms] = _(Je), [In, kn] = d(
2862
2848
  Bs,
2863
2849
  Ms
2864
- ), [Vs, Ls] = _(Fe), [kn, qn] = d(
2865
- Vs,
2866
- Ls
2867
- ), [$s, Hs] = _(ts), [On, Nn] = d(
2868
- $s,
2869
- Hs
2870
- ), [Us, Ws] = _(ss), [Dn, Bn] = d(
2871
- Us,
2872
- Ws
2873
- ), [Gs, js] = _(rs), [Mn, Vn] = d(Gs, js), [zs, Ks] = _(os), [Ln, $n] = d(zs, Ks), [Js, Fs] = _(cs), [Hn, Un] = d(Js, Fs), [Qs, Ys] = _(ls), [Wn, Gn] = d(Qs, Ys), [Zs, Xs] = _(ws), [jn, zn] = d(Zs, Xs), [tn, en] = _(fs), [Kn, Jn] = d(tn, en), [sn, nn] = _(bs), [Fn, Qn] = d(
2874
- sn,
2875
- nn
2876
- ), [rn, on] = _(ys), [Yn, Zn] = d(rn, on);
2877
- function Xn(e) {
2850
+ ), [Ls, $s] = _(Qe), [On, qn] = d(
2851
+ Ls,
2852
+ $s
2853
+ ), [Hs, Us] = _(es), [Nn, Dn] = d(
2854
+ Hs,
2855
+ Us
2856
+ ), [Ws, Gs] = _(ns), [Vn, Bn] = d(
2857
+ Ws,
2858
+ Gs
2859
+ ), [js, zs] = _(is), [Mn, Ln] = d(js, zs), [Ks, Js] = _(as), [$n, Hn] = d(Ks, Js), [Fs, Qs] = _(hs), [Un, Wn] = d(Fs, Qs), [Ys, Zs] = _(ds), [Gn, jn] = d(Ys, Zs), [Xs, tn] = _(ws), [zn, Kn] = d(Xs, tn), [en, sn] = _(ms), [Jn, Fn] = d(en, sn), [nn, rn] = _(vs), [Qn, Yn] = d(
2860
+ nn,
2861
+ rn
2862
+ ), [on, an] = _(Es), [Zn, Xn] = d(on, an);
2863
+ function tr(e) {
2878
2864
  const [t, s] = rt(() => e ? void 0 : nt());
2879
2865
  return R(() => {
2880
2866
  e && s(nt());
2881
2867
  }, []), t;
2882
2868
  }
2883
- const [an, cn] = _(Ps), [tr, er] = d(an, cn), [hn, pn] = _(xs), [sr, nr] = d(hn, pn);
2884
- function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2885
- const n = bt(!0), [r, i] = rt(/* @__PURE__ */ new Map()), o = bt(r), a = oe(
2886
- (u) => {
2887
- n.current && i((S) => (u && u(S), new Map(S)));
2869
+ const [cn, hn] = _(Rs), [er, sr] = d(cn, hn), [pn, un] = _(Cs), [nr, rr] = d(pn, un);
2870
+ function ir({ children: e, acceptCustomStyles: t, debug: s }) {
2871
+ const n = mt(!0), [r, i] = rt(/* @__PURE__ */ new Map()), o = mt(r), a = ie(
2872
+ (p) => {
2873
+ n.current && i((S) => (p && p(S), new Map(S)));
2888
2874
  },
2889
2875
  []
2890
- ), p = ae(() => ({
2891
- use(u, ...S) {
2892
- const gt = r.get(u);
2876
+ ), h = oe(() => ({
2877
+ use(p, ...S) {
2878
+ const gt = r.get(p);
2893
2879
  if (gt)
2894
2880
  return gt;
2895
- let v, K;
2881
+ let b, K;
2896
2882
  try {
2897
- v = u(...S);
2898
- } catch (f) {
2899
- K = f;
2883
+ b = p(...S);
2884
+ } catch (w) {
2885
+ K = w;
2900
2886
  }
2901
- function $(f) {
2902
- return r.set(u, f), f;
2887
+ function H(w) {
2888
+ return r.set(p, w), w;
2903
2889
  }
2904
2890
  if (K)
2905
- return $({ error: K });
2891
+ return H({ error: K });
2906
2892
  let I;
2907
- if (Array.isArray(v) && (I = v[1], v = v[0]), !v)
2908
- return $({ result: v, cleanup: I });
2909
- function ft(f) {
2910
- if ("on" in f) {
2911
- const k = f.on("change", () => a()), mt = I;
2893
+ if (Array.isArray(b) && (I = b[1], b = b[0]), !b)
2894
+ return H({ result: b, cleanup: I });
2895
+ function wt(w) {
2896
+ if ("on" in w) {
2897
+ const k = w.on("change", () => a()), ft = I;
2912
2898
  I = () => {
2913
- mt && mt(), k();
2899
+ ft && ft(), k();
2914
2900
  };
2915
2901
  }
2916
- return { result: f, cleanup: I };
2902
+ return { result: w, cleanup: I };
2917
2903
  }
2918
- return v instanceof Promise ? (v.then(
2919
- (f) => a((k) => k.set(u, ft(f))),
2920
- (f) => a((k) => k.set(u, { error: f }))
2921
- ), $({})) : $(ft(v));
2904
+ return b instanceof Promise ? (b.then(
2905
+ (w) => a((k) => k.set(p, wt(w))),
2906
+ (w) => a((k) => k.set(p, { error: w }))
2907
+ ), H({})) : H(wt(b));
2922
2908
  }
2923
2909
  }), [r]);
2924
2910
  return R(() => (n.current = !0, () => {
2925
2911
  n.current = !1;
2926
2912
  }), []), R(() => {
2927
- if (ht())
2928
- return Cs(t);
2913
+ if (at())
2914
+ return Ss(t);
2929
2915
  }, [t]), R(() => {
2930
- le(s || !1);
2916
+ ue(s || !1);
2931
2917
  }, [s]), R(() => {
2932
2918
  o.current = r;
2933
2919
  }, [r]), R(() => () => {
2934
- o.current.forEach((u) => {
2935
- "cleanup" in u && u.cleanup && u.cleanup();
2920
+ o.current.forEach((p) => {
2921
+ "cleanup" in p && p.cleanup && p.cleanup();
2936
2922
  });
2937
- }, []), /* @__PURE__ */ Rt(ne.Provider, { value: p, children: e });
2923
+ }, []), /* @__PURE__ */ Pt(se.Provider, { value: h, children: e });
2938
2924
  }
2939
2925
  export {
2940
2926
  Ne as BackButton,
2941
- As as BasicNavigator,
2942
- je as BiometryManager,
2943
- se as BrowserNavigator,
2944
- Je as ClosingBehavior,
2945
- Xe as CloudStorage,
2946
- Ee as ERR_INVALID_PATH_BASE,
2947
- fe as ERR_INVOKE_CUSTOM_METHOD_RESPONSE,
2948
- we as ERR_METHOD_PARAMETER_UNSUPPORTED,
2949
- _e as ERR_METHOD_UNSUPPORTED,
2950
- ve as ERR_NAVIGATION_HISTORY_EMPTY,
2951
- ye as ERR_NAVIGATION_INDEX_INVALID,
2952
- dn as ERR_NAVIGATION_ITEM_INVALID,
2953
- St as ERR_PARSE,
2954
- _n as ERR_SSR_INIT,
2955
- me as ERR_TIMED_OUT,
2956
- be as ERR_UNEXPECTED_TYPE,
2927
+ Is as BasicNavigator,
2928
+ ze as BiometryManager,
2929
+ ee as BrowserNavigator,
2930
+ Fe as ClosingBehavior,
2931
+ ts as CloudStorage,
2932
+ ye as ERR_INVALID_PATH_BASE,
2933
+ we as ERR_INVOKE_CUSTOM_METHOD_RESPONSE,
2934
+ _e as ERR_METHOD_PARAMETER_UNSUPPORTED,
2935
+ de as ERR_METHOD_UNSUPPORTED,
2936
+ be as ERR_NAVIGATION_HISTORY_EMPTY,
2937
+ ve as ERR_NAVIGATION_INDEX_INVALID,
2938
+ _n as ERR_NAVIGATION_ITEM_INVALID,
2939
+ Ct as ERR_PARSE,
2940
+ gn as ERR_SSR_INIT,
2941
+ fe as ERR_TIMED_OUT,
2942
+ me as ERR_UNEXPECTED_TYPE,
2957
2943
  ge as ERR_UNKNOWN_ENV,
2958
2944
  D as EventEmitter,
2959
- es as HapticFeedback,
2960
- ns as InitData,
2961
- is as Invoice,
2962
- as as MainButton,
2963
- us as MiniApp,
2964
- _s as Popup,
2965
- gs as QRScanner,
2945
+ ss as HapticFeedback,
2946
+ rs as InitData,
2947
+ os as Invoice,
2948
+ cs as MainButton,
2949
+ ls as MiniApp,
2950
+ gs as Popup,
2951
+ fs as QRScanner,
2966
2952
  W as SDKError,
2967
- rr as SDKProvider,
2968
- ms as SettingsButton,
2969
- vs as ThemeParams,
2970
- Es as Utils,
2971
- Rs as Viewport,
2972
- Ze as array,
2973
- bn as bindMiniAppCSSVars,
2974
- vn as bindThemeParamsCSSVars,
2975
- yn as bindViewportCSSVars,
2953
+ ir as SDKProvider,
2954
+ bs as SettingsButton,
2955
+ ys as ThemeParams,
2956
+ Ps as Utils,
2957
+ xs as Viewport,
2958
+ Xe as array,
2959
+ vn as bindMiniAppCSSVars,
2960
+ yn as bindThemeParamsCSSVars,
2961
+ En as bindViewportCSSVars,
2976
2962
  E as boolean,
2977
- Dt as captureSameReq,
2963
+ qt as captureSameReq,
2978
2964
  st as classNames,
2979
- Ie as compareVersions,
2980
- ks as createBrowserNavigatorFromLocation,
2981
- qe as createPostEvent,
2982
- H as createSafeURL,
2983
- $t as date,
2984
- xn as getHash,
2985
- ee as getPathname,
2986
- Ge as initBackButton,
2987
- Ke as initBiometryManager,
2988
- Fe as initClosingBehavior,
2989
- ts as initCloudStorage,
2990
- ss as initHapticFeedback,
2991
- rs as initInitData,
2992
- os as initInvoice,
2993
- cs as initMainButton,
2994
- ls as initMiniApp,
2995
- Cn as initNavigator,
2965
+ Te as compareVersions,
2966
+ Os as createBrowserNavigatorFromLocation,
2967
+ ke as createPostEvent,
2968
+ M as createSafeURL,
2969
+ Lt as date,
2970
+ Cn as getHash,
2971
+ te as getPathname,
2972
+ je as initBackButton,
2973
+ Je as initBiometryManager,
2974
+ Qe as initClosingBehavior,
2975
+ es as initCloudStorage,
2976
+ ns as initHapticFeedback,
2977
+ is as initInitData,
2978
+ as as initInvoice,
2979
+ hs as initMainButton,
2980
+ ds as initMiniApp,
2981
+ Sn as initNavigator,
2996
2982
  ws as initPopup,
2997
- fs as initQRScanner,
2998
- bs as initSettingsButton,
2999
- ys as initThemeParams,
3000
- Ps as initUtils,
3001
- xs as initViewport,
3002
- Cs as initWeb,
3003
- O as invokeCustomMethod,
3004
- Vt as isColorDark,
3005
- ht as isIframe,
3006
- Qt as isPageReload,
2983
+ ms as initQRScanner,
2984
+ vs as initSettingsButton,
2985
+ Es as initThemeParams,
2986
+ Rs as initUtils,
2987
+ Cs as initViewport,
2988
+ Ss as initWeb,
2989
+ q as invokeCustomMethod,
2990
+ Bt as isColorDark,
2991
+ at as isIframe,
2992
+ Ft as isPageReload,
3007
2993
  ct as isRGB,
3008
- Pe as isRGBShort,
3009
- Ts as isSDKError,
3010
- Rn as isSDKErrorOfType,
3011
- Ss as isSSR,
3012
- En as isTMA,
3013
- w as json,
3014
- gn as mergeClassNames,
3015
- Pn as mockTelegramEnv,
2994
+ Oe as isRGBShort,
2995
+ As as isSDKError,
2996
+ xn as isSDKErrorOfType,
2997
+ Ts as isSSR,
2998
+ Pn as isTMA,
2999
+ v as json,
3000
+ fn as mergeClassNames,
3001
+ Rn as mockTelegramEnv,
3016
3002
  x as number,
3017
3003
  z as off,
3018
3004
  y as on,
3019
- fn as parseInitData,
3020
- dt as parseLaunchParams,
3021
- Xt as parseThemeParams,
3022
- B as postEvent,
3005
+ mn as parseInitData,
3006
+ lt as parseLaunchParams,
3007
+ Zt as parseThemeParams,
3008
+ V as postEvent,
3023
3009
  g as request,
3024
- ze as requestBiometryInfo,
3025
- mn as requestThemeParams,
3026
- te as requestViewport,
3010
+ Ke as requestBiometryInfo,
3011
+ bn as requestThemeParams,
3012
+ Xt as requestViewport,
3027
3013
  nt as retrieveLaunchParams,
3028
- It as rgb,
3029
- lt as searchParams,
3030
- He as serializeLaunchParams,
3031
- Jt as serializeThemeParams,
3014
+ Ve as rgb,
3015
+ ut as searchParams,
3016
+ Ue as serializeLaunchParams,
3017
+ Kt as serializeThemeParams,
3032
3018
  P as setCSSVar,
3033
- le as setDebug,
3019
+ ue as setDebug,
3034
3020
  wn as setTargetOrigin,
3035
- h as string,
3036
- pe as subscribe,
3021
+ u as string,
3022
+ he as subscribe,
3037
3023
  C as supports,
3038
- ke as targetOrigin,
3039
- At as toRGB,
3040
- Ct as unsubscribe,
3024
+ Ie as targetOrigin,
3025
+ Vt as toRGB,
3026
+ xt as unsubscribe,
3041
3027
  U as urlToPath,
3042
- Ds as useBackButton,
3043
- Ns as useBackButtonRaw,
3028
+ Vs as useBackButton,
3029
+ Ds as useBackButtonRaw,
3044
3030
  Ms as useBiometryManager,
3045
3031
  Bs as useBiometryManagerRaw,
3046
- Ls as useClosingBehavior,
3047
- Vs as useClosingBehaviorRaw,
3048
- Hs as useCloudStorage,
3049
- $s as useCloudStorageRaw,
3050
- Ws as useHapticFeedback,
3051
- Us as useHapticFeedbackRaw,
3052
- js as useInitData,
3053
- Gs as useInitDataRaw,
3054
- Ks as useInvoice,
3055
- zs as useInvoiceRaw,
3056
- Xn as useLaunchParams,
3057
- Fs as useMainButton,
3058
- Js as useMainButtonRaw,
3059
- Ys as useMiniApp,
3060
- Qs as useMiniAppRaw,
3061
- Xs as usePopup,
3062
- Zs as usePopupRaw,
3063
- en as useQRScanner,
3064
- tn as useQRScannerRaw,
3065
- Os as useSDK,
3066
- nn as useSettingsButton,
3067
- sn as useSettingsButtonRaw,
3068
- on as useThemeParams,
3069
- rn as useThemeParamsRaw,
3070
- cn as useUtils,
3071
- an as useUtilsRaw,
3072
- pn as useViewport,
3073
- hn as useViewportRaw,
3074
- Tn as withBackButton,
3075
- Sn as withBackButtonRaw,
3076
- In as withBiometryManager,
3077
- An as withBiometryManagerRaw,
3032
+ $s as useClosingBehavior,
3033
+ Ls as useClosingBehaviorRaw,
3034
+ Us as useCloudStorage,
3035
+ Hs as useCloudStorageRaw,
3036
+ Gs as useHapticFeedback,
3037
+ Ws as useHapticFeedbackRaw,
3038
+ zs as useInitData,
3039
+ js as useInitDataRaw,
3040
+ Js as useInvoice,
3041
+ Ks as useInvoiceRaw,
3042
+ tr as useLaunchParams,
3043
+ Qs as useMainButton,
3044
+ Fs as useMainButtonRaw,
3045
+ Zs as useMiniApp,
3046
+ Ys as useMiniAppRaw,
3047
+ tn as usePopup,
3048
+ Xs as usePopupRaw,
3049
+ sn as useQRScanner,
3050
+ en as useQRScannerRaw,
3051
+ Ns as useSDK,
3052
+ rn as useSettingsButton,
3053
+ nn as useSettingsButtonRaw,
3054
+ an as useThemeParams,
3055
+ on as useThemeParamsRaw,
3056
+ hn as useUtils,
3057
+ cn as useUtilsRaw,
3058
+ un as useViewport,
3059
+ pn as useViewportRaw,
3060
+ An as withBackButton,
3061
+ Tn as withBackButtonRaw,
3062
+ kn as withBiometryManager,
3063
+ In as withBiometryManagerRaw,
3078
3064
  qn as withClosingBehavior,
3079
- kn as withClosingBehaviorRaw,
3080
- Nn as withCloudStorage,
3081
- On as withCloudStorageRaw,
3065
+ On as withClosingBehaviorRaw,
3066
+ Dn as withCloudStorage,
3067
+ Nn as withCloudStorageRaw,
3082
3068
  Bn as withHapticFeedback,
3083
- Dn as withHapticFeedbackRaw,
3084
- Vn as withInitData,
3069
+ Vn as withHapticFeedbackRaw,
3070
+ Ln as withInitData,
3085
3071
  Mn as withInitDataRaw,
3086
- $n as withInvoice,
3087
- Ln as withInvoiceRaw,
3088
- Un as withMainButton,
3089
- Hn as withMainButtonRaw,
3090
- Gn as withMiniApp,
3091
- Wn as withMiniAppRaw,
3092
- zn as withPopup,
3093
- jn as withPopupRaw,
3094
- Jn as withQRScanner,
3095
- Kn as withQRScannerRaw,
3096
- Qn as withSettingsButton,
3097
- Fn as withSettingsButtonRaw,
3098
- Zn as withThemeParams,
3099
- Yn as withThemeParamsRaw,
3100
- Mt as withTimeout,
3101
- er as withUtils,
3102
- tr as withUtilsRaw,
3103
- nr as withViewport,
3104
- sr as withViewportRaw
3072
+ Hn as withInvoice,
3073
+ $n as withInvoiceRaw,
3074
+ Wn as withMainButton,
3075
+ Un as withMainButtonRaw,
3076
+ jn as withMiniApp,
3077
+ Gn as withMiniAppRaw,
3078
+ Kn as withPopup,
3079
+ zn as withPopupRaw,
3080
+ Fn as withQRScanner,
3081
+ Jn as withQRScannerRaw,
3082
+ Yn as withSettingsButton,
3083
+ Qn as withSettingsButtonRaw,
3084
+ Xn as withThemeParams,
3085
+ Zn as withThemeParamsRaw,
3086
+ Dt as withTimeout,
3087
+ sr as withUtils,
3088
+ er as withUtilsRaw,
3089
+ rr as withViewport,
3090
+ nr as withViewportRaw
3105
3091
  };
3106
3092
  //# sourceMappingURL=index.js.map