@tma.js/sdk 3.1.6 → 3.1.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,20 +1,19 @@
1
- var it = Object.defineProperty;
2
- var ot = (s, t, r) => t in s ? it(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
3
- var e = (s, t, r) => ot(s, typeof t != "symbol" ? t + "" : t, r);
4
- import { batch as ue, signal as O, computed as C } from "@tma.js/signals";
5
- import { supports as ee, isTMAFp as at, postEventFp as pt, off as re, on as z, requestFp as ut, request2Fp as ct, invokeCustomMethodFp as lt, retrieveLaunchParamsFp as ce, retrieveRawInitDataFp as ht, captureSameReq as dt, logger as Re } from "@tma.js/bridge";
6
- import { CancelledError as yn, InvalidLaunchParamsError as In, InvokeCustomMethodFailedError as En, LaunchParamsRetrieveError as qn, MethodParameterUnsupportedError as An, MethodUnsupportedError as Bn, TimeoutError as xn, UnknownEnvError as Mn, applyPolyfills as Vn, createLogger as Tn, createPostEvent as Ln, createStartParam as $n, createStartParamFp as Rn, debug as Pn, decodeBase64Url as On, decodeBase64UrlFp as Dn, decodeStartParam as Gn, decodeStartParamFp as jn, deepSnakeToCamelObjKeys as Un, emitEvent as Wn, encodeBase64Url as Hn, getReleaseVersion as Kn, isSafeToCreateStartParam as Qn, isTMA as zn, isTMAFp as Nn, logger as Jn, mockTelegramEnv as Yn, off as Zn, offAll as Xn, on as ei, retrieveLaunchParams as ti, retrieveLaunchParamsFp as si, retrieveRawInitData as ri, retrieveRawInitDataFp as ni, retrieveRawLaunchParams as ii, retrieveRawLaunchParamsFp as oi, setDebug as ai, setTargetOrigin as pi, supports as ui, targetOrigin as ci } from "@tma.js/bridge";
7
- import { throwifyFpFn as he, throwifyAnyEither as Ge, getStorageValue as _t, setStorageValue as ft, snakeToKebab as mt, createCbCollector as ke, camelToKebab as je, BetterTaskEither as ge } from "@tma.js/toolkit";
8
- import { BetterPromise as Ue } from "better-promises";
9
- import { toRGBFullFp as bt, isRGB as _e, pipeQueryToSchema as gt, pipeJsonToSchema as Ft } from "@tma.js/transformers";
10
- import { isAnyRGB as hi, isRGB as di, isRGBA as _i, isRGBAShort as fi, isRGBShort as mi, parseInitDataQuery as bi, parseInitDataQueryFp as gi, parseLaunchParamsQuery as Fi, parseLaunchParamsQueryFp as wi, serializeInitDataQuery as Ci, serializeLaunchParamsQuery as Si, toRGB as vi, toRGBFp as ki, toRGBFull as yi, toRGBFullFp as Ii } from "@tma.js/transformers";
1
+ var nt = Object.defineProperty;
2
+ var it = (s, t, r) => t in s ? nt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
3
+ var e = (s, t, r) => it(s, typeof t != "symbol" ? t + "" : t, r);
4
+ import { batch as ce, signal as O, computed as C } from "@tma.js/signals";
5
+ import { supports as ee, isTMAFp as ot, postEventFp as at, off as ne, on as z, requestFp as pt, request2Fp as ut, invokeCustomMethodFp as ct, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as lt, captureSameReq as ht, logger as Re } from "@tma.js/bridge";
6
+ import { CancelledError as vn, InvalidLaunchParamsError as kn, InvokeCustomMethodFailedError as yn, LaunchParamsRetrieveError as In, MethodParameterUnsupportedError as En, MethodUnsupportedError as qn, TimeoutError as An, UnknownEnvError as Bn, applyPolyfills as xn, createLogger as Mn, createPostEvent as Vn, createStartParam as Tn, createStartParamFp as Ln, debug as $n, decodeBase64Url as Rn, decodeBase64UrlFp as Pn, decodeStartParam as On, decodeStartParamFp as Dn, deepSnakeToCamelObjKeys as Gn, emitEvent as jn, encodeBase64Url as Un, getReleaseVersion as Wn, isSafeToCreateStartParam as Hn, isTMA as Kn, isTMAFp as Qn, logger as zn, mockTelegramEnv as Nn, off as Jn, offAll as Yn, on as Zn, retrieveLaunchParams as Xn, retrieveLaunchParamsFp as ei, retrieveRawInitData as ti, retrieveRawInitDataFp as si, retrieveRawLaunchParams as ri, retrieveRawLaunchParamsFp as ni, setDebug as ii, setTargetOrigin as oi, supports as ai, targetOrigin as pi } from "@tma.js/bridge";
7
+ import { throwifyFpFn as te, throwifyAnyEither as Ge, getStorageValue as dt, setStorageValue as _t, snakeToKebab as ft, createCbCollector as ke, camelToKebab as je, BetterTaskEither as ge } from "@tma.js/toolkit";
8
+ import { toRGBFullFp as mt, isRGB as _e, pipeQueryToSchema as bt, pipeJsonToSchema as gt } from "@tma.js/transformers";
9
+ import { isAnyRGB as ci, isRGB as li, isRGBA as hi, isRGBAShort as di, isRGBShort as _i, parseInitDataQuery as fi, parseInitDataQueryFp as mi, parseLaunchParamsQuery as bi, parseLaunchParamsQueryFp as gi, serializeInitDataQuery as Fi, serializeLaunchParamsQuery as wi, toRGB as Ci, toRGBFp as Si, toRGBFull as vi, toRGBFullFp as ki } from "@tma.js/transformers";
11
10
  import { either as b, function as u, option as Q, taskEither as c } from "fp-ts";
12
11
  import { errorClassWithData as ye, errorClass as G } from "error-kid";
13
- import { parse as Pe, record as wt, string as K, array as Ct, safeParse as Fe, looseObject as Oe, pipe as We, transform as He, date as Ke, optional as St, number as Qe, integer as vt } from "valibot";
12
+ import { parse as Pe, record as Ft, string as K, array as wt, safeParse as Fe, looseObject as Oe, pipe as Ue, transform as We, date as He, optional as Ct, number as Ke, integer as St } from "valibot";
14
13
  function R(s) {
15
14
  return typeof s == "function" ? s() : s;
16
15
  }
17
- class ne {
16
+ class ie {
18
17
  constructor({
19
18
  onMounted: t,
20
19
  restoreState: r,
@@ -40,12 +39,12 @@ class ne {
40
39
  return b.right(void 0);
41
40
  const p = R(o) ? r() : void 0, i = p ? b.right(p) : typeof n == "function" ? n() : b.right(n);
42
41
  return u.pipe(i, b.map((l) => {
43
- ue(() => {
42
+ ce(() => {
44
43
  this._isMounted.set(!0), t == null || t(l);
45
44
  });
46
45
  }));
47
46
  }, this.unmount = () => {
48
- this._isMounted() && ue(() => {
47
+ this._isMounted() && ce(() => {
49
48
  this._isMounted.set(!1), a == null || a();
50
49
  });
51
50
  };
@@ -100,7 +99,7 @@ function W(s, t) {
100
99
  }
101
100
  // @__NO_SIDE_EFFECTS__
102
101
  function h(s) {
103
- return Object.assign(he(s), {
102
+ return Object.assign(te(s), {
104
103
  ifAvailable(...t) {
105
104
  return u.pipe(
106
105
  s.ifAvailable(...t),
@@ -118,70 +117,78 @@ function h(s) {
118
117
  function X(s) {
119
118
  return [s];
120
119
  }
121
- class pe extends (/* @__PURE__ */ ye(
122
- "ValidationError",
123
- (t, r) => ({ input: t, issues: r }),
124
- "Validation error"
125
- )) {
126
- }
127
- class Ie extends (/* @__PURE__ */ G(
128
- "CSSVarsBoundError",
129
- "CSS variables are already bound"
130
- )) {
131
- }
132
- class kt extends (/* @__PURE__ */ ye("DeviceStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
133
- }
134
- class yt extends (/* @__PURE__ */ ye("SecureStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
135
- }
136
- class It extends (/* @__PURE__ */ G(
137
- "NotAvailableError",
138
- X
139
- )) {
140
- }
141
- class Tr extends (/* @__PURE__ */ G(
142
- "InvalidEnvError",
143
- X
144
- )) {
145
- }
146
- class Et extends (/* @__PURE__ */ G(
147
- "FunctionNotAvailableError",
148
- X
149
- )) {
150
- }
151
- class U extends (/* @__PURE__ */ G(
152
- "InvalidArgumentsError",
153
- (t, r) => [t, { cause: r }]
154
- )) {
155
- }
156
- class Ee extends (/* @__PURE__ */ G(
157
- "ConcurrentCallError",
158
- X
159
- )) {
160
- }
161
- class qt extends (/* @__PURE__ */ G(
162
- "SetEmojiStatusError",
163
- (t) => [`Failed to set emoji status: ${t}`]
164
- )) {
165
- }
166
- class ze extends (/* @__PURE__ */ G(
167
- "AccessDeniedError",
168
- X
169
- )) {
170
- }
171
- class At extends (/* @__PURE__ */ G(
172
- "FullscreenFailedError",
173
- X
174
- )) {
175
- }
176
- class Bt extends (/* @__PURE__ */ G(
177
- "ShareMessageError",
178
- X
179
- )) {
180
- }
181
- class xt extends (/* @__PURE__ */ G(
182
- "UnknownThemeParamsKeyError",
183
- (t) => [`Unknown theme params key passed: ${t}`]
184
- )) {
120
+ class ue extends (/* @__PURE__ */ ye({
121
+ name: "ValidationError",
122
+ data: (t, r) => ({ input: t, issues: r }),
123
+ super: "Validation error"
124
+ })) {
125
+ }
126
+ class Ie extends (/* @__PURE__ */ G({
127
+ name: "CSSVarsBoundError",
128
+ super: "CSS variables are already bound"
129
+ })) {
130
+ }
131
+ class vt extends (/* @__PURE__ */ ye({
132
+ name: "DeviceStorageMethodError",
133
+ data: (t) => ({ error: t }),
134
+ super: (t) => [t]
135
+ })) {
136
+ }
137
+ class kt extends (/* @__PURE__ */ ye({
138
+ name: "SecureStorageMethodError",
139
+ data: (t) => ({ error: t }),
140
+ super: (t) => [t]
141
+ })) {
142
+ }
143
+ class yt extends (/* @__PURE__ */ G({
144
+ name: "NotAvailableError",
145
+ super: X
146
+ })) {
147
+ }
148
+ class Mr extends (/* @__PURE__ */ G({
149
+ name: "InvalidEnvError",
150
+ super: X
151
+ })) {
152
+ }
153
+ class It extends (/* @__PURE__ */ G({
154
+ name: "FunctionNotAvailableError",
155
+ super: X
156
+ })) {
157
+ }
158
+ class U extends (/* @__PURE__ */ G({
159
+ name: "InvalidArgumentsError",
160
+ super: (t, r) => [t, { cause: r }]
161
+ })) {
162
+ }
163
+ class Ee extends (/* @__PURE__ */ G({
164
+ name: "ConcurrentCallError",
165
+ super: X
166
+ })) {
167
+ }
168
+ class Et extends (/* @__PURE__ */ G({
169
+ name: "SetEmojiStatusError",
170
+ super: (t) => [`Failed to set emoji status: ${t}`]
171
+ })) {
172
+ }
173
+ class Qe extends (/* @__PURE__ */ G({
174
+ name: "AccessDeniedError",
175
+ super: X
176
+ })) {
177
+ }
178
+ class qt extends (/* @__PURE__ */ G({
179
+ name: "FullscreenFailedError",
180
+ super: X
181
+ })) {
182
+ }
183
+ class At extends (/* @__PURE__ */ G({
184
+ name: "ShareMessageError",
185
+ super: X
186
+ })) {
187
+ }
188
+ class Bt extends (/* @__PURE__ */ G({
189
+ name: "UnknownThemeParamsKeyError",
190
+ super: (t) => [`Unknown theme params key passed: ${t}`]
191
+ })) {
185
192
  }
186
193
  function A(s, t) {
187
194
  const r = C(() => R(t.version) || "100"), n = C(() => R(t.isTma)), { requires: a, returns: o } = t, p = a ? typeof a == "object" ? a : { every: [a] } : void 0, i = (m) => {
@@ -205,7 +212,7 @@ function A(s, t) {
205
212
  }, F = C(() => !l()), _ = C(() => r() !== "0.0"), S = C(() => t.isMounted ? t.isMounted() : !0), w = C(
206
213
  () => n() && _() && F() && S()
207
214
  ), k = (m) => {
208
- const g = new Et(m);
215
+ const g = new It(m);
209
216
  return ["task", "promise"].includes(t.returns) ? c.left(g) : b.left(g);
210
217
  }, y = (...m) => o === "plain" ? b.tryCatch(() => s(...m), (g) => g) : o === "promise" ? c.tryCatch(() => s(...m), (g) => g) : s(...m);
211
218
  return Object.assign(
@@ -339,7 +346,7 @@ class de {
339
346
  onChange(m) {
340
347
  r.set(m);
341
348
  }
342
- }), S = new ne({
349
+ }), S = new ie({
343
350
  initialState: o,
344
351
  isPageReload: p,
345
352
  onMounted: _.setState,
@@ -383,7 +390,7 @@ class de {
383
390
  return C(() => this.state()[t]);
384
391
  }
385
392
  }
386
- class Mt {
393
+ class xt {
387
394
  constructor(t) {
388
395
  /**
389
396
  * Signal indicating if the component is currently visible.
@@ -476,40 +483,40 @@ class Mt {
476
483
  }
477
484
  }
478
485
  function v() {
479
- return { isTma: C(() => at()) };
486
+ return { isTma: C(() => ot()) };
480
487
  }
481
- function te(s) {
488
+ function se(s) {
482
489
  return (t) => ({ ...t, ...R(s) });
483
490
  }
484
491
  // @__NO_SIDE_EFFECTS__
485
- function ie(s, t) {
492
+ function oe(s, t) {
486
493
  return O(s, t);
487
494
  }
488
- const Ne = /* @__PURE__ */ ie(pt), se = (...s) => Ne()(...s), Vt = (...s) => Ge(se(...s)), V = te({
489
- postEvent: se
495
+ const ze = /* @__PURE__ */ oe(at), re = (...s) => ze()(...s), Mt = (...s) => Ge(re(...s)), V = se({
496
+ postEvent: re
490
497
  });
491
- function Tt(s) {
498
+ function Vt(s) {
492
499
  return {
493
- get: () => _t(s),
500
+ get: () => dt(s),
494
501
  set(t) {
495
- ft(s, t);
502
+ _t(s, t);
496
503
  }
497
504
  };
498
505
  }
499
- function Lt() {
506
+ function Tt() {
500
507
  return performance.getEntriesByType("navigation")[0];
501
508
  }
502
- function $t() {
503
- const s = Lt();
509
+ function Lt() {
510
+ const s = Tt();
504
511
  return !!s && s.type === "reload";
505
512
  }
506
513
  function Y(s) {
507
- return te({
508
- storage: Tt(s),
509
- isPageReload: $t
514
+ return se({
515
+ storage: Vt(s),
516
+ isPageReload: Lt
510
517
  });
511
518
  }
512
- const Ce = /* @__PURE__ */ ie("0.0"), I = te({ version: Ce });
519
+ const Ce = /* @__PURE__ */ oe("0.0"), I = se({ version: Ce });
513
520
  // @__NO_SIDE_EFFECTS__
514
521
  function qe(s, t) {
515
522
  return {
@@ -523,11 +530,11 @@ function qe(s, t) {
523
530
  return z(t, r, n);
524
531
  },
525
532
  offClick(r, n) {
526
- re(t, r, n);
533
+ ne(t, r, n);
527
534
  }
528
535
  };
529
536
  }
530
- const Lr = /* @__PURE__ */ new Mt(
537
+ const Vr = /* @__PURE__ */ new xt(
531
538
  /* @__PURE__ */ qe("backButton", "back_button_pressed")
532
539
  );
533
540
  class Ae {
@@ -559,26 +566,26 @@ class Ae {
559
566
  return u.pipe(
560
567
  i ? c.right(i) : t(p),
561
568
  c.map((l) => {
562
- this._isMounted() || ue(() => {
569
+ this._isMounted() || ce(() => {
563
570
  this._isMounted.set(!0), r == null || r(l);
564
571
  });
565
572
  })
566
573
  );
567
574
  }, this.unmount = () => {
568
- this._isMounted() && ue(() => {
575
+ this._isMounted() && ce(() => {
569
576
  this._isMounted.set(!1), a == null || a();
570
577
  });
571
578
  };
572
579
  }
573
580
  }
574
581
  function De() {
575
- return new It("Biometry is not available");
582
+ return new yt("Biometry is not available");
576
583
  }
577
584
  function me(s) {
578
585
  let t = !1, r = !1, n = "", a = !1, o = "", p = !1;
579
586
  return s.available && (t = !0, r = s.token_saved, n = s.device_id, a = s.access_requested, o = s.type, p = s.access_granted), { available: t, tokenSaved: r, deviceId: n, type: o, accessGranted: p, accessRequested: a };
580
587
  }
581
- class Rt {
588
+ class $t {
582
589
  constructor({
583
590
  version: t,
584
591
  request: r,
@@ -741,15 +748,15 @@ class Rt {
741
748
  }), this.authenticate = /* @__PURE__ */ h(this.authenticateFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestAccess = /* @__PURE__ */ h(this.requestAccessFp), this.updateToken = /* @__PURE__ */ h(this.updateTokenFp), this.mount = /* @__PURE__ */ h(this.mountFp);
742
749
  }
743
750
  }
744
- const Pt = (s, t, r) => ut(s, t, {
745
- postEvent: se,
751
+ const Rt = (s, t, r) => pt(s, t, {
752
+ postEvent: re,
746
753
  ...r
747
- }), Je = (s, t, r) => ct(s, t, {
748
- postEvent: se,
754
+ }), Ne = (s, t, r) => ut(s, t, {
755
+ postEvent: re,
749
756
  ...r
750
- }), $r = (...s) => Ue.fn(() => Pt(...s)()), Rr = (...s) => Ue.fn(() => Je(...s)()), L = te({ request: Je });
751
- function Ot() {
752
- return new Rt({
757
+ }), Tr = te(Rt), Lr = te(Ne), L = se({ request: Ne });
758
+ function Pt() {
759
+ return new $t({
753
760
  ...u.pipe(
754
761
  v(),
755
762
  V,
@@ -758,15 +765,15 @@ function Ot() {
758
765
  Y("biometry")
759
766
  ),
760
767
  offInfoReceived(s) {
761
- re("biometry_info_received", s);
768
+ ne("biometry_info_received", s);
762
769
  },
763
770
  onInfoReceived(s) {
764
771
  return z("biometry_info_received", s);
765
772
  }
766
773
  });
767
774
  }
768
- const Pr = /* @__PURE__ */ Ot();
769
- class Dt {
775
+ const $r = /* @__PURE__ */ Pt();
776
+ class Ot {
770
777
  constructor({ postEvent: t, storage: r, isTma: n, isPageReload: a }) {
771
778
  /**
772
779
  * Signal indicating if closing confirmation dialog is currently enabled.
@@ -809,7 +816,7 @@ class Dt {
809
816
  onChange(_) {
810
817
  r.set(_);
811
818
  }
812
- }), p = new ne({
819
+ }), p = new ie({
813
820
  onMounted: o.setState,
814
821
  restoreState: r.get,
815
822
  initialState: { isConfirmationEnabled: !1 },
@@ -831,15 +838,15 @@ class Dt {
831
838
  }), this.unmount = p.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
832
839
  }
833
840
  }
834
- function Gt() {
835
- return new Dt(u.pipe(
841
+ function Dt() {
842
+ return new Ot(u.pipe(
836
843
  v(),
837
844
  Y("closingBehavior"),
838
845
  V
839
846
  ));
840
847
  }
841
- const Or = /* @__PURE__ */ Gt();
842
- class jt {
848
+ const Rr = /* @__PURE__ */ Dt();
849
+ class Gt {
843
850
  constructor({ version: t, isTma: r, invokeCustomMethod: n }) {
844
851
  /**
845
852
  * Signal indicating if the component is supported.
@@ -931,11 +938,11 @@ class jt {
931
938
  c.map((i) => ({
932
939
  // Fulfill the response with probably missing keys.
933
940
  ...o.reduce((l, f) => (l[f] = "", l), {}),
934
- ...Pe(wt(K(), K()), i)
941
+ ...Pe(Ft(K(), K()), i)
935
942
  }))
936
943
  )), this.getKeysFp = a((o) => u.pipe(
937
944
  n("getStorageKeys", {}, o),
938
- c.map((p) => Pe(Ct(K()), p))
945
+ c.map((p) => Pe(wt(K()), p))
939
946
  )), this.setItemFp = a((o, p, i) => u.pipe(
940
947
  n("saveStorageValue", { key: o, value: p }, i),
941
948
  c.map(() => {
@@ -943,28 +950,28 @@ class jt {
943
950
  )), this.clearFp = a((o) => u.pipe(this.getKeysFp(o), c.chain(this.deleteItemFp))), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.getItems = /* @__PURE__ */ h(this.getItemsFp), this.getKeys = /* @__PURE__ */ h(this.getKeysFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
944
951
  }
945
952
  }
946
- const be = /* @__PURE__ */ ie(0);
953
+ const be = /* @__PURE__ */ oe(0);
947
954
  function Be() {
948
955
  return be.set(be() + 1), be().toString();
949
956
  }
950
- function Ut(s, t, r) {
951
- return lt(s, t, Be(), {
957
+ function jt(s, t, r) {
958
+ return ct(s, t, Be(), {
952
959
  ...r || {},
953
- postEvent: se
960
+ postEvent: re
954
961
  });
955
962
  }
956
- const xe = te({
957
- invokeCustomMethod: Ut
963
+ const xe = se({
964
+ invokeCustomMethod: jt
958
965
  });
959
- function Wt() {
960
- return new jt(u.pipe(
966
+ function Ut() {
967
+ return new Gt(u.pipe(
961
968
  v(),
962
969
  I,
963
970
  xe
964
971
  ));
965
972
  }
966
- const Dr = /* @__PURE__ */ Wt();
967
- class Ht {
973
+ const Pr = /* @__PURE__ */ Ut();
974
+ class Wt {
968
975
  constructor({ isTma: t, request: r, version: n, createRequestId: a }) {
969
976
  /**
970
977
  * Retrieves an item using its key.
@@ -1014,7 +1021,7 @@ class Ht {
1014
1021
  params: { ...f, req_id: F },
1015
1022
  capture: (_) => "payload" in _ ? _.payload.req_id === F : !0
1016
1023
  }),
1017
- c.chain((_) => _.event === "device_storage_failed" ? c.left(new kt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
1024
+ c.chain((_) => _.event === "device_storage_failed" ? c.left(new vt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
1018
1025
  );
1019
1026
  };
1020
1027
  this.getItemFp = o((i) => u.pipe(
@@ -1031,32 +1038,32 @@ class Ht {
1031
1038
  )), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.clear = /* @__PURE__ */ h(this.clearFp);
1032
1039
  }
1033
1040
  }
1034
- const Ye = te({ createRequestId: Be });
1035
- function Kt() {
1036
- return new Ht(u.pipe(
1041
+ const Je = se({ createRequestId: Be });
1042
+ function Ht() {
1043
+ return new Wt(u.pipe(
1037
1044
  v(),
1038
1045
  I,
1039
1046
  L,
1040
- Ye
1047
+ Je
1041
1048
  ));
1042
1049
  }
1043
- const Gr = /* @__PURE__ */ Kt();
1044
- function Qt({ request: s, ...t }) {
1050
+ const Or = /* @__PURE__ */ Ht();
1051
+ function Kt({ request: s, ...t }) {
1045
1052
  return A((r) => u.pipe(
1046
1053
  s("web_app_request_emoji_status_access", "emoji_status_access_requested", r),
1047
1054
  c.map((n) => n.status)
1048
1055
  ), { ...t, requires: "web_app_request_emoji_status_access", returns: "task" });
1049
1056
  }
1050
1057
  // @__NO_SIDE_EFFECTS__
1051
- function zt() {
1052
- return Qt(u.pipe(
1058
+ function Qt() {
1059
+ return Kt(u.pipe(
1053
1060
  v(),
1054
1061
  I,
1055
1062
  L
1056
1063
  ));
1057
1064
  }
1058
- const Nt = /* @__PURE__ */ zt(), jr = /* @__PURE__ */ h(Nt);
1059
- function Jt({ request: s, ...t }) {
1065
+ const zt = /* @__PURE__ */ Qt(), Dr = /* @__PURE__ */ h(zt);
1066
+ function Nt({ request: s, ...t }) {
1060
1067
  return A((r, n) => u.pipe(
1061
1068
  s("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
1062
1069
  params: {
@@ -1065,7 +1072,7 @@ function Jt({ request: s, ...t }) {
1065
1072
  },
1066
1073
  ...n
1067
1074
  }),
1068
- c.chainW((a) => a.event === "emoji_status_failed" ? c.left(new qt(a.payload.error)) : c.right(void 0))
1075
+ c.chainW((a) => a.event === "emoji_status_failed" ? c.left(new Et(a.payload.error)) : c.right(void 0))
1069
1076
  ), {
1070
1077
  ...t,
1071
1078
  requires: "web_app_set_emoji_status",
@@ -1073,15 +1080,15 @@ function Jt({ request: s, ...t }) {
1073
1080
  });
1074
1081
  }
1075
1082
  // @__NO_SIDE_EFFECTS__
1076
- function Yt() {
1077
- return Jt(u.pipe(
1083
+ function Jt() {
1084
+ return Nt(u.pipe(
1078
1085
  v(),
1079
1086
  L,
1080
1087
  I
1081
1088
  ));
1082
1089
  }
1083
- const Zt = /* @__PURE__ */ Yt(), Ur = /* @__PURE__ */ h(Zt);
1084
- class Xt {
1090
+ const Yt = /* @__PURE__ */ Jt(), Gr = /* @__PURE__ */ h(Yt);
1091
+ class Zt {
1085
1092
  constructor({ postEvent: t, isTma: r, version: n }) {
1086
1093
  /**
1087
1094
  * Signal indicating if the component is supported.
@@ -1132,42 +1139,42 @@ class Xt {
1132
1139
  this.isSupported = W(a, n), this.impactOccurredFp = o((p) => t(a, { type: "impact", impact_style: p })), this.notificationOccurredFp = o((p) => t(a, { type: "notification", notification_type: p })), this.selectionChangedFp = o(() => t(a, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1133
1140
  }
1134
1141
  }
1135
- function es() {
1136
- return new Xt(u.pipe(
1142
+ function Xt() {
1143
+ return new Zt(u.pipe(
1137
1144
  v(),
1138
1145
  V,
1139
1146
  I
1140
1147
  ));
1141
1148
  }
1142
- const Wr = /* @__PURE__ */ es();
1143
- function ts({ postEvent: s, ...t }) {
1149
+ const jr = /* @__PURE__ */ Xt();
1150
+ function es({ postEvent: s, ...t }) {
1144
1151
  return A(() => s("web_app_add_to_home_screen"), { ...t, requires: "web_app_add_to_home_screen", returns: "either" });
1145
1152
  }
1146
1153
  // @__NO_SIDE_EFFECTS__
1147
- function ss() {
1148
- return ts(u.pipe(
1154
+ function ts() {
1155
+ return es(u.pipe(
1149
1156
  v(),
1150
1157
  I,
1151
1158
  V
1152
1159
  ));
1153
1160
  }
1154
- const rs = /* @__PURE__ */ ss(), Hr = /* @__PURE__ */ h(rs);
1155
- function ns({ request: s, ...t }) {
1161
+ const ss = /* @__PURE__ */ ts(), Ur = /* @__PURE__ */ h(ss);
1162
+ function rs({ request: s, ...t }) {
1156
1163
  return A((r) => u.pipe(
1157
1164
  s("web_app_check_home_screen", "home_screen_checked", r),
1158
1165
  c.map((n) => n.status || "unknown")
1159
1166
  ), { ...t, requires: "web_app_check_home_screen", returns: "task" });
1160
1167
  }
1161
1168
  // @__NO_SIDE_EFFECTS__
1162
- function is() {
1163
- return ns(u.pipe(
1169
+ function ns() {
1170
+ return rs(u.pipe(
1164
1171
  v(),
1165
1172
  I,
1166
1173
  L
1167
1174
  ));
1168
1175
  }
1169
- const os = /* @__PURE__ */ is(), Kr = /* @__PURE__ */ h(os);
1170
- class as {
1176
+ const is = /* @__PURE__ */ ns(), Wr = /* @__PURE__ */ h(is);
1177
+ class os {
1171
1178
  constructor({ retrieveInitData: t }) {
1172
1179
  e(this, "_state", O());
1173
1180
  e(this, "_raw", O());
@@ -1245,7 +1252,7 @@ class as {
1245
1252
  }, ({ raw: r, obj: n }) => {
1246
1253
  this._state.set(n), this._raw.set(r);
1247
1254
  }))
1248
- ), this.restore = he(this.restoreFp);
1255
+ ), this.restore = te(this.restoreFp);
1249
1256
  }
1250
1257
  fromState(t) {
1251
1258
  return C(() => {
@@ -1254,16 +1261,16 @@ class as {
1254
1261
  });
1255
1262
  }
1256
1263
  }
1257
- function ps() {
1258
- return new as({
1264
+ function as() {
1265
+ return new os({
1259
1266
  retrieveInitData() {
1260
1267
  return u.pipe(
1261
1268
  b.Do,
1262
1269
  b.bindW("obj", () => u.pipe(
1263
- ce(),
1270
+ le(),
1264
1271
  b.map(({ tgWebAppData: s }) => s ? Q.some(s) : Q.none)
1265
1272
  )),
1266
- b.bindW("raw", ht),
1273
+ b.bindW("raw", lt),
1267
1274
  b.map(({ obj: s, raw: t }) => u.pipe(
1268
1275
  Q.Do,
1269
1276
  Q.bind("obj", () => s),
@@ -1273,8 +1280,8 @@ function ps() {
1273
1280
  }
1274
1281
  });
1275
1282
  }
1276
- const Qr = /* @__PURE__ */ ps();
1277
- class us {
1283
+ const Hr = /* @__PURE__ */ as();
1284
+ class ps {
1278
1285
  constructor({ version: t, request: r, isTma: n }) {
1279
1286
  /**
1280
1287
  * Signal indicating if any invoice is currently opened.
@@ -1337,11 +1344,11 @@ class us {
1337
1344
  }), this.openUrl = /* @__PURE__ */ h(this.openUrlFp), this.openSlug = /* @__PURE__ */ h(this.openSlugFp);
1338
1345
  }
1339
1346
  }
1340
- function cs() {
1341
- return new us(u.pipe(v(), L, I));
1347
+ function us() {
1348
+ return new ps(u.pipe(v(), L, I));
1342
1349
  }
1343
- const zr = /* @__PURE__ */ cs();
1344
- function ls({ postEvent: s, ...t }) {
1350
+ const Kr = /* @__PURE__ */ us();
1351
+ function cs({ postEvent: s, ...t }) {
1345
1352
  return A((r, n = {}) => {
1346
1353
  if (typeof r == "string")
1347
1354
  try {
@@ -1357,39 +1364,39 @@ function ls({ postEvent: s, ...t }) {
1357
1364
  }, { ...t, returns: "either" });
1358
1365
  }
1359
1366
  // @__NO_SIDE_EFFECTS__
1360
- function hs() {
1361
- return ls(u.pipe(v(), V));
1367
+ function ls() {
1368
+ return cs(u.pipe(v(), V));
1362
1369
  }
1363
- const ds = /* @__PURE__ */ hs(), Nr = /* @__PURE__ */ h(ds);
1364
- function _s({ postEvent: s, version: t, ...r }) {
1370
+ const hs = /* @__PURE__ */ ls(), Qr = /* @__PURE__ */ h(hs);
1371
+ function ds({ postEvent: s, version: t, ...r }) {
1365
1372
  return A((n) => {
1366
1373
  const a = n.toString();
1367
1374
  return a.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", R(t)) ? (n = new URL(n), s("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = a, b.right(void 0)) : b.left(new U(`"${a}" is invalid URL`));
1368
1375
  }, { ...r, returns: "either" });
1369
1376
  }
1370
1377
  // @__NO_SIDE_EFFECTS__
1371
- function fs() {
1372
- return _s(u.pipe(
1378
+ function _s() {
1379
+ return ds(u.pipe(
1373
1380
  v(),
1374
1381
  V,
1375
1382
  I
1376
1383
  ));
1377
1384
  }
1378
- const Ze = /* @__PURE__ */ fs(), Jr = /* @__PURE__ */ h(Ze);
1379
- function ms({ openTelegramLink: s, ...t }) {
1385
+ const Ye = /* @__PURE__ */ _s(), zr = /* @__PURE__ */ h(Ye);
1386
+ function fs({ openTelegramLink: s, ...t }) {
1380
1387
  return A((r, n) => s(
1381
1388
  "https://t.me/share/url?" + new URLSearchParams({ url: r, text: n || "" }).toString().replace(/\+/g, "%20")
1382
1389
  ), { ...t, returns: "either" });
1383
1390
  }
1384
1391
  // @__NO_SIDE_EFFECTS__
1385
- function bs() {
1386
- return ms({
1392
+ function ms() {
1393
+ return fs({
1387
1394
  ...v(),
1388
- openTelegramLink: Ze
1395
+ openTelegramLink: Ye
1389
1396
  });
1390
1397
  }
1391
- const gs = /* @__PURE__ */ bs(), Yr = /* @__PURE__ */ h(gs);
1392
- function Fs(s) {
1398
+ const bs = /* @__PURE__ */ ms(), Nr = /* @__PURE__ */ h(bs);
1399
+ function gs(s) {
1393
1400
  let t = !1, r, n;
1394
1401
  return s.available && (t = !0, r = s.access_requested, n = s.access_granted), {
1395
1402
  available: t,
@@ -1397,7 +1404,7 @@ function Fs(s) {
1397
1404
  accessRequested: r || !1
1398
1405
  };
1399
1406
  }
1400
- class ws {
1407
+ class Fs {
1401
1408
  constructor({
1402
1409
  version: t,
1403
1410
  request: r,
@@ -1480,7 +1487,7 @@ class ws {
1480
1487
  initialState(w) {
1481
1488
  return u.pipe(
1482
1489
  r("web_app_check_location", "location_checked", w),
1483
- c.map(Fs)
1490
+ c.map(gs)
1484
1491
  );
1485
1492
  }
1486
1493
  }), f = { version: t, requires: "web_app_check_location", isTma: o }, F = E({
@@ -1505,8 +1512,8 @@ class ws {
1505
1512
  )), this.mount = /* @__PURE__ */ h(this.mountFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestLocation = /* @__PURE__ */ h(this.requestLocationFp);
1506
1513
  }
1507
1514
  }
1508
- function Cs() {
1509
- return new ws(u.pipe(
1515
+ function ws() {
1516
+ return new Fs(u.pipe(
1510
1517
  v(),
1511
1518
  V,
1512
1519
  I,
@@ -1514,8 +1521,8 @@ function Cs() {
1514
1521
  Y("locationManager")
1515
1522
  ));
1516
1523
  }
1517
- const Zr = /* @__PURE__ */ Cs();
1518
- class Ss {
1524
+ const Jr = /* @__PURE__ */ ws();
1525
+ class Cs {
1519
1526
  constructor({ defaults: t, ...r }) {
1520
1527
  //#region Properties.
1521
1528
  /**
@@ -1747,9 +1754,9 @@ function Me(s, t) {
1747
1754
  function Ve(s) {
1748
1755
  document.documentElement.style.removeProperty(s);
1749
1756
  }
1750
- function vs(s) {
1757
+ function Ss(s) {
1751
1758
  return u.pipe(
1752
- bt(s),
1759
+ mt(s),
1753
1760
  b.map((t) => Math.sqrt(
1754
1761
  [0.299, 0.587, 0.114].reduce((r, n, a) => {
1755
1762
  const o = parseInt(t.slice(1 + a * 2, 1 + (a + 1) * 2), 16);
@@ -1758,8 +1765,8 @@ function vs(s) {
1758
1765
  ) < 120)
1759
1766
  );
1760
1767
  }
1761
- const Xe = he(vs);
1762
- class ks {
1768
+ const Ze = te(Ss);
1769
+ class vs {
1763
1770
  constructor({
1764
1771
  initialState: t,
1765
1772
  onChange: r,
@@ -1848,7 +1855,7 @@ class ks {
1848
1855
  */
1849
1856
  e(this, "isDark", C(() => {
1850
1857
  const t = this.bgColor();
1851
- return !t || Xe(t);
1858
+ return !t || Ze(t);
1852
1859
  }));
1853
1860
  //#endregion
1854
1861
  //#region Mounting.
@@ -1873,7 +1880,7 @@ class ks {
1873
1880
  onChange: o.set
1874
1881
  }), l = (w) => {
1875
1882
  i.setState(w.theme_params);
1876
- }, f = new ne({
1883
+ }, f = new ie({
1877
1884
  initialState: () => b.right(R(t)),
1878
1885
  isPageReload: p,
1879
1886
  onMounted(w) {
@@ -1890,7 +1897,7 @@ class ks {
1890
1897
  this.accentTextColor = i.getter("accent_text_color"), this.bgColor = i.getter("bg_color"), this.buttonColor = i.getter("button_color"), this.buttonTextColor = i.getter("button_text_color"), this.bottomBarBgColor = i.getter("bottom_bar_bg_color"), this.destructiveTextColor = i.getter("destructive_text_color"), this.headerBgColor = i.getter("header_bg_color"), this.hintColor = i.getter("hint_color"), this.linkColor = i.getter("link_color"), this.secondaryBgColor = i.getter("secondary_bg_color"), this.sectionBgColor = i.getter("section_bg_color"), this.sectionHeaderTextColor = i.getter("section_header_text_color"), this.sectionSeparatorColor = i.getter("section_separator_color"), this.subtitleTextColor = i.getter("subtitle_text_color"), this.textColor = i.getter("text_color"), this.state = i.state, this.isMounted = f.isMounted, this.bindCssVarsFp = S((w) => {
1891
1898
  if (this._isCssVarsBound())
1892
1899
  return b.left(new Ie());
1893
- w || (w = (m) => `--tg-theme-${mt(m)}`);
1900
+ w || (w = (m) => `--tg-theme-${ft(m)}`);
1894
1901
  const k = (m) => {
1895
1902
  Object.entries(i.state()).forEach(([g, d]) => {
1896
1903
  d && m(g, d);
@@ -1907,15 +1914,15 @@ class ks {
1907
1914
  }
1908
1915
  //#endregion
1909
1916
  }
1910
- const Se = /* @__PURE__ */ ie({});
1911
- function ys() {
1912
- return new ks({
1917
+ const Se = /* @__PURE__ */ oe({});
1918
+ function ks() {
1919
+ return new vs({
1913
1920
  ...u.pipe(
1914
1921
  v(),
1915
1922
  Y("themeParams")
1916
1923
  ),
1917
1924
  offChange(s) {
1918
- re("theme_changed", s);
1925
+ ne("theme_changed", s);
1919
1926
  },
1920
1927
  onChange(s) {
1921
1928
  z("theme_changed", s);
@@ -1923,21 +1930,21 @@ function ys() {
1923
1930
  initialState: Se
1924
1931
  });
1925
1932
  }
1926
- const le = /* @__PURE__ */ ys();
1933
+ const he = /* @__PURE__ */ ks();
1927
1934
  // @__NO_SIDE_EFFECTS__
1928
- function et(s, t, r) {
1935
+ function Xe(s, t, r) {
1929
1936
  return u.pipe(
1930
1937
  /* @__PURE__ */ qe(s, t),
1931
1938
  (n) => ({ ...n, defaults: r })
1932
1939
  );
1933
1940
  }
1934
- const Xr = /* @__PURE__ */ new Ss(
1935
- /* @__PURE__ */ et("mainButton", "main_button_pressed", {
1936
- bgColor: C(() => le.buttonColor() || "#2481cc"),
1937
- textColor: C(() => le.buttonTextColor() || "#ffffff")
1941
+ const Yr = /* @__PURE__ */ new Cs(
1942
+ /* @__PURE__ */ Xe("mainButton", "main_button_pressed", {
1943
+ bgColor: C(() => he.buttonColor() || "#2481cc"),
1944
+ textColor: C(() => he.buttonTextColor() || "#ffffff")
1938
1945
  })
1939
1946
  );
1940
- class Is {
1947
+ class ys {
1941
1948
  constructor({
1942
1949
  storage: t,
1943
1950
  isPageReload: r,
@@ -1958,7 +1965,7 @@ class Is {
1958
1965
  */
1959
1966
  e(this, "isDark", C(() => {
1960
1967
  const t = this.bgColorRgb();
1961
- return t ? Xe(t) : !1;
1968
+ return t ? Ze(t) : !1;
1962
1969
  }));
1963
1970
  /**
1964
1971
  * Signal indicating if the mini app is currently active.
@@ -2130,7 +2137,7 @@ class Is {
2130
2137
  P && a(T, { color: P });
2131
2138
  }
2132
2139
  });
2133
- }, _ = new ne({
2140
+ }, _ = new ie({
2134
2141
  initialState() {
2135
2142
  return b.right({
2136
2143
  bgColor: "bg_color",
@@ -2201,7 +2208,7 @@ class Is {
2201
2208
  );
2202
2209
  const j = w($);
2203
2210
  return u.pipe(
2204
- j ? a(M, { color: j }) : b.left(new xt($)),
2211
+ j ? a(M, { color: j }) : b.left(new Bt($)),
2205
2212
  b.map(() => {
2206
2213
  S.setState({ [d]: $ });
2207
2214
  })
@@ -2245,8 +2252,8 @@ class Is {
2245
2252
  }
2246
2253
  //#endregion
2247
2254
  }
2248
- function Es() {
2249
- return new Is({
2255
+ function Is() {
2256
+ return new ys({
2250
2257
  ...u.pipe(
2251
2258
  v(),
2252
2259
  V,
@@ -2254,16 +2261,16 @@ function Es() {
2254
2261
  Y("miniApp")
2255
2262
  ),
2256
2263
  offVisibilityChanged(s) {
2257
- re("visibility_changed", s);
2264
+ ne("visibility_changed", s);
2258
2265
  },
2259
2266
  onVisibilityChanged(s) {
2260
2267
  z("visibility_changed", s);
2261
2268
  },
2262
- theme: le.state
2269
+ theme: he.state
2263
2270
  });
2264
2271
  }
2265
- const qs = /* @__PURE__ */ Es();
2266
- function As(s) {
2272
+ const Es = /* @__PURE__ */ Is();
2273
+ function qs(s) {
2267
2274
  const t = s.message.trim(), r = (s.title || "").trim(), n = s.buttons || [];
2268
2275
  if (r.length > 64)
2269
2276
  return b.left(new U(`Invalid title: ${r}`));
@@ -2289,7 +2296,7 @@ function As(s) {
2289
2296
  }
2290
2297
  return b.right({ title: r, message: t, buttons: a });
2291
2298
  }
2292
- class Bs {
2299
+ class As {
2293
2300
  constructor({ version: t, isTma: r, request: n }) {
2294
2301
  /**
2295
2302
  * Signal indicating if any popup is currently opened.
@@ -2339,7 +2346,7 @@ class Bs {
2339
2346
  });
2340
2347
  this.isSupported = W("web_app_open_popup", t), this.isOpened = C(a), this.showFp = p((i) => u.pipe(
2341
2348
  this.isOpened() ? c.left(new Ee("A popup is already opened")) : c.right(void 0),
2342
- c.chainW(() => c.fromEither(As(i))),
2349
+ c.chainW(() => c.fromEither(qs(i))),
2343
2350
  c.chain((l) => (a.set(!0), n("web_app_open_popup", "popup_closed", {
2344
2351
  ...i,
2345
2352
  params: l
@@ -2351,26 +2358,26 @@ class Bs {
2351
2358
  )), this.show = /* @__PURE__ */ h(this.showFp);
2352
2359
  }
2353
2360
  }
2354
- function xs() {
2355
- return new Bs(u.pipe(v(), L, I));
2361
+ function Bs() {
2362
+ return new As(u.pipe(v(), L, I));
2356
2363
  }
2357
- const en = /* @__PURE__ */ xs();
2358
- function Ms({ request: s, ...t }) {
2364
+ const Zr = /* @__PURE__ */ Bs();
2365
+ function xs({ request: s, ...t }) {
2359
2366
  return A((r) => u.pipe(
2360
2367
  s("web_app_request_phone", "phone_requested", r),
2361
2368
  c.map((n) => n.status)
2362
2369
  ), { ...t, requires: "web_app_request_phone", returns: "task" });
2363
2370
  }
2364
2371
  // @__NO_SIDE_EFFECTS__
2365
- function Vs() {
2366
- return Ms(u.pipe(
2372
+ function Ms() {
2373
+ return xs(u.pipe(
2367
2374
  v(),
2368
2375
  I,
2369
2376
  L
2370
2377
  ));
2371
2378
  }
2372
- const tt = /* @__PURE__ */ Vs(), tn = /* @__PURE__ */ h(tt);
2373
- function Ts({
2379
+ const et = /* @__PURE__ */ Ms(), Xr = /* @__PURE__ */ h(et);
2380
+ function Vs({
2374
2381
  invokeCustomMethod: s,
2375
2382
  requestPhoneAccess: t,
2376
2383
  ...r
@@ -2383,29 +2390,29 @@ function Ts({
2383
2390
  c.chainW((i) => {
2384
2391
  const l = Fe(K(), i);
2385
2392
  if (!l.success)
2386
- return c.left(new pe(i, l.issues));
2393
+ return c.left(new ue(i, l.issues));
2387
2394
  if (!l.output)
2388
2395
  return c.right(void 0);
2389
2396
  const f = Fe(
2390
- gt(
2397
+ bt(
2391
2398
  Oe({
2392
- contact: Ft(Oe({
2393
- user_id: Qe(),
2399
+ contact: gt(Oe({
2400
+ user_id: Ke(),
2394
2401
  phone_number: K(),
2395
2402
  first_name: K(),
2396
- last_name: St(K())
2403
+ last_name: Ct(K())
2397
2404
  })),
2398
- auth_date: We(
2405
+ auth_date: Ue(
2399
2406
  K(),
2400
- He((F) => new Date(Number(F) * 1e3)),
2401
- Ke()
2407
+ We((F) => new Date(Number(F) * 1e3)),
2408
+ He()
2402
2409
  ),
2403
2410
  hash: K()
2404
2411
  })
2405
2412
  ),
2406
2413
  l.output
2407
2414
  );
2408
- return f.success ? c.right({ raw: l.output, parsed: f.output }) : c.left(new pe(l.output, f.issues));
2415
+ return f.success ? c.right({ raw: l.output, parsed: f.output }) : c.left(new ue(l.output, f.issues));
2409
2416
  })
2410
2417
  ), a = (p) => u.pipe(
2411
2418
  n(p),
@@ -2413,7 +2420,7 @@ function Ts({
2413
2420
  // All other errors except validation ones should be ignored. Receiving validation error
2414
2421
  // means that we have some data, but we are unable to parse it properly. So, there is no
2415
2422
  // need to make some more requests further, the problem is local.
2416
- (i) => pe.is(i) ? b.left(i) : b.right(void 0),
2423
+ (i) => ue.is(i) ? b.left(i) : b.right(void 0),
2417
2424
  (i) => b.right(i)
2418
2425
  )
2419
2426
  ), o = (p) => ge(
@@ -2435,52 +2442,52 @@ function Ts({
2435
2442
  a(i),
2436
2443
  c.chain((l) => l ? c.right(l) : u.pipe(
2437
2444
  t(i),
2438
- c.chainW((f) => f === "sent" ? o(i) : c.left(new ze("User denied access")))
2445
+ c.chainW((f) => f === "sent" ? o(i) : c.left(new Qe("User denied access")))
2439
2446
  ))
2440
2447
  ), p), { ...r, returns: "task", requires: "web_app_request_phone" });
2441
2448
  }
2442
2449
  // @__NO_SIDE_EFFECTS__
2443
- function Ls() {
2444
- return Ts({
2450
+ function Ts() {
2451
+ return Vs({
2445
2452
  ...u.pipe(v(), xe, I),
2446
- requestPhoneAccess: tt
2453
+ requestPhoneAccess: et
2447
2454
  });
2448
2455
  }
2449
- function $s({ requestContact: s, ...t }) {
2456
+ function Ls({ requestContact: s, ...t }) {
2450
2457
  return A(
2451
2458
  s,
2452
2459
  { ...t, returns: "task", requires: "web_app_request_phone" }
2453
2460
  );
2454
2461
  }
2455
2462
  // @__NO_SIDE_EFFECTS__
2456
- function Rs() {
2457
- return $s({
2463
+ function $s() {
2464
+ return Ls({
2458
2465
  ...u.pipe(v(), I),
2459
2466
  requestContact(s) {
2460
2467
  return u.pipe(
2461
- st(s),
2468
+ tt(s),
2462
2469
  c.map((t) => t.parsed)
2463
2470
  );
2464
2471
  }
2465
2472
  });
2466
2473
  }
2467
- const st = /* @__PURE__ */ Ls(), sn = /* @__PURE__ */ h(st), Ps = /* @__PURE__ */ Rs(), rn = /* @__PURE__ */ h(Ps);
2468
- function Os({ request: s, ...t }) {
2474
+ const tt = /* @__PURE__ */ Ts(), en = /* @__PURE__ */ h(tt), Rs = /* @__PURE__ */ $s(), tn = /* @__PURE__ */ h(Rs);
2475
+ function Ps({ request: s, ...t }) {
2469
2476
  return A((r) => u.pipe(
2470
2477
  s("web_app_request_write_access", "write_access_requested", r),
2471
2478
  c.map((n) => n.status)
2472
2479
  ), { ...t, requires: "web_app_request_write_access", returns: "task" });
2473
2480
  }
2474
2481
  // @__NO_SIDE_EFFECTS__
2475
- function Ds() {
2476
- return Os(u.pipe(
2482
+ function Os() {
2483
+ return Ps(u.pipe(
2477
2484
  v(),
2478
2485
  I,
2479
2486
  L
2480
2487
  ));
2481
2488
  }
2482
- const Gs = /* @__PURE__ */ Ds(), nn = /* @__PURE__ */ h(Gs);
2483
- class js {
2489
+ const Ds = /* @__PURE__ */ Os(), sn = /* @__PURE__ */ h(Ds);
2490
+ class Gs {
2484
2491
  constructor({
2485
2492
  version: t,
2486
2493
  onClosed: r,
@@ -2604,8 +2611,8 @@ class js {
2604
2611
  )), this.open = /* @__PURE__ */ h(this.openFp), this.capture = /* @__PURE__ */ h(this.captureFp), this.close = /* @__PURE__ */ h(this.closeFp);
2605
2612
  }
2606
2613
  }
2607
- function Us() {
2608
- return new js({
2614
+ function js() {
2615
+ return new Gs({
2609
2616
  ...u.pipe(v(), V, I),
2610
2617
  onClosed(s) {
2611
2618
  return z("scan_qr_popup_closed", s);
@@ -2617,8 +2624,8 @@ function Us() {
2617
2624
  }
2618
2625
  });
2619
2626
  }
2620
- const on = /* @__PURE__ */ Us();
2621
- class Ws {
2627
+ const rn = /* @__PURE__ */ js();
2628
+ class Us {
2622
2629
  constructor({ defaults: t, ...r }) {
2623
2630
  //#region Properties.
2624
2631
  /**
@@ -2880,16 +2887,16 @@ class Ws {
2880
2887
  }
2881
2888
  //#endregion
2882
2889
  }
2883
- function Hs() {
2884
- return new Ws(
2885
- /* @__PURE__ */ et("secondaryButton", "secondary_button_pressed", {
2886
- bgColor: C(() => qs.bottomBarColorRgb() || "#000000"),
2887
- textColor: C(() => le.buttonColor() || "#2481cc")
2890
+ function Ws() {
2891
+ return new Us(
2892
+ /* @__PURE__ */ Xe("secondaryButton", "secondary_button_pressed", {
2893
+ bgColor: C(() => Es.bottomBarColorRgb() || "#000000"),
2894
+ textColor: C(() => he.buttonColor() || "#2481cc")
2888
2895
  })
2889
2896
  );
2890
2897
  }
2891
- const an = /* @__PURE__ */ Hs();
2892
- class Ks {
2898
+ const nn = /* @__PURE__ */ Ws();
2899
+ class Hs {
2893
2900
  constructor({ isTma: t, request: r, version: n, createRequestId: a }) {
2894
2901
  /**
2895
2902
  * Retrieves an item using its key.
@@ -2948,7 +2955,7 @@ class Ks {
2948
2955
  params: { ...f, req_id: F },
2949
2956
  capture: (_) => "payload" in _ ? _.payload.req_id === F : !0
2950
2957
  }),
2951
- c.chain((_) => _.event === "secure_storage_failed" ? c.left(new yt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
2958
+ c.chain((_) => _.event === "secure_storage_failed" ? c.left(new kt(_.payload.error || "UNKNOWN_ERROR")) : c.right(_.payload))
2952
2959
  );
2953
2960
  };
2954
2961
  this.getItemFp = o((i) => u.pipe(
@@ -2971,16 +2978,16 @@ class Ks {
2971
2978
  )), this.getItem = /* @__PURE__ */ h(this.getItemFp), this.setItem = /* @__PURE__ */ h(this.setItemFp), this.deleteItem = /* @__PURE__ */ h(this.deleteItemFp), this.clear = /* @__PURE__ */ h(this.clearFp), this.restoreItem = /* @__PURE__ */ h(this.restoreItemFp);
2972
2979
  }
2973
2980
  }
2974
- function Qs() {
2975
- return new Ks(u.pipe(
2981
+ function Ks() {
2982
+ return new Hs(u.pipe(
2976
2983
  v(),
2977
2984
  I,
2978
2985
  L,
2979
- Ye
2986
+ Je
2980
2987
  ));
2981
2988
  }
2982
- const pn = /* @__PURE__ */ Qs();
2983
- class zs {
2989
+ const on = /* @__PURE__ */ Ks();
2990
+ class Qs {
2984
2991
  constructor(t) {
2985
2992
  /**
2986
2993
  * Signal indicating if the component is currently visible.
@@ -3072,10 +3079,10 @@ class zs {
3072
3079
  this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.isSupported = r.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = r.stateBoolSetters("isVisible"), this.onClick = r.onClick, this.onClickFp = r.onClickFp, this.offClick = r.offClick, this.offClickFp = r.offClickFp, this.mount = r.mount, this.mountFp = r.mountFp, this.unmount = r.unmount;
3073
3080
  }
3074
3081
  }
3075
- const un = /* @__PURE__ */ new zs(
3082
+ const an = /* @__PURE__ */ new Qs(
3076
3083
  /* @__PURE__ */ qe("settingsButton", "settings_button_pressed")
3077
3084
  );
3078
- class Ns {
3085
+ class zs {
3079
3086
  constructor({ postEvent: t, storage: r, isTma: n, isPageReload: a, version: o }) {
3080
3087
  /**
3081
3088
  * Signal indicating if the component is supported.
@@ -3125,7 +3132,7 @@ class Ns {
3125
3132
  onChange(w) {
3126
3133
  r.set(w);
3127
3134
  }
3128
- }), l = new ne({
3135
+ }), l = new ie({
3129
3136
  initialState: p,
3130
3137
  isPageReload: a,
3131
3138
  onMounted: i.setState,
@@ -3153,16 +3160,16 @@ class Ns {
3153
3160
  }), this.unmount = l.unmount, this.disableVertical = /* @__PURE__ */ h(this.disableVerticalFp), this.enableVertical = /* @__PURE__ */ h(this.enableVerticalFp), this.mount = /* @__PURE__ */ h(this.mountFp);
3154
3161
  }
3155
3162
  }
3156
- function Js() {
3157
- return new Ns(u.pipe(
3163
+ function Ns() {
3164
+ return new zs(u.pipe(
3158
3165
  v(),
3159
3166
  V,
3160
3167
  I,
3161
3168
  Y("swipeBehavior")
3162
3169
  ));
3163
3170
  }
3164
- const cn = /* @__PURE__ */ Js();
3165
- async function ln(s) {
3171
+ const pn = /* @__PURE__ */ Ns();
3172
+ async function un(s) {
3166
3173
  try {
3167
3174
  const { clipboard: r } = navigator;
3168
3175
  if (r)
@@ -3177,74 +3184,74 @@ async function ln(s) {
3177
3184
  document.body.removeChild(t);
3178
3185
  }
3179
3186
  }
3180
- function Ys({ request: s, ...t }) {
3187
+ function Js({ request: s, ...t }) {
3181
3188
  return A((r, n, a) => u.pipe(
3182
3189
  s(
3183
3190
  "web_app_request_file_download",
3184
3191
  "file_download_requested",
3185
3192
  { ...a, params: { url: r, file_name: n } }
3186
3193
  ),
3187
- c.chain((o) => o.status === "downloading" ? c.right(void 0) : c.left(new ze("User denied the action")))
3194
+ c.chain((o) => o.status === "downloading" ? c.right(void 0) : c.left(new Qe("User denied the action")))
3188
3195
  ), { ...t, requires: "web_app_request_file_download", returns: "task" });
3189
3196
  }
3190
3197
  // @__NO_SIDE_EFFECTS__
3191
- function Zs() {
3192
- return Ys(u.pipe(
3198
+ function Ys() {
3199
+ return Js(u.pipe(
3193
3200
  v(),
3194
3201
  L,
3195
3202
  I
3196
3203
  ));
3197
3204
  }
3198
- const Xs = /* @__PURE__ */ Zs(), hn = /* @__PURE__ */ h(Xs);
3199
- function er({ invokeCustomMethod: s, ...t }) {
3205
+ const Zs = /* @__PURE__ */ Ys(), cn = /* @__PURE__ */ h(Zs);
3206
+ function Xs({ invokeCustomMethod: s, ...t }) {
3200
3207
  return A((r) => u.pipe(
3201
3208
  s("getCurrentTime", {}, r),
3202
3209
  c.chain((n) => {
3203
3210
  const a = Fe(
3204
- We(Qe(), vt(), He((o) => new Date(o * 1e3)), Ke()),
3211
+ Ue(Ke(), St(), We((o) => new Date(o * 1e3)), He()),
3205
3212
  n
3206
3213
  );
3207
- return a.success ? c.right(a.output) : c.left(new pe(n, a.issues));
3214
+ return a.success ? c.right(a.output) : c.left(new ue(n, a.issues));
3208
3215
  })
3209
3216
  ), { ...t, requires: "web_app_invoke_custom_method", returns: "task" });
3210
3217
  }
3211
3218
  // @__NO_SIDE_EFFECTS__
3212
- function tr() {
3213
- return er(u.pipe(
3219
+ function er() {
3220
+ return Xs(u.pipe(
3214
3221
  v(),
3215
3222
  xe,
3216
3223
  I
3217
3224
  ));
3218
3225
  }
3219
- const sr = /* @__PURE__ */ tr(), dn = /* @__PURE__ */ h(sr);
3220
- function rr({ postEvent: s, ...t }) {
3226
+ const tr = /* @__PURE__ */ er(), ln = /* @__PURE__ */ h(tr);
3227
+ function sr({ postEvent: s, ...t }) {
3221
3228
  return A(() => s("web_app_hide_keyboard"), { ...t, returns: "either", requires: "web_app_hide_keyboard" });
3222
3229
  }
3223
3230
  // @__NO_SIDE_EFFECTS__
3224
- function nr() {
3225
- return rr(u.pipe(
3231
+ function rr() {
3232
+ return sr(u.pipe(
3226
3233
  v(),
3227
3234
  V,
3228
3235
  I
3229
3236
  ));
3230
3237
  }
3231
- const ir = /* @__PURE__ */ nr(), _n = /* @__PURE__ */ h(ir);
3232
- function or({ request: s, createRequestId: t, ...r }) {
3238
+ const nr = /* @__PURE__ */ rr(), hn = /* @__PURE__ */ h(nr);
3239
+ function ir({ request: s, createRequestId: t, ...r }) {
3233
3240
  return A((n) => {
3234
3241
  const a = t();
3235
3242
  return u.pipe(
3236
3243
  s("web_app_read_text_from_clipboard", "clipboard_text_received", {
3237
3244
  ...n,
3238
3245
  params: { req_id: a },
3239
- capture: dt(a)
3246
+ capture: ht(a)
3240
3247
  }),
3241
3248
  c.map(({ data: o = null }) => o)
3242
3249
  );
3243
3250
  }, { ...r, requires: "web_app_read_text_from_clipboard", returns: "task" });
3244
3251
  }
3245
3252
  // @__NO_SIDE_EFFECTS__
3246
- function ar() {
3247
- return or({
3253
+ function or() {
3254
+ return ir({
3248
3255
  ...u.pipe(
3249
3256
  v(),
3250
3257
  I,
@@ -3253,8 +3260,8 @@ function ar() {
3253
3260
  createRequestId: Be
3254
3261
  });
3255
3262
  }
3256
- const pr = /* @__PURE__ */ ar(), fn = /* @__PURE__ */ h(pr);
3257
- function ur(s) {
3263
+ const ar = /* @__PURE__ */ or(), dn = /* @__PURE__ */ h(ar);
3264
+ function pr(s) {
3258
3265
  const t = {}, r = s.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3259
3266
  if (r) {
3260
3267
  const [, n, a] = r;
@@ -3270,10 +3277,10 @@ function ur(s) {
3270
3277
  }
3271
3278
  return t;
3272
3279
  }
3273
- function mn() {
3274
- return ur(navigator.userAgent);
3280
+ function _n() {
3281
+ return pr(navigator.userAgent);
3275
3282
  }
3276
- function cr({ postEvent: s, ...t }) {
3283
+ function ur({ postEvent: s, ...t }) {
3277
3284
  return A((r) => {
3278
3285
  const { size: n } = new Blob([r]);
3279
3286
  return !n || n > 4096 ? b.left(
@@ -3282,11 +3289,11 @@ function cr({ postEvent: s, ...t }) {
3282
3289
  }, { ...t, returns: "either" });
3283
3290
  }
3284
3291
  // @__NO_SIDE_EFFECTS__
3285
- function lr() {
3286
- return cr(u.pipe(v(), V));
3292
+ function cr() {
3293
+ return ur(u.pipe(v(), V));
3287
3294
  }
3288
- const hr = /* @__PURE__ */ lr(), bn = /* @__PURE__ */ h(hr);
3289
- function dr({ request: s, ...t }) {
3295
+ const lr = /* @__PURE__ */ cr(), fn = /* @__PURE__ */ h(lr);
3296
+ function hr({ request: s, ...t }) {
3290
3297
  return A((r, n) => u.pipe(
3291
3298
  s(
3292
3299
  "web_app_send_prepared_message",
@@ -3296,19 +3303,19 @@ function dr({ request: s, ...t }) {
3296
3303
  params: { id: r }
3297
3304
  }
3298
3305
  ),
3299
- c.chain((a) => a.event === "prepared_message_failed" ? c.left(new Bt(a.payload.error)) : c.right(void 0))
3306
+ c.chain((a) => a.event === "prepared_message_failed" ? c.left(new At(a.payload.error)) : c.right(void 0))
3300
3307
  ), { ...t, requires: "web_app_send_prepared_message", returns: "task" });
3301
3308
  }
3302
3309
  // @__NO_SIDE_EFFECTS__
3303
- function _r() {
3304
- return dr(u.pipe(
3310
+ function dr() {
3311
+ return hr(u.pipe(
3305
3312
  v(),
3306
3313
  L,
3307
3314
  I
3308
3315
  ));
3309
3316
  }
3310
- const fr = /* @__PURE__ */ _r(), gn = /* @__PURE__ */ h(fr);
3311
- function mr({ postEvent: s, ...t }) {
3317
+ const _r = /* @__PURE__ */ dr(), mn = /* @__PURE__ */ h(_r);
3318
+ function fr({ postEvent: s, ...t }) {
3312
3319
  return A((r, n = {}) => s("web_app_share_to_story", {
3313
3320
  text: n.text,
3314
3321
  media_url: r,
@@ -3316,15 +3323,15 @@ function mr({ postEvent: s, ...t }) {
3316
3323
  }), { ...t, requires: "web_app_share_to_story", returns: "either" });
3317
3324
  }
3318
3325
  // @__NO_SIDE_EFFECTS__
3319
- function br() {
3320
- return mr(u.pipe(
3326
+ function mr() {
3327
+ return fr(u.pipe(
3321
3328
  v(),
3322
3329
  V,
3323
3330
  I
3324
3331
  ));
3325
3332
  }
3326
- const gr = /* @__PURE__ */ br(), Fn = /* @__PURE__ */ h(gr), ve = /* @__PURE__ */ ie(!1);
3327
- function Fr({ isInlineMode: s, postEvent: t, ...r }) {
3333
+ const br = /* @__PURE__ */ mr(), bn = /* @__PURE__ */ h(br), ve = /* @__PURE__ */ oe(!1);
3334
+ function gr({ isInlineMode: s, postEvent: t, ...r }) {
3328
3335
  return A((n, a) => t("web_app_switch_inline_query", {
3329
3336
  query: n,
3330
3337
  chat_types: a || []
@@ -3337,8 +3344,8 @@ function Fr({ isInlineMode: s, postEvent: t, ...r }) {
3337
3344
  });
3338
3345
  }
3339
3346
  // @__NO_SIDE_EFFECTS__
3340
- function wr() {
3341
- return Fr({
3347
+ function Fr() {
3348
+ return gr({
3342
3349
  ...u.pipe(
3343
3350
  v(),
3344
3351
  V,
@@ -3347,8 +3354,8 @@ function wr() {
3347
3354
  isInlineMode: ve
3348
3355
  });
3349
3356
  }
3350
- const Cr = /* @__PURE__ */ wr(), wn = /* @__PURE__ */ h(Cr);
3351
- class Sr {
3357
+ const wr = /* @__PURE__ */ Fr(), gn = /* @__PURE__ */ h(wr);
3358
+ class Cr {
3352
3359
  constructor({
3353
3360
  storage: t,
3354
3361
  isPageReload: r,
@@ -3616,31 +3623,31 @@ class Sr {
3616
3623
  F(B), l(T), f(M), i(P);
3617
3624
  },
3618
3625
  restoreState: t.get
3619
- }), j = (q) => C(() => this.safeAreaInsets()[q]), oe = (q) => C(() => this.contentSafeAreaInsets()[q]);
3620
- this.state = d.state, this.height = d.getter("height"), this.stableHeight = d.getter("stableHeight"), this.width = d.getter("width"), this.isExpanded = d.getter("isExpanded"), this.safeAreaInsets = d.getter("safeAreaInsets"), this.safeAreaInsetTop = j("top"), this.safeAreaInsetBottom = j("bottom"), this.safeAreaInsetLeft = j("left"), this.safeAreaInsetRight = j("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = oe("top"), this.contentSafeAreaInsetBottom = oe("bottom"), this.contentSafeAreaInsetLeft = oe("left"), this.contentSafeAreaInsetRight = oe("right");
3621
- const rt = E({ isTma: k, returns: "task" }), Te = E({
3626
+ }), j = (q) => C(() => this.safeAreaInsets()[q]), ae = (q) => C(() => this.contentSafeAreaInsets()[q]);
3627
+ this.state = d.state, this.height = d.getter("height"), this.stableHeight = d.getter("stableHeight"), this.width = d.getter("width"), this.isExpanded = d.getter("isExpanded"), this.safeAreaInsets = d.getter("safeAreaInsets"), this.safeAreaInsetTop = j("top"), this.safeAreaInsetBottom = j("bottom"), this.safeAreaInsetLeft = j("left"), this.safeAreaInsetRight = j("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
3628
+ const st = E({ isTma: k, returns: "task" }), Te = E({
3622
3629
  isTma: k,
3623
3630
  returns: "either"
3624
- }), nt = E({
3631
+ }), rt = E({
3625
3632
  isTma: k,
3626
3633
  requires: "web_app_request_fullscreen",
3627
3634
  version: y,
3628
3635
  returns: "task"
3629
- }), Le = (q) => nt((Z) => u.pipe(
3636
+ }), Le = (q) => rt((Z) => u.pipe(
3630
3637
  _(
3631
3638
  q ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
3632
3639
  ["fullscreen_changed", "fullscreen_failed"],
3633
3640
  Z
3634
3641
  ),
3635
- c.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? c.left(new At(x.payload.error)) : (d.setState({
3642
+ c.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? c.left(new qt(x.payload.error)) : (d.setState({
3636
3643
  isFullscreen: "is_fullscreen" in x.payload ? x.payload.is_fullscreen : !0
3637
3644
  }), c.right(void 0)))
3638
3645
  ));
3639
- this.isMounted = $.isMounted, this.mountFp = rt($.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = Le(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = Le(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3640
- const ae = O(!1);
3641
- this.isCssVarsBound = C(ae), this.bindCssVarsFp = Te(
3646
+ this.isMounted = $.isMounted, this.mountFp = st($.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = Le(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = Le(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3647
+ const pe = O(!1);
3648
+ this.isCssVarsBound = C(pe), this.bindCssVarsFp = Te(
3642
3649
  (q) => {
3643
- if (ae())
3650
+ if (pe())
3644
3651
  return b.left(new Ie());
3645
3652
  q || (q = (x) => `--tg-viewport-${je(x)}`);
3646
3653
  const Z = [
@@ -3667,26 +3674,26 @@ class Sr {
3667
3674
  }, []);
3668
3675
  return Z.forEach((x) => {
3669
3676
  x.update();
3670
- }), ae.set(!0), b.right(() => {
3677
+ }), pe.set(!0), b.right(() => {
3671
3678
  Z.forEach((x) => {
3672
3679
  x.removeListener(), Ve(x.cssVar);
3673
- }), ae.set(!1);
3680
+ }), pe.set(!1);
3674
3681
  });
3675
3682
  }
3676
3683
  ), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Te(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
3677
3684
  }
3678
3685
  //#endregion
3679
3686
  }
3680
- function vr() {
3687
+ function Sr() {
3681
3688
  const s = (o) => ({
3682
3689
  on: (p) => {
3683
3690
  z(o, p);
3684
3691
  },
3685
3692
  off: (p) => {
3686
- re(o, p);
3693
+ ne(o, p);
3687
3694
  }
3688
3695
  }), t = s("viewport_changed"), r = s("fullscreen_changed"), n = s("safe_area_changed"), a = s("content_safe_area_changed");
3689
- return new Sr({
3696
+ return new Cr({
3690
3697
  ...u.pipe(
3691
3698
  v(),
3692
3699
  Y("viewport"),
@@ -3695,10 +3702,10 @@ function vr() {
3695
3702
  L
3696
3703
  ),
3697
3704
  isFullscreen() {
3698
- return u.pipe(ce(), b.map((o) => !!o.tgWebAppFullscreen));
3705
+ return u.pipe(le(), b.map((o) => !!o.tgWebAppFullscreen));
3699
3706
  },
3700
3707
  isViewportStable() {
3701
- return u.pipe(ce(), b.map((o) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(o.tgWebAppPlatform)));
3708
+ return u.pipe(le(), b.map((o) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(o.tgWebAppPlatform)));
3702
3709
  },
3703
3710
  offContentSafeAreaInsetsChanged: a.off,
3704
3711
  offFullscreenChanged: r.off,
@@ -3710,8 +3717,8 @@ function vr() {
3710
3717
  onViewportChanged: t.on
3711
3718
  });
3712
3719
  }
3713
- const Cn = /* @__PURE__ */ vr();
3714
- function kr(s = {}) {
3720
+ const Fn = /* @__PURE__ */ Sr();
3721
+ function vr(s = {}) {
3715
3722
  const {
3716
3723
  version: t,
3717
3724
  isInlineMode: r,
@@ -3720,7 +3727,7 @@ function kr(s = {}) {
3720
3727
  if (t && typeof r == "boolean" && n)
3721
3728
  Ce.set(t), ve.set(r), Se.set(n);
3722
3729
  else {
3723
- const i = u.pipe(ce(), b.matchW(
3730
+ const i = u.pipe(le(), b.matchW(
3724
3731
  (l) => l,
3725
3732
  (l) => {
3726
3733
  Ce.set(t || l.tgWebAppVersion), ve.set(typeof r == "boolean" ? r : !!l.tgWebAppBotInline), Se.set(n || l.tgWebAppThemeParams);
@@ -3729,10 +3736,10 @@ function kr(s = {}) {
3729
3736
  if (i)
3730
3737
  return b.left(i);
3731
3738
  }
3732
- s.postEvent && Ne.set(s.postEvent);
3739
+ s.postEvent && ze.set(s.postEvent);
3733
3740
  const [a, o] = ke(
3734
3741
  z("reload_iframe", () => {
3735
- Re().log("Received a request to reload the page"), Vt("iframe_will_reload"), window.location.reload();
3742
+ Re().log("Received a request to reload the page"), Mt("iframe_will_reload"), window.location.reload();
3736
3743
  })
3737
3744
  ), { acceptCustomStyles: p = !0 } = s;
3738
3745
  if (p) {
@@ -3747,171 +3754,171 @@ function kr(s = {}) {
3747
3754
  );
3748
3755
  }
3749
3756
  return u.pipe(
3750
- se("iframe_ready", { reload_supported: !0 }),
3757
+ re("iframe_ready", { reload_supported: !0 }),
3751
3758
  b.map(() => (Re().log("The package was initialized"), o))
3752
3759
  );
3753
3760
  }
3754
- const Sn = he(kr);
3761
+ const wn = te(vr);
3755
3762
  export {
3756
- ze as AccessDeniedError,
3757
- Mt as BackButton,
3758
- Rt as Biometry,
3763
+ Qe as AccessDeniedError,
3764
+ xt as BackButton,
3765
+ $t as Biometry,
3759
3766
  Ie as CSSVarsBoundError,
3760
- yn as CancelledError,
3761
- Dt as ClosingBehavior,
3762
- jt as CloudStorage,
3767
+ vn as CancelledError,
3768
+ Ot as ClosingBehavior,
3769
+ Gt as CloudStorage,
3763
3770
  Ee as ConcurrentCallError,
3764
- Ht as DeviceStorage,
3765
- kt as DeviceStorageMethodError,
3766
- At as FullscreenFailedError,
3767
- Et as FunctionUnavailableError,
3768
- Xt as HapticFeedback,
3769
- as as InitData,
3771
+ Wt as DeviceStorage,
3772
+ vt as DeviceStorageMethodError,
3773
+ qt as FullscreenFailedError,
3774
+ It as FunctionUnavailableError,
3775
+ Zt as HapticFeedback,
3776
+ os as InitData,
3770
3777
  U as InvalidArgumentsError,
3771
- Tr as InvalidEnvError,
3772
- In as InvalidLaunchParamsError,
3773
- us as Invoice,
3774
- En as InvokeCustomMethodFailedError,
3775
- qn as LaunchParamsRetrieveError,
3776
- ws as LocationManager,
3777
- Ss as MainButton,
3778
- An as MethodParameterUnsupportedError,
3779
- Bn as MethodUnsupportedError,
3780
- Is as MiniApp,
3781
- It as NotAvailableError,
3782
- Bs as Popup,
3783
- js as QrScanner,
3784
- Ws as SecondaryButton,
3785
- Ks as SecureStorage,
3786
- yt as SecureStorageMethodError,
3787
- qt as SetEmojiStatusError,
3788
- zs as SettingsButton,
3789
- Bt as ShareMessageError,
3790
- Ns as SwipeBehavior,
3791
- ks as ThemeParams,
3792
- xn as TimeoutError,
3793
- Mn as UnknownEnvError,
3794
- xt as UnknownThemeParamsKeyError,
3795
- pe as ValidationError,
3796
- Sr as Viewport,
3797
- Hr as addToHomeScreen,
3798
- rs as addToHomeScreenFp,
3799
- Vn as applyPolyfills,
3800
- Lr as backButton,
3801
- Pr as biometry,
3802
- Kr as checkHomeScreenStatus,
3803
- os as checkHomeScreenStatusFp,
3804
- Or as closingBehavior,
3805
- Dr as cloudStorage,
3806
- ln as copyTextToClipboard,
3807
- Tn as createLogger,
3808
- Ln as createPostEvent,
3778
+ Mr as InvalidEnvError,
3779
+ kn as InvalidLaunchParamsError,
3780
+ ps as Invoice,
3781
+ yn as InvokeCustomMethodFailedError,
3782
+ In as LaunchParamsRetrieveError,
3783
+ Fs as LocationManager,
3784
+ Cs as MainButton,
3785
+ En as MethodParameterUnsupportedError,
3786
+ qn as MethodUnsupportedError,
3787
+ ys as MiniApp,
3788
+ yt as NotAvailableError,
3789
+ As as Popup,
3790
+ Gs as QrScanner,
3791
+ Us as SecondaryButton,
3792
+ Hs as SecureStorage,
3793
+ kt as SecureStorageMethodError,
3794
+ Et as SetEmojiStatusError,
3795
+ Qs as SettingsButton,
3796
+ At as ShareMessageError,
3797
+ zs as SwipeBehavior,
3798
+ vs as ThemeParams,
3799
+ An as TimeoutError,
3800
+ Bn as UnknownEnvError,
3801
+ Bt as UnknownThemeParamsKeyError,
3802
+ ue as ValidationError,
3803
+ Cr as Viewport,
3804
+ Ur as addToHomeScreen,
3805
+ ss as addToHomeScreenFp,
3806
+ xn as applyPolyfills,
3807
+ Vr as backButton,
3808
+ $r as biometry,
3809
+ Wr as checkHomeScreenStatus,
3810
+ is as checkHomeScreenStatusFp,
3811
+ Rr as closingBehavior,
3812
+ Pr as cloudStorage,
3813
+ un as copyTextToClipboard,
3814
+ Mn as createLogger,
3815
+ Vn as createPostEvent,
3809
3816
  Be as createRequestId,
3810
- $n as createStartParam,
3811
- Rn as createStartParamFp,
3812
- Pn as debug,
3813
- On as decodeBase64Url,
3814
- Dn as decodeBase64UrlFp,
3815
- Gn as decodeStartParam,
3816
- jn as decodeStartParamFp,
3817
- Un as deepSnakeToCamelObjKeys,
3818
- Gr as deviceStorage,
3819
- hn as downloadFile,
3820
- Xs as downloadFileFp,
3821
- Wn as emitEvent,
3822
- Hn as encodeBase64Url,
3823
- dn as getCurrentTime,
3824
- sr as getCurrentTimeFp,
3825
- Kn as getReleaseVersion,
3826
- Wr as hapticFeedback,
3827
- _n as hideKeyboard,
3828
- ir as hideKeyboardFp,
3829
- Sn as init,
3830
- Qr as initData,
3831
- kr as initFp,
3832
- zr as invoice,
3833
- Ut as invokeCustomMethod,
3834
- hi as isAnyRGB,
3835
- Xe as isColorDark,
3836
- vs as isColorDarkFp,
3837
- di as isRGB,
3838
- _i as isRGBA,
3839
- fi as isRGBAShort,
3840
- mi as isRGBShort,
3841
- Qn as isSafeToCreateStartParam,
3842
- zn as isTMA,
3843
- Nn as isTMAFp,
3844
- Zr as locationManager,
3845
- Jn as logger,
3846
- Xr as mainButton,
3847
- qs as miniApp,
3848
- Yn as mockTelegramEnv,
3849
- Zn as off,
3850
- Xn as offAll,
3851
- ei as on,
3852
- Nr as openLink,
3853
- ds as openLinkFp,
3854
- Jr as openTelegramLink,
3855
- Ze as openTelegramLinkFp,
3856
- bi as parseInitDataQuery,
3857
- gi as parseInitDataQueryFp,
3858
- Fi as parseLaunchParamsQuery,
3859
- wi as parseLaunchParamsQueryFp,
3860
- en as popup,
3861
- Vt as postEvent,
3862
- se as postEventFp,
3863
- on as qrScanner,
3864
- fn as readTextFromClipboard,
3865
- pr as readTextFromClipboardFp,
3866
- $r as request,
3867
- Rr as request2,
3868
- Je as request2Fp,
3869
- rn as requestContact,
3870
- sn as requestContactComplete,
3871
- st as requestContactCompleteFp,
3872
- Ps as requestContactFp,
3873
- jr as requestEmojiStatusAccess,
3874
- Nt as requestEmojiStatusAccessFp,
3875
- Pt as requestFp,
3876
- tn as requestPhoneAccess,
3877
- tt as requestPhoneAccessFp,
3878
- nn as requestWriteAccess,
3879
- Gs as requestWriteAccessFp,
3880
- mn as retrieveAndroidDeviceData,
3881
- ur as retrieveAndroidDeviceDataFrom,
3882
- ti as retrieveLaunchParams,
3883
- si as retrieveLaunchParamsFp,
3884
- ri as retrieveRawInitData,
3885
- ni as retrieveRawInitDataFp,
3886
- ii as retrieveRawLaunchParams,
3887
- oi as retrieveRawLaunchParamsFp,
3888
- an as secondaryButton,
3889
- pn as secureStorage,
3890
- bn as sendData,
3891
- hr as sendDataFp,
3892
- Ci as serializeInitDataQuery,
3893
- Si as serializeLaunchParamsQuery,
3894
- ai as setDebug,
3895
- Ur as setEmojiStatus,
3896
- Zt as setEmojiStatusFp,
3897
- pi as setTargetOrigin,
3898
- un as settingsButton,
3899
- gn as shareMessage,
3900
- fr as shareMessageFp,
3901
- Fn as shareStory,
3902
- gr as shareStoryFp,
3903
- Yr as shareURL,
3904
- gs as shareURLFp,
3905
- ui as supports,
3906
- cn as swipeBehavior,
3907
- wn as switchInlineQuery,
3908
- Cr as switchInlineQueryFp,
3909
- ci as targetOrigin,
3910
- le as themeParams,
3911
- vi as toRGB,
3912
- ki as toRGBFp,
3913
- yi as toRGBFull,
3914
- Ii as toRGBFullFp,
3915
- Cn as viewport
3817
+ Tn as createStartParam,
3818
+ Ln as createStartParamFp,
3819
+ $n as debug,
3820
+ Rn as decodeBase64Url,
3821
+ Pn as decodeBase64UrlFp,
3822
+ On as decodeStartParam,
3823
+ Dn as decodeStartParamFp,
3824
+ Gn as deepSnakeToCamelObjKeys,
3825
+ Or as deviceStorage,
3826
+ cn as downloadFile,
3827
+ Zs as downloadFileFp,
3828
+ jn as emitEvent,
3829
+ Un as encodeBase64Url,
3830
+ ln as getCurrentTime,
3831
+ tr as getCurrentTimeFp,
3832
+ Wn as getReleaseVersion,
3833
+ jr as hapticFeedback,
3834
+ hn as hideKeyboard,
3835
+ nr as hideKeyboardFp,
3836
+ wn as init,
3837
+ Hr as initData,
3838
+ vr as initFp,
3839
+ Kr as invoice,
3840
+ jt as invokeCustomMethod,
3841
+ ci as isAnyRGB,
3842
+ Ze as isColorDark,
3843
+ Ss as isColorDarkFp,
3844
+ li as isRGB,
3845
+ hi as isRGBA,
3846
+ di as isRGBAShort,
3847
+ _i as isRGBShort,
3848
+ Hn as isSafeToCreateStartParam,
3849
+ Kn as isTMA,
3850
+ Qn as isTMAFp,
3851
+ Jr as locationManager,
3852
+ zn as logger,
3853
+ Yr as mainButton,
3854
+ Es as miniApp,
3855
+ Nn as mockTelegramEnv,
3856
+ Jn as off,
3857
+ Yn as offAll,
3858
+ Zn as on,
3859
+ Qr as openLink,
3860
+ hs as openLinkFp,
3861
+ zr as openTelegramLink,
3862
+ Ye as openTelegramLinkFp,
3863
+ fi as parseInitDataQuery,
3864
+ mi as parseInitDataQueryFp,
3865
+ bi as parseLaunchParamsQuery,
3866
+ gi as parseLaunchParamsQueryFp,
3867
+ Zr as popup,
3868
+ Mt as postEvent,
3869
+ re as postEventFp,
3870
+ rn as qrScanner,
3871
+ dn as readTextFromClipboard,
3872
+ ar as readTextFromClipboardFp,
3873
+ Tr as request,
3874
+ Lr as request2,
3875
+ Ne as request2Fp,
3876
+ tn as requestContact,
3877
+ en as requestContactComplete,
3878
+ tt as requestContactCompleteFp,
3879
+ Rs as requestContactFp,
3880
+ Dr as requestEmojiStatusAccess,
3881
+ zt as requestEmojiStatusAccessFp,
3882
+ Rt as requestFp,
3883
+ Xr as requestPhoneAccess,
3884
+ et as requestPhoneAccessFp,
3885
+ sn as requestWriteAccess,
3886
+ Ds as requestWriteAccessFp,
3887
+ _n as retrieveAndroidDeviceData,
3888
+ pr as retrieveAndroidDeviceDataFrom,
3889
+ Xn as retrieveLaunchParams,
3890
+ ei as retrieveLaunchParamsFp,
3891
+ ti as retrieveRawInitData,
3892
+ si as retrieveRawInitDataFp,
3893
+ ri as retrieveRawLaunchParams,
3894
+ ni as retrieveRawLaunchParamsFp,
3895
+ nn as secondaryButton,
3896
+ on as secureStorage,
3897
+ fn as sendData,
3898
+ lr as sendDataFp,
3899
+ Fi as serializeInitDataQuery,
3900
+ wi as serializeLaunchParamsQuery,
3901
+ ii as setDebug,
3902
+ Gr as setEmojiStatus,
3903
+ Yt as setEmojiStatusFp,
3904
+ oi as setTargetOrigin,
3905
+ an as settingsButton,
3906
+ mn as shareMessage,
3907
+ _r as shareMessageFp,
3908
+ bn as shareStory,
3909
+ br as shareStoryFp,
3910
+ Nr as shareURL,
3911
+ bs as shareURLFp,
3912
+ ai as supports,
3913
+ pn as swipeBehavior,
3914
+ gn as switchInlineQuery,
3915
+ wr as switchInlineQueryFp,
3916
+ pi as targetOrigin,
3917
+ he as themeParams,
3918
+ Ci as toRGB,
3919
+ Si as toRGBFp,
3920
+ vi as toRGBFull,
3921
+ ki as toRGBFullFp,
3922
+ Fn as viewport
3916
3923
  };
3917
3924
  //# sourceMappingURL=index.js.map