@tma.js/sdk 1.0.0 → 1.0.1

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.mjs CHANGED
@@ -2176,62 +2176,69 @@ function ar(r) {
2176
2176
  async: t = !1,
2177
2177
  cssVars: e = !1,
2178
2178
  acceptCustomStyles: n = !1
2179
- } = r, {
2180
- launchParams: {
2181
- initData: s,
2182
- initDataRaw: i,
2183
- version: a,
2184
- platform: c,
2185
- themeParams: u,
2186
- botInline: l = !1
2187
- },
2188
- isPageReload: p
2189
- } = Et(), m = De(), d = Ee(a);
2190
- Ct() && (n && Le(), d("iframe_ready", { reload_supported: !0 }), k("reload_iframe", () => window.location.reload()));
2191
- const y = {
2192
- backButton: $e(p, a, d),
2193
- closingBehavior: Ve(p, d),
2194
- cloudStorage: new Ae(a, m, d),
2195
- createRequestId: m,
2196
- hapticFeedback: new qe(a, d),
2197
- invoice: new Ge(a, d),
2198
- mainButton: Ie(
2199
- p,
2200
- u.buttonColor || "#000000",
2201
- u.buttonTextColor || "#ffffff",
2202
- d
2203
- ),
2204
- miniApp: Be(
2205
- p,
2206
- u.backgroundColor || "#ffffff",
2207
- a,
2208
- l,
2209
- d
2210
- ),
2211
- popup: new ze(a, d),
2212
- postEvent: d,
2213
- qrScanner: new Je(a, d),
2214
- themeParams: He(u),
2215
- utils: new Qe(a, m, d),
2216
- ...s ? {
2217
- initData: new Mt(s),
2218
- initDataRaw: i
2219
- } : {}
2220
- }, x = t ? Oe(p, c, d) : Ne(p, c, d);
2221
- return x instanceof Promise ? x.then((V) => (ot(
2222
- e,
2223
- y.miniApp,
2224
- y.themeParams,
2225
- V
2226
- ), {
2227
- ...y,
2228
- viewport: V
2229
- })) : (ot(
2230
- e,
2231
- y.miniApp,
2232
- y.themeParams,
2233
- x
2234
- ), { ...y, viewport: x });
2179
+ } = r;
2180
+ try {
2181
+ const {
2182
+ launchParams: {
2183
+ initData: s,
2184
+ initDataRaw: i,
2185
+ version: a,
2186
+ platform: c,
2187
+ themeParams: u,
2188
+ botInline: l = !1
2189
+ },
2190
+ isPageReload: p
2191
+ } = Et(), m = De(), d = Ee(a);
2192
+ Ct() && (n && Le(), d("iframe_ready", { reload_supported: !0 }), k("reload_iframe", () => window.location.reload()));
2193
+ const y = {
2194
+ backButton: $e(p, a, d),
2195
+ closingBehavior: Ve(p, d),
2196
+ cloudStorage: new Ae(a, m, d),
2197
+ createRequestId: m,
2198
+ hapticFeedback: new qe(a, d),
2199
+ invoice: new Ge(a, d),
2200
+ mainButton: Ie(
2201
+ p,
2202
+ u.buttonColor || "#000000",
2203
+ u.buttonTextColor || "#ffffff",
2204
+ d
2205
+ ),
2206
+ miniApp: Be(
2207
+ p,
2208
+ u.backgroundColor || "#ffffff",
2209
+ a,
2210
+ l,
2211
+ d
2212
+ ),
2213
+ popup: new ze(a, d),
2214
+ postEvent: d,
2215
+ qrScanner: new Je(a, d),
2216
+ themeParams: He(u),
2217
+ utils: new Qe(a, m, d),
2218
+ ...s ? {
2219
+ initData: new Mt(s),
2220
+ initDataRaw: i
2221
+ } : {}
2222
+ }, x = t ? Oe(p, c, d) : Ne(p, c, d);
2223
+ return x instanceof Promise ? x.then((V) => (ot(
2224
+ e,
2225
+ y.miniApp,
2226
+ y.themeParams,
2227
+ V
2228
+ ), {
2229
+ ...y,
2230
+ viewport: V
2231
+ })) : (ot(
2232
+ e,
2233
+ y.miniApp,
2234
+ y.themeParams,
2235
+ x
2236
+ ), { ...y, viewport: x });
2237
+ } catch (s) {
2238
+ if (t)
2239
+ return Promise.reject(s);
2240
+ throw s;
2241
+ }
2235
2242
  }
2236
2243
  function R(r, t) {
2237
2244
  return r.startsWith(t) ? r : `${t}${r}`;