@vbotma/bridge 2.3.3 → 2.3.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/dts/index.d.ts +1 -1
- package/dist/dts/methods/getReleaseVersion.d.ts +4 -0
- 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 +102 -118
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { is as
|
|
2
|
-
import { throwifyFpFn as C, getStorageValue as ve, setStorageValue as
|
|
3
|
-
import { createLogger as
|
|
1
|
+
import { is as R, looseObject as d, function as ne, nullish as P, boolean as G, number as N, string as x, optional as H, unknown as ge, parse as V, any as ye } from "valibot";
|
|
2
|
+
import { throwifyFpFn as C, getStorageValue as ve, setStorageValue as U, createLogger as Ee, throwifyAnyEither as A, createCbCollector as oe, BetterTaskEither as ae } from "@vbotma/toolkit";
|
|
3
|
+
import { createLogger as St, deepSnakeToCamelObjKeys as kt } from "@vbotma/toolkit";
|
|
4
4
|
import { BetterPromise as se, TimeoutError as Pe } from "better-promises";
|
|
5
|
-
import { CancelledError as
|
|
6
|
-
import { function as w, either as c, option as
|
|
5
|
+
import { CancelledError as Wt, TimeoutError as Ct } from "better-promises";
|
|
6
|
+
import { function as w, either as c, option as O, taskEither as l, json as xe } from "fp-ts";
|
|
7
7
|
import { errorClassWithData as Be, errorClass as B } from "error-kid";
|
|
8
|
-
import { parseLaunchParamsQueryFp as ie, themeParams as Se, pipeJsonToSchema as
|
|
8
|
+
import { parseLaunchParamsQueryFp as ie, themeParams as Se, pipeJsonToSchema as I, miniAppsMessage as j, serializeLaunchParamsQuery as pe, parseLaunchParamsQuery as ce } from "@vbotma/transformers";
|
|
9
9
|
import { signal as y, computed as _e } from "@vbotma/signals";
|
|
10
10
|
import ke from "mitt";
|
|
11
11
|
function ue(e) {
|
|
12
|
-
return
|
|
12
|
+
return R(
|
|
13
13
|
d({ VBotWebviewProxy: d({ postEvent: ne() }) }),
|
|
14
14
|
e
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function $() {
|
|
18
18
|
try {
|
|
19
19
|
return window.self !== window.top;
|
|
20
20
|
} catch {
|
|
@@ -61,8 +61,8 @@ class Ae extends (/* @__PURE__ */ B(
|
|
|
61
61
|
(t) => [`Server returned error: ${t}`]
|
|
62
62
|
)) {
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
function
|
|
64
|
+
const Q = "launchParams";
|
|
65
|
+
function K(e) {
|
|
66
66
|
return e.replace(/^[^?#]*[?#]/, "").replace(/[?#]/g, "&");
|
|
67
67
|
}
|
|
68
68
|
function Le() {
|
|
@@ -77,7 +77,7 @@ function Me() {
|
|
|
77
77
|
L(),
|
|
78
78
|
c.map((e) => {
|
|
79
79
|
const t = new URLSearchParams(e).get("vbWebAppData");
|
|
80
|
-
return t ?
|
|
80
|
+
return t ? O.some(t) : O.none;
|
|
81
81
|
})
|
|
82
82
|
);
|
|
83
83
|
}
|
|
@@ -87,7 +87,7 @@ function nt() {
|
|
|
87
87
|
c.fold((e) => {
|
|
88
88
|
throw e;
|
|
89
89
|
}, (e) => e),
|
|
90
|
-
|
|
90
|
+
O.match(() => {
|
|
91
91
|
}, (e) => e)
|
|
92
92
|
);
|
|
93
93
|
}
|
|
@@ -97,14 +97,14 @@ function L() {
|
|
|
97
97
|
// Try to retrieve launch parameters from the current location. This method
|
|
98
98
|
// can return nothing in case, location was changed, and then the page was
|
|
99
99
|
// reloaded.
|
|
100
|
-
[() =>
|
|
100
|
+
[() => K(window.location.href), "window.location.href"],
|
|
101
101
|
// Then, try using the lower level API - window.performance.
|
|
102
102
|
[() => {
|
|
103
103
|
const n = performance.getEntriesByType("navigation")[0];
|
|
104
|
-
return n &&
|
|
104
|
+
return n && K(n.name);
|
|
105
105
|
}, "performance navigation entries"],
|
|
106
106
|
// Finally, try using the session storage.
|
|
107
|
-
[() => ve(
|
|
107
|
+
[() => ve(Q), "local storage"]
|
|
108
108
|
]) {
|
|
109
109
|
const n = t();
|
|
110
110
|
if (!n) {
|
|
@@ -119,12 +119,12 @@ function L() {
|
|
|
119
119
|
e.push({ source: r, error: a });
|
|
120
120
|
continue;
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return U(Q, n), c.right(n);
|
|
123
123
|
}
|
|
124
124
|
return c.left(new Ce(e));
|
|
125
125
|
}
|
|
126
126
|
const ot = C(L);
|
|
127
|
-
function
|
|
127
|
+
function z(e, t) {
|
|
128
128
|
const r = /* @__PURE__ */ new Map(), n = ke(), a = (o, s, i = !1) => {
|
|
129
129
|
const _ = r.get(o) || /* @__PURE__ */ new Map();
|
|
130
130
|
r.set(o, _);
|
|
@@ -168,15 +168,15 @@ function k(e, t) {
|
|
|
168
168
|
source: window.parent
|
|
169
169
|
}));
|
|
170
170
|
}
|
|
171
|
-
const W = y(!1),
|
|
171
|
+
const W = y(!1), T = y("https://web.vbot.org"), qe = (e) => {
|
|
172
172
|
g().log("Event received:", e);
|
|
173
173
|
}, de = _e(W);
|
|
174
174
|
function at(e) {
|
|
175
|
-
e !== W() && (W.set(e), (e ? D :
|
|
175
|
+
e !== W() && (W.set(e), (e ? D : Fe)("*", qe));
|
|
176
176
|
}
|
|
177
|
-
const le = _e(
|
|
177
|
+
const le = _e(T);
|
|
178
178
|
function st(e) {
|
|
179
|
-
|
|
179
|
+
T.set(e), g().log("New target origin set", e);
|
|
180
180
|
}
|
|
181
181
|
const m = y((...e) => {
|
|
182
182
|
window.parent.postMessage(...e);
|
|
@@ -186,7 +186,7 @@ const m = y((...e) => {
|
|
|
186
186
|
shouldLog: de
|
|
187
187
|
}));
|
|
188
188
|
function it() {
|
|
189
|
-
Ue(), [m,
|
|
189
|
+
Ue(), [m, T, le, W, de, g].forEach((e) => {
|
|
190
190
|
e.unsubAll(), "reset" in e && e.reset();
|
|
191
191
|
});
|
|
192
192
|
}
|
|
@@ -206,10 +206,10 @@ function q(e, t, r) {
|
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
208
|
if (i === 2) {
|
|
209
|
-
|
|
209
|
+
X(e, t, n[1]);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
n.unshift(1),
|
|
212
|
+
n.unshift(1), X(e, t, o);
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
be(
|
|
@@ -219,7 +219,7 @@ function q(e, t, r) {
|
|
|
219
219
|
(i) => n.push(i)
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Y(e, t) {
|
|
223
223
|
const r = e[t];
|
|
224
224
|
be(e, t, () => r, (n) => {
|
|
225
225
|
Object.entries(n).forEach(([a, o]) => {
|
|
@@ -235,7 +235,7 @@ function be(e, t, r, n) {
|
|
|
235
235
|
set: n
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function X(e, t, r) {
|
|
239
239
|
Object.defineProperty(e, t, {
|
|
240
240
|
enumerable: !0,
|
|
241
241
|
configurable: !0,
|
|
@@ -243,7 +243,7 @@ function Y(e, t, r) {
|
|
|
243
243
|
value: r
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
const
|
|
246
|
+
const Oe = {
|
|
247
247
|
clipboard_text_received: d({
|
|
248
248
|
req_id: x(),
|
|
249
249
|
data: P(x())
|
|
@@ -260,8 +260,8 @@ const Fe = {
|
|
|
260
260
|
),
|
|
261
261
|
viewport_changed: P(
|
|
262
262
|
d({
|
|
263
|
-
height:
|
|
264
|
-
width: P(
|
|
263
|
+
height: N(),
|
|
264
|
+
width: P(N(), () => window.innerWidth),
|
|
265
265
|
is_state_stable: G(),
|
|
266
266
|
is_expanded: G()
|
|
267
267
|
}),
|
|
@@ -277,16 +277,16 @@ const Fe = {
|
|
|
277
277
|
theme_params: Se()
|
|
278
278
|
})
|
|
279
279
|
};
|
|
280
|
-
function
|
|
280
|
+
function Z(e) {
|
|
281
281
|
if (e.source !== window.parent)
|
|
282
282
|
return;
|
|
283
283
|
let t;
|
|
284
284
|
try {
|
|
285
|
-
t = V(
|
|
285
|
+
t = V(I(j()), e.data);
|
|
286
286
|
} catch {
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
const { eventType: r, eventData: n } = t, a =
|
|
289
|
+
const { eventType: r, eventData: n } = t, a = Oe[r];
|
|
290
290
|
let o;
|
|
291
291
|
try {
|
|
292
292
|
o = a ? V(a, n) : n;
|
|
@@ -305,13 +305,13 @@ function X(e) {
|
|
|
305
305
|
}
|
|
306
306
|
const {
|
|
307
307
|
on: D,
|
|
308
|
-
off:
|
|
308
|
+
off: Fe,
|
|
309
309
|
emit: Re,
|
|
310
310
|
clear: Ue
|
|
311
|
-
} =
|
|
311
|
+
} = z(
|
|
312
312
|
() => {
|
|
313
313
|
const e = window;
|
|
314
|
-
!e.VBotGameProxy && (e.VBotGameProxy = {}), q(e.VBotGameProxy, "receiveEvent", k),
|
|
314
|
+
!e.VBotGameProxy && (e.VBotGameProxy = {}), q(e.VBotGameProxy, "receiveEvent", k), Y(e, "VBotGameProxy"), !e.VBot && (e.VBot = {}), !e.VBot.WebView && (e.VBot.WebView = {}), q(e.VBot.WebView, "receiveEvent", k), Y(e.VBot, "WebView"), q(e, "VBotGameProxy_receiveEvent", k), window.addEventListener("message", Z);
|
|
315
315
|
},
|
|
316
316
|
() => {
|
|
317
317
|
[
|
|
@@ -326,7 +326,7 @@ const {
|
|
|
326
326
|
return;
|
|
327
327
|
const [n, a] = r;
|
|
328
328
|
"unwrap" in a && (a.unwrap(), n && n !== t && !Object.keys(n).length && delete t[e[0]]);
|
|
329
|
-
}), window.removeEventListener("message",
|
|
329
|
+
}), window.removeEventListener("message", Z);
|
|
330
330
|
}
|
|
331
331
|
), Ie = (...e) => m()(...e);
|
|
332
332
|
function je(e, t) {
|
|
@@ -344,7 +344,7 @@ function je(e, t) {
|
|
|
344
344
|
function S(e, t) {
|
|
345
345
|
g().log("Posting event:", t ? { eventType: e, eventData: t } : { eventType: e });
|
|
346
346
|
const r = window, n = JSON.stringify({ eventType: e, eventData: t });
|
|
347
|
-
return
|
|
347
|
+
return $() ? (Ie(n, le()), c.right(void 0)) : ue(r) ? (r.VBotWebviewProxy.postEvent(e, JSON.stringify(t)), c.right(void 0)) : R(d({ external: d({ notify: ne() }) }), r) ? (r.external.notify(n), c.right(void 0)) : c.left(new we());
|
|
348
348
|
}
|
|
349
349
|
function J(e, t, r = {}) {
|
|
350
350
|
const {
|
|
@@ -431,9 +431,9 @@ function _t({ launchParams: e, onEvent: t, resetPostMessage: r } = {}) {
|
|
|
431
431
|
} catch (s) {
|
|
432
432
|
throw new fe(o, s);
|
|
433
433
|
}
|
|
434
|
-
|
|
434
|
+
U("launchParams", o);
|
|
435
435
|
}
|
|
436
|
-
if (
|
|
436
|
+
if ($()) {
|
|
437
437
|
if (!t)
|
|
438
438
|
return;
|
|
439
439
|
r && m.reset();
|
|
@@ -443,7 +443,7 @@ function _t({ launchParams: e, onEvent: t, resetPostMessage: r } = {}) {
|
|
|
443
443
|
o(...s);
|
|
444
444
|
};
|
|
445
445
|
try {
|
|
446
|
-
const p = V(
|
|
446
|
+
const p = V(I(j()), i);
|
|
447
447
|
t({ name: p.eventType, params: p.eventData }, _);
|
|
448
448
|
} catch {
|
|
449
449
|
_();
|
|
@@ -479,9 +479,9 @@ function ut({ launchParams: e, onEvent: t, resetPostMessage: r } = {}) {
|
|
|
479
479
|
} catch (s) {
|
|
480
480
|
throw new fe(o, s);
|
|
481
481
|
}
|
|
482
|
-
|
|
482
|
+
U("launchParams", o);
|
|
483
483
|
}
|
|
484
|
-
if (
|
|
484
|
+
if ($()) {
|
|
485
485
|
if (!t)
|
|
486
486
|
return;
|
|
487
487
|
r && m.reset();
|
|
@@ -491,7 +491,7 @@ function ut({ launchParams: e, onEvent: t, resetPostMessage: r } = {}) {
|
|
|
491
491
|
o(...s);
|
|
492
492
|
};
|
|
493
493
|
try {
|
|
494
|
-
const p = V(
|
|
494
|
+
const p = V(I(j()), i);
|
|
495
495
|
t({ name: p.eventType, params: p.eventData }, _);
|
|
496
496
|
} catch {
|
|
497
497
|
_();
|
|
@@ -522,7 +522,7 @@ function ft(e, t = "*") {
|
|
|
522
522
|
n.emit(i, _);
|
|
523
523
|
} catch {
|
|
524
524
|
}
|
|
525
|
-
}, n =
|
|
525
|
+
}, n = z(
|
|
526
526
|
() => {
|
|
527
527
|
window.addEventListener("message", r);
|
|
528
528
|
},
|
|
@@ -546,7 +546,7 @@ function ft(e, t = "*") {
|
|
|
546
546
|
return h = a, a;
|
|
547
547
|
}
|
|
548
548
|
function wt() {
|
|
549
|
-
const e =
|
|
549
|
+
const e = z(
|
|
550
550
|
() => {
|
|
551
551
|
},
|
|
552
552
|
() => {
|
|
@@ -583,8 +583,8 @@ function dt() {
|
|
|
583
583
|
function ze(e) {
|
|
584
584
|
return ({ req_id: t }) => t === e;
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
"
|
|
586
|
+
const F = {
|
|
587
|
+
"3.0": [
|
|
588
588
|
"iframe_ready",
|
|
589
589
|
"iframe_will_reload",
|
|
590
590
|
"web_app_close",
|
|
@@ -595,50 +595,36 @@ const Z = {
|
|
|
595
595
|
"web_app_request_theme",
|
|
596
596
|
"web_app_request_viewport",
|
|
597
597
|
"web_app_setup_main_button",
|
|
598
|
-
"web_app_setup_closing_behavior"
|
|
599
|
-
],
|
|
600
|
-
6.1: [
|
|
598
|
+
"web_app_setup_closing_behavior",
|
|
601
599
|
"web_app_open_vb_link",
|
|
602
600
|
"web_app_open_invoice",
|
|
603
601
|
"web_app_setup_back_button",
|
|
604
602
|
"web_app_set_background_color",
|
|
605
603
|
"web_app_set_header_color",
|
|
606
|
-
"web_app_trigger_haptic_feedback"
|
|
607
|
-
|
|
608
|
-
6.2: ["web_app_open_popup"],
|
|
609
|
-
6.4: [
|
|
604
|
+
"web_app_trigger_haptic_feedback",
|
|
605
|
+
"web_app_open_popup",
|
|
610
606
|
"web_app_close_scan_qr_popup",
|
|
611
607
|
"web_app_open_scan_qr_popup",
|
|
612
608
|
"web_app_read_text_from_clipboard",
|
|
613
|
-
{ method: "web_app_open_link", param: "try_instant_view" }
|
|
614
|
-
|
|
615
|
-
6.7: ["web_app_switch_inline_query"],
|
|
616
|
-
6.9: [
|
|
609
|
+
{ method: "web_app_open_link", param: "try_instant_view" },
|
|
610
|
+
"web_app_switch_inline_query",
|
|
617
611
|
"web_app_invoke_custom_method",
|
|
618
612
|
"web_app_request_write_access",
|
|
619
613
|
"web_app_request_phone",
|
|
620
|
-
{ method: "web_app_set_header_color", param: "color" }
|
|
621
|
-
|
|
622
|
-
"6.10": ["web_app_setup_settings_button"],
|
|
623
|
-
7.2: [
|
|
614
|
+
{ method: "web_app_set_header_color", param: "color" },
|
|
615
|
+
"web_app_setup_settings_button",
|
|
624
616
|
"web_app_biometry_get_info",
|
|
625
617
|
"web_app_biometry_open_settings",
|
|
626
618
|
"web_app_biometry_request_access",
|
|
627
619
|
"web_app_biometry_request_auth",
|
|
628
|
-
"web_app_biometry_update_token"
|
|
629
|
-
],
|
|
630
|
-
7.6: [
|
|
620
|
+
"web_app_biometry_update_token",
|
|
631
621
|
{ method: "web_app_open_link", param: "try_browser" },
|
|
632
|
-
{ method: "web_app_close", param: "return_back" }
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
7.8: ["web_app_share_to_story"],
|
|
636
|
-
"7.10": [
|
|
622
|
+
{ method: "web_app_close", param: "return_back" },
|
|
623
|
+
"web_app_setup_swipe_behavior",
|
|
624
|
+
"web_app_share_to_story",
|
|
637
625
|
"web_app_setup_secondary_button",
|
|
638
626
|
"web_app_set_bottom_bar_color",
|
|
639
|
-
{ method: "web_app_setup_main_button", param: "has_shine_effect" }
|
|
640
|
-
],
|
|
641
|
-
"8.0": [
|
|
627
|
+
{ method: "web_app_setup_main_button", param: "has_shine_effect" },
|
|
642
628
|
"web_app_request_safe_area",
|
|
643
629
|
"web_app_request_content_safe_area",
|
|
644
630
|
"web_app_request_fullscreen",
|
|
@@ -658,30 +644,27 @@ const Z = {
|
|
|
658
644
|
"web_app_stop_accelerometer",
|
|
659
645
|
"web_app_stop_device_orientation",
|
|
660
646
|
"web_app_stop_gyroscope",
|
|
661
|
-
"web_app_toggle_orientation_lock"
|
|
662
|
-
],
|
|
663
|
-
"9.0": [
|
|
647
|
+
"web_app_toggle_orientation_lock",
|
|
664
648
|
"web_app_device_storage_clear",
|
|
665
649
|
"web_app_device_storage_get_key",
|
|
666
650
|
"web_app_device_storage_save_key",
|
|
667
651
|
"web_app_secure_storage_clear",
|
|
668
652
|
"web_app_secure_storage_get_key",
|
|
669
653
|
"web_app_secure_storage_restore_key",
|
|
670
|
-
"web_app_secure_storage_save_key"
|
|
671
|
-
|
|
672
|
-
9.1: ["web_app_hide_keyboard"],
|
|
673
|
-
9.2: [
|
|
654
|
+
"web_app_secure_storage_save_key",
|
|
655
|
+
"web_app_hide_keyboard",
|
|
674
656
|
"web_app_send_notification",
|
|
675
657
|
"web_app_finish_refresh"
|
|
676
658
|
]
|
|
677
659
|
};
|
|
678
660
|
function ee(e, t) {
|
|
679
|
-
return Object.keys(
|
|
661
|
+
return Object.keys(F).find((n) => F[n].some((a) => t ? typeof a == "object" && a.method === e && a.param === t : a === e)) || null;
|
|
680
662
|
}
|
|
663
|
+
const lt = Object.keys(F).pop() || "3.0";
|
|
681
664
|
function te(e) {
|
|
682
665
|
return e.split(".").map(Number);
|
|
683
666
|
}
|
|
684
|
-
function
|
|
667
|
+
function Te(e, t) {
|
|
685
668
|
const r = te(e), n = te(t), a = Math.max(r.length, n.length);
|
|
686
669
|
for (let o = 0; o < a; o += 1) {
|
|
687
670
|
const s = r[o] || 0, i = n[o] || 0;
|
|
@@ -695,18 +678,18 @@ function re(e, t, r) {
|
|
|
695
678
|
e,
|
|
696
679
|
t
|
|
697
680
|
) : ee(e);
|
|
698
|
-
return n ?
|
|
681
|
+
return n ? Te(n, r || t) <= 0 : !1;
|
|
699
682
|
}
|
|
700
|
-
function
|
|
683
|
+
function bt(e, t = "strict") {
|
|
701
684
|
const r = typeof t == "function" ? t : (n) => {
|
|
702
685
|
const { method: a, version: o } = n, s = "param" in n ? new We(a, n.param, o) : new Ve(a, o);
|
|
703
686
|
if (t === "strict")
|
|
704
687
|
throw s;
|
|
705
688
|
return g().forceWarn(s.message);
|
|
706
689
|
};
|
|
707
|
-
return ((n, a) => re(n, e) ? n === "web_app_set_header_color" &&
|
|
690
|
+
return ((n, a) => re(n, e) ? n === "web_app_set_header_color" && R(d({ color: ye() }), a) && !re(n, "color", e) ? r({ version: e, method: n, param: "color" }) : je(n, a) : r({ version: e, method: n }));
|
|
708
691
|
}
|
|
709
|
-
function
|
|
692
|
+
function De(e, t, r, n) {
|
|
710
693
|
return w.pipe(
|
|
711
694
|
J("web_app_invoke_custom_method", "custom_method_invoked", {
|
|
712
695
|
...n || {},
|
|
@@ -716,10 +699,10 @@ function Je(e, t, r, n) {
|
|
|
716
699
|
l.chain(({ result: a, error: o }) => o ? l.left(new Ae(o)) : l.right(a))
|
|
717
700
|
);
|
|
718
701
|
}
|
|
719
|
-
function
|
|
702
|
+
function mt(e, t, r, n) {
|
|
720
703
|
return se.fn(() => w.pipe(
|
|
721
704
|
// @ts-expect-error TypeScript is unable to determine required override.
|
|
722
|
-
|
|
705
|
+
De(e, t, r, n),
|
|
723
706
|
l.match(
|
|
724
707
|
(a) => {
|
|
725
708
|
throw a;
|
|
@@ -728,7 +711,7 @@ function bt(e, t, r, n) {
|
|
|
728
711
|
)
|
|
729
712
|
)());
|
|
730
713
|
}
|
|
731
|
-
function
|
|
714
|
+
function Je(e, t, r = {}) {
|
|
732
715
|
const {
|
|
733
716
|
// If no capture function was passed, we capture the first compatible event.
|
|
734
717
|
capture: n = () => !0,
|
|
@@ -758,11 +741,11 @@ function Ge(e, t, r = {}) {
|
|
|
758
741
|
l.mapBoth(_, _)
|
|
759
742
|
);
|
|
760
743
|
}
|
|
761
|
-
function
|
|
744
|
+
function ht(e, t, r) {
|
|
762
745
|
const { postEvent: n } = r || {};
|
|
763
746
|
return A(
|
|
764
747
|
// @ts-expect-error TypeScript will not be able to handle our overrides here.
|
|
765
|
-
|
|
748
|
+
Je(e, t, {
|
|
766
749
|
...r,
|
|
767
750
|
postEvent: n ? (...a) => {
|
|
768
751
|
try {
|
|
@@ -774,7 +757,7 @@ function mt(e, t, r) {
|
|
|
774
757
|
})
|
|
775
758
|
);
|
|
776
759
|
}
|
|
777
|
-
function
|
|
760
|
+
function gt() {
|
|
778
761
|
Object.hasOwn || (Object.hasOwn = function(e, t) {
|
|
779
762
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
780
763
|
});
|
|
@@ -786,57 +769,58 @@ function me(e) {
|
|
|
786
769
|
).split("").map((t) => "%" + ("00" + t.charCodeAt(0).toString(16)).slice(-2)).join("")
|
|
787
770
|
), (t) => t);
|
|
788
771
|
}
|
|
789
|
-
const
|
|
772
|
+
const yt = C(me);
|
|
790
773
|
function he(e) {
|
|
791
774
|
return btoa(
|
|
792
775
|
encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, (t, r) => String.fromCharCode(parseInt(`0x${r}`)))
|
|
793
776
|
).replace(/\+/g, "-").replace(/\//g, "_");
|
|
794
777
|
}
|
|
795
|
-
function
|
|
778
|
+
function Ge(e) {
|
|
796
779
|
const t = he(typeof e == "string" ? e : JSON.stringify(e));
|
|
797
780
|
return t.length > 512 ? c.left(new Error("Value is too long for start parameter")) : c.right(t);
|
|
798
781
|
}
|
|
799
|
-
const
|
|
800
|
-
function
|
|
782
|
+
const vt = C(Ge);
|
|
783
|
+
function Et(e, t) {
|
|
801
784
|
return A(
|
|
802
|
-
|
|
785
|
+
Ne(
|
|
803
786
|
e,
|
|
804
787
|
// @ts-expect-error TypeScript is unable to detect a correct override.
|
|
805
788
|
typeof t == "function" ? (r) => c.tryCatch(() => t(r), (n) => n) : t
|
|
806
789
|
)
|
|
807
790
|
);
|
|
808
791
|
}
|
|
809
|
-
function
|
|
792
|
+
function Ne(e, t) {
|
|
810
793
|
return w.pipe(
|
|
811
794
|
me(e),
|
|
812
795
|
c.chain((r) => t ? typeof t == "function" ? t(r) : xe.parse(r) : c.right(r))
|
|
813
796
|
);
|
|
814
797
|
}
|
|
815
|
-
function
|
|
798
|
+
function Pt(e) {
|
|
816
799
|
return he(e).length <= 512;
|
|
817
800
|
}
|
|
818
801
|
export {
|
|
819
|
-
|
|
802
|
+
Wt as CancelledError,
|
|
820
803
|
fe as InvalidLaunchParamsError,
|
|
821
804
|
Ae as InvokeCustomMethodFailedError,
|
|
805
|
+
lt as LATEST_VERSION,
|
|
822
806
|
Ce as LaunchParamsRetrieveError,
|
|
823
807
|
We as MethodParameterUnsupportedError,
|
|
824
808
|
Ve as MethodUnsupportedError,
|
|
825
|
-
|
|
809
|
+
Ct as TimeoutError,
|
|
826
810
|
we as UnknownEnvError,
|
|
827
|
-
|
|
811
|
+
gt as applyPolyfills,
|
|
828
812
|
ze as captureSameReq,
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
813
|
+
Te as compareVersions,
|
|
814
|
+
St as createLogger,
|
|
815
|
+
bt as createPostEvent,
|
|
816
|
+
vt as createStartParam,
|
|
817
|
+
Ge as createStartParamFp,
|
|
834
818
|
de as debug,
|
|
835
|
-
|
|
819
|
+
yt as decodeBase64Url,
|
|
836
820
|
me as decodeBase64UrlFp,
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
821
|
+
Et as decodeStartParam,
|
|
822
|
+
Ne as decodeStartParamFp,
|
|
823
|
+
kt as deepSnakeToCamelObjKeys,
|
|
840
824
|
ft as defineHostBridge,
|
|
841
825
|
wt as defineWebComponentBridge,
|
|
842
826
|
k as emitEvent,
|
|
@@ -844,25 +828,25 @@ export {
|
|
|
844
828
|
dt as getHostBridge,
|
|
845
829
|
ee as getReleaseVersion,
|
|
846
830
|
ue as hasWebviewProxy,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
831
|
+
mt as invokeCustomMethod,
|
|
832
|
+
De as invokeCustomMethodFp,
|
|
833
|
+
$ as isIframe,
|
|
834
|
+
Pt as isSafeToCreateStartParam,
|
|
851
835
|
ct as isVBma,
|
|
852
836
|
$e as isVBmaFp,
|
|
853
837
|
g as logger,
|
|
854
838
|
_t as mockVBotEnv,
|
|
855
|
-
|
|
839
|
+
Fe as off,
|
|
856
840
|
Ue as offAll,
|
|
857
841
|
D as on,
|
|
858
842
|
je as postEvent,
|
|
859
843
|
S as postEventFp,
|
|
860
844
|
Ie as postMessage,
|
|
861
845
|
m as postMessageImpl,
|
|
862
|
-
|
|
846
|
+
ht as request,
|
|
863
847
|
pt as request2,
|
|
864
848
|
J as request2Fp,
|
|
865
|
-
|
|
849
|
+
Je as requestFp,
|
|
866
850
|
it as resetGlobals,
|
|
867
851
|
rt as retrieveLaunchParams,
|
|
868
852
|
Le as retrieveLaunchParamsFp,
|