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