import { getCurrentHub , initAndBind , Integrations as CoreIntegrations , } from "@sentry/core" ; import { SyncPromise } from "@sentry/utils" ; import { MiniappOptions } from "./backend" ; import { MiniappClient , ReportDialogOptions } from "./client" ; import { wrap as internalWrap } from "./helpers" ; import { GlobalHandlers , IgnoreMpcrawlerErrors , LinkedErrors , Router , System , TryCatch , } from "./integrations/index" ; export const defaultIntegrations = [ new CoreIntegrations . InboundFilters ( ) , new CoreIntegrations . FunctionToString ( ) , new TryCatch ( ) , new GlobalHandlers ( ) , new LinkedErrors ( ) , new System ( ) , new Router ( ) , new IgnoreMpcrawlerErrors ( ) , ] ; /**
 * The Sentry Miniapp SDK Client.
 *
 * To use this SDK, call the  init function as early as possible when
 * launching the app. To set context information or send manual events, use
 * the provided methods.
 *
 *  example example example example see MiniappOptions for documentation on configuration options.
  export function init ( options = { } ) { if ( options . defaultIntegrations === undefined ) { options . defaultIntegrations = defaultIntegrations ; } options . normalizeDepth = options . normalizeDepth || 5 ; initAndBind ( MiniappClient , options ) ; } param options export function showReportDialog ( options = { } ) { if ( ! options . eventId ) { options . eventId = getCurrentHub ( ) . lastEventId ( ) ; } const client = getCurrentHub ( ) . getClient < MiniappClient > ( ) ; if ( client ) { client . showReportDialog ( options ) ; } } returns export function lastEventId ( ) { return getCurrentHub ( ) . lastEventId ( ) ; } param timeout export function flush ( timeout ? ) { const client = getCurrentHub ( ) . getClient < MiniappClient > ( ) ; if ( client ) { return client . flush ( timeout ) ; } return SyncPromise . reject ( false ) ; } param timeout export function close ( timeout ? ) { const client = getCurrentHub ( ) . getClient < MiniappClient > ( ) ; if ( client ) { return client . close ( timeout ) ; } return SyncPromise . reject ( false ) ; } param fn returns export function wrap ( fn ) { return internalWrap ( fn ) ( ) ; }