@vbotma/sdk 3.2.2 → 3.2.4

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,24 +1,24 @@
1
- var at = Object.defineProperty;
2
- var pt = (r, t, s) => t in r ? at(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s;
3
- var e = (r, t, s) => pt(r, typeof t != "symbol" ? t + "" : t, s);
1
+ var pt = Object.defineProperty;
2
+ var ct = (n, t, r) => t in n ? pt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[t] = r;
3
+ var e = (n, t, r) => ct(n, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { batch as ue, signal as O, computed as w } from "@vbotma/signals";
5
- import { supports as ee, isVBMAFp as ut, postEventFp as ke, off as re, on as G, request2Fp as je, requestFp as ct, invokeCustomMethodFp as lt, retrieveLaunchParamsFp as ce, retrieveRawInitDataFp as ht, captureSameReq as dt, logger as Pe } from "@vbotma/bridge";
6
- import { CancelledError as Rn, InvalidLaunchParamsError as Ln, InvokeCustomMethodFailedError as $n, LaunchParamsRetrieveError as Pn, MethodParameterUnsupportedError as On, MethodUnsupportedError as Dn, TimeoutError as Gn, UnknownEnvError as jn, applyPolyfills as Un, createLogger as Wn, createPostEvent as Hn, createStartParam as zn, createStartParamFp as Kn, debug as Nn, decodeBase64Url as Qn, decodeBase64UrlFp as Jn, decodeStartParam as Yn, decodeStartParamFp as Zn, deepSnakeToCamelObjKeys as Xn, emitEvent as ei, encodeBase64Url as ti, getReleaseVersion as si, isSafeToCreateStartParam as ri, isVBMA as ni, isVBMAFp as ii, logger as oi, mockVBotEnv as ai, off as pi, offAll as ui, on as ci, retrieveLaunchParams as li, retrieveLaunchParamsFp as hi, retrieveRawInitData as di, retrieveRawInitDataFp as fi, retrieveRawLaunchParams as _i, retrieveRawLaunchParamsFp as mi, setDebug as bi, setTargetOrigin as gi, supports as Fi, targetOrigin as wi } from "@vbotma/bridge";
7
- import { throwifyFpFn as he, throwifyAnyEither as Ue, setStorageValue as ft, getStorageValue as _t, snakeToKebab as mt, createCbCollector as ye, camelToKebab as We, BetterTaskEither as ge } from "@vbotma/toolkit";
8
- import { BetterPromise as He } from "better-promises";
9
- import { toRGBFullFp as bt, isRGB as fe, pipeQueryToSchema as gt, pipeJsonToSchema as Ft } from "@vbotma/transformers";
10
- import { isAnyRGB as Si, isRGB as vi, isRGBA as ki, isRGBAShort as yi, isRGBShort as Ii, parseInitDataQuery as Ei, parseInitDataQueryFp as qi, parseLaunchParamsQuery as Ai, parseLaunchParamsQueryFp as Bi, serializeInitDataQuery as xi, serializeLaunchParamsQuery as Mi, toRGB as Vi, toRGBFp as Ti, toRGBFull as Ri, toRGBFullFp as Li } from "@vbotma/transformers";
11
- import { either as b, function as p, option as N, taskEither as c } from "fp-ts";
12
- import { errorClass as j, errorClassWithData as Ie } from "error-kid";
13
- import { parse as Oe, record as wt, string as K, array as Ct, safeParse as Fe, looseObject as De, pipe as ze, transform as Ke, date as Ne, optional as St, number as Qe, integer as vt } from "valibot";
14
- function $(r) {
15
- return typeof r == "function" ? r() : r;
16
- }
17
- class ne {
5
+ import { supports as ee, isVBMAFp as ut, postEventFp as ye, off as ne, on as G, request2Fp as je, requestFp as lt, invokeCustomMethodFp as ht, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as dt, captureSameReq as ft, getHostBridge as re, logger as Oe } from "@vbotma/bridge";
6
+ import { CancelledError as Pn, InvalidLaunchParamsError as On, InvokeCustomMethodFailedError as Dn, LaunchParamsRetrieveError as Gn, MethodParameterUnsupportedError as Hn, MethodUnsupportedError as jn, TimeoutError as Un, UnknownEnvError as Wn, applyPolyfills as zn, createLogger as Kn, createPostEvent as Nn, createStartParam as Qn, createStartParamFp as Jn, debug as Yn, decodeBase64Url as Zn, decodeBase64UrlFp as Xn, decodeStartParam as ei, decodeStartParamFp as ti, deepSnakeToCamelObjKeys as si, defineHostBridge as ri, emitEvent as ni, encodeBase64Url as ii, getHostBridge as oi, getReleaseVersion as ai, isSafeToCreateStartParam as pi, isVBMA as ci, isVBMAFp as ui, logger as li, mockVBotEnv as hi, off as di, offAll as fi, on as _i, retrieveLaunchParams as mi, retrieveLaunchParamsFp as bi, retrieveRawInitData as gi, retrieveRawInitDataFp as Fi, retrieveRawLaunchParams as wi, retrieveRawLaunchParamsFp as Ci, setDebug as Si, setTargetOrigin as vi, supports as ki, targetOrigin as yi } from "@vbotma/bridge";
7
+ import { throwifyFpFn as de, throwifyAnyEither as Ue, setStorageValue as _t, getStorageValue as mt, snakeToKebab as bt, createCbCollector as Ie, camelToKebab as We, BetterTaskEither as Fe } from "@vbotma/toolkit";
8
+ import { BetterPromise as ze } from "better-promises";
9
+ import { toRGBFullFp as gt, isRGB as _e, pipeQueryToSchema as Ft, pipeJsonToSchema as wt } from "@vbotma/transformers";
10
+ import { isAnyRGB as Ei, isRGB as qi, isRGBA as Bi, isRGBAShort as Ai, isRGBShort as xi, parseInitDataQuery as Mi, parseInitDataQueryFp as Vi, parseLaunchParamsQuery as Ti, parseLaunchParamsQueryFp as Ri, serializeInitDataQuery as Li, serializeLaunchParamsQuery as $i, toRGB as Pi, toRGBFp as Oi, toRGBFull as Di, toRGBFullFp as Gi } from "@vbotma/transformers";
11
+ import { either as b, function as p, option as N, taskEither as u } from "fp-ts";
12
+ import { errorClass as H, errorClassWithData as Ee } from "error-kid";
13
+ import { parse as De, record as Ct, string as K, array as St, safeParse as we, looseObject as Ge, pipe as Ke, transform as Ne, date as Qe, optional as vt, number as Je, integer as kt } from "valibot";
14
+ function $(n) {
15
+ return typeof n == "function" ? n() : n;
16
+ }
17
+ class ie {
18
18
  constructor({
19
19
  onMounted: t,
20
- restoreState: s,
21
- initialState: n,
20
+ restoreState: r,
21
+ initialState: s,
22
22
  onUnmounted: i,
23
23
  isPageReload: a
24
24
  }) {
@@ -38,7 +38,7 @@ class ne {
38
38
  this.mount = () => {
39
39
  if (this.isMounted())
40
40
  return b.right(void 0);
41
- const u = $(a) ? s() : void 0, o = u ? b.right(u) : typeof n == "function" ? n() : b.right(n);
41
+ const c = $(a) ? r() : void 0, o = c ? b.right(c) : typeof s == "function" ? s() : b.right(s);
42
42
  return p.pipe(o, b.map((l) => {
43
43
  ue(() => {
44
44
  this._isMounted.set(!0), t == null || t(l);
@@ -51,20 +51,20 @@ class ne {
51
51
  };
52
52
  }
53
53
  }
54
- function we(r) {
54
+ function Ce(n) {
55
55
  const t = {};
56
- for (const s in r) {
57
- const n = r[s];
58
- n !== void 0 && (t[s] = n);
56
+ for (const r in n) {
57
+ const s = n[r];
58
+ s !== void 0 && (t[r] = s);
59
59
  }
60
60
  return t;
61
61
  }
62
- function _e(r, t) {
63
- const s = Object.keys(r), n = Object.keys(t);
64
- return s.length !== n.length ? !1 : s.every((i) => Object.prototype.hasOwnProperty.call(t, i) && r[i] === t[i]);
62
+ function me(n, t) {
63
+ const r = Object.keys(n), s = Object.keys(t);
64
+ return r.length !== s.length ? !1 : r.every((i) => Object.prototype.hasOwnProperty.call(t, i) && n[i] === t[i]);
65
65
  }
66
66
  class J {
67
- constructor({ initialState: t, onChange: s }) {
67
+ constructor({ initialState: t, onChange: r }) {
68
68
  e(this, "_state");
69
69
  /**
70
70
  * The current state.
@@ -75,10 +75,10 @@ class J {
75
75
  * @param state - updates to apply.
76
76
  */
77
77
  e(this, "setState", (t) => {
78
- const s = { ...this.state(), ...we(t) };
79
- _e(s, this.state()) || this._state.set(s);
78
+ const r = { ...this.state(), ...Ce(t) };
79
+ me(r, this.state()) || this._state.set(r);
80
80
  });
81
- this._state = O(t, { equals: _e }), this.state = w(this._state), this.state.sub(s);
81
+ this._state = O(t, { equals: me }), this.state = w(this._state), this.state.sub(r);
82
82
  }
83
83
  /**
84
84
  * Creates a computed signal based on the state.
@@ -92,164 +92,164 @@ class J {
92
92
  * @param state
93
93
  */
94
94
  hasDiff(t) {
95
- return !_e({ ...this.state(), ...we(t) }, this.state());
95
+ return !me({ ...this.state(), ...Ce(t) }, this.state());
96
96
  }
97
97
  }
98
- function H(r, t) {
99
- return w(() => ee(r, $(t)));
98
+ function W(n, t) {
99
+ return w(() => ee(n, $(t)));
100
100
  }
101
101
  // @__NO_SIDE_EFFECTS__
102
- function h(r) {
103
- return Object.assign(he(r), {
102
+ function h(n) {
103
+ return Object.assign(de(n), {
104
104
  ifAvailable(...t) {
105
105
  return p.pipe(
106
- r.ifAvailable(...t),
106
+ n.ifAvailable(...t),
107
107
  N.match(
108
108
  () => ({ ok: !1 }),
109
- (s) => ({
109
+ (r) => ({
110
110
  ok: !0,
111
- data: Ue(s)
111
+ data: Ue(r)
112
112
  })
113
113
  )
114
114
  );
115
115
  }
116
116
  });
117
117
  }
118
- function X(r) {
119
- return [r];
118
+ function X(n) {
119
+ return [n];
120
120
  }
121
- class pe extends (/* @__PURE__ */ Ie(
121
+ class ce extends (/* @__PURE__ */ Ee(
122
122
  "ValidationError",
123
- (t, s) => ({ input: t, issues: s }),
123
+ (t, r) => ({ input: t, issues: r }),
124
124
  "Validation error"
125
125
  )) {
126
126
  }
127
- class Ee extends (/* @__PURE__ */ j(
127
+ class qe extends (/* @__PURE__ */ H(
128
128
  "CSSVarsBoundError",
129
129
  "CSS variables are already bound"
130
130
  )) {
131
131
  }
132
- class kt extends (/* @__PURE__ */ Ie("DeviceStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
132
+ class yt extends (/* @__PURE__ */ Ee("DeviceStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
133
133
  }
134
- class yt extends (/* @__PURE__ */ Ie("SecureStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
134
+ class It extends (/* @__PURE__ */ Ee("SecureStorageMethodError", (t) => ({ error: t }), (t) => [t])) {
135
135
  }
136
- class It extends (/* @__PURE__ */ j(
136
+ class Et extends (/* @__PURE__ */ H(
137
137
  "NotAvailableError",
138
138
  X
139
139
  )) {
140
140
  }
141
- class Gr extends (/* @__PURE__ */ j(
141
+ class Hr extends (/* @__PURE__ */ H(
142
142
  "InvalidEnvError",
143
143
  X
144
144
  )) {
145
145
  }
146
- class Et extends (/* @__PURE__ */ j(
146
+ class qt extends (/* @__PURE__ */ H(
147
147
  "FunctionNotAvailableError",
148
148
  X
149
149
  )) {
150
150
  }
151
- class W extends (/* @__PURE__ */ j(
151
+ class U extends (/* @__PURE__ */ H(
152
152
  "InvalidArgumentsError",
153
- (t, s) => [t, { cause: s }]
153
+ (t, r) => [t, { cause: r }]
154
154
  )) {
155
155
  }
156
- class qe extends (/* @__PURE__ */ j(
156
+ class Be extends (/* @__PURE__ */ H(
157
157
  "ConcurrentCallError",
158
158
  X
159
159
  )) {
160
160
  }
161
- class qt extends (/* @__PURE__ */ j(
161
+ class Bt extends (/* @__PURE__ */ H(
162
162
  "SetEmojiStatusError",
163
163
  (t) => [`Failed to set emoji status: ${t}`]
164
164
  )) {
165
165
  }
166
- class Je extends (/* @__PURE__ */ j(
166
+ class Ye extends (/* @__PURE__ */ H(
167
167
  "AccessDeniedError",
168
168
  X
169
169
  )) {
170
170
  }
171
- class At extends (/* @__PURE__ */ j(
171
+ class At extends (/* @__PURE__ */ H(
172
172
  "FullscreenFailedError",
173
173
  X
174
174
  )) {
175
175
  }
176
- class Bt extends (/* @__PURE__ */ j(
176
+ class xt extends (/* @__PURE__ */ H(
177
177
  "ShareMessageError",
178
178
  X
179
179
  )) {
180
180
  }
181
- class xt extends (/* @__PURE__ */ j(
181
+ class Mt extends (/* @__PURE__ */ H(
182
182
  "UnknownThemeParamsKeyError",
183
183
  (t) => [`Unknown theme params key passed: ${t}`]
184
184
  )) {
185
185
  }
186
- function A(r, t) {
187
- const s = w(() => $(t.version) || "100"), n = w(() => $(t.isTma)), { requires: i, returns: a } = t, u = i ? typeof i == "object" ? i : { every: [i] } : void 0, o = (m) => {
186
+ function B(n, t) {
187
+ const r = w(() => $(t.version) || "100"), s = w(() => $(t.isTma)), { requires: i, returns: a } = t, c = i ? typeof i == "object" ? i : { every: [i] } : void 0, o = (m) => {
188
188
  if (!t.supports)
189
189
  return !0;
190
190
  const g = t.supports[m];
191
- return ee(g.method, g.param, s());
191
+ return ee(g.method, g.param, r());
192
192
  }, l = () => {
193
- if (!u)
193
+ if (!c)
194
194
  return;
195
- const [m, g] = "every" in u ? ["every", u.every] : ["some", u.some];
195
+ const [m, g] = "every" in c ? ["every", c.every] : ["some", c.some];
196
196
  for (let d = 0; d < g.length; d++) {
197
- const B = g[d], T = typeof B == "function" ? B() : ee(B, s()) ? void 0 : `it is unsupported in Mini Apps version ${s()}`;
197
+ const A = g[d], T = typeof A == "function" ? A() : ee(A, r()) ? void 0 : `it is unsupported in Mini Apps version ${r()}`;
198
198
  if (T && (m === "every" || d === g.length - 1))
199
199
  return T;
200
200
  }
201
201
  }, _ = (...m) => {
202
202
  for (const g in t.supports)
203
203
  if (t.supports[g].shouldCheck(...m) && !o(g))
204
- return `option ${g} is not supported in Mini Apps version ${s()}`;
205
- }, F = w(() => !l()), f = w(() => s() !== "0.0"), v = w(() => t.isMounted ? t.isMounted() : !0), C = w(
206
- () => n() && f() && F() && v()
204
+ return `option ${g} is not supported in Mini Apps version ${r()}`;
205
+ }, F = w(() => !l()), f = w(() => r() !== "0.0"), v = w(() => t.isMounted ? t.isMounted() : !0), C = w(
206
+ () => s() && f() && F() && v()
207
207
  ), k = (m) => {
208
- const g = new Et(m);
209
- return ["task", "promise"].includes(t.returns) ? c.left(g) : b.left(g);
210
- }, y = (...m) => a === "plain" ? b.tryCatch(() => r(...m), (g) => g) : a === "promise" ? c.tryCatch(() => r(...m), (g) => g) : r(...m);
208
+ const g = new qt(m);
209
+ return ["task", "promise"].includes(t.returns) ? u.left(g) : b.left(g);
210
+ }, y = (...m) => a === "plain" ? b.tryCatch(() => n(...m), (g) => g) : a === "promise" ? u.tryCatch(() => n(...m), (g) => g) : n(...m);
211
211
  return Object.assign(
212
212
  (...m) => {
213
213
  var T;
214
214
  const g = "Unable to call function:";
215
- if (!n())
215
+ if (!s())
216
216
  return k(`${g} it can't be called outside Mini Apps`);
217
217
  if (!f())
218
218
  return k(`${g} the SDK was not initialized. Use the SDK init() function`);
219
219
  const d = l();
220
220
  if (d)
221
221
  return k(`${g} ${d}`);
222
- const B = _(...m);
223
- if (B)
224
- return k(`${g} ${B}`);
222
+ const A = _(...m);
223
+ if (A)
224
+ return k(`${g} ${A}`);
225
225
  if (!v()) {
226
226
  const M = (T = t.isMounting) != null && T.call(t) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
227
227
  return k(`${g} the component is ${M}`);
228
228
  }
229
229
  return y(...m);
230
230
  },
231
- r,
231
+ n,
232
232
  {
233
233
  isAvailable: C,
234
234
  ifAvailable(...m) {
235
235
  return C() ? N.some(y(...m)) : N.none;
236
236
  }
237
237
  },
238
- u ? { isSupported: F } : {},
238
+ c ? { isSupported: F } : {},
239
239
  t.supports ? { supports: o } : {}
240
240
  );
241
241
  }
242
- function E(r) {
243
- return (t) => A(t, r);
242
+ function E(n) {
243
+ return (t) => B(t, n);
244
244
  }
245
- class de {
245
+ class fe {
246
246
  constructor({
247
247
  isTma: t,
248
- storage: s,
249
- onClick: n,
248
+ storage: r,
249
+ onClick: s,
250
250
  offClick: i,
251
251
  initialState: a,
252
- isPageReload: u,
252
+ isPageReload: c,
253
253
  postEvent: o,
254
254
  payload: l,
255
255
  method: _,
@@ -337,13 +337,13 @@ class de {
337
337
  const f = new J({
338
338
  initialState: a,
339
339
  onChange(m) {
340
- s.set(m);
340
+ r.set(m);
341
341
  }
342
- }), v = new ne({
342
+ }), v = new ie({
343
343
  initialState: a,
344
- isPageReload: u,
344
+ isPageReload: c,
345
345
  onMounted: f.setState,
346
- restoreState: s.get
346
+ restoreState: r.get
347
347
  }), C = { version: F, requires: _, isTma: t }, k = E({
348
348
  ...C,
349
349
  returns: "plain"
@@ -352,15 +352,15 @@ class de {
352
352
  returns: "either",
353
353
  isMounted: v.isMounted
354
354
  });
355
- this.isMounted = v.isMounted, this.isSupported = H(_, F), this.state = f.state, this.setStateFp = y((m) => {
356
- const g = { ...this.state(), ...we(m) };
355
+ this.isMounted = v.isMounted, this.isSupported = W(_, F), this.state = f.state, this.setStateFp = y((m) => {
356
+ const g = { ...this.state(), ...Ce(m) };
357
357
  return f.hasDiff(g) ? p.pipe(
358
358
  o(_, l(g)),
359
359
  b.map(() => {
360
360
  f.setState(g);
361
361
  })
362
362
  ) : b.right(void 0);
363
- }), this.setState = /* @__PURE__ */ h(this.setStateFp), this.onClickFp = k(n), this.onClick = /* @__PURE__ */ h(this.onClickFp), this.offClickFp = k(i), this.offClick = /* @__PURE__ */ h(this.offClickFp), this.mountFp = k(() => {
363
+ }), this.setState = /* @__PURE__ */ h(this.setStateFp), this.onClickFp = k(s), this.onClick = /* @__PURE__ */ h(this.onClickFp), this.offClickFp = k(i), this.offClick = /* @__PURE__ */ h(this.offClickFp), this.mountFp = k(() => {
364
364
  const m = () => {
365
365
  };
366
366
  return p.pipe(v.mount(), b.match(m, m));
@@ -368,10 +368,10 @@ class de {
368
368
  const g = y((d) => this.setStateFp({ [m]: d }));
369
369
  return [/* @__PURE__ */ h(g), g];
370
370
  }, this.stateBoolSetters = (m) => {
371
- const [, g] = this.stateSetters(m), d = y(() => g(!1)), B = y(() => g(!0));
371
+ const [, g] = this.stateSetters(m), d = y(() => g(!1)), A = y(() => g(!0));
372
372
  return [
373
373
  [/* @__PURE__ */ h(d), d],
374
- [/* @__PURE__ */ h(B), B]
374
+ [/* @__PURE__ */ h(A), A]
375
375
  ];
376
376
  };
377
377
  }
@@ -383,7 +383,7 @@ class de {
383
383
  return w(() => this.state()[t]);
384
384
  }
385
385
  }
386
- class Mt {
386
+ class Vt {
387
387
  constructor(t) {
388
388
  /**
389
389
  * Signal indicating if the component is currently visible.
@@ -466,75 +466,75 @@ class Mt {
466
466
  * @see onClick
467
467
  */
468
468
  e(this, "unmount");
469
- const s = new de({
469
+ const r = new fe({
470
470
  ...t,
471
471
  method: "web_app_setup_back_button",
472
- payload: (n) => ({ is_visible: n.isVisible }),
472
+ payload: (s) => ({ is_visible: s.isVisible }),
473
473
  initialState: { isVisible: !1 }
474
474
  });
475
- this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.isSupported = s.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
475
+ 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;
476
476
  }
477
477
  }
478
478
  function S() {
479
479
  return { isTma: w(() => ut()) };
480
480
  }
481
- function te(r) {
482
- return (t) => ({ ...t, ...$(r) });
481
+ function te(n) {
482
+ return (t) => ({ ...t, ...$(n) });
483
483
  }
484
484
  // @__NO_SIDE_EFFECTS__
485
- function ie(r, t) {
486
- return O(r, t);
485
+ function oe(n, t) {
486
+ return O(n, t);
487
487
  }
488
- const Ye = /* @__PURE__ */ ie(ke), se = (...r) => Ye()(...r), Vt = (...r) => Ue(se(...r)), V = te({
488
+ const Ze = /* @__PURE__ */ oe(ye), se = (...n) => Ze()(...n), Tt = (...n) => Ue(se(...n)), V = te({
489
489
  postEvent: se
490
490
  });
491
- function Tt(r) {
491
+ function Rt(n) {
492
492
  return {
493
- get: () => _t(r),
493
+ get: () => mt(n),
494
494
  set(t) {
495
- ft(r, t);
495
+ _t(n, t);
496
496
  }
497
497
  };
498
498
  }
499
- function Rt() {
499
+ function Lt() {
500
500
  return performance.getEntriesByType("navigation")[0];
501
501
  }
502
- function Lt() {
503
- const r = Rt();
504
- return !!r && r.type === "reload";
502
+ function $t() {
503
+ const n = Lt();
504
+ return !!n && n.type === "reload";
505
505
  }
506
- function Y(r) {
506
+ function Y(n) {
507
507
  return te({
508
- storage: Tt(r),
509
- isPageReload: Lt
508
+ storage: Rt(n),
509
+ isPageReload: $t
510
510
  });
511
511
  }
512
- const Ce = /* @__PURE__ */ ie("0.0"), I = te({ version: Ce });
512
+ const Se = /* @__PURE__ */ oe("0.0"), I = te({ version: Se });
513
513
  // @__NO_SIDE_EFFECTS__
514
- function Ae(r, t) {
514
+ function Ae(n, t) {
515
515
  return {
516
516
  ...p.pipe(
517
517
  S(),
518
518
  V,
519
519
  I,
520
- Y(r)
520
+ Y(n)
521
521
  ),
522
- onClick(s, n) {
523
- return G(t, s, n);
522
+ onClick(r, s) {
523
+ return G(t, r, s);
524
524
  },
525
- offClick(s, n) {
526
- re(t, s, n);
525
+ offClick(r, s) {
526
+ ne(t, r, s);
527
527
  }
528
528
  };
529
529
  }
530
- const jr = /* @__PURE__ */ new Mt(
530
+ const jr = /* @__PURE__ */ new Vt(
531
531
  /* @__PURE__ */ Ae("backButton", "back_button_pressed")
532
532
  );
533
- class Be {
533
+ class xe {
534
534
  constructor({
535
535
  initialState: t,
536
- onMounted: s,
537
- restoreState: n,
536
+ onMounted: r,
537
+ restoreState: s,
538
538
  onUnmounted: i,
539
539
  isPageReload: a
540
540
  }) {
@@ -552,15 +552,15 @@ class Be {
552
552
  * Unmounts the component.
553
553
  */
554
554
  e(this, "unmount");
555
- this.mount = (u) => {
555
+ this.mount = (c) => {
556
556
  if (this._isMounted())
557
- return c.right(void 0);
558
- const o = $(a) ? n() : void 0;
557
+ return u.right(void 0);
558
+ const o = $(a) ? s() : void 0;
559
559
  return p.pipe(
560
- o ? c.right(o) : t(u),
561
- c.map((l) => {
560
+ o ? u.right(o) : t(c),
561
+ u.map((l) => {
562
562
  this._isMounted() || ue(() => {
563
- this._isMounted.set(!0), s == null || s(l);
563
+ this._isMounted.set(!0), r == null || r(l);
564
564
  });
565
565
  })
566
566
  );
@@ -571,21 +571,21 @@ class Be {
571
571
  };
572
572
  }
573
573
  }
574
- function Ge() {
575
- return new It("Biometry is not available");
574
+ function He() {
575
+ return new Et("Biometry is not available");
576
576
  }
577
- function me(r) {
578
- let t = !1, s = !1, n = "", i = !1, a = "", u = !1;
579
- return r.available && (t = !0, s = r.token_saved, n = r.device_id, i = r.access_requested, a = r.type, u = r.access_granted), { available: t, tokenSaved: s, deviceId: n, type: a, accessGranted: u, accessRequested: i };
577
+ function be(n) {
578
+ let t = !1, r = !1, s = "", i = !1, a = "", c = !1;
579
+ return n.available && (t = !0, r = n.token_saved, s = n.device_id, i = n.access_requested, a = n.type, c = n.access_granted), { available: t, tokenSaved: r, deviceId: s, type: a, accessGranted: c, accessRequested: i };
580
580
  }
581
- class $t {
581
+ class Pt {
582
582
  constructor({
583
583
  version: t,
584
- request: s,
585
- postEvent: n,
584
+ request: r,
585
+ postEvent: s,
586
586
  storage: i,
587
587
  onInfoReceived: a,
588
- offInfoReceived: u,
588
+ offInfoReceived: c,
589
589
  isTma: o,
590
590
  isPageReload: l
591
591
  }) {
@@ -677,7 +677,7 @@ class $t {
677
677
  */
678
678
  e(this, "unmount");
679
679
  const _ = (m) => {
680
- F.setState(me(m));
680
+ F.setState(be(m));
681
681
  }, F = new J({
682
682
  initialState: {
683
683
  available: !1,
@@ -688,11 +688,11 @@ class $t {
688
688
  tokenSaved: !1
689
689
  },
690
690
  onChange: i.set
691
- }), f = new Be({
691
+ }), f = new xe({
692
692
  initialState(m) {
693
693
  return p.pipe(
694
- s("web_app_biometry_get_info", "biometry_info_received", m),
695
- c.map(me)
694
+ r("web_app_biometry_get_info", "biometry_info_received", m),
695
+ u.map(be)
696
696
  );
697
697
  },
698
698
  isPageReload: l,
@@ -700,7 +700,7 @@ class $t {
700
700
  F.setState(m), a(_);
701
701
  },
702
702
  onUnmounted() {
703
- u(_);
703
+ c(_);
704
704
  },
705
705
  restoreState: i.get
706
706
  }), v = { version: t, requires: "web_app_biometry_request_auth", isTma: o }, C = E({
@@ -714,42 +714,42 @@ class $t {
714
714
  isMounted: f.isMounted,
715
715
  returns: "task"
716
716
  });
717
- this.isAvailable = F.getter("available"), this.isMounted = f.isMounted, this.isSupported = H("web_app_biometry_request_auth", t), this.state = F.state, this.unmount = f.unmount, this.mountFp = k(f.mount), this.authenticateFp = y((m) => this.isAvailable() ? p.pipe(
718
- s("web_app_biometry_request_auth", "biometry_auth_requested", {
717
+ this.isAvailable = F.getter("available"), this.isMounted = f.isMounted, this.isSupported = W("web_app_biometry_request_auth", t), this.state = F.state, this.unmount = f.unmount, this.mountFp = k(f.mount), this.authenticateFp = y((m) => this.isAvailable() ? p.pipe(
718
+ r("web_app_biometry_request_auth", "biometry_auth_requested", {
719
719
  ...m,
720
720
  params: { reason: ((m || {}).reason || "").trim() }
721
721
  }),
722
- c.map((g) => (F.setState({ token: g.token }), g))
723
- ) : c.left(Ge())), this.openSettingsFp = C(() => n("web_app_biometry_open_settings")), this.requestAccessFp = y((m) => p.pipe(
724
- s("web_app_biometry_request_access", "biometry_info_received", {
722
+ u.map((g) => (F.setState({ token: g.token }), g))
723
+ ) : u.left(He())), this.openSettingsFp = C(() => s("web_app_biometry_open_settings")), this.requestAccessFp = y((m) => p.pipe(
724
+ r("web_app_biometry_request_access", "biometry_info_received", {
725
725
  ...m,
726
726
  params: { reason: ((m || {}).reason || "").trim() }
727
727
  }),
728
- c.chain((g) => {
729
- const d = me(g);
730
- return d.available ? (F.setState(d), c.right(d.accessRequested)) : c.left(Ge());
728
+ u.chain((g) => {
729
+ const d = be(g);
730
+ return d.available ? (F.setState(d), u.right(d.accessRequested)) : u.left(He());
731
731
  })
732
732
  )), this.updateTokenFp = y((m = {}) => {
733
733
  var g;
734
734
  return p.pipe(
735
- s("web_app_biometry_update_token", "biometry_token_updated", {
735
+ r("web_app_biometry_update_token", "biometry_token_updated", {
736
736
  ...m,
737
737
  params: { token: m.token || "", reason: (g = m.reason) == null ? void 0 : g.trim() }
738
738
  }),
739
- c.map((d) => d.status)
739
+ u.map((d) => d.status)
740
740
  );
741
741
  }), 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
742
  }
743
743
  }
744
- const Pt = (r, t, s) => ct(r, t, {
744
+ const Ot = (n, t, r) => lt(n, t, {
745
745
  postEvent: se,
746
- ...s
747
- }), Ze = (r, t, s) => je(r, t, {
746
+ ...r
747
+ }), Xe = (n, t, r) => je(n, t, {
748
748
  postEvent: se,
749
- ...s
750
- }), Ur = (...r) => He.fn(() => Pt(...r)()), Wr = (...r) => He.fn(() => Ze(...r)()), R = te({ request: Ze });
751
- function Ot() {
752
- return new $t({
749
+ ...r
750
+ }), Ur = (...n) => ze.fn(() => Ot(...n)()), Wr = (...n) => ze.fn(() => Xe(...n)()), R = te({ request: Xe });
751
+ function Dt() {
752
+ return new Pt({
753
753
  ...p.pipe(
754
754
  S(),
755
755
  V,
@@ -757,17 +757,17 @@ function Ot() {
757
757
  R,
758
758
  Y("biometry")
759
759
  ),
760
- offInfoReceived(r) {
761
- re("biometry_info_received", r);
760
+ offInfoReceived(n) {
761
+ ne("biometry_info_received", n);
762
762
  },
763
- onInfoReceived(r) {
764
- return G("biometry_info_received", r);
763
+ onInfoReceived(n) {
764
+ return G("biometry_info_received", n);
765
765
  }
766
766
  });
767
767
  }
768
- const Hr = /* @__PURE__ */ Ot();
769
- class Dt {
770
- constructor({ postEvent: t, storage: s, isTma: n, isPageReload: i }) {
768
+ const zr = /* @__PURE__ */ Dt();
769
+ class Gt {
770
+ constructor({ postEvent: t, storage: r, isTma: s, isPageReload: i }) {
771
771
  /**
772
772
  * Signal indicating if closing confirmation dialog is currently enabled.
773
773
  */
@@ -807,40 +807,40 @@ class Dt {
807
807
  const a = new J({
808
808
  initialState: { isConfirmationEnabled: !1 },
809
809
  onChange(f) {
810
- s.set(f);
810
+ r.set(f);
811
811
  }
812
- }), u = new ne({
812
+ }), c = new ie({
813
813
  onMounted: a.setState,
814
- restoreState: s.get,
814
+ restoreState: r.get,
815
815
  initialState: { isConfirmationEnabled: !1 },
816
816
  isPageReload: i
817
- }), o = { requires: "web_app_setup_closing_behavior", isTma: n }, l = E({
817
+ }), o = { requires: "web_app_setup_closing_behavior", isTma: s }, l = E({
818
818
  ...o,
819
819
  returns: "plain"
820
820
  }), _ = E({
821
821
  ...o,
822
822
  returns: "either",
823
- isMounted: u.isMounted
823
+ isMounted: c.isMounted
824
824
  }), F = (f) => f === this.isConfirmationEnabled() ? b.right(void 0) : (a.setState({ isConfirmationEnabled: f }), t("web_app_setup_closing_behavior", {
825
825
  need_confirmation: f
826
826
  }));
827
- this.isConfirmationEnabled = a.getter("isConfirmationEnabled"), this.isMounted = u.isMounted, this.disableConfirmationFp = _(() => F(!1)), this.enableConfirmationFp = _(() => F(!0)), this.mountFp = l(() => {
827
+ this.isConfirmationEnabled = a.getter("isConfirmationEnabled"), this.isMounted = c.isMounted, this.disableConfirmationFp = _(() => F(!1)), this.enableConfirmationFp = _(() => F(!0)), this.mountFp = l(() => {
828
828
  const f = () => {
829
829
  };
830
- return p.pipe(u.mount(), b.match(f, f));
831
- }), this.unmount = u.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
830
+ return p.pipe(c.mount(), b.match(f, f));
831
+ }), this.unmount = c.unmount, this.disableConfirmation = /* @__PURE__ */ h(this.disableConfirmationFp), this.enableConfirmation = /* @__PURE__ */ h(this.enableConfirmationFp), this.mount = /* @__PURE__ */ h(this.mountFp);
832
832
  }
833
833
  }
834
- function Gt() {
835
- return new Dt(p.pipe(
834
+ function Ht() {
835
+ return new Gt(p.pipe(
836
836
  S(),
837
837
  Y("closingBehavior"),
838
838
  V
839
839
  ));
840
840
  }
841
- const zr = /* @__PURE__ */ Gt();
841
+ const Kr = /* @__PURE__ */ Ht();
842
842
  class jt {
843
- constructor({ version: t, isTma: s, invokeCustomMethod: n }) {
843
+ constructor({ version: t, isTma: r, invokeCustomMethod: s }) {
844
844
  /**
845
845
  * Signal indicating if the component is supported.
846
846
  */
@@ -913,59 +913,59 @@ class jt {
913
913
  const i = E({
914
914
  version: t,
915
915
  requires: "web_app_invoke_custom_method",
916
- isTma: s,
916
+ isTma: r,
917
917
  returns: "task"
918
918
  });
919
- this.isSupported = H("web_app_invoke_custom_method", t), this.deleteItemFp = i((a, u) => {
919
+ this.isSupported = W("web_app_invoke_custom_method", t), this.deleteItemFp = i((a, c) => {
920
920
  const o = Array.isArray(a) ? a : [a];
921
921
  return p.pipe(
922
- o.length ? n("deleteStorageValues", { keys: o }, u) : c.right(void 0),
923
- c.map(() => {
922
+ o.length ? s("deleteStorageValues", { keys: o }, c) : u.right(void 0),
923
+ u.map(() => {
924
924
  })
925
925
  );
926
- }), this.getItemFp = i((a, u) => p.pipe(
927
- this.getItemsFp([a], u),
928
- c.map((o) => o[a] || "")
929
- )), this.getItemsFp = i((a, u) => p.pipe(
930
- a.length ? n("getStorageValues", { keys: a }, u) : c.right({}),
931
- c.map((o) => ({
926
+ }), this.getItemFp = i((a, c) => p.pipe(
927
+ this.getItemsFp([a], c),
928
+ u.map((o) => o[a] || "")
929
+ )), this.getItemsFp = i((a, c) => p.pipe(
930
+ a.length ? s("getStorageValues", { keys: a }, c) : u.right({}),
931
+ u.map((o) => ({
932
932
  // Fulfill the response with probably missing keys.
933
933
  ...a.reduce((l, _) => (l[_] = "", l), {}),
934
- ...Oe(wt(K(), K()), o)
934
+ ...De(Ct(K(), K()), o)
935
935
  }))
936
936
  )), this.getKeysFp = i((a) => p.pipe(
937
- n("getStorageKeys", {}, a),
938
- c.map((u) => Oe(Ct(K()), u))
939
- )), this.setItemFp = i((a, u, o) => p.pipe(
940
- n("saveStorageValue", { key: a, value: u }, o),
941
- c.map(() => {
937
+ s("getStorageKeys", {}, a),
938
+ u.map((c) => De(St(K()), c))
939
+ )), this.setItemFp = i((a, c, o) => p.pipe(
940
+ s("saveStorageValue", { key: a, value: c }, o),
941
+ u.map(() => {
942
942
  })
943
- )), this.clearFp = i((a) => p.pipe(this.getKeysFp(a), 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);
943
+ )), this.clearFp = i((a) => p.pipe(this.getKeysFp(a), u.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
944
  }
945
945
  }
946
- const be = /* @__PURE__ */ ie(0);
947
- function xe() {
948
- return be.set(be() + 1), be().toString();
946
+ const ge = /* @__PURE__ */ oe(0);
947
+ function Me() {
948
+ return ge.set(ge() + 1), ge().toString();
949
949
  }
950
- function Ut(r, t, s) {
951
- return lt(r, t, xe(), {
952
- ...s || {},
950
+ function Ut(n, t, r) {
951
+ return ht(n, t, Me(), {
952
+ ...r || {},
953
953
  postEvent: se
954
954
  });
955
955
  }
956
- const Me = te({
956
+ const Ve = te({
957
957
  invokeCustomMethod: Ut
958
958
  });
959
959
  function Wt() {
960
960
  return new jt(p.pipe(
961
961
  S(),
962
962
  I,
963
- Me
963
+ Ve
964
964
  ));
965
965
  }
966
- const Kr = /* @__PURE__ */ Wt();
967
- class Ht {
968
- constructor({ isTma: t, request: s, version: n, createRequestId: i }) {
966
+ const Nr = /* @__PURE__ */ Wt();
967
+ class zt {
968
+ constructor({ isTma: t, request: r, version: s, createRequestId: i }) {
969
969
  /**
970
970
  * Retrieves an item using its key.
971
971
  * @since Mini Apps v9.0
@@ -1003,69 +1003,69 @@ class Ht {
1003
1003
  */
1004
1004
  e(this, "clear");
1005
1005
  const a = E({
1006
- version: n,
1006
+ version: s,
1007
1007
  requires: "web_app_device_storage_get_key",
1008
1008
  isTma: t,
1009
1009
  returns: "task"
1010
- }), u = (o, l, _) => {
1010
+ }), c = (o, l, _) => {
1011
1011
  const F = i();
1012
1012
  return p.pipe(
1013
- s(o, ["device_storage_failed", l], {
1013
+ r(o, ["device_storage_failed", l], {
1014
1014
  params: { ..._, req_id: F },
1015
1015
  capture: ((f) => "payload" in f ? f.payload.req_id === F : !0)
1016
1016
  }),
1017
- c.chain((f) => f.event === "device_storage_failed" ? c.left(new kt(f.payload.error || "UNKNOWN_ERROR")) : c.right(f.payload))
1017
+ u.chain((f) => f.event === "device_storage_failed" ? u.left(new yt(f.payload.error || "UNKNOWN_ERROR")) : u.right(f.payload))
1018
1018
  );
1019
1019
  };
1020
1020
  this.getItemFp = a((o) => p.pipe(
1021
- u("web_app_device_storage_get_key", "device_storage_key_received", { key: o }),
1022
- c.map((l) => l.value)
1021
+ c("web_app_device_storage_get_key", "device_storage_key_received", { key: o }),
1022
+ u.map((l) => l.value)
1023
1023
  )), this.setItemFp = a((o, l) => p.pipe(
1024
- u("web_app_device_storage_save_key", "device_storage_key_saved", { key: o, value: l }),
1025
- c.map(() => {
1024
+ c("web_app_device_storage_save_key", "device_storage_key_saved", { key: o, value: l }),
1025
+ u.map(() => {
1026
1026
  })
1027
1027
  )), this.deleteItemFp = a((o) => this.setItemFp(o, null)), this.clearFp = a(() => p.pipe(
1028
- u("web_app_device_storage_clear", "device_storage_cleared", {}),
1029
- c.map(() => {
1028
+ c("web_app_device_storage_clear", "device_storage_cleared", {}),
1029
+ u.map(() => {
1030
1030
  })
1031
1031
  )), 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
1032
  }
1033
1033
  }
1034
- const Xe = te({ createRequestId: xe });
1035
- function zt() {
1036
- return new Ht(p.pipe(
1034
+ const et = te({ createRequestId: Me });
1035
+ function Kt() {
1036
+ return new zt(p.pipe(
1037
1037
  S(),
1038
1038
  I,
1039
1039
  R,
1040
- Xe
1040
+ et
1041
1041
  ));
1042
1042
  }
1043
- const Nr = /* @__PURE__ */ zt();
1044
- function Kt({ request: r, ...t }) {
1045
- return A((s) => p.pipe(
1046
- r("web_app_request_emoji_status_access", "emoji_status_access_requested", s),
1047
- c.map((n) => n.status)
1043
+ const Qr = /* @__PURE__ */ Kt();
1044
+ function Nt({ request: n, ...t }) {
1045
+ return B((r) => p.pipe(
1046
+ n("web_app_request_emoji_status_access", "emoji_status_access_requested", r),
1047
+ u.map((s) => s.status)
1048
1048
  ), { ...t, requires: "web_app_request_emoji_status_access", returns: "task" });
1049
1049
  }
1050
1050
  // @__NO_SIDE_EFFECTS__
1051
- function Nt() {
1052
- return Kt(p.pipe(
1051
+ function Qt() {
1052
+ return Nt(p.pipe(
1053
1053
  S(),
1054
1054
  I,
1055
1055
  R
1056
1056
  ));
1057
1057
  }
1058
- const Qt = /* @__PURE__ */ Nt(), Qr = /* @__PURE__ */ h(Qt);
1059
- function Jt({ request: r, ...t }) {
1060
- return A((s, n) => p.pipe(
1061
- r("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
1058
+ const Jt = /* @__PURE__ */ Qt(), Jr = /* @__PURE__ */ h(Jt);
1059
+ function Yt({ request: n, ...t }) {
1060
+ return B((r, s) => p.pipe(
1061
+ n("web_app_set_emoji_status", ["emoji_status_set", "emoji_status_failed"], {
1062
1062
  params: {
1063
- custom_emoji_id: s,
1064
- duration: (n || {}).duration
1063
+ custom_emoji_id: r,
1064
+ duration: (s || {}).duration
1065
1065
  },
1066
- ...n
1066
+ ...s
1067
1067
  }),
1068
- c.chainW((i) => i.event === "emoji_status_failed" ? c.left(new qt(i.payload.error)) : c.right(void 0))
1068
+ u.chainW((i) => i.event === "emoji_status_failed" ? u.left(new Bt(i.payload.error)) : u.right(void 0))
1069
1069
  ), {
1070
1070
  ...t,
1071
1071
  requires: "web_app_set_emoji_status",
@@ -1073,16 +1073,16 @@ function Jt({ request: r, ...t }) {
1073
1073
  });
1074
1074
  }
1075
1075
  // @__NO_SIDE_EFFECTS__
1076
- function Yt() {
1077
- return Jt(p.pipe(
1076
+ function Zt() {
1077
+ return Yt(p.pipe(
1078
1078
  S(),
1079
1079
  R,
1080
1080
  I
1081
1081
  ));
1082
1082
  }
1083
- const Zt = /* @__PURE__ */ Yt(), Jr = /* @__PURE__ */ h(Zt);
1084
- class Xt {
1085
- constructor({ postEvent: t, isTma: s, version: n }) {
1083
+ const Xt = /* @__PURE__ */ Zt(), Yr = /* @__PURE__ */ h(Xt);
1084
+ class es {
1085
+ constructor({ postEvent: t, isTma: r, version: s }) {
1086
1086
  /**
1087
1087
  * Signal indicating if the component is supported.
1088
1088
  */
@@ -1125,49 +1125,49 @@ class Xt {
1125
1125
  e(this, "selectionChanged");
1126
1126
  const i = "web_app_trigger_haptic_feedback", a = E({
1127
1127
  requires: i,
1128
- isTma: s,
1129
- version: n,
1128
+ isTma: r,
1129
+ version: s,
1130
1130
  returns: "plain"
1131
1131
  });
1132
- this.isSupported = H(i, n), this.impactOccurredFp = a((u) => t(i, { type: "impact", impact_style: u })), this.notificationOccurredFp = a((u) => t(i, { type: "notification", notification_type: u })), this.selectionChangedFp = a(() => t(i, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1132
+ this.isSupported = W(i, s), this.impactOccurredFp = a((c) => t(i, { type: "impact", impact_style: c })), this.notificationOccurredFp = a((c) => t(i, { type: "notification", notification_type: c })), this.selectionChangedFp = a(() => t(i, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1133
1133
  }
1134
1134
  }
1135
- function es() {
1136
- return new Xt(p.pipe(
1135
+ function ts() {
1136
+ return new es(p.pipe(
1137
1137
  S(),
1138
1138
  V,
1139
1139
  I
1140
1140
  ));
1141
1141
  }
1142
- const Yr = /* @__PURE__ */ es();
1143
- function ts({ postEvent: r, ...t }) {
1144
- return A(() => r("web_app_add_to_home_screen"), { ...t, requires: "web_app_add_to_home_screen", returns: "either" });
1142
+ const Zr = /* @__PURE__ */ ts();
1143
+ function ss({ postEvent: n, ...t }) {
1144
+ return B(() => n("web_app_add_to_home_screen"), { ...t, requires: "web_app_add_to_home_screen", returns: "either" });
1145
1145
  }
1146
1146
  // @__NO_SIDE_EFFECTS__
1147
- function ss() {
1148
- return ts(p.pipe(
1147
+ function rs() {
1148
+ return ss(p.pipe(
1149
1149
  S(),
1150
1150
  I,
1151
1151
  V
1152
1152
  ));
1153
1153
  }
1154
- const rs = /* @__PURE__ */ ss(), Zr = /* @__PURE__ */ h(rs);
1155
- function ns({ request: r, ...t }) {
1156
- return A((s) => p.pipe(
1157
- r("web_app_check_home_screen", "home_screen_checked", s),
1158
- c.map((n) => n.status || "unknown")
1154
+ const ns = /* @__PURE__ */ rs(), Xr = /* @__PURE__ */ h(ns);
1155
+ function is({ request: n, ...t }) {
1156
+ return B((r) => p.pipe(
1157
+ n("web_app_check_home_screen", "home_screen_checked", r),
1158
+ u.map((s) => s.status || "unknown")
1159
1159
  ), { ...t, requires: "web_app_check_home_screen", returns: "task" });
1160
1160
  }
1161
1161
  // @__NO_SIDE_EFFECTS__
1162
- function is() {
1163
- return ns(p.pipe(
1162
+ function os() {
1163
+ return is(p.pipe(
1164
1164
  S(),
1165
1165
  I,
1166
1166
  R
1167
1167
  ));
1168
1168
  }
1169
- const os = /* @__PURE__ */ is(), Xr = /* @__PURE__ */ h(os);
1170
- class as {
1169
+ const as = /* @__PURE__ */ os(), en = /* @__PURE__ */ h(as);
1170
+ class ps {
1171
1171
  constructor({ retrieveInitData: t }) {
1172
1172
  e(this, "_state", O());
1173
1173
  e(this, "_raw", O());
@@ -1188,8 +1188,8 @@ class as {
1188
1188
  * the [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery) method.
1189
1189
  */
1190
1190
  e(this, "canSendAfterDate", w(() => {
1191
- const t = this.authDate(), s = this.canSendAfter();
1192
- return s && t ? new Date(t.getTime() + s * 1e3) : void 0;
1191
+ const t = this.authDate(), r = this.canSendAfter();
1192
+ return r && t ? new Date(t.getTime() + r * 1e3) : void 0;
1193
1193
  }));
1194
1194
  /**
1195
1195
  * @see InitDataType.chat
@@ -1246,40 +1246,40 @@ class as {
1246
1246
  this.restoreFp = () => p.pipe(
1247
1247
  t(),
1248
1248
  b.map(N.match(() => {
1249
- }, ({ raw: s, obj: n }) => {
1250
- this._state.set(n), this._raw.set(s);
1249
+ }, ({ raw: r, obj: s }) => {
1250
+ this._state.set(s), this._raw.set(r);
1251
1251
  }))
1252
- ), this.restore = he(this.restoreFp);
1252
+ ), this.restore = de(this.restoreFp);
1253
1253
  }
1254
1254
  fromState(t) {
1255
1255
  return w(() => {
1256
- const s = this._state();
1257
- return s ? s[t] : void 0;
1256
+ const r = this._state();
1257
+ return r ? r[t] : void 0;
1258
1258
  });
1259
1259
  }
1260
1260
  }
1261
- function ps() {
1262
- return new as({
1261
+ function cs() {
1262
+ return new ps({
1263
1263
  retrieveInitData() {
1264
1264
  return p.pipe(
1265
1265
  b.Do,
1266
1266
  b.bindW("obj", () => p.pipe(
1267
- ce(),
1268
- b.map(({ vbWebAppData: r }) => r ? N.some(r) : N.none)
1267
+ le(),
1268
+ b.map(({ vbWebAppData: n }) => n ? N.some(n) : N.none)
1269
1269
  )),
1270
- b.bindW("raw", ht),
1271
- b.map(({ obj: r, raw: t }) => p.pipe(
1270
+ b.bindW("raw", dt),
1271
+ b.map(({ obj: n, raw: t }) => p.pipe(
1272
1272
  N.Do,
1273
- N.bind("obj", () => r),
1273
+ N.bind("obj", () => n),
1274
1274
  N.bind("raw", () => t)
1275
1275
  ))
1276
1276
  );
1277
1277
  }
1278
1278
  });
1279
1279
  }
1280
- const en = /* @__PURE__ */ ps();
1280
+ const tn = /* @__PURE__ */ cs();
1281
1281
  class us {
1282
- constructor({ version: t, request: s, isTma: n }) {
1282
+ constructor({ version: t, request: r, isTma: s }) {
1283
1283
  /**
1284
1284
  * Signal indicating if any invoice is currently opened.
1285
1285
  */
@@ -1316,99 +1316,99 @@ class us {
1316
1316
  e(this, "openUrl");
1317
1317
  const i = E({
1318
1318
  version: t,
1319
- isTma: n,
1319
+ isTma: s,
1320
1320
  requires: "web_app_open_invoice",
1321
1321
  returns: "task"
1322
- }), a = O(!1), u = () => {
1322
+ }), a = O(!1), c = () => {
1323
1323
  a.set(!1);
1324
1324
  };
1325
- this.isSupported = H("web_app_open_invoice", t), this.isOpened = w(a), this.openSlugFp = i((o, l) => p.pipe(
1326
- this.isOpened() ? c.left(new qe("Invoice is already opened")) : c.right(void 0),
1327
- c.chain(() => (a.set(!0), s("web_app_open_invoice", "invoice_closed", {
1325
+ this.isSupported = W("web_app_open_invoice", t), this.isOpened = w(a), this.openSlugFp = i((o, l) => p.pipe(
1326
+ this.isOpened() ? u.left(new Be("Invoice is already opened")) : u.right(void 0),
1327
+ u.chain(() => (a.set(!0), r("web_app_open_invoice", "invoice_closed", {
1328
1328
  ...l,
1329
1329
  params: { slug: o },
1330
1330
  capture: (_) => o === _.slug
1331
1331
  }))),
1332
- c.mapBoth((_) => (u(), _), (_) => (u(), _.status))
1332
+ u.mapBoth((_) => (c(), _), (_) => (c(), _.status))
1333
1333
  )), this.openUrlFp = i((o, l) => {
1334
1334
  const { hostname: _, pathname: F } = new URL(o, window.location.href);
1335
1335
  if (_ !== "t.me")
1336
- return c.left(new W(`Link has unexpected hostname: ${_}`));
1336
+ return u.left(new U(`Link has unexpected hostname: ${_}`));
1337
1337
  const f = F.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1338
- return f ? this.openSlugFp(f[2], l) : c.left(new W(
1338
+ return f ? this.openSlugFp(f[2], l) : u.left(new U(
1339
1339
  'Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'
1340
1340
  ));
1341
1341
  }), this.openUrl = /* @__PURE__ */ h(this.openUrlFp), this.openSlug = /* @__PURE__ */ h(this.openSlugFp);
1342
1342
  }
1343
1343
  }
1344
- function cs() {
1344
+ function ls() {
1345
1345
  return new us(p.pipe(S(), R, I));
1346
1346
  }
1347
- const tn = /* @__PURE__ */ cs();
1348
- function ls({ postEvent: r, ...t }) {
1349
- return A((s, n = {}) => {
1350
- if (typeof s == "string")
1347
+ const sn = /* @__PURE__ */ ls();
1348
+ function hs({ postEvent: n, ...t }) {
1349
+ return B((r, s = {}) => {
1350
+ if (typeof r == "string")
1351
1351
  try {
1352
- s = new URL(s);
1352
+ r = new URL(r);
1353
1353
  } catch (i) {
1354
- return b.left(new W(`"${s.toString()}" is invalid URL`, i));
1354
+ return b.left(new U(`"${r.toString()}" is invalid URL`, i));
1355
1355
  }
1356
- return r("web_app_open_link", {
1357
- url: s.toString(),
1358
- try_browser: n.tryBrowser,
1359
- try_instant_view: n.tryInstantView
1356
+ return n("web_app_open_link", {
1357
+ url: r.toString(),
1358
+ try_browser: s.tryBrowser,
1359
+ try_instant_view: s.tryInstantView
1360
1360
  });
1361
1361
  }, { ...t, returns: "either" });
1362
1362
  }
1363
1363
  // @__NO_SIDE_EFFECTS__
1364
- function hs() {
1365
- return ls(p.pipe(S(), V));
1364
+ function ds() {
1365
+ return hs(p.pipe(S(), V));
1366
1366
  }
1367
- const ds = /* @__PURE__ */ hs(), sn = /* @__PURE__ */ h(ds);
1368
- function fs({ postEvent: r, version: t, ...s }) {
1369
- return A((n) => {
1370
- const i = n.toString();
1371
- return i.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", $(t)) ? (n = new URL(n), r("web_app_open_tg_link", { path_full: n.pathname + n.search })) : (window.location.href = i, b.right(void 0)) : b.left(new W(`"${i}" is invalid URL`));
1372
- }, { ...s, returns: "either" });
1367
+ const fs = /* @__PURE__ */ ds(), rn = /* @__PURE__ */ h(fs);
1368
+ function _s({ postEvent: n, version: t, ...r }) {
1369
+ return B((s) => {
1370
+ const i = s.toString();
1371
+ return i.match(/^https:\/\/t.me\/.+/) ? ee("web_app_open_tg_link", $(t)) ? (s = new URL(s), n("web_app_open_tg_link", { path_full: s.pathname + s.search })) : (window.location.href = i, b.right(void 0)) : b.left(new U(`"${i}" is invalid URL`));
1372
+ }, { ...r, returns: "either" });
1373
1373
  }
1374
1374
  // @__NO_SIDE_EFFECTS__
1375
- function _s() {
1376
- return fs(p.pipe(
1375
+ function ms() {
1376
+ return _s(p.pipe(
1377
1377
  S(),
1378
1378
  V,
1379
1379
  I
1380
1380
  ));
1381
1381
  }
1382
- const et = /* @__PURE__ */ _s(), rn = /* @__PURE__ */ h(et);
1383
- function ms({ openVbotLink: r, ...t }) {
1384
- return A((s, n) => r(
1385
- "https://t.me/share/url?" + new URLSearchParams({ url: s, text: n || "" }).toString().replace(/\+/g, "%20")
1382
+ const tt = /* @__PURE__ */ ms(), nn = /* @__PURE__ */ h(tt);
1383
+ function bs({ openVbotLink: n, ...t }) {
1384
+ return B((r, s) => n(
1385
+ "https://t.me/share/url?" + new URLSearchParams({ url: r, text: s || "" }).toString().replace(/\+/g, "%20")
1386
1386
  ), { ...t, returns: "either" });
1387
1387
  }
1388
1388
  // @__NO_SIDE_EFFECTS__
1389
- function bs() {
1390
- return ms({
1389
+ function gs() {
1390
+ return bs({
1391
1391
  ...S(),
1392
- openVbotLink: et
1392
+ openVbotLink: tt
1393
1393
  });
1394
1394
  }
1395
- const gs = /* @__PURE__ */ bs(), nn = /* @__PURE__ */ h(gs);
1396
- function Fs(r) {
1397
- let t = !1, s, n;
1398
- return r.available && (t = !0, s = r.access_requested, n = r.access_granted), {
1395
+ const Fs = /* @__PURE__ */ gs(), on = /* @__PURE__ */ h(Fs);
1396
+ function ws(n) {
1397
+ let t = !1, r, s;
1398
+ return n.available && (t = !0, r = n.access_requested, s = n.access_granted), {
1399
1399
  available: t,
1400
- accessGranted: n || !1,
1401
- accessRequested: s || !1
1400
+ accessGranted: s || !1,
1401
+ accessRequested: r || !1
1402
1402
  };
1403
1403
  }
1404
- class ws {
1404
+ class Cs {
1405
1405
  constructor({
1406
1406
  version: t,
1407
- request: s,
1408
- postEvent: n,
1407
+ request: r,
1408
+ postEvent: s,
1409
1409
  storage: i,
1410
1410
  isTma: a,
1411
- isPageReload: u
1411
+ isPageReload: c
1412
1412
  }) {
1413
1413
  /**
1414
1414
  * Complete location manager state.
@@ -1477,14 +1477,14 @@ class ws {
1477
1477
  accessRequested: !1
1478
1478
  },
1479
1479
  onChange: i.set
1480
- }), l = new Be({
1481
- isPageReload: u,
1480
+ }), l = new xe({
1481
+ isPageReload: c,
1482
1482
  restoreState: i.get,
1483
1483
  onMounted: o.setState,
1484
1484
  initialState(C) {
1485
1485
  return p.pipe(
1486
- s("web_app_check_location", "location_checked", C),
1487
- c.map(Fs)
1486
+ r("web_app_check_location", "location_checked", C),
1487
+ u.map(ws)
1488
1488
  );
1489
1489
  }
1490
1490
  }), _ = { version: t, requires: "web_app_check_location", isTma: a }, F = E({
@@ -1498,9 +1498,9 @@ class ws {
1498
1498
  returns: "task",
1499
1499
  isMounted: l.isMounted
1500
1500
  });
1501
- this.isAvailable = o.getter("available"), this.isAccessRequested = o.getter("accessRequested"), this.isAccessGranted = o.getter("accessGranted"), this.isSupported = H("web_app_check_location", t), this.isMounted = l.isMounted, this.state = o.state, this.unmount = l.unmount, this.mountFp = f(l.mount), this.openSettingsFp = F(() => n("web_app_open_location_settings")), this.requestLocationFp = v((C) => p.pipe(
1502
- s("web_app_request_location", "location_requested", C),
1503
- c.map((k) => {
1501
+ this.isAvailable = o.getter("available"), this.isAccessRequested = o.getter("accessRequested"), this.isAccessGranted = o.getter("accessGranted"), this.isSupported = W("web_app_check_location", t), this.isMounted = l.isMounted, this.state = o.state, this.unmount = l.unmount, this.mountFp = f(l.mount), this.openSettingsFp = F(() => s("web_app_open_location_settings")), this.requestLocationFp = v((C) => p.pipe(
1502
+ r("web_app_request_location", "location_requested", C),
1503
+ u.map((k) => {
1504
1504
  if (!k.available)
1505
1505
  return o.setState({ available: !1 }), null;
1506
1506
  const { available: y, ...m } = k;
@@ -1509,8 +1509,8 @@ class ws {
1509
1509
  )), this.mount = /* @__PURE__ */ h(this.mountFp), this.openSettings = /* @__PURE__ */ h(this.openSettingsFp), this.requestLocation = /* @__PURE__ */ h(this.requestLocationFp);
1510
1510
  }
1511
1511
  }
1512
- function Cs() {
1513
- return new ws(p.pipe(
1512
+ function Ss() {
1513
+ return new Cs(p.pipe(
1514
1514
  S(),
1515
1515
  V,
1516
1516
  I,
@@ -1518,9 +1518,9 @@ function Cs() {
1518
1518
  Y("locationManager")
1519
1519
  ));
1520
1520
  }
1521
- const on = /* @__PURE__ */ Cs();
1522
- class Ss {
1523
- constructor({ defaults: t, ...s }) {
1521
+ const an = /* @__PURE__ */ Ss();
1522
+ class vs {
1523
+ constructor({ defaults: t, ...r }) {
1524
1524
  //#region Properties.
1525
1525
  /**
1526
1526
  * The button background color.
@@ -1708,8 +1708,8 @@ class Ss {
1708
1708
  * @see offClickFp
1709
1709
  */
1710
1710
  e(this, "offClick");
1711
- const n = new de({
1712
- ...s,
1711
+ const s = new fe({
1712
+ ...r,
1713
1713
  version: "100",
1714
1714
  initialState: {
1715
1715
  hasShineEffect: !1,
@@ -1728,49 +1728,49 @@ class Ss {
1728
1728
  color: a.bgColor,
1729
1729
  text_color: a.textColor
1730
1730
  })
1731
- }), i = (a, u) => {
1732
- const o = n.stateGetter(a);
1733
- return w(() => o() || $(u));
1731
+ }), i = (a, c) => {
1732
+ const o = s.stateGetter(a);
1733
+ return w(() => o() || $(c));
1734
1734
  };
1735
- this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.hasShineEffect = n.stateGetter("hasShineEffect"), this.isEnabled = n.stateGetter("isEnabled"), this.isLoaderVisible = n.stateGetter("isLoaderVisible"), this.text = n.stateGetter("text"), this.isVisible = n.stateGetter("isVisible"), this.isMounted = n.isMounted, this.state = n.state, [this.setBgColor, this.setBgColorFp] = n.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = n.stateSetters("textColor"), [
1735
+ this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.hasShineEffect = s.stateGetter("hasShineEffect"), this.isEnabled = s.stateGetter("isEnabled"), this.isLoaderVisible = s.stateGetter("isLoaderVisible"), this.text = s.stateGetter("text"), this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.state = s.state, [this.setBgColor, this.setBgColorFp] = s.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = s.stateSetters("textColor"), [
1736
1736
  [this.disableShineEffect, this.disableShineEffectFp],
1737
1737
  [this.enableShineEffect, this.enableShineEffectFp]
1738
- ] = n.stateBoolSetters("hasShineEffect"), [
1738
+ ] = s.stateBoolSetters("hasShineEffect"), [
1739
1739
  [this.disable, this.disableFp],
1740
1740
  [this.enable, this.enableFp]
1741
- ] = n.stateBoolSetters("isEnabled"), [
1741
+ ] = s.stateBoolSetters("isEnabled"), [
1742
1742
  [this.hideLoader, this.hideLoaderFp],
1743
1743
  [this.showLoader, this.showLoaderFp]
1744
- ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, this.onClick = n.onClick, this.onClickFp = n.onClickFp, this.offClick = n.offClick, this.offClickFp = n.offClickFp, this.mount = n.mount, this.mountFp = n.mountFp, this.unmount = n.unmount;
1744
+ ] = s.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = s.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.setParams = s.setState, this.setParamsFp = s.setStateFp, this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
1745
1745
  }
1746
1746
  //#endregion
1747
1747
  }
1748
- function Ve(r, t) {
1749
- document.documentElement.style.setProperty(r, t);
1748
+ function Te(n, t) {
1749
+ document.documentElement.style.setProperty(n, t);
1750
1750
  }
1751
- function Te(r) {
1752
- document.documentElement.style.removeProperty(r);
1751
+ function Re(n) {
1752
+ document.documentElement.style.removeProperty(n);
1753
1753
  }
1754
- function vs(r) {
1754
+ function ks(n) {
1755
1755
  return p.pipe(
1756
- bt(r),
1756
+ gt(n),
1757
1757
  b.map((t) => Math.sqrt(
1758
- [0.299, 0.587, 0.114].reduce((s, n, i) => {
1758
+ [0.299, 0.587, 0.114].reduce((r, s, i) => {
1759
1759
  const a = parseInt(t.slice(1 + i * 2, 1 + (i + 1) * 2), 16);
1760
- return s + a * a * n;
1760
+ return r + a * a * s;
1761
1761
  }, 0)
1762
1762
  ) < 120)
1763
1763
  );
1764
1764
  }
1765
- const tt = he(vs);
1766
- class ks {
1765
+ const st = de(ks);
1766
+ class ys {
1767
1767
  constructor({
1768
1768
  initialState: t,
1769
- onChange: s,
1770
- offChange: n,
1769
+ onChange: r,
1770
+ offChange: s,
1771
1771
  isTma: i,
1772
1772
  storage: a,
1773
- isPageReload: u
1773
+ isPageReload: c
1774
1774
  }) {
1775
1775
  //#region Colors.
1776
1776
  /**
@@ -1852,7 +1852,7 @@ class ks {
1852
1852
  */
1853
1853
  e(this, "isDark", w(() => {
1854
1854
  const t = this.bgColor();
1855
- return !t || tt(t);
1855
+ return !t || st(t);
1856
1856
  }));
1857
1857
  //#endregion
1858
1858
  //#region Mounting.
@@ -1877,14 +1877,14 @@ class ks {
1877
1877
  onChange: a.set
1878
1878
  }), l = (C) => {
1879
1879
  o.setState(C.theme_params);
1880
- }, _ = new ne({
1880
+ }, _ = new ie({
1881
1881
  initialState: () => b.right($(t)),
1882
- isPageReload: u,
1882
+ isPageReload: c,
1883
1883
  onMounted(C) {
1884
- o.setState(C), s(l);
1884
+ o.setState(C), r(l);
1885
1885
  },
1886
1886
  onUnmounted() {
1887
- n(l);
1887
+ s(l);
1888
1888
  },
1889
1889
  restoreState: a.get
1890
1890
  }), F = { isTma: i, returns: "either" }, f = E(F), v = E({
@@ -1893,62 +1893,62 @@ class ks {
1893
1893
  });
1894
1894
  this.accentTextColor = o.getter("accent_text_color"), this.bgColor = o.getter("bg_color"), this.buttonColor = o.getter("button_color"), this.buttonTextColor = o.getter("button_text_color"), this.bottomBarBgColor = o.getter("bottom_bar_bg_color"), this.destructiveTextColor = o.getter("destructive_text_color"), this.headerBgColor = o.getter("header_bg_color"), this.hintColor = o.getter("hint_color"), this.linkColor = o.getter("link_color"), this.secondaryBgColor = o.getter("secondary_bg_color"), this.sectionBgColor = o.getter("section_bg_color"), this.sectionHeaderTextColor = o.getter("section_header_text_color"), this.sectionSeparatorColor = o.getter("section_separator_color"), this.subtitleTextColor = o.getter("subtitle_text_color"), this.textColor = o.getter("text_color"), this.state = o.state, this.isMounted = _.isMounted, this.bindCssVarsFp = v((C) => {
1895
1895
  if (this._isCssVarsBound())
1896
- return b.left(new Ee());
1897
- C || (C = (m) => `--tg-theme-${mt(m)}`);
1896
+ return b.left(new qe());
1897
+ C || (C = (m) => `--tg-theme-${bt(m)}`);
1898
1898
  const k = (m) => {
1899
1899
  Object.entries(o.state()).forEach(([g, d]) => {
1900
1900
  d && m(g, d);
1901
1901
  });
1902
1902
  }, y = () => {
1903
1903
  k((m, g) => {
1904
- Ve(C(m), g);
1904
+ Te(C(m), g);
1905
1905
  });
1906
1906
  };
1907
1907
  return y(), o.state.sub(y), this._isCssVarsBound.set(!0), b.right(() => {
1908
- k(Te), o.state.unsub(y), this._isCssVarsBound.set(!1);
1908
+ k(Re), o.state.unsub(y), this._isCssVarsBound.set(!1);
1909
1909
  });
1910
1910
  }), this.mountFp = f(_.mount), this.unmount = _.unmount, this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.mount = /* @__PURE__ */ h(this.mountFp);
1911
1911
  }
1912
1912
  //#endregion
1913
1913
  }
1914
- const Se = /* @__PURE__ */ ie({});
1915
- function ys() {
1916
- return new ks({
1914
+ const ve = /* @__PURE__ */ oe({});
1915
+ function Is() {
1916
+ return new ys({
1917
1917
  ...p.pipe(
1918
1918
  S(),
1919
1919
  Y("themeParams")
1920
1920
  ),
1921
- offChange(r) {
1922
- re("theme_changed", r);
1921
+ offChange(n) {
1922
+ ne("theme_changed", n);
1923
1923
  },
1924
- onChange(r) {
1925
- G("theme_changed", r);
1924
+ onChange(n) {
1925
+ G("theme_changed", n);
1926
1926
  },
1927
- initialState: Se
1927
+ initialState: ve
1928
1928
  });
1929
1929
  }
1930
- const le = /* @__PURE__ */ ys();
1930
+ const he = /* @__PURE__ */ Is();
1931
1931
  // @__NO_SIDE_EFFECTS__
1932
- function st(r, t, s) {
1932
+ function rt(n, t, r) {
1933
1933
  return p.pipe(
1934
- /* @__PURE__ */ Ae(r, t),
1935
- (n) => ({ ...n, defaults: s })
1934
+ /* @__PURE__ */ Ae(n, t),
1935
+ (s) => ({ ...s, defaults: r })
1936
1936
  );
1937
1937
  }
1938
- const an = /* @__PURE__ */ new Ss(
1939
- /* @__PURE__ */ st("mainButton", "main_button_pressed", {
1940
- bgColor: w(() => le.buttonColor() || "#2481cc"),
1941
- textColor: w(() => le.buttonTextColor() || "#ffffff")
1938
+ const pn = /* @__PURE__ */ new vs(
1939
+ /* @__PURE__ */ rt("mainButton", "main_button_pressed", {
1940
+ bgColor: w(() => he.buttonColor() || "#2481cc"),
1941
+ textColor: w(() => he.buttonTextColor() || "#ffffff")
1942
1942
  })
1943
1943
  );
1944
- class Is {
1944
+ class Es {
1945
1945
  constructor({
1946
1946
  storage: t,
1947
- isPageReload: s,
1948
- version: n,
1947
+ isPageReload: r,
1948
+ version: s,
1949
1949
  postEvent: i,
1950
1950
  isTma: a,
1951
- theme: u,
1951
+ theme: c,
1952
1952
  onVisibilityChanged: o,
1953
1953
  offVisibilityChanged: l
1954
1954
  }) {
@@ -1962,7 +1962,7 @@ class Is {
1962
1962
  */
1963
1963
  e(this, "isDark", w(() => {
1964
1964
  const t = this.bgColorRgb();
1965
- return t ? tt(t) : !1;
1965
+ return t ? st(t) : !1;
1966
1966
  }));
1967
1967
  /**
1968
1968
  * Signal indicating if the mini app is currently active.
@@ -2127,14 +2127,14 @@ class Is {
2127
2127
  [this.headerColor, "web_app_set_header_color"],
2128
2128
  [this.bgColor, "web_app_set_background_color"],
2129
2129
  [this.bottomBarColor, "web_app_set_bottom_bar_color"]
2130
- ].forEach(([B, T]) => {
2131
- const M = B();
2132
- if (!fe(M) && (T !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(M))) {
2130
+ ].forEach(([A, T]) => {
2131
+ const M = A();
2132
+ if (!_e(M) && (T !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(M))) {
2133
2133
  const P = d[M];
2134
2134
  P && i(T, { color: P });
2135
2135
  }
2136
2136
  });
2137
- }, f = new ne({
2137
+ }, f = new ie({
2138
2138
  initialState() {
2139
2139
  return b.right({
2140
2140
  bgColor: "bg_color",
@@ -2143,16 +2143,16 @@ class Is {
2143
2143
  isActive: !0
2144
2144
  });
2145
2145
  },
2146
- isPageReload: s,
2146
+ isPageReload: r,
2147
2147
  onMounted: (d) => {
2148
- o(_), u.sub(F), v.setState(d);
2148
+ o(_), c.sub(F), v.setState(d);
2149
2149
  },
2150
2150
  onUnmounted() {
2151
- l(_), u.unsub(F);
2151
+ l(_), c.unsub(F);
2152
2152
  },
2153
2153
  restoreState: t.get
2154
2154
  });
2155
- this.isMounted = f.isMounted, this.mountFp = A(() => {
2155
+ this.isMounted = f.isMounted, this.mountFp = B(() => {
2156
2156
  const d = () => {
2157
2157
  };
2158
2158
  return p.pipe(f.mount(), b.match(d, d));
@@ -2167,34 +2167,34 @@ class Is {
2167
2167
  onChange: t.set
2168
2168
  });
2169
2169
  this.state = v.state;
2170
- const C = (d) => fe(d) ? d : $(u)[d], k = (d) => w(() => C(d()));
2170
+ const C = (d) => _e(d) ? d : $(c)[d], k = (d) => w(() => C(d()));
2171
2171
  this.isActive = v.getter("isActive"), this.isSupported = w(() => [
2172
2172
  "web_app_set_header_color",
2173
2173
  "web_app_set_background_color",
2174
2174
  "web_app_set_bottom_bar_color"
2175
- ].some((d) => ee(d, $(n))));
2175
+ ].some((d) => ee(d, $(s))));
2176
2176
  const y = O(!1);
2177
- this.isCssVarsBound = w(y), this.bindCssVarsFp = A((d) => {
2177
+ this.isCssVarsBound = w(y), this.bindCssVarsFp = B((d) => {
2178
2178
  if (y())
2179
- return b.left(new Ee());
2180
- const [B, T] = ye(() => {
2179
+ return b.left(new qe());
2180
+ const [A, T] = Ie(() => {
2181
2181
  y.set(!1);
2182
2182
  }), M = (P, L) => {
2183
- const U = () => {
2184
- Ve(P, L() || null);
2183
+ const j = () => {
2184
+ Te(P, L() || null);
2185
2185
  };
2186
- U(), B(L.sub(U), Te.bind(null, P));
2186
+ j(), A(L.sub(j), Re.bind(null, P));
2187
2187
  };
2188
2188
  return d || (d = (P) => `--tg-${We(P)}`), M(d("bgColor"), this.bgColorRgb), M(d("bottomBarColor"), this.bottomBarColorRgb), M(d("headerColor"), this.headerColorRgb), y.set(!0), b.right(T);
2189
2189
  }, { isTma: a, returns: "either", isMounted: this.isMounted }), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp);
2190
2190
  const m = (d) => {
2191
- const B = v.getter(d), T = k(B), M = {
2191
+ const A = v.getter(d), T = k(A), M = {
2192
2192
  headerColor: "web_app_set_header_color",
2193
2193
  bgColor: "web_app_set_background_color",
2194
2194
  bottomBarColor: "web_app_set_bottom_bar_color"
2195
- }[d], P = A(
2195
+ }[d], P = B(
2196
2196
  (L) => {
2197
- if (L === B())
2197
+ if (L === A())
2198
2198
  return b.right(void 0);
2199
2199
  if (M === "web_app_set_header_color" && (L === "bg_color" || L === "secondary_bg_color"))
2200
2200
  return p.pipe(
@@ -2203,9 +2203,9 @@ class Is {
2203
2203
  v.setState({ [d]: L });
2204
2204
  })
2205
2205
  );
2206
- const U = C(L);
2206
+ const j = C(L);
2207
2207
  return p.pipe(
2208
- U ? i(M, { color: U }) : b.left(new xt(L)),
2208
+ j ? i(M, { color: j }) : b.left(new Mt(L)),
2209
2209
  b.map(() => {
2210
2210
  v.setState({ [d]: L });
2211
2211
  })
@@ -2213,7 +2213,7 @@ class Is {
2213
2213
  },
2214
2214
  {
2215
2215
  isTma: a,
2216
- version: n,
2216
+ version: s,
2217
2217
  requires: M,
2218
2218
  isMounted: this.isMounted,
2219
2219
  returns: "either",
@@ -2221,12 +2221,12 @@ class Is {
2221
2221
  rgb: {
2222
2222
  method: "web_app_set_header_color",
2223
2223
  param: "color",
2224
- shouldCheck: fe
2224
+ shouldCheck: _e
2225
2225
  }
2226
2226
  } : void 0
2227
2227
  }
2228
2228
  );
2229
- return [B, T, /* @__PURE__ */ h(P), P];
2229
+ return [A, T, /* @__PURE__ */ h(P), P];
2230
2230
  };
2231
2231
  [
2232
2232
  this.bgColor,
@@ -2249,29 +2249,29 @@ class Is {
2249
2249
  }
2250
2250
  //#endregion
2251
2251
  }
2252
- function Es() {
2253
- return new Is({
2252
+ function qs() {
2253
+ return new Es({
2254
2254
  ...p.pipe(
2255
2255
  S(),
2256
2256
  V,
2257
2257
  I,
2258
2258
  Y("miniApp")
2259
2259
  ),
2260
- offVisibilityChanged(r) {
2261
- re("visibility_changed", r);
2260
+ offVisibilityChanged(n) {
2261
+ ne("visibility_changed", n);
2262
2262
  },
2263
- onVisibilityChanged(r) {
2264
- G("visibility_changed", r);
2263
+ onVisibilityChanged(n) {
2264
+ G("visibility_changed", n);
2265
2265
  },
2266
- theme: le.state
2266
+ theme: he.state
2267
2267
  });
2268
2268
  }
2269
- const qs = /* @__PURE__ */ Es();
2269
+ const Bs = /* @__PURE__ */ qs();
2270
2270
  function As() {
2271
- const r = Date.now(), t = Math.random().toString(36).substring(2, 9);
2272
- return `notif_${r}_${t}`;
2271
+ const n = Date.now(), t = Math.random().toString(36).substring(2, 9);
2272
+ return `notif_${n}_${t}`;
2273
2273
  }
2274
- class Bs {
2274
+ class xs {
2275
2275
  constructor({}) {
2276
2276
  /**
2277
2277
  * Sends a notification to the native app.
@@ -2284,55 +2284,55 @@ class Bs {
2284
2284
  */
2285
2285
  e(this, "send");
2286
2286
  this.sendFp = (t) => p.pipe(
2287
- c.fromEither(
2288
- ke("web_app_send_notification", {
2287
+ u.fromEither(
2288
+ ye("web_app_send_notification", {
2289
2289
  id: As(),
2290
2290
  message: t.message,
2291
2291
  title: t.title,
2292
2292
  type: t.type ?? "default"
2293
2293
  })
2294
2294
  ),
2295
- c.map(() => {
2295
+ u.map(() => {
2296
2296
  })
2297
- ), this.send = (t) => this.sendFp(t)().then((n) => {
2298
- if (n._tag === "Left")
2299
- throw n.left;
2300
- return n.right;
2297
+ ), this.send = (t) => this.sendFp(t)().then((s) => {
2298
+ if (s._tag === "Left")
2299
+ throw s.left;
2300
+ return s.right;
2301
2301
  });
2302
2302
  }
2303
2303
  }
2304
- function xs() {
2305
- return new Bs(p.pipe(S()));
2304
+ function Ms() {
2305
+ return new xs(p.pipe(S()));
2306
2306
  }
2307
- const pn = /* @__PURE__ */ xs();
2308
- function Ms(r) {
2309
- const t = r.message.trim(), s = (r.title || "").trim(), n = r.buttons || [];
2310
- if (s.length > 64)
2311
- return b.left(new W(`Invalid title: ${s}`));
2307
+ const cn = /* @__PURE__ */ Ms();
2308
+ function Vs(n) {
2309
+ const t = n.message.trim(), r = (n.title || "").trim(), s = n.buttons || [];
2310
+ if (r.length > 64)
2311
+ return b.left(new U(`Invalid title: ${r}`));
2312
2312
  if (!t || t.length > 256)
2313
- return b.left(new W(`Invalid message: ${t}`));
2314
- if (n.length > 3)
2315
- return b.left(new W(`Invalid buttons count: ${n.length}`));
2313
+ return b.left(new U(`Invalid message: ${t}`));
2314
+ if (s.length > 3)
2315
+ return b.left(new U(`Invalid buttons count: ${s.length}`));
2316
2316
  const i = [];
2317
- if (!n.length)
2317
+ if (!s.length)
2318
2318
  i.push({ type: "close", id: "" });
2319
2319
  else
2320
- for (let a = 0; a < n.length; a++) {
2321
- const u = n[a], o = u.id || "";
2320
+ for (let a = 0; a < s.length; a++) {
2321
+ const c = s[a], o = c.id || "";
2322
2322
  if (o.length > 64)
2323
- return b.left(new W(`Button with index ${a} has invalid id: ${o}`));
2324
- if (!u.type || u.type === "default" || u.type === "destructive") {
2325
- const l = u.text.trim();
2323
+ return b.left(new U(`Button with index ${a} has invalid id: ${o}`));
2324
+ if (!c.type || c.type === "default" || c.type === "destructive") {
2325
+ const l = c.text.trim();
2326
2326
  if (!l || l.length > 64)
2327
- return b.left(new W(`Button with index ${a} has invalid text: ${l}`));
2328
- i.push({ type: u.type, text: l, id: o });
2327
+ return b.left(new U(`Button with index ${a} has invalid text: ${l}`));
2328
+ i.push({ type: c.type, text: l, id: o });
2329
2329
  } else
2330
- i.push({ type: u.type, id: o });
2330
+ i.push({ type: c.type, id: o });
2331
2331
  }
2332
- return b.right({ title: s, message: t, buttons: i });
2332
+ return b.right({ title: r, message: t, buttons: i });
2333
2333
  }
2334
- class Vs {
2335
- constructor({ version: t, isTma: s, request: n }) {
2334
+ class Ts {
2335
+ constructor({ version: t, isTma: r, request: s }) {
2336
2336
  /**
2337
2337
  * Signal indicating if any popup is currently opened.
2338
2338
  */
@@ -2373,92 +2373,92 @@ class Vs {
2373
2373
  e(this, "show");
2374
2374
  const i = O(!1), a = () => {
2375
2375
  i.set(!1);
2376
- }, u = E({
2376
+ }, c = E({
2377
2377
  version: t,
2378
- isTma: s,
2378
+ isTma: r,
2379
2379
  requires: "web_app_open_popup",
2380
2380
  returns: "task"
2381
2381
  });
2382
- this.isSupported = H("web_app_open_popup", t), this.isOpened = w(i), this.showFp = u((o) => p.pipe(
2383
- this.isOpened() ? c.left(new qe("A popup is already opened")) : c.right(void 0),
2384
- c.chainW(() => c.fromEither(Ms(o))),
2385
- c.chain((l) => (i.set(!0), n("web_app_open_popup", "popup_closed", {
2382
+ this.isSupported = W("web_app_open_popup", t), this.isOpened = w(i), this.showFp = c((o) => p.pipe(
2383
+ this.isOpened() ? u.left(new Be("A popup is already opened")) : u.right(void 0),
2384
+ u.chainW(() => u.fromEither(Vs(o))),
2385
+ u.chain((l) => (i.set(!0), s("web_app_open_popup", "popup_closed", {
2386
2386
  ...o,
2387
2387
  params: l
2388
2388
  }))),
2389
- c.mapBoth(
2389
+ u.mapBoth(
2390
2390
  (l) => (a(), l),
2391
2391
  (l) => (a(), l.button_id)
2392
2392
  )
2393
2393
  )), this.show = /* @__PURE__ */ h(this.showFp);
2394
2394
  }
2395
2395
  }
2396
- function Ts() {
2397
- return new Vs(p.pipe(S(), R, I));
2396
+ function Rs() {
2397
+ return new Ts(p.pipe(S(), R, I));
2398
2398
  }
2399
- const un = /* @__PURE__ */ Ts();
2400
- function Rs({ request: r, ...t }) {
2401
- return A((s) => p.pipe(
2402
- r("web_app_request_phone", "phone_requested", s),
2403
- c.map((n) => n.status)
2399
+ const un = /* @__PURE__ */ Rs();
2400
+ function Ls({ request: n, ...t }) {
2401
+ return B((r) => p.pipe(
2402
+ n("web_app_request_phone", "phone_requested", r),
2403
+ u.map((s) => s.status)
2404
2404
  ), { ...t, requires: "web_app_request_phone", returns: "task" });
2405
2405
  }
2406
2406
  // @__NO_SIDE_EFFECTS__
2407
- function Ls() {
2408
- return Rs(p.pipe(
2407
+ function $s() {
2408
+ return Ls(p.pipe(
2409
2409
  S(),
2410
2410
  I,
2411
2411
  R
2412
2412
  ));
2413
2413
  }
2414
- const rt = /* @__PURE__ */ Ls(), cn = /* @__PURE__ */ h(rt);
2415
- function $s({
2416
- invokeCustomMethod: r,
2414
+ const nt = /* @__PURE__ */ $s(), ln = /* @__PURE__ */ h(nt);
2415
+ function Ps({
2416
+ invokeCustomMethod: n,
2417
2417
  requestPhoneAccess: t,
2418
- ...s
2418
+ ...r
2419
2419
  }) {
2420
- const n = (u) => p.pipe(
2421
- r("getRequestedContact", {}, {
2422
- ...u,
2423
- timeout: (u || {}).timeout || 5e3
2420
+ const s = (c) => p.pipe(
2421
+ n("getRequestedContact", {}, {
2422
+ ...c,
2423
+ timeout: (c || {}).timeout || 5e3
2424
2424
  }),
2425
- c.chainW((o) => {
2426
- const l = Fe(K(), o);
2425
+ u.chainW((o) => {
2426
+ const l = we(K(), o);
2427
2427
  if (!l.success)
2428
- return c.left(new pe(o, l.issues));
2428
+ return u.left(new ce(o, l.issues));
2429
2429
  if (!l.output)
2430
- return c.right(void 0);
2431
- const _ = Fe(
2432
- gt(
2433
- De({
2434
- contact: Ft(De({
2435
- user_id: Qe(),
2430
+ return u.right(void 0);
2431
+ const _ = we(
2432
+ Ft(
2433
+ Ge({
2434
+ contact: wt(Ge({
2435
+ user_id: Je(),
2436
2436
  phone_number: K(),
2437
2437
  first_name: K(),
2438
- last_name: St(K())
2438
+ last_name: vt(K())
2439
2439
  })),
2440
- auth_date: ze(
2440
+ auth_date: Ke(
2441
2441
  K(),
2442
- Ke((F) => new Date(Number(F) * 1e3)),
2443
- Ne()
2442
+ Ne((F) => new Date(Number(F) * 1e3)),
2443
+ Qe()
2444
2444
  ),
2445
2445
  hash: K()
2446
2446
  })
2447
2447
  ),
2448
2448
  l.output
2449
2449
  );
2450
- return _.success ? c.right({ raw: l.output, parsed: _.output }) : c.left(new pe(l.output, _.issues));
2450
+ return _.success ? u.right({ raw: l.output, parsed: _.output }) : u.left(new ce(l.output, _.issues));
2451
2451
  })
2452
- ), i = (u) => p.pipe(
2453
- n(u),
2454
- c.match(
2452
+ ), i = (c) => p.pipe(
2453
+ s(c),
2454
+ u.match(
2455
2455
  // All other errors except validation ones should be ignored. Receiving validation error
2456
2456
  // means that we have some data, but we are unable to parse it properly. So, there is no
2457
2457
  // need to make some more requests further, the problem is local.
2458
- (o) => pe.is(o) ? b.left(o) : b.right(void 0),
2458
+ (o) => ce.is(o) ? b.left(o) : b.right(void 0),
2459
2459
  (o) => b.right(o)
2460
2460
  )
2461
- ), a = (u) => ge(
2461
+ ), a = (c) => Fe(
2462
2462
  async (o, l, _) => {
2463
2463
  let F = 50;
2464
2464
  for (; !_.isRejected; ) {
@@ -2470,47 +2470,47 @@ function $s({
2470
2470
  await new Promise((v) => setTimeout(v, F)), F += 50;
2471
2471
  }
2472
2472
  },
2473
- u
2473
+ c
2474
2474
  );
2475
- return A((u) => ge.fn((o) => p.pipe(
2475
+ return B((c) => Fe.fn((o) => p.pipe(
2476
2476
  // Try to get the requested contact. Probably, we already requested it before.
2477
2477
  i(o),
2478
- c.chain((l) => l ? c.right(l) : p.pipe(
2478
+ u.chain((l) => l ? u.right(l) : p.pipe(
2479
2479
  t(o),
2480
- c.chainW((_) => _ === "sent" ? a(o) : c.left(new Je("User denied access")))
2480
+ u.chainW((_) => _ === "sent" ? a(o) : u.left(new Ye("User denied access")))
2481
2481
  ))
2482
- ), u), { ...s, returns: "task", requires: "web_app_request_phone" });
2482
+ ), c), { ...r, returns: "task", requires: "web_app_request_phone" });
2483
2483
  }
2484
2484
  // @__NO_SIDE_EFFECTS__
2485
- function Ps() {
2486
- return $s({
2487
- ...p.pipe(S(), Me, I),
2488
- requestPhoneAccess: rt
2485
+ function Os() {
2486
+ return Ps({
2487
+ ...p.pipe(S(), Ve, I),
2488
+ requestPhoneAccess: nt
2489
2489
  });
2490
2490
  }
2491
- function Os({ requestContact: r, ...t }) {
2492
- return A(
2493
- r,
2491
+ function Ds({ requestContact: n, ...t }) {
2492
+ return B(
2493
+ n,
2494
2494
  { ...t, returns: "task", requires: "web_app_request_phone" }
2495
2495
  );
2496
2496
  }
2497
2497
  // @__NO_SIDE_EFFECTS__
2498
- function Ds() {
2499
- return Os({
2498
+ function Gs() {
2499
+ return Ds({
2500
2500
  ...p.pipe(S(), I),
2501
- requestContact(r) {
2501
+ requestContact(n) {
2502
2502
  return p.pipe(
2503
- nt(r),
2504
- c.map((t) => t.parsed)
2503
+ it(n),
2504
+ u.map((t) => t.parsed)
2505
2505
  );
2506
2506
  }
2507
2507
  });
2508
2508
  }
2509
- const nt = /* @__PURE__ */ Ps(), ln = /* @__PURE__ */ h(nt), Gs = /* @__PURE__ */ Ds(), hn = /* @__PURE__ */ h(Gs);
2510
- function js({ request: r, ...t }) {
2511
- return A((s) => p.pipe(
2512
- r("web_app_request_write_access", "write_access_requested", s),
2513
- c.map((n) => n.status)
2509
+ const it = /* @__PURE__ */ Os(), hn = /* @__PURE__ */ h(it), Hs = /* @__PURE__ */ Gs(), dn = /* @__PURE__ */ h(Hs);
2510
+ function js({ request: n, ...t }) {
2511
+ return B((r) => p.pipe(
2512
+ n("web_app_request_write_access", "write_access_requested", r),
2513
+ u.map((s) => s.status)
2514
2514
  ), { ...t, requires: "web_app_request_write_access", returns: "task" });
2515
2515
  }
2516
2516
  // @__NO_SIDE_EFFECTS__
@@ -2521,12 +2521,12 @@ function Us() {
2521
2521
  R
2522
2522
  ));
2523
2523
  }
2524
- const Ws = /* @__PURE__ */ Us(), dn = /* @__PURE__ */ h(Ws);
2525
- class Hs {
2524
+ const Ws = /* @__PURE__ */ Us(), fn = /* @__PURE__ */ h(Ws);
2525
+ class zs {
2526
2526
  constructor({
2527
2527
  version: t,
2528
- onClosed: s,
2529
- onTextReceived: n,
2528
+ onClosed: r,
2529
+ onTextReceived: s,
2530
2530
  isTma: i,
2531
2531
  postEvent: a
2532
2532
  }) {
@@ -2609,10 +2609,10 @@ class Hs {
2609
2609
  * @see openFp
2610
2610
  */
2611
2611
  e(this, "open");
2612
- const u = { version: t, requires: "web_app_open_scan_qr_popup", isTma: i }, o = E({ ...u, returns: "either" }), l = E({ ...u, returns: "task" }), _ = O(!1), F = () => {
2612
+ const c = { version: t, requires: "web_app_open_scan_qr_popup", isTma: i }, o = E({ ...c, returns: "either" }), l = E({ ...c, returns: "task" }), _ = O(!1), F = () => {
2613
2613
  _.set(!1);
2614
2614
  };
2615
- this.isSupported = H("web_app_open_scan_qr_popup", t), this.isOpened = w(_), this.captureFp = l((f) => {
2615
+ this.isSupported = W("web_app_open_scan_qr_popup", t), this.isOpened = w(_), this.captureFp = l((f) => {
2616
2616
  let v;
2617
2617
  return p.pipe(
2618
2618
  this.openFp({
@@ -2621,46 +2621,46 @@ class Hs {
2621
2621
  f.capture(C) && (v = C, this.close());
2622
2622
  }
2623
2623
  }),
2624
- c.map(() => v)
2624
+ u.map(() => v)
2625
2625
  );
2626
2626
  }), this.closeFp = o(() => p.pipe(a("web_app_close_scan_qr_popup"), b.map(F))), this.openFp = l((f) => p.pipe(
2627
- _() ? c.left(new qe("The QR Scanner is already opened")) : async () => a("web_app_open_scan_qr_popup", { text: f.text }),
2628
- c.chainW(() => {
2627
+ _() ? u.left(new Be("The QR Scanner is already opened")) : async () => a("web_app_open_scan_qr_popup", { text: f.text }),
2628
+ u.chainW(() => {
2629
2629
  _.set(!0);
2630
- const [v, C] = ye(), k = (y) => (C(), _.set(!1), y);
2630
+ const [v, C] = Ie(), k = (y) => (C(), _.set(!1), y);
2631
2631
  return p.pipe(
2632
- ge((y) => {
2632
+ Fe((y) => {
2633
2633
  v(
2634
2634
  // The scanner was closed externally.
2635
- s(y),
2635
+ r(y),
2636
2636
  // The scanner was closed internally.
2637
2637
  _.sub((m) => {
2638
2638
  m || y();
2639
2639
  }),
2640
- n(f.onCaptured)
2640
+ s(f.onCaptured)
2641
2641
  );
2642
2642
  }, f),
2643
- c.mapBoth(k, k)
2643
+ u.mapBoth(k, k)
2644
2644
  );
2645
2645
  })
2646
2646
  )), this.open = /* @__PURE__ */ h(this.openFp), this.capture = /* @__PURE__ */ h(this.captureFp), this.close = /* @__PURE__ */ h(this.closeFp);
2647
2647
  }
2648
2648
  }
2649
- function zs() {
2650
- return new Hs({
2649
+ function Ks() {
2650
+ return new zs({
2651
2651
  ...p.pipe(S(), V, I),
2652
- onClosed(r) {
2653
- return G("scan_qr_popup_closed", r);
2652
+ onClosed(n) {
2653
+ return G("scan_qr_popup_closed", n);
2654
2654
  },
2655
- onTextReceived(r) {
2655
+ onTextReceived(n) {
2656
2656
  return G("qr_text_received", (t) => {
2657
- r(t.data);
2657
+ n(t.data);
2658
2658
  });
2659
2659
  }
2660
2660
  });
2661
2661
  }
2662
- const fn = /* @__PURE__ */ zs();
2663
- class Ks {
2662
+ const _n = /* @__PURE__ */ Ks();
2663
+ class Ns {
2664
2664
  constructor({}) {
2665
2665
  /**
2666
2666
  * Signal indicating if refresh is currently in progress.
@@ -2693,25 +2693,25 @@ class Ks {
2693
2693
  G("refresh_requested", () => {
2694
2694
  t.set(!0);
2695
2695
  }), this.isRefreshing = w(t), this.finishRefreshFp = () => p.pipe(
2696
- c.fromEither(ke("web_app_finish_refresh")),
2697
- c.map(() => {
2696
+ u.fromEither(ye("web_app_finish_refresh")),
2697
+ u.map(() => {
2698
2698
  t.set(!1);
2699
2699
  })
2700
- ), this.finishRefresh = () => this.finishRefreshFp()().then((n) => {
2701
- if (n._tag === "Left")
2702
- throw n.left;
2703
- return n.right;
2704
- }), this.onRefreshRequest = (s) => G("refresh_requested", () => {
2705
- s();
2700
+ ), this.finishRefresh = () => this.finishRefreshFp()().then((s) => {
2701
+ if (s._tag === "Left")
2702
+ throw s.left;
2703
+ return s.right;
2704
+ }), this.onRefreshRequest = (r) => G("refresh_requested", () => {
2705
+ r();
2706
2706
  });
2707
2707
  }
2708
2708
  }
2709
- function Ns() {
2710
- return new Ks(p.pipe(S()));
2709
+ function Qs() {
2710
+ return new Ns(p.pipe(S()));
2711
2711
  }
2712
- const _n = /* @__PURE__ */ Ns();
2713
- class Qs {
2714
- constructor({ defaults: t, ...s }) {
2712
+ const mn = /* @__PURE__ */ Qs();
2713
+ class Js {
2714
+ constructor({ defaults: t, ...r }) {
2715
2715
  //#region Properties.
2716
2716
  /**
2717
2717
  * Signal indicating if the component is supported.
@@ -2934,8 +2934,8 @@ class Qs {
2934
2934
  * @see offClick
2935
2935
  */
2936
2936
  e(this, "offClick");
2937
- const n = new de({
2938
- ...s,
2937
+ const s = new fe({
2938
+ ...r,
2939
2939
  initialState: {
2940
2940
  hasShineEffect: !1,
2941
2941
  isEnabled: !0,
@@ -2955,34 +2955,34 @@ class Qs {
2955
2955
  text_color: a.textColor,
2956
2956
  position: a.position
2957
2957
  })
2958
- }), i = (a, u) => {
2959
- const o = n.stateGetter(a);
2960
- return w(() => o() || $(u));
2958
+ }), i = (a, c) => {
2959
+ const o = s.stateGetter(a);
2960
+ return w(() => o() || $(c));
2961
2961
  };
2962
- this.isSupported = H("web_app_setup_secondary_button", s.version), this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.position = n.stateGetter("position"), this.hasShineEffect = n.stateGetter("hasShineEffect"), this.isEnabled = n.stateGetter("isEnabled"), this.isLoaderVisible = n.stateGetter("isLoaderVisible"), this.text = n.stateGetter("text"), this.isVisible = n.stateGetter("isVisible"), this.isMounted = n.isMounted, this.state = n.state, [this.setPosition, this.setPositionFp] = n.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = n.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = n.stateSetters("textColor"), [
2962
+ this.isSupported = W("web_app_setup_secondary_button", r.version), this.bgColor = i("bgColor", t.bgColor), this.textColor = i("textColor", t.textColor), this.position = s.stateGetter("position"), this.hasShineEffect = s.stateGetter("hasShineEffect"), this.isEnabled = s.stateGetter("isEnabled"), this.isLoaderVisible = s.stateGetter("isLoaderVisible"), this.text = s.stateGetter("text"), this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.state = s.state, [this.setPosition, this.setPositionFp] = s.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = s.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = s.stateSetters("textColor"), [
2963
2963
  [this.disableShineEffect, this.disableShineEffectFp],
2964
2964
  [this.enableShineEffect, this.enableShineEffectFp]
2965
- ] = n.stateBoolSetters("hasShineEffect"), [
2965
+ ] = s.stateBoolSetters("hasShineEffect"), [
2966
2966
  [this.disable, this.disableFp],
2967
2967
  [this.enable, this.enableFp]
2968
- ] = n.stateBoolSetters("isEnabled"), [
2968
+ ] = s.stateBoolSetters("isEnabled"), [
2969
2969
  [this.hideLoader, this.hideLoaderFp],
2970
2970
  [this.showLoader, this.showLoaderFp]
2971
- ] = n.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = n.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = n.stateBoolSetters("isVisible"), this.setParams = n.setState, this.setParamsFp = n.setStateFp, this.onClick = n.onClick, this.onClickFp = n.onClickFp, this.offClick = n.offClick, this.offClickFp = n.offClickFp, this.mount = n.mount, this.mountFp = n.mountFp, this.unmount = n.unmount;
2971
+ ] = s.stateBoolSetters("isLoaderVisible"), [this.setText, this.setTextFp] = s.stateSetters("text"), [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.setParams = s.setState, this.setParamsFp = s.setStateFp, this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
2972
2972
  }
2973
2973
  //#endregion
2974
2974
  }
2975
- function Js() {
2976
- return new Qs(
2977
- /* @__PURE__ */ st("secondaryButton", "secondary_button_pressed", {
2978
- bgColor: w(() => qs.bottomBarColorRgb() || "#000000"),
2979
- textColor: w(() => le.buttonColor() || "#2481cc")
2975
+ function Ys() {
2976
+ return new Js(
2977
+ /* @__PURE__ */ rt("secondaryButton", "secondary_button_pressed", {
2978
+ bgColor: w(() => Bs.bottomBarColorRgb() || "#000000"),
2979
+ textColor: w(() => he.buttonColor() || "#2481cc")
2980
2980
  })
2981
2981
  );
2982
2982
  }
2983
- const mn = /* @__PURE__ */ Js();
2984
- class Ys {
2985
- constructor({ isTma: t, request: s, version: n, createRequestId: i }) {
2983
+ const bn = /* @__PURE__ */ Ys();
2984
+ class Zs {
2985
+ constructor({ isTma: t, request: r, version: s, createRequestId: i }) {
2986
2986
  /**
2987
2987
  * Retrieves an item using its key.
2988
2988
  * @since Mini Apps v9.0
@@ -3029,50 +3029,50 @@ class Ys {
3029
3029
  */
3030
3030
  e(this, "clear");
3031
3031
  const a = E({
3032
- version: n,
3032
+ version: s,
3033
3033
  requires: "web_app_secure_storage_get_key",
3034
3034
  isTma: t,
3035
3035
  returns: "task"
3036
- }), u = (o, l, _) => {
3036
+ }), c = (o, l, _) => {
3037
3037
  const F = i();
3038
3038
  return p.pipe(
3039
- s(o, ["secure_storage_failed", l], {
3039
+ r(o, ["secure_storage_failed", l], {
3040
3040
  params: { ..._, req_id: F },
3041
3041
  capture: ((f) => "payload" in f ? f.payload.req_id === F : !0)
3042
3042
  }),
3043
- c.chain((f) => f.event === "secure_storage_failed" ? c.left(new yt(f.payload.error || "UNKNOWN_ERROR")) : c.right(f.payload))
3043
+ u.chain((f) => f.event === "secure_storage_failed" ? u.left(new It(f.payload.error || "UNKNOWN_ERROR")) : u.right(f.payload))
3044
3044
  );
3045
3045
  };
3046
3046
  this.getItemFp = a((o) => p.pipe(
3047
- u("web_app_secure_storage_get_key", "secure_storage_key_received", { key: o }),
3048
- c.map((l) => ({
3047
+ c("web_app_secure_storage_get_key", "secure_storage_key_received", { key: o }),
3048
+ u.map((l) => ({
3049
3049
  value: l.value,
3050
3050
  canRestore: !!l.can_restore
3051
3051
  }))
3052
3052
  )), this.setItemFp = a((o, l) => p.pipe(
3053
- u("web_app_secure_storage_save_key", "secure_storage_key_saved", { key: o, value: l }),
3054
- c.map(() => {
3053
+ c("web_app_secure_storage_save_key", "secure_storage_key_saved", { key: o, value: l }),
3054
+ u.map(() => {
3055
3055
  })
3056
3056
  )), this.deleteItemFp = a((o) => this.setItemFp(o, null)), this.clearFp = a(() => p.pipe(
3057
- u("web_app_secure_storage_clear", "secure_storage_cleared", {}),
3058
- c.map(() => {
3057
+ c("web_app_secure_storage_clear", "secure_storage_cleared", {}),
3058
+ u.map(() => {
3059
3059
  })
3060
3060
  )), this.restoreItemFp = a((o) => p.pipe(
3061
- u("web_app_secure_storage_restore_key", "secure_storage_key_restored", { key: o }),
3062
- c.map((l) => l.value)
3061
+ c("web_app_secure_storage_restore_key", "secure_storage_key_restored", { key: o }),
3062
+ u.map((l) => l.value)
3063
3063
  )), 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);
3064
3064
  }
3065
3065
  }
3066
- function Zs() {
3067
- return new Ys(p.pipe(
3066
+ function Xs() {
3067
+ return new Zs(p.pipe(
3068
3068
  S(),
3069
3069
  I,
3070
3070
  R,
3071
- Xe
3071
+ et
3072
3072
  ));
3073
3073
  }
3074
- const bn = /* @__PURE__ */ Zs();
3075
- class Xs {
3074
+ const gn = /* @__PURE__ */ Xs();
3075
+ class er {
3076
3076
  constructor(t) {
3077
3077
  /**
3078
3078
  * Signal indicating if the component is currently visible.
@@ -3155,20 +3155,20 @@ class Xs {
3155
3155
  * @see onClick
3156
3156
  */
3157
3157
  e(this, "unmount");
3158
- const s = new de({
3158
+ const r = new fe({
3159
3159
  ...t,
3160
3160
  method: "web_app_setup_settings_button",
3161
- payload: (n) => ({ is_visible: n.isVisible }),
3161
+ payload: (s) => ({ is_visible: s.isVisible }),
3162
3162
  initialState: { isVisible: !1 }
3163
3163
  });
3164
- this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.isSupported = s.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
3164
+ 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;
3165
3165
  }
3166
3166
  }
3167
- const gn = /* @__PURE__ */ new Xs(
3167
+ const Fn = /* @__PURE__ */ new er(
3168
3168
  /* @__PURE__ */ Ae("settingsButton", "settings_button_pressed")
3169
3169
  );
3170
- class er {
3171
- constructor({ postEvent: t, storage: s, isTma: n, isPageReload: i, version: a }) {
3170
+ class tr {
3171
+ constructor({ postEvent: t, storage: r, isTma: s, isPageReload: i, version: a }) {
3172
3172
  /**
3173
3173
  * Signal indicating if the component is supported.
3174
3174
  */
@@ -3212,17 +3212,17 @@ class er {
3212
3212
  * @see enableVerticalFp
3213
3213
  */
3214
3214
  e(this, "enableVertical");
3215
- const u = { isVerticalEnabled: !0 }, o = new J({
3216
- initialState: u,
3215
+ const c = { isVerticalEnabled: !0 }, o = new J({
3216
+ initialState: c,
3217
3217
  onChange(C) {
3218
- s.set(C);
3218
+ r.set(C);
3219
3219
  }
3220
- }), l = new ne({
3221
- initialState: u,
3220
+ }), l = new ie({
3221
+ initialState: c,
3222
3222
  isPageReload: i,
3223
3223
  onMounted: o.setState,
3224
- restoreState: s.get
3225
- }), _ = { requires: "web_app_setup_swipe_behavior", isTma: n, version: a }, F = E({
3224
+ restoreState: r.get
3225
+ }), _ = { requires: "web_app_setup_swipe_behavior", isTma: s, version: a }, F = E({
3226
3226
  ..._,
3227
3227
  returns: "plain"
3228
3228
  }), f = E({
@@ -3238,216 +3238,216 @@ class er {
3238
3238
  })
3239
3239
  ) : b.right(void 0);
3240
3240
  };
3241
- this.isSupported = H("web_app_setup_swipe_behavior", a), this.isVerticalEnabled = o.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = f(() => v(!1)), this.enableVerticalFp = f(() => v(!0)), this.mountFp = F(() => {
3241
+ this.isSupported = W("web_app_setup_swipe_behavior", a), this.isVerticalEnabled = o.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = f(() => v(!1)), this.enableVerticalFp = f(() => v(!0)), this.mountFp = F(() => {
3242
3242
  const C = () => {
3243
3243
  };
3244
3244
  return p.pipe(l.mount(), b.match(C, C));
3245
3245
  }), this.unmount = l.unmount, this.disableVertical = /* @__PURE__ */ h(this.disableVerticalFp), this.enableVertical = /* @__PURE__ */ h(this.enableVerticalFp), this.mount = /* @__PURE__ */ h(this.mountFp);
3246
3246
  }
3247
3247
  }
3248
- function tr() {
3249
- return new er(p.pipe(
3248
+ function sr() {
3249
+ return new tr(p.pipe(
3250
3250
  S(),
3251
3251
  V,
3252
3252
  I,
3253
3253
  Y("swipeBehavior")
3254
3254
  ));
3255
3255
  }
3256
- const Fn = /* @__PURE__ */ tr();
3257
- async function wn(r) {
3256
+ const wn = /* @__PURE__ */ sr();
3257
+ async function Cn(n) {
3258
3258
  try {
3259
- const { clipboard: s } = navigator;
3260
- if (s)
3261
- return await s.writeText(r);
3259
+ const { clipboard: r } = navigator;
3260
+ if (r)
3261
+ return await r.writeText(n);
3262
3262
  } catch {
3263
3263
  }
3264
3264
  const t = document.createElement("textarea");
3265
- t.value = r, t.style.top = "0", t.style.left = "0", t.style.position = "fixed", document.body.appendChild(t), t.focus(), t.select();
3265
+ t.value = n, t.style.top = "0", t.style.left = "0", t.style.position = "fixed", document.body.appendChild(t), t.focus(), t.select();
3266
3266
  try {
3267
3267
  document.execCommand("copy");
3268
3268
  } finally {
3269
3269
  document.body.removeChild(t);
3270
3270
  }
3271
3271
  }
3272
- function sr({ request: r, ...t }) {
3273
- return A((s, n, i) => p.pipe(
3274
- r(
3272
+ function rr({ request: n, ...t }) {
3273
+ return B((r, s, i) => p.pipe(
3274
+ n(
3275
3275
  "web_app_request_file_download",
3276
3276
  "file_download_requested",
3277
- { ...i, params: { url: s, file_name: n } }
3277
+ { ...i, params: { url: r, file_name: s } }
3278
3278
  ),
3279
- c.chain((a) => a.status === "downloading" ? c.right(void 0) : c.left(new Je("User denied the action")))
3279
+ u.chain((a) => a.status === "downloading" ? u.right(void 0) : u.left(new Ye("User denied the action")))
3280
3280
  ), { ...t, requires: "web_app_request_file_download", returns: "task" });
3281
3281
  }
3282
3282
  // @__NO_SIDE_EFFECTS__
3283
- function rr() {
3284
- return sr(p.pipe(
3283
+ function nr() {
3284
+ return rr(p.pipe(
3285
3285
  S(),
3286
3286
  R,
3287
3287
  I
3288
3288
  ));
3289
3289
  }
3290
- const nr = /* @__PURE__ */ rr(), Cn = /* @__PURE__ */ h(nr);
3291
- function ir({ invokeCustomMethod: r, ...t }) {
3292
- return A((s) => p.pipe(
3293
- r("getCurrentTime", {}, s),
3294
- c.chain((n) => {
3295
- const i = Fe(
3296
- ze(Qe(), vt(), Ke((a) => new Date(a * 1e3)), Ne()),
3297
- n
3290
+ const ir = /* @__PURE__ */ nr(), Sn = /* @__PURE__ */ h(ir);
3291
+ function or({ invokeCustomMethod: n, ...t }) {
3292
+ return B((r) => p.pipe(
3293
+ n("getCurrentTime", {}, r),
3294
+ u.chain((s) => {
3295
+ const i = we(
3296
+ Ke(Je(), kt(), Ne((a) => new Date(a * 1e3)), Qe()),
3297
+ s
3298
3298
  );
3299
- return i.success ? c.right(i.output) : c.left(new pe(n, i.issues));
3299
+ return i.success ? u.right(i.output) : u.left(new ce(s, i.issues));
3300
3300
  })
3301
3301
  ), { ...t, requires: "web_app_invoke_custom_method", returns: "task" });
3302
3302
  }
3303
3303
  // @__NO_SIDE_EFFECTS__
3304
- function or() {
3305
- return ir(p.pipe(
3304
+ function ar() {
3305
+ return or(p.pipe(
3306
3306
  S(),
3307
- Me,
3307
+ Ve,
3308
3308
  I
3309
3309
  ));
3310
3310
  }
3311
- const ar = /* @__PURE__ */ or(), Sn = /* @__PURE__ */ h(ar);
3312
- function pr({ postEvent: r, ...t }) {
3313
- return A(() => r("web_app_hide_keyboard"), { ...t, returns: "either", requires: "web_app_hide_keyboard" });
3311
+ const pr = /* @__PURE__ */ ar(), vn = /* @__PURE__ */ h(pr);
3312
+ function cr({ postEvent: n, ...t }) {
3313
+ return B(() => n("web_app_hide_keyboard"), { ...t, returns: "either", requires: "web_app_hide_keyboard" });
3314
3314
  }
3315
3315
  // @__NO_SIDE_EFFECTS__
3316
3316
  function ur() {
3317
- return pr(p.pipe(
3317
+ return cr(p.pipe(
3318
3318
  S(),
3319
3319
  V,
3320
3320
  I
3321
3321
  ));
3322
3322
  }
3323
- const cr = /* @__PURE__ */ ur(), vn = /* @__PURE__ */ h(cr);
3324
- function lr({ request: r, createRequestId: t, ...s }) {
3325
- return A((n) => {
3323
+ const lr = /* @__PURE__ */ ur(), kn = /* @__PURE__ */ h(lr);
3324
+ function hr({ request: n, createRequestId: t, ...r }) {
3325
+ return B((s) => {
3326
3326
  const i = t();
3327
3327
  return p.pipe(
3328
- r("web_app_read_text_from_clipboard", "clipboard_text_received", {
3329
- ...n,
3328
+ n("web_app_read_text_from_clipboard", "clipboard_text_received", {
3329
+ ...s,
3330
3330
  params: { req_id: i },
3331
- capture: dt(i)
3331
+ capture: ft(i)
3332
3332
  }),
3333
- c.map(({ data: a = null }) => a)
3333
+ u.map(({ data: a = null }) => a)
3334
3334
  );
3335
- }, { ...s, requires: "web_app_read_text_from_clipboard", returns: "task" });
3335
+ }, { ...r, requires: "web_app_read_text_from_clipboard", returns: "task" });
3336
3336
  }
3337
3337
  // @__NO_SIDE_EFFECTS__
3338
- function hr() {
3339
- return lr({
3338
+ function dr() {
3339
+ return hr({
3340
3340
  ...p.pipe(
3341
3341
  S(),
3342
3342
  I,
3343
3343
  R
3344
3344
  ),
3345
- createRequestId: xe
3345
+ createRequestId: Me
3346
3346
  });
3347
3347
  }
3348
- const dr = /* @__PURE__ */ hr(), kn = /* @__PURE__ */ h(dr);
3349
- function fr(r) {
3350
- const t = {}, s = r.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3351
- if (s) {
3352
- const [, n, i] = s;
3353
- n && (t.appVersion = n), i && i.slice(1, i.length - 1).split(";").forEach((a) => {
3354
- const [u, o] = a.trim().split(" ");
3355
- if (u === "Android")
3348
+ const fr = /* @__PURE__ */ dr(), yn = /* @__PURE__ */ h(fr);
3349
+ function _r(n) {
3350
+ const t = {}, r = n.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3351
+ if (r) {
3352
+ const [, s, i] = r;
3353
+ s && (t.appVersion = s), i && i.slice(1, i.length - 1).split(";").forEach((a) => {
3354
+ const [c, o] = a.trim().split(" ");
3355
+ if (c === "Android")
3356
3356
  t.androidVersion = o;
3357
- else if (u === "SDK") {
3357
+ else if (c === "SDK") {
3358
3358
  const l = parseInt(o, 10);
3359
3359
  l && (t.sdkVersion = l);
3360
- } else o ? (t.manufacturer = u, t.model = o) : t.performanceClass = u;
3360
+ } else o ? (t.manufacturer = c, t.model = o) : t.performanceClass = c;
3361
3361
  });
3362
3362
  }
3363
3363
  return t;
3364
3364
  }
3365
- function yn() {
3366
- return fr(navigator.userAgent);
3365
+ function In() {
3366
+ return _r(navigator.userAgent);
3367
3367
  }
3368
- function _r({ postEvent: r, ...t }) {
3369
- return A((s) => {
3370
- const { size: n } = new Blob([s]);
3371
- return !n || n > 4096 ? b.left(
3372
- new W(n ? "Maximum size of data to send is 4096 bytes" : "Attempted to send empty data")
3373
- ) : r("web_app_data_send", { data: s });
3368
+ function mr({ postEvent: n, ...t }) {
3369
+ return B((r) => {
3370
+ const { size: s } = new Blob([r]);
3371
+ return !s || s > 4096 ? b.left(
3372
+ new U(s ? "Maximum size of data to send is 4096 bytes" : "Attempted to send empty data")
3373
+ ) : n("web_app_data_send", { data: r });
3374
3374
  }, { ...t, returns: "either" });
3375
3375
  }
3376
3376
  // @__NO_SIDE_EFFECTS__
3377
- function mr() {
3378
- return _r(p.pipe(S(), V));
3377
+ function br() {
3378
+ return mr(p.pipe(S(), V));
3379
3379
  }
3380
- const br = /* @__PURE__ */ mr(), In = /* @__PURE__ */ h(br);
3381
- function gr({ request: r, ...t }) {
3382
- return A((s, n) => p.pipe(
3383
- r(
3380
+ const gr = /* @__PURE__ */ br(), En = /* @__PURE__ */ h(gr);
3381
+ function Fr({ request: n, ...t }) {
3382
+ return B((r, s) => p.pipe(
3383
+ n(
3384
3384
  "web_app_send_prepared_message",
3385
3385
  ["prepared_message_failed", "prepared_message_sent"],
3386
3386
  {
3387
- ...n,
3388
- params: { id: s }
3387
+ ...s,
3388
+ params: { id: r }
3389
3389
  }
3390
3390
  ),
3391
- c.chain((i) => i.event === "prepared_message_failed" ? c.left(new Bt(i.payload.error)) : c.right(void 0))
3391
+ u.chain((i) => i.event === "prepared_message_failed" ? u.left(new xt(i.payload.error)) : u.right(void 0))
3392
3392
  ), { ...t, requires: "web_app_send_prepared_message", returns: "task" });
3393
3393
  }
3394
3394
  // @__NO_SIDE_EFFECTS__
3395
- function Fr() {
3396
- return gr(p.pipe(
3395
+ function wr() {
3396
+ return Fr(p.pipe(
3397
3397
  S(),
3398
3398
  R,
3399
3399
  I
3400
3400
  ));
3401
3401
  }
3402
- const wr = /* @__PURE__ */ Fr(), En = /* @__PURE__ */ h(wr);
3403
- function Cr({ postEvent: r, ...t }) {
3404
- return A((s, n = {}) => r("web_app_share_to_story", {
3405
- text: n.text,
3406
- media_url: s,
3407
- widget_link: n.widgetLink
3402
+ const Cr = /* @__PURE__ */ wr(), qn = /* @__PURE__ */ h(Cr);
3403
+ function Sr({ postEvent: n, ...t }) {
3404
+ return B((r, s = {}) => n("web_app_share_to_story", {
3405
+ text: s.text,
3406
+ media_url: r,
3407
+ widget_link: s.widgetLink
3408
3408
  }), { ...t, requires: "web_app_share_to_story", returns: "either" });
3409
3409
  }
3410
3410
  // @__NO_SIDE_EFFECTS__
3411
- function Sr() {
3412
- return Cr(p.pipe(
3411
+ function vr() {
3412
+ return Sr(p.pipe(
3413
3413
  S(),
3414
3414
  V,
3415
3415
  I
3416
3416
  ));
3417
3417
  }
3418
- const vr = /* @__PURE__ */ Sr(), qn = /* @__PURE__ */ h(vr), ve = /* @__PURE__ */ ie(!1);
3419
- function kr({ isInlineMode: r, postEvent: t, ...s }) {
3420
- return A((n, i) => t("web_app_switch_inline_query", {
3421
- query: n,
3418
+ const kr = /* @__PURE__ */ vr(), Bn = /* @__PURE__ */ h(kr), ke = /* @__PURE__ */ oe(!1);
3419
+ function yr({ isInlineMode: n, postEvent: t, ...r }) {
3420
+ return B((s, i) => t("web_app_switch_inline_query", {
3421
+ query: s,
3422
3422
  chat_types: i || []
3423
3423
  }), {
3424
- ...s,
3424
+ ...r,
3425
3425
  requires: {
3426
- every: ["web_app_switch_inline_query", () => $(r) ? void 0 : "The application must be launched in the inline mode"]
3426
+ every: ["web_app_switch_inline_query", () => $(n) ? void 0 : "The application must be launched in the inline mode"]
3427
3427
  },
3428
3428
  returns: "either"
3429
3429
  });
3430
3430
  }
3431
3431
  // @__NO_SIDE_EFFECTS__
3432
- function yr() {
3433
- return kr({
3432
+ function Ir() {
3433
+ return yr({
3434
3434
  ...p.pipe(
3435
3435
  S(),
3436
3436
  V,
3437
3437
  I
3438
3438
  ),
3439
- isInlineMode: ve
3439
+ isInlineMode: ke
3440
3440
  });
3441
3441
  }
3442
- const Ir = /* @__PURE__ */ yr(), An = /* @__PURE__ */ h(Ir);
3443
- class Er {
3442
+ const Er = /* @__PURE__ */ Ir(), An = /* @__PURE__ */ h(Er);
3443
+ class qr {
3444
3444
  constructor({
3445
3445
  storage: t,
3446
- isPageReload: s,
3447
- onContentSafeAreaInsetsChanged: n,
3446
+ isPageReload: r,
3447
+ onContentSafeAreaInsetsChanged: s,
3448
3448
  onSafeAreaInsetsChanged: i,
3449
3449
  onViewportChanged: a,
3450
- onFullscreenChanged: u,
3450
+ onFullscreenChanged: c,
3451
3451
  offContentSafeAreaInsetsChanged: o,
3452
3452
  offFullscreenChanged: l,
3453
3453
  offSafeAreaInsetsChanged: _,
@@ -3657,7 +3657,7 @@ class Er {
3657
3657
  width: 0
3658
3658
  },
3659
3659
  onChange: t.set
3660
- }), B = (q) => {
3660
+ }), A = (q) => {
3661
3661
  d.setState({
3662
3662
  isExpanded: q.is_expanded,
3663
3663
  height: q.height,
@@ -3670,19 +3670,19 @@ class Er {
3670
3670
  d.setState({ safeAreaInsets: q });
3671
3671
  }, P = (q) => {
3672
3672
  d.setState({ contentSafeAreaInsets: q });
3673
- }, L = new Be({
3673
+ }, L = new xe({
3674
3674
  initialState(q) {
3675
3675
  const Z = (z) => () => {
3676
3676
  const [Q, D] = z === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
3677
- return ee(Q, $(y)) ? f(Q, D, q) : c.right({ top: 0, left: 0, right: 0, bottom: 0 });
3678
- }, x = (z) => () => typeof z == "boolean" ? c.right(z) : c.fromEither(z());
3677
+ return ee(Q, $(y)) ? f(Q, D, q) : u.right({ top: 0, left: 0, right: 0, bottom: 0 });
3678
+ }, x = (z) => () => typeof z == "boolean" ? u.right(z) : u.fromEither(z());
3679
3679
  return p.pipe(
3680
- c.Do,
3681
- c.bindW("safeAreaInsets", Z("safe-area")),
3682
- c.bindW("contentSafeAreaInsets", Z("content-safe-area")),
3683
- c.bindW("isFullscreen", x(C)),
3684
- c.bindW("isViewportStable", x(v)),
3685
- c.chainW(({ isViewportStable: z, ...Q }) => z ? c.right({
3680
+ u.Do,
3681
+ u.bindW("safeAreaInsets", Z("safe-area")),
3682
+ u.bindW("contentSafeAreaInsets", Z("content-safe-area")),
3683
+ u.bindW("isFullscreen", x(C)),
3684
+ u.bindW("isViewportStable", x(v)),
3685
+ u.chainW(({ isViewportStable: z, ...Q }) => z ? u.right({
3686
3686
  ...Q,
3687
3687
  height: window.innerHeight,
3688
3688
  isExpanded: !0,
@@ -3690,7 +3690,7 @@ class Er {
3690
3690
  width: window.innerWidth
3691
3691
  }) : p.pipe(
3692
3692
  f("web_app_request_viewport", "viewport_changed", q),
3693
- c.map((D) => ({
3693
+ u.map((D) => ({
3694
3694
  ...Q,
3695
3695
  height: D.height,
3696
3696
  isExpanded: D.is_expanded,
@@ -3700,40 +3700,40 @@ class Er {
3700
3700
  ))
3701
3701
  );
3702
3702
  },
3703
- isPageReload: s,
3703
+ isPageReload: r,
3704
3704
  onMounted(q) {
3705
- a(B), u(T), i(M), n(P), d.setState(q);
3705
+ a(A), c(T), i(M), s(P), d.setState(q);
3706
3706
  },
3707
3707
  onUnmounted() {
3708
- F(B), l(T), _(M), o(P);
3708
+ F(A), l(T), _(M), o(P);
3709
3709
  },
3710
3710
  restoreState: t.get
3711
- }), U = (q) => w(() => this.safeAreaInsets()[q]), oe = (q) => w(() => this.contentSafeAreaInsets()[q]);
3712
- 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 = U("top"), this.safeAreaInsetBottom = U("bottom"), this.safeAreaInsetLeft = U("left"), this.safeAreaInsetRight = U("right"), this.contentSafeAreaInsets = d.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = oe("top"), this.contentSafeAreaInsetBottom = oe("bottom"), this.contentSafeAreaInsetLeft = oe("left"), this.contentSafeAreaInsetRight = oe("right");
3713
- const it = E({ isTma: k, returns: "task" }), Re = E({
3711
+ }), j = (q) => w(() => this.safeAreaInsets()[q]), ae = (q) => w(() => this.contentSafeAreaInsets()[q]);
3712
+ 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");
3713
+ const ot = E({ isTma: k, returns: "task" }), Le = E({
3714
3714
  isTma: k,
3715
3715
  returns: "either"
3716
- }), ot = E({
3716
+ }), at = E({
3717
3717
  isTma: k,
3718
3718
  requires: "web_app_request_fullscreen",
3719
3719
  version: y,
3720
3720
  returns: "task"
3721
- }), Le = (q) => ot((Z) => p.pipe(
3721
+ }), $e = (q) => at((Z) => p.pipe(
3722
3722
  f(
3723
3723
  q ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
3724
3724
  ["fullscreen_changed", "fullscreen_failed"],
3725
3725
  Z
3726
3726
  ),
3727
- c.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? c.left(new At(x.payload.error)) : (d.setState({
3727
+ u.chain((x) => x.event === "fullscreen_failed" && x.payload.error !== "ALREADY_FULLSCREEN" ? u.left(new At(x.payload.error)) : (d.setState({
3728
3728
  isFullscreen: "is_fullscreen" in x.payload ? x.payload.is_fullscreen : !0
3729
- }), c.right(void 0)))
3729
+ }), u.right(void 0)))
3730
3730
  ));
3731
- this.isMounted = L.isMounted, this.mountFp = it(L.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);
3732
- const ae = O(!1);
3733
- this.isCssVarsBound = w(ae), this.bindCssVarsFp = Re(
3731
+ this.isMounted = L.isMounted, this.mountFp = ot(L.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = d.getter("isFullscreen"), this.requestFullscreenFp = $e(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = $e(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3732
+ const pe = O(!1);
3733
+ this.isCssVarsBound = w(pe), this.bindCssVarsFp = Le(
3734
3734
  (q) => {
3735
- if (ae())
3736
- return b.left(new Ee());
3735
+ if (pe())
3736
+ return b.left(new qe());
3737
3737
  q || (q = (x) => `--vb-viewport-${We(x)}`);
3738
3738
  const Z = [
3739
3739
  ["height", this.height],
@@ -3750,35 +3750,35 @@ class Er {
3750
3750
  ].reduce((x, [z, Q]) => {
3751
3751
  const D = q(z);
3752
3752
  if (D) {
3753
- const $e = () => {
3754
- Ve(D, `${Q()}px`);
3753
+ const Pe = () => {
3754
+ Te(D, `${Q()}px`);
3755
3755
  };
3756
- x.push({ update: $e, removeListener: Q.sub($e), cssVar: D });
3756
+ x.push({ update: Pe, removeListener: Q.sub(Pe), cssVar: D });
3757
3757
  }
3758
3758
  return x;
3759
3759
  }, []);
3760
3760
  return Z.forEach((x) => {
3761
3761
  x.update();
3762
- }), ae.set(!0), b.right(() => {
3762
+ }), pe.set(!0), b.right(() => {
3763
3763
  Z.forEach((x) => {
3764
- x.removeListener(), Te(x.cssVar);
3765
- }), ae.set(!1);
3764
+ x.removeListener(), Re(x.cssVar);
3765
+ }), pe.set(!1);
3766
3766
  });
3767
3767
  }
3768
- ), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Re(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
3768
+ ), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.expandFp = Le(() => m("web_app_expand")), this.expand = /* @__PURE__ */ h(this.expandFp);
3769
3769
  }
3770
3770
  //#endregion
3771
3771
  }
3772
- function qr() {
3773
- const r = (a) => ({
3774
- on: (u) => {
3775
- G(a, u);
3772
+ function Br() {
3773
+ const n = (a) => ({
3774
+ on: (c) => {
3775
+ G(a, c);
3776
3776
  },
3777
- off: (u) => {
3778
- re(a, u);
3777
+ off: (c) => {
3778
+ ne(a, c);
3779
3779
  }
3780
- }), t = r("viewport_changed"), s = r("fullscreen_changed"), n = r("safe_area_changed"), i = r("content_safe_area_changed");
3781
- return new Er({
3780
+ }), t = n("viewport_changed"), r = n("fullscreen_changed"), s = n("safe_area_changed"), i = n("content_safe_area_changed");
3781
+ return new qr({
3782
3782
  ...p.pipe(
3783
3783
  S(),
3784
3784
  Y("viewport"),
@@ -3787,22 +3787,22 @@ function qr() {
3787
3787
  R
3788
3788
  ),
3789
3789
  isFullscreen() {
3790
- return p.pipe(ce(), b.map((a) => !!a.vbWebAppFullscreen));
3790
+ return p.pipe(le(), b.map((a) => !!a.vbWebAppFullscreen));
3791
3791
  },
3792
3792
  isViewportStable() {
3793
- return p.pipe(ce(), b.map((a) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(a.vbWebAppPlatform)));
3793
+ return p.pipe(le(), b.map((a) => ["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(a.vbWebAppPlatform)));
3794
3794
  },
3795
3795
  offContentSafeAreaInsetsChanged: i.off,
3796
- offFullscreenChanged: s.off,
3797
- offSafeAreaInsetsChanged: n.off,
3796
+ offFullscreenChanged: r.off,
3797
+ offSafeAreaInsetsChanged: s.off,
3798
3798
  offViewportChanged: t.off,
3799
3799
  onContentSafeAreaInsetsChanged: i.on,
3800
- onFullscreenChanged: s.on,
3801
- onSafeAreaInsetsChanged: n.on,
3800
+ onFullscreenChanged: r.on,
3801
+ onSafeAreaInsetsChanged: s.on,
3802
3802
  onViewportChanged: t.on
3803
3803
  });
3804
3804
  }
3805
- const Bn = /* @__PURE__ */ qr();
3805
+ const xn = /* @__PURE__ */ Br();
3806
3806
  class Ar {
3807
3807
  constructor({ request: t }) {
3808
3808
  /**
@@ -3830,19 +3830,19 @@ class Ar {
3830
3830
  * Convenience method to select a folder.
3831
3831
  */
3832
3832
  e(this, "selectFolder");
3833
- this.requestAccessFp = (s) => p.pipe(
3833
+ this.requestAccessFp = (r) => p.pipe(
3834
3834
  t("web_app_request_storage_access", "storage_access_granted", {
3835
3835
  params: {
3836
- access_type: s.accessType,
3837
- multiple: s.multiple,
3838
- accept: s.accept,
3839
- max_file_size: s.maxFileSize,
3840
- read_content: s.readContent
3836
+ access_type: r.accessType,
3837
+ multiple: r.multiple,
3838
+ accept: r.accept,
3839
+ max_file_size: r.maxFileSize,
3840
+ read_content: r.readContent
3841
3841
  }
3842
3842
  }),
3843
- c.map((n) => ({
3844
- accessType: n.access_type,
3845
- items: n.items.map((i) => ({
3843
+ u.map((s) => ({
3844
+ accessType: s.access_type,
3845
+ items: s.items.map((i) => ({
3846
3846
  name: i.name,
3847
3847
  path: i.path,
3848
3848
  size: i.size,
@@ -3851,54 +3851,97 @@ class Ar {
3851
3851
  lastModified: i.last_modified
3852
3852
  }))
3853
3853
  }))
3854
- ), this.requestAccess = (s) => this.requestAccessFp(s)().then((i) => {
3854
+ ), this.requestAccess = (r) => this.requestAccessFp(r)().then((i) => {
3855
3855
  if (i._tag === "Left")
3856
3856
  throw i.left;
3857
3857
  return i.right;
3858
- }), this.selectFile = (s) => this.requestAccess({
3858
+ }), this.selectFile = (r) => this.requestAccess({
3859
3859
  accessType: "file",
3860
3860
  multiple: !1,
3861
- ...s
3862
- }), this.selectFiles = (s) => this.requestAccess({
3861
+ ...r
3862
+ }), this.selectFiles = (r) => this.requestAccess({
3863
3863
  accessType: "file",
3864
3864
  multiple: !0,
3865
- ...s
3865
+ ...r
3866
3866
  }), this.selectFolder = () => this.requestAccess({
3867
3867
  accessType: "folder"
3868
3868
  });
3869
3869
  }
3870
3870
  }
3871
- function Br() {
3871
+ function xr() {
3872
3872
  return new Ar({
3873
3873
  request: je
3874
3874
  });
3875
3875
  }
3876
- const xn = /* @__PURE__ */ Br();
3877
- function xr(r = {}) {
3876
+ const Mn = /* @__PURE__ */ xr();
3877
+ class Vn {
3878
+ /**
3879
+ * Listens to 'web_app_send_notification' method call from Mini App.
3880
+ */
3881
+ static onSend(t) {
3882
+ return re().on("web_app_send_notification", (s) => {
3883
+ s && t(s);
3884
+ });
3885
+ }
3886
+ }
3887
+ class Tn {
3888
+ /**
3889
+ * Sets the theme params of the Mini App.
3890
+ * Sends 'theme_changed' event to the Mini App.
3891
+ */
3892
+ static setTheme(t) {
3893
+ re().send("theme_changed", { theme_params: t });
3894
+ }
3895
+ /**
3896
+ * Listens to 'web_app_set_background_color' method call from Mini App.
3897
+ */
3898
+ static onBackgroundColorChange(t) {
3899
+ return re().on("web_app_set_background_color", (s) => {
3900
+ s && typeof s.color == "string" && t(s.color);
3901
+ });
3902
+ }
3903
+ /**
3904
+ * Listens to 'web_app_set_header_color' method call from Mini App.
3905
+ */
3906
+ static onHeaderColorChange(t) {
3907
+ return re().on("web_app_set_header_color", (s) => {
3908
+ s && ("color_key" in s && s.color_key ? t(s.color_key) : "color" in s && s.color && t(s.color));
3909
+ });
3910
+ }
3911
+ /**
3912
+ * Listens to 'web_app_set_bottom_bar_color' method call from Mini App.
3913
+ */
3914
+ static onBottomBarColorChange(t) {
3915
+ return re().on("web_app_set_bottom_bar_color", (s) => {
3916
+ s && s.color && t(s.color);
3917
+ });
3918
+ }
3919
+ }
3920
+ function Mr(n = {}) {
3878
3921
  const {
3879
3922
  version: t,
3880
- isInlineMode: s,
3881
- themeParams: n
3882
- } = r;
3883
- if (t && typeof s == "boolean" && n)
3884
- Ce.set(t), ve.set(s), Se.set(n);
3923
+ isInlineMode: r,
3924
+ themeParams: s
3925
+ } = n;
3926
+ if (t && typeof r == "boolean" && s)
3927
+ Se.set(t), ke.set(r), ve.set(s);
3885
3928
  else {
3886
- const o = p.pipe(ce(), b.matchW(
3929
+ const o = p.pipe(le(), b.matchW(
3887
3930
  (l) => l,
3888
3931
  (l) => {
3889
- Ce.set(t || l.vbWebAppVersion), ve.set(typeof s == "boolean" ? s : !!l.vbWebAppBotInline), Se.set(n || l.vbWebAppThemeParams);
3932
+ Se.set(t || l.vbWebAppVersion), ke.set(typeof r == "boolean" ? r : !!l.vbWebAppBotInline), ve.set(s || l.vbWebAppThemeParams);
3890
3933
  }
3891
3934
  ));
3892
3935
  if (o)
3893
3936
  return b.left(o);
3894
3937
  }
3895
- r.postEvent && Ye.set(r.postEvent);
3896
- const [i, a] = ye(
3938
+ n.postEvent && Ze.set(n.postEvent);
3939
+ const [i, a] = Ie(
3897
3940
  G("reload_iframe", () => {
3898
- Pe().log("Received a request to reload the page"), Vt("iframe_will_reload"), window.location.reload();
3941
+ Oe().log("Received a request to reload the page"), Tt("iframe_will_reload"), window.location.reload();
3899
3942
  })
3900
- ), { acceptCustomStyles: u = !0 } = r;
3901
- if (u) {
3943
+ ), { acceptCustomStyles: c = !0 } = n;
3944
+ if (c) {
3902
3945
  const o = document.createElement("style");
3903
3946
  o.id = "telegram-custom-styles", document.head.appendChild(o), i(
3904
3947
  G("set_custom_style", (l) => {
@@ -3911,176 +3954,180 @@ function xr(r = {}) {
3911
3954
  }
3912
3955
  return p.pipe(
3913
3956
  se("iframe_ready", { reload_supported: !0 }),
3914
- b.map(() => (Pe().log("The package was initialized"), a))
3957
+ b.map(() => (Oe().log("The package was initialized"), a))
3915
3958
  );
3916
3959
  }
3917
- const Mn = he(xr);
3960
+ const Rn = de(Mr);
3918
3961
  export {
3919
- Je as AccessDeniedError,
3920
- Mt as BackButton,
3921
- $t as Biometry,
3922
- Ee as CSSVarsBoundError,
3923
- Rn as CancelledError,
3924
- Dt as ClosingBehavior,
3962
+ Ye as AccessDeniedError,
3963
+ Vt as BackButton,
3964
+ Pt as Biometry,
3965
+ qe as CSSVarsBoundError,
3966
+ Pn as CancelledError,
3967
+ Gt as ClosingBehavior,
3925
3968
  jt as CloudStorage,
3926
- qe as ConcurrentCallError,
3927
- Ht as DeviceStorage,
3928
- kt as DeviceStorageMethodError,
3969
+ Be as ConcurrentCallError,
3970
+ zt as DeviceStorage,
3971
+ yt as DeviceStorageMethodError,
3929
3972
  At as FullscreenFailedError,
3930
- Et as FunctionUnavailableError,
3931
- Xt as HapticFeedback,
3932
- as as InitData,
3933
- W as InvalidArgumentsError,
3934
- Gr as InvalidEnvError,
3935
- Ln as InvalidLaunchParamsError,
3973
+ qt as FunctionUnavailableError,
3974
+ es as HapticFeedback,
3975
+ Vn as HostNotification,
3976
+ Tn as HostThemeParams,
3977
+ ps as InitData,
3978
+ U as InvalidArgumentsError,
3979
+ Hr as InvalidEnvError,
3980
+ On as InvalidLaunchParamsError,
3936
3981
  us as Invoice,
3937
- $n as InvokeCustomMethodFailedError,
3938
- Pn as LaunchParamsRetrieveError,
3939
- ws as LocationManager,
3940
- Ss as MainButton,
3941
- On as MethodParameterUnsupportedError,
3942
- Dn as MethodUnsupportedError,
3943
- Is as MiniApp,
3944
- It as NotAvailableError,
3945
- Bs as Notification,
3946
- Vs as Popup,
3947
- Hs as QrScanner,
3948
- Ks as Refresh,
3949
- Qs as SecondaryButton,
3950
- Ys as SecureStorage,
3951
- yt as SecureStorageMethodError,
3952
- qt as SetEmojiStatusError,
3953
- Xs as SettingsButton,
3954
- Bt as ShareMessageError,
3982
+ Dn as InvokeCustomMethodFailedError,
3983
+ Gn as LaunchParamsRetrieveError,
3984
+ Cs as LocationManager,
3985
+ vs as MainButton,
3986
+ Hn as MethodParameterUnsupportedError,
3987
+ jn as MethodUnsupportedError,
3988
+ Es as MiniApp,
3989
+ Et as NotAvailableError,
3990
+ xs as Notification,
3991
+ Ts as Popup,
3992
+ zs as QrScanner,
3993
+ Ns as Refresh,
3994
+ Js as SecondaryButton,
3995
+ Zs as SecureStorage,
3996
+ It as SecureStorageMethodError,
3997
+ Bt as SetEmojiStatusError,
3998
+ er as SettingsButton,
3999
+ xt as ShareMessageError,
3955
4000
  Ar as StoragePermission,
3956
- er as SwipeBehavior,
3957
- ks as ThemeParams,
3958
- Gn as TimeoutError,
3959
- jn as UnknownEnvError,
3960
- xt as UnknownThemeParamsKeyError,
3961
- pe as ValidationError,
3962
- Er as Viewport,
3963
- Zr as addToHomeScreen,
3964
- rs as addToHomeScreenFp,
3965
- Un as applyPolyfills,
4001
+ tr as SwipeBehavior,
4002
+ ys as ThemeParams,
4003
+ Un as TimeoutError,
4004
+ Wn as UnknownEnvError,
4005
+ Mt as UnknownThemeParamsKeyError,
4006
+ ce as ValidationError,
4007
+ qr as Viewport,
4008
+ Xr as addToHomeScreen,
4009
+ ns as addToHomeScreenFp,
4010
+ zn as applyPolyfills,
3966
4011
  jr as backButton,
3967
- Hr as biometry,
3968
- Xr as checkHomeScreenStatus,
3969
- os as checkHomeScreenStatusFp,
3970
- zr as closingBehavior,
3971
- Kr as cloudStorage,
3972
- wn as copyTextToClipboard,
3973
- Wn as createLogger,
3974
- Hn as createPostEvent,
3975
- xe as createRequestId,
3976
- zn as createStartParam,
3977
- Kn as createStartParamFp,
3978
- Nn as debug,
3979
- Qn as decodeBase64Url,
3980
- Jn as decodeBase64UrlFp,
3981
- Yn as decodeStartParam,
3982
- Zn as decodeStartParamFp,
3983
- Xn as deepSnakeToCamelObjKeys,
3984
- Nr as deviceStorage,
3985
- Cn as downloadFile,
3986
- nr as downloadFileFp,
3987
- ei as emitEvent,
3988
- ti as encodeBase64Url,
3989
- Sn as getCurrentTime,
3990
- ar as getCurrentTimeFp,
3991
- si as getReleaseVersion,
3992
- Yr as hapticFeedback,
3993
- vn as hideKeyboard,
3994
- cr as hideKeyboardFp,
3995
- Mn as init,
3996
- en as initData,
3997
- xr as initFp,
3998
- tn as invoice,
4012
+ zr as biometry,
4013
+ en as checkHomeScreenStatus,
4014
+ as as checkHomeScreenStatusFp,
4015
+ Kr as closingBehavior,
4016
+ Nr as cloudStorage,
4017
+ Cn as copyTextToClipboard,
4018
+ Kn as createLogger,
4019
+ Nn as createPostEvent,
4020
+ Me as createRequestId,
4021
+ Qn as createStartParam,
4022
+ Jn as createStartParamFp,
4023
+ Yn as debug,
4024
+ Zn as decodeBase64Url,
4025
+ Xn as decodeBase64UrlFp,
4026
+ ei as decodeStartParam,
4027
+ ti as decodeStartParamFp,
4028
+ si as deepSnakeToCamelObjKeys,
4029
+ ri as defineHostBridge,
4030
+ Qr as deviceStorage,
4031
+ Sn as downloadFile,
4032
+ ir as downloadFileFp,
4033
+ ni as emitEvent,
4034
+ ii as encodeBase64Url,
4035
+ vn as getCurrentTime,
4036
+ pr as getCurrentTimeFp,
4037
+ oi as getHostBridge,
4038
+ ai as getReleaseVersion,
4039
+ Zr as hapticFeedback,
4040
+ kn as hideKeyboard,
4041
+ lr as hideKeyboardFp,
4042
+ Rn as init,
4043
+ tn as initData,
4044
+ Mr as initFp,
4045
+ sn as invoice,
3999
4046
  Ut as invokeCustomMethod,
4000
- Si as isAnyRGB,
4001
- tt as isColorDark,
4002
- vs as isColorDarkFp,
4003
- vi as isRGB,
4004
- ki as isRGBA,
4005
- yi as isRGBAShort,
4006
- Ii as isRGBShort,
4007
- ri as isSafeToCreateStartParam,
4008
- ni as isVBMA,
4009
- ii as isVBMAFp,
4010
- on as locationManager,
4011
- oi as logger,
4012
- an as mainButton,
4013
- qs as miniApp,
4014
- ai as mockVBotEnv,
4015
- pn as notification,
4016
- pi as off,
4017
- ui as offAll,
4018
- ci as on,
4019
- sn as openLink,
4020
- ds as openLinkFp,
4021
- rn as openVBotLink,
4022
- et as openVBotLinkFp,
4023
- Ei as parseInitDataQuery,
4024
- qi as parseInitDataQueryFp,
4025
- Ai as parseLaunchParamsQuery,
4026
- Bi as parseLaunchParamsQueryFp,
4047
+ Ei as isAnyRGB,
4048
+ st as isColorDark,
4049
+ ks as isColorDarkFp,
4050
+ qi as isRGB,
4051
+ Bi as isRGBA,
4052
+ Ai as isRGBAShort,
4053
+ xi as isRGBShort,
4054
+ pi as isSafeToCreateStartParam,
4055
+ ci as isVBMA,
4056
+ ui as isVBMAFp,
4057
+ an as locationManager,
4058
+ li as logger,
4059
+ pn as mainButton,
4060
+ Bs as miniApp,
4061
+ hi as mockVBotEnv,
4062
+ cn as notification,
4063
+ di as off,
4064
+ fi as offAll,
4065
+ _i as on,
4066
+ rn as openLink,
4067
+ fs as openLinkFp,
4068
+ nn as openVBotLink,
4069
+ tt as openVBotLinkFp,
4070
+ Mi as parseInitDataQuery,
4071
+ Vi as parseInitDataQueryFp,
4072
+ Ti as parseLaunchParamsQuery,
4073
+ Ri as parseLaunchParamsQueryFp,
4027
4074
  un as popup,
4028
- Vt as postEvent,
4075
+ Tt as postEvent,
4029
4076
  se as postEventFp,
4030
- fn as qrScanner,
4031
- kn as readTextFromClipboard,
4032
- dr as readTextFromClipboardFp,
4033
- _n as refresh,
4077
+ _n as qrScanner,
4078
+ yn as readTextFromClipboard,
4079
+ fr as readTextFromClipboardFp,
4080
+ mn as refresh,
4034
4081
  Ur as request,
4035
4082
  Wr as request2,
4036
- Ze as request2Fp,
4037
- hn as requestContact,
4038
- ln as requestContactComplete,
4039
- nt as requestContactCompleteFp,
4040
- Gs as requestContactFp,
4041
- Qr as requestEmojiStatusAccess,
4042
- Qt as requestEmojiStatusAccessFp,
4043
- Pt as requestFp,
4044
- cn as requestPhoneAccess,
4045
- rt as requestPhoneAccessFp,
4046
- dn as requestWriteAccess,
4083
+ Xe as request2Fp,
4084
+ dn as requestContact,
4085
+ hn as requestContactComplete,
4086
+ it as requestContactCompleteFp,
4087
+ Hs as requestContactFp,
4088
+ Jr as requestEmojiStatusAccess,
4089
+ Jt as requestEmojiStatusAccessFp,
4090
+ Ot as requestFp,
4091
+ ln as requestPhoneAccess,
4092
+ nt as requestPhoneAccessFp,
4093
+ fn as requestWriteAccess,
4047
4094
  Ws as requestWriteAccessFp,
4048
- yn as retrieveAndroidDeviceData,
4049
- fr as retrieveAndroidDeviceDataFrom,
4050
- li as retrieveLaunchParams,
4051
- hi as retrieveLaunchParamsFp,
4052
- di as retrieveRawInitData,
4053
- fi as retrieveRawInitDataFp,
4054
- _i as retrieveRawLaunchParams,
4055
- mi as retrieveRawLaunchParamsFp,
4056
- mn as secondaryButton,
4057
- bn as secureStorage,
4058
- In as sendData,
4059
- br as sendDataFp,
4060
- xi as serializeInitDataQuery,
4061
- Mi as serializeLaunchParamsQuery,
4062
- bi as setDebug,
4063
- Jr as setEmojiStatus,
4064
- Zt as setEmojiStatusFp,
4065
- gi as setTargetOrigin,
4066
- gn as settingsButton,
4067
- En as shareMessage,
4068
- wr as shareMessageFp,
4069
- qn as shareStory,
4070
- vr as shareStoryFp,
4071
- nn as shareURL,
4072
- gs as shareURLFp,
4073
- xn as storagePermission,
4074
- Fi as supports,
4075
- Fn as swipeBehavior,
4095
+ In as retrieveAndroidDeviceData,
4096
+ _r as retrieveAndroidDeviceDataFrom,
4097
+ mi as retrieveLaunchParams,
4098
+ bi as retrieveLaunchParamsFp,
4099
+ gi as retrieveRawInitData,
4100
+ Fi as retrieveRawInitDataFp,
4101
+ wi as retrieveRawLaunchParams,
4102
+ Ci as retrieveRawLaunchParamsFp,
4103
+ bn as secondaryButton,
4104
+ gn as secureStorage,
4105
+ En as sendData,
4106
+ gr as sendDataFp,
4107
+ Li as serializeInitDataQuery,
4108
+ $i as serializeLaunchParamsQuery,
4109
+ Si as setDebug,
4110
+ Yr as setEmojiStatus,
4111
+ Xt as setEmojiStatusFp,
4112
+ vi as setTargetOrigin,
4113
+ Fn as settingsButton,
4114
+ qn as shareMessage,
4115
+ Cr as shareMessageFp,
4116
+ Bn as shareStory,
4117
+ kr as shareStoryFp,
4118
+ on as shareURL,
4119
+ Fs as shareURLFp,
4120
+ Mn as storagePermission,
4121
+ ki as supports,
4122
+ wn as swipeBehavior,
4076
4123
  An as switchInlineQuery,
4077
- Ir as switchInlineQueryFp,
4078
- wi as targetOrigin,
4079
- le as themeParams,
4080
- Vi as toRGB,
4081
- Ti as toRGBFp,
4082
- Ri as toRGBFull,
4083
- Li as toRGBFullFp,
4084
- Bn as viewport
4124
+ Er as switchInlineQueryFp,
4125
+ yi as targetOrigin,
4126
+ he as themeParams,
4127
+ Pi as toRGB,
4128
+ Oi as toRGBFp,
4129
+ Di as toRGBFull,
4130
+ Gi as toRGBFullFp,
4131
+ xn as viewport
4085
4132
  };
4086
4133
  //# sourceMappingURL=index.js.map