@tma.js/bridge 2.1.2 → 2.1.3
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 +3 -3
- 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 +96 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { is as L, looseObject as f, function as Z, nullish as v, boolean as z, number as G, string as b, optional as V, unknown as
|
|
2
|
-
import { throwifyFpFn as S, getStorageValue as
|
|
1
|
+
import { is as L, looseObject as f, function as Z, nullish as v, boolean as z, number as G, string as b, optional as V, unknown as Se, parse as C, any as Te } from "valibot";
|
|
2
|
+
import { throwifyFpFn as S, getStorageValue as $e, setStorageValue as ee, createLogger as Ae, throwifyAnyEither as W, createCbCollector as Me, BetterTaskEither as Ce } from "@tma.js/toolkit";
|
|
3
3
|
import { createLogger as pr, deepSnakeToCamelObjKeys as _r } from "@tma.js/toolkit";
|
|
4
|
-
import { BetterPromise as te, TimeoutError as
|
|
4
|
+
import { BetterPromise as te, TimeoutError as Le } from "better-promises";
|
|
5
5
|
import { CancelledError as lr, TimeoutError as mr } from "better-promises";
|
|
6
|
-
import { parseLaunchParamsQueryFp as re, themeParams as
|
|
7
|
-
import { errorClass as E, errorClassWithData as
|
|
6
|
+
import { parseLaunchParamsQueryFp as re, themeParams as We, pipeJsonToSchema as ne, miniAppsMessage as oe, serializeLaunchParamsQuery as Fe, parseLaunchParamsQuery as qe } from "@tma.js/transformers";
|
|
7
|
+
import { errorClass as E, errorClassWithData as Oe } from "error-kid";
|
|
8
8
|
import { signal as P, computed as ae } from "@tma.js/signals";
|
|
9
|
-
import
|
|
9
|
+
import Re from "mitt";
|
|
10
10
|
function se(e) {
|
|
11
11
|
return L(
|
|
12
12
|
f({ TelegramWebviewProxy: f({ postEvent: Z() }) }),
|
|
@@ -20,12 +20,12 @@ function ie() {
|
|
|
20
20
|
return !0;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
var
|
|
23
|
+
var Ue = function(e, t, r) {
|
|
24
24
|
if (r || arguments.length === 2) for (var n = 0, a = t.length, o; n < a; n++)
|
|
25
25
|
(o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
|
|
26
26
|
return e.concat(o || Array.prototype.slice.call(t));
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function Ie(e) {
|
|
29
29
|
return e;
|
|
30
30
|
}
|
|
31
31
|
function x(e, t, r, n, a, o, s, i, c) {
|
|
@@ -100,67 +100,67 @@ var T = function(e, t) {
|
|
|
100
100
|
return function() {
|
|
101
101
|
var n = Array.from(arguments);
|
|
102
102
|
return r(arguments) ? t.apply(this, n) : function(a) {
|
|
103
|
-
return t.apply(void 0,
|
|
103
|
+
return t.apply(void 0, Ue([a], n, !1));
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
|
-
},
|
|
106
|
+
}, je = { _tag: "None" }, ze = function(e) {
|
|
107
107
|
return { _tag: "Some", value: e };
|
|
108
|
-
}, ze = function(e) {
|
|
109
|
-
return e._tag === "Left";
|
|
110
108
|
}, Ge = function(e) {
|
|
111
|
-
return
|
|
109
|
+
return e._tag === "Left";
|
|
112
110
|
}, Ve = function(e) {
|
|
111
|
+
return { _tag: "Left", left: e };
|
|
112
|
+
}, Be = function(e) {
|
|
113
113
|
return { _tag: "Right", right: e };
|
|
114
|
-
}, m =
|
|
114
|
+
}, m = Ve, _ = Be, ue = /* @__PURE__ */ T(2, function(e, t) {
|
|
115
115
|
return d(e) ? e : t(e.right);
|
|
116
|
-
}),
|
|
116
|
+
}), De = function(e) {
|
|
117
117
|
return function(t) {
|
|
118
118
|
return d(t) ? t : _(e(t.right));
|
|
119
119
|
};
|
|
120
|
-
},
|
|
120
|
+
}, Ne = function(e, t) {
|
|
121
121
|
return function(r) {
|
|
122
122
|
return d(r) ? m(e(r.left)) : _(t(r.right));
|
|
123
123
|
};
|
|
124
|
-
},
|
|
124
|
+
}, Je = function(e) {
|
|
125
125
|
return function(t) {
|
|
126
126
|
return d(t) ? m(e(t.left)) : t;
|
|
127
127
|
};
|
|
128
|
-
}, d =
|
|
128
|
+
}, d = Ge, ce = function(e, t) {
|
|
129
129
|
return function(r) {
|
|
130
130
|
return d(r) ? e(r.left) : t(r.right);
|
|
131
131
|
};
|
|
132
|
-
},
|
|
132
|
+
}, Qe = ce, F = ce, He = F, q = function(e, t) {
|
|
133
133
|
try {
|
|
134
134
|
return _(e());
|
|
135
135
|
} catch (r) {
|
|
136
136
|
return m(t(r));
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, Ke = ue, Ye = ue, Xe = je, Ze = ze, et = function(e) {
|
|
139
139
|
return e._tag === "None";
|
|
140
|
-
},
|
|
140
|
+
}, tt = function(e, t) {
|
|
141
141
|
return function(r) {
|
|
142
|
-
return
|
|
142
|
+
return et(r) ? e() : t(r.value);
|
|
143
143
|
};
|
|
144
|
-
},
|
|
145
|
-
function
|
|
144
|
+
}, rt = tt;
|
|
145
|
+
function nt(e) {
|
|
146
146
|
return x(_, e.of);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ot(e) {
|
|
149
149
|
return x(m, e.of);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function at(e) {
|
|
152
152
|
return function(t, r) {
|
|
153
153
|
return e.chain(t, function(n) {
|
|
154
154
|
return d(n) ? e.of(n) : r(n.right);
|
|
155
155
|
});
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function st(e) {
|
|
159
159
|
return function(t, r, n) {
|
|
160
|
-
return e.map(t,
|
|
160
|
+
return e.map(t, Ne(r, n));
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function it(e) {
|
|
164
164
|
return function(t, r) {
|
|
165
165
|
return function(n) {
|
|
166
166
|
return e.map(n, F(t, r));
|
|
@@ -168,16 +168,16 @@ function st(e) {
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
var pe = function(e, t) {
|
|
171
|
-
return l(e, ut(t));
|
|
172
|
-
}, it = function(e, t) {
|
|
173
171
|
return l(e, ct(t));
|
|
174
|
-
}, ut = function(e) {
|
|
172
|
+
}, ut = function(e, t) {
|
|
173
|
+
return l(e, pt(t));
|
|
174
|
+
}, ct = function(e) {
|
|
175
175
|
return function(t) {
|
|
176
176
|
return function() {
|
|
177
177
|
return Promise.resolve().then(t).then(e);
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
|
-
},
|
|
180
|
+
}, pt = function(e) {
|
|
181
181
|
return function(t) {
|
|
182
182
|
return function() {
|
|
183
183
|
return Promise.all([Promise.resolve().then(t), Promise.resolve().then(e)]).then(function(r) {
|
|
@@ -190,7 +190,7 @@ var pe = function(e, t) {
|
|
|
190
190
|
return function() {
|
|
191
191
|
return Promise.resolve(e);
|
|
192
192
|
};
|
|
193
|
-
},
|
|
193
|
+
}, _t = /* @__PURE__ */ T(2, function(e, t) {
|
|
194
194
|
return function() {
|
|
195
195
|
return Promise.resolve().then(e).then(function(r) {
|
|
196
196
|
return t(r)();
|
|
@@ -201,22 +201,22 @@ var pe = function(e, t) {
|
|
|
201
201
|
map: pe
|
|
202
202
|
}, me = {
|
|
203
203
|
of: _e
|
|
204
|
-
},
|
|
204
|
+
}, ft = {
|
|
205
205
|
URI: fe,
|
|
206
206
|
map: pe,
|
|
207
207
|
of: _e,
|
|
208
|
-
ap:
|
|
209
|
-
chain:
|
|
210
|
-
},
|
|
211
|
-
class
|
|
208
|
+
ap: ut,
|
|
209
|
+
chain: _t
|
|
210
|
+
}, lt = /* @__PURE__ */ ot(me), we = /* @__PURE__ */ nt(me), he = /* @__PURE__ */ it(le), mt = /* @__PURE__ */ T(3, st(le)), ge = /* @__PURE__ */ T(2, at(ft)), wt = ge, ht = ge;
|
|
211
|
+
class gt extends E("MethodUnsupportedError", (t, r) => [
|
|
212
212
|
`Method "${t}" is unsupported in Mini Apps version ${r}`
|
|
213
213
|
]) {
|
|
214
214
|
}
|
|
215
|
-
class
|
|
215
|
+
class dt extends E("MethodParameterUnsupportedError", (t, r, n) => [
|
|
216
216
|
`Parameter "${r}" of "${t}" method is unsupported in Mini Apps version ${n}`
|
|
217
217
|
]) {
|
|
218
218
|
}
|
|
219
|
-
class
|
|
219
|
+
class vt extends Oe(
|
|
220
220
|
"LaunchParamsRetrieveError",
|
|
221
221
|
(t) => ({ errors: t }),
|
|
222
222
|
(t) => [
|
|
@@ -232,12 +232,12 @@ class dt extends qe(
|
|
|
232
232
|
]
|
|
233
233
|
) {
|
|
234
234
|
}
|
|
235
|
-
class
|
|
235
|
+
class bt extends E("InvalidLaunchParamsError", (t, r) => [
|
|
236
236
|
`Invalid value for launch params: ${t}`,
|
|
237
237
|
{ cause: r }
|
|
238
238
|
]) {
|
|
239
239
|
}
|
|
240
|
-
class
|
|
240
|
+
class de extends E("UnknownEnvError") {
|
|
241
241
|
}
|
|
242
242
|
class yt extends E(
|
|
243
243
|
"InvokeCustomMethodError",
|
|
@@ -248,15 +248,15 @@ const B = "launchParams";
|
|
|
248
248
|
function D(e) {
|
|
249
249
|
return e.replace(/^[^?#]*[?#]/, "").replace(/[?#]/g, "&");
|
|
250
250
|
}
|
|
251
|
-
const Et = x($,
|
|
251
|
+
const Et = x($, Ke(re)), Nt = S(Et), Pt = x($, De((e) => {
|
|
252
252
|
const t = new URLSearchParams(e).get("tgWebAppData");
|
|
253
|
-
return t ?
|
|
253
|
+
return t ? Ze(t) : Xe;
|
|
254
254
|
})), Jt = x(
|
|
255
255
|
Pt,
|
|
256
|
-
|
|
256
|
+
He((e) => {
|
|
257
257
|
throw e;
|
|
258
258
|
}, (e) => e),
|
|
259
|
-
|
|
259
|
+
rt(() => {
|
|
260
260
|
}, (e) => e)
|
|
261
261
|
);
|
|
262
262
|
function $() {
|
|
@@ -272,7 +272,7 @@ function $() {
|
|
|
272
272
|
return n && D(n.name);
|
|
273
273
|
}, "performance navigation entries"],
|
|
274
274
|
// Finally, try using the session storage.
|
|
275
|
-
[() =>
|
|
275
|
+
[() => $e(B), "local storage"]
|
|
276
276
|
]) {
|
|
277
277
|
const n = t();
|
|
278
278
|
if (!n) {
|
|
@@ -281,7 +281,7 @@ function $() {
|
|
|
281
281
|
}
|
|
282
282
|
const a = l(
|
|
283
283
|
re(n),
|
|
284
|
-
|
|
284
|
+
Qe((o) => o, () => !0)
|
|
285
285
|
);
|
|
286
286
|
if (typeof a != "boolean") {
|
|
287
287
|
e.push({ source: r, error: a });
|
|
@@ -289,11 +289,11 @@ function $() {
|
|
|
289
289
|
}
|
|
290
290
|
return ee(B, n), _(n);
|
|
291
291
|
}
|
|
292
|
-
return m(new
|
|
292
|
+
return m(new vt(e));
|
|
293
293
|
}
|
|
294
294
|
const Qt = S($);
|
|
295
295
|
function xt(e, t) {
|
|
296
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
296
|
+
const r = /* @__PURE__ */ new Map(), n = Re(), a = (o, s, i = !1) => {
|
|
297
297
|
const c = r.get(o) || /* @__PURE__ */ new Map();
|
|
298
298
|
r.set(o, c);
|
|
299
299
|
const u = c.get(s) || [];
|
|
@@ -358,7 +358,7 @@ function M(e, t, r) {
|
|
|
358
358
|
n.unshift(1), J(e, t, o);
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
|
-
|
|
361
|
+
ve(
|
|
362
362
|
e,
|
|
363
363
|
t,
|
|
364
364
|
() => s,
|
|
@@ -367,13 +367,13 @@ function M(e, t, r) {
|
|
|
367
367
|
}
|
|
368
368
|
function N(e, t) {
|
|
369
369
|
const r = e[t];
|
|
370
|
-
|
|
370
|
+
ve(e, t, () => r, (n) => {
|
|
371
371
|
Object.entries(n).forEach(([a, o]) => {
|
|
372
372
|
r[a] = o;
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function ve(e, t, r, n) {
|
|
377
377
|
Object.defineProperty(e, t, {
|
|
378
378
|
enumerable: !0,
|
|
379
379
|
configurable: !0,
|
|
@@ -396,7 +396,7 @@ const kt = {
|
|
|
396
396
|
}),
|
|
397
397
|
custom_method_invoked: f({
|
|
398
398
|
req_id: b(),
|
|
399
|
-
result: V(
|
|
399
|
+
result: V(Se()),
|
|
400
400
|
error: V(b())
|
|
401
401
|
}),
|
|
402
402
|
popup_closed: v(
|
|
@@ -420,7 +420,7 @@ const kt = {
|
|
|
420
420
|
})
|
|
421
421
|
),
|
|
422
422
|
theme_changed: f({
|
|
423
|
-
theme_params:
|
|
423
|
+
theme_params: We()
|
|
424
424
|
})
|
|
425
425
|
};
|
|
426
426
|
function Q(e) {
|
|
@@ -451,7 +451,7 @@ function Q(e) {
|
|
|
451
451
|
Tt(r, o);
|
|
452
452
|
}
|
|
453
453
|
const {
|
|
454
|
-
on:
|
|
454
|
+
on: be,
|
|
455
455
|
off: St,
|
|
456
456
|
emit: Tt,
|
|
457
457
|
clear: $t
|
|
@@ -477,23 +477,23 @@ const {
|
|
|
477
477
|
}
|
|
478
478
|
), k = P(!1), O = P("https://web.telegram.org"), At = (e) => {
|
|
479
479
|
h().log("Event received:", e);
|
|
480
|
-
},
|
|
480
|
+
}, ye = ae(k);
|
|
481
481
|
function Ht(e) {
|
|
482
|
-
e !== k() && (k.set(e), (e ?
|
|
482
|
+
e !== k() && (k.set(e), (e ? be : St)("*", At));
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const Ee = ae(O);
|
|
485
485
|
function Kt(e) {
|
|
486
486
|
O.set(e), h().log("New target origin set", e);
|
|
487
487
|
}
|
|
488
488
|
const y = P((...e) => {
|
|
489
489
|
window.parent.postMessage(...e);
|
|
490
|
-
}), h = P(
|
|
490
|
+
}), h = P(Ae("Bridge", {
|
|
491
491
|
bgColor: "#9147ff",
|
|
492
492
|
textColor: "white",
|
|
493
|
-
shouldLog:
|
|
493
|
+
shouldLog: ye
|
|
494
494
|
}));
|
|
495
495
|
function Yt() {
|
|
496
|
-
$t(), [y, O,
|
|
496
|
+
$t(), [y, O, Ee, k, ye, h].forEach((e) => {
|
|
497
497
|
e.unsubAll(), "reset" in e && e.reset();
|
|
498
498
|
});
|
|
499
499
|
}
|
|
@@ -505,7 +505,7 @@ function Ct(e, t) {
|
|
|
505
505
|
e,
|
|
506
506
|
t
|
|
507
507
|
),
|
|
508
|
-
|
|
508
|
+
Je((r) => {
|
|
509
509
|
throw r;
|
|
510
510
|
})
|
|
511
511
|
);
|
|
@@ -513,17 +513,17 @@ function Ct(e, t) {
|
|
|
513
513
|
function R(e, t) {
|
|
514
514
|
h().log("Posting event:", t ? { eventType: e, eventData: t } : { eventType: e });
|
|
515
515
|
const r = window, n = JSON.stringify({ eventType: e, eventData: t });
|
|
516
|
-
return ie() ? (Mt(n,
|
|
516
|
+
return ie() ? (Mt(n, Ee()), _(void 0)) : se(r) ? (r.TelegramWebviewProxy.postEvent(e, JSON.stringify(t)), _(void 0)) : L(f({ external: f({ notify: Z() }) }), r) ? (r.external.notify(n), _(void 0)) : m(new de());
|
|
517
517
|
}
|
|
518
518
|
function U(e, t, r = {}) {
|
|
519
519
|
const {
|
|
520
520
|
// If no capture function was passed, we capture the first compatible event.
|
|
521
521
|
capture: n = () => !0,
|
|
522
522
|
postEvent: a = R
|
|
523
|
-
} = r, o = P(), [s, i] =
|
|
523
|
+
} = r, o = P(), [s, i] = Me();
|
|
524
524
|
(Array.isArray(t) ? t : [t]).forEach((u) => {
|
|
525
525
|
s(
|
|
526
|
-
|
|
526
|
+
be(u, (p) => {
|
|
527
527
|
(Array.isArray(t) ? n({ event: u, payload: p }) : n(p)) && o.set([p]);
|
|
528
528
|
})
|
|
529
529
|
);
|
|
@@ -531,18 +531,18 @@ function U(e, t, r = {}) {
|
|
|
531
531
|
const c = (u) => (i(), u);
|
|
532
532
|
return l(
|
|
533
533
|
async () => a(e, r.params),
|
|
534
|
-
|
|
534
|
+
ht(() => Ce((u, p, w) => {
|
|
535
535
|
const g = o();
|
|
536
536
|
if (g)
|
|
537
537
|
return u(g[0]);
|
|
538
538
|
const I = (j) => {
|
|
539
539
|
j && u(j[0]);
|
|
540
|
-
},
|
|
540
|
+
}, ke = () => {
|
|
541
541
|
o.unsub(I);
|
|
542
542
|
};
|
|
543
|
-
o.sub(I), w.on("finalized",
|
|
543
|
+
o.sub(I), w.on("finalized", ke);
|
|
544
544
|
}, r)),
|
|
545
|
-
|
|
545
|
+
mt(c, c)
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
548
|
function Xt(e, t, r) {
|
|
@@ -579,7 +579,7 @@ function Lt(e, t) {
|
|
|
579
579
|
return l(
|
|
580
580
|
U("web_app_request_theme", "theme_changed", { ...t, timeout: n }),
|
|
581
581
|
he(
|
|
582
|
-
(a) =>
|
|
582
|
+
(a) => Le.is(a) || de.is(a) ? _(!1) : m(a),
|
|
583
583
|
() => _(!0)
|
|
584
584
|
)
|
|
585
585
|
);
|
|
@@ -590,12 +590,12 @@ function er({ launchParams: e, onEvent: t, resetPostMessage: r } = {}) {
|
|
|
590
590
|
// Here we have to trick serializeLaunchParamsQuery into thinking, it serializes a valid
|
|
591
591
|
// value. We are doing it because we are working with tgWebAppData presented as a
|
|
592
592
|
// string, not an object as serializeLaunchParamsQuery requires.
|
|
593
|
-
|
|
593
|
+
Fe({ ...e, tgWebAppData: void 0 }) + (e.tgWebAppData ? `&tgWebAppData=${encodeURIComponent(e.tgWebAppData.toString())}` : "")
|
|
594
594
|
);
|
|
595
595
|
try {
|
|
596
|
-
|
|
596
|
+
qe(o);
|
|
597
597
|
} catch (s) {
|
|
598
|
-
throw new
|
|
598
|
+
throw new bt(o, s);
|
|
599
599
|
}
|
|
600
600
|
ee("launchParams", o);
|
|
601
601
|
}
|
|
@@ -747,12 +747,12 @@ function X(e, t, r) {
|
|
|
747
747
|
}
|
|
748
748
|
function tr(e, t = "strict") {
|
|
749
749
|
const r = typeof t == "function" ? t : (n) => {
|
|
750
|
-
const { method: a, version: o } = n, s = "param" in n ? new
|
|
750
|
+
const { method: a, version: o } = n, s = "param" in n ? new dt(a, n.param, o) : new gt(a, o);
|
|
751
751
|
if (t === "strict")
|
|
752
752
|
throw s;
|
|
753
753
|
return h().forceWarn(s.message);
|
|
754
754
|
};
|
|
755
|
-
return (n, a) => X(n, e) ? n === "web_app_set_header_color" && L(f({ color:
|
|
755
|
+
return (n, a) => X(n, e) ? n === "web_app_set_header_color" && L(f({ color: Te() }), a) && !X(n, "color", e) ? r({ version: e, method: n, param: "color" }) : Ct(n, a) : r({ version: e, method: n });
|
|
756
756
|
}
|
|
757
757
|
function qt(e, t, r, n) {
|
|
758
758
|
return l(
|
|
@@ -761,7 +761,7 @@ function qt(e, t, r, n) {
|
|
|
761
761
|
params: { method: e, params: t, req_id: r },
|
|
762
762
|
capture: Wt(r)
|
|
763
763
|
}),
|
|
764
|
-
|
|
764
|
+
wt(({ result: a, error: o }) => o ? lt(new yt(o)) : we(a))
|
|
765
765
|
);
|
|
766
766
|
}
|
|
767
767
|
function rr(e, t, r, n) {
|
|
@@ -781,13 +781,13 @@ function nr() {
|
|
|
781
781
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function Pe(e) {
|
|
785
785
|
return q(() => decodeURIComponent(
|
|
786
786
|
atob(e).replace(/-/g, "+").replace(/_/g, "/").split("").map((t) => "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2)).join("")
|
|
787
787
|
), (t) => t);
|
|
788
788
|
}
|
|
789
|
-
const or = S(
|
|
790
|
-
function
|
|
789
|
+
const or = S(Pe);
|
|
790
|
+
function xe(e) {
|
|
791
791
|
return btoa(
|
|
792
792
|
encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, (t, r) => String.fromCharCode(parseInt(`0x${r}`)))
|
|
793
793
|
).replace(/\+/g, "-").replace(/\//g, "_");
|
|
@@ -795,10 +795,10 @@ function Pe(e) {
|
|
|
795
795
|
var Ot = function(e) {
|
|
796
796
|
return q(function() {
|
|
797
797
|
return JSON.parse(e);
|
|
798
|
-
},
|
|
798
|
+
}, Ie);
|
|
799
799
|
};
|
|
800
800
|
function Rt(e) {
|
|
801
|
-
const t =
|
|
801
|
+
const t = xe(typeof e == "string" ? e : JSON.stringify(e));
|
|
802
802
|
return t.length > 512 ? m(new Error("Value is too long for start parameter")) : _(t);
|
|
803
803
|
}
|
|
804
804
|
const ar = S(Rt);
|
|
@@ -813,22 +813,22 @@ function sr(e, t) {
|
|
|
813
813
|
}
|
|
814
814
|
function Ut(e, t) {
|
|
815
815
|
return l(
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
Pe(e),
|
|
817
|
+
Ye((r) => t ? typeof t == "function" ? t(r) : Ot(r) : _(r))
|
|
818
818
|
);
|
|
819
819
|
}
|
|
820
820
|
function ir(e) {
|
|
821
|
-
return
|
|
821
|
+
return xe(e).length <= 512;
|
|
822
822
|
}
|
|
823
823
|
export {
|
|
824
824
|
lr as CancelledError,
|
|
825
|
-
|
|
825
|
+
bt as InvalidLaunchParamsError,
|
|
826
826
|
yt as InvokeCustomMethodFailedError,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
827
|
+
vt as LaunchParamsRetrieveError,
|
|
828
|
+
dt as MethodParameterUnsupportedError,
|
|
829
|
+
gt as MethodUnsupportedError,
|
|
830
830
|
mr as TimeoutError,
|
|
831
|
-
|
|
831
|
+
de as UnknownEnvError,
|
|
832
832
|
nr as applyPolyfills,
|
|
833
833
|
Wt as captureSameReq,
|
|
834
834
|
Ft as compareVersions,
|
|
@@ -836,14 +836,14 @@ export {
|
|
|
836
836
|
tr as createPostEvent,
|
|
837
837
|
ar as createStartParam,
|
|
838
838
|
Rt as createStartParamFp,
|
|
839
|
-
|
|
839
|
+
ye as debug,
|
|
840
840
|
or as decodeBase64Url,
|
|
841
|
-
|
|
841
|
+
Pe as decodeBase64UrlFp,
|
|
842
842
|
sr as decodeStartParam,
|
|
843
843
|
Ut as decodeStartParamFp,
|
|
844
844
|
_r as deepSnakeToCamelObjKeys,
|
|
845
845
|
A as emitEvent,
|
|
846
|
-
|
|
846
|
+
xe as encodeBase64Url,
|
|
847
847
|
Y as getReleaseVersion,
|
|
848
848
|
se as hasWebviewProxy,
|
|
849
849
|
rr as invokeCustomMethod,
|
|
@@ -856,7 +856,7 @@ export {
|
|
|
856
856
|
er as mockTelegramEnv,
|
|
857
857
|
St as off,
|
|
858
858
|
$t as offAll,
|
|
859
|
-
|
|
859
|
+
be as on,
|
|
860
860
|
Ct as postEvent,
|
|
861
861
|
R as postEventFp,
|
|
862
862
|
Mt as postMessage,
|
|
@@ -873,6 +873,6 @@ export {
|
|
|
873
873
|
Ht as setDebug,
|
|
874
874
|
Kt as setTargetOrigin,
|
|
875
875
|
X as supports,
|
|
876
|
-
|
|
876
|
+
Ee as targetOrigin
|
|
877
877
|
};
|
|
878
878
|
//# sourceMappingURL=index.js.map
|