@vbotma/sdk 3.3.3 → 3.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ var pt = (n, e, s) => e in n ? ct(n, e, { enumerable: !0, configurable: !0, writ
3
3
  var t = (n, e, s) => pt(n, typeof e != "symbol" ? e + "" : e, s);
4
4
  import { batch as ue, signal as O, computed as S } from "@vbotma/signals";
5
5
  import { supports as te, isVBmaFp as ut, postEventFp as ye, off as ne, on as j, request2Fp as Ge, requestFp as lt, invokeCustomMethodFp as dt, retrieveLaunchParamsFp as le, retrieveRawInitDataFp as ht, captureSameReq as _t, getHostBridge as d, logger as He } from "@vbotma/bridge";
6
- import { CancelledError as Mi, InvalidLaunchParamsError as Ri, InvokeCustomMethodFailedError as Ti, LaunchParamsRetrieveError as Vi, MethodParameterUnsupportedError as Li, MethodUnsupportedError as $i, TimeoutError as Pi, UnknownEnvError as Hi, applyPolyfills as Oi, createLogger as Di, createPostEvent as ji, createStartParam as Gi, createStartParamFp as Ui, debug as Wi, decodeBase64Url as Qi, decodeBase64UrlFp as Ki, decodeStartParam as zi, decodeStartParamFp as Ni, deepSnakeToCamelObjKeys as Ji, defineHostBridge as Yi, emitEvent as Zi, encodeBase64Url as Xi, getHostBridge as eo, getReleaseVersion as to, isSafeToCreateStartParam as so, isVBma as ro, isVBmaFp as no, logger as io, mockVBotEnv as oo, off as ao, offAll as co, on as po, retrieveLaunchParams as uo, retrieveLaunchParamsFp as lo, retrieveRawInitData as ho, retrieveRawInitDataFp as _o, retrieveRawLaunchParams as bo, retrieveRawLaunchParamsFp as fo, setDebug as go, setLaunchParams as mo, setTargetOrigin as wo, supports as Fo, targetOrigin as So } from "@vbotma/bridge";
7
- import { throwifyFpFn as he, throwifyAnyEither as Ue, setStorageValue as bt, getStorageValue as ft, snakeToKebab as gt, createCbCollector as qe, camelToKebab as We, BetterTaskEither as we } from "@vbotma/toolkit";
6
+ import { CancelledError as Mi, InvalidLaunchParamsError as Ri, InvokeCustomMethodFailedError as Vi, LaunchParamsRetrieveError as Ti, MethodParameterUnsupportedError as Li, MethodUnsupportedError as $i, TimeoutError as Pi, UnknownEnvError as Hi, applyPolyfills as Oi, createLogger as Di, createPostEvent as ji, createStartParam as Gi, createStartParamFp as Wi, debug as Ui, decodeBase64Url as Qi, decodeBase64UrlFp as Ki, decodeStartParam as zi, decodeStartParamFp as Ni, deepSnakeToCamelObjKeys as Ji, defineHostBridge as Yi, defineWebComponentBridge as Zi, emitEvent as Xi, encodeBase64Url as eo, getHostBridge as to, getReleaseVersion as so, isSafeToCreateStartParam as ro, isVBma as no, isVBmaFp as io, logger as oo, mockVBotEnv as ao, off as co, offAll as po, on as uo, retrieveLaunchParams as lo, retrieveLaunchParamsFp as ho, retrieveRawInitData as _o, retrieveRawInitDataFp as bo, retrieveRawLaunchParams as fo, retrieveRawLaunchParamsFp as go, setDebug as mo, setLaunchParams as wo, setTargetOrigin as Fo, supports as So, targetOrigin as Co } from "@vbotma/bridge";
7
+ import { throwifyFpFn as he, throwifyAnyEither as We, setStorageValue as bt, getStorageValue as ft, snakeToKebab as gt, createCbCollector as qe, camelToKebab as Ue, BetterTaskEither as we } from "@vbotma/toolkit";
8
8
  import { BetterPromise as Qe } from "better-promises";
9
9
  import { toRGBFullFp as mt, isRGB as be, pipeQueryToSchema as wt, pipeJsonToSchema as Ft } from "@vbotma/transformers";
10
- import { isAnyRGB as vo, isRGB as ko, isRGBA as yo, isRGBAShort as qo, isRGBShort as Io, parseInitDataQuery as Eo, parseInitDataQueryFp as Bo, parseLaunchParamsQuery as Ao, parseLaunchParamsQueryFp as xo, serializeInitDataQuery as Mo, serializeLaunchParamsQuery as Ro, toRGB as To, toRGBFp as Vo, toRGBFull as Lo, toRGBFullFp as $o } from "@vbotma/transformers";
10
+ import { isAnyRGB as ko, isRGB as yo, isRGBA as qo, isRGBAShort as Io, isRGBShort as Bo, parseInitDataQuery as Eo, parseInitDataQueryFp as Ao, parseLaunchParamsQuery as xo, parseLaunchParamsQueryFp as Mo, serializeInitDataQuery as Ro, serializeLaunchParamsQuery as Vo, toRGB as To, toRGBFp as Lo, toRGBFull as $o, toRGBFullFp as Po } from "@vbotma/transformers";
11
11
  import { either as m, function as p, option as N, taskEither as u } from "fp-ts";
12
12
  import { errorClass as G, errorClassWithData as Ie } from "error-kid";
13
13
  import { parse as Oe, record as St, string as z, array as Ct, safeParse as Fe, looseObject as De, pipe as Ke, transform as ze, date as Ne, optional as vt, number as Je, integer as kt } from "valibot";
@@ -95,7 +95,7 @@ class Y {
95
95
  return !fe({ ...this.state(), ...Se(e) }, this.state());
96
96
  }
97
97
  }
98
- function U(n, e) {
98
+ function W(n, e) {
99
99
  return S(() => te(n, P(e)));
100
100
  }
101
101
  // @__NO_SIDE_EFFECTS__
@@ -108,7 +108,7 @@ function h(n) {
108
108
  () => ({ ok: !1 }),
109
109
  (s) => ({
110
110
  ok: !0,
111
- data: Ue(s)
111
+ data: We(s)
112
112
  })
113
113
  )
114
114
  );
@@ -124,7 +124,7 @@ class pe extends (/* @__PURE__ */ Ie(
124
124
  "Validation error"
125
125
  )) {
126
126
  }
127
- class Ee extends (/* @__PURE__ */ G(
127
+ class Be extends (/* @__PURE__ */ G(
128
128
  "CSSVarsBoundError",
129
129
  "CSS variables are already bound"
130
130
  )) {
@@ -143,7 +143,7 @@ class _n extends (/* @__PURE__ */ G(
143
143
  ee
144
144
  )) {
145
145
  }
146
- class Et extends (/* @__PURE__ */ G(
146
+ class Bt extends (/* @__PURE__ */ G(
147
147
  "FunctionNotAvailableError",
148
148
  ee
149
149
  )) {
@@ -153,12 +153,12 @@ class Q extends (/* @__PURE__ */ G(
153
153
  (e, s) => [e, { cause: s }]
154
154
  )) {
155
155
  }
156
- class Be extends (/* @__PURE__ */ G(
156
+ class Ee extends (/* @__PURE__ */ G(
157
157
  "ConcurrentCallError",
158
158
  ee
159
159
  )) {
160
160
  }
161
- class Bt extends (/* @__PURE__ */ G(
161
+ class Et extends (/* @__PURE__ */ G(
162
162
  "SetEmojiStatusError",
163
163
  (e) => [`Failed to set emoji status: ${e}`]
164
164
  )) {
@@ -194,9 +194,9 @@ function A(n, e) {
194
194
  return;
195
195
  const [g, w] = "every" in c ? ["every", c.every] : ["some", c.some];
196
196
  for (let _ = 0; _ < w.length; _++) {
197
- const x = w[_], V = typeof x == "function" ? x() : te(x, s()) ? void 0 : `it is unsupported in Mini Apps version ${s()}`;
198
- if (V && (g === "every" || _ === w.length - 1))
199
- return V;
197
+ const x = w[_], T = typeof x == "function" ? x() : te(x, s()) ? void 0 : `it is unsupported in Mini Apps version ${s()}`;
198
+ if (T && (g === "every" || _ === w.length - 1))
199
+ return T;
200
200
  }
201
201
  }, f = (...g) => {
202
202
  for (const w in e.supports)
@@ -205,12 +205,12 @@ function A(n, e) {
205
205
  }, F = S(() => !l()), b = S(() => s() !== "0.0"), k = S(() => e.isMounted ? e.isMounted() : !0), C = S(
206
206
  () => r() && b() && F() && k()
207
207
  ), q = (g) => {
208
- const w = new Et(g);
208
+ const w = new Bt(g);
209
209
  return ["task", "promise"].includes(e.returns) ? u.left(w) : m.left(w);
210
210
  }, I = (...g) => o === "plain" ? m.tryCatch(() => n(...g), (w) => w) : o === "promise" ? u.tryCatch(() => n(...g), (w) => w) : n(...g);
211
211
  return Object.assign(
212
212
  (...g) => {
213
- var V;
213
+ var T;
214
214
  const w = "Unable to call function:";
215
215
  if (!r())
216
216
  return q(`${w} it can't be called outside Mini Apps`);
@@ -223,7 +223,7 @@ function A(n, e) {
223
223
  if (x)
224
224
  return q(`${w} ${x}`);
225
225
  if (!k()) {
226
- const R = (V = e.isMounting) != null && V.call(e) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
226
+ const R = (T = e.isMounting) != null && T.call(e) ? "mounting. Wait for the mount completion" : "unmounted. Use the mount() method";
227
227
  return q(`${w} the component is ${R}`);
228
228
  }
229
229
  return I(...g);
@@ -239,7 +239,7 @@ function A(n, e) {
239
239
  e.supports ? { supports: a } : {}
240
240
  );
241
241
  }
242
- function E(n) {
242
+ function B(n) {
243
243
  return (e) => A(e, n);
244
244
  }
245
245
  class _e {
@@ -344,15 +344,15 @@ class _e {
344
344
  isPageReload: c,
345
345
  onMounted: b.setState,
346
346
  restoreState: s.get
347
- }), C = { version: F, requires: f, isVBma: e }, q = E({
347
+ }), C = { version: F, requires: f, isVBma: e }, q = B({
348
348
  ...C,
349
349
  returns: "plain"
350
- }), I = E({
350
+ }), I = B({
351
351
  ...C,
352
352
  returns: "either",
353
353
  isMounted: k.isMounted
354
354
  });
355
- this.isMounted = k.isMounted, this.isSupported = U(f, F), this.state = b.state, this.setStateFp = I((g) => {
355
+ this.isMounted = k.isMounted, this.isSupported = W(f, F), this.state = b.state, this.setStateFp = I((g) => {
356
356
  const w = { ...this.state(), ...Se(g) };
357
357
  return b.hasDiff(w) ? p.pipe(
358
358
  a(f, l(w)),
@@ -485,10 +485,10 @@ function se(n) {
485
485
  function oe(n, e) {
486
486
  return O(n, e);
487
487
  }
488
- const Ze = /* @__PURE__ */ oe(ye), re = (...n) => Ze()(...n), Tt = (...n) => Ue(re(...n)), T = se({
488
+ const Ze = /* @__PURE__ */ oe(ye), re = (...n) => Ze()(...n), Vt = (...n) => We(re(...n)), V = se({
489
489
  postEvent: re
490
490
  });
491
- function Vt(n) {
491
+ function Tt(n) {
492
492
  return {
493
493
  get: () => ft(n),
494
494
  set(e) {
@@ -505,7 +505,7 @@ function $t() {
505
505
  }
506
506
  function Z(n) {
507
507
  return se({
508
- storage: Vt(n),
508
+ storage: Tt(n),
509
509
  isPageReload: $t
510
510
  });
511
511
  }
@@ -515,7 +515,7 @@ function Ae(n, e) {
515
515
  return {
516
516
  ...p.pipe(
517
517
  v(),
518
- T,
518
+ V,
519
519
  y,
520
520
  Z(n)
521
521
  ),
@@ -703,18 +703,18 @@ class Pt {
703
703
  c(f);
704
704
  },
705
705
  restoreState: i.get
706
- }), k = { version: e, requires: "web_app_biometry_request_auth", isVBma: a }, C = E({
706
+ }), k = { version: e, requires: "web_app_biometry_request_auth", isVBma: a }, C = B({
707
707
  ...k,
708
708
  returns: "either"
709
- }), q = E({
709
+ }), q = B({
710
710
  ...k,
711
711
  returns: "task"
712
- }), I = E({
712
+ }), I = B({
713
713
  ...k,
714
714
  isMounted: b.isMounted,
715
715
  returns: "task"
716
716
  });
717
- this.isAvailable = F.getter("available"), this.isMounted = b.isMounted, this.isSupported = U("web_app_biometry_request_auth", e), this.state = F.state, this.unmount = b.unmount, this.mountFp = q(b.mount), this.authenticateFp = I((g) => this.isAvailable() ? p.pipe(
717
+ this.isAvailable = F.getter("available"), this.isMounted = b.isMounted, this.isSupported = W("web_app_biometry_request_auth", e), this.state = F.state, this.unmount = b.unmount, this.mountFp = q(b.mount), this.authenticateFp = I((g) => this.isAvailable() ? p.pipe(
718
718
  s("web_app_biometry_request_auth", "biometry_auth_requested", {
719
719
  ...g,
720
720
  params: { reason: ((g || {}).reason || "").trim() }
@@ -752,7 +752,7 @@ function Ot() {
752
752
  return new Pt({
753
753
  ...p.pipe(
754
754
  v(),
755
- T,
755
+ V,
756
756
  y,
757
757
  L,
758
758
  Z("biometry")
@@ -814,10 +814,10 @@ class Dt {
814
814
  restoreState: s.get,
815
815
  initialState: { isConfirmationEnabled: !1 },
816
816
  isPageReload: i
817
- }), a = { requires: "web_app_setup_closing_behavior", isVBma: r }, l = E({
817
+ }), a = { requires: "web_app_setup_closing_behavior", isVBma: r }, l = B({
818
818
  ...a,
819
819
  returns: "plain"
820
- }), f = E({
820
+ }), f = B({
821
821
  ...a,
822
822
  returns: "either",
823
823
  isMounted: c.isMounted
@@ -835,7 +835,7 @@ function jt() {
835
835
  return new Dt(p.pipe(
836
836
  v(),
837
837
  Z("closingBehavior"),
838
- T
838
+ V
839
839
  ));
840
840
  }
841
841
  const wn = /* @__PURE__ */ jt();
@@ -910,13 +910,13 @@ class Gt {
910
910
  * @see clearFp
911
911
  */
912
912
  t(this, "clear");
913
- const i = E({
913
+ const i = B({
914
914
  version: e,
915
915
  requires: "web_app_invoke_custom_method",
916
916
  isVBma: s,
917
917
  returns: "task"
918
918
  });
919
- this.isSupported = U("web_app_invoke_custom_method", e), this.deleteItemFp = i((o, c) => {
919
+ this.isSupported = W("web_app_invoke_custom_method", e), this.deleteItemFp = i((o, c) => {
920
920
  const a = Array.isArray(o) ? o : [o];
921
921
  return p.pipe(
922
922
  a.length ? r("deleteStorageValues", { keys: a }, c) : u.right(void 0),
@@ -947,23 +947,23 @@ const me = /* @__PURE__ */ oe(0);
947
947
  function Me() {
948
948
  return me.set(me() + 1), me().toString();
949
949
  }
950
- function Ut(n, e, s) {
950
+ function Wt(n, e, s) {
951
951
  return dt(n, e, Me(), {
952
952
  ...s || {},
953
953
  postEvent: re
954
954
  });
955
955
  }
956
956
  const Re = se({
957
- invokeCustomMethod: Ut
957
+ invokeCustomMethod: Wt
958
958
  });
959
- function Wt() {
959
+ function Ut() {
960
960
  return new Gt(p.pipe(
961
961
  v(),
962
962
  y,
963
963
  Re
964
964
  ));
965
965
  }
966
- const Fn = /* @__PURE__ */ Wt();
966
+ const Fn = /* @__PURE__ */ Ut();
967
967
  class Qt {
968
968
  constructor({ isVBma: e, request: s, version: r, createRequestId: i }) {
969
969
  /**
@@ -1002,7 +1002,7 @@ class Qt {
1002
1002
  * @see clearFp
1003
1003
  */
1004
1004
  t(this, "clear");
1005
- const o = E({
1005
+ const o = B({
1006
1006
  version: r,
1007
1007
  requires: "web_app_device_storage_get_key",
1008
1008
  isVBma: e,
@@ -1065,7 +1065,7 @@ function Yt({ request: n, ...e }) {
1065
1065
  },
1066
1066
  ...r
1067
1067
  }),
1068
- u.chainW((i) => i.event === "emoji_status_failed" ? u.left(new Bt(i.payload.error)) : u.right(void 0))
1068
+ u.chainW((i) => i.event === "emoji_status_failed" ? u.left(new Et(i.payload.error)) : u.right(void 0))
1069
1069
  ), {
1070
1070
  ...e,
1071
1071
  requires: "web_app_set_emoji_status",
@@ -1088,7 +1088,7 @@ class es {
1088
1088
  */
1089
1089
  t(this, "isSupported");
1090
1090
  /**
1091
- * A method that tells if an impact occurred. The Telegram app may play the
1091
+ * A method that tells if an impact occurred. The VBot app may play the
1092
1092
  * appropriate haptics based on style value passed.
1093
1093
  * @param style - impact style.
1094
1094
  * @since Mini Apps v6.1
@@ -1100,7 +1100,7 @@ class es {
1100
1100
  t(this, "impactOccurred");
1101
1101
  /**
1102
1102
  * A method tells that a task or action has succeeded, failed, or produced
1103
- * a warning. The Telegram app may play the appropriate haptics based on type
1103
+ * a warning. The VBot app may play the appropriate haptics based on type
1104
1104
  * value passed.
1105
1105
  * @param type - notification type.
1106
1106
  * @since Mini Apps v6.1
@@ -1111,7 +1111,7 @@ class es {
1111
1111
  */
1112
1112
  t(this, "notificationOccurred");
1113
1113
  /**
1114
- * A method tells that the user has changed a selection. The Telegram app may
1114
+ * A method tells that the user has changed a selection. The VBot app may
1115
1115
  * play the appropriate haptics.
1116
1116
  *
1117
1117
  * Do not use this feedback when the user makes or confirms a selection; use
@@ -1123,19 +1123,19 @@ class es {
1123
1123
  * @see selectionChangedFp
1124
1124
  */
1125
1125
  t(this, "selectionChanged");
1126
- const i = "web_app_trigger_haptic_feedback", o = E({
1126
+ const i = "web_app_trigger_haptic_feedback", o = B({
1127
1127
  requires: i,
1128
1128
  isVBma: s,
1129
1129
  version: r,
1130
1130
  returns: "plain"
1131
1131
  });
1132
- this.isSupported = U(i, r), this.impactOccurredFp = o((c) => e(i, { type: "impact", impact_style: c })), this.notificationOccurredFp = o((c) => e(i, { type: "notification", notification_type: c })), this.selectionChangedFp = o(() => e(i, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1132
+ this.isSupported = W(i, r), this.impactOccurredFp = o((c) => e(i, { type: "impact", impact_style: c })), this.notificationOccurredFp = o((c) => e(i, { type: "notification", notification_type: c })), this.selectionChangedFp = o(() => e(i, { type: "selection_change" })), this.impactOccurred = /* @__PURE__ */ h(this.impactOccurredFp), this.notificationOccurred = /* @__PURE__ */ h(this.notificationOccurredFp), this.selectionChanged = /* @__PURE__ */ h(this.selectionChangedFp);
1133
1133
  }
1134
1134
  }
1135
1135
  function ts() {
1136
1136
  return new es(p.pipe(
1137
1137
  v(),
1138
- T,
1138
+ V,
1139
1139
  y
1140
1140
  ));
1141
1141
  }
@@ -1148,7 +1148,7 @@ function rs() {
1148
1148
  return ss(p.pipe(
1149
1149
  v(),
1150
1150
  y,
1151
- T
1151
+ V
1152
1152
  ));
1153
1153
  }
1154
1154
  const ns = /* @__PURE__ */ rs(), yn = /* @__PURE__ */ h(ns);
@@ -1185,7 +1185,6 @@ class cs {
1185
1185
  t(this, "canSendAfter", this.fromState("can_send_after"));
1186
1186
  /**
1187
1187
  * Date after which it is allowed to call
1188
- * the [answerWebAppQuery](https://core.telegram.org/bots/api#answerwebappquery) method.
1189
1188
  */
1190
1189
  t(this, "canSendAfterDate", S(() => {
1191
1190
  const e = this.authDate(), s = this.canSendAfter();
@@ -1307,14 +1306,14 @@ class us {
1307
1306
  * @param options - additional options.
1308
1307
  * @since Mini Apps v6.1
1309
1308
  * @example
1310
- * const status = await invoice.openUrl('https://t.me/$kJNFS331');
1309
+ * const status = await invoice.openUrl('https://vbot.vn/$kJNFS331');
1311
1310
  */
1312
1311
  t(this, "openUrlFp");
1313
1312
  /**
1314
1313
  * @see openUrlFp
1315
1314
  */
1316
1315
  t(this, "openUrl");
1317
- const i = E({
1316
+ const i = B({
1318
1317
  version: e,
1319
1318
  isVBma: r,
1320
1319
  requires: "web_app_open_invoice",
@@ -1322,8 +1321,8 @@ class us {
1322
1321
  }), o = O(!1), c = () => {
1323
1322
  o.set(!1);
1324
1323
  };
1325
- this.isSupported = U("web_app_open_invoice", e), this.isOpened = S(o), this.openSlugFp = i((a, l) => p.pipe(
1326
- this.isOpened() ? u.left(new Be("Invoice is already opened")) : u.right(void 0),
1324
+ this.isSupported = W("web_app_open_invoice", e), this.isOpened = S(o), this.openSlugFp = i((a, l) => p.pipe(
1325
+ this.isOpened() ? u.left(new Ee("Invoice is already opened")) : u.right(void 0),
1327
1326
  u.chain(() => (o.set(!0), s("web_app_open_invoice", "invoice_closed", {
1328
1327
  ...l,
1329
1328
  params: { slug: a },
@@ -1332,7 +1331,7 @@ class us {
1332
1331
  u.mapBoth((f) => (c(), f), (f) => (c(), f.status))
1333
1332
  )), this.openUrlFp = i((a, l) => {
1334
1333
  const { hostname: f, pathname: F } = new URL(a, window.location.href);
1335
- if (f !== "t.me")
1334
+ if (f !== "vbot.vn")
1336
1335
  return u.left(new Q(`Link has unexpected hostname: ${f}`));
1337
1336
  const b = F.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1338
1337
  return b ? this.openSlugFp(b[2], l) : u.left(new Q(
@@ -1344,7 +1343,7 @@ class us {
1344
1343
  function ls() {
1345
1344
  return new us(p.pipe(v(), L, y));
1346
1345
  }
1347
- const En = /* @__PURE__ */ ls();
1346
+ const Bn = /* @__PURE__ */ ls();
1348
1347
  function ds({ postEvent: n, ...e }) {
1349
1348
  return A((s, r = {}) => {
1350
1349
  if (typeof s == "string")
@@ -1362,27 +1361,27 @@ function ds({ postEvent: n, ...e }) {
1362
1361
  }
1363
1362
  // @__NO_SIDE_EFFECTS__
1364
1363
  function hs() {
1365
- return ds(p.pipe(v(), T));
1364
+ return ds(p.pipe(v(), V));
1366
1365
  }
1367
- const _s = /* @__PURE__ */ hs(), Bn = /* @__PURE__ */ h(_s);
1366
+ const _s = /* @__PURE__ */ hs(), En = /* @__PURE__ */ h(_s);
1368
1367
  function bs({ postEvent: n, version: e, ...s }) {
1369
1368
  return A((r) => {
1370
1369
  const i = r.toString();
1371
- return i.match(/^https:\/\/t.me\/.+/) ? te("web_app_open_tg_link", P(e)) ? (r = new URL(r), n("web_app_open_tg_link", { path_full: r.pathname + r.search })) : (window.location.href = i, m.right(void 0)) : m.left(new Q(`"${i}" is invalid URL`));
1370
+ return i.match(/^https:\/\/vbot\.vn\/.+/) ? te("web_app_open_tg_link", P(e)) ? (r = new URL(r), n("web_app_open_tg_link", { path_full: r.pathname + r.search })) : (window.location.href = i, m.right(void 0)) : m.left(new Q(`"${i}" is invalid URL`));
1372
1371
  }, { ...s, returns: "either" });
1373
1372
  }
1374
1373
  // @__NO_SIDE_EFFECTS__
1375
1374
  function fs() {
1376
1375
  return bs(p.pipe(
1377
1376
  v(),
1378
- T,
1377
+ V,
1379
1378
  y
1380
1379
  ));
1381
1380
  }
1382
1381
  const tt = /* @__PURE__ */ fs(), An = /* @__PURE__ */ h(tt);
1383
1382
  function gs({ openVbotLink: n, ...e }) {
1384
1383
  return A((s, r) => n(
1385
- "https://t.me/share/url?" + new URLSearchParams({ url: s, text: r || "" }).toString().replace(/\+/g, "%20")
1384
+ "https://vbot.vn/share/url?" + new URLSearchParams({ url: s, text: r || "" }).toString().replace(/\+/g, "%20")
1386
1385
  ), { ...e, returns: "either" });
1387
1386
  }
1388
1387
  // @__NO_SIDE_EFFECTS__
@@ -1487,18 +1486,18 @@ class Ss {
1487
1486
  u.map(Fs)
1488
1487
  );
1489
1488
  }
1490
- }), f = { version: e, requires: "web_app_check_location", isVBma: o }, F = E({
1489
+ }), f = { version: e, requires: "web_app_check_location", isVBma: o }, F = B({
1491
1490
  ...f,
1492
1491
  returns: "either"
1493
- }), b = E({
1492
+ }), b = B({
1494
1493
  ...f,
1495
1494
  returns: "task"
1496
- }), k = E({
1495
+ }), k = B({
1497
1496
  ...f,
1498
1497
  returns: "task",
1499
1498
  isMounted: l.isMounted
1500
1499
  });
1501
- this.isAvailable = a.getter("available"), this.isAccessRequested = a.getter("accessRequested"), this.isAccessGranted = a.getter("accessGranted"), this.isSupported = U("web_app_check_location", e), this.isMounted = l.isMounted, this.state = a.state, this.unmount = l.unmount, this.mountFp = b(l.mount), this.openSettingsFp = F(() => r("web_app_open_location_settings")), this.requestLocationFp = k((C) => p.pipe(
1500
+ this.isAvailable = a.getter("available"), this.isAccessRequested = a.getter("accessRequested"), this.isAccessGranted = a.getter("accessGranted"), this.isSupported = W("web_app_check_location", e), this.isMounted = l.isMounted, this.state = a.state, this.unmount = l.unmount, this.mountFp = b(l.mount), this.openSettingsFp = F(() => r("web_app_open_location_settings")), this.requestLocationFp = k((C) => p.pipe(
1502
1501
  s("web_app_request_location", "location_requested", C),
1503
1502
  u.map((q) => {
1504
1503
  if (!q.available)
@@ -1512,7 +1511,7 @@ class Ss {
1512
1511
  function Cs() {
1513
1512
  return new Ss(p.pipe(
1514
1513
  v(),
1515
- T,
1514
+ V,
1516
1515
  y,
1517
1516
  L,
1518
1517
  Z("locationManager")
@@ -1745,10 +1744,10 @@ class vs {
1745
1744
  }
1746
1745
  //#endregion
1747
1746
  }
1748
- function Te(n, e) {
1747
+ function Ve(n, e) {
1749
1748
  document.documentElement.style.setProperty(n, e);
1750
1749
  }
1751
- function Ve(n) {
1750
+ function Te(n) {
1752
1751
  document.documentElement.style.removeProperty(n);
1753
1752
  }
1754
1753
  function ks(n) {
@@ -1887,13 +1886,13 @@ class ys {
1887
1886
  r(l);
1888
1887
  },
1889
1888
  restoreState: o.get
1890
- }), F = { isVBma: i, returns: "either" }, b = E(F), k = E({
1889
+ }), F = { isVBma: i, returns: "either" }, b = B(F), k = B({
1891
1890
  ...F,
1892
1891
  isMounted: f.isMounted
1893
1892
  });
1894
1893
  this.accentTextColor = a.getter("accent_text_color"), this.bgColor = a.getter("bg_color"), this.buttonColor = a.getter("button_color"), this.buttonTextColor = a.getter("button_text_color"), this.bottomBarBgColor = a.getter("bottom_bar_bg_color"), this.destructiveTextColor = a.getter("destructive_text_color"), this.headerBgColor = a.getter("header_bg_color"), this.hintColor = a.getter("hint_color"), this.linkColor = a.getter("link_color"), this.secondaryBgColor = a.getter("secondary_bg_color"), this.sectionBgColor = a.getter("section_bg_color"), this.sectionHeaderTextColor = a.getter("section_header_text_color"), this.sectionSeparatorColor = a.getter("section_separator_color"), this.subtitleTextColor = a.getter("subtitle_text_color"), this.textColor = a.getter("text_color"), this.state = a.state, this.isMounted = f.isMounted, this.bindCssVarsFp = k((C) => {
1895
1894
  if (this._isCssVarsBound())
1896
- return m.left(new Ee());
1895
+ return m.left(new Be());
1897
1896
  C || (C = (g) => `--vb-theme-${gt(g)}`);
1898
1897
  const q = (g) => {
1899
1898
  Object.entries(a.state()).forEach(([w, _]) => {
@@ -1901,11 +1900,11 @@ class ys {
1901
1900
  });
1902
1901
  }, I = () => {
1903
1902
  q((g, w) => {
1904
- Te(C(g), w);
1903
+ Ve(C(g), w);
1905
1904
  });
1906
1905
  };
1907
1906
  return I(), a.state.sub(I), this._isCssVarsBound.set(!0), m.right(() => {
1908
- q(Ve), a.state.unsub(I), this._isCssVarsBound.set(!1);
1907
+ q(Te), a.state.unsub(I), this._isCssVarsBound.set(!1);
1909
1908
  });
1910
1909
  }), this.mountFp = b(f.mount), this.unmount = f.unmount, this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp), this.mount = /* @__PURE__ */ h(this.mountFp);
1911
1910
  }
@@ -2104,7 +2103,7 @@ class Is {
2104
2103
  */
2105
2104
  t(this, "close");
2106
2105
  /**
2107
- * Informs the Telegram app that the Mini App is ready to be displayed.
2106
+ * Informs the VBot app that the Mini App is ready to be displayed.
2108
2107
  *
2109
2108
  * It is recommended to call this method as early as possible, as soon as all
2110
2109
  * essential interface elements loaded.
@@ -2127,11 +2126,11 @@ class Is {
2127
2126
  [this.headerColor, "web_app_set_header_color"],
2128
2127
  [this.bgColor, "web_app_set_background_color"],
2129
2128
  [this.bottomBarColor, "web_app_set_bottom_bar_color"]
2130
- ].forEach(([x, V]) => {
2129
+ ].forEach(([x, T]) => {
2131
2130
  const R = x();
2132
- if (!be(R) && (V !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(R))) {
2131
+ if (!be(R) && (T !== "web_app_set_header_color" || !["bg_color", "secondary_bg_color"].includes(R))) {
2133
2132
  const H = _[R];
2134
- H && i(V, { color: H });
2133
+ H && i(T, { color: H });
2135
2134
  }
2136
2135
  });
2137
2136
  }, b = new ie({
@@ -2176,19 +2175,19 @@ class Is {
2176
2175
  const I = O(!1);
2177
2176
  this.isCssVarsBound = S(I), this.bindCssVarsFp = A((_) => {
2178
2177
  if (I())
2179
- return m.left(new Ee());
2180
- const [x, V] = qe(() => {
2178
+ return m.left(new Be());
2179
+ const [x, T] = qe(() => {
2181
2180
  I.set(!1);
2182
2181
  }), R = (H, $) => {
2183
- const W = () => {
2184
- Te(H, $() || null);
2182
+ const U = () => {
2183
+ Ve(H, $() || null);
2185
2184
  };
2186
- W(), x($.sub(W), Ve.bind(null, H));
2185
+ U(), x($.sub(U), Te.bind(null, H));
2187
2186
  };
2188
- return _ || (_ = (H) => `--tg-${We(H)}`), R(_("bgColor"), this.bgColorRgb), R(_("bottomBarColor"), this.bottomBarColorRgb), R(_("headerColor"), this.headerColorRgb), I.set(!0), m.right(V);
2187
+ return _ || (_ = (H) => `--tg-${Ue(H)}`), R(_("bgColor"), this.bgColorRgb), R(_("bottomBarColor"), this.bottomBarColorRgb), R(_("headerColor"), this.headerColorRgb), I.set(!0), m.right(T);
2189
2188
  }, { isVBma: o, returns: "either", isMounted: this.isMounted }), this.bindCssVars = /* @__PURE__ */ h(this.bindCssVarsFp);
2190
2189
  const g = (_) => {
2191
- const x = k.getter(_), V = q(x), R = {
2190
+ const x = k.getter(_), T = q(x), R = {
2192
2191
  headerColor: "web_app_set_header_color",
2193
2192
  bgColor: "web_app_set_background_color",
2194
2193
  bottomBarColor: "web_app_set_bottom_bar_color"
@@ -2203,9 +2202,9 @@ class Is {
2203
2202
  k.setState({ [_]: $ });
2204
2203
  })
2205
2204
  );
2206
- const W = C($);
2205
+ const U = C($);
2207
2206
  return p.pipe(
2208
- W ? i(R, { color: W }) : m.left(new Mt($)),
2207
+ U ? i(R, { color: U }) : m.left(new Mt($)),
2209
2208
  m.map(() => {
2210
2209
  k.setState({ [_]: $ });
2211
2210
  })
@@ -2226,7 +2225,7 @@ class Is {
2226
2225
  } : void 0
2227
2226
  }
2228
2227
  );
2229
- return [x, V, /* @__PURE__ */ h(H), H];
2228
+ return [x, T, /* @__PURE__ */ h(H), H];
2230
2229
  };
2231
2230
  [
2232
2231
  this.bgColor,
@@ -2244,16 +2243,16 @@ class Is {
2244
2243
  this.setBottomBarColor,
2245
2244
  this.setBottomBarColorFp
2246
2245
  ] = g("bottomBarColor");
2247
- const w = E({ isVBma: o, returns: "either" });
2246
+ const w = B({ isVBma: o, returns: "either" });
2248
2247
  this.closeFp = w((_) => i("web_app_close", { return_back: _ })), this.close = /* @__PURE__ */ h(this.closeFp), this.readyFp = w(() => i("web_app_ready")), this.ready = /* @__PURE__ */ h(this.readyFp);
2249
2248
  }
2250
2249
  //#endregion
2251
2250
  }
2252
- function Es() {
2251
+ function Bs() {
2253
2252
  return new Is({
2254
2253
  ...p.pipe(
2255
2254
  v(),
2256
- T,
2255
+ V,
2257
2256
  y,
2258
2257
  Z("miniApp")
2259
2258
  ),
@@ -2266,7 +2265,7 @@ function Es() {
2266
2265
  theme: de.state
2267
2266
  });
2268
2267
  }
2269
- const Bs = /* @__PURE__ */ Es();
2268
+ const Es = /* @__PURE__ */ Bs();
2270
2269
  function As() {
2271
2270
  const n = Date.now(), e = Math.random().toString(36).substring(2, 9);
2272
2271
  return `notif_${n}_${e}`;
@@ -2287,13 +2286,13 @@ class xs {
2287
2286
  * @see sendFp
2288
2287
  */
2289
2288
  t(this, "send");
2290
- const r = E({
2289
+ const r = B({
2291
2290
  version: e,
2292
2291
  isVBma: s,
2293
2292
  requires: "web_app_send_notification",
2294
2293
  returns: "task"
2295
2294
  });
2296
- this.isSupported = U("web_app_send_notification", e), this.sendFp = r((i) => p.pipe(
2295
+ this.isSupported = W("web_app_send_notification", e), this.sendFp = r((i) => p.pipe(
2297
2296
  u.fromEither(ye("web_app_send_notification", {
2298
2297
  id: As(),
2299
2298
  message: i.message,
@@ -2312,7 +2311,7 @@ class xs {
2312
2311
  function Ms() {
2313
2312
  return new xs(y(v()));
2314
2313
  }
2315
- const Tn = /* @__PURE__ */ Ms();
2314
+ const Vn = /* @__PURE__ */ Ms();
2316
2315
  function Rs(n) {
2317
2316
  const e = n.message.trim(), s = (n.title || "").trim(), r = n.buttons || [];
2318
2317
  if (s.length > 64)
@@ -2339,7 +2338,7 @@ function Rs(n) {
2339
2338
  }
2340
2339
  return m.right({ title: s, message: e, buttons: i });
2341
2340
  }
2342
- class Ts {
2341
+ class Vs {
2343
2342
  constructor({ version: e, isVBma: s, request: r }) {
2344
2343
  /**
2345
2344
  * Signal indicating if any popup is currently opened.
@@ -2381,14 +2380,14 @@ class Ts {
2381
2380
  t(this, "show");
2382
2381
  const i = O(!1), o = () => {
2383
2382
  i.set(!1);
2384
- }, c = E({
2383
+ }, c = B({
2385
2384
  version: e,
2386
2385
  isVBma: s,
2387
2386
  requires: "web_app_open_popup",
2388
2387
  returns: "task"
2389
2388
  });
2390
- this.isSupported = U("web_app_open_popup", e), this.isOpened = S(i), this.showFp = c((a) => p.pipe(
2391
- this.isOpened() ? u.left(new Be("A popup is already opened")) : u.right(void 0),
2389
+ this.isSupported = W("web_app_open_popup", e), this.isOpened = S(i), this.showFp = c((a) => p.pipe(
2390
+ this.isOpened() ? u.left(new Ee("A popup is already opened")) : u.right(void 0),
2392
2391
  u.chainW(() => u.fromEither(Rs(a))),
2393
2392
  u.chain((l) => (i.set(!0), r("web_app_open_popup", "popup_closed", {
2394
2393
  ...a,
@@ -2401,10 +2400,10 @@ class Ts {
2401
2400
  )), this.show = /* @__PURE__ */ h(this.showFp);
2402
2401
  }
2403
2402
  }
2404
- function Vs() {
2405
- return new Ts(p.pipe(v(), L, y));
2403
+ function Ts() {
2404
+ return new Vs(p.pipe(v(), L, y));
2406
2405
  }
2407
- const Vn = /* @__PURE__ */ Vs();
2406
+ const Tn = /* @__PURE__ */ Ts();
2408
2407
  function Ls({ request: n, ...e }) {
2409
2408
  return A((s) => p.pipe(
2410
2409
  n("web_app_request_phone", "phone_requested", s),
@@ -2522,14 +2521,14 @@ function Gs({ request: n, ...e }) {
2522
2521
  ), { ...e, requires: "web_app_request_write_access", returns: "task" });
2523
2522
  }
2524
2523
  // @__NO_SIDE_EFFECTS__
2525
- function Us() {
2524
+ function Ws() {
2526
2525
  return Gs(p.pipe(
2527
2526
  v(),
2528
2527
  y,
2529
2528
  L
2530
2529
  ));
2531
2530
  }
2532
- const Ws = /* @__PURE__ */ Us(), Hn = /* @__PURE__ */ h(Ws);
2531
+ const Us = /* @__PURE__ */ Ws(), Hn = /* @__PURE__ */ h(Us);
2533
2532
  class Qs {
2534
2533
  constructor({
2535
2534
  version: e,
@@ -2617,10 +2616,10 @@ class Qs {
2617
2616
  * @see openFp
2618
2617
  */
2619
2618
  t(this, "open");
2620
- const c = { version: e, requires: "web_app_open_scan_qr_popup", isVBma: i }, a = E({ ...c, returns: "either" }), l = E({ ...c, returns: "task" }), f = O(!1), F = () => {
2619
+ const c = { version: e, requires: "web_app_open_scan_qr_popup", isVBma: i }, a = B({ ...c, returns: "either" }), l = B({ ...c, returns: "task" }), f = O(!1), F = () => {
2621
2620
  f.set(!1);
2622
2621
  };
2623
- this.isSupported = U("web_app_open_scan_qr_popup", e), this.isOpened = S(f), this.captureFp = l((b) => {
2622
+ this.isSupported = W("web_app_open_scan_qr_popup", e), this.isOpened = S(f), this.captureFp = l((b) => {
2624
2623
  let k;
2625
2624
  return p.pipe(
2626
2625
  this.openFp({
@@ -2632,7 +2631,7 @@ class Qs {
2632
2631
  u.map(() => k)
2633
2632
  );
2634
2633
  }), this.closeFp = a(() => p.pipe(o("web_app_close_scan_qr_popup"), m.map(F))), this.openFp = l((b) => p.pipe(
2635
- f() ? u.left(new Be("The QR Scanner is already opened")) : async () => o("web_app_open_scan_qr_popup", { text: b.text }),
2634
+ f() ? u.left(new Ee("The QR Scanner is already opened")) : async () => o("web_app_open_scan_qr_popup", { text: b.text }),
2636
2635
  u.chainW(() => {
2637
2636
  f.set(!0);
2638
2637
  const [k, C] = qe(), q = (I) => (C(), f.set(!1), I);
@@ -2656,7 +2655,7 @@ class Qs {
2656
2655
  }
2657
2656
  function Ks() {
2658
2657
  return new Qs({
2659
- ...p.pipe(v(), T, y),
2658
+ ...p.pipe(v(), V, y),
2660
2659
  onClosed(n) {
2661
2660
  return j("scan_qr_popup_closed", n);
2662
2661
  },
@@ -2967,7 +2966,7 @@ class Js {
2967
2966
  const a = r.stateGetter(o);
2968
2967
  return S(() => a() || P(c));
2969
2968
  };
2970
- this.isSupported = U("web_app_setup_secondary_button", s.version), this.bgColor = i("bgColor", e.bgColor), this.textColor = i("textColor", e.textColor), this.position = r.stateGetter("position"), this.hasShineEffect = r.stateGetter("hasShineEffect"), this.isEnabled = r.stateGetter("isEnabled"), this.isLoaderVisible = r.stateGetter("isLoaderVisible"), this.text = r.stateGetter("text"), this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.state = r.state, [this.setPosition, this.setPositionFp] = r.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = r.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = r.stateSetters("textColor"), [
2969
+ this.isSupported = W("web_app_setup_secondary_button", s.version), this.bgColor = i("bgColor", e.bgColor), this.textColor = i("textColor", e.textColor), this.position = r.stateGetter("position"), this.hasShineEffect = r.stateGetter("hasShineEffect"), this.isEnabled = r.stateGetter("isEnabled"), this.isLoaderVisible = r.stateGetter("isLoaderVisible"), this.text = r.stateGetter("text"), this.isVisible = r.stateGetter("isVisible"), this.isMounted = r.isMounted, this.state = r.state, [this.setPosition, this.setPositionFp] = r.stateSetters("position"), [this.setBgColor, this.setBgColorFp] = r.stateSetters("bgColor"), [this.setTextColor, this.setTextColorFp] = r.stateSetters("textColor"), [
2971
2970
  [this.disableShineEffect, this.disableShineEffectFp],
2972
2971
  [this.enableShineEffect, this.enableShineEffectFp]
2973
2972
  ] = r.stateBoolSetters("hasShineEffect"), [
@@ -2983,7 +2982,7 @@ class Js {
2983
2982
  function Ys() {
2984
2983
  return new Js(
2985
2984
  /* @__PURE__ */ rt("secondaryButton", "secondary_button_pressed", {
2986
- bgColor: S(() => Bs.bottomBarColorRgb() || "#000000"),
2985
+ bgColor: S(() => Es.bottomBarColorRgb() || "#000000"),
2987
2986
  textColor: S(() => de.buttonColor() || "#2481cc")
2988
2987
  })
2989
2988
  );
@@ -3036,7 +3035,7 @@ class Zs {
3036
3035
  * @see clearFp
3037
3036
  */
3038
3037
  t(this, "clear");
3039
- const o = E({
3038
+ const o = B({
3040
3039
  version: r,
3041
3040
  requires: "web_app_secure_storage_get_key",
3042
3041
  isVBma: e,
@@ -3172,7 +3171,7 @@ class er {
3172
3171
  this.isVisible = s.stateGetter("isVisible"), this.isMounted = s.isMounted, this.isSupported = s.isSupported, [[this.hide, this.hideFp], [this.show, this.showFp]] = s.stateBoolSetters("isVisible"), this.onClick = s.onClick, this.onClickFp = s.onClickFp, this.offClick = s.offClick, this.offClickFp = s.offClickFp, this.mount = s.mount, this.mountFp = s.mountFp, this.unmount = s.unmount;
3173
3172
  }
3174
3173
  }
3175
- const Un = /* @__PURE__ */ new er(
3174
+ const Wn = /* @__PURE__ */ new er(
3176
3175
  /* @__PURE__ */ Ae("settingsButton", "settings_button_pressed")
3177
3176
  );
3178
3177
  class tr {
@@ -3230,10 +3229,10 @@ class tr {
3230
3229
  isPageReload: i,
3231
3230
  onMounted: a.setState,
3232
3231
  restoreState: s.get
3233
- }), f = { requires: "web_app_setup_swipe_behavior", isVBma: r, version: o }, F = E({
3232
+ }), f = { requires: "web_app_setup_swipe_behavior", isVBma: r, version: o }, F = B({
3234
3233
  ...f,
3235
3234
  returns: "plain"
3236
- }), b = E({
3235
+ }), b = B({
3237
3236
  ...f,
3238
3237
  isMounted: l.isMounted,
3239
3238
  returns: "either"
@@ -3246,7 +3245,7 @@ class tr {
3246
3245
  })
3247
3246
  ) : m.right(void 0);
3248
3247
  };
3249
- this.isSupported = U("web_app_setup_swipe_behavior", o), this.isVerticalEnabled = a.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = b(() => k(!1)), this.enableVerticalFp = b(() => k(!0)), this.mountFp = F(() => {
3248
+ this.isSupported = W("web_app_setup_swipe_behavior", o), this.isVerticalEnabled = a.getter("isVerticalEnabled"), this.isMounted = l.isMounted, this.disableVerticalFp = b(() => k(!1)), this.enableVerticalFp = b(() => k(!0)), this.mountFp = F(() => {
3250
3249
  const C = () => {
3251
3250
  };
3252
3251
  return p.pipe(l.mount(), m.match(C, C));
@@ -3256,12 +3255,12 @@ class tr {
3256
3255
  function sr() {
3257
3256
  return new tr(p.pipe(
3258
3257
  v(),
3259
- T,
3258
+ V,
3260
3259
  y,
3261
3260
  Z("swipeBehavior")
3262
3261
  ));
3263
3262
  }
3264
- const Wn = /* @__PURE__ */ sr();
3263
+ const Un = /* @__PURE__ */ sr();
3265
3264
  async function Qn(n) {
3266
3265
  try {
3267
3266
  const { clipboard: s } = navigator;
@@ -3324,7 +3323,7 @@ function pr({ postEvent: n, ...e }) {
3324
3323
  function ur() {
3325
3324
  return pr(p.pipe(
3326
3325
  v(),
3327
- T,
3326
+ V,
3328
3327
  y
3329
3328
  ));
3330
3329
  }
@@ -3355,7 +3354,7 @@ function hr() {
3355
3354
  }
3356
3355
  const _r = /* @__PURE__ */ hr(), Jn = /* @__PURE__ */ h(_r);
3357
3356
  function br(n) {
3358
- const e = {}, s = n.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3357
+ const e = {}, s = n.match(/VBot-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);
3359
3358
  if (s) {
3360
3359
  const [, r, i] = s;
3361
3360
  r && (e.appVersion = r), i && i.slice(1, i.length - 1).split(";").forEach((o) => {
@@ -3383,7 +3382,7 @@ function fr({ postEvent: n, ...e }) {
3383
3382
  }
3384
3383
  // @__NO_SIDE_EFFECTS__
3385
3384
  function gr() {
3386
- return fr(p.pipe(v(), T));
3385
+ return fr(p.pipe(v(), V));
3387
3386
  }
3388
3387
  const mr = /* @__PURE__ */ gr(), Zn = /* @__PURE__ */ h(mr);
3389
3388
  function wr({ request: n, ...e }) {
@@ -3419,7 +3418,7 @@ function Cr({ postEvent: n, ...e }) {
3419
3418
  function vr() {
3420
3419
  return Cr(p.pipe(
3421
3420
  v(),
3422
- T,
3421
+ V,
3423
3422
  y
3424
3423
  ));
3425
3424
  }
@@ -3441,14 +3440,14 @@ function qr() {
3441
3440
  return yr({
3442
3441
  ...p.pipe(
3443
3442
  v(),
3444
- T,
3443
+ V,
3445
3444
  y
3446
3445
  ),
3447
3446
  isInlineMode: ke
3448
3447
  });
3449
3448
  }
3450
3449
  const Ir = /* @__PURE__ */ qr(), ti = /* @__PURE__ */ h(Ir);
3451
- class Er {
3450
+ class Br {
3452
3451
  constructor({
3453
3452
  storage: e,
3454
3453
  isPageReload: s,
@@ -3665,24 +3664,24 @@ class Er {
3665
3664
  width: 0
3666
3665
  },
3667
3666
  onChange: e.set
3668
- }), x = (B) => {
3667
+ }), x = (E) => {
3669
3668
  _.setState({
3670
- isExpanded: B.is_expanded,
3671
- height: B.height,
3672
- width: B.width,
3673
- stableHeight: B.is_state_stable ? B.height : void 0
3669
+ isExpanded: E.is_expanded,
3670
+ height: E.height,
3671
+ width: E.width,
3672
+ stableHeight: E.is_state_stable ? E.height : void 0
3674
3673
  });
3675
- }, V = (B) => {
3676
- _.setState({ isFullscreen: B.is_fullscreen });
3677
- }, R = (B) => {
3678
- _.setState({ safeAreaInsets: B });
3679
- }, H = (B) => {
3680
- _.setState({ contentSafeAreaInsets: B });
3674
+ }, T = (E) => {
3675
+ _.setState({ isFullscreen: E.is_fullscreen });
3676
+ }, R = (E) => {
3677
+ _.setState({ safeAreaInsets: E });
3678
+ }, H = (E) => {
3679
+ _.setState({ contentSafeAreaInsets: E });
3681
3680
  }, $ = new xe({
3682
- initialState(B) {
3681
+ initialState(E) {
3683
3682
  const X = (K) => () => {
3684
3683
  const [J, D] = K === "safe-area" ? ["web_app_request_safe_area", "safe_area_changed"] : ["web_app_request_content_safe_area", "content_safe_area_changed"];
3685
- return te(J, P(I)) ? b(J, D, B) : u.right({ top: 0, left: 0, right: 0, bottom: 0 });
3684
+ return te(J, P(I)) ? b(J, D, E) : u.right({ top: 0, left: 0, right: 0, bottom: 0 });
3686
3685
  }, M = (K) => () => typeof K == "boolean" ? u.right(K) : u.fromEither(K());
3687
3686
  return p.pipe(
3688
3687
  u.Do,
@@ -3697,7 +3696,7 @@ class Er {
3697
3696
  stableHeight: window.innerHeight,
3698
3697
  width: window.innerWidth
3699
3698
  }) : p.pipe(
3700
- b("web_app_request_viewport", "viewport_changed", B),
3699
+ b("web_app_request_viewport", "viewport_changed", E),
3701
3700
  u.map((D) => ({
3702
3701
  ...J,
3703
3702
  height: D.height,
@@ -3709,26 +3708,26 @@ class Er {
3709
3708
  );
3710
3709
  },
3711
3710
  isPageReload: s,
3712
- onMounted(B) {
3713
- o(x), c(V), i(R), r(H), _.setState(B);
3711
+ onMounted(E) {
3712
+ o(x), c(T), i(R), r(H), _.setState(E);
3714
3713
  },
3715
3714
  onUnmounted() {
3716
- F(x), l(V), f(R), a(H);
3715
+ F(x), l(T), f(R), a(H);
3717
3716
  },
3718
3717
  restoreState: e.get
3719
- }), W = (B) => S(() => this.safeAreaInsets()[B]), ae = (B) => S(() => this.contentSafeAreaInsets()[B]);
3720
- this.state = _.state, this.height = _.getter("height"), this.stableHeight = _.getter("stableHeight"), this.width = _.getter("width"), this.isExpanded = _.getter("isExpanded"), this.safeAreaInsets = _.getter("safeAreaInsets"), this.safeAreaInsetTop = W("top"), this.safeAreaInsetBottom = W("bottom"), this.safeAreaInsetLeft = W("left"), this.safeAreaInsetRight = W("right"), this.contentSafeAreaInsets = _.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
3721
- const ot = E({ isVBma: q, returns: "task" }), Le = E({
3718
+ }), U = (E) => S(() => this.safeAreaInsets()[E]), ae = (E) => S(() => this.contentSafeAreaInsets()[E]);
3719
+ this.state = _.state, this.height = _.getter("height"), this.stableHeight = _.getter("stableHeight"), this.width = _.getter("width"), this.isExpanded = _.getter("isExpanded"), this.safeAreaInsets = _.getter("safeAreaInsets"), this.safeAreaInsetTop = U("top"), this.safeAreaInsetBottom = U("bottom"), this.safeAreaInsetLeft = U("left"), this.safeAreaInsetRight = U("right"), this.contentSafeAreaInsets = _.getter("contentSafeAreaInsets"), this.contentSafeAreaInsetTop = ae("top"), this.contentSafeAreaInsetBottom = ae("bottom"), this.contentSafeAreaInsetLeft = ae("left"), this.contentSafeAreaInsetRight = ae("right");
3720
+ const ot = B({ isVBma: q, returns: "task" }), Le = B({
3722
3721
  isVBma: q,
3723
3722
  returns: "either"
3724
- }), at = E({
3723
+ }), at = B({
3725
3724
  isVBma: q,
3726
3725
  requires: "web_app_request_fullscreen",
3727
3726
  version: I,
3728
3727
  returns: "task"
3729
- }), $e = (B) => at((X) => p.pipe(
3728
+ }), $e = (E) => at((X) => p.pipe(
3730
3729
  b(
3731
- B ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
3730
+ E ? "web_app_request_fullscreen" : "web_app_exit_fullscreen",
3732
3731
  ["fullscreen_changed", "fullscreen_failed"],
3733
3732
  X
3734
3733
  ),
@@ -3739,10 +3738,10 @@ class Er {
3739
3738
  this.isMounted = $.isMounted, this.mountFp = ot($.mount), this.mount = /* @__PURE__ */ h(this.mountFp), this.isFullscreen = _.getter("isFullscreen"), this.requestFullscreenFp = $e(!0), this.requestFullscreen = /* @__PURE__ */ h(this.requestFullscreenFp), this.exitFullscreenFp = $e(!1), this.exitFullscreen = /* @__PURE__ */ h(this.exitFullscreenFp);
3740
3739
  const ce = O(!1);
3741
3740
  this.isCssVarsBound = S(ce), this.bindCssVarsFp = Le(
3742
- (B) => {
3741
+ (E) => {
3743
3742
  if (ce())
3744
- return m.left(new Ee());
3745
- B || (B = (M) => `--vb-viewport-${We(M)}`);
3743
+ return m.left(new Be());
3744
+ E || (E = (M) => `--vb-viewport-${Ue(M)}`);
3746
3745
  const X = [
3747
3746
  ["height", this.height],
3748
3747
  ["stableHeight", this.stableHeight],
@@ -3756,10 +3755,10 @@ class Er {
3756
3755
  ["contentSafeAreaInsetLeft", this.contentSafeAreaInsetLeft],
3757
3756
  ["contentSafeAreaInsetRight", this.contentSafeAreaInsetRight]
3758
3757
  ].reduce((M, [K, J]) => {
3759
- const D = B(K);
3758
+ const D = E(K);
3760
3759
  if (D) {
3761
3760
  const Pe = () => {
3762
- Te(D, `${J()}px`);
3761
+ Ve(D, `${J()}px`);
3763
3762
  };
3764
3763
  M.push({ update: Pe, removeListener: J.sub(Pe), cssVar: D });
3765
3764
  }
@@ -3769,7 +3768,7 @@ class Er {
3769
3768
  M.update();
3770
3769
  }), ce.set(!0), m.right(() => {
3771
3770
  X.forEach((M) => {
3772
- M.removeListener(), Ve(M.cssVar);
3771
+ M.removeListener(), Te(M.cssVar);
3773
3772
  }), ce.set(!1);
3774
3773
  });
3775
3774
  }
@@ -3777,7 +3776,7 @@ class Er {
3777
3776
  }
3778
3777
  //#endregion
3779
3778
  }
3780
- function Br() {
3779
+ function Er() {
3781
3780
  const n = (o) => ({
3782
3781
  on: (c) => {
3783
3782
  j(o, c);
@@ -3786,12 +3785,12 @@ function Br() {
3786
3785
  ne(o, c);
3787
3786
  }
3788
3787
  }), e = n("viewport_changed"), s = n("fullscreen_changed"), r = n("safe_area_changed"), i = n("content_safe_area_changed");
3789
- return new Er({
3788
+ return new Br({
3790
3789
  ...p.pipe(
3791
3790
  v(),
3792
3791
  Z("viewport"),
3793
3792
  y,
3794
- T,
3793
+ V,
3795
3794
  L
3796
3795
  ),
3797
3796
  isFullscreen() {
@@ -3810,7 +3809,7 @@ function Br() {
3810
3809
  onViewportChanged: e.on
3811
3810
  });
3812
3811
  }
3813
- const si = /* @__PURE__ */ Br();
3812
+ const si = /* @__PURE__ */ Er();
3814
3813
  class Ar {
3815
3814
  constructor({ request: e }) {
3816
3815
  /**
@@ -3918,7 +3917,7 @@ class Rr {
3918
3917
  }
3919
3918
  }
3920
3919
  const ii = new Rr();
3921
- class Tr {
3920
+ class Vr {
3922
3921
  /**
3923
3922
  * Listens to 'web_app_setup_secondary_button' methods calls from Mini App.
3924
3923
  */
@@ -3935,8 +3934,8 @@ class Tr {
3935
3934
  d().send("secondary_button_pressed");
3936
3935
  }
3937
3936
  }
3938
- const oi = new Tr();
3939
- class Vr {
3937
+ const oi = new Vr();
3938
+ class Tr {
3940
3939
  /**
3941
3940
  * Listens to 'web_app_setup_settings_button' methods calls from Mini App.
3942
3941
  */
@@ -3953,7 +3952,7 @@ class Vr {
3953
3952
  d().send("settings_button_pressed");
3954
3953
  }
3955
3954
  }
3956
- const ai = new Vr();
3955
+ const ai = new Tr();
3957
3956
  class Lr {
3958
3957
  /**
3959
3958
  * Listens to 'web_app_open_popup' methods calls from Mini App.
@@ -4314,7 +4313,7 @@ class Gr {
4314
4313
  }
4315
4314
  }
4316
4315
  const bi = new Gr();
4317
- class Ur {
4316
+ class Wr {
4318
4317
  /**
4319
4318
  * Listens to 'web_app_open_link' methods calls from Mini App.
4320
4319
  */
@@ -4332,8 +4331,8 @@ class Ur {
4332
4331
  });
4333
4332
  }
4334
4333
  }
4335
- const fi = new Ur();
4336
- class Wr {
4334
+ const fi = new Wr();
4335
+ class Ur {
4337
4336
  /**
4338
4337
  * Listens to 'web_app_request_emoji_status_access' methods calls from Mini App.
4339
4338
  */
@@ -4369,7 +4368,7 @@ class Wr {
4369
4368
  d().send("emoji_status_failed", e);
4370
4369
  }
4371
4370
  }
4372
- const gi = new Wr();
4371
+ const gi = new Ur();
4373
4372
  class Qr {
4374
4373
  /**
4375
4374
  * Listens to 'web_app_add_to_home_screen' methods calls from Mini App.
@@ -4589,7 +4588,7 @@ class sn {
4589
4588
  });
4590
4589
  }
4591
4590
  }
4592
- const Ei = new sn();
4591
+ const Bi = new sn();
4593
4592
  function rn(n = {}) {
4594
4593
  const {
4595
4594
  version: e,
@@ -4611,12 +4610,12 @@ function rn(n = {}) {
4611
4610
  n.postEvent && Ze.set(n.postEvent);
4612
4611
  const [i, o] = qe(
4613
4612
  j("reload_iframe", () => {
4614
- He().log("Received a request to reload the page"), Tt("iframe_will_reload"), window.location.reload();
4613
+ He().log("Received a request to reload the page"), Vt("iframe_will_reload"), window.location.reload();
4615
4614
  })
4616
4615
  ), { acceptCustomStyles: c = !0 } = n;
4617
4616
  if (c) {
4618
4617
  const a = document.createElement("style");
4619
- a.id = "telegram-custom-styles", document.head.appendChild(a), i(
4618
+ a.id = "vbot-custom-styles", document.head.appendChild(a), i(
4620
4619
  j("set_custom_style", (l) => {
4621
4620
  a.innerHTML = l;
4622
4621
  }),
@@ -4630,20 +4629,20 @@ function rn(n = {}) {
4630
4629
  m.map(() => (He().log("The package was initialized"), o))
4631
4630
  );
4632
4631
  }
4633
- const Bi = he(rn);
4632
+ const Ei = he(rn);
4634
4633
  export {
4635
4634
  Ye as AccessDeniedError,
4636
4635
  Rt as BackButton,
4637
4636
  Pt as Biometry,
4638
- Ee as CSSVarsBoundError,
4637
+ Be as CSSVarsBoundError,
4639
4638
  Mi as CancelledError,
4640
4639
  Dt as ClosingBehavior,
4641
4640
  Gt as CloudStorage,
4642
- Be as ConcurrentCallError,
4641
+ Ee as ConcurrentCallError,
4643
4642
  Qt as DeviceStorage,
4644
4643
  yt as DeviceStorageMethodError,
4645
4644
  At as FullscreenFailedError,
4646
- Et as FunctionUnavailableError,
4645
+ Bt as FunctionUnavailableError,
4647
4646
  es as HapticFeedback,
4648
4647
  Mr as HostBackButton,
4649
4648
  Or as HostBiometry,
@@ -4651,12 +4650,12 @@ export {
4651
4650
  Jr as HostClipboard,
4652
4651
  zr as HostClosingBehavior,
4653
4652
  en as HostCustomMethod,
4654
- Wr as HostEmojiStatus,
4653
+ Ur as HostEmojiStatus,
4655
4654
  Yr as HostFiles,
4656
4655
  Hr as HostHapticFeedback,
4657
4656
  Qr as HostHomeScreen,
4658
4657
  Dr as HostInvoice,
4659
- Ur as HostLink,
4658
+ Wr as HostLink,
4660
4659
  Gr as HostLocationManager,
4661
4660
  Rr as HostMainButton,
4662
4661
  Pr as HostMiniApp,
@@ -4664,8 +4663,8 @@ export {
4664
4663
  Lr as HostPopup,
4665
4664
  Kr as HostPrivacy,
4666
4665
  jr as HostQrScanner,
4667
- Tr as HostSecondaryButton,
4668
- Vr as HostSettingsButton,
4666
+ Vr as HostSecondaryButton,
4667
+ Tr as HostSettingsButton,
4669
4668
  Zr as HostSharing,
4670
4669
  Nr as HostSwipeBehavior,
4671
4670
  sn as HostThemeParams,
@@ -4675,8 +4674,8 @@ export {
4675
4674
  _n as InvalidEnvError,
4676
4675
  Ri as InvalidLaunchParamsError,
4677
4676
  us as Invoice,
4678
- Ti as InvokeCustomMethodFailedError,
4679
- Vi as LaunchParamsRetrieveError,
4677
+ Vi as InvokeCustomMethodFailedError,
4678
+ Ti as LaunchParamsRetrieveError,
4680
4679
  Ss as LocationManager,
4681
4680
  vs as MainButton,
4682
4681
  Li as MethodParameterUnsupportedError,
@@ -4684,13 +4683,13 @@ export {
4684
4683
  Is as MiniApp,
4685
4684
  It as NotAvailableError,
4686
4685
  xs as Notification,
4687
- Ts as Popup,
4686
+ Vs as Popup,
4688
4687
  Qs as QrScanner,
4689
4688
  zs as Refresh,
4690
4689
  Js as SecondaryButton,
4691
4690
  Zs as SecureStorage,
4692
4691
  qt as SecureStorageMethodError,
4693
- Bt as SetEmojiStatusError,
4692
+ Et as SetEmojiStatusError,
4694
4693
  er as SettingsButton,
4695
4694
  xt as ShareMessageError,
4696
4695
  Ar as StoragePermission,
@@ -4700,7 +4699,7 @@ export {
4700
4699
  Hi as UnknownEnvError,
4701
4700
  Mt as UnknownThemeParamsKeyError,
4702
4701
  pe as ValidationError,
4703
- Er as Viewport,
4702
+ Br as Viewport,
4704
4703
  yn as addToHomeScreen,
4705
4704
  ns as addToHomeScreenFp,
4706
4705
  Oi as applyPolyfills,
@@ -4715,23 +4714,24 @@ export {
4715
4714
  ji as createPostEvent,
4716
4715
  Me as createRequestId,
4717
4716
  Gi as createStartParam,
4718
- Ui as createStartParamFp,
4719
- Wi as debug,
4717
+ Wi as createStartParamFp,
4718
+ Ui as debug,
4720
4719
  Qi as decodeBase64Url,
4721
4720
  Ki as decodeBase64UrlFp,
4722
4721
  zi as decodeStartParam,
4723
4722
  Ni as decodeStartParamFp,
4724
4723
  Ji as deepSnakeToCamelObjKeys,
4725
4724
  Yi as defineHostBridge,
4725
+ Zi as defineWebComponentBridge,
4726
4726
  Sn as deviceStorage,
4727
4727
  Kn as downloadFile,
4728
4728
  ir as downloadFileFp,
4729
- Zi as emitEvent,
4730
- Xi as encodeBase64Url,
4729
+ Xi as emitEvent,
4730
+ eo as encodeBase64Url,
4731
4731
  zn as getCurrentTime,
4732
4732
  cr as getCurrentTimeFp,
4733
- eo as getHostBridge,
4734
- to as getReleaseVersion,
4733
+ to as getHostBridge,
4734
+ so as getReleaseVersion,
4735
4735
  kn as hapticFeedback,
4736
4736
  Nn as hideKeyboard,
4737
4737
  lr as hideKeyboardFp,
@@ -4758,42 +4758,42 @@ export {
4758
4758
  ai as hostSettingsButton,
4759
4759
  ki as hostSharing,
4760
4760
  Si as hostSwipeBehavior,
4761
- Ei as hostThemeParams,
4761
+ Bi as hostThemeParams,
4762
4762
  pi as hostViewport,
4763
- Bi as init,
4763
+ Ei as init,
4764
4764
  In as initData,
4765
4765
  rn as initFp,
4766
- En as invoice,
4767
- Ut as invokeCustomMethod,
4768
- vo as isAnyRGB,
4766
+ Bn as invoice,
4767
+ Wt as invokeCustomMethod,
4768
+ ko as isAnyRGB,
4769
4769
  st as isColorDark,
4770
4770
  ks as isColorDarkFp,
4771
- ko as isRGB,
4772
- yo as isRGBA,
4773
- qo as isRGBAShort,
4774
- Io as isRGBShort,
4775
- so as isSafeToCreateStartParam,
4776
- ro as isVBma,
4777
- no as isVBmaFp,
4771
+ yo as isRGB,
4772
+ qo as isRGBA,
4773
+ Io as isRGBAShort,
4774
+ Bo as isRGBShort,
4775
+ ro as isSafeToCreateStartParam,
4776
+ no as isVBma,
4777
+ io as isVBmaFp,
4778
4778
  Mn as locationManager,
4779
- io as logger,
4779
+ oo as logger,
4780
4780
  Rn as mainButton,
4781
- Bs as miniApp,
4782
- oo as mockVBotEnv,
4783
- Tn as notification,
4784
- ao as off,
4785
- co as offAll,
4786
- po as on,
4787
- Bn as openLink,
4781
+ Es as miniApp,
4782
+ ao as mockVBotEnv,
4783
+ Vn as notification,
4784
+ co as off,
4785
+ po as offAll,
4786
+ uo as on,
4787
+ En as openLink,
4788
4788
  _s as openLinkFp,
4789
4789
  An as openVBotLink,
4790
4790
  tt as openVBotLinkFp,
4791
4791
  Eo as parseInitDataQuery,
4792
- Bo as parseInitDataQueryFp,
4793
- Ao as parseLaunchParamsQuery,
4794
- xo as parseLaunchParamsQueryFp,
4795
- Vn as popup,
4796
- Tt as postEvent,
4792
+ Ao as parseInitDataQueryFp,
4793
+ xo as parseLaunchParamsQuery,
4794
+ Mo as parseLaunchParamsQueryFp,
4795
+ Tn as popup,
4796
+ Vt as postEvent,
4797
4797
  re as postEventFp,
4798
4798
  On as qrScanner,
4799
4799
  Jn as readTextFromClipboard,
@@ -4812,27 +4812,27 @@ export {
4812
4812
  Ln as requestPhoneAccess,
4813
4813
  nt as requestPhoneAccessFp,
4814
4814
  Hn as requestWriteAccess,
4815
- Ws as requestWriteAccessFp,
4815
+ Us as requestWriteAccessFp,
4816
4816
  Yn as retrieveAndroidDeviceData,
4817
4817
  br as retrieveAndroidDeviceDataFrom,
4818
- uo as retrieveLaunchParams,
4819
- lo as retrieveLaunchParamsFp,
4820
- ho as retrieveRawInitData,
4821
- _o as retrieveRawInitDataFp,
4822
- bo as retrieveRawLaunchParams,
4823
- fo as retrieveRawLaunchParamsFp,
4818
+ lo as retrieveLaunchParams,
4819
+ ho as retrieveLaunchParamsFp,
4820
+ _o as retrieveRawInitData,
4821
+ bo as retrieveRawInitDataFp,
4822
+ fo as retrieveRawLaunchParams,
4823
+ go as retrieveRawLaunchParamsFp,
4824
4824
  jn as secondaryButton,
4825
4825
  Gn as secureStorage,
4826
4826
  Zn as sendData,
4827
4827
  mr as sendDataFp,
4828
- Mo as serializeInitDataQuery,
4829
- Ro as serializeLaunchParamsQuery,
4830
- go as setDebug,
4828
+ Ro as serializeInitDataQuery,
4829
+ Vo as serializeLaunchParamsQuery,
4830
+ mo as setDebug,
4831
4831
  vn as setEmojiStatus,
4832
4832
  Xt as setEmojiStatusFp,
4833
- mo as setLaunchParams,
4834
- wo as setTargetOrigin,
4835
- Un as settingsButton,
4833
+ wo as setLaunchParams,
4834
+ Fo as setTargetOrigin,
4835
+ Wn as settingsButton,
4836
4836
  Xn as shareMessage,
4837
4837
  Sr as shareMessageFp,
4838
4838
  ei as shareStory,
@@ -4840,16 +4840,16 @@ export {
4840
4840
  xn as shareURL,
4841
4841
  ws as shareURLFp,
4842
4842
  ri as storagePermission,
4843
- Fo as supports,
4844
- Wn as swipeBehavior,
4843
+ So as supports,
4844
+ Un as swipeBehavior,
4845
4845
  ti as switchInlineQuery,
4846
4846
  Ir as switchInlineQueryFp,
4847
- So as targetOrigin,
4847
+ Co as targetOrigin,
4848
4848
  de as themeParams,
4849
4849
  To as toRGB,
4850
- Vo as toRGBFp,
4851
- Lo as toRGBFull,
4852
- $o as toRGBFullFp,
4850
+ Lo as toRGBFp,
4851
+ $o as toRGBFull,
4852
+ Po as toRGBFullFp,
4853
4853
  si as viewport
4854
4854
  };
4855
4855
  //# sourceMappingURL=index.js.map