@tma.js/bridge 2.2.0 → 2.2.2

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.
@@ -1,4 +1,4 @@
1
- import * as E from 'fp-ts/Either';
1
+ import { either as E } from 'fp-ts';
2
2
  export type DecodeBase64UrlError = DOMException;
3
3
  /**
4
4
  * Decodes a base-64-url ASCII string.
@@ -1,6 +1,6 @@
1
1
  import { BetterPromise, BetterPromiseOptions, TimeoutError } from 'better-promises';
2
+ import { taskEither as TE } from 'fp-ts';
2
3
  import { Request2Error } from '../utils/request2.js';
3
- import * as TE from 'fp-ts/TaskEither';
4
4
  export type isTMAError = Exclude<Request2Error, TimeoutError>;
5
5
  /**
6
6
  * @see isTMAFp
@@ -1,8 +1,8 @@
1
1
  declare const MethodUnsupportedError_base: import('error-kid').ErrorClass<[method: string, version: string]>;
2
- export declare class MethodUnsupportedError extends MethodUnsupportedError_base {
2
+ export declare class MethodUnsupportedError extends /* @__PURE__ */ MethodUnsupportedError_base {
3
3
  }
4
4
  declare const MethodParameterUnsupportedError_base: import('error-kid').ErrorClass<[method: string, param: string, version: string]>;
5
- export declare class MethodParameterUnsupportedError extends MethodParameterUnsupportedError_base {
5
+ export declare class MethodParameterUnsupportedError extends /* @__PURE__ */ MethodParameterUnsupportedError_base {
6
6
  }
7
7
  declare const LaunchParamsRetrieveError_base: import('error-kid').ErrorClassWithData<[{
8
8
  source: string;
@@ -13,15 +13,15 @@ declare const LaunchParamsRetrieveError_base: import('error-kid').ErrorClassWith
13
13
  error: unknown;
14
14
  }[];
15
15
  }>;
16
- export declare class LaunchParamsRetrieveError extends LaunchParamsRetrieveError_base {
16
+ export declare class LaunchParamsRetrieveError extends /* @__PURE__ */ LaunchParamsRetrieveError_base {
17
17
  }
18
18
  declare const InvalidLaunchParamsError_base: import('error-kid').ErrorClass<[launchParams: string, cause: unknown]>;
19
- export declare class InvalidLaunchParamsError extends InvalidLaunchParamsError_base {
19
+ export declare class InvalidLaunchParamsError extends /* @__PURE__ */ InvalidLaunchParamsError_base {
20
20
  }
21
21
  declare const UnknownEnvError_base: import('error-kid').ErrorClass<[]>;
22
- export declare class UnknownEnvError extends UnknownEnvError_base {
22
+ export declare class UnknownEnvError extends /* @__PURE__ */ UnknownEnvError_base {
23
23
  }
24
24
  declare const InvokeCustomMethodFailedError_base: import('error-kid').ErrorClass<[error: string]>;
25
- export declare class InvokeCustomMethodFailedError extends InvokeCustomMethodFailedError_base {
25
+ export declare class InvokeCustomMethodFailedError extends /* @__PURE__ */ InvokeCustomMethodFailedError_base {
26
26
  }
27
27
  export {};
@@ -1,7 +1,6 @@
1
1
  import { LaunchParamsGenType, ParseLaunchParamsQueryError } from '@tma.js/transformers';
2
+ import { either as E, option as O } from 'fp-ts';
2
3
  import { LaunchParamsRetrieveError } from './errors.js';
3
- import * as E from 'fp-ts/Either';
4
- import * as O from 'fp-ts/Option';
5
4
  export type RetrieveRawInitDataError = RetrieveRawLaunchParamsError;
6
5
  export type RetrieveRawLaunchParamsError = LaunchParamsRetrieveError;
7
6
  export type RetrieveLaunchParamsError = RetrieveRawLaunchParamsError | ParseLaunchParamsQueryError;
@@ -9,7 +8,7 @@ export type RetrieveLaunchParamsResult = LaunchParamsGenType;
9
8
  /**
10
9
  * @returns Launch parameters from any known source.
11
10
  */
12
- export declare const retrieveLaunchParamsFp: () => E.Either<RetrieveLaunchParamsError, RetrieveLaunchParamsResult>;
11
+ export declare function retrieveLaunchParamsFp(): E.Either<RetrieveLaunchParamsError, RetrieveLaunchParamsResult>;
13
12
  /**
14
13
  * @see retrieveLaunchParamsFp
15
14
  */
@@ -17,11 +16,11 @@ export declare const retrieveLaunchParams: () => RetrieveLaunchParamsResult;
17
16
  /**
18
17
  * @returns Raw init data from any known source.
19
18
  */
20
- export declare const retrieveRawInitDataFp: () => E.Either<RetrieveRawInitDataError, O.Option<string>>;
19
+ export declare function retrieveRawInitDataFp(): E.Either<RetrieveRawInitDataError, O.Option<string>>;
21
20
  /**
22
21
  * @see retrieveRawInitDataFp
23
22
  */
24
- export declare const retrieveRawInitData: () => string | undefined;
23
+ export declare function retrieveRawInitData(): string | undefined;
25
24
  /**
26
25
  * @returns Launch parameters in a raw format from any known source.
27
26
  */
@@ -1,6 +1,6 @@
1
+ import { either as E } from 'fp-ts';
1
2
  import { UnknownEnvError } from '../errors.js';
2
3
  import { MethodNameWithOptionalParams, MethodNameWithoutParams, MethodNameWithRequiredParams, MethodParams } from './types/index.js';
3
- import * as E from 'fp-ts/Either';
4
4
  export type PostEventError = UnknownEnvError;
5
5
  export type PostEventFn = typeof postEvent;
6
6
  export type PostEventFpFn = typeof postEventFp;
@@ -1,6 +1,5 @@
1
+ import { either as E, json as J } from 'fp-ts';
1
2
  import { DecodeBase64UrlError } from './base64-url.js';
2
- import * as E from 'fp-ts/Either';
3
- import * as J from 'fp-ts/Json';
4
3
  /**
5
4
  * Creates a safe start parameter value. If the value is not a string, the
6
5
  * function applies JSON.stringify to it, so make sure you are not passing an
@@ -1,8 +1,8 @@
1
1
  import { BetterPromise } from 'better-promises';
2
+ import { taskEither as TE } from 'fp-ts';
2
3
  import { InvokeCustomMethodFailedError } from '../errors.js';
3
4
  import { CustomMethodName, CustomMethodParams } from '../methods/types/index.js';
4
5
  import { Request2Error, Request2FpOptions, Request2Options } from './request2.js';
5
- import * as TE from 'fp-ts/TaskEither';
6
6
  export type InvokeCustomMethodError = Request2Error | InvokeCustomMethodFailedError;
7
7
  export type InvokeCustomMethodOptions = Omit<Request2Options<'custom_method_invoked'>, 'capture'>;
8
8
  export type InvokeCustomMethodFn = typeof invokeCustomMethod;
@@ -1,9 +1,9 @@
1
1
  import { If, IsNever } from '@tma.js/toolkit';
2
2
  import { BetterPromise, BetterPromiseOptions, TimeoutError } from 'better-promises';
3
+ import { taskEither as TE } from 'fp-ts';
3
4
  import { EventName, EventPayload } from '../events/types/index.js';
4
5
  import { PostEventError, PostEventFn, PostEventFpFn } from '../methods/postEvent.js';
5
6
  import { MethodNameWithOptionalParams, MethodNameWithoutParams, MethodNameWithRequiredParams, MethodParams } from '../methods/types/index.js';
6
- import * as TE from 'fp-ts/TaskEither';
7
7
  type AnyEventName = EventName | EventName[];
8
8
  export type RequestError = PostEventError | TimeoutError;
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  import { If, IsNever } from '@tma.js/toolkit';
2
2
  import { BetterPromise } from 'better-promises';
3
+ import { taskEither as TE } from 'fp-ts';
3
4
  import { EventName, EventPayload } from '../events/types/index.js';
4
5
  import { MethodNameWithOptionalParams, MethodNameWithRequiredParams, MethodNameWithoutParams, MethodParams } from '../methods/types/index.js';
5
6
  import { RequestCaptureEventFn, RequestCaptureEventsFn, RequestCaptureFn, RequestError, RequestFpOptions, RequestOptions, RequestCaptureFnEventsPayload } from './request.js';
6
- import * as TE from 'fp-ts/TaskEither';
7
7
  type AnyEventName = EventName | EventName[];
8
8
  export type Request2Error = RequestError;
9
9
  export type Request2CaptureEventsFn<E extends EventName[]> = RequestCaptureEventsFn<E>;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("valibot"),_=require("@tma.js/toolkit"),A=require("better-promises"),E=require("error-kid"),w=require("@tma.js/transformers"),b=require("@tma.js/signals"),Oe=require("mitt");function W(e){return i.is(i.looseObject({TelegramWebviewProxy:i.looseObject({postEvent:i.function()})}),e)}function I(){try{return window.self!==window.top}catch{return!0}}var Le=function(e,r,t){if(t||arguments.length===2)for(var n=0,o=r.length,a;n<o;n++)(a||!(n in r))&&(a||(a=Array.prototype.slice.call(r,0,n)),a[n]=r[n]);return e.concat(a||Array.prototype.slice.call(r))};function $e(e){return e}function x(e,r,t,n,o,a,s,u,p){switch(arguments.length){case 1:return e;case 2:return function(){return r(e.apply(this,arguments))};case 3:return function(){return t(r(e.apply(this,arguments)))};case 4:return function(){return n(t(r(e.apply(this,arguments))))};case 5:return function(){return o(n(t(r(e.apply(this,arguments)))))};case 6:return function(){return a(o(n(t(r(e.apply(this,arguments))))))};case 7:return function(){return s(a(o(n(t(r(e.apply(this,arguments)))))))};case 8:return function(){return u(s(a(o(n(t(r(e.apply(this,arguments))))))))};case 9:return function(){return p(u(s(a(o(n(t(r(e.apply(this,arguments)))))))))}}}function h(e,r,t,n,o,a,s,u,p){switch(arguments.length){case 1:return e;case 2:return r(e);case 3:return t(r(e));case 4:return n(t(r(e)));case 5:return o(n(t(r(e))));case 6:return a(o(n(t(r(e)))));case 7:return s(a(o(n(t(r(e))))));case 8:return u(s(a(o(n(t(r(e)))))));case 9:return p(u(s(a(o(n(t(r(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var q=function(e,r){var t=typeof e=="number"?function(n){return n.length>=e}:e;return function(){var n=Array.from(arguments);return t(arguments)?r.apply(this,n):function(o){return r.apply(void 0,Le([o],n,!1))}}},je={_tag:"None"},Re=function(e){return{_tag:"Some",value:e}},Ue=function(e){return e._tag==="Left"},We=function(e){return{_tag:"Left",left:e}},Ie=function(e){return{_tag:"Right",right:e}},g=We,f=Ie,te=q(2,function(e,r){return P(e)?e:r(e.right)}),Be=function(e){return function(r){return P(r)?r:f(e(r.right))}},Ve=function(e,r){return function(t){return P(t)?g(e(t.left)):f(r(t.right))}},ze=function(e){return function(r){return P(r)?g(e(r.left)):r}},P=Ue,ne=function(e,r){return function(t){return P(t)?e(t.left):r(t.right)}},De=ne,B=ne,Ge=B,V=function(e,r){try{return f(e())}catch(t){return g(r(t))}},Je=te,Ne=te,Qe=je,Ke=Re,He=function(e){return e._tag==="None"},Ye=function(e,r){return function(t){return He(t)?e():r(t.value)}},Xe=Ye;function Ze(e){return x(f,e.of)}function er(e){return x(g,e.of)}function rr(e){return function(r,t){return e.chain(r,function(n){return P(n)?e.of(n):t(n.right)})}}function tr(e){return function(r,t,n){return e.map(r,Ve(t,n))}}function nr(e){return function(r,t){return function(n){return e.map(n,B(r,t))}}}var ae=function(e,r){return h(e,or(r))},ar=function(e,r){return h(e,sr(r))},or=function(e){return function(r){return function(){return Promise.resolve().then(r).then(e)}}},sr=function(e){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(e)]).then(function(t){var n=t[0],o=t[1];return n(o)})}}},oe=function(e){return function(){return Promise.resolve(e)}},ir=q(2,function(e,r){return function(){return Promise.resolve().then(e).then(function(t){return r(t)()})}}),se="Task",ie={URI:se,map:ae},ue={of:oe},ur={URI:se,map:ae,of:oe,ap:ar,chain:ir},cr=er(ue),ce=Ze(ue),pe=nr(ie),le=q(3,tr(ie)),_e=q(2,rr(ur)),pr=_e,fe=_e;class me extends E.errorClass("MethodUnsupportedError",(r,t)=>[`Method "${r}" is unsupported in Mini Apps version ${t}`]){}class he extends E.errorClass("MethodParameterUnsupportedError",(r,t,n)=>[`Parameter "${t}" of "${r}" method is unsupported in Mini Apps version ${n}`]){}class ge extends E.errorClassWithData("LaunchParamsRetrieveError",r=>({errors:r}),r=>[["Unable to retrieve launch parameters from any known source. Perhaps, you have opened your app outside Telegram?","📖 Refer to docs for more information:","https://docs.telegram-mini-apps.com/packages/tma-js-bridge/environment","","Collected errors:",...r.map(({source:t,error:n})=>`Source: ${t} / ${n instanceof Error?n.message:String(n)}`)].join(`
2
- `)]){}class de extends E.errorClass("InvalidLaunchParamsError",(r,t)=>[`Invalid value for launch params: ${r}`,{cause:t}]){}class z extends E.errorClass("UnknownEnvError"){}class we extends E.errorClass("InvokeCustomMethodError",r=>[`Server returned error: ${r}`]){}const K="launchParams";function H(e){return e.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}const be=x(F,Je(w.parseLaunchParamsQueryFp)),lr=_.throwifyFpFn(be),ve=x(F,Be(e=>{const r=new URLSearchParams(e).get("tgWebAppData");return r?Ke(r):Qe})),_r=x(ve,Ge(e=>{throw e},e=>e),Xe(()=>{},e=>e));function F(){const e=[];for(const[r,t]of[[()=>H(window.location.href),"window.location.href"],[()=>{const n=performance.getEntriesByType("navigation")[0];return n&&H(n.name)},"performance navigation entries"],[()=>_.getStorageValue(K),"local storage"]]){const n=r();if(!n){e.push({source:t,error:new Error("Source is empty")});continue}const o=h(w.parseLaunchParamsQueryFp(n),De(a=>a,()=>!0));if(typeof o!="boolean"){e.push({source:t,error:o});continue}return _.setStorageValue(K,n),f(n)}return g(new ge(e))}const fr=_.throwifyFpFn(F);function mr(e,r){const t=new Map,n=Oe(),o=(a,s,u=!1)=>{const p=t.get(a)||new Map;t.set(a,p);const c=p.get(s)||[];p.set(s,c);const l=c.findIndex(m=>m[1]===u);if(l>=0&&(n.off(a,c[l][0]),c.splice(l,1),!c.length&&(p.delete(s),!p.size))){const m=t.size;t.delete(a),m&&!t.size&&r()}};return{on(a,s,u){!t.size&&e();const p=()=>{o(a,s,u)},c=(...d)=>{u&&p(),a==="*"?s({name:d[0],payload:d[1]}):s(...d)};n.on(a,c);const l=t.get(a)||new Map;t.set(a,l);const m=l.get(s)||[];return l.set(s,m),m.push([c,u||!1]),p},off:o,emit:n.emit,clear(){const a=t.size;n.all.clear(),t.clear(),a&&r()}}}function M(e,r){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:e,eventData:r}),source:window.parent}))}const C=b.signal(!1),D=b.signal("https://web.telegram.org"),hr=e=>{v().log("Event received:",e)},G=b.computed(C);function gr(e){e!==C()&&(C.set(e),(e?O:Ee)("*",hr))}const J=b.computed(D);function dr(e){D.set(e),v().log("New target origin set",e)}const y=b.signal((...e)=>{window.parent.postMessage(...e)}),v=b.signal(_.createLogger("Bridge",{bgColor:"#9147ff",textColor:"white",shouldLog:G}));function wr(){Pe(),[y,D,J,C,G,v].forEach(e=>{e.unsubAll(),"reset"in e&&e.reset()})}function j(e,r,t){const n=[t],o=e[r];typeof o=="function"&&n.push(o);const a=(...u)=>{n.forEach(p=>p(...u))},s=Object.assign((...u)=>{a(...u)},{unwrap(){const{length:u}=n;if(u===1){delete e[r];return}if(u===2){X(e,r,n[1]);return}n.unshift(1),X(e,r,a)}});ye(e,r,()=>s,u=>n.push(u))}function Y(e,r){const t=e[r];ye(e,r,()=>t,n=>{Object.entries(n).forEach(([o,a])=>{t[o]=a})})}function ye(e,r,t,n){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:t,set:n})}function X(e,r,t){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t})}const br={clipboard_text_received:i.looseObject({req_id:i.string(),data:i.nullish(i.string())}),custom_method_invoked:i.looseObject({req_id:i.string(),result:i.optional(i.unknown()),error:i.optional(i.string())}),popup_closed:i.nullish(i.looseObject({button_id:i.nullish(i.string(),()=>{})}),{}),viewport_changed:i.nullish(i.looseObject({height:i.number(),width:i.nullish(i.number(),()=>window.innerWidth),is_state_stable:i.boolean(),is_expanded:i.boolean()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:i.looseObject({theme_params:w.themeParams()})};function Z(e){if(e.source!==window.parent)return;let r;try{r=i.parse(w.pipeJsonToSchema(w.miniAppsMessage()),e.data)}catch{return}const{eventType:t,eventData:n}=r,o=br[t];let a;try{a=o?i.parse(o,n):n}catch(s){return v().forceError([`An error occurred processing the "${t}" event from the Telegram application.`,"Please, file an issue here:","https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose"].join(`
3
- `),r,s)}vr(t,a)}const{on:O,off:Ee,emit:vr,clear:Pe}=mr(()=>{const e=window;!e.TelegramGameProxy&&(e.TelegramGameProxy={}),j(e.TelegramGameProxy,"receiveEvent",M),Y(e,"TelegramGameProxy"),!e.Telegram&&(e.Telegram={}),!e.Telegram.WebView&&(e.Telegram.WebView={}),j(e.Telegram.WebView,"receiveEvent",M),Y(e.Telegram,"WebView"),j(e,"TelegramGameProxy_receiveEvent",M),window.addEventListener("message",Z)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["Telegram","WebView","receiveEvent"]].forEach(e=>{const r=window;let t=[void 0,r];for(const a of e)if(t=[t[1],t[1][a]],!t[1])return;const[n,o]=t;"unwrap"in o&&(o.unwrap(),n&&n!==r&&!Object.keys(n).length&&delete r[e[0]])}),window.removeEventListener("message",Z)}),ke=(...e)=>y()(...e);function Se(e,r){h(k(e,r),ze(t=>{throw t}))}function k(e,r){v().log("Posting event:",r?{eventType:e,eventData:r}:{eventType:e});const t=window,n=JSON.stringify({eventType:e,eventData:r});return I()?(ke(n,J()),f(void 0)):W(t)?(t.TelegramWebviewProxy.postEvent(e,JSON.stringify(r)),f(void 0)):i.is(i.looseObject({external:i.looseObject({notify:i.function()})}),t)?(t.external.notify(n),f(void 0)):g(new z)}function L(e,r,t={}){const{capture:n=()=>!0,postEvent:o=k}=t,a=b.signal(),[s,u]=_.createCbCollector();(Array.isArray(r)?r:[r]).forEach(c=>{s(O(c,l=>{const m=Array.isArray(r);n(m?{event:c,payload:l}:l)&&a.set([m?{event:c,payload:l}:l])}))});const p=c=>(u(),c);return h(async()=>o(e,t.params),fe(()=>_.BetterTaskEither((c,l,m)=>{const d=a();if(d)return c(d[0]);const S=T=>{T&&c(T[0])},$=()=>{a.unsub(S)};a.sub(S),m.on("finalized",$)},t)),le(p,p))}function yr(e,r,t){const{postEvent:n}=t||{};return _.throwifyAnyEither(L(e,r,{...t,postEvent:n?(...o)=>{try{return n(...o),f(void 0)}catch(a){return g(a)}}:k}))}function Er(e,r){const t=Te(e,r);return typeof t=="function"?A.BetterPromise.fn(()=>_.throwifyAnyEither(t)):t}function Te(e,r){const t=W(window);if(!e)return t||h(F(),B(()=>!1,()=>!0));if(t)return ce(!0);const{timeout:n=100}=r||{};return h(L("web_app_request_theme","theme_changed",{...r,timeout:n}),pe(o=>A.TimeoutError.is(o)||z.is(o)?f(!1):g(o),()=>f(!0)))}function Pr({launchParams:e,onEvent:r,resetPostMessage:t}={}){if(e){const a=typeof e=="string"||e instanceof URLSearchParams?e.toString():w.serializeLaunchParamsQuery({...e,tgWebAppData:void 0})+(e.tgWebAppData?`&tgWebAppData=${encodeURIComponent(e.tgWebAppData.toString())}`:"");try{w.parseLaunchParamsQuery(a)}catch(s){throw new de(a,s)}_.setStorageValue("launchParams",a)}if(I()){if(!r)return;t&&y.reset();const a=y();y.set((...s)=>{const[u]=s,p=()=>{a(...s)};try{const c=i.parse(w.pipeJsonToSchema(w.miniAppsMessage()),u);r({name:c.eventType,params:c.eventData},p)}catch{p()}});return}const n=window.TelegramWebviewProxy||{},o=n.postEvent||(()=>{});window.TelegramWebviewProxy={...n,postEvent(a,s){const u=()=>{o(a,s)};r?r({name:a,params:s?JSON.parse(s):void 0},u):u()}},v().log("Environment was mocked by the mockTelegramEnv function")}function Ae(e){return({req_id:r})=>r===e}const ee={"6.0":["iframe_ready","iframe_will_reload","web_app_close","web_app_data_send","web_app_expand","web_app_open_link","web_app_ready","web_app_request_theme","web_app_request_viewport","web_app_setup_main_button","web_app_setup_closing_behavior"],6.1:["web_app_open_tg_link","web_app_open_invoice","web_app_setup_back_button","web_app_set_background_color","web_app_set_header_color","web_app_trigger_haptic_feedback"],6.2:["web_app_open_popup"],6.4:["web_app_close_scan_qr_popup","web_app_open_scan_qr_popup","web_app_read_text_from_clipboard",{method:"web_app_open_link",param:"try_instant_view"}],6.7:["web_app_switch_inline_query"],6.9:["web_app_invoke_custom_method","web_app_request_write_access","web_app_request_phone",{method:"web_app_set_header_color",param:"color"}],"6.10":["web_app_setup_settings_button"],7.2:["web_app_biometry_get_info","web_app_biometry_open_settings","web_app_biometry_request_access","web_app_biometry_request_auth","web_app_biometry_update_token"],7.6:[{method:"web_app_open_link",param:"try_browser"},{method:"web_app_close",param:"return_back"}],7.7:["web_app_setup_swipe_behavior"],7.8:["web_app_share_to_story"],"7.10":["web_app_setup_secondary_button","web_app_set_bottom_bar_color",{method:"web_app_setup_main_button",param:"has_shine_effect"}],"8.0":["web_app_request_safe_area","web_app_request_content_safe_area","web_app_request_fullscreen","web_app_exit_fullscreen","web_app_set_emoji_status","web_app_add_to_home_screen","web_app_check_home_screen","web_app_request_emoji_status_access","web_app_check_location","web_app_open_location_settings","web_app_request_file_download","web_app_request_location","web_app_send_prepared_message","web_app_start_accelerometer","web_app_start_device_orientation","web_app_start_gyroscope","web_app_stop_accelerometer","web_app_stop_device_orientation","web_app_stop_gyroscope","web_app_toggle_orientation_lock"],"9.0":["web_app_device_storage_clear","web_app_device_storage_get_key","web_app_device_storage_save_key","web_app_secure_storage_clear","web_app_secure_storage_get_key","web_app_secure_storage_restore_key","web_app_secure_storage_save_key"],9.1:["web_app_hide_keyboard"]};function R(e,r){return Object.keys(ee).find(n=>ee[n].some(o=>r?typeof o=="object"&&o.method===e&&o.param===r:o===e))||null}function re(e){return e.split(".").map(Number)}function xe(e,r){const t=re(e),n=re(r),o=Math.max(t.length,n.length);for(let a=0;a<o;a+=1){const s=t[a]||0,u=n[a]||0;if(s!==u)return s>u?1:-1}return 0}function U(e,r,t){const n=t?R(e,r):R(e);return n?xe(n,t||r)<=0:!1}function kr(e,r="strict"){const t=typeof r=="function"?r:n=>{const{method:o,version:a}=n,s="param"in n?new he(o,n.param,a):new me(o,a);if(r==="strict")throw s;return v().forceWarn(s.message)};return(n,o)=>U(n,e)?n==="web_app_set_header_color"&&i.is(i.looseObject({color:i.any()}),o)&&!U(n,"color",e)?t({version:e,method:n,param:"color"}):Se(n,o):t({version:e,method:n})}function Fe(e,r,t,n){return h(L("web_app_invoke_custom_method","custom_method_invoked",{...n||{},params:{method:e,params:r,req_id:t},capture:Ae(t)}),pr(({result:o,error:a})=>a?cr(new we(a)):ce(o)))}function Sr(e,r,t,n){return A.BetterPromise.fn(()=>h(Fe(e,r,t,n),pe(o=>{throw o},o=>o))())}function Me(e,r,t={}){const{capture:n=()=>!0,postEvent:o=k}=t,a=b.signal(),[s,u]=_.createCbCollector();(Array.isArray(r)?r:[r]).forEach(c=>{s(O(c,l=>{(Array.isArray(r)?n({event:c,payload:l}):n(l))&&a.set([l])}))});const p=c=>(u(),c);return h(async()=>o(e,t.params),fe(()=>_.BetterTaskEither((c,l,m)=>{const d=a();if(d)return c(d[0]);const S=T=>{T&&c(T[0])},$=()=>{a.unsub(S)};a.sub(S),m.on("finalized",$)},t)),le(p,p))}function Tr(e,r,t){const{postEvent:n}=t||{};return _.throwifyAnyEither(Me(e,r,{...t,postEvent:n?(...o)=>{try{return n(...o),f(void 0)}catch(a){return g(a)}}:k}))}function Ar(){Object.hasOwn||(Object.hasOwn=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)})}function N(e){return V(()=>decodeURIComponent(atob(e.replace(/-/g,"+").replace(/_/g,"/")).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")),r=>r)}const xr=_.throwifyFpFn(N);function Q(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(r,t)=>String.fromCharCode(parseInt(`0x${t}`)))).replace(/\+/g,"-").replace(/\//g,"_")}var Fr=function(e){return V(function(){return JSON.parse(e)},$e)};function Ce(e){const r=Q(typeof e=="string"?e:JSON.stringify(e));return r.length>512?g(new Error("Value is too long for start parameter")):f(r)}const Mr=_.throwifyFpFn(Ce);function Cr(e,r){return _.throwifyAnyEither(qe(e,typeof r=="function"?t=>V(()=>r(t),n=>n):r))}function qe(e,r){return h(N(e),Ne(t=>r?typeof r=="function"?r(t):Fr(t):f(t)))}function qr(e){return Q(e).length<=512}Object.defineProperty(exports,"createLogger",{enumerable:!0,get:()=>_.createLogger});Object.defineProperty(exports,"deepSnakeToCamelObjKeys",{enumerable:!0,get:()=>_.deepSnakeToCamelObjKeys});Object.defineProperty(exports,"CancelledError",{enumerable:!0,get:()=>A.CancelledError});Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:()=>A.TimeoutError});exports.InvalidLaunchParamsError=de;exports.InvokeCustomMethodFailedError=we;exports.LaunchParamsRetrieveError=ge;exports.MethodParameterUnsupportedError=he;exports.MethodUnsupportedError=me;exports.UnknownEnvError=z;exports.applyPolyfills=Ar;exports.captureSameReq=Ae;exports.compareVersions=xe;exports.createPostEvent=kr;exports.createStartParam=Mr;exports.createStartParamFp=Ce;exports.debug=G;exports.decodeBase64Url=xr;exports.decodeBase64UrlFp=N;exports.decodeStartParam=Cr;exports.decodeStartParamFp=qe;exports.emitEvent=M;exports.encodeBase64Url=Q;exports.getReleaseVersion=R;exports.hasWebviewProxy=W;exports.invokeCustomMethod=Sr;exports.invokeCustomMethodFp=Fe;exports.isIframe=I;exports.isSafeToCreateStartParam=qr;exports.isTMA=Er;exports.isTMAFp=Te;exports.logger=v;exports.mockTelegramEnv=Pr;exports.off=Ee;exports.offAll=Pe;exports.on=O;exports.postEvent=Se;exports.postEventFp=k;exports.postMessage=ke;exports.postMessageImpl=y;exports.request=Tr;exports.request2=yr;exports.request2Fp=L;exports.requestFp=Me;exports.resetGlobals=wr;exports.retrieveLaunchParams=lr;exports.retrieveLaunchParamsFp=be;exports.retrieveRawInitData=_r;exports.retrieveRawInitDataFp=ve;exports.retrieveRawLaunchParams=fr;exports.retrieveRawLaunchParamsFp=F;exports.setDebug=gr;exports.setTargetOrigin=dr;exports.supports=U;exports.targetOrigin=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("valibot"),f=require("@tma.js/toolkit"),k=require("better-promises"),a=require("fp-ts"),y=require("error-kid"),d=require("@tma.js/transformers"),g=require("@tma.js/signals"),me=require("mitt");function j(e){return i.is(i.looseObject({TelegramWebviewProxy:i.looseObject({postEvent:i.function()})}),e)}function L(){try{return window.self!==window.top}catch{return!0}}class N extends y.errorClass("MethodUnsupportedError",(t,r)=>[`Method "${t}" is unsupported in Mini Apps version ${r}`]){}class H extends y.errorClass("MethodParameterUnsupportedError",(t,r,n)=>[`Parameter "${r}" of "${t}" method is unsupported in Mini Apps version ${n}`]){}class Y extends y.errorClassWithData("LaunchParamsRetrieveError",t=>({errors:t}),t=>[["Unable to retrieve launch parameters from any known source. Perhaps, you have opened your app outside Telegram?","📖 Refer to docs for more information:","https://docs.telegram-mini-apps.com/packages/tma-js-bridge/environment","","Collected errors:",...t.map(({source:r,error:n})=>`Source: ${r} / ${n instanceof Error?n.message:String(n)}`)].join(`
2
+ `)]){}class X extends y.errorClass("InvalidLaunchParamsError",(t,r)=>[`Invalid value for launch params: ${t}`,{cause:r}]){}class R extends y.errorClass("UnknownEnvError"){}class Z extends y.errorClass("InvokeCustomMethodError",t=>[`Server returned error: ${t}`]){}const $="launchParams";function z(e){return e.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}function ee(){return a.function.pipe(S(),a.either.chainW(d.parseLaunchParamsQueryFp))}const he=f.throwifyFpFn(ee);function te(){return a.function.pipe(S(),a.either.map(e=>{const t=new URLSearchParams(e).get("tgWebAppData");return t?a.option.some(t):a.option.none}))}function de(){return a.function.pipe(te(),a.either.fold(e=>{throw e},e=>e),a.option.match(()=>{},e=>e))}function S(){const e=[];for(const[t,r]of[[()=>z(window.location.href),"window.location.href"],[()=>{const n=performance.getEntriesByType("navigation")[0];return n&&z(n.name)},"performance navigation entries"],[()=>f.getStorageValue($),"local storage"]]){const n=t();if(!n){e.push({source:r,error:new Error("Source is empty")});continue}const s=a.function.pipe(d.parseLaunchParamsQueryFp(n),a.either.foldW(o=>o,()=>!0));if(typeof s!="boolean"){e.push({source:r,error:s});continue}return f.setStorageValue($,n),a.either.right(n)}return a.either.left(new Y(e))}const ge=f.throwifyFpFn(S);function we(e,t){const r=new Map,n=me(),s=(o,c,u=!1)=>{const _=r.get(o)||new Map;r.set(o,_);const p=_.get(c)||[];_.set(c,p);const l=p.findIndex(m=>m[1]===u);if(l>=0&&(n.off(o,p[l][0]),p.splice(l,1),!p.length&&(_.delete(c),!_.size))){const m=r.size;r.delete(o),m&&!r.size&&t()}};return{on(o,c,u){!r.size&&e();const _=()=>{s(o,c,u)},p=(...h)=>{u&&_(),o==="*"?c({name:h[0],payload:h[1]}):c(...h)};n.on(o,p);const l=r.get(o)||new Map;r.set(o,l);const m=l.get(c)||[];return l.set(c,m),m.push([p,u||!1]),_},off:s,emit:n.emit,clear(){const o=r.size;n.all.clear(),r.clear(),o&&t()}}}function T(e,t){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:e,eventData:t}),source:window.parent}))}const C=g.signal(!1),W=g.signal("https://web.telegram.org"),be=e=>{w().log("Event received:",e)},U=g.computed(C);function ye(e){e!==C()&&(C.set(e),(e?F:ne)("*",be))}const I=g.computed(W);function ve(e){W.set(e),w().log("New target origin set",e)}const b=g.signal((...e)=>{window.parent.postMessage(...e)}),w=g.signal(f.createLogger("Bridge",{bgColor:"#9147ff",textColor:"white",shouldLog:U}));function Ee(){oe(),[b,W,I,C,U,w].forEach(e=>{e.unsubAll(),"reset"in e&&e.reset()})}function q(e,t,r){const n=[r],s=e[t];typeof s=="function"&&n.push(s);const o=(...u)=>{n.forEach(_=>_(...u))},c=Object.assign((...u)=>{o(...u)},{unwrap(){const{length:u}=n;if(u===1){delete e[t];return}if(u===2){G(e,t,n[1]);return}n.unshift(1),G(e,t,o)}});re(e,t,()=>c,u=>n.push(u))}function D(e,t){const r=e[t];re(e,t,()=>r,n=>{Object.entries(n).forEach(([s,o])=>{r[s]=o})})}function re(e,t,r,n){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:r,set:n})}function G(e,t,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}const Pe={clipboard_text_received:i.looseObject({req_id:i.string(),data:i.nullish(i.string())}),custom_method_invoked:i.looseObject({req_id:i.string(),result:i.optional(i.unknown()),error:i.optional(i.string())}),popup_closed:i.nullish(i.looseObject({button_id:i.nullish(i.string(),()=>{})}),{}),viewport_changed:i.nullish(i.looseObject({height:i.number(),width:i.nullish(i.number(),()=>window.innerWidth),is_state_stable:i.boolean(),is_expanded:i.boolean()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:i.looseObject({theme_params:d.themeParams()})};function J(e){if(e.source!==window.parent)return;let t;try{t=i.parse(d.pipeJsonToSchema(d.miniAppsMessage()),e.data)}catch{return}const{eventType:r,eventData:n}=t,s=Pe[r];let o;try{o=s?i.parse(s,n):n}catch(c){return w().forceError([`An error occurred processing the "${r}" event from the Telegram application.`,"Please, file an issue here:","https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose"].join(`
3
+ `),t,c)}ke(r,o)}const{on:F,off:ne,emit:ke,clear:oe}=we(()=>{const e=window;!e.TelegramGameProxy&&(e.TelegramGameProxy={}),q(e.TelegramGameProxy,"receiveEvent",T),D(e,"TelegramGameProxy"),!e.Telegram&&(e.Telegram={}),!e.Telegram.WebView&&(e.Telegram.WebView={}),q(e.Telegram.WebView,"receiveEvent",T),D(e.Telegram,"WebView"),q(e,"TelegramGameProxy_receiveEvent",T),window.addEventListener("message",J)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["Telegram","WebView","receiveEvent"]].forEach(e=>{const t=window;let r=[void 0,t];for(const o of e)if(r=[r[1],r[1][o]],!r[1])return;const[n,s]=r;"unwrap"in s&&(s.unwrap(),n&&n!==t&&!Object.keys(n).length&&delete t[e[0]])}),window.removeEventListener("message",J)}),ae=(...e)=>b()(...e);function se(e,t){a.function.pipe(v(e,t),a.either.mapLeft(r=>{throw r}))}function v(e,t){w().log("Posting event:",t?{eventType:e,eventData:t}:{eventType:e});const r=window,n=JSON.stringify({eventType:e,eventData:t});return L()?(ae(n,I()),a.either.right(void 0)):j(r)?(r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t)),a.either.right(void 0)):i.is(i.looseObject({external:i.looseObject({notify:i.function()})}),r)?(r.external.notify(n),a.either.right(void 0)):a.either.left(new R)}function x(e,t,r={}){const{capture:n=()=>!0,postEvent:s=v}=r,o=g.signal(),[c,u]=f.createCbCollector();(Array.isArray(t)?t:[t]).forEach(p=>{c(F(p,l=>{const m=Array.isArray(t);n(m?{event:p,payload:l}:l)&&o.set([m?{event:p,payload:l}:l])}))});const _=p=>(u(),p);return a.function.pipe(async()=>s(e,r.params),a.taskEither.chainW(()=>f.BetterTaskEither((p,l,m)=>{const h=o();if(h)return p(h[0]);const E=P=>{P&&p(P[0])},M=()=>{o.unsub(E)};o.sub(E),m.on("finalized",M)},r)),a.taskEither.mapBoth(_,_))}function Se(e,t,r){const{postEvent:n}=r||{};return f.throwifyAnyEither(x(e,t,{...r,postEvent:n?(...s)=>{try{return n(...s),a.either.right(void 0)}catch(o){return a.either.left(o)}}:v}))}function Te(e,t){const r=ie(e,t);return typeof r=="function"?k.BetterPromise.fn(()=>f.throwifyAnyEither(r)):r}function ie(e,t){const r=j(window);if(!e)return r||a.function.pipe(S(),a.either.match(()=>!1,()=>!0));if(r)return a.taskEither.right(!0);const{timeout:n=100}=t||{};return a.function.pipe(x("web_app_request_theme","theme_changed",{...t,timeout:n}),a.taskEither.match(s=>k.TimeoutError.is(s)||R.is(s)?a.either.right(!1):a.either.left(s),()=>a.either.right(!0)))}function Ce({launchParams:e,onEvent:t,resetPostMessage:r}={}){if(e){const o=typeof e=="string"||e instanceof URLSearchParams?e.toString():d.serializeLaunchParamsQuery({...e,tgWebAppData:void 0})+(e.tgWebAppData?`&tgWebAppData=${encodeURIComponent(e.tgWebAppData.toString())}`:"");try{d.parseLaunchParamsQuery(o)}catch(c){throw new X(o,c)}f.setStorageValue("launchParams",o)}if(L()){if(!t)return;r&&b.reset();const o=b();b.set((...c)=>{const[u]=c,_=()=>{o(...c)};try{const p=i.parse(d.pipeJsonToSchema(d.miniAppsMessage()),u);t({name:p.eventType,params:p.eventData},_)}catch{_()}});return}const n=window.TelegramWebviewProxy||{},s=n.postEvent||(()=>{});window.TelegramWebviewProxy={...n,postEvent(o,c){const u=()=>{s(o,c)};t?t({name:o,params:c?JSON.parse(c):void 0},u):u()}},w().log("Environment was mocked by the mockTelegramEnv function")}function ce(e){return({req_id:t})=>t===e}const Q={"6.0":["iframe_ready","iframe_will_reload","web_app_close","web_app_data_send","web_app_expand","web_app_open_link","web_app_ready","web_app_request_theme","web_app_request_viewport","web_app_setup_main_button","web_app_setup_closing_behavior"],6.1:["web_app_open_tg_link","web_app_open_invoice","web_app_setup_back_button","web_app_set_background_color","web_app_set_header_color","web_app_trigger_haptic_feedback"],6.2:["web_app_open_popup"],6.4:["web_app_close_scan_qr_popup","web_app_open_scan_qr_popup","web_app_read_text_from_clipboard",{method:"web_app_open_link",param:"try_instant_view"}],6.7:["web_app_switch_inline_query"],6.9:["web_app_invoke_custom_method","web_app_request_write_access","web_app_request_phone",{method:"web_app_set_header_color",param:"color"}],"6.10":["web_app_setup_settings_button"],7.2:["web_app_biometry_get_info","web_app_biometry_open_settings","web_app_biometry_request_access","web_app_biometry_request_auth","web_app_biometry_update_token"],7.6:[{method:"web_app_open_link",param:"try_browser"},{method:"web_app_close",param:"return_back"}],7.7:["web_app_setup_swipe_behavior"],7.8:["web_app_share_to_story"],"7.10":["web_app_setup_secondary_button","web_app_set_bottom_bar_color",{method:"web_app_setup_main_button",param:"has_shine_effect"}],"8.0":["web_app_request_safe_area","web_app_request_content_safe_area","web_app_request_fullscreen","web_app_exit_fullscreen","web_app_set_emoji_status","web_app_add_to_home_screen","web_app_check_home_screen","web_app_request_emoji_status_access","web_app_check_location","web_app_open_location_settings","web_app_request_file_download","web_app_request_location","web_app_send_prepared_message","web_app_start_accelerometer","web_app_start_device_orientation","web_app_start_gyroscope","web_app_stop_accelerometer","web_app_stop_device_orientation","web_app_stop_gyroscope","web_app_toggle_orientation_lock"],"9.0":["web_app_device_storage_clear","web_app_device_storage_get_key","web_app_device_storage_save_key","web_app_secure_storage_clear","web_app_secure_storage_get_key","web_app_secure_storage_restore_key","web_app_secure_storage_save_key"],9.1:["web_app_hide_keyboard"]};function A(e,t){return Object.keys(Q).find(n=>Q[n].some(s=>t?typeof s=="object"&&s.method===e&&s.param===t:s===e))||null}function K(e){return e.split(".").map(Number)}function pe(e,t){const r=K(e),n=K(t),s=Math.max(r.length,n.length);for(let o=0;o<s;o+=1){const c=r[o]||0,u=n[o]||0;if(c!==u)return c>u?1:-1}return 0}function O(e,t,r){const n=r?A(e,t):A(e);return n?pe(n,r||t)<=0:!1}function Fe(e,t="strict"){const r=typeof t=="function"?t:n=>{const{method:s,version:o}=n,c="param"in n?new H(s,n.param,o):new N(s,o);if(t==="strict")throw c;return w().forceWarn(c.message)};return(n,s)=>O(n,e)?n==="web_app_set_header_color"&&i.is(i.looseObject({color:i.any()}),s)&&!O(n,"color",e)?r({version:e,method:n,param:"color"}):se(n,s):r({version:e,method:n})}function ue(e,t,r,n){return a.function.pipe(x("web_app_invoke_custom_method","custom_method_invoked",{...n||{},params:{method:e,params:t,req_id:r},capture:ce(r)}),a.taskEither.chain(({result:s,error:o})=>o?a.taskEither.left(new Z(o)):a.taskEither.right(s)))}function xe(e,t,r,n){return k.BetterPromise.fn(()=>a.function.pipe(ue(e,t,r,n),a.taskEither.match(s=>{throw s},s=>s))())}function _e(e,t,r={}){const{capture:n=()=>!0,postEvent:s=v}=r,o=g.signal(),[c,u]=f.createCbCollector();(Array.isArray(t)?t:[t]).forEach(p=>{c(F(p,l=>{(Array.isArray(t)?n({event:p,payload:l}):n(l))&&o.set([l])}))});const _=p=>(u(),p);return a.function.pipe(async()=>s(e,r.params),a.taskEither.chainW(()=>f.BetterTaskEither((p,l,m)=>{const h=o();if(h)return p(h[0]);const E=P=>{P&&p(P[0])},M=()=>{o.unsub(E)};o.sub(E),m.on("finalized",M)},r)),a.taskEither.mapBoth(_,_))}function Me(e,t,r){const{postEvent:n}=r||{};return f.throwifyAnyEither(_e(e,t,{...r,postEvent:n?(...s)=>{try{return n(...s),a.either.right(void 0)}catch(o){return a.either.left(o)}}:v}))}function qe(){Object.hasOwn||(Object.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)})}function B(e){return a.either.tryCatch(()=>decodeURIComponent(atob(e.replace(/-/g,"+").replace(/_/g,"/")).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join("")),t=>t)}const Ae=f.throwifyFpFn(B);function V(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(`0x${r}`)))).replace(/\+/g,"-").replace(/\//g,"_")}function le(e){const t=V(typeof e=="string"?e:JSON.stringify(e));return t.length>512?a.either.left(new Error("Value is too long for start parameter")):a.either.right(t)}const Oe=f.throwifyFpFn(le);function je(e,t){return f.throwifyAnyEither(fe(e,typeof t=="function"?r=>a.either.tryCatch(()=>t(r),n=>n):t))}function fe(e,t){return a.function.pipe(B(e),a.either.chain(r=>t?typeof t=="function"?t(r):a.json.parse(r):a.either.right(r)))}function Le(e){return V(e).length<=512}Object.defineProperty(exports,"createLogger",{enumerable:!0,get:()=>f.createLogger});Object.defineProperty(exports,"deepSnakeToCamelObjKeys",{enumerable:!0,get:()=>f.deepSnakeToCamelObjKeys});Object.defineProperty(exports,"CancelledError",{enumerable:!0,get:()=>k.CancelledError});Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:()=>k.TimeoutError});exports.InvalidLaunchParamsError=X;exports.InvokeCustomMethodFailedError=Z;exports.LaunchParamsRetrieveError=Y;exports.MethodParameterUnsupportedError=H;exports.MethodUnsupportedError=N;exports.UnknownEnvError=R;exports.applyPolyfills=qe;exports.captureSameReq=ce;exports.compareVersions=pe;exports.createPostEvent=Fe;exports.createStartParam=Oe;exports.createStartParamFp=le;exports.debug=U;exports.decodeBase64Url=Ae;exports.decodeBase64UrlFp=B;exports.decodeStartParam=je;exports.decodeStartParamFp=fe;exports.emitEvent=T;exports.encodeBase64Url=V;exports.getReleaseVersion=A;exports.hasWebviewProxy=j;exports.invokeCustomMethod=xe;exports.invokeCustomMethodFp=ue;exports.isIframe=L;exports.isSafeToCreateStartParam=Le;exports.isTMA=Te;exports.isTMAFp=ie;exports.logger=w;exports.mockTelegramEnv=Ce;exports.off=ne;exports.offAll=oe;exports.on=F;exports.postEvent=se;exports.postEventFp=v;exports.postMessage=ae;exports.postMessageImpl=b;exports.request=Me;exports.request2=Se;exports.request2Fp=x;exports.requestFp=_e;exports.resetGlobals=Ee;exports.retrieveLaunchParams=he;exports.retrieveLaunchParamsFp=ee;exports.retrieveRawInitData=de;exports.retrieveRawInitDataFp=te;exports.retrieveRawLaunchParams=ge;exports.retrieveRawLaunchParamsFp=S;exports.setDebug=ye;exports.setTargetOrigin=ve;exports.supports=O;exports.targetOrigin=I;
4
4
  //# sourceMappingURL=index.cjs.map