{"version":3,"file":"stytchUI.mjs","sources":["../../../src/b2c/stytchUI.ts"],"sourcesContent":["import type { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { AppContainer, SDKConfig } from '@stytch/web';\n\nimport { createMountFn, createWebComponent } from '../bindings/WebComponents';\n\nconst defaultSdkProps = ['client', 'config', 'presentation', 'callbacks', 'strings'] as const;\n\n/**\n * Renders a log in screen.\n *\n * @attr {boolean} [shadow] - use shadow DOM to contain styles\n *\n * @prop {StytchClient} client - used to make API calls.\n * @prop {StytchLoginConfig} config - object containing the products that should be registered\n * @prop {PresentationConfig} [presentation] - for customizing the UI styling and presentation\n * @prop {Messages} [strings] - custom strings to be used, to customize text or for localization\n *\n * @event StytchEvent - see {@link import('./idpWebComponent').StytchEvent}\n * @event StytchError - see {@link import('./idpWebComponent').StytchError}\n *\n */\nexport const StytchUI = createWebComponent<SDKConfig<StytchProjectConfigurationInput>>(AppContainer, {\n  propNames: defaultSdkProps,\n});\n\n/**\n * Mounts a login screen inside the element provided.\n * If a login screen has already been rendered inside the element,\n * it will be updated to use the new config, style, and callback options passed in.\n * @example\n * mountLogin({\n *   client: stytchClient,\n *   elementId: '#login-container',\n *   config: {...}\n * });\n *\n * @deprecated Prefer using the StytchUI web component instead.\n *\n * @param client - A {@link StytchClient} instance used for making API calls.\n * @param elementId - A string containing the id of the element that should contain the login screen.\n * @param config - A {@link StytchLoginConfig} object containing the products that should be registered\n * @param presentation - Optional {@link PresentationConfig} object for customizing the UI presentation\n * @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.\n * @param strings - Optional custom strings to be used in the prebuilt UI.\n * @throws An error when the element specified by elementId cannot be found.\n */\nexport const mountLogin = createMountFn('stytch-ui', StytchUI);\n"],"names":["defaultSdkProps","StytchUI","createWebComponent","AppContainer","propNames","mountLogin","createMountFn"],"mappings":";;;AAKA,MAAMA,eAAAA,GAAkB;AAAC,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,cAAA;AAAgB,IAAA,WAAA;AAAa,IAAA;AAAU,CAAA;AAEpF;;;;;;;;;;;;;AAaC,IACM,MAAMC,QAAAA,GAAWC,kBAAAA,CAA+DC,YAAAA,EAAc;IACnGC,SAAAA,EAAWJ;AACb,CAAA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBC,IACM,MAAMK,UAAAA,GAAaC,aAAAA,CAAc,aAAaL,QAAAA;;;;"}