@monterosa/sdk-launcher-kit 0.18.0 → 0.19.0-rc.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.
- package/dist/index.cjs.js +561 -336
- package/dist/index.cjs.js.map +1 -1
- package/dist/{index.esm2017.js → index.esm.js} +513 -312
- package/dist/index.esm.js.map +1 -0
- package/dist/src/api.d.ts +23 -9
- package/dist/src/autoresize.d.ts +9 -0
- package/dist/src/child_helpers.d.ts +6 -5
- package/dist/src/constants.d.ts +2 -4
- package/dist/src/custom_element.d.ts +9 -0
- package/dist/src/experience_impl.d.ts +3 -4
- package/dist/src/index.d.ts +4 -4
- package/dist/src/integrations.d.ts +15 -0
- package/dist/src/loader.d.ts +2 -4
- package/dist/src/logger.d.ts +2 -4
- package/dist/src/parent_application.d.ts +2 -4
- package/dist/src/parent_application_impl.d.ts +2 -4
- package/dist/src/storage.d.ts +7 -6
- package/dist/src/storage_impl.d.ts +2 -4
- package/dist/src/types.d.ts +8 -12
- package/dist/src/utils/bridge/api.d.ts +2 -4
- package/dist/src/utils/bridge/bridge_impl.d.ts +4 -4
- package/dist/src/utils/bridge/config.d.ts +2 -4
- package/dist/src/utils/bridge/constants.d.ts +2 -4
- package/dist/src/utils/bridge/helpers.d.ts +2 -4
- package/dist/src/utils/bridge/index.d.ts +2 -4
- package/dist/src/utils/bridge/public_types.d.ts +5 -7
- package/dist/src/utils/bridge/sideeffects.d.ts +2 -4
- package/dist/src/utils/bridge/types.d.ts +2 -4
- package/dist/src/utils/htmlelement-shim.d.ts +8 -0
- package/package.json +20 -14
- package/dist/index.esm2017.js.map +0 -1
- package/dist/index.esm5.js +0 -1837
- package/dist/index.esm5.js.map +0 -1
- package/dist/src/utils/hash.d.ts +0 -19
- package/dist/src/utils/hashable.d.ts +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/constants.ts","../src/logger.ts","../src/utils/bridge/public_types.ts","../src/types.ts","../src/utils/bridge/types.ts","../src/utils/bridge/config.ts","../src/utils/bridge/helpers.ts","../src/utils/bridge/sideeffects.ts","../src/utils/bridge/constants.ts","../src/utils/bridge/bridge_impl.ts","../src/utils/bridge/api.ts","../src/experience_impl.ts","../src/integrations.ts","../src/loader.ts","../src/api.ts","../src/parent_application_impl.ts","../src/parent_application.ts","../src/storage_impl.ts","../src/storage.ts","../src/custom_element.ts","../src/autoresize.ts","../src/child_helpers.ts"],"sourcesContent":["/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nexport const RESIZE_THROTTLE_TIMEOUT = 25;\n\n/**\n * Duration of the loader fade IN/OUT animation\n */\nexport const LOADER_ANIMATION_DURATION = 750;\n\n/**\n * Final cut off timeout for the loader after which it will be hidden even\n * though Experience UI may ne not yet ready\n */\nexport const LOADER_TIMEOUT = 5000;\n\n/**\n * Bumper timeout during which the loader still visible even though Experience\n * UI may be ready\n *\n * (!) At the moment its value is 0 as loader has a fade in effect what already\n * adds a small bumper delay before Experience is injected on the page\n */\nexport const LOADER_BUMPER_TIMEOUT = 0;\n\nexport const DEFAULT_HEIGHT = 250;\n","/**\n * @license\n * @monterosa/sdk-interact-kit\n *\n * Copyright © 2023 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Logger } from '@monterosa/sdk-core';\n\nexport const logger = new Logger('@monterosa/sdk-interact-kit');\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Emitter } from '@monterosa/sdk-util';\n\n/**\n * Android SDK registers the following functions:\n * - calls `window.monterosaSdk.receiveMessage()` if wants to send a message\n * - registers `window.monterosaSdk.postMessage()` to receive a message\n * iOS SDK:\n * - calls `window.monterosaSdk.receiveMessage()` if wants to send a message\n * - registers `window.webkit.messageHandlers.monterosaSdk.postMessage()` to receive a message\n */\n\ntype GlobalMonterosaSdk = {\n initialised: boolean;\n emitter: Emitter;\n // send message to Android\n postMessage?: (message: string) => void;\n // receive a message from Android or iOS\n receiveMessage: (message: Message) => void;\n};\n\ntype GlobalWebkitType = {\n messageHandlers?: {\n monterosaSdk: {\n // post message to iOS\n postMessage: (message: string) => void;\n };\n };\n};\n\ndeclare global {\n /**\n * Declare variables in globalThis. This solution only works by declaring\n * variables with `var`: https://stackoverflow.com/a/69429093\n */\n\n // eslint-disable-next-line\n var monterosaSdk: GlobalMonterosaSdk | undefined;\n\n // eslint-disable-next-line\n var webkit: GlobalWebkitType | undefined;\n\n interface Window {\n monterosaSdk?: GlobalWebkitType;\n webkit?: GlobalWebkitType;\n }\n}\n\n/**\n * The Payload type is a type alias that represents a key-value hash object\n * in which the keys are strings and the values can be of any type.\n * This is a flexible way to define the content of the message being sent,\n * as the keys can be customized to match the specific needs of the application,\n * and the values can be any valid JavaScript type.\n */\nexport type Payload = { [string: string]: any };\n\n/**\n * The Message interface is used to define the structure of a message that\n * is passed between two applications via a communication bridge.\n */\nexport interface Message {\n /**\n * Id of the message. Its autogenerated by the communication bridge\n */\n id: string;\n /**\n * Id of the message this message responds to.\n */\n respondingTo: string | null;\n /**\n * The source of message. Used to distinguish Monterosa SDK messages from other\n * broadcasted messages. In the future can be used for a more fine grade targeting\n */\n sourceName: Source | string;\n /**\n * The current timestamp in milliseconds\n */\n timestamp: number;\n /**\n * Defines the message action\n */\n action: Action | string;\n /**\n * Hash of key-value pairs. Values constrained by json format:\n * four primitive types (strings, numbers, booleans,\n * and null) and two structured types (objects and arrays).\n */\n payload: Payload;\n /**\n * Used to identify if the message belongs to the communication\n * bridge established between parent and child\n */\n bridgeId: string;\n /**\n * Message protocol version\n */\n version: string;\n}\n\n/**\n * @internal\n */\nexport interface Bridge extends Emitter {\n id: string;\n iFrameId: string;\n iFrameSelector: string;\n childIFrame: HTMLIFrameElement | null;\n send: (\n action: string,\n payload?: Payload,\n sourceName?: Source,\n id?: string,\n ) => Message;\n request: (\n action: string,\n payload?: Payload,\n timeout?: number,\n sourceName?: Source,\n ) => Promise<Message>;\n}\n\n/**\n * @internal\n */\nexport interface Bridged {\n bridge: Bridge;\n}\n\n/**\n * A list of possible actions in communications between\n * parent application and child Experience\n *\n * @internal\n */\nexport enum Action {\n /**\n * Notifies that communication channel is ready and\n * messages can be {@link sendSdkMessage | sent}\n */\n OnReady = 'onBridgeReady',\n /**\n * Notifies that intrisic size of child Experience has changed\n */\n OnResize = 'onIntrinsicSizeChanged',\n /**\n * Notifies that UI of child Experience is loaded.\n * When this action is fired the loader will be hidden\n */\n OnUILoaded = 'onUILoaded',\n /**\n * Notifies child Experience about the request to load more data\n */\n OnMoreDataRequested = 'onMoreDataRequested',\n}\n\n/**\n * @internal\n */\nexport enum Source {\n Sdk = 'sdk',\n User = 'user',\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022-2024 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { MonterosaSdk } from '@monterosa/sdk-core';\n\nimport { Bridged } from './utils/bridge/public_types';\n\n/**\n * Reserved query parameter names for controlling the behaviour of Experience.\n */\nexport enum QueryParam {\n /**\n * Represents the host of the application. This parameter is added by Studio\n * and the embed URL already contains it.\n */\n Host = 'h',\n /**\n * Represents the Project Id of the application. This parameter is added by\n * Studio and the embed URL already contains it.\n */\n Project = 'p',\n /**\n * Represents the Event Id of the application. This parameter is added to the\n * experience URL when the eventId is provided in the experience config.\n */\n Event = 'e',\n /**\n * Used to identify the unique ID of the communication bridge between\n * the parent application and the child experience.\n */\n BridgeId = 'micBridgeId',\n /**\n * Determines whether the header and footer views of the application should be\n * hidden. This parameter can be used to control the visibility of the\n * application's header and footer components.\n */\n HideHeaderAndFooter = 'micHideHeaderAndFooter',\n /**\n * Determines whether autoresize is enabled for the application. When autoresize\n * is enabled, the application's height will adjust automatically based on its\n * content.\n */\n AutoresizesHeight = 'micAutoresizesHeight',\n}\n\n/**\n * Interface of user Experience provided by the Monterosa / Interaction Cloud\n */\nexport interface Experience extends Bridged {\n /**\n * Instance of SDK\n *\n * @internal\n */\n sdk: MonterosaSdk;\n /**\n * Unique identifier of the Experience instance.\n */\n id: string;\n /**\n * Config\n */\n config: ExperienceConfiguration;\n /**\n * Generates the URL to use when embedding the experience by\n * reconciling multiple data sources:\n *\n * 1. The embed URL as specified in App spec and obtained via Listings\n *\n * 2. The `host` and `projectId` used to configure the SDK instance\n *\n * 3. The `experienceUrl` passed via {@link ExperienceConfiguration}\n *\n * 4. `host`, `projectId` and `eventId` parameters passed via {@link ExperienceConfiguration}\n *\n * 5. Custom `parameters` dictionary passed via {@link ExperienceConfiguration}\n *\n * To reconcile all of those data sources, the SDK . Also we protect\n * {@link QueryParam | reserved parameters} required for the functioning\n * of the SDK.\n *\n * This implies:\n *\n * - SDK will always prioritise using the values lower in the list above.\n *\n * - SDK {@link QueryParam | reserved parameters} will be stripped out from\n * embed URL, `experienceURL` and custom\n * {@link ExperienceConfiguration | parameters dictionary}.\n *\n * - `h`, `e`, `p` query parameters provided in custom parameters dictionary\n * will be ignored\n *\n * @returns the URL to use when embedding the Experience.\n */\n getUrl(): Promise<string>;\n}\n\n/**\n * Interface of parent application\n *\n * @remarks\n * Parent application is a reference to the parent window where Experience\n * resides. It is used to establish communication bridge between Experience and\n * parent application. It can be get with {@link getParentApplication}\n */\nexport interface ParentApplication extends Bridged {}\n\n/**\n * Experience configuration options\n */\nexport interface ExperienceConfiguration {\n /**\n * The user is able to override default experience URL. If its not empty,\n * default experience URL will be overwritten with the provided one. At the\n * same time URL query parameters will remain.\n */\n experienceUrl?: string | null;\n /**\n * Overrides the host portion of the resulting experience URL. This property\n * takes precedence over `experienceUrl`. For example, if `experienceUrl` is\n * \"https://example.com?h=h1\" and the `host` is set to \"h2\", the resulting URL\n * will be: https://example.com?h=h2\n */\n host?: string;\n /**\n * Overrides the project id portion of the resulting experience URL. This\n * property takes precedence over `experienceUrl`. For example,\n * if `experienceUrl` is \"https://example.com?p=p1\" and the `projectId` is\n * set to \"p2\", the resulting URL will be: https://example.com?p=p2\n */\n projectId?: string;\n /**\n * If event id is provided, Experience can automatically displays elements\n * associated with this event. It is worth to mention that the behaviour of\n * Experiences depend on their implementation and can vary.\n *\n * This property takes precedence over `experienceUrl`. For example, if\n * `experienceUrl` is \"https://example.com?e=e1\" and the `eventId` is set to\n * \"e2\", the resulting URL will be: https://example.com?e=e2\n */\n eventId?: string;\n /**\n * A key/value dictionary of custom parameters that will be passed on to the\n * embedded Experience as URL query parameter. There are several reserved\n * parameter keys: \"p\", \"h\", \"e\", \"micHideHeaderAndFooter\" and \"micBridgeId\".\n * When one of reserved keys is provided it will be ignored.\n */\n parameters?: { [key: string]: string };\n /**\n * If true the container adjusts its height according to the intrinsic\n * height of embedded Experience\n */\n autoresizesHeight?: boolean;\n /**\n * If true removes the headers and footers of embedded Experience,\n * so that the resulting UI does not display two headers/footers.\n */\n hidesHeadersAndFooters?: boolean;\n /**\n * The user is able to control wether loading state is enabled or disabled\n * using this property. By default, it is true meaning that the loading state\n * will be enabled.\n */\n supportsLoadingState?: boolean;\n /**\n * Loading template is a function that returns html markup which can be used\n * to substitute default loader UI. Make sure that the template is wrapped in\n * a single html element, e.g. `() => '<div>...loading...</div>'`\n */\n loadingTemplate?: () => string;\n /*\n * Defines a Permissions Policy for the <iframe>. This policy outlines the\n * available features for the <iframe> (e.g., access to the microphone,\n * camera, battery, web-share, etc.) based on the origin of the request.\n *\n * Additional information can be found at: https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy\n */\n allow?: string;\n /**\n * Set this to true to enable iframe's fullscreen mode compatibility with\n * older browsers.\n */\n allowFullScreen?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface Integration {\n experience: Experience;\n container: HTMLElement;\n controller: AbortController;\n embedded: boolean;\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2024 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\n/**\n * Defines a set of error codes that may be encountered when using the\n * Launcher Kit bridge\n *\n * @example\n * ```javascript\n * try {\n * // some code that uses the LauncherKit's bridge\n * } catch (err) {\n * if (err.code === BridgeError.InvalidRequestTimeoutError) {\n * // handle invalid request timeout error\n * } else {\n * // handle other error types\n * }\n * }\n * ```\n *\n * @remarks\n * - The `BridgeError` enum provides a convenient way to handle errors\n * encountered when using the `LauncherKit` module. By checking the code\n * property of the caught error against the values of the enum, the error\n * type can be determined and appropriate action taken.\n *\n * - The `BridgeError` enum is not intended to be instantiated or extended.\n */\nexport enum BridgeError {\n /**\n * Indicates an error occurred due to an invalid timeout value being provided.\n * This error is thrown when the specified timeout is not a positive number.\n */\n InvalidRequestTimeoutError = 'invalid_request_timeout_error',\n}\n\nexport const BridgeErrorMessages = {\n [BridgeError.InvalidRequestTimeoutError]: () =>\n 'Request timeout must be greater than 0',\n};\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2024 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { createError } from '@monterosa/sdk-util';\n\nimport { BridgeError, BridgeErrorMessages } from './types';\n\n/**\n * @internal\n */\nconst Config = {\n requestTimeout: 20000,\n};\n\n/**\n * Sets a new timeout value for requests (default is 20_000 mseconds).\n *\n * This function updates the request timeout in the application's configuration.\n * It ensures that the new timeout value is a positive number, and throws\n * an error if the value is non-positive.\n *\n * @param newTimeout - The new timeout value in milliseconds. Must be\n * a positive number.\n *\n * @throws\n * Throws {@link BridgeError | BridgeError.InvalidRequestTimeoutError}\n * if `newTimeout` is less than or equal to 0.\n *\n * @example\n * ```javascript\n * // Set the request timeout to 3000 milliseconds\n * setRequestTimeout(3000);\n * ```\n */\nexport function setRequestTimeout(newTimeout: number) {\n if (newTimeout <= 0) {\n throw createError(\n BridgeError.InvalidRequestTimeoutError,\n BridgeErrorMessages,\n );\n }\n\n Config.requestTimeout = newTimeout;\n}\n\nexport default Config;\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Message } from './public_types';\n\nexport function isMessage(message: Message | any): message is Message {\n return (\n message instanceof Object &&\n Object.prototype.hasOwnProperty.call(message, 'bridgeId')\n );\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\n/* eslint no-console: \"off\" */\n\nimport { getGlobal, Emitter } from '@monterosa/sdk-util';\n\nimport { isMessage } from './helpers';\n\nconst globals = getGlobal();\n\nconst receiveMessage = (message: any) => {\n if (!isMessage(message)) {\n // data does not match message format\n return;\n }\n\n globals.monterosaSdk!.emitter.emit('message', message);\n};\n\nfunction handleWindowMessage({ data }: MessageEvent) {\n try {\n if (typeof data !== 'string') {\n // ignore non string data\n return;\n }\n\n const message = JSON.parse(data);\n\n receiveMessage(message);\n } catch (err) {\n if (err instanceof Error) {\n console.error(err.message);\n }\n }\n}\n\n/**\n * Since this code operates as a side effect while updating the global space,\n * we must be very careful because it may run twice, for example, when two apps\n * using the SDK run on the same page. Additionally, the global namespace may\n * already be updated by the Android or iOS SDKs.\n */\n\n// The Monterosa SDK namespace may already exist, either because it was created\n// by a native SDK or by another web app using the JS SDK from the same scope.\nglobals.monterosaSdk ??= {\n initialised: false,\n emitter: new Emitter(),\n receiveMessage,\n};\n\n// Each of nullish coalescing assignments will only be applied when\n// the Monterosa SDK namespace exists at that moment and one of its properties\n// is not defined.\nglobals.monterosaSdk.initialised ??= false;\nglobals.monterosaSdk.emitter ??= new Emitter();\nglobals.monterosaSdk.receiveMessage ??= receiveMessage;\n\nif (!globals.monterosaSdk.initialised) {\n // Subscribe to the message only once for each app that uses the SDK on this page.\n if (typeof globals.addEventListener !== 'undefined') {\n globals.addEventListener('message', handleWindowMessage);\n }\n\n globals.monterosaSdk.initialised = true;\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { getGlobal } from '@monterosa/sdk-util';\n\nconst globals = getGlobal();\n\n/**\n * @internal\n */\nexport const IFRAME_ID_PREFIX = 'micBridge';\n\nexport const IS_IOS =\n !!globals.webkit?.messageHandlers?.monterosaSdk?.postMessage;\nexport const IS_ANDROID = !!globals.monterosaSdk?.postMessage;\nexport const IS_WEB = globals.self !== globals.parent;\n\n/**\n * @internal\n */\nexport const VERSION = '1.0.0';\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { getGlobal, Emitter } from '@monterosa/sdk-util';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport './sideeffects';\n\nimport { Message, Bridge, Payload, Source, Action } from './public_types';\nimport {\n IFRAME_ID_PREFIX,\n VERSION,\n IS_IOS,\n IS_WEB,\n IS_ANDROID,\n} from './constants';\nimport Config from './config';\n\nimport { logger } from '../../logger';\n\nconst globals = getGlobal();\n\n/**\n * @internal\n */\nclass BridgeImpl extends Emitter implements Bridge {\n private recipientReady: boolean = false;\n private messagesQueue: Message[] = [];\n\n constructor(public id: string = uuidv4()) {\n super();\n\n globals.monterosaSdk!.emitter.on('message', this.handleMessage.bind(this));\n }\n\n static isMessage(message: Message | any): message is Message {\n return (\n message instanceof Object &&\n Object.prototype.hasOwnProperty.call(message, 'bridgeId') &&\n Object.prototype.hasOwnProperty.call(message, 'action')\n );\n }\n\n get iFrameId(): string {\n return `${IFRAME_ID_PREFIX}-${this.id}`;\n }\n\n get iFrameSelector(): string {\n return `iframe#${this.iFrameId}`;\n }\n\n get childIFrame(): HTMLIFrameElement | null {\n return document.querySelector(this.iFrameSelector);\n }\n\n private handleMessage(message: Message) {\n const { id, bridgeId, action, respondingTo } = message;\n\n if (bridgeId !== this.id) {\n return;\n }\n\n logger.log(\n `Received a ${respondingTo === null ? 'message' : 'response'}`,\n message,\n );\n\n if (action === Action.OnReady) {\n this.recipientReady = true;\n\n if (respondingTo === null) {\n this.send(Action.OnReady, {}, Source.Sdk, id);\n }\n\n while (this.messagesQueue.length > 0) {\n this.postMessage(this.messagesQueue.shift()!);\n }\n }\n\n this.emit('message', message);\n }\n\n private createMessage(\n action: string,\n payload: Payload,\n sourceName: Source,\n respondingTo: string | null = null,\n ): Message {\n return {\n id: uuidv4(),\n respondingTo,\n action,\n sourceName,\n\n bridgeId: this.id,\n\n payload,\n version: VERSION,\n timestamp: Date.now(),\n };\n }\n\n postMessage(message: Message) {\n if (!this.recipientReady && message.action !== Action.OnReady) {\n this.messagesQueue.push(message);\n\n return;\n }\n\n const json = JSON.stringify(message);\n\n if (IS_IOS) {\n globals.webkit?.messageHandlers?.monterosaSdk.postMessage(json);\n }\n\n if (IS_ANDROID) {\n if (globals.monterosaSdk?.postMessage) {\n globals.monterosaSdk.postMessage(json);\n }\n }\n\n if (IS_WEB) {\n globals.parent.postMessage(json, '*');\n }\n\n if (this.childIFrame) {\n this.childIFrame.contentWindow?.postMessage(json, '*');\n }\n }\n\n send(\n action: string,\n payload: Payload = {},\n sourceName = Source.Sdk,\n respondingTo?: string,\n ): Message {\n const message = this.createMessage(\n action,\n payload,\n sourceName,\n respondingTo,\n );\n\n logger.log(\n `Sending a ${message.respondingTo === null ? 'message' : 'response'}`,\n message,\n );\n\n this.postMessage(message);\n\n return message;\n }\n\n async request(\n action: string,\n payload: Payload = {},\n timeout: number = Config.requestTimeout,\n sourceName = Source.Sdk,\n ): Promise<Message> {\n let timeoutRef: ReturnType<typeof setTimeout>;\n let handler: (message: Message) => void;\n\n const message = this.createMessage(action, payload, sourceName);\n\n logger.log('Sending a request', message);\n\n /**\n * Start the timeout, when it finishes it should reject Promise.race below\n */\n const countdown: Promise<any> = new Promise((_, reject) => {\n timeoutRef = setTimeout(\n () =>\n reject(\n new Error(\n `The request for action '${action}' exceeded the timeout ` +\n `limit of ${timeout}ms and was aborted.`,\n ),\n ),\n timeout,\n );\n });\n\n /**\n * Start the request and wait for the message with the respondingTo\n * equal to message id we sent\n */\n const request: Promise<Message> = new Promise((resolve) => {\n handler = (responseMessage: Message) => {\n if (responseMessage.respondingTo === message.id) {\n resolve(responseMessage);\n }\n };\n\n globals.monterosaSdk!.emitter.on('message', handler);\n\n this.postMessage(message);\n });\n\n /**\n * Start race between timeout and request\n * - if timeout wins the promise will be rejected\n * - if request wins then Message will be resolved\n */\n\n return (\n Promise.race([countdown, request])\n /**\n * As the matter of clean up we need to clear timeout id\n * and unsubscribe from the message event\n */\n .finally(() => {\n clearTimeout(timeoutRef);\n globals.monterosaSdk!.emitter.off('message', handler);\n })\n );\n }\n}\n\nexport default BridgeImpl;\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Unsubscribe, subscribe } from '@monterosa/sdk-util';\n\nimport { Bridge, Bridged, Message, Source, Payload } from './public_types';\n\nimport { QueryParam } from '../../types';\n\nimport Config from './config';\nimport BridgeImpl from './bridge_impl';\n\nlet parentBridge: Bridge;\n\nconst bridges: Map<string, BridgeImpl> = new Map();\n\n/**\n * @internal\n */\nexport function getBridge(id: string): BridgeImpl {\n if (bridges.has(id)) {\n return bridges.get(id) as BridgeImpl;\n }\n\n const bridge = new BridgeImpl(id);\n\n bridges.set(id, bridge);\n\n return bridge;\n}\n\n/**\n * @internal\n */\nexport function getParentBridge(): Bridge | null {\n if (typeof window === 'undefined') {\n return null;\n }\n\n if (parentBridge !== undefined) {\n return parentBridge;\n }\n\n const url = new URL(window.location.href);\n\n const bridgeId = url.searchParams.get(QueryParam.BridgeId);\n\n if (bridgeId === null) {\n return null;\n }\n\n parentBridge = new BridgeImpl(bridgeId);\n\n return parentBridge;\n}\n\n/**\n * @internal\n */\nexport function sendSdkMessage(\n bridged: Bridged,\n action: string,\n payload: Payload = {},\n) {\n return bridged.bridge.send(action, payload, Source.Sdk);\n}\n\n/**\n * This function allows to send a simple message with action name and payload to\n * a recipient which can be either parent application (from Experience to parent\n * application) or child Experience (from parent page to Experience).\n *\n * @remarks\n * Usage example in parent application:\n *\n * @example\n * ```typescript\n * const experience = getExperience();\n *\n * // message to Experience can be sent only when its ready\n * onUILoaded(experience, async () => {\n * sendMessage(\n * experience,\n * 'my_action',\n * { key: 'value' }\n * );\n * });\n *\n * embed(experience);\n * ```\n *\n * Usage example in child Experience:\n *\n * @example\n * ```typescript\n * const parentApp = getParentApplication();\n *\n * if (parentApp !== null) {\n * sendMessage(\n * parentApp,\n * 'my_action',\n * { key: 'value' }\n * );\n * }\n * ```\n *\n * @param bridged - Instance of either {@link ParentApplication} or {@link Experience}\n * @param action - Arbitrary action name that defines purpose of the message\n * @param payload - A key-value object that is sent in a message\n * @returns Returns {@link Message | message}\n */\nexport function sendMessage(\n bridged: Bridged,\n action: string,\n payload: Payload = {},\n) {\n return bridged.bridge.send(action, payload, Source.User);\n}\n\n/**\n * @internal\n */\nexport function sendSdkRequest(\n bridged: Bridged,\n action: string,\n payload: Payload = {},\n timeout = Config.requestTimeout,\n) {\n return bridged.bridge.request(action, payload, timeout, Source.Sdk);\n}\n\n/**\n * This function allows to send a request with action name and payload to\n * a recipient which can be either parent application (from Experience to parent\n * application) or child Experience (from parent page to Experience). It is similar\n * to {@link sendMessage} with only one difference is that it returns a Promise which\n * resolves if the recipient response with {@link respondToMessage}. Otherwise it\n * will rejects after a certain timeout.\n *\n * @remarks\n * Usage example in parent application:\n *\n * @example\n * ```typescript\n * const experience = getExperience();\n *\n * // request to Experience can be sent only when its ready\n * onUILoaded(experience, async () => {\n * const response = await sendRequest(\n * experience,\n * 'my_action',\n * { key: 'value' }\n * );\n *\n * console.log(response);\n * });\n *\n * embed(experience);\n * ```\n *\n * Usage example in child Experience:\n *\n * @example\n * ```typescript\n * const parentApp = getParentApplication();\n *\n * // parent application can be null if Experience is running stand alone\n * if (parentApp !== null) {\n * const response = await sendRequest(\n * parentApp,\n * 'my_action',\n * { key: 'value' }\n * );\n *\n * console.log(response);\n * }\n * ```\n *\n * @param bridged - Instance of either {@link ParentApplication} or {@link Experience}\n * @param action - Arbitrary action name that defines purpose of the message\n * @param payload - A key-value object that is sent as in request\n * @param timeout - Configurable request timeout, if there is no response by\n * the end of this timeout then returned Promise will be rejected.\n */\nexport function sendRequest(\n bridged: Bridged,\n action: string,\n payload: Payload = {},\n timeout = Config.requestTimeout,\n) {\n return bridged.bridge.request(action, payload, timeout, Source.User);\n}\n\n/**\n * @internal\n */\nexport function respondToSdkMessage(\n bridged: Bridged,\n message: Message,\n payload: Payload = {},\n) {\n bridged.bridge.send(message.action, payload, Source.Sdk, message.id);\n}\n\n/**\n * Respond to a received message. It is used to reply to a\n * {@link sendRequest | user request}.\n *\n * @param bridged - Instance of either {@link ParentApplication} or {@link Experience}\n * @param message - {@link Message | Message} to respond to\n * @param payload - A key-value object that is sent as in response\n */\nexport function respondToMessage(\n bridged: Bridged,\n message: Message,\n payload: Payload = {},\n) {\n bridged.bridge.send(message.action, payload, Source.User, message.id);\n}\n\nfunction onMessageFunc(\n bridged: Bridged,\n source: Source,\n callback: (message: Message) => void,\n) {\n return subscribe(bridged.bridge, 'message', (message: Message) => {\n if (message.sourceName === source) {\n callback(message);\n }\n });\n}\n\n/**\n * @internal\n */\nexport function onSdkMessage(\n bridged: Bridged,\n callback: (message: Message) => void,\n): Unsubscribe {\n return onMessageFunc(bridged, Source.Sdk, callback);\n}\n\n/**\n * Adds an observer for when user message is received\n *\n * @param bridged - Instance of either {@link ParentApplication} or {@link Experience}\n * @param callback - The callback that is triggered when user message is received\n * @returns The unsubscribe function. When it's called,\n * the observer will be removed and user messages will no longer be received\n */\nexport function onMessage(\n bridged: Bridged,\n callback: (message: Message) => void,\n): Unsubscribe {\n return onMessageFunc(bridged, Source.User, callback);\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022-2024 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { MonterosaSdk } from '@monterosa/sdk-core';\nimport { fetchListings } from '@monterosa/sdk-interact-kit';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { QueryParam, Experience, ExperienceConfiguration } from './types';\nimport { getBridge, Bridge } from './utils/bridge';\n\n/**\n * @internal\n */\nexport default class ExperienceImpl implements Experience {\n readonly _config: Readonly<ExperienceConfiguration>;\n private _parameters: { [key: string]: string } = {};\n readonly bridge: Bridge;\n embedUrl!: string;\n id: string = uuidv4();\n\n constructor(public sdk: MonterosaSdk, config: ExperienceConfiguration) {\n this._config = config;\n this.bridge = getBridge(this.id);\n\n if (config.parameters !== undefined) {\n const reserved = Object.values(QueryParam) as string[];\n const ignored: string[] = [];\n\n Object.entries(config.parameters).forEach(([key, value]) => {\n if (reserved.includes(key)) {\n ignored.push(key);\n } else {\n this._parameters[key] = value;\n }\n });\n\n if (ignored.length === 1) {\n console.warn(\n `Parameter \"${ignored[0]}\" ignored as it matches reserved words`,\n );\n }\n\n if (ignored.length > 1) {\n console.warn(\n `Parameters \"${ignored.join(\n '\", \"',\n )}\" ignored as they match reserved words`,\n );\n }\n }\n }\n\n get config() {\n return Object.assign(this._config, {\n autoresizesHeight: this._config.autoresizesHeight ?? false,\n hidesHeadersAndFooters: this._config.hidesHeadersAndFooters ?? true,\n supportsLoadingState: this._config.supportsLoadingState ?? true,\n experienceUrl: this._config.experienceUrl ?? null,\n });\n }\n\n async getEmbedUrl() {\n if (this.embedUrl) {\n return Promise.resolve(this.embedUrl);\n }\n\n const {\n options: { host, projectId },\n } = this.sdk;\n\n const listings = await fetchListings(host, projectId);\n\n this.embedUrl = listings.project.embed;\n\n return this.embedUrl;\n }\n\n async getUrl(): Promise<string> {\n const embedUrl = await this.getEmbedUrl();\n\n // sanitise and create an object from an url\n let url = new URL(ExperienceImpl.sanitiseUrl(embedUrl));\n\n // override host and project with those that are set in SDK instance\n url.searchParams.set(QueryParam.Host, this.sdk.options.host);\n url.searchParams.set(QueryParam.Project, this.sdk.options.projectId);\n\n // if custom experienceUrl is set:\n // * take experienceUrl as the base\n // * search params from experienceUrl have priority\n if (this.config.experienceUrl !== null) {\n // sanitise and create an object from a custom url\n const customUrl = new URL(\n ExperienceImpl.sanitiseUrl(this.config.experienceUrl),\n );\n\n // apply embedUrl query parameters if they don't exist in experienceUrl\n Array.from(url.searchParams.entries())\n .filter(([key]) => !customUrl.searchParams.has(key))\n .forEach(([key, value]) => customUrl.searchParams.set(key, value));\n\n url = customUrl;\n }\n\n // Prepare a final list of query parameters\n const queryParameters = {\n ...(this.config.host !== undefined && {\n [QueryParam.Host]: this.config.host,\n }),\n\n ...(this.config.projectId !== undefined && {\n [QueryParam.Project]: this.config.projectId,\n }),\n\n ...(this.config.eventId !== undefined && {\n [QueryParam.Event]: this.config.eventId,\n }),\n\n [QueryParam.BridgeId]: this.bridge.id,\n\n [QueryParam.HideHeaderAndFooter]: this.config.hidesHeadersAndFooters\n ? '1'\n : '0',\n\n [QueryParam.AutoresizesHeight]: this.config.autoresizesHeight ? '1' : '0',\n\n // Adding user defined parameters to the URL search parameters if exists\n ...this._parameters,\n };\n\n Object.entries(queryParameters).forEach(([key, value]) => {\n url.searchParams.set(key, value);\n });\n\n return url.href;\n }\n\n private static sanitiseUrl(\n url: string,\n options?: {\n stripReservedParameters?: 'all' | 'mic';\n },\n ): string {\n const stripReservedParameters = options?.stripReservedParameters || 'mic';\n\n // Ensure the URL includes a protocol.\n if (/^http/.test(url) === false) {\n // If none are found, use the same as the document.\n url = `${document.location.protocol}${url}`;\n }\n\n const urlObj = new URL(url);\n\n Object.values(QueryParam)\n .filter((key) => {\n if (stripReservedParameters === 'mic') {\n return key.startsWith('mic');\n }\n\n return key;\n })\n .forEach((key) => urlObj.searchParams.delete(key));\n\n return urlObj.href;\n }\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport type { Integration, Experience } from './types';\n\nconst integrations: Map<HTMLElement, Integration> = new Map();\n\nexport function addIntegration(\n container: HTMLElement,\n integration: Integration,\n) {\n integrations.set(container, integration);\n}\n\nexport function getIntegration(container: HTMLElement): Integration | void {\n return integrations.get(container);\n}\n\nexport function getIntegrations(): Array<Integration> {\n return Array.from(integrations.values());\n}\n\nexport function deleteIntegration(container: HTMLElement) {\n integrations.delete(container);\n}\n\nexport function hasIntegration(container: HTMLElement): boolean;\n\nexport function hasIntegration(experience: Experience): boolean;\n\nexport function hasIntegration(\n containerOrExperience: HTMLElement | Experience,\n): boolean {\n if (containerOrExperience instanceof HTMLElement) {\n return integrations.has(containerOrExperience);\n }\n\n return Array.from(integrations.values()).some(\n (integration) => integration.experience === containerOrExperience,\n );\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { delay } from '@monterosa/sdk-util';\n\nimport { LOADER_ANIMATION_DURATION, DEFAULT_HEIGHT } from './constants';\n\n/* eslint-disable */\ntype CSSProperties = keyof Omit<\n CSSStyleDeclaration,\n | typeof Symbol.iterator\n | number\n | 'length'\n | 'parentRule'\n | 'getPropertyPriority'\n | 'getPropertyValue'\n | 'item'\n | 'removeProperty'\n | 'setProperty'\n>;\n/* eslint-enable */\n\nfunction getLoadingTemplate(): string {\n return `\n <div>\n <style type=\"text/css\">\n .__mic-loader {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9;\n box-sizing: border-box;\n text-align: center;\n background: #fff;\n }\n\n .__mic-loader__container {\n padding: 20px 0;\n gap: 20px;\n min-height: ${DEFAULT_HEIGHT}px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n .__mic-loader__spinner {\n position: relative;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: #0b0f1c;\n color: #0b0f1c;\n animation: mic-loader__animation 1s infinite linear alternate;\n animation-delay: 0.5s; \n }\n\n .__mic-loader__spinner::before,\n .__mic-loader__spinner::after {\n content: \"\";\n display: inline-block;\n position: absolute;\n top: 0;\n }\n\n .__mic-loader__spinner::before {\n left: -15px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: #0b0f1c;\n color: #0b0f1c;\n animation: mic-loader__animation 1s infinite alternate;\n animation-delay: 0s;\n }\n\n .__mic-loader__spinner::after {\n left: 15px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: #0b0f1c;\n color: #0b0f1c;\n animation: mic-loader__animation 1s infinite alternate;\n animation-delay: 1s;\n }\n\n @keyframes mic-loader__animation {\n 0% {\n background-color: #0b0f1c;\n }\n 50%, 100% {\n background-color: rgba(11, 15, 28, 0.2);\n }\n }\n </style>\n <div class=\"__mic-loader\">\n <div class=\"__mic-loader__container\">\n <div class=\"__mic-loader__spinner\"></div>\n </div>\n </div>\n </div>\n `;\n}\n\nexport function embed(\n container: HTMLElement,\n loadingTemplate: () => string = getLoadingTemplate,\n): HTMLElement {\n /**\n * Return existing element if it exists\n */\n let loaderElement: HTMLElement | null =\n container.querySelector('[data-role=loader]');\n\n if (loaderElement !== null) {\n return loaderElement;\n }\n\n /**\n * Stash and apply some custom styles to container element\n */\n stashStyles(container, ['minHeight', 'position']);\n\n container.style.minHeight = `${DEFAULT_HEIGHT}px`;\n\n /**\n * Inject loader element built from the html markup template\n */\n const templateElement = document.createElement('template');\n templateElement.innerHTML = loadingTemplate().trim();\n\n loaderElement = container.appendChild(\n templateElement.content.firstElementChild as Element,\n ) as HTMLElement;\n\n /**\n * Setting custom data attribute to be able to distinguish element along\n * other injected html elements if any\n */\n loaderElement.setAttribute('data-role', 'loader');\n\n return loaderElement;\n}\n\nexport function unmount(container: HTMLElement): void {\n const loaderElement = container.querySelector('[data-role=loader]');\n\n if (loaderElement === null) {\n return;\n }\n\n loaderElement.parentElement?.removeChild(loaderElement);\n\n unstashStyles(container);\n}\n\nexport async function show(\n container: HTMLElement,\n loadingTemplate: () => string = getLoadingTemplate,\n): Promise<void> {\n const loaderElement = embed(container, loadingTemplate);\n\n const { position } = getComputedStyle(container);\n\n /**\n * In order to properly position the loader,\n * the container's position should be anything but 'static'.\n */\n if (position === 'static') {\n container.style.position = 'relative';\n }\n\n /**\n * Setting styles to the loader for a nice fade in animation\n */\n loaderElement.style.opacity = '0';\n\n /**\n * Kicking fade animation in.\n */\n setTimeout(() => {\n loaderElement.style.transition = `all ${LOADER_ANIMATION_DURATION}ms`;\n loaderElement.style.opacity = '1';\n }, 0);\n\n /**\n * Wait until the animation is finished. We do not use \"transitionend\" event\n * here as it will just make the code more bloated and unnecessary complex.\n */\n await delay(LOADER_ANIMATION_DURATION);\n}\n\nexport async function hide(container: HTMLElement): Promise<void> {\n const loaderElement: HTMLElement | null =\n container.querySelector('[data-role=loader]');\n\n if (loaderElement === null) {\n return;\n }\n\n /**\n * Kicking fade out animation.\n */\n setTimeout(() => {\n loaderElement.style.opacity = '0';\n }, 0);\n\n /**\n * Wait until the animation is finished. We do not use \"transitionend\" event\n * here as it will just make the code more bloated and unnecessary complex.\n */\n await delay(LOADER_ANIMATION_DURATION);\n\n unstashStyles(container);\n unmount(container);\n}\n\nfunction stashStyles(element: HTMLElement, props: CSSProperties[]) {\n const styles = getComputedStyle(element);\n\n const stash = props\n .map((prop) => `${String(prop)}=${styles[prop]}`)\n .join(';');\n\n element.setAttribute('data-stash', stash);\n}\n\nfunction unstashStyles(element: HTMLElement) {\n const stash = element.getAttribute('data-stash');\n\n if (stash === null) {\n return;\n }\n\n const attributes: [attr: CSSProperties, value: string][] = stash\n .split(';')\n .map((attr) => attr.split('=') as [attr: CSSProperties, value: string]);\n\n for (const [attr, value] of attributes) {\n element.style[attr] = value;\n }\n\n element.removeAttribute('data-stash');\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022-2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { MonterosaSdk, Sdk, getSdk, LogLevel } from '@monterosa/sdk-core';\nimport { Unsubscribe, delay, Emitter } from '@monterosa/sdk-util';\n\nimport { Experience, ExperienceConfiguration, Integration } from './types';\n\nimport { LOADER_TIMEOUT, LOADER_BUMPER_TIMEOUT } from './constants';\n\nimport { logger } from './logger';\n\nimport { sendSdkMessage, onSdkMessage, Action } from './utils/bridge';\n\nimport ExperienceImpl from './experience_impl';\nimport {\n addIntegration,\n getIntegration,\n getIntegrations,\n deleteIntegration,\n hasIntegration,\n} from './integrations';\n\nimport { show as showLoader, hide as hideLoader } from './loader';\n\nimport { version } from '../package.json';\n\n/**\n * The current SDK version.\n *\n * @internal\n */\nexport const VERSION = version;\n\n/**\n * Event emitter for the launcher kit.\n *\n * @internal\n */\nexport const emitter = new Emitter();\n\n/**\n * Creates an iframe with the provided parameters.\n *\n * @param url Url of the web app.\n *\n * @private\n */\nfunction createIFrame(\n url: string,\n options: {\n id?: string;\n scrolling?: boolean;\n allow?: string;\n allowFullScreen?: boolean;\n } = {},\n): HTMLIFrameElement {\n const iframe = document.createElement('iframe');\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.border = '0';\n iframe.style.display = 'block';\n iframe.style.boxSizing = 'border-box';\n\n iframe.setAttribute('src', url);\n\n if (options.id !== undefined) {\n iframe.setAttribute('id', options.id);\n }\n\n if (options.allow !== undefined) {\n iframe.setAttribute('allow', options.allow);\n }\n\n if (options.allowFullScreen === true) {\n iframe.setAttribute('allowfullscreen', '');\n }\n\n /**\n * Though scrolling attribute is deprecated we still have to rely on it as some\n * browsers (e.g. Chrome, as of now version 103) just ignores overflow: hidden.\n * Hence we are setting scrolling to no in order to eliminate scroll and calculate\n * width of the child Experience correctly. If scroll persists it appears on each\n * content change what leads to incorrect width calculation.\n *\n * Later we will look into alternatives such as iframeless Experience embed\n */\n if (!options.scrolling) {\n iframe.style.overflow = 'hidden';\n iframe.setAttribute('scrolling', 'no');\n }\n\n return iframe;\n}\n\nfunction concealIFrame(iframe: HTMLIFrameElement) {\n iframe.style.opacity = '0';\n}\n\nfunction revealIFrame(iframe: HTMLIFrameElement) {\n iframe.style.opacity = '1';\n}\n\nfunction isSdk(value: MonterosaSdk | any): value is MonterosaSdk {\n return value instanceof Sdk;\n}\n\n/**\n * Returns Experience for the default given sdk\n *\n * @param config - Optional config\n */\nexport function getExperience(config?: ExperienceConfiguration): Experience;\n\n/**\n * Returns Experience for the given sdk\n *\n * @param sdk - Optional project instance whose Experience to return.\n * if no project is provided, it will attempt to use the default one\n * @param config - Optional config\n */\nexport function getExperience(\n sdk?: MonterosaSdk,\n config?: ExperienceConfiguration,\n): Experience;\n\nexport function getExperience(\n sdkOrConfig?: MonterosaSdk | ExperienceConfiguration,\n config?: ExperienceConfiguration,\n): Experience {\n let sdk: MonterosaSdk;\n let experienceConfig: ExperienceConfiguration;\n\n if (isSdk(sdkOrConfig)) {\n /**\n * Interface: getExperience(sdk, config?)\n */\n\n sdk = sdkOrConfig;\n\n if (config !== undefined) {\n experienceConfig = config;\n } else {\n experienceConfig = {};\n }\n } else if (sdkOrConfig !== undefined) {\n /**\n * Interface: getExperience(config)\n */\n\n sdk = getSdk();\n experienceConfig = sdkOrConfig;\n } else {\n /**\n * Interface: getExperience()\n */\n\n sdk = getSdk();\n experienceConfig = {};\n }\n\n const experience = new ExperienceImpl(sdk, experienceConfig);\n\n return experience;\n}\n\nfunction onUILoaded(experience: Experience): Promise<void> {\n return new Promise((resolve) => {\n const unsubscribe = onSdkMessage(experience, ({ action }) => {\n if (action === Action.OnUILoaded) {\n unsubscribe();\n resolve();\n }\n });\n });\n}\n\n/**\n * Subscribe to the event when Experience is embedded into the container.\n * Also calls the callback immediately for all currently embedded Experiences.\n *\n * @param callback - Callback to be called when Experience is embedded.\n */\nexport function onExperienceEmbedded(\n callback: (experience: Experience, container: HTMLElement) => void,\n): Unsubscribe {\n const integrations = getIntegrations();\n\n for (const integration of integrations) {\n if (integration.embedded) {\n callback(integration.experience, integration.container);\n }\n }\n\n emitter.on('embedded', callback);\n\n return () => {\n emitter.off('embedded', callback);\n };\n}\n\n/**\n * Subscribe to the event when Experience is unmounted from the container.\n *\n * @param callback - Callback to be called when Experience is unmounted.\n */\nexport function onExperienceUnmounted(\n callback: (experience: Experience) => void,\n): Unsubscribe {\n emitter.on('unmounted', callback);\n\n return () => {\n emitter.off('unmounted', callback);\n };\n}\n\nasync function experienceReady(experience: Experience) {\n /**\n * Bumper delay during which loading state can't be hidden even\n * if Experience loaded earlier than timer reached bumper timeout\n */\n const bumper = delay(LOADER_BUMPER_TIMEOUT);\n\n /**\n * Final cut off timeout delay after which loading state must\n * be hidden even if Experience is still loading\n */\n const timeout = delay(LOADER_TIMEOUT);\n\n /**\n * Promisifying OnUILoaded communication bridge event\n */\n const loaded = onUILoaded(experience);\n\n const hasFullyLoadedExperience = Promise.all([bumper, loaded]);\n\n const eitherTimeoutOrFullyLoaded = Promise.race([\n timeout,\n hasFullyLoadedExperience,\n ]);\n\n return eitherTimeoutOrFullyLoaded;\n}\n\n/**\n * Embeds web Experience app into iframe. There is only one app can be\n * associated with Experience and it is configured in\n * Monterosa / Interaction Cloud. Please refer the developer guide to get\n * more information on what is app and how to configure it:\n * {@link https://products.monterosa.co/mic/developer-guides/whats-an-app}\n *\n * @example\n * ```javascript\n * const experience = getExperience();\n *\n * embed(experience, 'container-id');\n * ```\n * @param {Experience} - An instance of Experience\n * @param {HTMLElement | string} containerOrId - HTML element instance or\n * element id where iframe is embedded into.\n *\n * @public\n */\nexport async function embed(\n experience: Experience,\n containerOrId: HTMLElement | string,\n): Promise<void> {\n const container =\n containerOrId instanceof HTMLElement\n ? containerOrId\n : document.getElementById(containerOrId);\n\n if (container === null) {\n throw new Error(\n `Container element \"${containerOrId}\" not found in DOM. ` +\n 'Please ensure the element exists before calling embed().',\n );\n }\n\n if (hasIntegration(container)) {\n throw new Error(\n 'Container already contains an embedded experience. Use unmount() first ' +\n 'to remove the existing experience before embedding a new one.',\n );\n }\n\n if (hasIntegration(experience)) {\n throw new Error(\n 'This experience is already embedded in another container. Use unmount() ' +\n 'to remove it from that container before embedding it into this one.',\n );\n }\n\n const controller = new AbortController();\n\n const integration: Integration = {\n container,\n experience,\n controller,\n embedded: false,\n };\n\n addIntegration(container, integration);\n\n if (experience.config.supportsLoadingState === true) {\n // Although showLoader is an asynchronous function, we execute\n // it synchronously to embed the iframe as quickly as possible.\n showLoader(container, experience.config.loadingTemplate);\n }\n\n const url = await experience.getUrl();\n\n if (controller.signal.aborted) {\n return;\n }\n\n const iframe = createIFrame(url, {\n id: experience.bridge.iFrameId,\n scrolling: !experience.config.autoresizesHeight,\n allow: experience.config.allow,\n allowFullScreen: experience.config.allowFullScreen,\n });\n\n container.appendChild(iframe);\n\n concealIFrame(iframe);\n\n integration.embedded = true;\n\n emitter.emit('embedded', experience, container);\n\n await experienceReady(experience);\n\n if (controller.signal.aborted) {\n return;\n }\n\n revealIFrame(iframe);\n\n if (experience.config.supportsLoadingState === true) {\n await hideLoader(container);\n }\n}\n\n/**\n * Unmounts web Experience app which was previously embedded in the container.\n *\n * @example\n * ```javascript\n * unmount('container-id');\n * ```\n *\n * @param {HTMLElement | string} containerOrId - HTML element instance or\n * element id where iframe is embedded into.\n *\n * @public\n */\nexport function unmount(containerOrId: HTMLElement | string): void {\n const container =\n containerOrId instanceof HTMLElement\n ? containerOrId\n : document.getElementById(containerOrId);\n\n if (container === null) {\n throw new Error(\n `Container element \"${containerOrId}\" not found in DOM. ` +\n 'Please ensure the element exists before calling unmount().',\n );\n }\n\n const integration = getIntegration(container);\n\n if (!integration) {\n throw new Error(\n `No experience found embedded in container \"${containerOrId}\". ` +\n 'Please ensure the experience is embedded before calling unmount().',\n );\n }\n\n integration.controller.abort();\n\n while (container.lastElementChild) {\n container.removeChild(container.lastElementChild);\n }\n\n integration.embedded = false;\n\n deleteIntegration(container);\n\n container.style.height = '';\n\n emitter.emit('unmounted', integration.experience, container);\n}\n\n/**\n * Informs the Experience that more data should be loaded and displayed on the UI.\n *\n * @remarks\n * One example is when Experience renders items feed partially. Once a user scrolled\n * to the bottom edge of the app, more elements to load is requested.\n *\n * @param experience - Experience instance\n */\nexport function requestMoreData(experience: Experience): void {\n sendSdkMessage(experience, Action.OnMoreDataRequested);\n}\n\n/**\n * Enables logging with the specified log level.\n *\n * @param logLevel - The log level or flag to determine the logging\n * behavior. If a log level is provided, it will be used to set the log\n * level. If a boolean flag is provided, logging will be enabled or disabled\n * based on the flag value.\n */\nexport function enableLogging(logLevel?: LogLevel): void;\n\n/**\n * Enables or disables logging based on the provided flag.\n *\n * @param enable - The flag to determine the logging behavior. If a boolean flag\n * is provided, logging will be enabled or disabled based on the flag value.\n */\nexport function enableLogging(enable?: boolean): void;\n\nexport function enableLogging(logLevelOrFlag: LogLevel | boolean = true) {\n if (typeof logLevelOrFlag === 'boolean') {\n logger.logLevel = logLevelOrFlag ? LogLevel.Verbose : LogLevel.Silent;\n\n return;\n }\n\n logger.logLevel = logLevelOrFlag;\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Bridge } from './utils/bridge';\nimport { ParentApplication } from './types';\n\nclass ParentApplicationImpl implements ParentApplication {\n constructor(public bridge: Bridge) {}\n}\n\nexport default ParentApplicationImpl;\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2023 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { ParentApplication } from './types';\n\nimport ParentApplicationImpl from './parent_application_impl';\n\nimport { getParentBridge } from './utils/bridge';\n\nlet parentApplication: ParentApplication;\n\n/**\n * Returns instance of parent application.\n *\n * @returns Returns {@link ParentApplication}\n * if an Experience resides within the parent application, and it was embedded\n * using {@link embed} function. Otherwise it returns `null`.\n */\nexport function getParentApplication(): ParentApplication | null {\n if (parentApplication !== undefined) {\n return parentApplication;\n }\n\n const parentBridge = getParentBridge();\n\n if (parentBridge === null) {\n return null;\n }\n\n parentApplication = new ParentApplicationImpl(parentBridge);\n\n return parentApplication;\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2023 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport {\n checkAvailability,\n getItem,\n setItem,\n removeItem,\n clear,\n} from '@monterosa/sdk-util';\n\nexport default class StorageImpl {\n private memoryStore: { [key: string]: string } = {};\n private accessible: boolean = checkAvailability();\n private _persistent: boolean = false;\n\n set persistent(newValue: boolean) {\n const oldValue = this._persistent;\n\n if (oldValue === newValue) {\n return;\n }\n\n const swapToStorage = newValue === true && this.accessible;\n const swapToMemory = newValue === false && this.accessible;\n\n if (swapToStorage) {\n for (const [key, value] of Object.entries(this.memoryStore)) {\n setItem(key, value);\n }\n }\n\n if (swapToMemory) {\n clear();\n }\n\n this._persistent = newValue;\n }\n\n get persistent(): boolean {\n return this._persistent;\n }\n\n getItem(key: string): string | null {\n if (this.persistent && this.accessible) {\n return getItem(key);\n }\n\n if (Object.prototype.hasOwnProperty.call(this.memoryStore, key)) {\n return this.memoryStore[key];\n }\n\n return null;\n }\n\n setItem(key: string, value: string): void {\n if (this.persistent && this.accessible) {\n setItem(key, value);\n }\n\n this.memoryStore[key] = value;\n }\n\n removeItem(key: string): void {\n if (this.persistent && this.accessible) {\n removeItem(key);\n }\n\n delete this.memoryStore[key];\n }\n\n clear(): void {\n if (this.persistent && this.accessible) {\n clear();\n }\n\n this.memoryStore = {};\n }\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2023 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Experience } from './types';\n\nimport { onExperienceEmbedded, onExperienceUnmounted } from './api';\nimport { getParentApplication } from './parent_application';\nimport StorageImpl from './storage_impl';\n\nimport {\n sendSdkRequest,\n respondToSdkMessage,\n onSdkMessage,\n Payload,\n} from './utils/bridge';\n\n/**\n * @internal\n */\nexport enum StorageAction {\n Read = 'storageRead',\n Write = 'storageWrite',\n Remove = 'storageRemove',\n Clear = 'storageClear',\n}\n\n/**\n * @internal\n */\nexport const storage = new StorageImpl();\n\n/**\n * @internal\n */\nconst unsubs: Map<string, () => void> = new Map();\n\n/**\n * @internal\n */\nexport function handleExperienceEmbedded(experience: Experience) {\n const unsub = onSdkMessage(experience, (message) => {\n if (\n !Object.values(StorageAction).includes(message.action as StorageAction)\n ) {\n return;\n }\n\n const { key, value } = message.payload as {\n key?: string;\n value?: string;\n };\n\n const respond = (payload?: Payload) =>\n respondToSdkMessage(experience, message, payload);\n\n try {\n switch (message.action) {\n case StorageAction.Read:\n if (key === undefined) {\n throw new Error('Key is required');\n }\n\n respond({\n key,\n value: storage.getItem(key),\n });\n break;\n case StorageAction.Write:\n if (key === undefined || value === undefined) {\n throw new Error('Key and value are required');\n }\n\n storage.setItem(key, value);\n\n respond({ key });\n break;\n case StorageAction.Remove:\n if (key === undefined) {\n throw new Error('Key is required');\n }\n\n storage.removeItem(key);\n\n respond({ key });\n break;\n case StorageAction.Clear:\n storage.clear();\n respond();\n break;\n }\n } catch (error) {\n if (error instanceof Error) {\n respond({\n ...(key !== undefined && { key }),\n error: error.message,\n });\n }\n }\n });\n\n unsubs.set(experience.id, unsub);\n}\n\n/**\n * @internal\n */\nexport function handleExperienceUnmounted(experience: Experience) {\n const unsub = unsubs.get(experience.id);\n\n if (unsub) {\n unsub();\n unsubs.delete(experience.id);\n }\n}\n\n/**\n * The `setStoragePersistent` function is a simple function that allows to\n * control the persistence of the SDK storage. If the argument `persistent` is\n * set to `true`, then the storage will be persistent across browser sessions\n * and if it is set to `false`, then the storage will save to memory.\n * It is important to note that the use of persistent storage may be subject\n * to laws and regulations, such as those related to data privacy and protection.\n *\n * @remarks\n * - We transition from persistent to memory and memory to persistent in\n * a seamless manner for you\n *\n * - By default we store in memory\n *\n * - The value of storage persistent persists across session (aka put it to true,\n * it will remain so, put it back to false, it will remain so)\n *\n * - You have the responsibility to comply with any laws and regulations, and\n * store only the data if you know it's valid to do so\n *\n * @param persistent - Determines whether or not SDK storage should persist\n * across browser sessions.\n */\nexport function setStoragePersistent(persistent: boolean): void {\n storage.persistent = persistent;\n}\n\n/**\n * The function allows to read data from the SDK storage.\n *\n * @param key - The name of the item to be read from storage.\n *\n * @throws\n * The function throws an error if there is a timeout reading the data\n * from the parent application storage.\n *\n * @returns A promise that resolves to the value\n * of the item in storage or `null` if the item doesn't exist.\n */\nexport async function storageRead(key: string): Promise<string | null> {\n const parentApp = getParentApplication();\n\n let value: string | null = null;\n\n if (parentApp !== null) {\n const result = await sendSdkRequest(parentApp, StorageAction.Read, {\n key,\n });\n\n if (result.payload.error !== undefined) {\n throw new Error(result.payload.error);\n }\n\n value = result.payload.value as string;\n } else {\n value = storage.getItem(key);\n }\n\n return Promise.resolve(value);\n}\n\n/**\n * The function allows to write data to the SDK storage.\n *\n * @param key - A name of the item to be stored.\n * @param value - A value to be stored.\n *\n * @throws\n * The function throws an error if there is a timeout writing the data\n * to the parent's application storage.\n *\n * @returns A promise that resolves to `void` once the data has\n * been successfully stored.\n */\nexport async function storageWrite(key: string, value: string): Promise<void> {\n const parentApp = getParentApplication();\n\n if (parentApp !== null) {\n const result = await sendSdkRequest(parentApp, StorageAction.Write, {\n key,\n value,\n });\n\n if (result.payload.error !== undefined) {\n throw new Error(result.payload.error);\n }\n } else {\n storage.setItem(key, value);\n }\n\n return Promise.resolve();\n}\n\n/**\n * The function allows to remove an item from the SDK storage.\n *\n * @param key - A name of the item to be removed.\n *\n * @throws\n * The function throws an error if there is a timeout removing the data\n * from the parent's application storage.\n *\n * @returns A promise that resolves to `void` once the data has\n * been successfully removed.\n */\nexport async function storageRemove(key: string): Promise<void> {\n const parentApp = getParentApplication();\n\n if (parentApp !== null) {\n const result = await sendSdkRequest(parentApp, StorageAction.Remove, {\n key,\n });\n\n if (result.payload.error !== undefined) {\n throw new Error(result.payload.error);\n }\n } else {\n storage.removeItem(key);\n }\n\n return Promise.resolve();\n}\n\n/**\n * The function allows to clear all data from the SDK storage.\n *\n * @throws\n * The function throws an error if there is a timeout clearing the parent's\n * application storage.\n *\n * @returns A promise that resolves to `void` once the data has been\n * successfully cleared.\n */\nexport async function storageClear(): Promise<void> {\n const parentApp = getParentApplication();\n\n if (parentApp !== null) {\n const result = await sendSdkRequest(parentApp, StorageAction.Clear);\n\n if (result.payload.error !== undefined) {\n throw new Error(result.payload.error);\n }\n } else {\n storage.clear();\n }\n\n return Promise.resolve();\n}\n\nonExperienceEmbedded(handleExperienceEmbedded);\nonExperienceUnmounted(handleExperienceUnmounted);\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022-2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { configure } from '@monterosa/sdk-core';\n\nimport { getExperience, embed, unmount } from './api';\nimport { setStoragePersistent } from './storage';\nimport { Action, onSdkMessage } from './utils/bridge';\n\nconst ELEMENT_NAME = 'monterosa-experience';\n\nclass MonterosaExperienceElement extends HTMLElement {\n async connectedCallback() {\n const host = this.getAttribute('host');\n\n if (host === null) {\n throw new Error('Host attribute is not set for Experience element');\n }\n\n const projectId = this.getAttribute('projectId');\n\n if (projectId === null) {\n throw new Error('Project attribute is not set for Experience element');\n }\n\n const autoresizesHeight = this.getAttribute('autoresizesHeight') !== null;\n\n const hidesHeadersAndFooters =\n this.getAttribute('hidesHeadersAndFooters') !== null;\n\n const persistentStorage = this.getAttribute('persistentStorage') !== null;\n\n const eventId =\n this.getAttribute('eventId') !== null\n ? (this.getAttribute('eventId') as string)\n : undefined;\n\n const experienceUrl =\n this.getAttribute('experienceUrl') !== null\n ? this.getAttribute('experienceUrl')!\n : undefined;\n\n const allow =\n this.getAttribute('allow') !== null\n ? this.getAttribute('allow')!\n : undefined;\n\n const allowFullScreen = this.getAttribute('allowFullScreen') !== null;\n\n const parameters: { [key: string]: string } = {};\n\n for (let i = 0; i < this.attributes.length; i++) {\n const attr = this.attributes[i];\n\n if (attr.name.startsWith('param-')) {\n const paramName = attr.name.split('param-')[1];\n\n parameters[paramName] = attr.value;\n }\n }\n\n const sdk = configure(\n {\n host,\n projectId,\n },\n `${host}-${projectId}`,\n );\n\n const experience = getExperience(sdk, {\n autoresizesHeight,\n eventId,\n hidesHeadersAndFooters,\n experienceUrl,\n allow,\n allowFullScreen,\n parameters,\n });\n\n this.style.height = '250px';\n this.style.display = 'block';\n this.style.position = 'relative';\n\n if (persistentStorage) {\n setStoragePersistent(true);\n }\n\n embed(experience, this);\n\n // eslint-disable-next-line\n onSdkMessage(experience, ({ payload, action }) => {\n switch (action) {\n case Action.OnReady:\n break;\n case Action.OnResize: {\n // const { width, height } = payload;\n break;\n }\n case Action.OnUILoaded:\n this.dispatchEvent(\n new CustomEvent('uiloaded', {\n bubbles: true,\n cancelable: false,\n composed: true,\n }),\n );\n break;\n }\n });\n }\n\n disconnectedCallback() {\n unmount(this);\n }\n}\n\nif (!customElements.get(ELEMENT_NAME)) {\n customElements.define(ELEMENT_NAME, MonterosaExperienceElement);\n}\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Experience } from './types';\n\nimport { Action, onSdkMessage } from './utils/bridge';\n\nimport { onExperienceEmbedded, onExperienceUnmounted } from './api';\n\nconst unsubs: Map<string, () => void> = new Map();\n\nfunction handleExperienceEmbedded(\n experience: Experience,\n container: HTMLElement,\n) {\n if (!experience.config.autoresizesHeight) {\n return;\n }\n\n const unsub = onSdkMessage(experience, ({ action, payload }) => {\n if (action === Action.OnResize) {\n /**\n * Container width is maintained the same as it is defined in the parent\n * page to preserve its behaviour. Only the height is updated\n */\n // container.style.width = `${payload.width}px`;\n container.style.height = `${payload.height}px`;\n }\n });\n\n unsubs.set(experience.id, unsub);\n}\n\nfunction handleExperienceUnmounted(experience: Experience): void {\n const unsub = unsubs.get(experience.id);\n\n if (unsub) {\n unsub();\n unsubs.delete(experience.id);\n }\n}\n\nonExperienceEmbedded(handleExperienceEmbedded);\nonExperienceUnmounted(handleExperienceUnmounted);\n","/**\n * @license\n * @monterosa/sdk-launcher-kit\n *\n * Copyright © 2022 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Unsubscribe, throttle } from '@monterosa/sdk-util';\n\nimport { RESIZE_THROTTLE_TIMEOUT } from './constants';\n\nimport { QueryParam, Experience } from './types';\n\nimport { getParentApplication } from './parent_application';\nimport {\n sendSdkMessage,\n sendSdkRequest,\n onSdkMessage,\n Action,\n} from './utils/bridge';\n\nfunction getUrlParam(param: string) {\n let queryString = {};\n\n if (typeof window !== 'undefined') {\n queryString = window.location.search;\n }\n\n const urlParams = new URLSearchParams(queryString);\n\n return urlParams.get(param);\n}\n\n/**\n * The SDK on the parent application will by default request a child\n * Experience to hide its header and footer by setting a query parameter called\n * `micHideHeaderAndFooter` to `1`.\n *\n * This function will return true if that is the case, and false otherwise.\n *\n * When true, the developer of a child Experience is expected to hide it's headers\n * and footers as the parent application is actively providing them.\n *\n * You can test whether you are respecting this correctly by adding the following query\n * to your URL:\n *\n * \"?micHideHeaderAndFooter=1\"\n *\n * @returns Whether the header and footer views should be hidden.\n */\nexport function shouldHideHeaderAndFooter() {\n return getUrlParam(QueryParam.HideHeaderAndFooter) === '1';\n}\n\n/**\n * This function will returns true if experience is embedded in autoresize height mode.\n */\nexport function isAutoresizesHeight() {\n return getUrlParam(QueryParam.AutoresizesHeight) === '1';\n}\n\n/**\n * This function is used to notify the parent application that the Experience\n * is ready to be used. It's intended to be called by the Experience itself and\n * not by the parent application.\n *\n * @example\n * ```javascript\n * import { sendReady } from '@monterosa/sdk-launcher-kit';\n *\n * sendReady();\n * ```\n *\n * @returns void\n */\nexport function sendReady(): void {\n const parentApp = getParentApplication();\n\n if (parentApp === null) {\n console.log(\n 'Unable to send ready message, as there is no parent application',\n );\n\n return;\n }\n\n sendSdkRequest(parentApp, Action.OnReady);\n}\n\n/**\n * Sends a message to the SDK of the parent application informing it that\n * the UI of this Experience has completed loading.\n *\n * You should call this method when your UI has completed loading and you are ready to\n * display data to the user. This can be when your network calls have successfully requested\n * data and you have updated the DOM for it, or when an error has occurred and you want\n * to take over the UI to provide details to the user.\n *\n * The SDK will use this message to dismiss the loading indicator, allowing a seamless\n * transition between a native loading UI, into a fully loaded, child Experience.\n *\n * If this call is not made, the parent SDK will add a grace period to ensure the web app\n * has sufficient time to load, and eventually dismiss the loading state, whether Experience\n * is ready or not, so as to avoid scenarios were a defect leaves an infinite loading state\n * presented to the user.\n */\nexport function sendFinishedLoadingUI() {\n const parentApp = getParentApplication();\n\n if (parentApp === null) {\n console.log(\n 'Unable to send finished loading UI message, as there is no parent application',\n );\n\n return;\n }\n\n sendSdkMessage(parentApp, Action.OnUILoaded);\n}\n\n/**\n * Adds an observer for when more data is requested by the parent application\n *\n * @param callback - The callback that is triggered when a request for more data\n * is received\n * @returns The unsubscribe function. When it's called,\n * the observer will be removed and requests for data will no longer be received\n */\nexport function onMoreDataRequested(callback: () => void): Unsubscribe {\n const parentApp = getParentApplication();\n\n if (parentApp === null) {\n console.log(\n 'Unable to subscribe to more data event, as there is no parent application',\n );\n\n return () => {};\n }\n\n return onSdkMessage(parentApp, ({ action }) => {\n if (action === Action.OnMoreDataRequested) {\n callback();\n }\n });\n}\n\n/**\n * Adds an observer for when experience is fully embedded and ready to accept\n * incoming messages\n *\n * @param experience - Experience instance\n * @param callback - The callback that is triggered when experience is embedded\n * @returns The unsubscribe function. When it's called, the observer will be\n * removed and ready event will not be received\n */\nexport function onReady(\n experience: Experience,\n callback: () => void,\n): Unsubscribe {\n return onSdkMessage(experience, ({ action }) => {\n if (action === Action.OnReady) {\n callback();\n }\n });\n}\n\n/**\n * @internal\n */\nexport const sendExperienceSizeThrottled: (\n width: number,\n height: number,\n) => void = throttle(\n (width: number, height: number) => {\n const parentApp = getParentApplication();\n\n if (parentApp !== null) {\n sendSdkMessage(parentApp, Action.OnResize, { width, height });\n }\n },\n RESIZE_THROTTLE_TIMEOUT,\n {\n leading: true,\n trailing: true,\n },\n);\n\n/**\n * Sends the experience size to the parent application.\n *\n * @param width - The width of the experience.\n * @param height - The height of the experience.\n */\nexport function sendExperienceSize(width: number, height: number) {\n sendExperienceSizeThrottled(width, height);\n}\n\n/**\n * Sets up an observer to watch for the element dimensions change and\n * automatically reports their changes to the parent application.\n *\n * @param element - HTML element whose dimensions need to be watched\n * @returns The unsubscribe function. When it's called,\n * the observer will be removed and element dimensions are no longer tracked\n */\nexport function reportExperienceSizeChanges(element: HTMLElement): () => void {\n const observer = new ResizeObserver(() => {\n const width = Math.max(element.offsetWidth, element.scrollWidth);\n const height = Math.max(element.offsetHeight, element.scrollHeight);\n\n sendExperienceSize(width, height);\n });\n\n observer.observe(element);\n\n return () => observer.unobserve(element);\n}\n"],"names":["globals","_a","_b","_c","_d","VERSION","uuidv4","embed","unmount","showLoader","hideLoader","unsubs","handleExperienceEmbedded","handleExperienceUnmounted"],"mappings":";;;;;AAAA;;;;;;;AAOG;AAEI,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;AAEG;AACI,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C;;;AAGG;AACI,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC;;;;;;AAMG;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AACH,CAAC,EACD,uBAAuB,EACvB;AACE,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,QAAQ,EAAE,IAAI;AACf,CAAA,EACD;AAEF;;;;;AAKG;AACa,SAAA,kBAAkB,CAAC,KAAa,EAAE,MAAc,EAAA;AAC9D,IAAA,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,2BAA2B,CAAC,OAAoB,EAAA;AAC9D,IAAA,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAK;AACvC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;AACjE,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AAEpE,QAAA,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACpC,KAAC,CAAC,CAAC;AAEH,IAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1B,OAAO,MAAM,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC3C;;;;"}
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022-2025 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
11
9
|
import { MonterosaSdk, LogLevel } from '@monterosa/sdk-core';
|
|
12
|
-
import {
|
|
10
|
+
import { Unsubscribe, Emitter } from '@monterosa/sdk-util';
|
|
11
|
+
import { Experience, ExperienceConfiguration } from './types';
|
|
13
12
|
/**
|
|
14
13
|
* The current SDK version.
|
|
15
14
|
*
|
|
16
15
|
* @internal
|
|
17
16
|
*/
|
|
18
17
|
export declare const VERSION: string;
|
|
18
|
+
/**
|
|
19
|
+
* Event emitter for the launcher kit.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare const emitter: Emitter;
|
|
19
24
|
/**
|
|
20
25
|
* Returns Experience for the default given sdk
|
|
21
26
|
*
|
|
@@ -30,6 +35,19 @@ export declare function getExperience(config?: ExperienceConfiguration): Experie
|
|
|
30
35
|
* @param config - Optional config
|
|
31
36
|
*/
|
|
32
37
|
export declare function getExperience(sdk?: MonterosaSdk, config?: ExperienceConfiguration): Experience;
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to the event when Experience is embedded into the container.
|
|
40
|
+
* Also calls the callback immediately for all currently embedded Experiences.
|
|
41
|
+
*
|
|
42
|
+
* @param callback - Callback to be called when Experience is embedded.
|
|
43
|
+
*/
|
|
44
|
+
export declare function onExperienceEmbedded(callback: (experience: Experience, container: HTMLElement) => void): Unsubscribe;
|
|
45
|
+
/**
|
|
46
|
+
* Subscribe to the event when Experience is unmounted from the container.
|
|
47
|
+
*
|
|
48
|
+
* @param callback - Callback to be called when Experience is unmounted.
|
|
49
|
+
*/
|
|
50
|
+
export declare function onExperienceUnmounted(callback: (experience: Experience) => void): Unsubscribe;
|
|
33
51
|
/**
|
|
34
52
|
* Embeds web Experience app into iframe. There is only one app can be
|
|
35
53
|
* associated with Experience and it is configured in
|
|
@@ -74,10 +92,6 @@ export declare function unmount(containerOrId: HTMLElement | string): void;
|
|
|
74
92
|
* @param experience - Experience instance
|
|
75
93
|
*/
|
|
76
94
|
export declare function requestMoreData(experience: Experience): void;
|
|
77
|
-
/**
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
export declare function registerEmbedHook(hook: EmbedHook): void;
|
|
81
95
|
/**
|
|
82
96
|
* Enables logging with the specified log level.
|
|
83
97
|
*
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -89,7 +87,10 @@ export declare function onReady(experience: Experience, callback: () => void): U
|
|
|
89
87
|
*/
|
|
90
88
|
export declare const sendExperienceSizeThrottled: (width: number, height: number) => void;
|
|
91
89
|
/**
|
|
92
|
-
*
|
|
90
|
+
* Sends the experience size to the parent application.
|
|
91
|
+
*
|
|
92
|
+
* @param width - The width of the experience.
|
|
93
|
+
* @param height - The height of the experience.
|
|
93
94
|
*/
|
|
94
95
|
export declare function sendExperienceSize(width: number, height: number): void;
|
|
95
96
|
/**
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022-2024 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -20,6 +18,7 @@ export default class ExperienceImpl implements Experience {
|
|
|
20
18
|
private _parameters;
|
|
21
19
|
readonly bridge: Bridge;
|
|
22
20
|
embedUrl: string;
|
|
21
|
+
id: string;
|
|
23
22
|
constructor(sdk: MonterosaSdk, config: ExperienceConfiguration);
|
|
24
23
|
get config(): Readonly<ExperienceConfiguration> & {
|
|
25
24
|
autoresizesHeight: boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -13,6 +11,8 @@
|
|
|
13
11
|
*
|
|
14
12
|
* @packageDocumentation
|
|
15
13
|
*/
|
|
14
|
+
import './custom_element';
|
|
15
|
+
import './autoresize';
|
|
16
16
|
export * from './api';
|
|
17
17
|
export * from './types';
|
|
18
18
|
export * from './utils/bridge';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
4
|
+
*
|
|
5
|
+
* Copyright © 2025 Monterosa Productions Limited. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
|
+
*/
|
|
9
|
+
import type { Integration, Experience } from './types';
|
|
10
|
+
export declare function addIntegration(container: HTMLElement, integration: Integration): void;
|
|
11
|
+
export declare function getIntegration(container: HTMLElement): Integration | void;
|
|
12
|
+
export declare function getIntegrations(): Array<Integration>;
|
|
13
|
+
export declare function deleteIntegration(container: HTMLElement): void;
|
|
14
|
+
export declare function hasIntegration(container: HTMLElement): boolean;
|
|
15
|
+
export declare function hasIntegration(experience: Experience): boolean;
|
package/dist/src/loader.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
package/dist/src/logger.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* interact-kit
|
|
3
|
+
* @monterosa/sdk-interact-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2023 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2023 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2023 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2023 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
package/dist/src/storage.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2023 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2023 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
11
|
-
import { Unsubscribe } from '@monterosa/sdk-util';
|
|
12
9
|
import { Experience } from './types';
|
|
13
10
|
import StorageImpl from './storage_impl';
|
|
14
11
|
/**
|
|
@@ -27,7 +24,11 @@ export declare const storage: StorageImpl;
|
|
|
27
24
|
/**
|
|
28
25
|
* @internal
|
|
29
26
|
*/
|
|
30
|
-
export declare function
|
|
27
|
+
export declare function handleExperienceEmbedded(experience: Experience): void;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function handleExperienceUnmounted(experience: Experience): void;
|
|
31
32
|
/**
|
|
32
33
|
* The `setStoragePersistent` function is a simple function that allows to
|
|
33
34
|
* control the persistence of the SDK storage. If the argument `persistent` is
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2023 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2023 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022-2024 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|
|
11
9
|
import { MonterosaSdk } from '@monterosa/sdk-core';
|
|
12
|
-
import { Unsubscribe } from '@monterosa/sdk-util';
|
|
13
10
|
import { Bridged } from './utils/bridge/public_types';
|
|
14
11
|
/**
|
|
15
12
|
* Reserved query parameter names for controlling the behaviour of Experience.
|
|
@@ -58,6 +55,10 @@ export interface Experience extends Bridged {
|
|
|
58
55
|
* @internal
|
|
59
56
|
*/
|
|
60
57
|
sdk: MonterosaSdk;
|
|
58
|
+
/**
|
|
59
|
+
* Unique identifier of the Experience instance.
|
|
60
|
+
*/
|
|
61
|
+
id: string;
|
|
61
62
|
/**
|
|
62
63
|
* Config
|
|
63
64
|
*/
|
|
@@ -182,12 +183,7 @@ export interface ExperienceConfiguration {
|
|
|
182
183
|
*/
|
|
183
184
|
export interface Integration {
|
|
184
185
|
experience: Experience;
|
|
186
|
+
container: HTMLElement;
|
|
185
187
|
controller: AbortController;
|
|
186
|
-
|
|
187
|
-
storageUnsubscribe?: Unsubscribe;
|
|
188
|
-
hooksUnsubscribe: Unsubscribe[];
|
|
188
|
+
embedded: boolean;
|
|
189
189
|
}
|
|
190
|
-
/**
|
|
191
|
-
* @internal
|
|
192
|
-
*/
|
|
193
|
-
export declare type EmbedHook = (experience: Experience, container: HTMLElement) => Unsubscribe;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
*
|
|
4
|
-
* launcher-kit
|
|
3
|
+
* @monterosa/sdk-launcher-kit
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* Copyright © 2022 Monterosa. All rights reserved.
|
|
5
|
+
* Copyright © 2022 Monterosa Productions Limited. All rights reserved.
|
|
8
6
|
*
|
|
9
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
10
8
|
*/
|