@stytch/vanilla-js 6.0.9 → 6.0.11
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/CHANGELOG.md +13 -0
- package/dist/cjs/{StytchSSRProxy-DjO95TII.js → StytchSSRProxy-BG8v1Uf6.js} +19 -23
- package/dist/cjs/StytchSSRProxy-BG8v1Uf6.js.map +1 -0
- package/dist/cjs/b2b/index.cjs +47 -39
- package/dist/cjs/b2b/index.cjs.map +1 -1
- package/dist/cjs/b2b/index.headless.cjs +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.headless.cjs +1 -1
- package/dist/cjs/{shadcn-DnwRqCY0.js → shadcn-Ds1x7jpl.js} +2 -2
- package/dist/cjs/{shadcn-DnwRqCY0.js.map → shadcn-Ds1x7jpl.js.map} +1 -1
- package/dist/cjs-dev/{StytchSSRProxy-t6BtsVJa.js → StytchSSRProxy-CCpBazSd.js} +19 -23
- package/dist/cjs-dev/StytchSSRProxy-CCpBazSd.js.map +1 -0
- package/dist/cjs-dev/b2b/index.cjs +47 -39
- package/dist/cjs-dev/b2b/index.cjs.map +1 -1
- package/dist/cjs-dev/b2b/index.headless.cjs +1 -1
- package/dist/cjs-dev/index.cjs +2 -2
- package/dist/cjs-dev/index.headless.cjs +1 -1
- package/dist/cjs-dev/{shadcn-C7p3HE31.js → shadcn-YlPYvF-0.js} +2 -2
- package/dist/cjs-dev/{shadcn-C7p3HE31.js.map → shadcn-YlPYvF-0.js.map} +1 -1
- package/dist/esm/node_modules/js-cookie/dist/js.cookie.mjs +17 -21
- package/dist/esm/node_modules/js-cookie/dist/js.cookie.mjs.map +1 -1
- package/dist/esm/packages/web/src/NetworkClient.mjs +1 -1
- package/dist/esm/packages/web/src/ui/b2b/screens/EmailForm.mjs +1 -20
- package/dist/esm/packages/web/src/ui/b2b/screens/EmailForm.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2b/screens/PasswordEmailForm.mjs +42 -37
- package/dist/esm/packages/web/src/ui/b2b/screens/PasswordEmailForm.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2b/screens/useParseErrorMessage.mjs +28 -0
- package/dist/esm/packages/web/src/ui/b2b/screens/useParseErrorMessage.mjs.map +1 -0
- package/dist/esm-dev/node_modules/js-cookie/dist/js.cookie.mjs +17 -21
- package/dist/esm-dev/node_modules/js-cookie/dist/js.cookie.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/NetworkClient.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/EmailForm.mjs +1 -20
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/EmailForm.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/PasswordEmailForm.mjs +42 -37
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/PasswordEmailForm.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/useParseErrorMessage.mjs +28 -0
- package/dist/esm-dev/packages/web/src/ui/b2b/screens/useParseErrorMessage.mjs.map +1 -0
- package/dist/iife/b2b/index.headless.js +1 -1
- package/dist/iife/b2b/index.headless.js.map +1 -1
- package/dist/iife/b2b/index.js +3 -3
- package/dist/iife/b2b/index.js.map +1 -1
- package/dist/iife/index.headless.js +1 -1
- package/dist/iife/index.headless.js.map +1 -1
- package/dist/iife/index.js +1 -1
- package/dist/iife/index.js.map +1 -1
- package/dist/types/{DFPProtectedAuthProvider-Cg2QSi2l.d.ts → DFPProtectedAuthProvider-DQV4qHPT.d.ts} +1 -1
- package/dist/types/{GoogleOneTapClient-iv3nb_kU.d.ts → GoogleOneTapClient-BITSM9oM.d.ts} +1 -1
- package/dist/types/{PresentationConfig-CxQiKzO8.d.ts → PresentationConfig-BjjsTM1r.d.ts} +1 -1
- package/dist/types/{StytchB2BClient-C-2u87oo.d.ts → StytchB2BClient-DkrU-AQy.d.ts} +2 -2
- package/dist/types/{StytchClient-CCLs7DV6.d.ts → StytchClient-CUz_XnTa.d.ts} +2 -2
- package/dist/types/adminPortal/index.d.ts +5 -5
- package/dist/types/b2b/index.d.ts +9 -9
- package/dist/types/b2b/index.headless.d.ts +5 -5
- package/dist/types/compat.d.ts +2 -2
- package/dist/types/{idpHelpers-CxSGKrN9.d.ts → idpHelpers-DsFYR_P9.d.ts} +1 -1
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.headless.d.ts +5 -5
- package/dist/types/{themes-MdCoynbd.d.ts → themes-LfxL9FBW.d.ts} +5 -5
- package/package.json +1 -1
- package/dist/cjs/StytchSSRProxy-DjO95TII.js.map +0 -1
- package/dist/cjs-dev/StytchSSRProxy-t6BtsVJa.js.map +0 -1
package/dist/iife/b2b/index.js
CHANGED
|
@@ -24,7 +24,7 @@ ICU features such as interpolation and plurals will not work properly for that m
|
|
|
24
24
|
Please compile your catalog first.
|
|
25
25
|
`)),"string"==typeof d&&nc.test(d))?nd(d):"string"==typeof d?d:(n=d,a=this._locale,o=this._locales,(e={},t)=>{let r=((e,t,r={})=>{let n=t||e,a=e=>"object"==typeof e?e:r[e],o=(e,t)=>{let o=no(n,e,Object.keys(r).length?a("number"):void 0);return t.replace(RegExp(nu,"g"),o)};return{plural:(e,t)=>{let{offset:r=0}=t,a=ni(n,!1,e,t);return o(e-r,a)},selectordinal:(e,t)=>{let{offset:r=0}=t,a=ni(n,!0,e,t);return o(e-r,a)},select:nh,number:(e,t)=>no(n,e,a(t)||{style:t}),date:(e,t)=>na(n,e,a(t)||t),time:(e,t)=>(function(e,t,r){let n;if(r||(r="default"),"string"==typeof r)switch(n={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":n.timeZoneName="short";break;case"short":delete n.second}else n=r;return na(e,t,n)})(n,e,a(t)||t)}})(a,o,t),i=(t,n=!1)=>Array.isArray(t)?t.reduce((t,a)=>{let o;if("#"===a&&n)return t+nu;if("string"==typeof a)return t+a;let[s,l,c]=a,d={};return("plural"===l||"selectordinal"===l||"select"===l?Object.entries(c).forEach(([e,t])=>{d[e]=i(t,"plural"===l||"selectordinal"===l)}):d=c,null==(o=l?(0,r[l])(e[s],d):e[s]))?t:t+o},""):t,s=i(n);return"string"==typeof s&&nc.test(s)?nd(s):"string"==typeof s?s:s?String(s):""})(t,r?.formats)}date(e,t){return na(this._locales||this._locale,e,t)}number(e,t){return no(this._locales||this._locale,e,t)}}function ny(e={}){return new nf(e)}ny();var nv=0;function nb(e,t,r,n,a,o){var i,s,l={};for(s in t)"ref"==s?i=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--nv,__i:-1,__u:0,__source:a,__self:o};if("function"==typeof e&&(i=e.defaultProps))for(s in i)void 0===l[s]&&(l[s]=i[s]);return te.vnode&&te.vnode(c),c}let nw=/<([a-zA-Z0-9]+)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9]+)\/>/,nk={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0};function nS(e){let{render:t,component:r,id:n,message:a,formats:o,lingui:{i18n:i,defaultComponent:s}}=e,{values:l,components:c}=nC(e),d=i&&"function"==typeof i._?i._(n,l,{message:a,formats:o}):n,u=d?function e(t,r={}){let n=t.split(nw);if(1===n.length)return t;let a=((e=0,t="")=>()=>`${t}_${e++}`)(0,"$lingui$"),o=[],i=n.shift();for(let[t,s,l]of(i&&o.push(i),function e(t){if(!t.length)return[];let[r,n,a,o]=t.slice(0,4);return[[r||a,n||"",o]].concat(e(t.slice(4,t.length)))}(n))){let n=void 0!==t?r[t]:void 0;(!n||nk[n.type]&&s)&&(n?console.error(`${n.type} is a void element tag therefore it must have no children`):console.error(`Can't use element at index '${t}' as it is not declared in the original translation`),n=nb(tg,{})),Array.isArray(n)&&(n=nb(tg,{children:n})),o.push(rF(n,{key:a()},s?e(s,r):n.props.children)),l&&o.push(l)}return 1===o.length?o[0]:o}(d,c):null;if(null===t||null===r)return u;let h=s||nE,m={id:n,message:a,translation:u,children:u};if(t&&r)console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");else if(t&&"function"!=typeof t)console.error(`Invalid value supplied to prop \`render\`. It must be a function, provided ${t}`);else if(r&&"function"!=typeof r)return console.error(`Invalid value supplied to prop \`component\`. It must be a React component, provided ${r}`),nb(h,{...m,children:u});return"function"==typeof t?t(m):nb(r||h,{...m,children:u})}let nE=({children:e})=>e,nC=e=>{if(!e.values)return{values:void 0,components:e.components};let t={...e.values},r={...e.components};return Object.entries(e.values).forEach(([e,n])=>{if("string"==typeof n||"number"==typeof n)return;let a=Object.keys(r).length;r[a]=nb(tg,{children:n}),t[e]=`<${a}/>`}),{values:t,components:r}},nP=tI(null),nT=e=>{let t=t2(nP);if(null==t)throw Error(e??"useLingui hook was used without I18nProvider.");return t};function nO(){return nT()}let nA=({i18n:e,defaultComponent:t,children:r})=>{let n=tQ(e.locale),a=t0(()=>({i18n:e,defaultComponent:t,_:e.t.bind(e)}),[e,t]),[o,i]=tG(a());return(tZ(()=>{let t=()=>{n.current=e.locale,i(a())},r=e.on("change",t);return n.current!==e.locale&&t(),r},[e,a]),n.current)?nb(nP.Provider,{value:o,children:r}):(console.log("I18nProvider rendered `null`. A call to `i18n.activate` needs to happen in order for translations to be activated and for the I18nProvider to render.This is not an error but an informational message logged only in development."),null)};function nx(e){let t=nT(`Trans component was rendered without I18nProvider.
|
|
26
26
|
Attempted to render message: ${e.message} id: ${e.id}. Make sure this component is rendered inside a I18nProvider.`);return nb(nS,{...e,lingui:t})}let nD=({children:e,messages:t,overrides:r})=>{let n=t1(()=>({...t,...r}),[t,r]),[a]=tG(()=>{let e=ny({locale:"en",messages:{en:n}});return e.setMessagesCompiler(nt),e});return tZ(()=>{a.load({en:n})},[a,n]),rZ.createElement(nA,{i18n:a},e)},nz=tI(void 0),nM=tI(void 0),nI=({children:e,consentManifestGenerator:t,authTokenParams:r})=>rZ.createElement(nz.Provider,{value:t},rZ.createElement(nM.Provider,{value:r},e));function nR(e){let t=t1(()=>e?matchMedia(e):void 0,[e]),[r,n]=tG(()=>t?.matches??!1);return tZ(()=>{if(!t)return void n(!1);let e=new AbortController;return t.addEventListener("change",e=>n(e.matches),{signal:e.signal}),()=>e.abort()},[t]),r}let nL={"font-family":"system-ui, sans-serif","font-family-mono":"ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace",spacing:"4px","rounded-base":"4px","text-base":"1rem","container-width":"400px","mobile-breakpoint":"768px","transition-duration":"0.15s","destructive-foreground":"#fff"},nB={...nL,"color-scheme":"light",background:"oklch(1 0 0)",foreground:"oklch(0.14 0 0)",primary:"oklch(0.2 0 0)","primary-foreground":"oklch(0.99 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.2 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.52 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.2 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.92 0 0)",ring:"oklch(0.72 0 0)",destructive:"oklch(0.577 0.245 27.325)",warning:"oklch(0.67 0.16 58)",success:"oklch(0.6 0.13 163)"},nN={...nL,"color-scheme":"dark",background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",primary:"oklch(0.922 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)",destructive:"oklch(0.704 0.191 22.216)",warning:"oklch(0.754 0.16 58)",success:"oklch(0.704 0.13 163)"},nU={hideHeaderText:!1};function nF(e,t,{products:r,enableShadowDOM:n},a){let o,{theme:i,options:s}=e??{};if(r.filter(e=>"string"==typeof e).length>0)throw eP(`Please add an import for ${a} and update config.products to
|
|
27
|
-
products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error("'config.products' should not include strings anymore");let l=Array.isArray(i),c=nR(l?"(prefers-color-scheme: dark)":void 0);o=l?c?i[1]:i[0]:i;let d=t1(()=>{let e={};for(let t of r)Object.assign(e,t.icons);return Object.assign(e,s?.icons),e},[r,s]);return{theme:{...nB,...o},options:{enableShadowDOM:n,...nU,...s},displayWatermark:t,iconRegistry:d}}let nq=tI(void 0);function nH(e,t){if(null!=t.buttonId&&!1!==t.buttonId)return"string"==typeof t.buttonId?e+t.buttonId:e}var nK={exports:{}},nj=(en=function(){if(el)return nK.exports;el=1;var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,function(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}(o)))}return n}function r(e,t){return t?e?e+" "+t:e+t:e}return nK.exports?(t.default=t,nK.exports=t):window.classNames=t,nK.exports}())&&en.__esModule&&Object.prototype.hasOwnProperty.call(en,"default")?en.default:en;let n$=[],nV=new Set;function nW(e){n$.push(e),nV.forEach(t=>t(e))}function nG(){var e;let t=document.createElement("style"),r=!0,n=((e=e=>{r||document.contains(t)?(t.textContent+=e,r=!1):n()})(n$.join("\n")),nV.add(e),()=>nV.delete(e));return t}nW(".Typography_module_typography__74817c74{font-family:var(--st-font-family)}.Typography_module_header__74817c74{color:var(--st-foreground);font-family:var(--st-header-font);font-size:var(--st-text-2xl);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-2xl)}.Typography_module_body__74817c74{color:var(--st-foreground);font-size:var(--st-text-base)}.Typography_module_body__74817c74,.Typography_module_helper__74817c74{font-weight:var(--st-font-weight-normal);line-height:var(--st-line-height-base)}.Typography_module_helper__74817c74{color:var(--st-muted-foreground);font-size:var(--st-text-xs)}.Typography_module_start__74817c74{text-align:start}.Typography_module_center__74817c74{text-align:center}.Typography_module_end__74817c74{text-align:end}.Typography_module_foreground__74817c74{color:var(--st-foreground)}.Typography_module_muted__74817c74{color:var(--st-muted-foreground)}.Typography_module_destructive__74817c74{color:var(--st-destructive)}.Typography_module_warning__74817c74{color:var(--st-warning)}.Typography_module_success__74817c74{color:var(--st-success)}.Typography_module_regular__74817c74{font-weight:var(--st-font-weight-normal)}.Typography_module_medium__74817c74{font-weight:var(--st-font-weight-medium)}.Typography_module_semibold__74817c74{font-weight:var(--st-font-weight-semibold)}.Typography_module_bold__74817c74{font-weight:var(--st-font-weight-bold)}.Typography_module_defaultFont__74817c74{font-family:var(--st-font-family)}.Typography_module_monoFont__74817c74{font-family:var(--st-font-family-mono)}");var nY={typography:"Typography_module_typography__74817c74",header:"Typography_module_header__74817c74",body:"Typography_module_body__74817c74",helper:"Typography_module_helper__74817c74",start:"Typography_module_start__74817c74",center:"Typography_module_center__74817c74",end:"Typography_module_end__74817c74",foreground:"Typography_module_foreground__74817c74",muted:"Typography_module_muted__74817c74",destructive:"Typography_module_destructive__74817c74",warning:"Typography_module_warning__74817c74",success:"Typography_module_success__74817c74",regular:"Typography_module_regular__74817c74",medium:"Typography_module_medium__74817c74",semibold:"Typography_module_semibold__74817c74",bold:"Typography_module_bold__74817c74",defaultFont:"Typography_module_defaultFont__74817c74",monoFont:"Typography_module_monoFont__74817c74"};let nZ=rs(({variant:e="body",as:t="div",weight:r,font:n,color:a,align:o,className:i,...s},l)=>rZ.createElement(t,{...s,ref:l,className:nj(i,nY.typography,nY[e],n&&nY[n+"Font"],r&&nY[r],a&&nY[a],o&&nY[o])}));nW(".Badge_module_badge__c44e2b28{background-color:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-base);cursor:default;padding:var(--st-spacing-0_5) var(--st-spacing);width:fit-content}");let nJ=({className:e,children:t})=>rZ.createElement("div",{className:nj("Badge_module_badge__c44e2b28",e)},rZ.createElement(nZ,{variant:"helper"},t));nW(".LastUsed_module_container__4e54ed99{position:relative}.LastUsed_module_badge__4e54ed99{position:absolute;right:var(--st-spacing-3);top:0;translate:0 -60%}[dir=rtl] .LastUsed_module_badge__4e54ed99{left:var(--st-spacing-3);right:auto}.LastUsed_module_badge__4e54ed99:dir(rtl){left:var(--st-spacing-3);right:auto}");let nQ=({children:e})=>{let{i18n:t,_:r}=nO();return rZ.createElement("div",{className:"LastUsed_module_container__4e54ed99"},e,rZ.createElement(nJ,{className:"LastUsed_module_badge__4e54ed99"},t._({id:"provider.lastUsed",message:"Last used"})))},nX=({niceName:e,variableName:t})=>rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because there are no ",e," set for this project so we are unable to verify the"," ",rZ.createElement("code",null,t),"\xa0 provided in the configuration. To set ",e,"for this project please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xa0 For more information on why this validation is necessary please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation.")),n1="origin_not_allowed_for_client",n0="invalid_client",n2="oauth_config_not_found",n3="default_provider_not_allowed",n4=({error:e})=>{switch(e){case n1:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the current host\xa0",rZ.createElement("code",null,window.location.host),"is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xa0 ",rZ.createElement("code",null,"http://localhost"),"and\xa0",rZ.createElement("code",null,"http://localhost:<port_number>"),"\xa0 to the Authorized JavaScript origins box. You can learn more\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));case n0:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xa0 Please check that the client ID saved in"," ",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xa0 matches the client ID in your Google Cloud Console.");case n2:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));case"no_login_redirect_urls_set":return rZ.createElement(nX,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});case"no_signup_redirect_urls_set":return rZ.createElement(nX,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});case n3:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."))}},n5=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,n8=e=>(document.cookie?document.cookie.split("; "):[]).filter(t=>{let[r]=t.split("=");return e===r}).length>1,n6=()=>{},n7="u">typeof window?tJ:tZ,n9=e=>{let t=tQ(e);return n7(()=>{t.current=e},[e]),t0((...e)=>(0,t.current)(...e),[])},ae={primaryInfo:null,isEnrolling:!1,smsOtp:{isSending:!1,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{enrollment:null}},at="Main",ar="Email Confirmation",an="Logged In",aa="Discovery",ao="Error",ai="Password Authenticate",as="Password Reset Form",al="Password Reset Verify Confirmation",ac="Password Forgot Form",ad="Password Set New Confirmation",au="MFA Enrollment Selection",ah="Recovery Code Entry",am="Recovery Code Save",ap="SMS OTP Enrollment",a_="SMS OTP Entry",ag="TOTP Enrollment Manual",af="TOTP Enrollment QR Code",ay="TOTP Entry",av="Email Method Selection",ab="Email OTP Entry",aw="SSO Discovery Email",ak="SSO Discovery Fallback",aS="SSO Discovery Menu",aE="EmailForm",aC="EmailDiscoveryForm",aP="OAuthButtons",aT="SSOButtons",aO="PasswordsEmailForm",aA="PasswordEmailCombined",ax="PasswordEmailCombinedDiscovery",aD="Divider",az="Default",aM="EmailMagicLink",aI="Organization",aR="CannotJoinOrgDueToAuthPolicy",aL="AdBlockerDetected",aB="OrganizationDiscoveryClaimedDomain",aN=e=>!!e,aU=({allMethods:e,orgSupportedMethods:t,uiIncludedMethods:r})=>new Set(t?.length?t:r?.length?r:e);function aF(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[...t.screenHistory,t.screen]}}function aq(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[]}}function aH(e){switch(e){case"totp":return d.totp;case"sms_otp":return d.smsOtp;default:return}}let aK=()=>new Date(Date.now()+12e4),aj=[d.totp,d.smsOtp],a$=(e,t)=>{switch(t.type){case"transition":return"push"===t.history?aF(t.screen,e):aq(t.screen,e);case"navigate_back":{let t=e.screenHistory.at(-1);if(!t)return e;let r=e.screenHistory.slice(0,-1);return{...e,screen:t,screenHistory:r}}case"set_error_message_and_transition":return{...e,screen:ao,error:{type:t.errorType,canGoBack:t.canGoBack}};case"set_user_supplied_email":return{...e,formState:{...e.formState,emailState:{userSuppliedEmail:t.email},passwordState:{email:t.email}}};case"set_organization":return{...e,flowState:{type:s.Organization,organization:t.organization}};case"set_discovery_state":{let r=t.discoveredOrganizations;return{...e,formState:{...e.formState,discoveryState:{email:t.email,discoveredOrganizations:r}},screen:aa}}case"select_discovered_organization":{let{membership:r,organization:n,primary_required:a}=t.discoveredOrganization,o=r.member?.email_address??e.formState.discoveryState.email,i=a?a.allowed_auth_methods:void 0,l={...e,flowState:{type:s.Organization,organization:n},formState:{...e.formState,passwordState:{email:o}},primary:{primaryAuthMethods:i,email:o,emailVerified:r.member?.email_address_verified},screen:at};if(i?.length===0)return{...l,screen:ao,error:{type:aR,canGoBack:!0}};return l}case"set_password_state":return{...e,formState:{...e.formState,passwordState:{email:t.email}}};case"send_email_otp":return aF(ab,{...e,formState:{...e.formState,otpState:{codeExpiration:t.codeExpiration}}});case"set_sso_discovery_state":if(!t.connections.length)return aF(ak,e);return aF(aS,{...e,formState:{...e.formState,ssoDiscoveryState:{connections:t.connections}}});case"use_password_auth":return aF(ai,{...e,formState:{...e.formState,passwordState:{email:t.email}}});default:return((e,t)=>{switch(t.type){case"primary_authenticate_success":{let r=!!t.response.member_session,n="multi_tenant_magic_links"===t.resetTokenType?as:an;if(r)return aq(n,{...e,mfa:ae,primary:{}});if(t.response.primary_required){let r=t.response.primary_required.allowed_auth_methods,{email_address:n,email_address_verified:a}=t.response.member,o={...e,flowState:{type:s.Organization,organization:t.response.organization},formState:{...e.formState,passwordState:{email:n}},primary:{primaryAuthMethods:r,email:n,emailVerified:a}};if(r?.length===0)return aq(ao,{...o,error:{type:aR,canGoBack:!1}});return aq(at,o)}let a=t.response.member.mfa_phone_number_verified,o={enrolledMfaMethods:[!!t.response.member.totp_registration_id&&d.totp,a&&d.smsOtp].filter(aN),memberId:t.response.member_id,memberPhoneNumber:t.response.member.mfa_phone_number,organizationId:t.response.organization.organization_id,organizationMfaOptionsSupported:"RESTRICTED"===t.response.organization.mfa_methods?t.response.organization.allowed_mfa_methods?.map(aH).filter(aN)??[]:[],postAuthScreen:n},i=e=>0===o.organizationMfaOptionsSupported.length||o.organizationMfaOptionsSupported.includes(e),l=t.response.mfa_required?.secondary_auth_initiated==="sms_otp",c=l?d.smsOtp:(()=>{let e=aH(t.response.member.default_mfa_method);if(e&&i(e)&&o.enrolledMfaMethods.includes(e))return e})()??o.enrolledMfaMethods.find(i);if(c){let t={...ae,primaryInfo:o};switch(c){case d.totp:return aq(ay,{...e,mfa:t,primary:{}});case d.smsOtp:{let r={...e,mfa:{...t,smsOtp:{...t.smsOtp,codeExpiration:l?aK():null}},primary:{}};if(a)return aq(a_,r);return{...r,screen:a_,screenHistory:[ap]}}}}return aq(function(e){if(1===e.size){if(e.has(d.totp))return af;if(e.has(d.smsOtp))return ap}return au}(aU({allMethods:aj,orgSupportedMethods:o.organizationMfaOptionsSupported,uiIncludedMethods:t.includedMfaMethods})),{...e,mfa:{...ae,primaryInfo:o,isEnrolling:!0},primary:{}})}case"sms_otp/send":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!0,sendError:null}}};case"sms_otp/send_success":return aF(a_,{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:null,codeExpiration:aK(),formattedDestination:t.formattedPhoneNumber??e.mfa.smsOtp.formattedDestination,enrolledNumber:t.phoneNumber?{phoneNumber:t.phoneNumber,countryCode:t.countryCode}:null}}});case"sms_otp/send_error":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:t.error,codeExpiration:e.mfa.smsOtp.codeExpiration??new Date(Date.now()-1e3)}}};case"sms_otp/format_destination":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,formattedDestination:t.formattedPhoneNumber}}};case"sms_otp/authenticate_success":case"recovery_code/authenticate_success":case"recovery_code/save_acknowledge":return aq(e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:ae});case"totp/authenticate_success":return aq(e.mfa.isEnrolling?am:e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:e.mfa.isEnrolling?e.mfa:ae});case"totp/create_success":if(!e.mfa.isEnrolling||e.mfa.primaryInfo?.memberId!==t.memberId||e.mfa.primaryInfo?.organizationId!==t.organizationId)return e;return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{secret:t.response.secret,qrCode:t.response.qr_code,recoveryCodes:t.response.recovery_codes,method:e.mfa.totp.enrollment?.method??"qr"}}}};case"totp/show_code":{if(!e.mfa.isEnrolling||!e.mfa.totp.enrollment)return e;let r=t.method??e.mfa.totp.enrollment.method??"qr";return aF("manual"===r?ag:af,{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{...e.mfa.totp.enrollment,method:r}}}})}default:return e}})(e,t)}},aV={screen:at,screenHistory:[],formState:{emailState:{userSuppliedEmail:""},otpState:{codeExpiration:null},discoveryState:{email:"",discoveredOrganizations:[]},passwordState:{email:""},ssoDiscoveryState:{connections:[]}},flowState:{type:s.Organization,organization:null},mfa:ae,primary:{},error:{type:az,canGoBack:!1}},aW=rZ.createContext({client:{},config:{},state:[aV,()=>null]}),aG=({children:e,client:t,config:r,callbacks:n,initialState:a})=>{let o=rZ.useReducer(a$,a??aV);return rZ.createElement(aW.Provider,{value:{client:t,state:o,config:r,callbacks:n}},e)},aY=()=>n9(t2(aW).callbacks?.onError??n6),aZ=()=>n9(t2(aW).callbacks?.onEvent??n6),aJ=e=>{let t,r,n=!1,a=[],o={};return"string"==typeof e?r=e:(r=e.type,e.type===c.Google&&e.one_tap&&(n=e.one_tap,t=e.cancel_on_tap_outside),a=e.customScopes||[],o=e.providerParams||{}),{type:r,one_tap:n,customScopes:a,providerParams:o,cancel_on_tap_outside:t}};var aQ={exports:{}},aX={},a1=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(rJ),a0=(ed||(ed=1,ec||(ec=1,!function(){function e(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=a1.useState,n=a1.useEffect,a=a1.useLayoutEffect,o=a1.useDebugValue,i=!1,s=!1,l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(l,c){i||void 0===a1.startTransition||(i=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=c();if(!s){var u=c();t(d,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var h=(u=r({inst:{value:d,getSnapshot:c}}))[0].inst,m=u[1];return a(function(){h.value=d,h.getSnapshot=c,e(h)&&m({inst:h})},[l,d,c]),n(function(){return e(h)&&m({inst:h}),l(function(){e(h)&&m({inst:h})})},[l]),o(d),d};aX.useSyncExternalStore=void 0!==a1.useSyncExternalStore?a1.useSyncExternalStore:l,"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),aQ.exports=aX),aQ.exports);let a2=new WeakMap,a3={},a4={},a5=()=>{},a8=a5(),a6=Object,a7=e=>e===a8,a9=(e,t)=>({...e,...t}),oe="undefined",ot=typeof window!=oe,or=typeof document!=oe,on=(e,t)=>{let r=a2.get(e);return[()=>e.get(t)||a3,n=>{if(!a7(t)){let a=e.get(t);t in a4||(a4[t]=a),r[5](t,a9(a,n),a||a3)}},r[6],()=>!a7(t)&&t in a4?a4[t]:e.get(t)||a3]},oa=new WeakMap,oo=0,oi=e=>{let t,r,n=typeof e,a=e&&e.constructor,o=a==Date;if(a6(e)!==e||o||a==RegExp)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=oa.get(e))return t;if(t=++oo+"~",oa.set(e,t),a==Array){for(r=0,t="@";r<e.length;r++)t+=oi(e[r])+",";oa.set(e,t)}if(a==a6){t="#";let n=a6.keys(e).sort();for(;!a7(r=n.pop());)a7(e[r])||(t+=r+":"+oi(e[r])+",");oa.set(e,t)}}return t},os=!0,[ol,oc]=ot&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[a5,a5],od={initFocus:e=>(or&&document.addEventListener("visibilitychange",e),ol("focus",e),()=>{or&&document.removeEventListener("visibilitychange",e),oc("focus",e)}),initReconnect:e=>{let t=()=>{os=!0,e()},r=()=>{os=!1};return ol("online",t),ol("offline",r),()=>{oc("online",t),oc("offline",r)}}},ou=!rZ.useId,oh=!ot||"Deno"in window,om=oh?tZ:tJ,op="u">typeof navigator&&navigator.connection,o_=!oh&&op&&(["slow-2g","2g"].includes(op.effectiveType)||op.saveData),og=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?oi(e):"",t]},of=0,oy=()=>++of;async function ov(...e){let[t,r,n,a]=e,o=a9({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),i=o.populateCache,s=o.rollbackOnError,l=o.optimisticData,c=!1!==o.revalidate,d=o.throwOnError;if("function"==typeof r){let e=[],n=t.keys();for(let a=n.next();!a.done;a=n.next()){let n=a.value;!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n)}return Promise.all(e.map(u))}return u(r);async function u(r){let a,[o]=og(r);if(!o)return;let[u,h]=on(t,o),[m,p,_]=a2.get(t),g=m[o],f=()=>c&&(delete _[o],g&&g[0])?g[0](2).then(()=>u().data):u().data;if(e.length<3)return f();let y=n,v=oy();p[o]=[v,0];let b=!a7(l),w=u(),k=w.data,S=w._c,E=a7(S)?k:S;if(b&&h({data:l="function"==typeof l?l(E):l,_c:E}),"function"==typeof y)try{y=y(E)}catch(e){a=e}if(y&&"function"==typeof y.then){let e;if(y=await y.catch(e=>{a=e}),v!==p[o][0]){if(a)throw a;return y}a&&b&&(e=a,"function"==typeof s?s(e):!1!==s)&&(i=!0,h({data:y=E,_c:a8}))}i&&!a&&("function"==typeof i&&(y=i(y,E)),h({data:y,_c:a8})),p[o][1]=oy();let C=await f();if(h({_c:a8}),a){if(d)throw a;return}return i?C:y}}let ob=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},[ow,ok]=((e,t)=>{if(!a2.has(e)){let r=a9(od,t),n={},a=ov.bind(a8,e),o=a5,i={},s=(e,t)=>{let r=i[e]||[];return i[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let a=i[t];if(a)for(let e of a)e(r,n)},c=()=>{if(!a2.has(e)&&(a2.set(e,[n,{},{},{},a,l,s]),!oh)){let t=r.initFocus(setTimeout.bind(a8,ob.bind(a8,n,0))),a=r.initReconnect(setTimeout.bind(a8,ob.bind(a8,n,1)));o=()=>{t&&t(),a&&a(),a2.delete(e)}}};return c(),[e,a,c,o]}return[e,a2.get(e)[4]]})(new Map),oS=a9({onLoadingSlow:a5,onSuccess:a5,onError:a5,onErrorRetry:(e,t,r,n,a)=>{let o=r.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(a7(o)||!(i>o))&&setTimeout(n,s,a)},onDiscarded:a5,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:o_?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:o_?5e3:3e3,compare:(e,t)=>oi(e)==oi(t),isPaused:()=>!1,cache:ow,mutate:ok,fallback:{}},{isOnline:()=>os,isVisible:()=>{let e=or&&document.visibilityState;return a7(e)||"hidden"!==e}}),oE=tI({}),oC=ot&&window.__SWR_DEVTOOLS_USE__,oP=oC?window.__SWR_DEVTOOLS_USE__:[],oT=e=>"function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],oO=oP.concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let n=og(t)[0],[,,,a]=a2.get(ow),o=a[n];return o?(delete a[n],o):r(...e)});return e(t,a,n)});oC&&(window.__SWR_DEVTOOLS_REACT__=rZ);let oA={dedupe:!0};var ox=(r=(e,t,r)=>{let{cache:n,compare:a,suspense:o,fallbackData:i,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:h}=r,[m,p,_]=a2.get(n),[g,f]=og(e),y=tQ(!1),v=tQ(!1),b=tQ(g),w=tQ(t),k=tQ(r),S=()=>k.current.isVisible()&&k.current.isOnline(),[E,C,P,T]=on(n,g),O=tQ({}).current,A=a7(i)?r.fallback[g]:i,x=(e,t)=>{let r=!0;for(let n in O)"data"===n?!a(t[n],e[n])&&(a7(e[n])&&a(t[n],U)||(r=!1)):t[n]!==e[n]&&(r=!1);return r},D=t1(()=>{let e=!!g&&!!t&&(a7(s)?!k.current.isPaused()&&!o&&(!!a7(l)||l):s),r=t=>{let r=a9(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=E(),a=T(),i=r(n),c=n===a?i:r(a),d=i;return[()=>{let e=r(E());return x(e,d)?d:d=e},()=>c]},[n,g]),z=a0.useSyncExternalStore(t0(e=>P(g,(t,r)=>{x(r,t)||e()}),[n,g]),D[0],D[1]),M=!y.current,I=m[g]&&m[g].length>0,R=z.data,L=a7(R)?A:R,B=z.error,N=tQ(L),U=h?a7(R)?N.current:R:L,F=(!I||!!a7(B))&&(M&&!a7(s)?s:!k.current.isPaused()&&(o?!a7(L)&&l:a7(L)||l)),q=!!(g&&t&&M&&F),H=a7(z.isValidating)?q:z.isValidating,K=a7(z.isLoading)?q:z.isLoading,j=t0(async e=>{let t,n,o=w.current;if(!g||!o||v.current||k.current.isPaused())return!1;let i=!0,s=e||{},l=!_[g]||!s.dedupe,c=()=>ou?!v.current&&g===b.current&&y.current:g===b.current,d={isValidating:!1,isLoading:!1},u=()=>{C(d)},h=()=>{let e=_[g];e&&e[1]===n&&delete _[g]},P={isValidating:!0};a7(E().data)&&(P.isLoading=!0);try{if(l&&(C(P),r.loadingTimeout&&a7(E().data)&&setTimeout(()=>{i&&c()&&k.current.onLoadingSlow(g,r)},r.loadingTimeout),_[g]=[o(f),oy()]),[t,n]=_[g],t=await t,l&&setTimeout(h,r.dedupingInterval),!_[g]||_[g][1]!==n)return l&&c()&&k.current.onDiscarded(g),!1;d.error=a8;let e=p[g];if(!a7(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return u(),l&&c()&&k.current.onDiscarded(g),!1;let s=E().data;d.data=a(s,t)?s:t,l&&c()&&k.current.onSuccess(t,g,r)}catch(r){h();let e=k.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&c())&&(e.onError(r,g,e),(!0===t||"function"==typeof t&&t(r))&&S()&&e.onErrorRetry(r,g,e,e=>{let t=m[g];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))}return i=!1,u(),!0},[g,n]),$=t0((...e)=>ov(n,b.current,...e),[]);if(om(()=>{w.current=t,k.current=r,a7(R)||(N.current=R)}),om(()=>{var e;let t;if(!g)return;let r=j.bind(a8,oA),n=0,a=(e=(e,t={})=>{if(0==e){let e=Date.now();k.current.revalidateOnFocus&&e>n&&S()&&(n=e+k.current.focusThrottleInterval,r())}else if(1==e)k.current.revalidateOnReconnect&&S()&&r();else if(2==e)return j();else if(3==e)return j(t)},(t=m[g]||(m[g]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(v.current=!1,b.current=g,y.current=!0,C({_k:f}),F)if(a7(L)||oh)r();else ot&&typeof window.requestAnimationFrame!=oe?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{v.current=!0,a()}},[g]),om(()=>{let e;function t(){let t="function"==typeof c?c(L):c;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!E().error&&(d||k.current.isVisible())&&(u||k.current.isOnline())?j(oA).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[c,d,u,g]),t3(U),o&&a7(L)&&g){if(!ou&&oh)throw Error("Fallback data is required when using suspense in SSR.");throw w.current=t,k.current=r,v.current=!1,a7(B)?j(oA):B}return{mutate:$,get data(){return O.data=!0,U},get error(){return O.error=!0,B},get isValidating(){return O.isValidating=!0,H},get isLoading(){return O.isLoading=!0,K}}},function(...e){let t=a9(oS,t2(oE)),[n,a,o]=oT(e),i=((e,t)=>{let r=a9(e,t);if(t){let{use:n,fallback:a}=e,{use:o,fallback:i}=t;n&&o&&(r.use=n.concat(o)),a&&i&&(r.fallback=a9(a,i))}return r})(t,o),s=r,{use:l}=i,c=(l||[]).concat(oO);for(let e=c.length;e--;)s=c[e](s);return s(n,a||i.fetcher||null,i)}),oD=(n=()=>(e,t,r={})=>{var n;let a,o,i,s,l,{mutate:c}=a9(oS,t2(oE)),d=tQ(e),u=tQ(t),h=tQ(r),m=tQ(0),[p,_,g]=(n={data:a8,error:a8,isMutating:!1},a=tG({})[1],o=tQ(!1),i=tQ(n),s=tQ({data:!1,error:!1,isValidating:!1}),l=t0(e=>{let t=!1,r=i.current;for(let n in e)r[n]!==e[n]&&(r[n]=e[n],s.current[n]&&(t=!0));t&&!o.current&&(ou?a({}):rZ.startTransition(()=>a({})))},[]),om(()=>(o.current=!1,()=>{o.current=!0})),[i,s.current,l]),f=p.current,y=t0(async(e,t)=>{let[r,n]=og(d.current);if(!u.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!r)throw Error("Can’t trigger the mutation: missing key.");let a=a9(a9({populateCache:!1,throwOnError:!0},h.current),t),o=oy();m.current=o,g({isMutating:!0});try{let t=await c(r,u.current(n,{arg:e}),a9(a,{throwOnError:!0}));return m.current<=o&&(g({data:t,isMutating:!1,error:void 0}),null==a.onSuccess||a.onSuccess(t,r,a)),t}catch(e){if(m.current<=o&&(g({error:e,isMutating:!1}),null==a.onError||a.onError(e,r,a),a.throwOnError))throw e}},[]),v=t0(()=>{m.current=oy(),g({data:a8,error:a8,isMutating:!1})},[]);return om(()=>{d.current=e,u.current=t,h.current=r}),{trigger:y,reset:v,get data(){return _.data=!0,f.data},get error(){return _.error=!0,f.error},get isMutating(){return _.isMutating=!0,f.isMutating}}},(...e)=>{let[t,r,a]=oT(e),o=(a.use||[]).concat(n);return ox(t,r,{...a,use:o})});let oz={"stytch.magicLinks.authenticate":eu.B2BMagicLinkAuthenticate,"stytch.sso.authenticate":eu.B2BSSOAuthenticate,"stytch.sso.discoverConnections":eu.B2BSSODiscoverConnections,"stytch.magicLinks.discovery.authenticate":eu.B2BMagicLinkDiscoveryAuthenticate,"stytch.discovery.organizations.create":eu.B2BDiscoveryOrganizationsCreate,"stytch.discovery.intermediateSessions.exchange":eu.B2BDiscoveryIntermediateSessionExchange,"stytch.magicLinks.email.loginOrSignup":eu.B2BMagicLinkEmailLoginOrSignup,"stytch.magicLinks.email.discovery.send":eu.B2BMagicLinkEmailDiscoverySend,"stytch.oauth.authenticate":eu.B2BOAuthAuthenticate,"stytch.oauth.discovery.authenticate":eu.B2BOAuthDiscoveryAuthenticate,"stytch.otps.sms.send":eu.B2BSMSOTPSend,"stytch.otps.sms.authenticate":eu.B2BSMSOTPAuthenticate,"stytch.totp.create":eu.B2BTOTPCreate,"stytch.totp.authenticate":eu.B2BTOTPAuthenticate,"stytch.recoveryCodes.recover":eu.B2BRecoveryCodesRecover,"stytch.impersonation.authenticate":eu.B2BImpersonationAuthenticate,"stytch.otps.email.authenticate":eu.B2BOTPsEmailAuthenticate,"stytch.otps.email.discovery.authenticate":eu.B2BOTPsEmailDiscoveryAuthenticate,"stytch.otps.email.discovery.send":eu.B2BOTPsEmailDiscoverySend,"stytch.otps.email.loginOrSignup":eu.B2BOTPsEmailLoginOrSignup,"stytch.organization.getBySlug":eu.B2BOrganizationsGetBySlug},oM=(e,t,r={})=>{let n=aZ(),a=aY(),o=oD(e,t,{throwOnError:!1,...r,onSuccess:(e,t,a)=>{let o=oz[t];o&&n({type:o,data:e}),r.onSuccess?.(e,t,a)},onError:(e,t,n)=>{a(e),r.onError?.(e,t,n)}});return o.isMutating?{...o,error:void 0}:o},oI=()=>{let e=t2(aW).client,[t,r]=tG(r1(e).bootstrap.getSync());return tZ(()=>{r1(e).bootstrap.getAsync().then(e=>{r(e)})},[e]),t},oR=(e,t,r)=>{t({type:"primary_authenticate_success",response:e,includedMfaMethods:r.mfaProductInclude})},oL=(e,t)=>{t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})};function oB(e,t){return e.some(e=>e.id===t)}function oN({products:e,organizationProducts:t},r){return t1(()=>{let n={};for(let a of[...e,...t])a[r]&&Object.assign(n,a[r]);return n},[e,t,r])}let oU=()=>{let e=t2(aW).config;return t1(()=>{let t=e.oauthOptions?aJ(e.oauthOptions?.providers[0]):void 0,r=t?.type===c.Google&&t?.one_tap===!0;return 1===e.products.length&&oB(e.products,"oauth")&&e.oauthOptions?.providers.length===1&&r},[e])},oF=(e,t)=>`stytch_sdk_state_${e}${t?`::${t}`:""}`;function oq(e){return null==e?{getItem:()=>null,removeItem(){},setItem(){}}:{getItem(t,r){let n=oF(t,r);try{return e.getItem(n)}catch{return null}},setItem(t,r,n){let a=oF(t,r);try{n&&e.setItem(a,n)}catch{}},removeItem(t,r){let n=oF(t,r);try{e.removeItem(n)}catch{}}}}let oH=oq(globalThis.localStorage),oK=oq(globalThis.sessionStorage);function oj(e,t){return{getItem:r=>e.getItem(t,r),setItem(r,n){e.setItem(t,r,n)},removeItem(r){e.removeItem(t,r)}}}function o$(){let{publicToken:e}=r1(t2(aW).client);return[t1(()=>oH.getItem(e,"b2b_last_used_method"),[e]),t=>{oH.setItem(e,"b2b_last_used_method",t)}]}nW(".Button_module_button__fba1165e{align-items:center;border:1px solid;border-radius:var(--st-button-radius);box-shadow:var(--st-shadow-button);display:flex;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);gap:var(--st-spacing-2);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);transition:background-color var(--st-transition-duration) ease-in-out,border-color var(--st-transition-duration) ease-in-out}.-st-mobile .Button_module_button__fba1165e{padding:var(--st-spacing-3)}.Button_module_button__fba1165e:focus-visible{box-shadow:var(--st-shadow-button),var(--st-focus-ring-shadow)}.Button_module_button__fba1165e:not(:disabled){cursor:pointer}.Button_module_button__fba1165e:disabled{opacity:.5}.Button_module_block__fba1165e{justify-content:center;width:100%}.Button_module_primary__fba1165e{background-color:var(--st-primary);border-color:var(--st-primary);color:var(--st-primary-foreground)}.Button_module_primary__fba1165e:not(:disabled):hover{background-color:var(--st-primary-button-hover);border-color:var(--st-primary-button-hover)}.Button_module_secondary__fba1165e{background-color:var(--st-secondary);border-color:var(--st-secondary);color:var(--st-secondary-foreground)}.Button_module_secondary__fba1165e:not(:disabled):hover{background-color:var(--st-secondary-button-hover);border-color:var(--st-secondary-button-hover)}.Button_module_outline__fba1165e{background-color:var(--st-background);border:1px solid var(--st-border);color:var(--st-foreground)}.Button_module_outline__fba1165e:not(:disabled):hover{background-color:var(--st-accent);color:var(--st-accent-foreground)}.Button_module_outline__fba1165e:focus-visible{border-color:var(--st-ring)}.Button_module_ghost__fba1165e{background-color:var(--st-background);border:1px solid var(--st-background);box-shadow:none;color:var(--st-foreground)}.Button_module_ghost__fba1165e:not(:disabled):hover{background-color:var(--st-accent);border-color:var(--st-background);color:var(--st-accent-foreground)}.Button_module_ghost__fba1165e:focus-visible{box-shadow:var(--st-focus-ring-shadow)}.Button_module_destructive__fba1165e{background-color:var(--st-destructive);border-color:var(--st-destructive);color:var(--st-destructive-foreground)}.Button_module_destructive__fba1165e:not(:disabled):hover{background-color:var(--st-destructive-button-hover);border-color:var(--st-destructive-button-hover)}");var oV={button:"Button_module_button__fba1165e inputBase_module_focusRing__06c14ae4",block:"Button_module_block__fba1165e",primary:"Button_module_primary__fba1165e",secondary:"Button_module_secondary__fba1165e",outline:"Button_module_outline__fba1165e",ghost:"Button_module_ghost__fba1165e",destructive:"Button_module_destructive__fba1165e"};nW("@keyframes CircularProgress_module_circularRotate__c4a435cb{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes CircularProgress_module_circularDash__c4a435cb{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:1px,200px;stroke-dashoffset:-126px}}.CircularProgress_module_root__c4a435cb{animation:CircularProgress_module_circularRotate__c4a435cb 1.4s linear infinite}.CircularProgress_module_svg__c4a435cb{display:block}.CircularProgress_module_animatedCircle__c4a435cb{animation:CircularProgress_module_circularDash__c4a435cb 1.4s ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px,200px;stroke-dashoffset:0}");let oW=({size:e,label:t,thickness:r=3.6})=>{let{i18n:n,_:a}=nO();return rZ.createElement("div",{className:"CircularProgress_module_root__c4a435cb",style:{width:e,height:e}},rZ.createElement("svg",{className:"CircularProgress_module_svg__c4a435cb",viewBox:"22 22 44 44","aria-label":t??n._({id:"loading.label",message:"Loading"})},rZ.createElement("circle",{className:"CircularProgress_module_animatedCircle__c4a435cb",cx:44,cy:44,r:(44-r)/2,fill:"none",strokeWidth:r})))};function oG({variant:e,block:t=!0}){return nj(oV.button,oV[e],{[oV.block]:t})}let oY=e=>{let{as:t,children:r,icon:n,onClick:a,loading:o,disabled:i=o,block:s,variant:l,...c}=e,d=rZ.createElement(rZ.Fragment,null,n,rZ.createElement("span",null,r));return o&&(d=rZ.createElement(oW,{size:20})),rZ.createElement(t,{className:oG(e),onClick:a,disabled:i,...c},d)},oZ=e=>oY({type:"button",as:"button",...e}),oJ=e=>oY({...e,onKeyDown:t=>{e.onKeyDown?.(t),t.defaultPrevented||" "===t.key&&t.currentTarget.click()},as:"a"}),oQ={[c.Google]:{messageDescriptor:{id:"oauth.continueWithGoogle",message:"Continue with Google"}},[c.Microsoft]:{messageDescriptor:{id:"oauth.continueWithMicrosoft",message:"Continue with Microsoft"}},[c.HubSpot]:{messageDescriptor:{id:"oauth.continueWithHubSpot",message:"Continue with HubSpot"}},[c.Slack]:{messageDescriptor:{id:"oauth.continueWithSlack",message:"Continue with Slack"}},[c.GitHub]:{messageDescriptor:{id:"oauth.continueWithGitHub",message:"Continue with GitHub"}}},oX=({providerType:e,loginRedirectUrl:t,signupRedirectUrl:r,discoveryRedirectUrl:n,customScopes:a,providerParams:o,onSuccess:i})=>{let{i18n:s,_:l}=nO(),c=t2(aW).client,[d]=t2(aW).state,u=t2(nq),h=u.iconRegistry,m=nH(`oauth-${e}`,u.options),p=oQ[e],_=e,g=null;if(p){let{messageDescriptor:t}=p,r=h[e];_=s._(t),g=rZ.createElement(r,null)}let f=async()=>{let s=c.oauth[e];d.flowState.organization?await s.start({login_redirect_url:t,signup_redirect_url:r,custom_scopes:a,organization_id:d.flowState.organization.organization_id,provider_params:o}):await s.discovery.start({discovery_redirect_url:n,custom_scopes:a,provider_params:o}),i?.()};return rZ.createElement(oZ,{onClick:f,variant:"outline",icon:g,id:m},_)},o1=({customScopes:e,providerParams:t,cancelOnTapOutside:r})=>{let n,a=t2(aW).client,o=t2(aW).config,i=oU(),[s,l]=tG(),d=(n=tQ(!1),tZ(()=>(n.current=!0,()=>{n.current=!1}),[]),n),[u,h]=t2(aW).state,[m,p]=o$(),_=t0(async()=>{let e,{oneTap:t}=r1(a),n=await t.createOneTapClient();if(!n.success)return void("oauth_config_not_found"===n.reason?l(n2):"default_provider_not_allowed"===n.reason?l(n3):eP("Unable to load One Tap settings for project",n));let{client:i}=n;if(!d.current)return;e=u.flowState.organization?t.createOnSuccessHandler({organizationId:u.flowState.organization.organization_id,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})}):t.createOnDiscoverySuccessHandler({discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})});let s=await i.render({callback:e,style:{position:er.floating},cancelOnTapOutside:r});return d.current?(s.success||("unregistered_origin"===s.reason&&l(n1),"invalid_client"===s.reason&&l(n0),eP("Unable to render One Tap prompt",s)),i):void i.cancel()},[a,d,u.flowState.organization,o.oauthOptions?.signupRedirectURL,o.oauthOptions?.loginRedirectURL,o.oauthOptions?.discoveryRedirectURL,h,r]);if(tZ(()=>{let e;return _().then(t=>e=t).catch(e=>{eP("Unable to render One Tap prompt",e)}),()=>e?.cancel()},[_]),i)return null;let g=rZ.createElement(oX,{providerType:c.Google,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,customScopes:e,providerParams:t,onSuccess:()=>p(c.Google)}),f=m===c.Google?rZ.createElement(nQ,null,g):g;return s?rZ.createElement(rZ.Fragment,null,rZ.createElement(n4,{error:s}),f):f};nW(".logo_module_darkInvert__4ffe6ba9{filter:invert(var(--st-dark-mode,0))}");var o0="logo_module_darkInvert__4ffe6ba9";let o2=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#4285F4",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#34A853",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#FBBC05",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#EA4335",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),o3=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#F35325",d:"M1 1h8.57v8.57H1z"}),tm("path",{fill:"#81BC06",d:"M10.43 1H19v8.57h-8.57z"}),tm("path",{fill:"#05A6F0",d:"M1 10.43h8.57V19H1z"}),tm("path",{fill:"#FFBA08",d:"M10.43 10.43H19V19h-8.57z"})),o4={gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#C5221F",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09"}),tm("path",{fill:"#FBBC04",d:"m14.9 4.48-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#4285F4",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22"}),tm("path",{fill:"#34A853",d:"M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8z"}),tm("path",{fill:"#EA4335",d:"M10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{clipPath:"url(#a)"},tm("path",{fill:"#158FDA",d:"M6.58 17.2h10.25c1.2 0 2.17-.97 2.17-2.17V7.7c0-.64-.32-1.22-.87-1.54L12.77 3.1c-.72-.4-1.6-.4-2.3 0L4.39 6.6V15c0 1.21.98 2.2 2.2 2.2"}),tm("path",{fill:"url(#b)",d:"M8.61 15.82c.06-.66.48-1.24 1.09-1.5 0 0 5.55-3.11 8.3-4.73.85-.5 1-1.5 1-1.5V15a2.2 2.2 0 0 1-2.2 2.2h-6.65c-.8 0-1.46-.6-1.54-1.4"}),tm("path",{fill:"#01459B",d:"m17.83 5.96-9.55 5.27 1.9 1.16c.71.42 1.74.66 2.46.25l5.08-2.85A2.3 2.3 0 0 0 19 7.69c0-1.1-.76-1.47-1.17-1.73"}),tm("path",{fill:"#26AEE9",d:"M11.67 2.81q-.63 0-1.21.32L2.4 7.68l3.06 1.85 9.37-5.28-1.95-1.11q-.57-.33-1.2-.33"}),tm("path",{fill:"#0078D3",d:"M14.83 4.25 5.46 9.53l3.06 1.86 9.56-5.27-.25-.16z"}),tm("path",{fill:"url(#c)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"}),tm("g",{filter:"url(#d)"},tm("path",{fill:"url(#e)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"})),tm("path",{fill:"#fff",d:"M3.46 8.58q.28-.6.84-.94.64-.36 1.36-.36.69-.02 1.27.3.56.3.85.87.32.6.32 1.3.02.7-.28 1.36a2.2 2.2 0 0 1-1.1 1.06q-.52.21-1.05.21-.7.03-1.3-.3-.57-.3-.86-.87-.32-.6-.32-1.28-.02-.7.27-1.35m.95 2.15q.16.37.5.6t.75.21q.45 0 .8-.24.33-.24.47-.62.15-.41.13-.85 0-.44-.15-.85a1.4 1.4 0 0 0-.47-.63 1.3 1.3 0 0 0-.8-.23 1.3 1.3 0 0 0-1.25.86c-.22.57-.2 1.2.02 1.75"})),tm("defs",null,tm("linearGradient",{id:"b",x1:12.02,x2:19,y1:15.58,y2:12.64,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#4DE2FB"}),tm("stop",{offset:1,stopColor:"#28AEE8"})),tm("linearGradient",{id:"c",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("linearGradient",{id:"e",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M0 0h20v20H0z"})),tm("filter",{id:"d",width:53.58,height:53.4,x:-15.16,y:-10.87,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},tm("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),tm("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),tm("feOffset",{dx:6,dy:6}),tm("feGaussianBlur",{stdDeviation:11.14}),tm("feComposite",{in2:"hardAlpha",operator:"out"}),tm("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.38 0"}),tm("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_893_1954"}),tm("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_893_1954",result:"shape"})))),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#5F01D2",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"}))},o5=20,o8=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("path",{d:"M9.09 7.91L13.67 12.5L9.09 17.09L10.5 18.5L16.5 12.5L10.5 6.5L9.09 7.91Z",fill:"currentColor"})),o6=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("g",{clipPath:"url(#clip0_221_1596)"},rZ.createElement("path",{d:"M17.5125 10.53C17.0025 7.9425 14.73 6 12 6C9.8325 6 7.95 7.23 7.0125 9.03C4.755 9.27 3 11.1825 3 13.5C3 15.9825 5.0175 18 7.5 18H17.25C19.32 18 21 16.32 21 14.25C21 12.27 19.4625 10.665 17.5125 10.53Z",fill:"currentColor"})),rZ.createElement("g",{clipPath:"url(#clip1_221_1596)"},rZ.createElement("path",{d:"M15.9684 13.1139L14.9987 14.0933L14.5152 13.6098L14.2501 13.3446L13.9849 13.6098L13.5001 14.0946L13.0152 13.6098L12.9054 13.4999H12.7501H12.6188H12.3532L12.2651 13.7504C12.0087 14.4788 11.3147 14.9999 10.5001 14.9999C9.46592 14.9999 8.62506 14.1591 8.62506 13.1249C8.62506 12.0908 9.46592 11.2499 10.5001 11.2499C11.3147 11.2499 12.0087 11.7711 12.2651 12.4994L12.3532 12.7499H12.6188H15.5969L15.9684 13.1139ZM9.00006 13.1249C9.00006 13.9508 9.6742 14.6249 10.5001 14.6249C11.3259 14.6249 12.0001 13.9508 12.0001 13.1249C12.0001 12.2991 11.3259 11.6249 10.5001 11.6249C9.6742 11.6249 9.00006 12.2991 9.00006 13.1249Z",fill:"var(--st-background)",stroke:"var(--st-background)",strokeWidth:"0.75"})),rZ.createElement("defs",null,rZ.createElement("clipPath",{id:"clip0_221_1596"},rZ.createElement("rect",{width:"18",height:"18",transform:"translate(3 3)"})),rZ.createElement("clipPath",{id:"clip1_221_1596"},rZ.createElement("rect",{width:"8.25",height:"6",transform:"translate(8.25006 10.1251)"})))),o7={"google-workspace":"google","microsoft-entra":"microsoft",okta:"okta"},o9=({connection:e,onStart:t})=>{let{i18n:r,_:n}=nO(),a=t2(aW).client,{ssoOptions:o}=t2(aW).config,{iconRegistry:i,options:s}=t2(nq),{connection_id:l,display_name:c,identity_provider:d}=e,u=nH(`sso-${c}`,s),h=i[o7[d]]??o6;return rZ.createElement(oZ,{variant:"outline",onClick:()=>a.sso.start({connection_id:l,signup_redirect_url:o?.signupRedirectURL,login_redirect_url:o?.loginRedirectURL}).then(()=>{t?.(e)}),icon:rZ.createElement(h,null),id:u},r._({id:"provider.continueWith",message:"Continue with {display_name}",values:{display_name:c}}))};function ie(){let[e,t]=tG(0);return{expiration:e,start:e=>{t(Date.now()+1e3*e)},clear:()=>{t(0)}}}let it=e=>Math.max(0,Math.ceil((e-Date.now())/1e3)),ir=e=>{let[t,r]=tG(()=>it(e)),n=t<=0;return tZ(()=>{let t=()=>r(it(e));if(t(),Date.now()>=e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[n,e]),[t,!n]},ia=()=>{let e;return(e="u">typeof window&&window)&&(/Chromatic/.test(e.navigator.userAgent)||/chromatic=true/.test(e.location.href))?"chromatic-ignore":void 0};nW(".VerticalTransition_module_container__9366f503{display:grid;overflow:clip;width:fit-content}.VerticalTransition_module_primary__9366f503,.VerticalTransition_module_secondary__9366f503{grid-area:1/1/2/2;transition:translate var(--st-transition-duration) ease-in-out}.VerticalTransition_module_secondary__9366f503{translate:0 100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_primary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_primary__9366f503{translate:0 -100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_secondary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_secondary__9366f503{translate:0 0}");function io(e){let[t,r]=tG(!1);return tZ(()=>{if(!t||!e)return;let n=setTimeout(()=>r(!1),1e3*e);return()=>clearTimeout(n)},[t,e]),[t,r]}let ii=({primary:e,secondary:t,rootClassName:r,className:n,trigger:a="manual",triggered:o})=>rZ.createElement("div",{className:nj(r,"VerticalTransition_module_container__9366f503",{VerticalTransition_module_triggered__9366f503:o,VerticalTransition_module_canTriggerByHover__9366f503:"hover"===a}),"aria-live":"manual"===a?"polite":void 0},rZ.createElement("div",{className:nj(n,"VerticalTransition_module_primary__9366f503"),"aria-hidden":"manual"===a?o:void 0},e),rZ.createElement("div",{className:nj(n,"VerticalTransition_module_secondary__9366f503"),"aria-hidden":"manual"===a?!o:void 0},t)),is=e=>{if(e&&"object"==typeof e&&"error_type"in e&&"string"==typeof e.error_type)return e.error_type},il={invalid_email:{id:"error.invalidEmail",message:"Email format is invalid."},invalid_phone_number:{id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:"error.unsubscribedPhoneNumber",message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:"error.inactiveEmail",message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:"error.unauthorizedCredentials",message:"Unauthorized credentials."},user_unauthenticated:{id:"error.userUnauthenticated",message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:"error.emailNotFound",message:"Email not found."},unable_to_auth_magic_link:{id:"error.unableToAuthMagicLink",message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:"error.noUserPassword",message:"Password not found for this user. Please try again."},breached_password:{id:"error.breachedPassword",message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:"error.resetPassword",message:"Password must be reset."},oauth_token_not_found:{id:"error.oauthTokenNotFound",message:"OAuth Token could not be found."},invalid_code:{id:"error.invalidCode",message:"Code format is invalid, please try again."},member_password_not_found:{id:"error.memberPasswordNotFound",message:"Member password not found."},oauth_flow_callback_error:{id:"error.oauthFlowCallbackError",message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:"error.unauthorizedAction",message:"Unauthorized action."},user_lock_limit_reached:{id:"error.userLockLimitReached",message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:"error.invalidSessionToken",message:"Invalid session token."},session_not_found:{id:"error.sessionNotFound",message:"Session not found."},invalid_phone_number_country_code:{id:"error.invalidPhoneNumberCountryCode",message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:"error.otpCodeNotFound",message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:"error.duplicatePhoneNumber",message:"A member with the specified phone number already exists for this organization."}},ic=(e,t)=>{let r=il[is(e)];return r?t(r):e.error_message};nW(".Column_module_column__efe9ce44{display:flex;flex-direction:column}");let id=rs(({as:e="div",gap:t,className:r,style:n,...a},o)=>{let i={...n};return null!=t&&(i.gap=1===t?"var(--st-spacing)":`var(--st-spacing-${t})`),rZ.createElement(e,{ref:o,className:nj(r,"Column_module_column__efe9ce44"),style:i,...a})});function iu(e){var t;let r;return Number.isNaN(r=parseFloat(t=window.getComputedStyle(e).getPropertyValue("--st-transition-duration")))?0:t.endsWith("ms")?r:1e3*r}nW(".Toast_module_container__ac93617f{bottom:10vh;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0}.Toast_module_toast__ac93617f{background:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-md);box-shadow:0 2px 4px rgba(0,0,0,.05);color:var(--st-destructive);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);pointer-events:auto;position:absolute;top:0;white-space:pre}");let ih=[];function im(e){for(let t of ih)t(e)}let ip={opacity:0,translate:"0 var(--st-spacing-2)"},i_={opacity:1,translate:"0"};function ig(e,t){e.animate([i_,ip],{duration:t,easing:"ease-in-out"}).addEventListener("finish",()=>e.remove())}let iy=()=>{let e=tQ(null),t=tQ(),r=tQ();return tZ(()=>{let n=n=>{if(!e.current)return;let a=2*iu(e.current),o=document.createElement("div");o.textContent=n.message,o.className="Toast_module_toast__ac93617f",t.current&&ig(t.current,a),e.current.appendChild(o),t.current=o,o.animate([ip,i_],{duration:a,easing:"ease-in-out"}),r.current=window.setTimeout(()=>{t.current&&(ig(t.current,a),t.current=void 0)},n.durationMs??1e4)};return ih.push(n),()=>{clearTimeout(r.current);let e=ih.indexOf(n);-1!==e&&ih.splice(e,1)}},[]),rZ.createElement("div",{className:"Toast_module_container__ac93617f",ref:e,"aria-live":"polite"})};nW(".Divider_module_container__1fb7194e{align-items:center;display:flex;gap:var(--st-spacing-2);line-height:var(--st-line-height-xs)}.Divider_module_bar__1fb7194e{border-bottom:1px solid var(--st-divider-color);flex:1 1 auto}");var iv="Divider_module_bar__1fb7194e";let ib=()=>{let{i18n:e,_:t}=nO();return rZ.createElement("div",{role:"separator",className:"Divider_module_container__1fb7194e"},rZ.createElement("div",{className:iv}),rZ.createElement(nZ,{variant:"helper"},e._({id:"methodDivider.text",message:"or"})),rZ.createElement("div",{className:iv}))},iw=e=>"children"in e?rZ.createElement(id,{gap:2},e.children):rZ.createElement(id,{gap:4},e.top&&rZ.createElement(iw,null,e.top),rZ.createElement(ib,null),rZ.createElement(iw,null,e.bottom)),ik=({header:e,description:t,children:r,additionalActions:n,resend:a,sendMagicLink:o,goBack:i})=>{let{i18n:s,_:l}=nO(),[c,d]=tG(!1),[u,h]=tG(!1),m=ie(),[p,_]=ir(m.expiration),g=a&&rZ.createElement(oZ,{variant:"outline",onClick:async()=>{d(!0);try{await a(),m.start(15)}catch(e){im({message:ic(e,l)}),m.clear()}finally{d(!1)}},loading:c,disabled:c||_},rZ.createElement(ii,{className:ia(),triggered:_,primary:s._({id:"button.resendEmail",message:"Resend email"}),secondary:s._({id:"button.emailResent",message:"Email resent! Try again in {timeRemaining}s",values:{timeRemaining:p}})})),f=i&&rZ.createElement(oZ,{variant:"ghost",onClick:i},s._({id:"button.goBack",message:"Go back"})),y=o?rZ.createElement(iw,{top:rZ.createElement(rZ.Fragment,null,n,g),bottom:rZ.createElement(rZ.Fragment,null,rZ.createElement(oZ,{variant:"outline",onClick:()=>{h(!0),o().catch(()=>h(!1))},loading:u},s._({id:"button.loginWithoutPassword",message:"Log in without a password"})),f)}):rZ.createElement(iw,null,n,g,f);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e),rZ.createElement(nZ,null,t),r,y)},iS={messageDescriptor:{id:"link.openInGmail",message:"Open in Gmail"},icon:"gmail",getUrl:e=>{let t=encodeURIComponent(e?`from:@${e} in:anywhere`:"in:anywhere");return`https://mail.google.com/mail/u/0/#search/${t}`}},iE={messageDescriptor:{id:"link.openInYahoo",message:"Open in Yahoo"},icon:"yahoo",getUrl:e=>e?`https://mail.yahoo.com/d/search/keyword=${e}`:"https://mail.yahoo.com/d/search/referrer=unread"},iC={messageDescriptor:{id:"link.openInOutlook",message:"Open in Outlook"},icon:"outlook",getUrl:()=>"https://outlook.office.com/mail/0/inbox"},iP=({providerInfo:{icon:e,messageDescriptor:t,getUrl:r},emailDomain:n})=>{let{i18n:a,_:o}=nO(),i=r(n),{iconRegistry:s}=t2(nq),l=s[e];return rZ.createElement(oJ,{variant:"outline",href:i,target:"_blank",rel:"noopener noreferrer",icon:rZ.createElement(l,null)},a._(t))},iT=({emailDomain:e,email:t,goBack:r,resend:n,countdown:a,isSubmitting:o})=>{let{i18n:i,_:s}=nO(),[l,c]=ir(a?.expiration??0);return rZ.createElement(ik,{header:i._({id:"emailConfirmation.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:t}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:e,providerInfo:iS}),rZ.createElement(iP,{emailDomain:e,providerInfo:iE}),rZ.createElement(iP,{emailDomain:e,providerInfo:iC}),n&&a&&rZ.createElement(oZ,{variant:"outline",disabled:o||c,onClick:()=>{a.start(15),n().catch(()=>a.clear())}},rZ.createElement(ii,{className:ia(),primary:i._({id:"button.resendEmail",message:"Resend email"}),secondary:i._({id:"emailConfirmation.emailSent",message:"Email sent! Try again in {timeRemaining}s",values:{timeRemaining:l}}),triggered:c})),r&&rZ.createElement(oZ,{variant:"ghost",onClick:r},i._({id:"button.goBack",message:"Go back"})))})},iO=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.discovery.send",(e,{arg:{email:n}})=>t.magicLinks.email.discovery.send({email_address:n,discovery_redirect_url:r.emailMagicLinksOptions?.discoveryRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})}})},iA=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.loginOrSignup",(e,{arg:{email:n,organization_id:a}})=>t.magicLinks.email.loginOrSignup({email_address:n,organization_id:a,login_redirect_url:r.emailMagicLinksOptions?.loginRedirectURL,signup_redirect_url:r.emailMagicLinksOptions?.signupRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})},onError:e=>{eP(e)}})},ix=()=>{let e=t2(aW).client,t=t2(aW).config,[r,n]=tG(()=>{let{emailDomains:t}=r1(e).bootstrap.getSync();return t});return(tZ(()=>{r1(e).bootstrap.getAsync().then(({emailDomains:e})=>{n(e)})},[e]),t.emailMagicLinksOptions?.domainHint)?t.emailMagicLinksOptions?.domainHint:1===r.length?r[0]:null},iD=()=>{let[e,t]=t2(aW).state,r=ix(),n=ie(),{trigger:a,isMutating:o}=iA(),{trigger:i,isMutating:l}=iO(),c=e.formState.emailState.userSuppliedEmail,d=async()=>{e.flowState.type===s.Discovery?await i({email:c}):e.flowState.type===s.Organization&&e.flowState.organization&&await a({email:c,organization_id:e.flowState.organization.organization_id})};return rZ.createElement(iT,{emailDomain:r,email:c,goBack:()=>{t({type:"set_user_supplied_email",email:""}),t({type:"transition",screen:at})},resend:d,countdown:n,isSubmitting:o||l})},iz={"data-1p-ignore":!0},iM=(e="s")=>e+tQ(((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""))()).current;nW(".VisuallyHidden_module_hidden__c5a4c7ad,:not(:focus):not(:focus-within) .VisuallyHidden_module_focusable__c5a4c7ad{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap;word-wrap:normal}");let iI=({children:e,focusable:t})=>rZ.createElement("div",{className:nj(t?"VisuallyHidden_module_focusable__c5a4c7ad":"VisuallyHidden_module_hidden__c5a4c7ad")},e),iR=e=>{let t=tQ(e);tZ(()=>t.current(),[])},iL=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g,iB=({children:e,...t})=>{let r=t1(()=>(e=>{let t=e.split(iL),r=Array.from(e.matchAll(iL)).map(e=>e[0]),n=[];for(;t.length||r.length;)if(t.length&&n.push(t.shift()),r.length){let e=r.shift();n.push(rZ.createElement("a",{key:e+"__"+String(r.length),href:e,target:"_blank",rel:"noreferrer"},e))}return n})(e),[e]),[n,a]=tG(!1);return iR(()=>a(!0)),rZ.createElement("div",{"aria-live":"polite"},n&&rZ.createElement(nZ,{...t,variant:"helper",color:"destructive",key:e},r))};nW(".Input_module_label__a0aad2f4{color:var(--st-foreground);display:block;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-sm);margin-bottom:var(--st-spacing-0_5);width:fit-content}.Input_module_input__a0aad2f4{padding:var(--st-spacing-2) var(--st-spacing-3);width:100%}.-st-mobile .Input_module_input__a0aad2f4{padding:var(--st-spacing-3)}.Input_module_input__a0aad2f4:disabled{color:var(--st-muted-foreground)}.Input_module_input__a0aad2f4::placeholder{color:var(--st-muted-foreground)}.Input_module_inputWrapper__a0aad2f4{display:flex;position:relative}.Input_module_action__a0aad2f4{inset-inline-end:var(--st-spacing-2);position:absolute;scale:.75;transform-origin:center right}[dir=rtl] .Input_module_action__a0aad2f4{transform-origin:center left}.Input_module_action__a0aad2f4:dir(rtl){transform-origin:center left}.Input_module_error__a0aad2f4{margin-top:var(--st-spacing-2)}");let iN=rs(({className:e,label:t,hideLabel:r,action:n,id:a,containerClassName:o,error:i,...s},l)=>{let c=t2(nq),d=a+(c.options?.inputIdSuffix??""),u=iM(),h=tQ(null),[m,p]=tG();tJ(()=>{h.current&&p(h.current.getBoundingClientRect().width)},[n]);let _=rZ.createElement("label",{className:"Input_module_label__a0aad2f4",htmlFor:d},t);return i&&(s["aria-invalid"]=!0,s["aria-errormessage"]=u),rZ.createElement("div",{className:nj(o,"Input_module_container__a0aad2f4")},r?rZ.createElement(iI,null,_):_,rZ.createElement("div",{className:"Input_module_inputWrapper__a0aad2f4"},rZ.createElement("input",{ref:l,id:d,className:nj(e,"Input_module_input__a0aad2f4 inputBase_module_inputBase__06c14ae4 inputBase_module_focusRing__06c14ae4"),style:m?{paddingInlineEnd:`calc(${m}px + var(--st-spacing-4))`}:void 0,...s}),n&&rZ.createElement("div",{ref:h,className:"Input_module_action__a0aad2f4"},n)),i&&rZ.createElement(iB,{id:u,className:"Input_module_error__a0aad2f4","aria-live":"polite"},i))}),iU=({email:e,setEmail:t,hasPasskeys:r=!1,...n})=>{let{i18n:a,_:o}=nO();return rZ.createElement(iN,{id:"email-input",label:a._({id:"formField.email.label",message:"Email"}),placeholder:a._({id:"formField.email.placeholder",message:"example@email.com"}),type:"email",autoComplete:r?"username webauthn":"email",value:e,onChange:e=>t(e.target.value),required:!0,...r?iz:{},...n})},iF=({email:e})=>{let[,t]=t2(aW).state,{i18n:r,_:n}=nO();return rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"use_password_auth",email:e})}},r._({id:"button.usePassword",message:"Use a password instead"}))},iq={oauth:void 0,sso:"sso",emailMagicLinks:"magic_link",emailOtp:"email_otp",passwords:"password"},iH={[c.Google]:"google_oauth",[c.Microsoft]:"microsoft_oauth",[c.HubSpot]:"hubspot_oauth",[c.Slack]:"slack_oauth",[c.GitHub]:"github_oauth"},iK=Object.fromEntries(Object.entries(iq).map(([e,t])=>[t,e])),ij=Object.fromEntries(Object.entries(iH).map(([e,t])=>[t,e])),i$=e=>e in ij?"oauth":iK[e],iV=Object.values(c),iW=(e,t)=>e.flatMap(e=>{if("oauth"===e.id)return t.map(e=>{let t=iH["string"==typeof e?e:e.type];if(t)return t});{let t=iq[e.id];if(t)return t}}).filter(aN),iG=()=>{let e,[t]=t2(aW).state,r=t2(aW).config,{restrictedAuthMethods:n,hasPrimaryAuthMethods:a}=(()=>{let[e]=t2(aW).state,{primaryAuthMethods:t}=e.primary;return{restrictedAuthMethods:t1(()=>e.primary.primaryAuthMethods?new Set(e.primary.primaryAuthMethods):e.flowState.organization?.auth_methods==="RESTRICTED"?new Set(e.flowState.organization?.allowed_auth_methods??[]):void 0,[e.flowState.organization?.allowed_auth_methods,e.flowState.organization?.auth_methods,e.primary.primaryAuthMethods]),hasPrimaryAuthMethods:!!t}})(),o=(e=t2(aW).config,t1(()=>e.oauthOptions?.providers?e.oauthOptions.providers.map(aJ):[],[e.oauthOptions?.providers])),i=t1(()=>iW(r.products,o),[r.products,o]),s=t1(()=>{if(!n)return i;let e=i.filter(e=>n.has(e));return e.length>0||!a?e:t.flowState.organization?.auth_methods==="RESTRICTED"?iW(r.organizationProducts,iV).filter(e=>n.has(e)):["magic_link"]},[r.organizationProducts,i,a,n,t.flowState.organization?.auth_methods]);return{products:t1(()=>[...new Set(s.map(i$).filter(aN))].map(e=>r.organizationProducts.find(t=>t.id===e)).filter(aN),[s,r.organizationProducts]),oauthProviderSettings:t1(()=>s.map(e=>{let t=ij[e];if(t)return o.find(e=>e.type===t)??aJ(t)}).filter(aN),[s,o])}},iY=()=>new Date(Date.now()+6e5),iZ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.discovery.send",(e,{arg:{email:t}})=>r.otps.email.discovery.send({email_address:t,login_template_id:n.emailOtpOptions?.loginTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iJ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.loginOrSignup",(e,{arg:{email:t,organization_id:a}})=>r.otps.email.loginOrSignup({email_address:t,organization_id:a,login_template_id:n.emailOtpOptions?.loginTemplateId,signup_template_id:n.emailOtpOptions?.signupTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iQ=["email_jit_provisioning_not_allowed","invalid_email_for_jit_provisioning"],iX=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),o=(()=>{let{i18n:e,_:t}=nO();return(r,{email:n,org:a})=>iQ.includes(r.error_type)?e._({id:"error.jitIneligible",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin",values:{email:n,organizationName:a}}):ic(r,t)})(),{i18n:i,_:s}=nO(),{products:l}=iG(),c=oB(l,"emailMagicLinks"),d=oB(l,"emailOtp"),u=t.primary.email,h=u||n,{trigger:m,error:p,isMutating:_}=iA(),{trigger:g,error:f,isMutating:y}=iJ(),v=_||y,b=p||f,w=t.flowState.organization;if(!w)return rZ.createElement(rZ.Fragment,null);let k=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:h}),c&&d?r({type:"transition",screen:av,history:"push"}):c?m({email:h,organization_id:w.organization_id}):d&&g({email:h,organization_id:w.organization_id})};return u?rZ.createElement(id,{gap:2},l.filter(e=>"emailMagicLinks"===e.id||"emailOtp"===e.id).map(e=>{switch(e.id){case"emailMagicLinks":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),m({email:h,organization_id:w.organization_id})},loading:_,disabled:v,variant:"outline"},i._({id:"button.emailLink",message:"Email me a link"}));case"emailOtp":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),g({email:h,organization_id:w.organization_id})},loading:y,disabled:v,variant:"outline"},i._({id:"button.emailCode",message:"Email me a code"}))}}),e&&rZ.createElement(iF,{email:h})):rZ.createElement(id,{as:"form",onSubmit:k,gap:2},rZ.createElement(iU,{email:h,setEmail:a,hideLabel:!0,error:b?o(b,{email:h,org:w.organization_name}):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:v},i._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:h}))},i1=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),{i18n:o,_:i}=nO(),{products:s}=iG(),l=s.some(e=>"emailMagicLinks"===e.id),c=s.some(e=>"emailOtp"===e.id),{trigger:d,error:u,isMutating:h}=iO(),{trigger:m,error:p,isMutating:_}=iZ(),g=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:n}),l&&c?r({type:"transition",screen:av,history:"push"}):l?d({email:n}):c&&m({email:n})},f=u||p;return rZ.createElement(id,{as:"form",onSubmit:g,gap:2},rZ.createElement(iU,{email:n,setEmail:a,hideLabel:!0,error:f?ic(f,i):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:h||_},o._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:n}))},i0={emailMagicLinks:{messageDescriptor:{id:"emailMethodSelection.link",message:"Email me a login link"}},emailOtp:{messageDescriptor:{id:"emailMethodSelection.code",message:"Email me a login code"}}},i2=()=>{let{products:e}=iG(),{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{trigger:o,isMutating:i,error:l,reset:c}=iO(),{trigger:d,isMutating:u,error:h,reset:m}=iZ(),{trigger:p,isMutating:_,error:g,reset:f}=iA(),{trigger:y,isMutating:v,error:b,reset:w}=iJ(),k=i||u||_||v,S=l||h||g||b,E=t1(()=>e.map(e=>{let t=i0[e.id];if(t)return{option:e.id,messageDescriptor:t.messageDescriptor}}).filter(aN),[e]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"emailMethodSelection.title",message:"Select how you’d like to continue"})),rZ.createElement(iw,null,E.map(({option:e,messageDescriptor:r})=>rZ.createElement(oZ,{key:e,variant:"outline",disabled:k,onClick:()=>{switch(c(),m(),f(),w(),e){case"emailMagicLinks":n.flowState.type===s.Discovery?o({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&p({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id});break;case"emailOtp":n.flowState.type===s.Discovery?d({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&y({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id})}}},t._(r))),S&&rZ.createElement(iB,null,ic(S,r)),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{a({type:"navigate_back"})}},t._({id:"button.goBack",message:"Go back"}))))};nW(".Loading_module_loadingScreen__1c53715a{display:flex;justify-content:center}");let i3=()=>{let{i18n:e,_:t}=nO();return tm(nZ,{variant:"header",align:"center"},e._({id:"login.loading",message:"Logging in..."}))},i4=()=>tm("div",{className:"Loading_module_loadingScreen__1c53715a"},tm(oW,{size:32})),i5=({isSubmitting:e,resendOTP:t,countdown:r})=>{let{i18n:n,_:a}=nO(),[o,i]=ir(r.expiration);return rZ.createElement(oZ,{variant:"outline",disabled:e||i,onClick:()=>{r.start(15),t().catch(()=>r.clear())}},rZ.createElement(ii,{className:ia(),primary:n._({id:"passcode.resendCode",message:"Resend code"}),secondary:n._({id:"passcode.codeSent",message:"Code sent! Try again in {timeRemaining}s",values:{timeRemaining:o}}),triggered:i}))};nW(".AnimatedContainer_module_container__fb438508{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--st-transition-duration) ease-out}.AnimatedContainer_module_open__fb438508{grid-template-rows:1fr}.AnimatedContainer_module_inner__fb438508{min-height:0;overflow:clip}");let i8=({isOpen:e,children:t})=>rZ.createElement("div",{className:nj("AnimatedContainer_module_container__fb438508",{AnimatedContainer_module_open__fb438508:e}),"aria-live":"polite"},rZ.createElement("div",{className:"AnimatedContainer_module_inner__fb438508","aria-hidden":!e},t));nW(".LoadingBar_module_container__3a991498{background-color:var(--st-muted);border-radius:var(--st-rounded-full);height:var(--st-spacing);overflow:clip}.LoadingBar_module_progress__3a991498{animation:LoadingBar_module_loading__3a991498 10s cubic-bezier(.22,1,.36,1);background-color:var(--st-primary);height:100%;width:100%}@keyframes LoadingBar_module_loading__3a991498{0%{transform:translateX(-100%)}to{transform:translateX(-1%)}}");let i6=({isLoading:e})=>rZ.createElement("div",{role:"progressbar",className:"LoadingBar_module_container__3a991498"},e&&rZ.createElement("div",{className:"LoadingBar_module_progress__3a991498"}));nW(".OTPEntry_module_progressInner__6b10f31d{padding-top:var(--st-spacing-2)}");var i7=Object.defineProperty,i9=Object.defineProperties,se=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,sa=(e,t,r)=>t in e?i7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,so=tI({}),si=rs((e,t)=>{let r;var n,a,o,i,s,{value:l,onChange:c,maxLength:d,textAlign:u="left",pattern:h,placeholder:m,inputMode:p="numeric",onComplete:_,pushPasswordManagerStrategy:g="increase-width",pasteTransformer:f,containerClassName:y,noScriptCSSFallback:v=sl,render:b,children:w}=e,k=((e,t)=>{var r={};for(var n in e)sr.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&st)for(var n of st(e))0>t.indexOf(n)&&sn.call(e,n)&&(r[n]=e[n]);return r})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[S,E]=tG("string"==typeof k.defaultValue?k.defaultValue:""),C=null!=l?l:S,P=(r=tQ(),tZ(()=>{r.current=C}),r.current),T=t0(e=>{null==c||c(e),E(e)},[c]),O=t1(()=>h?"string"==typeof h?new RegExp(h):h:null,[h]),A=tQ(null),x=tQ(null),D=tQ({value:C,onChange:T,isIOS:"u">typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),z=tQ({prev:[null==(o=A.current)?void 0:o.selectionStart,null==(i=A.current)?void 0:i.selectionEnd,null==(s=A.current)?void 0:s.selectionDirection]});tX(t,()=>A.current,[]),tZ(()=>{let e=A.current,t=x.current;if(!e||!t)return;function r(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,r=e.selectionEnd,n=e.selectionDirection,a=e.maxLength,o=e.value,i=z.current.prev,s=-1,l=-1,c;if(0!==o.length&&null!==t&&null!==r){let e=t===r,n=t===o.length&&o.length<a;if(e&&!n){if(0===t)s=0,l=1,c="forward";else if(t===a)s=t-1,l=t,c="backward";else if(a>1&&o.length>1){let e=0;if(null!==i[0]&&null!==i[1]){c=t<i[1]?"backward":"forward";let r=i[0]===i[1]&&i[0]<a;"backward"!==c||r||(e=-1)}s=e+t,l=e+t+1}}-1!==s&&-1!==l&&s!==l&&A.current.setSelectionRange(s,l,c)}let d=-1!==s?s:t,u=-1!==l?l:r,h=null!=c?c:n;N(d),F(u),z.current.prev=[d,u,h]}if(D.current.value!==e.value&&D.current.onChange(e.value),z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",r,{capture:!0}),r(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";ss(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),ss(e.sheet,`[data-input-otp]:autofill { ${t} }`),ss(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),ss(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),ss(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let a=new ResizeObserver(n);return a.observe(e),()=>{document.removeEventListener("selectionchange",r,{capture:!0}),a.disconnect()}},[]);let[M,I]=tG(!1),[R,L]=tG(!1),[B,N]=tG(null),[U,F]=tG(null);tZ(()=>{var e;setTimeout(e=()=>{var e,t,r,n;null==(e=A.current)||e.dispatchEvent(new Event("input"));let a=null==(t=A.current)?void 0:t.selectionStart,o=null==(r=A.current)?void 0:r.selectionEnd,i=null==(n=A.current)?void 0:n.selectionDirection;null!==a&&null!==o&&(N(a),F(o),z.current.prev=[a,o,i])},0),setTimeout(e,10),setTimeout(e,50)},[C,R]),tZ(()=>{void 0!==P&&C!==P&&P.length<d&&C.length===d&&(null==_||_(C))},[d,_,P,C]);let q=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,o]=tG(!1),[i,s]=tG(!1),[l,c]=tG(!1),d=t1(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&i,[a,i,r]),u=t0(()=>{let n=e.current,a=t.current;if(!n||!a||l||"none"===r)return;let i=n.getBoundingClientRect().left+n.offsetWidth,s=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,s)===n||(o(!0),c(!0))},[e,t,l,r]);return tZ(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let a=setInterval(n,1e3);return()=>{clearInterval(a)}},[e,r]),tZ(()=>{let e=n||document.activeElement===t.current;if("none"===r||!e)return;let a=setTimeout(u,0),o=setTimeout(u,2e3),i=setTimeout(u,5e3),s=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(o),clearTimeout(i),clearTimeout(s)}},[t,n,r,u]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:x,inputRef:A,pushPasswordManagerStrategy:g,isFocused:R}),H=t0(e=>{let t=e.currentTarget.value.slice(0,d);t.length>0&&O&&!O.test(t)?e.preventDefault():("string"==typeof P&&t.length<P.length&&document.dispatchEvent(new Event("selectionchange")),T(t))},[d,T,P,O]),K=t0(()=>{var e;if(A.current){let t=Math.min(A.current.value.length,d-1),r=A.current.value.length;null==(e=A.current)||e.setSelectionRange(t,r),N(t),F(r)}L(!0)},[d]),j=t0(e=>{var t,r;let n=A.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!n))return;let a=e.clipboardData.getData("text/plain"),o=f?f(a):a;e.preventDefault();let i=null==(t=A.current)?void 0:t.selectionStart,s=null==(r=A.current)?void 0:r.selectionEnd,l=(i!==s?C.slice(0,i)+o+C.slice(s):C.slice(0,i)+o+C.slice(i)).slice(0,d);if(l.length>0&&O&&!O.test(l))return;n.value=l,T(l);let c=Math.min(l.length,d-1),u=l.length;n.setSelectionRange(c,u),N(c),F(u)},[d,T,O,C]),$=t1(()=>({position:"relative",cursor:k.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[k.disabled]),V=t1(()=>({position:"absolute",inset:0,width:q.willPushPWMBadge?`calc(100% + ${q.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:q.willPushPWMBadge?`inset(0 ${q.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:u,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[q.PWM_BADGE_SPACE_WIDTH,q.willPushPWMBadge,u]),W=t1(()=>tm("input",i9(((e,t)=>{for(var r in t||(t={}))sr.call(t,r)&&sa(e,r,t[r]);if(st)for(var r of st(t))sn.call(t,r)&&sa(e,r,t[r]);return e})({autoComplete:k.autoComplete||"one-time-code"},k),se({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===C.length||void 0,"data-input-otp-mss":B,"data-input-otp-mse":U,inputMode:p,pattern:null==O?void 0:O.source,"aria-placeholder":m,style:V,maxLength:d,value:C,ref:A,onPaste:e=>{var t;j(e),null==(t=k.onPaste)||t.call(k,e)},onChange:H,onMouseOver:e=>{var t;I(!0),null==(t=k.onMouseOver)||t.call(k,e)},onMouseLeave:e=>{var t;I(!1),null==(t=k.onMouseLeave)||t.call(k,e)},onFocus:e=>{var t;K(),null==(t=k.onFocus)||t.call(k,e)},onBlur:e=>{var t;L(!1),null==(t=k.onBlur)||t.call(k,e)}}))),[H,K,j,p,V,d,U,B,k,null==O?void 0:O.source,C]),G=t1(()=>({slots:Array.from({length:d}).map((e,t)=>{var r;let n=R&&null!==B&&null!==U&&(B===U&&t===B||t>=B&&t<U),a=void 0!==C[t]?C[t]:null;return{char:a,placeholderChar:void 0!==C[0]?null:null!=(r=null==m?void 0:m[t])?r:null,isActive:n,hasFakeCaret:n&&null===a}}),isFocused:R,isHovering:!k.disabled&&M}),[R,M,d,U,B,k.disabled,C]),Y=t1(()=>b?b(G):tm(so.Provider,{value:G},w),[w,G,b]);return tm(tg,null,null!==v&&tm("noscript",null,tm("style",null,v)),tm("div",{ref:x,"data-input-otp-container":!0,style:$,className:y},Y,tm("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))});function ss(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}si.displayName="Input";var sl=`
|
|
27
|
+
products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error("'config.products' should not include strings anymore");let l=Array.isArray(i),c=nR(l?"(prefers-color-scheme: dark)":void 0);o=l?c?i[1]:i[0]:i;let d=t1(()=>{let e={};for(let t of r)Object.assign(e,t.icons);return Object.assign(e,s?.icons),e},[r,s]);return{theme:{...nB,...o},options:{enableShadowDOM:n,...nU,...s},displayWatermark:t,iconRegistry:d}}let nq=tI(void 0);function nH(e,t){if(null!=t.buttonId&&!1!==t.buttonId)return"string"==typeof t.buttonId?e+t.buttonId:e}var nK={exports:{}},nj=(en=function(){if(el)return nK.exports;el=1;var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,function(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}(o)))}return n}function r(e,t){return t?e?e+" "+t:e+t:e}return nK.exports?(t.default=t,nK.exports=t):window.classNames=t,nK.exports}())&&en.__esModule&&Object.prototype.hasOwnProperty.call(en,"default")?en.default:en;let n$=[],nV=new Set;function nW(e){n$.push(e),nV.forEach(t=>t(e))}function nG(){var e;let t=document.createElement("style"),r=!0,n=((e=e=>{r||document.contains(t)?(t.textContent+=e,r=!1):n()})(n$.join("\n")),nV.add(e),()=>nV.delete(e));return t}nW(".Typography_module_typography__74817c74{font-family:var(--st-font-family)}.Typography_module_header__74817c74{color:var(--st-foreground);font-family:var(--st-header-font);font-size:var(--st-text-2xl);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-2xl)}.Typography_module_body__74817c74{color:var(--st-foreground);font-size:var(--st-text-base)}.Typography_module_body__74817c74,.Typography_module_helper__74817c74{font-weight:var(--st-font-weight-normal);line-height:var(--st-line-height-base)}.Typography_module_helper__74817c74{color:var(--st-muted-foreground);font-size:var(--st-text-xs)}.Typography_module_start__74817c74{text-align:start}.Typography_module_center__74817c74{text-align:center}.Typography_module_end__74817c74{text-align:end}.Typography_module_foreground__74817c74{color:var(--st-foreground)}.Typography_module_muted__74817c74{color:var(--st-muted-foreground)}.Typography_module_destructive__74817c74{color:var(--st-destructive)}.Typography_module_warning__74817c74{color:var(--st-warning)}.Typography_module_success__74817c74{color:var(--st-success)}.Typography_module_regular__74817c74{font-weight:var(--st-font-weight-normal)}.Typography_module_medium__74817c74{font-weight:var(--st-font-weight-medium)}.Typography_module_semibold__74817c74{font-weight:var(--st-font-weight-semibold)}.Typography_module_bold__74817c74{font-weight:var(--st-font-weight-bold)}.Typography_module_defaultFont__74817c74{font-family:var(--st-font-family)}.Typography_module_monoFont__74817c74{font-family:var(--st-font-family-mono)}");var nY={typography:"Typography_module_typography__74817c74",header:"Typography_module_header__74817c74",body:"Typography_module_body__74817c74",helper:"Typography_module_helper__74817c74",start:"Typography_module_start__74817c74",center:"Typography_module_center__74817c74",end:"Typography_module_end__74817c74",foreground:"Typography_module_foreground__74817c74",muted:"Typography_module_muted__74817c74",destructive:"Typography_module_destructive__74817c74",warning:"Typography_module_warning__74817c74",success:"Typography_module_success__74817c74",regular:"Typography_module_regular__74817c74",medium:"Typography_module_medium__74817c74",semibold:"Typography_module_semibold__74817c74",bold:"Typography_module_bold__74817c74",defaultFont:"Typography_module_defaultFont__74817c74",monoFont:"Typography_module_monoFont__74817c74"};let nZ=rs(({variant:e="body",as:t="div",weight:r,font:n,color:a,align:o,className:i,...s},l)=>rZ.createElement(t,{...s,ref:l,className:nj(i,nY.typography,nY[e],n&&nY[n+"Font"],r&&nY[r],a&&nY[a],o&&nY[o])}));nW(".Badge_module_badge__c44e2b28{background-color:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-base);cursor:default;padding:var(--st-spacing-0_5) var(--st-spacing);width:fit-content}");let nJ=({className:e,children:t})=>rZ.createElement("div",{className:nj("Badge_module_badge__c44e2b28",e)},rZ.createElement(nZ,{variant:"helper"},t));nW(".LastUsed_module_container__4e54ed99{position:relative}.LastUsed_module_badge__4e54ed99{position:absolute;right:var(--st-spacing-3);top:0;translate:0 -60%}[dir=rtl] .LastUsed_module_badge__4e54ed99{left:var(--st-spacing-3);right:auto}.LastUsed_module_badge__4e54ed99:dir(rtl){left:var(--st-spacing-3);right:auto}");let nQ=({children:e})=>{let{i18n:t,_:r}=nO();return rZ.createElement("div",{className:"LastUsed_module_container__4e54ed99"},e,rZ.createElement(nJ,{className:"LastUsed_module_badge__4e54ed99"},t._({id:"provider.lastUsed",message:"Last used"})))},nX=({niceName:e,variableName:t})=>rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because there are no ",e," set for this project so we are unable to verify the"," ",rZ.createElement("code",null,t),"\xa0 provided in the configuration. To set ",e,"for this project please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xa0 For more information on why this validation is necessary please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation.")),n1="origin_not_allowed_for_client",n0="invalid_client",n2="oauth_config_not_found",n3="default_provider_not_allowed",n4=({error:e})=>{switch(e){case n1:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the current host\xa0",rZ.createElement("code",null,window.location.host),"is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xa0 ",rZ.createElement("code",null,"http://localhost"),"and\xa0",rZ.createElement("code",null,"http://localhost:<port_number>"),"\xa0 to the Authorized JavaScript origins box. You can learn more\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));case n0:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xa0 Please check that the client ID saved in"," ",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xa0 matches the client ID in your Google Cloud Console.");case n2:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));case"no_login_redirect_urls_set":return rZ.createElement(nX,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});case"no_signup_redirect_urls_set":return rZ.createElement(nX,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});case n3:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."))}},n5=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,n8=e=>(document.cookie?document.cookie.split("; "):[]).filter(t=>{let[r]=t.split("=");return e===r}).length>1,n6=()=>{},n7="u">typeof window?tJ:tZ,n9=e=>{let t=tQ(e);return n7(()=>{t.current=e},[e]),t0((...e)=>(0,t.current)(...e),[])},ae={primaryInfo:null,isEnrolling:!1,smsOtp:{isSending:!1,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{enrollment:null}},at="Main",ar="Email Confirmation",an="Logged In",aa="Discovery",ao="Error",ai="Password Authenticate",as="Password Reset Form",al="Password Reset Verify Confirmation",ac="Password Forgot Form",ad="Password Set New Confirmation",au="MFA Enrollment Selection",ah="Recovery Code Entry",am="Recovery Code Save",ap="SMS OTP Enrollment",a_="SMS OTP Entry",ag="TOTP Enrollment Manual",af="TOTP Enrollment QR Code",ay="TOTP Entry",av="Email Method Selection",ab="Email OTP Entry",aw="SSO Discovery Email",ak="SSO Discovery Fallback",aS="SSO Discovery Menu",aE="EmailForm",aC="EmailDiscoveryForm",aP="OAuthButtons",aT="SSOButtons",aO="PasswordsEmailForm",aA="PasswordEmailCombined",ax="PasswordEmailCombinedDiscovery",aD="Divider",az="Default",aM="EmailMagicLink",aI="Organization",aR="CannotJoinOrgDueToAuthPolicy",aL="AdBlockerDetected",aB="OrganizationDiscoveryClaimedDomain",aN=e=>!!e,aU=({allMethods:e,orgSupportedMethods:t,uiIncludedMethods:r})=>new Set(t?.length?t:r?.length?r:e);function aF(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[...t.screenHistory,t.screen]}}function aq(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[]}}function aH(e){switch(e){case"totp":return d.totp;case"sms_otp":return d.smsOtp;default:return}}let aK=()=>new Date(Date.now()+12e4),aj=[d.totp,d.smsOtp],a$=(e,t)=>{switch(t.type){case"transition":return"push"===t.history?aF(t.screen,e):aq(t.screen,e);case"navigate_back":{let t=e.screenHistory.at(-1);if(!t)return e;let r=e.screenHistory.slice(0,-1);return{...e,screen:t,screenHistory:r}}case"set_error_message_and_transition":return{...e,screen:ao,error:{type:t.errorType,canGoBack:t.canGoBack}};case"set_user_supplied_email":return{...e,formState:{...e.formState,emailState:{userSuppliedEmail:t.email},passwordState:{email:t.email}}};case"set_organization":return{...e,flowState:{type:s.Organization,organization:t.organization}};case"set_discovery_state":{let r=t.discoveredOrganizations;return{...e,formState:{...e.formState,discoveryState:{email:t.email,discoveredOrganizations:r}},screen:aa}}case"select_discovered_organization":{let{membership:r,organization:n,primary_required:a}=t.discoveredOrganization,o=r.member?.email_address??e.formState.discoveryState.email,i=a?a.allowed_auth_methods:void 0,l={...e,flowState:{type:s.Organization,organization:n},formState:{...e.formState,passwordState:{email:o}},primary:{primaryAuthMethods:i,email:o,emailVerified:r.member?.email_address_verified},screen:at};if(i?.length===0)return{...l,screen:ao,error:{type:aR,canGoBack:!0}};return l}case"set_password_state":return{...e,formState:{...e.formState,passwordState:{email:t.email}}};case"send_email_otp":return aF(ab,{...e,formState:{...e.formState,otpState:{codeExpiration:t.codeExpiration}}});case"set_sso_discovery_state":if(!t.connections.length)return aF(ak,e);return aF(aS,{...e,formState:{...e.formState,ssoDiscoveryState:{connections:t.connections}}});case"use_password_auth":return aF(ai,{...e,formState:{...e.formState,passwordState:{email:t.email}}});default:return((e,t)=>{switch(t.type){case"primary_authenticate_success":{let r=!!t.response.member_session,n="multi_tenant_magic_links"===t.resetTokenType?as:an;if(r)return aq(n,{...e,mfa:ae,primary:{}});if(t.response.primary_required){let r=t.response.primary_required.allowed_auth_methods,{email_address:n,email_address_verified:a}=t.response.member,o={...e,flowState:{type:s.Organization,organization:t.response.organization},formState:{...e.formState,passwordState:{email:n}},primary:{primaryAuthMethods:r,email:n,emailVerified:a}};if(r?.length===0)return aq(ao,{...o,error:{type:aR,canGoBack:!1}});return aq(at,o)}let a=t.response.member.mfa_phone_number_verified,o={enrolledMfaMethods:[!!t.response.member.totp_registration_id&&d.totp,a&&d.smsOtp].filter(aN),memberId:t.response.member_id,memberPhoneNumber:t.response.member.mfa_phone_number,organizationId:t.response.organization.organization_id,organizationMfaOptionsSupported:"RESTRICTED"===t.response.organization.mfa_methods?t.response.organization.allowed_mfa_methods?.map(aH).filter(aN)??[]:[],postAuthScreen:n},i=e=>0===o.organizationMfaOptionsSupported.length||o.organizationMfaOptionsSupported.includes(e),l=t.response.mfa_required?.secondary_auth_initiated==="sms_otp",c=l?d.smsOtp:(()=>{let e=aH(t.response.member.default_mfa_method);if(e&&i(e)&&o.enrolledMfaMethods.includes(e))return e})()??o.enrolledMfaMethods.find(i);if(c){let t={...ae,primaryInfo:o};switch(c){case d.totp:return aq(ay,{...e,mfa:t,primary:{}});case d.smsOtp:{let r={...e,mfa:{...t,smsOtp:{...t.smsOtp,codeExpiration:l?aK():null}},primary:{}};if(a)return aq(a_,r);return{...r,screen:a_,screenHistory:[ap]}}}}return aq(function(e){if(1===e.size){if(e.has(d.totp))return af;if(e.has(d.smsOtp))return ap}return au}(aU({allMethods:aj,orgSupportedMethods:o.organizationMfaOptionsSupported,uiIncludedMethods:t.includedMfaMethods})),{...e,mfa:{...ae,primaryInfo:o,isEnrolling:!0},primary:{}})}case"sms_otp/send":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!0,sendError:null}}};case"sms_otp/send_success":return aF(a_,{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:null,codeExpiration:aK(),formattedDestination:t.formattedPhoneNumber??e.mfa.smsOtp.formattedDestination,enrolledNumber:t.phoneNumber?{phoneNumber:t.phoneNumber,countryCode:t.countryCode}:null}}});case"sms_otp/send_error":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:t.error,codeExpiration:e.mfa.smsOtp.codeExpiration??new Date(Date.now()-1e3)}}};case"sms_otp/format_destination":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,formattedDestination:t.formattedPhoneNumber}}};case"sms_otp/authenticate_success":case"recovery_code/authenticate_success":case"recovery_code/save_acknowledge":return aq(e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:ae});case"totp/authenticate_success":return aq(e.mfa.isEnrolling?am:e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:e.mfa.isEnrolling?e.mfa:ae});case"totp/create_success":if(!e.mfa.isEnrolling||e.mfa.primaryInfo?.memberId!==t.memberId||e.mfa.primaryInfo?.organizationId!==t.organizationId)return e;return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{secret:t.response.secret,qrCode:t.response.qr_code,recoveryCodes:t.response.recovery_codes,method:e.mfa.totp.enrollment?.method??"qr"}}}};case"totp/show_code":{if(!e.mfa.isEnrolling||!e.mfa.totp.enrollment)return e;let r=t.method??e.mfa.totp.enrollment.method??"qr";return aF("manual"===r?ag:af,{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{...e.mfa.totp.enrollment,method:r}}}})}default:return e}})(e,t)}},aV={screen:at,screenHistory:[],formState:{emailState:{userSuppliedEmail:""},otpState:{codeExpiration:null},discoveryState:{email:"",discoveredOrganizations:[]},passwordState:{email:""},ssoDiscoveryState:{connections:[]}},flowState:{type:s.Organization,organization:null},mfa:ae,primary:{},error:{type:az,canGoBack:!1}},aW=rZ.createContext({client:{},config:{},state:[aV,()=>null]}),aG=({children:e,client:t,config:r,callbacks:n,initialState:a})=>{let o=rZ.useReducer(a$,a??aV);return rZ.createElement(aW.Provider,{value:{client:t,state:o,config:r,callbacks:n}},e)},aY=()=>n9(t2(aW).callbacks?.onError??n6),aZ=()=>n9(t2(aW).callbacks?.onEvent??n6),aJ=e=>{let t,r,n=!1,a=[],o={};return"string"==typeof e?r=e:(r=e.type,e.type===c.Google&&e.one_tap&&(n=e.one_tap,t=e.cancel_on_tap_outside),a=e.customScopes||[],o=e.providerParams||{}),{type:r,one_tap:n,customScopes:a,providerParams:o,cancel_on_tap_outside:t}};var aQ={exports:{}},aX={},a1=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(rJ),a0=(ed||(ed=1,ec||(ec=1,!function(){function e(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=a1.useState,n=a1.useEffect,a=a1.useLayoutEffect,o=a1.useDebugValue,i=!1,s=!1,l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(l,c){i||void 0===a1.startTransition||(i=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=c();if(!s){var u=c();t(d,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var h=(u=r({inst:{value:d,getSnapshot:c}}))[0].inst,m=u[1];return a(function(){h.value=d,h.getSnapshot=c,e(h)&&m({inst:h})},[l,d,c]),n(function(){return e(h)&&m({inst:h}),l(function(){e(h)&&m({inst:h})})},[l]),o(d),d};aX.useSyncExternalStore=void 0!==a1.useSyncExternalStore?a1.useSyncExternalStore:l,"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),aQ.exports=aX),aQ.exports);let a2=new WeakMap,a3={},a4={},a5=()=>{},a8=a5(),a6=Object,a7=e=>e===a8,a9=(e,t)=>({...e,...t}),oe="undefined",ot=typeof window!=oe,or=typeof document!=oe,on=(e,t)=>{let r=a2.get(e);return[()=>e.get(t)||a3,n=>{if(!a7(t)){let a=e.get(t);t in a4||(a4[t]=a),r[5](t,a9(a,n),a||a3)}},r[6],()=>!a7(t)&&t in a4?a4[t]:e.get(t)||a3]},oa=new WeakMap,oo=0,oi=e=>{let t,r,n=typeof e,a=e&&e.constructor,o=a==Date;if(a6(e)!==e||o||a==RegExp)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=oa.get(e))return t;if(t=++oo+"~",oa.set(e,t),a==Array){for(r=0,t="@";r<e.length;r++)t+=oi(e[r])+",";oa.set(e,t)}if(a==a6){t="#";let n=a6.keys(e).sort();for(;!a7(r=n.pop());)a7(e[r])||(t+=r+":"+oi(e[r])+",");oa.set(e,t)}}return t},os=!0,[ol,oc]=ot&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[a5,a5],od={initFocus:e=>(or&&document.addEventListener("visibilitychange",e),ol("focus",e),()=>{or&&document.removeEventListener("visibilitychange",e),oc("focus",e)}),initReconnect:e=>{let t=()=>{os=!0,e()},r=()=>{os=!1};return ol("online",t),ol("offline",r),()=>{oc("online",t),oc("offline",r)}}},ou=!rZ.useId,oh=!ot||"Deno"in window,om=oh?tZ:tJ,op="u">typeof navigator&&navigator.connection,o_=!oh&&op&&(["slow-2g","2g"].includes(op.effectiveType)||op.saveData),og=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?oi(e):"",t]},of=0,oy=()=>++of;async function ov(...e){let[t,r,n,a]=e,o=a9({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),i=o.populateCache,s=o.rollbackOnError,l=o.optimisticData,c=!1!==o.revalidate,d=o.throwOnError;if("function"==typeof r){let e=[],n=t.keys();for(let a=n.next();!a.done;a=n.next()){let n=a.value;!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n)}return Promise.all(e.map(u))}return u(r);async function u(r){let a,[o]=og(r);if(!o)return;let[u,h]=on(t,o),[m,p,_]=a2.get(t),g=m[o],f=()=>c&&(delete _[o],g&&g[0])?g[0](2).then(()=>u().data):u().data;if(e.length<3)return f();let y=n,v=oy();p[o]=[v,0];let b=!a7(l),w=u(),k=w.data,S=w._c,E=a7(S)?k:S;if(b&&h({data:l="function"==typeof l?l(E):l,_c:E}),"function"==typeof y)try{y=y(E)}catch(e){a=e}if(y&&"function"==typeof y.then){let e;if(y=await y.catch(e=>{a=e}),v!==p[o][0]){if(a)throw a;return y}a&&b&&(e=a,"function"==typeof s?s(e):!1!==s)&&(i=!0,h({data:y=E,_c:a8}))}i&&!a&&("function"==typeof i&&(y=i(y,E)),h({data:y,_c:a8})),p[o][1]=oy();let C=await f();if(h({_c:a8}),a){if(d)throw a;return}return i?C:y}}let ob=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},[ow,ok]=((e,t)=>{if(!a2.has(e)){let r=a9(od,t),n={},a=ov.bind(a8,e),o=a5,i={},s=(e,t)=>{let r=i[e]||[];return i[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let a=i[t];if(a)for(let e of a)e(r,n)},c=()=>{if(!a2.has(e)&&(a2.set(e,[n,{},{},{},a,l,s]),!oh)){let t=r.initFocus(setTimeout.bind(a8,ob.bind(a8,n,0))),a=r.initReconnect(setTimeout.bind(a8,ob.bind(a8,n,1)));o=()=>{t&&t(),a&&a(),a2.delete(e)}}};return c(),[e,a,c,o]}return[e,a2.get(e)[4]]})(new Map),oS=a9({onLoadingSlow:a5,onSuccess:a5,onError:a5,onErrorRetry:(e,t,r,n,a)=>{let o=r.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(a7(o)||!(i>o))&&setTimeout(n,s,a)},onDiscarded:a5,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:o_?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:o_?5e3:3e3,compare:(e,t)=>oi(e)==oi(t),isPaused:()=>!1,cache:ow,mutate:ok,fallback:{}},{isOnline:()=>os,isVisible:()=>{let e=or&&document.visibilityState;return a7(e)||"hidden"!==e}}),oE=tI({}),oC=ot&&window.__SWR_DEVTOOLS_USE__,oP=oC?window.__SWR_DEVTOOLS_USE__:[],oT=e=>"function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],oO=oP.concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let n=og(t)[0],[,,,a]=a2.get(ow),o=a[n];return o?(delete a[n],o):r(...e)});return e(t,a,n)});oC&&(window.__SWR_DEVTOOLS_REACT__=rZ);let oA={dedupe:!0};var ox=(r=(e,t,r)=>{let{cache:n,compare:a,suspense:o,fallbackData:i,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:h}=r,[m,p,_]=a2.get(n),[g,f]=og(e),y=tQ(!1),v=tQ(!1),b=tQ(g),w=tQ(t),k=tQ(r),S=()=>k.current.isVisible()&&k.current.isOnline(),[E,C,P,T]=on(n,g),O=tQ({}).current,A=a7(i)?r.fallback[g]:i,x=(e,t)=>{let r=!0;for(let n in O)"data"===n?!a(t[n],e[n])&&(a7(e[n])&&a(t[n],U)||(r=!1)):t[n]!==e[n]&&(r=!1);return r},D=t1(()=>{let e=!!g&&!!t&&(a7(s)?!k.current.isPaused()&&!o&&(!!a7(l)||l):s),r=t=>{let r=a9(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=E(),a=T(),i=r(n),c=n===a?i:r(a),d=i;return[()=>{let e=r(E());return x(e,d)?d:d=e},()=>c]},[n,g]),z=a0.useSyncExternalStore(t0(e=>P(g,(t,r)=>{x(r,t)||e()}),[n,g]),D[0],D[1]),M=!y.current,I=m[g]&&m[g].length>0,R=z.data,L=a7(R)?A:R,B=z.error,N=tQ(L),U=h?a7(R)?N.current:R:L,F=(!I||!!a7(B))&&(M&&!a7(s)?s:!k.current.isPaused()&&(o?!a7(L)&&l:a7(L)||l)),q=!!(g&&t&&M&&F),H=a7(z.isValidating)?q:z.isValidating,K=a7(z.isLoading)?q:z.isLoading,j=t0(async e=>{let t,n,o=w.current;if(!g||!o||v.current||k.current.isPaused())return!1;let i=!0,s=e||{},l=!_[g]||!s.dedupe,c=()=>ou?!v.current&&g===b.current&&y.current:g===b.current,d={isValidating:!1,isLoading:!1},u=()=>{C(d)},h=()=>{let e=_[g];e&&e[1]===n&&delete _[g]},P={isValidating:!0};a7(E().data)&&(P.isLoading=!0);try{if(l&&(C(P),r.loadingTimeout&&a7(E().data)&&setTimeout(()=>{i&&c()&&k.current.onLoadingSlow(g,r)},r.loadingTimeout),_[g]=[o(f),oy()]),[t,n]=_[g],t=await t,l&&setTimeout(h,r.dedupingInterval),!_[g]||_[g][1]!==n)return l&&c()&&k.current.onDiscarded(g),!1;d.error=a8;let e=p[g];if(!a7(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return u(),l&&c()&&k.current.onDiscarded(g),!1;let s=E().data;d.data=a(s,t)?s:t,l&&c()&&k.current.onSuccess(t,g,r)}catch(r){h();let e=k.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&c())&&(e.onError(r,g,e),(!0===t||"function"==typeof t&&t(r))&&S()&&e.onErrorRetry(r,g,e,e=>{let t=m[g];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))}return i=!1,u(),!0},[g,n]),$=t0((...e)=>ov(n,b.current,...e),[]);if(om(()=>{w.current=t,k.current=r,a7(R)||(N.current=R)}),om(()=>{var e;let t;if(!g)return;let r=j.bind(a8,oA),n=0,a=(e=(e,t={})=>{if(0==e){let e=Date.now();k.current.revalidateOnFocus&&e>n&&S()&&(n=e+k.current.focusThrottleInterval,r())}else if(1==e)k.current.revalidateOnReconnect&&S()&&r();else if(2==e)return j();else if(3==e)return j(t)},(t=m[g]||(m[g]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(v.current=!1,b.current=g,y.current=!0,C({_k:f}),F)if(a7(L)||oh)r();else ot&&typeof window.requestAnimationFrame!=oe?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{v.current=!0,a()}},[g]),om(()=>{let e;function t(){let t="function"==typeof c?c(L):c;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!E().error&&(d||k.current.isVisible())&&(u||k.current.isOnline())?j(oA).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[c,d,u,g]),t3(U),o&&a7(L)&&g){if(!ou&&oh)throw Error("Fallback data is required when using suspense in SSR.");throw w.current=t,k.current=r,v.current=!1,a7(B)?j(oA):B}return{mutate:$,get data(){return O.data=!0,U},get error(){return O.error=!0,B},get isValidating(){return O.isValidating=!0,H},get isLoading(){return O.isLoading=!0,K}}},function(...e){let t=a9(oS,t2(oE)),[n,a,o]=oT(e),i=((e,t)=>{let r=a9(e,t);if(t){let{use:n,fallback:a}=e,{use:o,fallback:i}=t;n&&o&&(r.use=n.concat(o)),a&&i&&(r.fallback=a9(a,i))}return r})(t,o),s=r,{use:l}=i,c=(l||[]).concat(oO);for(let e=c.length;e--;)s=c[e](s);return s(n,a||i.fetcher||null,i)}),oD=(n=()=>(e,t,r={})=>{var n;let a,o,i,s,l,{mutate:c}=a9(oS,t2(oE)),d=tQ(e),u=tQ(t),h=tQ(r),m=tQ(0),[p,_,g]=(n={data:a8,error:a8,isMutating:!1},a=tG({})[1],o=tQ(!1),i=tQ(n),s=tQ({data:!1,error:!1,isValidating:!1}),l=t0(e=>{let t=!1,r=i.current;for(let n in e)r[n]!==e[n]&&(r[n]=e[n],s.current[n]&&(t=!0));t&&!o.current&&(ou?a({}):rZ.startTransition(()=>a({})))},[]),om(()=>(o.current=!1,()=>{o.current=!0})),[i,s.current,l]),f=p.current,y=t0(async(e,t)=>{let[r,n]=og(d.current);if(!u.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!r)throw Error("Can’t trigger the mutation: missing key.");let a=a9(a9({populateCache:!1,throwOnError:!0},h.current),t),o=oy();m.current=o,g({isMutating:!0});try{let t=await c(r,u.current(n,{arg:e}),a9(a,{throwOnError:!0}));return m.current<=o&&(g({data:t,isMutating:!1,error:void 0}),null==a.onSuccess||a.onSuccess(t,r,a)),t}catch(e){if(m.current<=o&&(g({error:e,isMutating:!1}),null==a.onError||a.onError(e,r,a),a.throwOnError))throw e}},[]),v=t0(()=>{m.current=oy(),g({data:a8,error:a8,isMutating:!1})},[]);return om(()=>{d.current=e,u.current=t,h.current=r}),{trigger:y,reset:v,get data(){return _.data=!0,f.data},get error(){return _.error=!0,f.error},get isMutating(){return _.isMutating=!0,f.isMutating}}},(...e)=>{let[t,r,a]=oT(e),o=(a.use||[]).concat(n);return ox(t,r,{...a,use:o})});let oz={"stytch.magicLinks.authenticate":eu.B2BMagicLinkAuthenticate,"stytch.sso.authenticate":eu.B2BSSOAuthenticate,"stytch.sso.discoverConnections":eu.B2BSSODiscoverConnections,"stytch.magicLinks.discovery.authenticate":eu.B2BMagicLinkDiscoveryAuthenticate,"stytch.discovery.organizations.create":eu.B2BDiscoveryOrganizationsCreate,"stytch.discovery.intermediateSessions.exchange":eu.B2BDiscoveryIntermediateSessionExchange,"stytch.magicLinks.email.loginOrSignup":eu.B2BMagicLinkEmailLoginOrSignup,"stytch.magicLinks.email.discovery.send":eu.B2BMagicLinkEmailDiscoverySend,"stytch.oauth.authenticate":eu.B2BOAuthAuthenticate,"stytch.oauth.discovery.authenticate":eu.B2BOAuthDiscoveryAuthenticate,"stytch.otps.sms.send":eu.B2BSMSOTPSend,"stytch.otps.sms.authenticate":eu.B2BSMSOTPAuthenticate,"stytch.totp.create":eu.B2BTOTPCreate,"stytch.totp.authenticate":eu.B2BTOTPAuthenticate,"stytch.recoveryCodes.recover":eu.B2BRecoveryCodesRecover,"stytch.impersonation.authenticate":eu.B2BImpersonationAuthenticate,"stytch.otps.email.authenticate":eu.B2BOTPsEmailAuthenticate,"stytch.otps.email.discovery.authenticate":eu.B2BOTPsEmailDiscoveryAuthenticate,"stytch.otps.email.discovery.send":eu.B2BOTPsEmailDiscoverySend,"stytch.otps.email.loginOrSignup":eu.B2BOTPsEmailLoginOrSignup,"stytch.organization.getBySlug":eu.B2BOrganizationsGetBySlug},oM=(e,t,r={})=>{let n=aZ(),a=aY(),o=oD(e,t,{throwOnError:!1,...r,onSuccess:(e,t,a)=>{let o=oz[t];o&&n({type:o,data:e}),r.onSuccess?.(e,t,a)},onError:(e,t,n)=>{a(e),r.onError?.(e,t,n)}});return o.isMutating?{...o,error:void 0}:o},oI=()=>{let e=t2(aW).client,[t,r]=tG(r1(e).bootstrap.getSync());return tZ(()=>{r1(e).bootstrap.getAsync().then(e=>{r(e)})},[e]),t},oR=(e,t,r)=>{t({type:"primary_authenticate_success",response:e,includedMfaMethods:r.mfaProductInclude})},oL=(e,t)=>{t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})};function oB(e,t){return e.some(e=>e.id===t)}function oN({products:e,organizationProducts:t},r){return t1(()=>{let n={};for(let a of[...e,...t])a[r]&&Object.assign(n,a[r]);return n},[e,t,r])}let oU=()=>{let e=t2(aW).config;return t1(()=>{let t=e.oauthOptions?aJ(e.oauthOptions?.providers[0]):void 0,r=t?.type===c.Google&&t?.one_tap===!0;return 1===e.products.length&&oB(e.products,"oauth")&&e.oauthOptions?.providers.length===1&&r},[e])},oF=(e,t)=>`stytch_sdk_state_${e}${t?`::${t}`:""}`;function oq(e){return null==e?{getItem:()=>null,removeItem(){},setItem(){}}:{getItem(t,r){let n=oF(t,r);try{return e.getItem(n)}catch{return null}},setItem(t,r,n){let a=oF(t,r);try{n&&e.setItem(a,n)}catch{}},removeItem(t,r){let n=oF(t,r);try{e.removeItem(n)}catch{}}}}let oH=oq(globalThis.localStorage),oK=oq(globalThis.sessionStorage);function oj(e,t){return{getItem:r=>e.getItem(t,r),setItem(r,n){e.setItem(t,r,n)},removeItem(r){e.removeItem(t,r)}}}function o$(){let{publicToken:e}=r1(t2(aW).client);return[t1(()=>oH.getItem(e,"b2b_last_used_method"),[e]),t=>{oH.setItem(e,"b2b_last_used_method",t)}]}nW(".Button_module_button__fba1165e{align-items:center;border:1px solid;border-radius:var(--st-button-radius);box-shadow:var(--st-shadow-button);display:flex;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);gap:var(--st-spacing-2);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);transition:background-color var(--st-transition-duration) ease-in-out,border-color var(--st-transition-duration) ease-in-out}.-st-mobile .Button_module_button__fba1165e{padding:var(--st-spacing-3)}.Button_module_button__fba1165e:focus-visible{box-shadow:var(--st-shadow-button),var(--st-focus-ring-shadow)}.Button_module_button__fba1165e:not(:disabled){cursor:pointer}.Button_module_button__fba1165e:disabled{opacity:.5}.Button_module_block__fba1165e{justify-content:center;width:100%}.Button_module_primary__fba1165e{background-color:var(--st-primary);border-color:var(--st-primary);color:var(--st-primary-foreground)}.Button_module_primary__fba1165e:not(:disabled):hover{background-color:var(--st-primary-button-hover);border-color:var(--st-primary-button-hover)}.Button_module_secondary__fba1165e{background-color:var(--st-secondary);border-color:var(--st-secondary);color:var(--st-secondary-foreground)}.Button_module_secondary__fba1165e:not(:disabled):hover{background-color:var(--st-secondary-button-hover);border-color:var(--st-secondary-button-hover)}.Button_module_outline__fba1165e{background-color:var(--st-background);border:1px solid var(--st-border);color:var(--st-foreground)}.Button_module_outline__fba1165e:not(:disabled):hover{background-color:var(--st-accent);color:var(--st-accent-foreground)}.Button_module_outline__fba1165e:focus-visible{border-color:var(--st-ring)}.Button_module_ghost__fba1165e{background-color:var(--st-background);border:1px solid var(--st-background);box-shadow:none;color:var(--st-foreground)}.Button_module_ghost__fba1165e:not(:disabled):hover{background-color:var(--st-accent);border-color:var(--st-background);color:var(--st-accent-foreground)}.Button_module_ghost__fba1165e:focus-visible{box-shadow:var(--st-focus-ring-shadow)}.Button_module_destructive__fba1165e{background-color:var(--st-destructive);border-color:var(--st-destructive);color:var(--st-destructive-foreground)}.Button_module_destructive__fba1165e:not(:disabled):hover{background-color:var(--st-destructive-button-hover);border-color:var(--st-destructive-button-hover)}");var oV={button:"Button_module_button__fba1165e inputBase_module_focusRing__06c14ae4",block:"Button_module_block__fba1165e",primary:"Button_module_primary__fba1165e",secondary:"Button_module_secondary__fba1165e",outline:"Button_module_outline__fba1165e",ghost:"Button_module_ghost__fba1165e",destructive:"Button_module_destructive__fba1165e"};nW("@keyframes CircularProgress_module_circularRotate__c4a435cb{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes CircularProgress_module_circularDash__c4a435cb{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:1px,200px;stroke-dashoffset:-126px}}.CircularProgress_module_root__c4a435cb{animation:CircularProgress_module_circularRotate__c4a435cb 1.4s linear infinite}.CircularProgress_module_svg__c4a435cb{display:block}.CircularProgress_module_animatedCircle__c4a435cb{animation:CircularProgress_module_circularDash__c4a435cb 1.4s ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px,200px;stroke-dashoffset:0}");let oW=({size:e,label:t,thickness:r=3.6})=>{let{i18n:n,_:a}=nO();return rZ.createElement("div",{className:"CircularProgress_module_root__c4a435cb",style:{width:e,height:e}},rZ.createElement("svg",{className:"CircularProgress_module_svg__c4a435cb",viewBox:"22 22 44 44","aria-label":t??n._({id:"loading.label",message:"Loading"})},rZ.createElement("circle",{className:"CircularProgress_module_animatedCircle__c4a435cb",cx:44,cy:44,r:(44-r)/2,fill:"none",strokeWidth:r})))};function oG({variant:e,block:t=!0}){return nj(oV.button,oV[e],{[oV.block]:t})}let oY=e=>{let{as:t,children:r,icon:n,onClick:a,loading:o,disabled:i=o,block:s,variant:l,...c}=e,d=rZ.createElement(rZ.Fragment,null,n,rZ.createElement("span",null,r));return o&&(d=rZ.createElement(oW,{size:20})),rZ.createElement(t,{className:oG(e),onClick:a,disabled:i,...c},d)},oZ=e=>oY({type:"button",as:"button",...e}),oJ=e=>oY({...e,onKeyDown:t=>{e.onKeyDown?.(t),t.defaultPrevented||" "===t.key&&t.currentTarget.click()},as:"a"}),oQ={[c.Google]:{messageDescriptor:{id:"oauth.continueWithGoogle",message:"Continue with Google"}},[c.Microsoft]:{messageDescriptor:{id:"oauth.continueWithMicrosoft",message:"Continue with Microsoft"}},[c.HubSpot]:{messageDescriptor:{id:"oauth.continueWithHubSpot",message:"Continue with HubSpot"}},[c.Slack]:{messageDescriptor:{id:"oauth.continueWithSlack",message:"Continue with Slack"}},[c.GitHub]:{messageDescriptor:{id:"oauth.continueWithGitHub",message:"Continue with GitHub"}}},oX=({providerType:e,loginRedirectUrl:t,signupRedirectUrl:r,discoveryRedirectUrl:n,customScopes:a,providerParams:o,onSuccess:i})=>{let{i18n:s,_:l}=nO(),c=t2(aW).client,[d]=t2(aW).state,u=t2(nq),h=u.iconRegistry,m=nH(`oauth-${e}`,u.options),p=oQ[e],_=e,g=null;if(p){let{messageDescriptor:t}=p,r=h[e];_=s._(t),g=rZ.createElement(r,null)}let f=async()=>{let s=c.oauth[e];d.flowState.organization?await s.start({login_redirect_url:t,signup_redirect_url:r,custom_scopes:a,organization_id:d.flowState.organization.organization_id,provider_params:o}):await s.discovery.start({discovery_redirect_url:n,custom_scopes:a,provider_params:o}),i?.()};return rZ.createElement(oZ,{onClick:f,variant:"outline",icon:g,id:m},_)},o1=({customScopes:e,providerParams:t,cancelOnTapOutside:r})=>{let n,a=t2(aW).client,o=t2(aW).config,i=oU(),[s,l]=tG(),d=(n=tQ(!1),tZ(()=>(n.current=!0,()=>{n.current=!1}),[]),n),[u,h]=t2(aW).state,[m,p]=o$(),_=t0(async()=>{let e,{oneTap:t}=r1(a),n=await t.createOneTapClient();if(!n.success)return void("oauth_config_not_found"===n.reason?l(n2):"default_provider_not_allowed"===n.reason?l(n3):eP("Unable to load One Tap settings for project",n));let{client:i}=n;if(!d.current)return;e=u.flowState.organization?t.createOnSuccessHandler({organizationId:u.flowState.organization.organization_id,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})}):t.createOnDiscoverySuccessHandler({discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})});let s=await i.render({callback:e,style:{position:er.floating},cancelOnTapOutside:r});return d.current?(s.success||("unregistered_origin"===s.reason&&l(n1),"invalid_client"===s.reason&&l(n0),eP("Unable to render One Tap prompt",s)),i):void i.cancel()},[a,d,u.flowState.organization,o.oauthOptions?.signupRedirectURL,o.oauthOptions?.loginRedirectURL,o.oauthOptions?.discoveryRedirectURL,h,r]);if(tZ(()=>{let e;return _().then(t=>e=t).catch(e=>{eP("Unable to render One Tap prompt",e)}),()=>e?.cancel()},[_]),i)return null;let g=rZ.createElement(oX,{providerType:c.Google,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,customScopes:e,providerParams:t,onSuccess:()=>p(c.Google)}),f=m===c.Google?rZ.createElement(nQ,null,g):g;return s?rZ.createElement(rZ.Fragment,null,rZ.createElement(n4,{error:s}),f):f};nW(".logo_module_darkInvert__4ffe6ba9{filter:invert(var(--st-dark-mode,0))}");var o0="logo_module_darkInvert__4ffe6ba9";let o2=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#4285F4",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#34A853",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#FBBC05",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#EA4335",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),o3=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#F35325",d:"M1 1h8.57v8.57H1z"}),tm("path",{fill:"#81BC06",d:"M10.43 1H19v8.57h-8.57z"}),tm("path",{fill:"#05A6F0",d:"M1 10.43h8.57V19H1z"}),tm("path",{fill:"#FFBA08",d:"M10.43 10.43H19V19h-8.57z"})),o4={gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#C5221F",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09"}),tm("path",{fill:"#FBBC04",d:"m14.9 4.48-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#4285F4",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22"}),tm("path",{fill:"#34A853",d:"M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8z"}),tm("path",{fill:"#EA4335",d:"M10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{clipPath:"url(#a)"},tm("path",{fill:"#158FDA",d:"M6.58 17.2h10.25c1.2 0 2.17-.97 2.17-2.17V7.7c0-.64-.32-1.22-.87-1.54L12.77 3.1c-.72-.4-1.6-.4-2.3 0L4.39 6.6V15c0 1.21.98 2.2 2.2 2.2"}),tm("path",{fill:"url(#b)",d:"M8.61 15.82c.06-.66.48-1.24 1.09-1.5 0 0 5.55-3.11 8.3-4.73.85-.5 1-1.5 1-1.5V15a2.2 2.2 0 0 1-2.2 2.2h-6.65c-.8 0-1.46-.6-1.54-1.4"}),tm("path",{fill:"#01459B",d:"m17.83 5.96-9.55 5.27 1.9 1.16c.71.42 1.74.66 2.46.25l5.08-2.85A2.3 2.3 0 0 0 19 7.69c0-1.1-.76-1.47-1.17-1.73"}),tm("path",{fill:"#26AEE9",d:"M11.67 2.81q-.63 0-1.21.32L2.4 7.68l3.06 1.85 9.37-5.28-1.95-1.11q-.57-.33-1.2-.33"}),tm("path",{fill:"#0078D3",d:"M14.83 4.25 5.46 9.53l3.06 1.86 9.56-5.27-.25-.16z"}),tm("path",{fill:"url(#c)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"}),tm("g",{filter:"url(#d)"},tm("path",{fill:"url(#e)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"})),tm("path",{fill:"#fff",d:"M3.46 8.58q.28-.6.84-.94.64-.36 1.36-.36.69-.02 1.27.3.56.3.85.87.32.6.32 1.3.02.7-.28 1.36a2.2 2.2 0 0 1-1.1 1.06q-.52.21-1.05.21-.7.03-1.3-.3-.57-.3-.86-.87-.32-.6-.32-1.28-.02-.7.27-1.35m.95 2.15q.16.37.5.6t.75.21q.45 0 .8-.24.33-.24.47-.62.15-.41.13-.85 0-.44-.15-.85a1.4 1.4 0 0 0-.47-.63 1.3 1.3 0 0 0-.8-.23 1.3 1.3 0 0 0-1.25.86c-.22.57-.2 1.2.02 1.75"})),tm("defs",null,tm("linearGradient",{id:"b",x1:12.02,x2:19,y1:15.58,y2:12.64,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#4DE2FB"}),tm("stop",{offset:1,stopColor:"#28AEE8"})),tm("linearGradient",{id:"c",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("linearGradient",{id:"e",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M0 0h20v20H0z"})),tm("filter",{id:"d",width:53.58,height:53.4,x:-15.16,y:-10.87,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},tm("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),tm("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),tm("feOffset",{dx:6,dy:6}),tm("feGaussianBlur",{stdDeviation:11.14}),tm("feComposite",{in2:"hardAlpha",operator:"out"}),tm("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.38 0"}),tm("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_893_1954"}),tm("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_893_1954",result:"shape"})))),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#5F01D2",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"}))},o5=20,o8=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("path",{d:"M9.09 7.91L13.67 12.5L9.09 17.09L10.5 18.5L16.5 12.5L10.5 6.5L9.09 7.91Z",fill:"currentColor"})),o6=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("g",{clipPath:"url(#clip0_221_1596)"},rZ.createElement("path",{d:"M17.5125 10.53C17.0025 7.9425 14.73 6 12 6C9.8325 6 7.95 7.23 7.0125 9.03C4.755 9.27 3 11.1825 3 13.5C3 15.9825 5.0175 18 7.5 18H17.25C19.32 18 21 16.32 21 14.25C21 12.27 19.4625 10.665 17.5125 10.53Z",fill:"currentColor"})),rZ.createElement("g",{clipPath:"url(#clip1_221_1596)"},rZ.createElement("path",{d:"M15.9684 13.1139L14.9987 14.0933L14.5152 13.6098L14.2501 13.3446L13.9849 13.6098L13.5001 14.0946L13.0152 13.6098L12.9054 13.4999H12.7501H12.6188H12.3532L12.2651 13.7504C12.0087 14.4788 11.3147 14.9999 10.5001 14.9999C9.46592 14.9999 8.62506 14.1591 8.62506 13.1249C8.62506 12.0908 9.46592 11.2499 10.5001 11.2499C11.3147 11.2499 12.0087 11.7711 12.2651 12.4994L12.3532 12.7499H12.6188H15.5969L15.9684 13.1139ZM9.00006 13.1249C9.00006 13.9508 9.6742 14.6249 10.5001 14.6249C11.3259 14.6249 12.0001 13.9508 12.0001 13.1249C12.0001 12.2991 11.3259 11.6249 10.5001 11.6249C9.6742 11.6249 9.00006 12.2991 9.00006 13.1249Z",fill:"var(--st-background)",stroke:"var(--st-background)",strokeWidth:"0.75"})),rZ.createElement("defs",null,rZ.createElement("clipPath",{id:"clip0_221_1596"},rZ.createElement("rect",{width:"18",height:"18",transform:"translate(3 3)"})),rZ.createElement("clipPath",{id:"clip1_221_1596"},rZ.createElement("rect",{width:"8.25",height:"6",transform:"translate(8.25006 10.1251)"})))),o7={"google-workspace":"google","microsoft-entra":"microsoft",okta:"okta"},o9=({connection:e,onStart:t})=>{let{i18n:r,_:n}=nO(),a=t2(aW).client,{ssoOptions:o}=t2(aW).config,{iconRegistry:i,options:s}=t2(nq),{connection_id:l,display_name:c,identity_provider:d}=e,u=nH(`sso-${c}`,s),h=i[o7[d]]??o6;return rZ.createElement(oZ,{variant:"outline",onClick:()=>a.sso.start({connection_id:l,signup_redirect_url:o?.signupRedirectURL,login_redirect_url:o?.loginRedirectURL}).then(()=>{t?.(e)}),icon:rZ.createElement(h,null),id:u},r._({id:"provider.continueWith",message:"Continue with {display_name}",values:{display_name:c}}))};function ie(){let[e,t]=tG(0);return{expiration:e,start:e=>{t(Date.now()+1e3*e)},clear:()=>{t(0)}}}let it=e=>Math.max(0,Math.ceil((e-Date.now())/1e3)),ir=e=>{let[t,r]=tG(()=>it(e)),n=t<=0;return tZ(()=>{let t=()=>r(it(e));if(t(),Date.now()>=e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[n,e]),[t,!n]},ia=()=>{let e;return(e="u">typeof window&&window)&&(/Chromatic/.test(e.navigator.userAgent)||/chromatic=true/.test(e.location.href))?"chromatic-ignore":void 0};nW(".VerticalTransition_module_container__9366f503{display:grid;overflow:clip;width:fit-content}.VerticalTransition_module_primary__9366f503,.VerticalTransition_module_secondary__9366f503{grid-area:1/1/2/2;transition:translate var(--st-transition-duration) ease-in-out}.VerticalTransition_module_secondary__9366f503{translate:0 100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_primary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_primary__9366f503{translate:0 -100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_secondary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_secondary__9366f503{translate:0 0}");function io(e){let[t,r]=tG(!1);return tZ(()=>{if(!t||!e)return;let n=setTimeout(()=>r(!1),1e3*e);return()=>clearTimeout(n)},[t,e]),[t,r]}let ii=({primary:e,secondary:t,rootClassName:r,className:n,trigger:a="manual",triggered:o})=>rZ.createElement("div",{className:nj(r,"VerticalTransition_module_container__9366f503",{VerticalTransition_module_triggered__9366f503:o,VerticalTransition_module_canTriggerByHover__9366f503:"hover"===a}),"aria-live":"manual"===a?"polite":void 0},rZ.createElement("div",{className:nj(n,"VerticalTransition_module_primary__9366f503"),"aria-hidden":"manual"===a?o:void 0},e),rZ.createElement("div",{className:nj(n,"VerticalTransition_module_secondary__9366f503"),"aria-hidden":"manual"===a?!o:void 0},t)),is=e=>{if(e&&"object"==typeof e&&"error_type"in e&&"string"==typeof e.error_type)return e.error_type},il={invalid_email:{id:"error.invalidEmail",message:"Email format is invalid."},invalid_phone_number:{id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:"error.unsubscribedPhoneNumber",message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:"error.inactiveEmail",message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:"error.unauthorizedCredentials",message:"Unauthorized credentials."},user_unauthenticated:{id:"error.userUnauthenticated",message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:"error.emailNotFound",message:"Email not found."},unable_to_auth_magic_link:{id:"error.unableToAuthMagicLink",message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:"error.noUserPassword",message:"Password not found for this user. Please try again."},breached_password:{id:"error.breachedPassword",message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:"error.resetPassword",message:"Password must be reset."},oauth_token_not_found:{id:"error.oauthTokenNotFound",message:"OAuth Token could not be found."},invalid_code:{id:"error.invalidCode",message:"Code format is invalid, please try again."},member_password_not_found:{id:"error.memberPasswordNotFound",message:"Member password not found."},oauth_flow_callback_error:{id:"error.oauthFlowCallbackError",message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:"error.unauthorizedAction",message:"Unauthorized action."},user_lock_limit_reached:{id:"error.userLockLimitReached",message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:"error.invalidSessionToken",message:"Invalid session token."},session_not_found:{id:"error.sessionNotFound",message:"Session not found."},invalid_phone_number_country_code:{id:"error.invalidPhoneNumberCountryCode",message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:"error.otpCodeNotFound",message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:"error.duplicatePhoneNumber",message:"A member with the specified phone number already exists for this organization."}},ic=(e,t)=>{let r=il[is(e)];return r?t(r):e.error_message};nW(".Column_module_column__efe9ce44{display:flex;flex-direction:column}");let id=rs(({as:e="div",gap:t,className:r,style:n,...a},o)=>{let i={...n};return null!=t&&(i.gap=1===t?"var(--st-spacing)":`var(--st-spacing-${t})`),rZ.createElement(e,{ref:o,className:nj(r,"Column_module_column__efe9ce44"),style:i,...a})});function iu(e){var t;let r;return Number.isNaN(r=parseFloat(t=window.getComputedStyle(e).getPropertyValue("--st-transition-duration")))?0:t.endsWith("ms")?r:1e3*r}nW(".Toast_module_container__ac93617f{bottom:10vh;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0}.Toast_module_toast__ac93617f{background:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-md);box-shadow:0 2px 4px rgba(0,0,0,.05);color:var(--st-destructive);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);pointer-events:auto;position:absolute;top:0;white-space:pre}");let ih=[];function im(e){for(let t of ih)t(e)}let ip={opacity:0,translate:"0 var(--st-spacing-2)"},i_={opacity:1,translate:"0"};function ig(e,t){e.animate([i_,ip],{duration:t,easing:"ease-in-out"}).addEventListener("finish",()=>e.remove())}let iy=()=>{let e=tQ(null),t=tQ(),r=tQ();return tZ(()=>{let n=n=>{if(!e.current)return;let a=2*iu(e.current),o=document.createElement("div");o.textContent=n.message,o.className="Toast_module_toast__ac93617f",t.current&&ig(t.current,a),e.current.appendChild(o),t.current=o,o.animate([ip,i_],{duration:a,easing:"ease-in-out"}),r.current=window.setTimeout(()=>{t.current&&(ig(t.current,a),t.current=void 0)},n.durationMs??1e4)};return ih.push(n),()=>{clearTimeout(r.current);let e=ih.indexOf(n);-1!==e&&ih.splice(e,1)}},[]),rZ.createElement("div",{className:"Toast_module_container__ac93617f",ref:e,"aria-live":"polite"})};nW(".Divider_module_container__1fb7194e{align-items:center;display:flex;gap:var(--st-spacing-2);line-height:var(--st-line-height-xs)}.Divider_module_bar__1fb7194e{border-bottom:1px solid var(--st-divider-color);flex:1 1 auto}");var iv="Divider_module_bar__1fb7194e";let ib=()=>{let{i18n:e,_:t}=nO();return rZ.createElement("div",{role:"separator",className:"Divider_module_container__1fb7194e"},rZ.createElement("div",{className:iv}),rZ.createElement(nZ,{variant:"helper"},e._({id:"methodDivider.text",message:"or"})),rZ.createElement("div",{className:iv}))},iw=e=>"children"in e?rZ.createElement(id,{gap:2},e.children):rZ.createElement(id,{gap:4},e.top&&rZ.createElement(iw,null,e.top),rZ.createElement(ib,null),rZ.createElement(iw,null,e.bottom)),ik=({header:e,description:t,children:r,additionalActions:n,resend:a,sendMagicLink:o,goBack:i})=>{let{i18n:s,_:l}=nO(),[c,d]=tG(!1),[u,h]=tG(!1),m=ie(),[p,_]=ir(m.expiration),g=a&&rZ.createElement(oZ,{variant:"outline",onClick:async()=>{d(!0);try{await a(),m.start(15)}catch(e){im({message:ic(e,l)}),m.clear()}finally{d(!1)}},loading:c,disabled:c||_},rZ.createElement(ii,{className:ia(),triggered:_,primary:s._({id:"button.resendEmail",message:"Resend email"}),secondary:s._({id:"button.emailResent",message:"Email resent! Try again in {timeRemaining}s",values:{timeRemaining:p}})})),f=i&&rZ.createElement(oZ,{variant:"ghost",onClick:i},s._({id:"button.goBack",message:"Go back"})),y=o?rZ.createElement(iw,{top:rZ.createElement(rZ.Fragment,null,n,g),bottom:rZ.createElement(rZ.Fragment,null,rZ.createElement(oZ,{variant:"outline",onClick:()=>{h(!0),o().catch(()=>h(!1))},loading:u},s._({id:"button.loginWithoutPassword",message:"Log in without a password"})),f)}):rZ.createElement(iw,null,n,g,f);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e),rZ.createElement(nZ,null,t),r,y)},iS={messageDescriptor:{id:"link.openInGmail",message:"Open in Gmail"},icon:"gmail",getUrl:e=>{let t=encodeURIComponent(e?`from:@${e} in:anywhere`:"in:anywhere");return`https://mail.google.com/mail/u/0/#search/${t}`}},iE={messageDescriptor:{id:"link.openInYahoo",message:"Open in Yahoo"},icon:"yahoo",getUrl:e=>e?`https://mail.yahoo.com/d/search/keyword=${e}`:"https://mail.yahoo.com/d/search/referrer=unread"},iC={messageDescriptor:{id:"link.openInOutlook",message:"Open in Outlook"},icon:"outlook",getUrl:()=>"https://outlook.office.com/mail/0/inbox"},iP=({providerInfo:{icon:e,messageDescriptor:t,getUrl:r},emailDomain:n})=>{let{i18n:a,_:o}=nO(),i=r(n),{iconRegistry:s}=t2(nq),l=s[e];return rZ.createElement(oJ,{variant:"outline",href:i,target:"_blank",rel:"noopener noreferrer",icon:rZ.createElement(l,null)},a._(t))},iT=({emailDomain:e,email:t,goBack:r,resend:n,countdown:a,isSubmitting:o})=>{let{i18n:i,_:s}=nO(),[l,c]=ir(a?.expiration??0);return rZ.createElement(ik,{header:i._({id:"emailConfirmation.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:t}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:e,providerInfo:iS}),rZ.createElement(iP,{emailDomain:e,providerInfo:iE}),rZ.createElement(iP,{emailDomain:e,providerInfo:iC}),n&&a&&rZ.createElement(oZ,{variant:"outline",disabled:o||c,onClick:()=>{a.start(15),n().catch(()=>a.clear())}},rZ.createElement(ii,{className:ia(),primary:i._({id:"button.resendEmail",message:"Resend email"}),secondary:i._({id:"emailConfirmation.emailSent",message:"Email sent! Try again in {timeRemaining}s",values:{timeRemaining:l}}),triggered:c})),r&&rZ.createElement(oZ,{variant:"ghost",onClick:r},i._({id:"button.goBack",message:"Go back"})))})},iO=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.discovery.send",(e,{arg:{email:n}})=>t.magicLinks.email.discovery.send({email_address:n,discovery_redirect_url:r.emailMagicLinksOptions?.discoveryRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})}})},iA=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.loginOrSignup",(e,{arg:{email:n,organization_id:a}})=>t.magicLinks.email.loginOrSignup({email_address:n,organization_id:a,login_redirect_url:r.emailMagicLinksOptions?.loginRedirectURL,signup_redirect_url:r.emailMagicLinksOptions?.signupRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})},onError:e=>{eP(e)}})},ix=()=>{let e=t2(aW).client,t=t2(aW).config,[r,n]=tG(()=>{let{emailDomains:t}=r1(e).bootstrap.getSync();return t});return(tZ(()=>{r1(e).bootstrap.getAsync().then(({emailDomains:e})=>{n(e)})},[e]),t.emailMagicLinksOptions?.domainHint)?t.emailMagicLinksOptions?.domainHint:1===r.length?r[0]:null},iD=()=>{let[e,t]=t2(aW).state,r=ix(),n=ie(),{trigger:a,isMutating:o}=iA(),{trigger:i,isMutating:l}=iO(),c=e.formState.emailState.userSuppliedEmail,d=async()=>{e.flowState.type===s.Discovery?await i({email:c}):e.flowState.type===s.Organization&&e.flowState.organization&&await a({email:c,organization_id:e.flowState.organization.organization_id})};return rZ.createElement(iT,{emailDomain:r,email:c,goBack:()=>{t({type:"set_user_supplied_email",email:""}),t({type:"transition",screen:at})},resend:d,countdown:n,isSubmitting:o||l})},iz={"data-1p-ignore":!0},iM=(e="s")=>e+tQ(((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""))()).current;nW(".VisuallyHidden_module_hidden__c5a4c7ad,:not(:focus):not(:focus-within) .VisuallyHidden_module_focusable__c5a4c7ad{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap;word-wrap:normal}");let iI=({children:e,focusable:t})=>rZ.createElement("div",{className:nj(t?"VisuallyHidden_module_focusable__c5a4c7ad":"VisuallyHidden_module_hidden__c5a4c7ad")},e),iR=e=>{let t=tQ(e);tZ(()=>t.current(),[])},iL=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g,iB=({children:e,...t})=>{let r=t1(()=>(e=>{let t=e.split(iL),r=Array.from(e.matchAll(iL)).map(e=>e[0]),n=[];for(;t.length||r.length;)if(t.length&&n.push(t.shift()),r.length){let e=r.shift();n.push(rZ.createElement("a",{key:e+"__"+String(r.length),href:e,target:"_blank",rel:"noreferrer"},e))}return n})(e),[e]),[n,a]=tG(!1);return iR(()=>a(!0)),rZ.createElement("div",{"aria-live":"polite"},n&&rZ.createElement(nZ,{...t,variant:"helper",color:"destructive",key:e},r))};nW(".Input_module_label__a0aad2f4{color:var(--st-foreground);display:block;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-sm);margin-bottom:var(--st-spacing-0_5);width:fit-content}.Input_module_input__a0aad2f4{padding:var(--st-spacing-2) var(--st-spacing-3);width:100%}.-st-mobile .Input_module_input__a0aad2f4{padding:var(--st-spacing-3)}.Input_module_input__a0aad2f4:disabled{color:var(--st-muted-foreground)}.Input_module_input__a0aad2f4::placeholder{color:var(--st-muted-foreground)}.Input_module_inputWrapper__a0aad2f4{display:flex;position:relative}.Input_module_action__a0aad2f4{inset-inline-end:var(--st-spacing-2);position:absolute;scale:.75;transform-origin:center right}[dir=rtl] .Input_module_action__a0aad2f4{transform-origin:center left}.Input_module_action__a0aad2f4:dir(rtl){transform-origin:center left}.Input_module_error__a0aad2f4{margin-top:var(--st-spacing-2)}");let iN=rs(({className:e,label:t,hideLabel:r,action:n,id:a,containerClassName:o,error:i,...s},l)=>{let c=t2(nq),d=a+(c.options?.inputIdSuffix??""),u=iM(),h=tQ(null),[m,p]=tG();tJ(()=>{h.current&&p(h.current.getBoundingClientRect().width)},[n]);let _=rZ.createElement("label",{className:"Input_module_label__a0aad2f4",htmlFor:d},t);return i&&(s["aria-invalid"]=!0,s["aria-errormessage"]=u),rZ.createElement("div",{className:nj(o,"Input_module_container__a0aad2f4")},r?rZ.createElement(iI,null,_):_,rZ.createElement("div",{className:"Input_module_inputWrapper__a0aad2f4"},rZ.createElement("input",{ref:l,id:d,className:nj(e,"Input_module_input__a0aad2f4 inputBase_module_inputBase__06c14ae4 inputBase_module_focusRing__06c14ae4"),style:m?{paddingInlineEnd:`calc(${m}px + var(--st-spacing-4))`}:void 0,...s}),n&&rZ.createElement("div",{ref:h,className:"Input_module_action__a0aad2f4"},n)),i&&rZ.createElement(iB,{id:u,className:"Input_module_error__a0aad2f4","aria-live":"polite"},i))}),iU=({email:e,setEmail:t,hasPasskeys:r=!1,...n})=>{let{i18n:a,_:o}=nO();return rZ.createElement(iN,{id:"email-input",label:a._({id:"formField.email.label",message:"Email"}),placeholder:a._({id:"formField.email.placeholder",message:"example@email.com"}),type:"email",autoComplete:r?"username webauthn":"email",value:e,onChange:e=>t(e.target.value),required:!0,...r?iz:{},...n})},iF=({email:e})=>{let[,t]=t2(aW).state,{i18n:r,_:n}=nO();return rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"use_password_auth",email:e})}},r._({id:"button.usePassword",message:"Use a password instead"}))},iq={oauth:void 0,sso:"sso",emailMagicLinks:"magic_link",emailOtp:"email_otp",passwords:"password"},iH={[c.Google]:"google_oauth",[c.Microsoft]:"microsoft_oauth",[c.HubSpot]:"hubspot_oauth",[c.Slack]:"slack_oauth",[c.GitHub]:"github_oauth"},iK=Object.fromEntries(Object.entries(iq).map(([e,t])=>[t,e])),ij=Object.fromEntries(Object.entries(iH).map(([e,t])=>[t,e])),i$=e=>e in ij?"oauth":iK[e],iV=Object.values(c),iW=(e,t)=>e.flatMap(e=>{if("oauth"===e.id)return t.map(e=>{let t=iH["string"==typeof e?e:e.type];if(t)return t});{let t=iq[e.id];if(t)return t}}).filter(aN),iG=()=>{let e,[t]=t2(aW).state,r=t2(aW).config,{restrictedAuthMethods:n,hasPrimaryAuthMethods:a}=(()=>{let[e]=t2(aW).state,{primaryAuthMethods:t}=e.primary;return{restrictedAuthMethods:t1(()=>e.primary.primaryAuthMethods?new Set(e.primary.primaryAuthMethods):e.flowState.organization?.auth_methods==="RESTRICTED"?new Set(e.flowState.organization?.allowed_auth_methods??[]):void 0,[e.flowState.organization?.allowed_auth_methods,e.flowState.organization?.auth_methods,e.primary.primaryAuthMethods]),hasPrimaryAuthMethods:!!t}})(),o=(e=t2(aW).config,t1(()=>e.oauthOptions?.providers?e.oauthOptions.providers.map(aJ):[],[e.oauthOptions?.providers])),i=t1(()=>iW(r.products,o),[r.products,o]),s=t1(()=>{if(!n)return i;let e=i.filter(e=>n.has(e));return e.length>0||!a?e:t.flowState.organization?.auth_methods==="RESTRICTED"?iW(r.organizationProducts,iV).filter(e=>n.has(e)):["magic_link"]},[r.organizationProducts,i,a,n,t.flowState.organization?.auth_methods]);return{products:t1(()=>[...new Set(s.map(i$).filter(aN))].map(e=>r.organizationProducts.find(t=>t.id===e)).filter(aN),[s,r.organizationProducts]),oauthProviderSettings:t1(()=>s.map(e=>{let t=ij[e];if(t)return o.find(e=>e.type===t)??aJ(t)}).filter(aN),[s,o])}},iY=()=>new Date(Date.now()+6e5),iZ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.discovery.send",(e,{arg:{email:t}})=>r.otps.email.discovery.send({email_address:t,login_template_id:n.emailOtpOptions?.loginTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iJ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.loginOrSignup",(e,{arg:{email:t,organization_id:a}})=>r.otps.email.loginOrSignup({email_address:t,organization_id:a,login_template_id:n.emailOtpOptions?.loginTemplateId,signup_template_id:n.emailOtpOptions?.signupTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iQ=["email_jit_provisioning_not_allowed","invalid_email_for_jit_provisioning"],iX=()=>{let{i18n:e,_:t}=nO();return(r,{email:n,org:a})=>iQ.includes(r.error_type)?e._({id:"error.jitIneligible",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin",values:{email:n,organizationName:a}}):ic(r,t)},i1=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),o=iX(),{i18n:i,_:s}=nO(),{products:l}=iG(),c=oB(l,"emailMagicLinks"),d=oB(l,"emailOtp"),u=t.primary.email,h=u||n,{trigger:m,error:p,isMutating:_}=iA(),{trigger:g,error:f,isMutating:y}=iJ(),v=_||y,b=p||f,w=t.flowState.organization;if(!w)return rZ.createElement(rZ.Fragment,null);let k=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:h}),c&&d?r({type:"transition",screen:av,history:"push"}):c?m({email:h,organization_id:w.organization_id}):d&&g({email:h,organization_id:w.organization_id})};return u?rZ.createElement(id,{gap:2},l.filter(e=>"emailMagicLinks"===e.id||"emailOtp"===e.id).map(e=>{switch(e.id){case"emailMagicLinks":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),m({email:h,organization_id:w.organization_id})},loading:_,disabled:v,variant:"outline"},i._({id:"button.emailLink",message:"Email me a link"}));case"emailOtp":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),g({email:h,organization_id:w.organization_id})},loading:y,disabled:v,variant:"outline"},i._({id:"button.emailCode",message:"Email me a code"}))}}),e&&rZ.createElement(iF,{email:h})):rZ.createElement(id,{as:"form",onSubmit:k,gap:2},rZ.createElement(iU,{email:h,setEmail:a,hideLabel:!0,error:b?o(b,{email:h,org:w.organization_name}):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:v},i._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:h}))},i0=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),{i18n:o,_:i}=nO(),{products:s}=iG(),l=s.some(e=>"emailMagicLinks"===e.id),c=s.some(e=>"emailOtp"===e.id),{trigger:d,error:u,isMutating:h}=iO(),{trigger:m,error:p,isMutating:_}=iZ(),g=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:n}),l&&c?r({type:"transition",screen:av,history:"push"}):l?d({email:n}):c&&m({email:n})},f=u||p;return rZ.createElement(id,{as:"form",onSubmit:g,gap:2},rZ.createElement(iU,{email:n,setEmail:a,hideLabel:!0,error:f?ic(f,i):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:h||_},o._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:n}))},i2={emailMagicLinks:{messageDescriptor:{id:"emailMethodSelection.link",message:"Email me a login link"}},emailOtp:{messageDescriptor:{id:"emailMethodSelection.code",message:"Email me a login code"}}},i3=()=>{let{products:e}=iG(),{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{trigger:o,isMutating:i,error:l,reset:c}=iO(),{trigger:d,isMutating:u,error:h,reset:m}=iZ(),{trigger:p,isMutating:_,error:g,reset:f}=iA(),{trigger:y,isMutating:v,error:b,reset:w}=iJ(),k=i||u||_||v,S=l||h||g||b,E=t1(()=>e.map(e=>{let t=i2[e.id];if(t)return{option:e.id,messageDescriptor:t.messageDescriptor}}).filter(aN),[e]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"emailMethodSelection.title",message:"Select how you’d like to continue"})),rZ.createElement(iw,null,E.map(({option:e,messageDescriptor:r})=>rZ.createElement(oZ,{key:e,variant:"outline",disabled:k,onClick:()=>{switch(c(),m(),f(),w(),e){case"emailMagicLinks":n.flowState.type===s.Discovery?o({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&p({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id});break;case"emailOtp":n.flowState.type===s.Discovery?d({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&y({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id})}}},t._(r))),S&&rZ.createElement(iB,null,ic(S,r)),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{a({type:"navigate_back"})}},t._({id:"button.goBack",message:"Go back"}))))};nW(".Loading_module_loadingScreen__1c53715a{display:flex;justify-content:center}");let i4=()=>{let{i18n:e,_:t}=nO();return tm(nZ,{variant:"header",align:"center"},e._({id:"login.loading",message:"Logging in..."}))},i5=()=>tm("div",{className:"Loading_module_loadingScreen__1c53715a"},tm(oW,{size:32})),i8=({isSubmitting:e,resendOTP:t,countdown:r})=>{let{i18n:n,_:a}=nO(),[o,i]=ir(r.expiration);return rZ.createElement(oZ,{variant:"outline",disabled:e||i,onClick:()=>{r.start(15),t().catch(()=>r.clear())}},rZ.createElement(ii,{className:ia(),primary:n._({id:"passcode.resendCode",message:"Resend code"}),secondary:n._({id:"passcode.codeSent",message:"Code sent! Try again in {timeRemaining}s",values:{timeRemaining:o}}),triggered:i}))};nW(".AnimatedContainer_module_container__fb438508{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--st-transition-duration) ease-out}.AnimatedContainer_module_open__fb438508{grid-template-rows:1fr}.AnimatedContainer_module_inner__fb438508{min-height:0;overflow:clip}");let i6=({isOpen:e,children:t})=>rZ.createElement("div",{className:nj("AnimatedContainer_module_container__fb438508",{AnimatedContainer_module_open__fb438508:e}),"aria-live":"polite"},rZ.createElement("div",{className:"AnimatedContainer_module_inner__fb438508","aria-hidden":!e},t));nW(".LoadingBar_module_container__3a991498{background-color:var(--st-muted);border-radius:var(--st-rounded-full);height:var(--st-spacing);overflow:clip}.LoadingBar_module_progress__3a991498{animation:LoadingBar_module_loading__3a991498 10s cubic-bezier(.22,1,.36,1);background-color:var(--st-primary);height:100%;width:100%}@keyframes LoadingBar_module_loading__3a991498{0%{transform:translateX(-100%)}to{transform:translateX(-1%)}}");let i7=({isLoading:e})=>rZ.createElement("div",{role:"progressbar",className:"LoadingBar_module_container__3a991498"},e&&rZ.createElement("div",{className:"LoadingBar_module_progress__3a991498"}));nW(".OTPEntry_module_progressInner__6b10f31d{padding-top:var(--st-spacing-2)}");var i9=Object.defineProperty,se=Object.defineProperties,st=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,so=(e,t,r)=>t in e?i9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,si=tI({}),ss=rs((e,t)=>{let r;var n,a,o,i,s,{value:l,onChange:c,maxLength:d,textAlign:u="left",pattern:h,placeholder:m,inputMode:p="numeric",onComplete:_,pushPasswordManagerStrategy:g="increase-width",pasteTransformer:f,containerClassName:y,noScriptCSSFallback:v=sc,render:b,children:w}=e,k=((e,t)=>{var r={};for(var n in e)sn.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&sr)for(var n of sr(e))0>t.indexOf(n)&&sa.call(e,n)&&(r[n]=e[n]);return r})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[S,E]=tG("string"==typeof k.defaultValue?k.defaultValue:""),C=null!=l?l:S,P=(r=tQ(),tZ(()=>{r.current=C}),r.current),T=t0(e=>{null==c||c(e),E(e)},[c]),O=t1(()=>h?"string"==typeof h?new RegExp(h):h:null,[h]),A=tQ(null),x=tQ(null),D=tQ({value:C,onChange:T,isIOS:"u">typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),z=tQ({prev:[null==(o=A.current)?void 0:o.selectionStart,null==(i=A.current)?void 0:i.selectionEnd,null==(s=A.current)?void 0:s.selectionDirection]});tX(t,()=>A.current,[]),tZ(()=>{let e=A.current,t=x.current;if(!e||!t)return;function r(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,r=e.selectionEnd,n=e.selectionDirection,a=e.maxLength,o=e.value,i=z.current.prev,s=-1,l=-1,c;if(0!==o.length&&null!==t&&null!==r){let e=t===r,n=t===o.length&&o.length<a;if(e&&!n){if(0===t)s=0,l=1,c="forward";else if(t===a)s=t-1,l=t,c="backward";else if(a>1&&o.length>1){let e=0;if(null!==i[0]&&null!==i[1]){c=t<i[1]?"backward":"forward";let r=i[0]===i[1]&&i[0]<a;"backward"!==c||r||(e=-1)}s=e+t,l=e+t+1}}-1!==s&&-1!==l&&s!==l&&A.current.setSelectionRange(s,l,c)}let d=-1!==s?s:t,u=-1!==l?l:r,h=null!=c?c:n;N(d),F(u),z.current.prev=[d,u,h]}if(D.current.value!==e.value&&D.current.onChange(e.value),z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",r,{capture:!0}),r(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";sl(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),sl(e.sheet,`[data-input-otp]:autofill { ${t} }`),sl(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),sl(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),sl(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let a=new ResizeObserver(n);return a.observe(e),()=>{document.removeEventListener("selectionchange",r,{capture:!0}),a.disconnect()}},[]);let[M,I]=tG(!1),[R,L]=tG(!1),[B,N]=tG(null),[U,F]=tG(null);tZ(()=>{var e;setTimeout(e=()=>{var e,t,r,n;null==(e=A.current)||e.dispatchEvent(new Event("input"));let a=null==(t=A.current)?void 0:t.selectionStart,o=null==(r=A.current)?void 0:r.selectionEnd,i=null==(n=A.current)?void 0:n.selectionDirection;null!==a&&null!==o&&(N(a),F(o),z.current.prev=[a,o,i])},0),setTimeout(e,10),setTimeout(e,50)},[C,R]),tZ(()=>{void 0!==P&&C!==P&&P.length<d&&C.length===d&&(null==_||_(C))},[d,_,P,C]);let q=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,o]=tG(!1),[i,s]=tG(!1),[l,c]=tG(!1),d=t1(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&i,[a,i,r]),u=t0(()=>{let n=e.current,a=t.current;if(!n||!a||l||"none"===r)return;let i=n.getBoundingClientRect().left+n.offsetWidth,s=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,s)===n||(o(!0),c(!0))},[e,t,l,r]);return tZ(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let a=setInterval(n,1e3);return()=>{clearInterval(a)}},[e,r]),tZ(()=>{let e=n||document.activeElement===t.current;if("none"===r||!e)return;let a=setTimeout(u,0),o=setTimeout(u,2e3),i=setTimeout(u,5e3),s=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(o),clearTimeout(i),clearTimeout(s)}},[t,n,r,u]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:x,inputRef:A,pushPasswordManagerStrategy:g,isFocused:R}),H=t0(e=>{let t=e.currentTarget.value.slice(0,d);t.length>0&&O&&!O.test(t)?e.preventDefault():("string"==typeof P&&t.length<P.length&&document.dispatchEvent(new Event("selectionchange")),T(t))},[d,T,P,O]),K=t0(()=>{var e;if(A.current){let t=Math.min(A.current.value.length,d-1),r=A.current.value.length;null==(e=A.current)||e.setSelectionRange(t,r),N(t),F(r)}L(!0)},[d]),j=t0(e=>{var t,r;let n=A.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!n))return;let a=e.clipboardData.getData("text/plain"),o=f?f(a):a;e.preventDefault();let i=null==(t=A.current)?void 0:t.selectionStart,s=null==(r=A.current)?void 0:r.selectionEnd,l=(i!==s?C.slice(0,i)+o+C.slice(s):C.slice(0,i)+o+C.slice(i)).slice(0,d);if(l.length>0&&O&&!O.test(l))return;n.value=l,T(l);let c=Math.min(l.length,d-1),u=l.length;n.setSelectionRange(c,u),N(c),F(u)},[d,T,O,C]),$=t1(()=>({position:"relative",cursor:k.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[k.disabled]),V=t1(()=>({position:"absolute",inset:0,width:q.willPushPWMBadge?`calc(100% + ${q.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:q.willPushPWMBadge?`inset(0 ${q.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:u,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[q.PWM_BADGE_SPACE_WIDTH,q.willPushPWMBadge,u]),W=t1(()=>tm("input",se(((e,t)=>{for(var r in t||(t={}))sn.call(t,r)&&so(e,r,t[r]);if(sr)for(var r of sr(t))sa.call(t,r)&&so(e,r,t[r]);return e})({autoComplete:k.autoComplete||"one-time-code"},k),st({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===C.length||void 0,"data-input-otp-mss":B,"data-input-otp-mse":U,inputMode:p,pattern:null==O?void 0:O.source,"aria-placeholder":m,style:V,maxLength:d,value:C,ref:A,onPaste:e=>{var t;j(e),null==(t=k.onPaste)||t.call(k,e)},onChange:H,onMouseOver:e=>{var t;I(!0),null==(t=k.onMouseOver)||t.call(k,e)},onMouseLeave:e=>{var t;I(!1),null==(t=k.onMouseLeave)||t.call(k,e)},onFocus:e=>{var t;K(),null==(t=k.onFocus)||t.call(k,e)},onBlur:e=>{var t;L(!1),null==(t=k.onBlur)||t.call(k,e)}}))),[H,K,j,p,V,d,U,B,k,null==O?void 0:O.source,C]),G=t1(()=>({slots:Array.from({length:d}).map((e,t)=>{var r;let n=R&&null!==B&&null!==U&&(B===U&&t===B||t>=B&&t<U),a=void 0!==C[t]?C[t]:null;return{char:a,placeholderChar:void 0!==C[0]?null:null!=(r=null==m?void 0:m[t])?r:null,isActive:n,hasFakeCaret:n&&null===a}}),isFocused:R,isHovering:!k.disabled&&M}),[R,M,d,U,B,k.disabled,C]),Y=t1(()=>b?b(G):tm(si.Provider,{value:G},w),[w,G,b]);return tm(tg,null,null!==v&&tm("noscript",null,tm("style",null,v)),tm("div",{ref:x,"data-input-otp-container":!0,style:$,className:y},Y,tm("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))});function sl(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}ss.displayName="Input";var sc=`
|
|
28
28
|
[data-input-otp] {
|
|
29
29
|
--nojs-bg: white !important;
|
|
30
30
|
--nojs-fg: black !important;
|
|
@@ -43,7 +43,7 @@ products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error
|
|
|
43
43
|
--nojs-bg: black !important;
|
|
44
44
|
--nojs-fg: white !important;
|
|
45
45
|
}
|
|
46
|
-
}`;nW(".OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*64)}.-st-mobile .OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*70)}.OtpInput_module_slotsContainer__1e43b599{display:flex;gap:var(--st-spacing-2);justify-content:start;width:fit-content}.OtpInput_module_otpSlot__1e43b599{align-items:center;display:flex;height:calc(var(--st-spacing)*9);justify-content:center;width:calc(var(--st-spacing)*9)}.-st-mobile .OtpInput_module_otpSlot__1e43b599{height:calc(var(--st-spacing)*10);width:calc(var(--st-spacing)*10)}.OtpInput_module_disabled__1e43b599 .OtpInput_module_otpSlot__1e43b599{color:var(--st-muted-foreground)}.OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1.5s step-start infinite;border-right:1px solid var(--st-foreground);display:inline-block;height:calc(var(--st-text-sm)*1.25);width:0}.OtpInput_module_safari__1e43b599 .OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1s ease-in-out infinite;border-right-width:2px}@keyframes OtpInput_module_caretBlink__1e43b599{0%,to{opacity:0}50%{opacity:1}}");let sc=e=>e.replace(/\D/g,"").slice(0,6),sd=({slots:e})=>rZ.createElement("div",{className:"OtpInput_module_slotsContainer__1e43b599"},e.map((e,t)=>rZ.createElement("div",{key:t,className:nj("OtpInput_module_otpSlot__1e43b599 inputBase_module_inputBase__06c14ae4",{"OtpInput_module_active__1e43b599 inputBase_module_forceFocusRing__06c14ae4":e.isActive})},rZ.createElement("span",null,e.char),e.hasFakeCaret&&rZ.createElement("div",{className:"OtpInput_module_caret__1e43b599"})))),su=({defaultOtp:e,onSubmit:t,disabled:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(e),l=t1(()=>{let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrom")},[]);return rZ.createElement(si,{"aria-label":a._({id:"formField.otp.ariaLabel",message:"One-time passcode"}),containerClassName:nj("OtpInput_module_inputContainer__1e43b599",{OtpInput_module_disabled__1e43b599:r,OtpInput_module_safari__1e43b599:l}),maxLength:6,value:i,onChange:e=>s(sc(e)),pasteTransformer:sc,disabled:r,onComplete:t,pattern:"[0-9]*",render:sd,...n})},sh=({header:e,body:t,helper:r,align:n})=>rZ.createElement(id,{gap:4},rZ.createElement(nZ,{variant:"header",align:n},e),t&&rZ.createElement(nZ,{align:n},t),r&&rZ.createElement(nZ,{variant:"helper",align:n},r)),sm=({header:e,helperContent:t,instruction:r,isSubmitting:n,onSubmit:a,errorMessage:o})=>{let{i18n:i,_:s}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:e,body:r}),rZ.createElement(id,{gap:2},rZ.createElement(id,null,rZ.createElement(su,{onSubmit:a,disabled:n}),rZ.createElement(i8,{isOpen:n},rZ.createElement(id,{className:"OTPEntry_module_progressInner__6b10f31d",gap:2},rZ.createElement(nZ,{variant:"helper"},i._({id:"formField.passcode.status.verifying",message:"Verifying passcode..."})),rZ.createElement(i6,{isLoading:n})))),rZ.createElement(id,null,!n&&o&&rZ.createElement(iB,null,o),rZ.createElement(nZ,{variant:"helper",className:ia()},t))))},sp=({expiration:e,formattedDestination:t,isSubmitting:r,onSubmit:n,errorMessage:a})=>{let o,{i18n:i,_:s}=nO(),[l,c]=ir(e),d=(o=Math.floor(l/60))+":"+String(l-60*o).padStart(2,"0"),u=c?i._({id:"passcode.expirationCountdown",message:"Your code expires in {timeRemaining}.",values:{timeRemaining:d}}):i._({id:"passcode.expired",message:"Your code has expired."});return rZ.createElement(sm,{header:i._({id:"passcode.title",message:"Enter passcode"}),helperContent:u,instruction:rZ.createElement(nx,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:rZ.createElement("b",null)},values:{destination:t}}),isSubmitting:r,onSubmit:n,errorMessage:a})},s_=({password:e,setPassword:t,type:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(!1),l=tQ(null);return tZ(()=>{let e=l.current?.form;if(!e)return;let t=new AbortController;return e.addEventListener("submit",()=>{l.current&&(l.current.type="password"),s(!1)},{signal:t.signal}),()=>t.abort()},[]),rZ.createElement(iN,{id:`${r}-password`,label:a._({id:"formField.password.label",message:"Password"}),ref:l,autoComplete:`${r}-password`,type:i?"text":"password",value:e,onChange:e=>t(e.target.value),required:!0,action:rZ.createElement(oZ,{variant:"ghost",onClick:()=>s(!i)},i?a._({id:"button.hidePassword",message:"Hide"}):a._({id:"button.showPassword",message:"Show"})),...n})},sg=()=>{let[e,t]=t2(aW).state,r=t2(aW).config,n=t2(aW).client,{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=tG(e.formState.passwordState.email),[d,u]=tG(""),[h,m]=tG(""),[p,_]=tG(!1),g=e.flowState.organization;return{stytch:n,onError:s,email:l,setEmail:c,password:d,setPassword:u,organization:g,errorMessage:h,setErrorMessage:m,isSubmitting:p,setIsSubmitting:_,submitPassword:e=>{m(""),_(!0),n.passwords.authenticate({email_address:l,organization_id:e,password:d,session_duration_minutes:r.sessionOptions?.sessionDurationMinutes??30,locale:r.passwordOptions?.locale}).then(e=>{_(!1),i({type:eu.B2BPasswordAuthenticate,data:e}),oR(e,t,r)}).catch(e=>{_(!1),s(e),m(ic(e,o))})},submitDiscoveryPassword:()=>{m(""),_(!0),n.passwords.discovery.authenticate({email_address:l,password:d}).then(e=>{_(!1),i({type:eu.B2BPasswordDiscoveryAuthenticate,data:e}),t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations}),t({type:"transition",screen:aa})}).catch(e=>{_(!1),s(e),m(ic(e,o))})},handleNonMemberReset:()=>{if(g){if(!(({email_jit_provisioning:e,email_allowed_domains:t},r)=>{switch(e){case"ALL_ALLOWED":return!0;case"NOT_ALLOWED":return!1;case"RESTRICTED":{let e=r.split("@").pop();return null!=e&&t.includes(e)}}})(g,l)){_(!1);let e=g.organization_name;m(a._({id:"error.emailNoAccessToOrg",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin.",values:{email:l,organizationName:e}}));return}r1(n).dataLayer.setItem("reset-email-value",l),n.magicLinks.email.loginOrSignup({email_address:l,organization_id:g.organization_id,login_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,signup_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}).then(()=>{_(!1),t({type:"set_password_state",email:l}),t({type:"transition",screen:al})}).catch(e=>{s(e),m(ic(e,o)),_(!1)})}}}},sf=()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{stytch:n,email:a,setEmail:o,password:i,setPassword:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,submitPassword:m,submitDiscoveryPassword:p,handleNonMemberReset:_}=sg(),[g,f]=tG(!!l&&!a),y=async o=>{if(o.preventDefault(),l){let o=l.organization_id;if(!g)return void m(o);if(!a.match(n5))return void d(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}));d(""),h(!0),r1(n).searchManager.searchMember(a,l.organization_id).then(({member:t})=>{if(t){f(!1),h(!1),e({type:"set_password_state",email:a});return}_()}).catch(e=>{h(!1),d(ic(e,r))})}else p()};return rZ.createElement(id,{as:"form",onSubmit:y,gap:2},rZ.createElement(iU,{email:a,setEmail:o}),!g&&rZ.createElement(s_,{password:i,setPassword:s,type:"current",error:c}),rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},t._({id:"button.continue",message:"Continue"})),!g&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:a}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})))},sy=()=>{let e,t,r=((t=(e=new URL(window.location.toString())).searchParams).delete("token"),t.delete("stytch_token_type"),e);window.history.replaceState(null,document.title,r)};nW('.PasswordError_module_item__c070e7fb{margin-left:var(--st-spacing-6);text-indent:calc(var(--st-spacing-6)*-1)}.PasswordError_module_item__c070e7fb svg{display:inline-block;height:var(--st-spacing-4);margin-right:var(--st-spacing-2);vertical-align:middle;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb{display:inline-block;margin-right:var(--st-spacing-2);text-align:center;text-indent:0;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb:before{content:"•"}');nW(".PasswordStrengthCheck_module_container__75d2aaf0{border-radius:var(--st-rounded-full);display:flex;gap:var(--st-spacing-0_5);height:0;overflow:clip;transition:height var(--st-transition-duration)}.PasswordStrengthCheck_module_container__75d2aaf0:is(.PasswordStrengthCheck_module_weak__75d2aaf0,.PasswordStrengthCheck_module_strong__75d2aaf0){height:var(--st-spacing)}.PasswordStrengthCheck_module_block__75d2aaf0{background:var(--st-muted);flex:1 1 auto;height:var(--st-spacing)}.PasswordStrengthCheck_module_weak__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-destructive)}.PasswordStrengthCheck_module_strong__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-success)}");let sv=({score:e})=>{let t,{i18n:r,_:n}=nO();return 1===e||2===e?t="PasswordStrengthCheck_module_weak__75d2aaf0":(3===e||4===e)&&(t="PasswordStrengthCheck_module_strong__75d2aaf0"),rZ.createElement("div",{className:nj("PasswordStrengthCheck_module_container__75d2aaf0",t)},null!=e&&e>0&&rZ.createElement(rZ.Fragment,null,[,,,,].fill(void 0).map((t,r)=>rZ.createElement("div",{key:r,className:nj("PasswordStrengthCheck_module_block__75d2aaf0",{PasswordStrengthCheck_module_filled__75d2aaf0:e>r})})),rZ.createElement(iI,null,r._({id:"password.strength",message:"Password strength: {score} out of 4.",values:{score:e}}))))},sb={"Short keyboard patterns are easy to guess.":{id:"password.zxcvbn.warning.shortKeyboardPatterns",message:"Short keyboard patterns are easy to guess."},"Straight rows of keys are easy to guess.":{id:"password.zxcvbn.warning.straightRows",message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:"password.zxcvbn.warning.repeats",message:'Repeats like "aaa" are easy to guess.'},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:"password.zxcvbn.warning.longerRepeats",message:'Repeats like "abcabcabc" are only slightly harder to guess than "abc".'},'Sequences like "abc" or "6543" are easy to guess.':{id:"password.zxcvbn.warning.sequences",message:'Sequences like "abc" or "6543" are easy to guess.'},"Recent years are easy to guess.":{id:"password.zxcvbn.warning.recentYears",message:"Recent years are easy to guess."},"Dates are often easy to guess.":{id:"password.zxcvbn.warning.dates",message:"Dates are often easy to guess."},"This is a top-10 common password.":{id:"password.zxcvbn.warning.top10CommonPassword",message:"This is a top-10 common password."},"This is a top-100 common password.":{id:"password.zxcvbn.warning.top100CommonPassword",message:"This is a top-100 common password."},"This is a very common password.":{id:"password.zxcvbn.warning.veryCommonPassword",message:"This is a very common password."},"This is similar to a commonly used password.":{id:"password.zxcvbn.warning.similarToCommonPassword",message:"This is similar to a commonly used password."},"A word by itself is easy to guess.":{id:"password.zxcvbn.warning.wordByItself",message:"A word by itself is easy to guess."},"Names and surnames by themselves are easy to guess.":{id:"password.zxcvbn.warning.names",message:"Names and surnames by themselves are easy to guess."},"Common names and surnames are easy to guess.":{id:"password.zxcvbn.warning.commonNames",message:"Common names and surnames are easy to guess."}},sw={"Use a few words, avoid common phrases.":{id:"password.zxcvbn.suggestion.useAFewWords",message:"Use a few words, avoid common phrases."},"No need for symbols, digits, or uppercase letters.":{id:"password.zxcvbn.suggestion.noSymbolsDigitsUppercase",message:"No need for symbols, digits, or uppercase letters."},"Add another word or two. Uncommon words are better.":{id:"password.zxcvbn.suggestion.addWords",message:"Add another word or two. Uncommon words are better."},"Use a longer keyboard pattern with more turns.":{id:"password.zxcvbn.suggestion.longerKeyboardPattern",message:"Use a longer keyboard pattern with more turns."},"Avoid repeated words and characters.":{id:"password.zxcvbn.suggestion.avoidRepeats",message:"Avoid repeated words and characters."},"Avoid sequences.":{id:"password.zxcvbn.suggestion.avoidSequences",message:"Avoid sequences."},"Avoid recent years.":{id:"password.zxcvbn.suggestion.avoidRecentYears",message:"Avoid recent years."},"Avoid years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou",message:"Avoid years that are associated with you."},"Avoid dates and years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou",message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:"password.zxcvbn.suggestion.capitalization",message:"Capitalization doesn't help very much."},"All-uppercase is almost as easy to guess as all-lowercase.":{id:"password.zxcvbn.suggestion.allUppercase",message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:"password.zxcvbn.suggestion.reversed",message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:"password.zxcvbn.suggestion.predictableSubstitutions",message:"Predictable substitutions like '@' instead of 'a' don't help very much."}},sk={fulfilled:{id:"password.requirement.fulfilled",message:"Fulfilled"},notFulfilled:{id:"password.requirement.notFulfilled",message:"Not fulfilled"},warning:{id:"password.requirement.warning",message:"Warning"},suggestion:{id:"password.requirement.suggestion",message:"Suggestion"}},sS=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"currentColor"})),sE=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"currentColor"})),sC=({children:e,type:t})=>{let{i18n:r,_:n}=nO(),a="suggestion"===t?rZ.createElement("span",{role:"presentation",className:"PasswordError_module_bullet__c070e7fb"}):"fulfilled"===t?rZ.createElement(sE,null):rZ.createElement(sS,null);return rZ.createElement(nZ,{variant:"helper",className:"PasswordError_module_item__c070e7fb",color:"suggestion"===t?void 0:"fulfilled"===t?"success":"destructive","aria-atomic":!0},a,rZ.createElement("span",null,rZ.createElement(iI,null,r._(sk[t]),": "),e))},sP=({bootstrap:e,...t})=>{let{i18n:r,_:n}=nO(),a=e.passwordConfig?.ludsComplexity??0,o=e.passwordConfig?.ludsMinimumCount??0;if("notLoaded"===t.policy)return null;let{passwordInvalid:i,isPasswordBreached:s}=t,l=s?rZ.createElement(sC,{type:"warning"},r._({id:"password.strengthError.breached",message:"This password may have been used on a different site that experienced a security issue. Please choose another password."})):null;if("zxcvbn"===t.policy){let{passwordScore:e,passwordWarning:n,passwordSuggestions:a}=t,o=n?sb[n]??n:null,s=[...new Set(a)].map(e=>sw[e]??e);return rZ.createElement(id,{gap:1,"aria-live":"polite"},rZ.createElement(sv,{score:e}),rZ.createElement(iI,null,i?r._({id:"password.strength.notAccepted",message:"Password not accepted."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement("div",null,o&&rZ.createElement(sC,{type:"warning"},r._(o)),s.map(e=>rZ.createElement(sC,{key:e.id,type:"suggestion"},r._(e))),l))}let{missingCharacters:c,missingComplexity:d}=t;return rZ.createElement("div",{"aria-live":"polite"},rZ.createElement(iI,null,i?r._({id:"password.strength.requirementsNotMet",message:"Your password must meet all requirements."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement(sC,{type:0===c?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.minimumLength",message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:o}})),rZ.createElement(sC,{type:0===d?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.complexity",message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:a}})),l)},sT=()=>{throw Error("Assertion failure")};function sO(e){return`sso:${e.connection_id}`}function sA(e){return"oauth"===e.type?e.provider.type:"sso"===e.type?sO(e.connection):"sso-discovery"}let sx=({buttons:e})=>{let{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{oauthProviderSettings:o=[]}=iG(),i=t2(nq),[l,d]=o$(),u=t2(aW).config,{loginRedirectURL:h,signupRedirectURL:m,discoveryRedirectURL:p,customScopes:_,providerParams:g}=u.oauthOptions??{},{B2BGoogleOneTap:f,OAuthB2BButton:y,SSOButton:v}=oN(u,"ssoAndOAuthButtons"),b=n.flowState.type===s.Discovery,w=e.flatMap(e=>e===aP?o.map(e=>({type:"oauth",provider:e})):e===aT?b?{type:"sso-discovery"}:n.flowState.organization?.sso_active_connections?.map(e=>({type:"sso",connection:e}))??[]:void sT());if(0===w.length)return null;let[k,S]=eT(w,e=>sA(e)===l);return rZ.createElement(iw,null,k.map((e,r)=>{let o=(()=>{switch(e.type){case"oauth":var r,o,s;let l,u,b;return b={customScopes:(o=r=e.provider,0==Object.keys(l=o.customScopes).length&&(l=_),l),providerParams:(s=n.primary.email,0==Object.keys(u=r.providerParams).length&&(u=g??{}),!s||r.type!==c.Google&&r.type!==c.Microsoft||"login_hint"in u||(u={...u,login_hint:s}),u)},r.one_tap?rZ.createElement(f,{key:r.type,...b,cancelOnTapOutside:r.cancel_on_tap_outside}):rZ.createElement(y,{key:r.type,providerType:r.type,loginRedirectUrl:h,signupRedirectUrl:m,discoveryRedirectUrl:p,onSuccess:()=>d(r.type),...b});case"sso":return rZ.createElement(v,{key:e.connection.display_name,connection:e.connection,onStart:()=>d(sO(e.connection))});case"sso-discovery":return rZ.createElement(oZ,{key:"sso-discovery",variant:"outline",id:nH("sso-discovery",i.options),onClick:()=>{a({type:"transition",screen:aw,history:"push"})}},t._({id:"provider.continueWithSSO",message:"Use single sign-on"}));default:sT()}})();return S&&0===r?rZ.createElement(nQ,{key:sA(e)},o):o}))},sD=({availableConnections:e})=>{let[t,r]=o$(),n=t?.startsWith("sso:")?t.slice(4):void 0,[a,o]=eT(e,e=>e.connection_id===n);return tm(id,{gap:2},a.map((e,t)=>{let n=tm(o9,{key:e.display_name,connection:e,onStart:e=>r(sO(e))});return o&&0===t?tm(nQ,{key:e.display_name},n):n}))},sz=()=>rZ.createElement(iX,{showPasswordButton:!1}),sM=()=>rZ.createElement(iX,{showPasswordButton:!0}),sI=()=>rZ.createElement(i1,{showPasswordButton:!1}),sR=()=>rZ.createElement(i1,{showPasswordButton:!0});var sL=Object.freeze({__proto__:null,emailMagicLinks:{id:"emailMagicLinks",screens:{[ar]:iD,[av]:i2},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},emailOtp:{id:"emailOtp",screens:{[ab]:()=>{let e=t2(aW).client,t=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{codeExpiration:i}=a.formState.otpState,l=ie(),{userSuppliedEmail:c}=a.formState.emailState,d=iJ({throwOnError:!0}),u=iZ({throwOnError:!0}),h=d.isMutating||u.isMutating,m=d.error||u.error,p=oM("stytch.otps.email.discovery.authenticate",(t,{arg:{otp:r,email:n}})=>e.otps.email.discovery.authenticate({code:r,email_address:n}),{onSuccess:e=>{oL(e,o)},throwOnError:!0}),_=oM("stytch.otps.email.authenticate",(t,{arg:{otp:r,emailAddress:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.email.authenticate({code:r,email_address:n,organization_id:a,session_duration_minutes:o}),{onSuccess:e=>{oR(e,o,t)},throwOnError:!0}),g=p.isMutating||_.isMutating,f=p.error||_.error||m,y=f?ic(f,n):void 0,v=()=>{for(let e of[d,u,_,p])e.reset()},b=async e=>{v();try{a.flowState.type===s.Discovery?await p.trigger({otp:e,email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&a.formState.emailState.userSuppliedEmail&&await _.trigger({otp:e,emailAddress:a.formState.emailState.userSuppliedEmail,organizationId:a.flowState.organization.organization_id,sessionDurationMinutes:t.sessionOptions.sessionDurationMinutes})}catch{l.clear()}},w=async()=>{v(),!h&&(a.flowState.type===s.Discovery?await u.trigger({email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&await d.trigger({email:c,organization_id:a.flowState.organization.organization_id}))};return rZ.createElement(id,{gap:6},null!==i?rZ.createElement(sp,{isSubmitting:g,onSubmit:b,errorMessage:y,expiration:i.getTime(),formattedDestination:c}):rZ.createElement(i4,null),rZ.createElement(iw,null,rZ.createElement(i5,{countdown:l,resendOTP:w,isSubmitting:g}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{o({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[av]:i2,[ar]:iD},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},oauth:{id:"oauth",screens:{},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,B2BGoogleOneTap:o1,OAuthB2BButton:oX},icons:{google:o2,microsoft:o3,hubspot:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#FF7A59",fillRule:"evenodd",d:"M13.93 13.97a2.4 2.4 0 0 1-2.43-2.4c0-1.34 1.09-2.42 2.43-2.42a2.4 2.4 0 0 1 2.43 2.41c0 1.33-1.08 2.41-2.43 2.41m.73-7.05V4.78c.56-.26.96-.83.96-1.49v-.05c0-.9-.75-1.64-1.66-1.64h-.05c-.92 0-1.67.74-1.67 1.64v.05c0 .66.4 1.23.96 1.5v2.13q-1.27.21-2.24.98L5 3.32q.07-.21.07-.46C5.08 1.83 4.24 1 3.2 1s-1.88.83-1.88 1.86a1.87 1.87 0 0 0 2.8 1.6l5.85 4.51a4.6 4.6 0 0 0 .07 5.29l-1.77 1.76a1.54 1.54 0 0 0-1.98 1.46 1.54 1.54 0 0 0 3.09 0q-.02-.23-.08-.44l1.76-1.74a4.75 4.75 0 0 0 7.62-3.74 4.7 4.7 0 0 0-4.02-4.64",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#E01E5A",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0z"}),tm("path",{fill:"#36C5F0",d:"M7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79z"}),tm("path",{fill:"#2EB67D",d:"M15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0z"}),tm("path",{fill:"#ECB22E",d:"M12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#24292F",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd",className:o0}))}},passwords:{id:"passwords",screens:{"Password Email":sf,[ai]:()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{email:n,setEmail:a,password:o,setPassword:i,organization:s,errorMessage:l,setErrorMessage:c,isSubmitting:d,submitPassword:u,submitDiscoveryPassword:h}=sg(),m=async e=>{e.preventDefault(),n.match(n5)?s?u(s.organization_id):h():c(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"password.login.title",message:"Log in with email and password"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:4},rZ.createElement(iU,{email:n,setEmail:a}),rZ.createElement(s_,{password:o,setPassword:i,type:"current",error:l}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:d,type:"submit"},t._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:n}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},t._({id:"button.goBack",message:"Go back"})))))},[ac]:()=>{let[,e]=t2(aW).state,t=t2(aW).config,r=aZ(),{i18n:n,_:a}=nO(),{stytch:o,email:i,setEmail:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,handleNonMemberReset:m}=sg(),p=async s=>{(s.preventDefault(),i.match(n5))?(d(""),h(!0),l?r1(o).searchManager.searchMember(i,l.organization_id).then(({member:n})=>{n?o.passwords.resetByEmailStart({email_address:i,organization_id:l.organization_id,login_redirect_url:t.passwordOptions?.loginRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(t=>{h(!1),r({type:eu.B2BPasswordResetByEmailStart,data:t}),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))}):m()}).catch(e=>{h(!1),d(ic(e,a))}):o.passwords.discovery.resetByEmailStart({email_address:i,discovery_redirect_url:t.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(()=>{h(!1),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))})):d(n._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},n._({id:"password.forgot.title",message:"Check your email for help signing in"})),rZ.createElement(nZ,{variant:"body"},l?n._({id:"password.forgot.content.organization",message:"We'll email you a login link to sign in to your account directly or reset your password if you have one."}):n._({id:"password.forgot.content.discovery",message:"We'll email you a verification link to sign up for an account or reset your password if you have one."})),rZ.createElement(iU,{email:i,setEmail:s,error:c}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},n._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},n._({id:"button.goBack",message:"Go back"}))))},[ad]:()=>{let[,e]=t2(aW).state,t=aZ(),r=t2(aW).config,{i18n:n,_:a}=nO(),{stytch:o,onError:i,email:s,organization:l,setIsSubmitting:c}=sg();return rZ.createElement(ik,{header:n._({id:"password.reset.emailSent.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"password.reset.emailSent.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:s}}),resend:()=>l?o.passwords.resetByEmailStart({email_address:s,organization_id:l.organization_id,login_redirect_url:r.passwordOptions?.loginRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordResetByEmailStart,data:e})}).catch(e=>{throw i(e),e}):o.passwords.discovery.resetByEmailStart({email_address:s,discovery_redirect_url:r.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordDiscoveryResetStart,data:e})}),goBack:()=>e({type:"transition",screen:at})})},[as]:()=>{let e=t2(aW).client,t=t2(aW).config,[,r]=t2(aW).state,n=oI(),{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=t1(()=>{let t=e.parseAuthenticateUrl();return t?[t.token,t.tokenType]:["",""]},[e]),d=r1(e).dataLayer.getItem("reset-email-value"),[u,h]=tG(""),[m,p]=tG(""),[_,g]=tG({policy:"notLoaded"}),[f,y]=tG(!1),v=t1(()=>((e,t=500)=>{let r;return(...n)=>{clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}})(t=>(p(""),e.passwords.strengthCheck({password:t}).then(({score:e,valid_password:t,zxcvbn_feedback:r,luds_feedback:n,strength_policy:a,breached_password:o})=>{let i={passwordInvalid:!t,isPasswordBreached:o};"zxcvbn"===a?g({policy:a,...i,passwordScore:e,passwordWarning:r.warning,passwordSuggestions:r.suggestions}):"luds"===a&&g({policy:a,...i,missingCharacters:n.missing_characters,missingComplexity:n.missing_complexity})}).catch(e=>{p(ic(e,o))}))),[e.passwords,o]);tZ(()=>{if("multi_tenant_magic_links"===c)return void e.magicLinks.authenticate({magic_links_token:l,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.emailMagicLinksOptions?.locale}).then(e=>{sy(),r({type:"primary_authenticate_success",response:e,includedMfaMethods:t.mfaProductInclude,resetTokenType:c})}).catch(e=>{p(ic(e,o)),s(e)})},[c]);let b=function(e,t){if("notLoaded"===t||"zxcvbn"===t||null==e.passwordConfig)return{type:"new",passwordrules:"allowed: unicode; minlength: 10"};let{ludsComplexity:r,ludsMinimumCount:n}=e.passwordConfig,a=["special","digit","upper","lower"].slice(0,r);return{type:"new",minLength:n,passwordrules:`allowed: unicode; minlength: ${n}; ${a.map(e=>`required: ${e}`).join("; ")}`}}(n,_.policy);return rZ.createElement(id,{gap:6,as:"form",onSubmit:n=>{n.preventDefault(),p(""),y(!0),"multi_tenant_passwords"==c?e.passwords.resetByEmail({password_reset_token:l,password:u,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.passwordOptions?.locale}).then(e=>{y(!1),i({type:eu.B2BPasswordResetByEmail,data:e}),oR(e,r,t)}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):"discovery"==c?e.passwords.discovery.resetByEmail({password_reset_token:l,password:u}).then(e=>{y(!1),i({type:eu.B2BDiscoveryPasswordReset,data:e}),r({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations}),r({type:"transition",screen:aa})}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):e.passwords.resetBySession({password:u}).then(e=>{y(!1),i({type:eu.B2BPasswordResetBySession,data:e}),r({type:"transition",screen:an})}).catch(e=>{s(e),p(ic(e,o)),y(!1)})}},rZ.createElement(nZ,{variant:"header"},a._({id:"password.setNew.title",message:"Set a new password"})),rZ.createElement(id,{gap:2},d?rZ.createElement(iU,{email:d,setEmail:n6,disabled:!0}):null,rZ.createElement(s_,{password:u,setPassword:e=>{h(e),v(e)},error:m,...b}),rZ.createElement(sP,{bootstrap:n,..._}),rZ.createElement(oZ,{variant:"primary",loading:f,type:"submit",disabled:"notLoaded"===_.policy||_.passwordInvalid},a._({id:"button.continue",message:"Continue"}))))},[al]:()=>{let{i18n:e,_:t}=nO(),[r,n]=t2(aW).state,a=ix(),o=r.formState.passwordState.email;return rZ.createElement(ik,{header:e._({id:"password.verification.title",message:"Verify your email first."}),description:rZ.createElement(nx,{id:"password.verification.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:o}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:a,providerInfo:iS}),rZ.createElement(iP,{emailDomain:a,providerInfo:iC}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{n({type:"set_user_supplied_email",email:""}),n({type:"transition",screen:at})}},e._({id:"button.retry",message:"Try again"})))})}},mainScreen:{[aO]:sf,[aA]:sM,[ax]:sR},icons:o4},sso:{id:"sso",screens:{[aw]:()=>{let e,[,t]=t2(aW).state,[r,n]=tG(""),{i18n:a,_:o}=nO(),[i,s]=tG(),[l,c]=tG(!1),{trigger:d}=(e=t2(aW).client,oM("stytch.sso.discoverConnections",async(t,{arg:{emailAddress:r}})=>await e.sso.discoverConnections(r),{throwOnError:!0})),u=t2(aW).client,{ssoOptions:h}=t2(aW).config,m=async e=>{e.preventDefault(),s(void 0);let n=async()=>{try{let e=await d({emailAddress:r});if(!e)return[];return e.connections}catch(e){s(((e,t)=>{if(e&&"object"==typeof e){if("error_message"in e&&"string"==typeof e.error_message)return e.error_message;if(t)return t;if("message"in e&&"string"==typeof e.message)return e.message}})(e,a._({id:"ssoDiscovery.email.error.unknown",message:"Something went wrong. Try again later or contact your admin for help."})))}};try{c(!0);let e=await n();if(e?.length===1){let[t]=e;await u.sso.start({connection_id:t.connection_id,login_redirect_url:h?.loginRedirectURL,signup_redirect_url:h?.signupRedirectURL});return}c(!1),e&&t({type:"set_sso_discovery_state",connections:e})}catch(e){throw c(!1),e}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"ssoDiscovery.email.title",message:"Enter your email to continue"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:2},rZ.createElement(iU,{email:r,setEmail:n,hideLabel:!0,error:i}),rZ.createElement(oZ,{variant:"primary",loading:l,type:"submit"},a._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},a._({id:"button.goBack",message:"Go back"}))))},[aS]:()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO();return tm(id,{gap:6},tm(nZ,{variant:"header"},r._({id:"ssoDiscovery.title",message:"Select a connection to continue"})),tm(id,{gap:4},tm(sD,{availableConnections:e.formState.ssoDiscoveryState.connections}),tm(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[ak]:()=>{let[,e]=t2(aW).state,[t,r]=tG(""),[n,a]=tG(),[o,i]=tG(!1),s=t2(aW).client,{ssoOptions:l}=t2(aW).config,{i18n:c,_:d}=nO(),{trigger:u}=oM("stytch.organization.getBySlug",async(e,{arg:{slug:t}})=>s.organization.getBySlug({organization_slug:t}),{onError:()=>{a(c._({id:"ssoDiscovery.fallback.error.unknown",message:"An error occurred. Please try again."})),i(!1)}}),h=async r=>{r.preventDefault(),a(void 0),i(!0);let n=await u({slug:t});if(n){let{organization:t}=n;if(null===t)a(c._({id:"ssoDiscovery.fallback.error.orgNotFound",message:"Organization not found. Please try again."})),i(!1);else if(1===t.sso_active_connections.length){let[e]=t.sso_active_connections;await s.sso.start({connection_id:e.connection_id,login_redirect_url:l?.loginRedirectURL,signup_redirect_url:l?.signupRedirectURL})}else e({type:"set_organization",organization:t}),e({type:"transition",screen:at})}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},c._({id:"ssoDiscovery.fallback.title",message:"Sorry, we couldn't find any connections"})),rZ.createElement(nZ,null,c._({id:"ssoDiscovery.fallback.content",message:"Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."})),rZ.createElement(id,{as:"form",onSubmit:h,gap:2},rZ.createElement(iN,{id:"organization-slug",hideLabel:!0,label:c._({id:"formField.orgSlug.label",message:"Organization slug"}),value:t,onChange:e=>r(e.target.value),placeholder:c._({id:"formField.orgSlug.label",message:"Organization slug"}),error:n}),rZ.createElement(oZ,{variant:"primary",loading:o,type:"submit",disabled:!t||o},c._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"transition",screen:at})}},c._({id:"ssoDiscovery.fallback.button.reset",message:"Try another method"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{e({type:"navigate_back"})}},c._({id:"button.goBack",message:"Go back"}))))}},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,SSOButton:o9},icons:{google:o2,microsoft:o3,okta:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#191919",fillRule:"evenodd",d:"m10.9 1.13-.37 4.56a5 5 0 0 0-1.19.01l-.2-2.2q0-.12.11-.13h.38l-.18-2.24q.01-.12.11-.13h1.23q.11.01.11.13m-3.09.22q-.04-.1-.15-.08l-1.15.42q-.11.06-.07.16l.94 2.04-.36.13q-.1.06-.06.16l.95 2a4 4 0 0 1 1.12-.42zM5 2.62l2.65 3.73q-.51.33-.9.78l-1.6-1.56a.12.12 0 0 1 .01-.18l.3-.23-1.58-1.6a.12.12 0 0 1 0-.18l.94-.78a.12.12 0 0 1 .17.02M2.77 4.78q-.1-.05-.17.04l-.61 1.06a.12.12 0 0 0 .05.17L4.07 7l-.2.32a.12.12 0 0 0 .06.17l2.02.92q.22-.56.59-1.04zm-1.5 2.88q.03-.11.15-.1l4.42 1.16q-.17.57-.19 1.18l-2.21-.18a.12.12 0 0 1-.1-.14l.06-.37L1.16 9q-.11-.02-.1-.14zm-.16 2.99q-.12.02-.1.14l.2 1.2q.05.12.15.1l2.17-.56.07.37c0 .06.08.1.14.09l2.14-.59q-.19-.56-.22-1.17zm.7 3.17a.12.12 0 0 1 .06-.17L6 11.7q.24.55.62 1.02L4.8 14.01a.12.12 0 0 1-.17-.04l-.19-.33-1.84 1.28q-.1.05-.17-.04zm5.02-.86L3.6 16.21a.12.12 0 0 0 0 .18l.95.79q.1.06.17-.02l1.3-1.84.29.25q.1.07.18-.03l1.26-1.82a5 5 0 0 1-.93-.76m-.64 5.22a.12.12 0 0 1-.07-.16l1.91-4.15q.53.27 1.13.39L8.6 16.4a.12.12 0 0 1-.16.07l-.35-.12-.6 2.16q-.04.1-.15.08zm3.28-3.87-.37 4.56q0 .12.12.13h1.22q.12-.01.12-.13l-.18-2.23h.37q.12-.02.12-.14l-.2-2.2a4 4 0 0 1-1.2.01M13.9 1.97a.12.12 0 0 0-.07-.17l-1.15-.41q-.12-.03-.16.08l-.6 2.16-.35-.13q-.1-.02-.15.08l-.56 2.15q.6.12 1.12.39zm2.5 1.81-3.21 3.26a4 4 0 0 0-.93-.76l1.26-1.83a.12.12 0 0 1 .18-.03l.29.25 1.3-1.83a.12.12 0 0 1 .17-.02l.94.79q.09.08.01.17m1.75 2.56q.1-.05.05-.17l-.62-1.05a.12.12 0 0 0-.17-.04l-1.84 1.27-.2-.32q-.06-.1-.16-.04l-1.82 1.29q.38.46.62 1.02zM18.79 8l.2 1.2a.12.12 0 0 1-.1.15l-4.55.42a4 4 0 0 0-.23-1.17l2.14-.59q.12-.02.15.1l.06.37 2.17-.57q.12-.03.15.1zm-.2 4.43q.1.01.14-.1l.2-1.2a.12.12 0 0 0-.1-.15l-2.23-.2.06-.37a.12.12 0 0 0-.1-.14l-2.22-.18q-.01.6-.19 1.18l4.43 1.15m-1.19 2.75a.12.12 0 0 1-.17.04l-3.77-2.6q.36-.48.59-1.04l2.02.92q.1.06.05.16l-.19.33 2.03.96q.1.05.05.17zm-5.04-1.54 2.65 3.73q.08.08.17.02l.94-.79a.12.12 0 0 0 0-.17l-1.57-1.6.3-.23q.08-.09 0-.18l-1.59-1.56q-.4.46-.9.78m-.02 5.08q-.12.03-.16-.08l-1.2-4.41q.59-.14 1.1-.43l.96 2.01c.03.06 0 .14-.06.16l-.36.13.94 2.04q.04.1-.07.16z",clipRule:"evenodd",className:o0}))}}});nW(".Logo_module_container__f17fe7db{align-items:center;display:flex;gap:var(--st-spacing-2);justify-content:center}.Logo_module_logo__f17fe7db{max-height:50px;max-width:100px}");var sB="Logo_module_logo__f17fe7db";let sN=({orgLogo:e,appLogo:t})=>e||t?rZ.createElement("div",{className:"Logo_module_container__f17fe7db"},e&&rZ.createElement("img",{className:sB,src:e.url,alt:e.alt}),t&&rZ.createElement("img",{className:sB,src:t.url,alt:t.alt})):null,sU=({text:e,onGoBack:t})=>{let{i18n:r,_:n}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"error.title",message:"Looks like there was an error!"}),body:e}),t&&rZ.createElement(oZ,{variant:"outline",onClick:t},r._({id:"button.goBack",message:"Go back"})))},sF=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{type:a,canGoBack:o}=e.error,i=e.flowState.organization?.organization_name,s={[az]:r._({id:"error.default",message:"Something went wrong. Try again later or contact your admin for help."}),[aM]:r._({id:"error.eml",message:"Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."}),[aI]:r._({id:"error.organization",message:"The organization you are looking for could not be found. If you think this is a mistake, contact your admin."}),[aR]:i?r._({id:"error.authPolicyWithOrg",message:"Unable to join due to {organizationName}'s authentication policy. Please contact your admin for more information.",values:{organizationName:i}}):r._({id:"error.authPolicyNoOrg",message:"Unable to join due to the organization's authentication policy. Please contact your admin for more information."}),[aL]:r._({id:"error.adBlockerDetected",message:"The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."}),[aB]:r._({id:"error.claimedDomain",message:"Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."})},l=t1(()=>{if(o)return()=>t({type:"transition",screen:at})},[o,t]);return rZ.createElement(sU,{text:s[a],onGoBack:l})};nW(".Root_module_root__870c11a1{color-scheme:var(--st-color-scheme);font-family:var(--st-font-family);isolation:isolate}:where(.Root_module_root__870c11a1),:where(.Root_module_root__870c11a1) *{box-sizing:border-box;margin:0;padding:0}:where(.Root_module_root__870c11a1) :is(span,strong,em,p,a){font-feature-settings:inherit;font-size:inherit;font-variant:inherit;line-height:inherit}:where(.Root_module_root__870c11a1) :is(span,strong,em,p){color:inherit}:where(.Root_module_root__870c11a1) :is(span,em,p){font-weight:inherit}:where(.Root_module_root__870c11a1) :is(img,svg){display:block}.Root_module_root__870c11a1 a{-webkit-text-decoration:none;text-decoration:none}.Root_module_root__870c11a1 :is(b,strong){font-weight:var(--st-font-weight-bold)}.Root_module_root__870c11a1{--st-font-weight-normal:400;--st-font-weight-medium:500;--st-font-weight-semibold:600;--st-font-weight-bold:700;--st-rounded-md:calc(var(--st-rounded-base)*2);--st-rounded-2xl:calc(var(--st-rounded-base)*6);--st-rounded-full:calc(var(--st-rounded-base)*9999);--st-text-xs:calc(var(--st-text-base)*0.75);--st-text-sm:calc(var(--st-text-base)*0.875);--st-text-2xl:calc(var(--st-text-base)*1.5);--st-line-height-xs:1.33333;--st-line-height-sm:1.42857;--st-line-height-base:1.5;--st-line-height-2xl:1.33333;--st-spacing-0_5:calc(var(--st-spacing)*0.5);--st-spacing-2:calc(var(--st-spacing)*2);--st-spacing-3:calc(var(--st-spacing)*3);--st-spacing-4:calc(var(--st-spacing)*4);--st-spacing-5:calc(var(--st-spacing)*5);--st-spacing-6:calc(var(--st-spacing)*6);--st-spacing-7:calc(var(--st-spacing)*7);--st-spacing-8:calc(var(--st-spacing)*8);--st-spacing-9:calc(var(--st-spacing)*9);--st-spacing-10:calc(var(--st-spacing)*10);--st-tab-background:color-mix(in oklab,var(--st-accent) 80%,transparent);--st-primary-button-hover:color-mix(in oklab,var(--st-primary) 90%,transparent);--st-secondary-button-hover:color-mix(in oklab,var(--st-secondary) 80%,transparent);--st-destructive-button-hover:color-mix(in oklab,var(--st-destructive) 80%,transparent);--st-divider-color:color-mix(in oklab,var(--st-border) 50%,transparent);--st-focus-ring-shadow:0 0 0 3px color-mix(in oklab,var(--st-ring) 50%,transparent);--st-shadow:0 0;--st-shadow-input:var(--st-shadow);--st-shadow-button:var(--st-shadow);--st-button-radius:var(--st-rounded-md);--st-input-radius:var(--st-rounded-md);--st-container-radius:var(--st-rounded-2xl);--st-container-border:var(--st-border);--st-header-font:var(--st-font-family)}"),nW(".inputBase_module_inputBase__06c14ae4{background-color:var(--st-background);border:1px solid var(--st-input);border-radius:var(--st-input-radius);box-shadow:var(--st-shadow-input);color:var(--st-foreground);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm)}.inputBase_module_forceFocusRing__06c14ae4,:is(.inputBase_module_focusRing__06c14ae4,.inputBase_module_inputBase__06c14ae4):focus-visible{border-color:var(--st-ring);box-shadow:var(--st-shadow-input),var(--st-focus-ring-shadow);outline:0}");nW("[dir=rtl] .i18n_module_rtlIcon__278ecfc9{scale:-1 1}.i18n_module_rtlIcon__278ecfc9:dir(rtl){scale:-1 1}"),nW("a.Watermark_module_watermark__6a046c31{align-items:center;border-radius:var(--st-rounded-md);color:var(--st-muted-foreground);display:flex;padding:var(--st-spacing-2) var(--st-spacing-3);transition:background var(--st-transition-duration),color var(--st-transition-duration)}a.Watermark_module_watermark__6a046c31:hover{background:var(--st-accent);color:var(--st-accent-foreground)}a.Watermark_module_watermark__6a046c31 span{font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);line-height:var(--st-line-height-sm)}a.Watermark_module_watermark__6a046c31 svg{height:24px}a.Watermark_module_watermark__6a046c31 path{fill:hsl(218.92,100%,calc(7.25%*(1 + var(--st-dark-mode, 0)*100)))}");let sq=({poweredBy:e,label:t})=>rZ.createElement("a",{className:nj("Watermark_module_watermark__6a046c31","inputBase_module_focusRing__06c14ae4"),href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},rZ.createElement("span",null,e,"\xa0"),rZ.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 47 24","aria-label":t},rZ.createElement("path",{fillRule:"evenodd",d:"M3.58 9.1c0 .86.37 1.26 1.4 1.5v.01l1.36.33c2 .5 2.9 1.47 2.9 3.18 0 2.3-1.56 3.6-4.09 3.6S1.19 16.57 1 14.37h2.19c.14 1.1.83 1.66 1.96 1.66 1.14 0 1.87-.61 1.87-1.56 0-.9-.45-1.35-1.62-1.61l-1.37-.31c-1.22-.3-2.67-1.09-2.67-3.2C1.36 7.35 2.9 6 5.18 6c2.46 0 3.73.98 3.89 2.98H6.79c-.1-.89-.64-1.32-1.64-1.32-.93 0-1.57.56-1.57 1.43Zm31.95 2.84c-.16-.83-.7-1.22-1.68-1.22h-.14c-1.3 0-2.13 1.02-2.13 2.6 0 1.57.84 2.59 2.13 2.59h.14c.98 0 1.52-.39 1.68-1.22h2.15c-.2 1.96-1.58 3.03-3.9 3.03-2.46 0-4.18-1.81-4.18-4.4 0-2.6 1.72-4.41 4.18-4.41 2.32 0 3.7 1.07 3.9 3.03h-2.15Zm-8.5 2.9v-4.17h2.27V8.9h-1.48a.8.8 0 0 1-.8-.8V6h-2.17v2.9h-1.8a1.9 1.9 0 0 0-1.74 1.16l-1.88 4.44-2-4.47a1.9 1.9 0 0 0-1.72-1.13h-2.6a.8.8 0 0 1-.8-.8V6h-2.16v9.47c0 1.47.78 2.25 2.25 2.25h2.06v-1.8h-1.08c-.84 0-1.06-.23-1.06-1.08v-4.17h2.64c.24 0 .42.1.5.28l2.92 6.14v.45c0 .87-.24.9-1.06.9h-2.73v1.85h3.6c1.39 0 2.25-.98 2.25-2.57l.01-.73 2.8-6.04c.08-.18.26-.28.5-.28h1.1v4.8c0 1.47.78 2.25 2.25 2.25h2.12v-1.81H28.1c-.85 0-1.07-.22-1.07-1.07Zm13.7-4.77.15-.18c.5-.62 1.02-.98 2.16-.98 1.93 0 3.04 1.21 3.04 3.33v5.48h-2.16v-5.21c0-.66-.2-1.18-.54-1.51-.29-.27-.67-.4-1.11-.37-1.05.07-1.53.88-1.53 2.56v4.53h-2.17V6h2.17v4.07Z"}),rZ.createElement("path",{d:"M29.82 22.74v.4h-.57v-3.13h.58v1.4c.16-.3.4-.5.73-.5.48 0 .8.42.8 1.11v.06c0 .72-.38 1.12-.82 1.12a.75.75 0 0 1-.72-.46Zm.95-.68v-.02c0-.46-.2-.7-.47-.7-.3 0-.5.25-.5.7v.02c0 .47.19.7.5.7.28 0 .46-.22.46-.7Zm.97 1.88v-.4c.07.02.18.03.28.03.26 0 .41-.1.5-.44l.02-.02h-.3l-.67-2.15h.62l.49 1.74.48-1.74h.6l-.74 2.29c-.18.6-.48.75-.88.75-.16 0-.3-.02-.4-.06Zm3.7-3.16h-.81v-.5h2.23v.5h-.83v2.37h-.59v-2.37Zm1.36.18h.6l.36 1.73.4-1.73h.67l.42 1.7.35-1.7h.59l-.53 2.19h-.78l-.4-1.67-.38 1.67h-.78l-.51-2.2Zm3.71-.67c0-.21.12-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.15-.96h.58v3.15h-.58V20Zm1.1.29c0-.21.11-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.04 1.12v-.06c0-.68.45-1.12 1.08-1.12.64 0 1.08.44 1.08 1.12v.06c0 .7-.45 1.12-1.08 1.12-.67 0-1.09-.43-1.09-1.12Zm1.57-.02v-.02c0-.47-.2-.7-.49-.7s-.5.23-.5.7v.02c0 .47.19.7.5.7.3 0 .49-.22.49-.7Z"})));nW(".MainContainer_module_container__d1278a0c{background-color:var(--st-background);border:1px solid var(--st-container-border);border-radius:var(--st-container-radius);color:var(--st-foreground);max-width:var(--st-container-width);padding:var(--st-spacing-10) var(--st-spacing-9);width:100%}.MainContainer_module_watermarkContainer__d1278a0c{display:flex;justify-content:center}");let sH=({children:e,displayWatermark:t,theme:r})=>{let{i18n:n,_:a}=nO(),o=tQ(null),{className:i,style:s}=function(e,t){let r=e["mobile-breakpoint"],[n,a]=tG(r);tZ(()=>{a(function e(t,r){if(!r)return t;let n=t.replace(/var\s*\([^)]+\)/gi,e=>{let[t,n]=e.match(/\(([^)]+)\)/)[1].split(",").map(e=>e.trim());return window.getComputedStyle(r).getPropertyValue(t)||n||e});return n===t?n:e(n,r)}(r,t.current))},[r,t]);let o=nR(`(max-width: ${n})`);return{style:t1(()=>(function(e){let{"color-scheme":t,...r}=e,n=Object.fromEntries(Object.entries(r).map(([e,t])=>[`--st-${e}`,t]));return"shadcn"===e["color-scheme"]?n["--st-color-scheme"]="inherit":(n["--st-color-scheme"]=t,n["--st-dark-mode"]="dark"===e["color-scheme"]?"1":"0"),n})(e),[e]),className:nj({"-st-mobile":o})}}(r,o);return rZ.createElement(id,{gap:6,style:s,className:nj("MainContainer_module_container__d1278a0c Root_module_root__870c11a1",i),ref:o},e,t&&rZ.createElement("div",{className:"MainContainer_module_watermarkContainer__d1278a0c"},rZ.createElement(sq,{poweredBy:n._({id:"watermark.poweredBy",message:"Powered by"}),label:n._({id:"watermark.altText",message:"Stytch by Twilio"})})),rZ.createElement(iy,null))},sK=({header:e,text:t})=>{let{i18n:r,_:n}=nO(),a=r._({id:"success.title",message:"Success!"}),o=r._({id:"login.success.content",message:"You have successfully logged in."});return tm(sh,{header:e??a,body:t??o,align:"center"})},sj=()=>{let e=aZ();return iR(()=>{e({type:eu.AuthenticateFlowComplete,data:{}})}),tm(sK,null)};nW(".OrganizationRow_module_organizationRow__bee3960a{justify-content:space-between;text-align:left;width:100%}.OrganizationRow_module_left__bee3960a{align-items:center;display:flex;gap:var(--st-spacing-2)}.OrganizationRow_module_nameText__bee3960a{overflow-wrap:anywhere}.OrganizationRow_module_logo__bee3960a{background-color:var(--st-primary);border-radius:var(--st-rounded-base);color:var(--st-primary-foreground);flex:0 0 auto;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);height:var(--st-spacing-6);line-height:calc(var(--st-spacing-6) - 1px);text-align:center;width:var(--st-spacing-6)}.OrganizationRow_module_right__bee3960a{flex:0 0 auto}.OrganizationRow_module_rightContent__bee3960a{align-items:center;color:var(--st-muted-foreground);display:flex;height:var(--st-spacing-6);justify-content:end;min-width:20px}");var s$="OrganizationRow_module_logo__bee3960a";let sV=()=>rZ.createElement("svg",{className:"OrganizationRow_module_arrow__bee3960a i18n_module_rtlIcon__278ecfc9",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M14.707 10L10.3535 14.3545L9.64648 13.6475L12.793 10.5H6V9.5H12.793L9.64648 6.35352L10.3535 5.64648L14.707 10Z",fill:"currentColor"})),sW=({organization:e,action:t,onClick:r})=>{let{organization_name:n,organization_logo_url:a}=e,o=a?rZ.createElement("img",{className:s$,src:a,alt:""}):rZ.createElement("div",{className:s$,role:"presentation"},Array.from(n)[0]);return rZ.createElement("button",{className:nj("OrganizationRow_module_organizationRow__bee3960a","VerticalTransition_module_hoverTrigger__9366f503",oG({variant:"outline"})),onClick:r},rZ.createElement("div",{className:"OrganizationRow_module_left__bee3960a"},o,rZ.createElement("div",{className:"OrganizationRow_module_nameText__bee3960a"},n)),rZ.createElement(ii,{trigger:"hover",rootClassName:"OrganizationRow_module_right__bee3960a",className:"OrganizationRow_module_rightContent__bee3960a",primary:t&&rZ.createElement(nJ,null,t),secondary:rZ.createElement(sV,null)}))},sG=e=>"eligible_to_join_by_email_domain"===e||"eligible_to_join_by_oauth_tenant"===e,sY=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{createOrganizationEnabled:a}=oI(),{i18n:o,_:i}=nO(),s=()=>t({type:"transition",screen:at}),{trigger:l,isMutating:c}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),d=a&&n.directCreateOrganizationForNoMembership;if(tZ(()=>{d&&l()},[d,l]),d||c)return rZ.createElement(i4,null);let u=e.formState.discoveryState.email;return a&&!n.disableCreateOrganization?rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.create.title",message:"Create an organization to get started"})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.create.content",message:"{email} does not have an account. Think this is a mistake? Try a different email address, or contact your admin.",values:{email:u}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>l()},o._({id:"button.createAnOrganization",message:"Create an organization"})),rZ.createElement(oZ,{variant:"ghost",onClick:s},o._({id:"button.goBack",message:"Go back"})))):rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.title",message:"{email} does not belong to any organizations.",values:{email:u}})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.content",message:"Make sure your email address is correct. Otherwise, you might need to be invited by your admin."})),rZ.createElement(oZ,{variant:"outline",onClick:s},o._({id:"button.tryDifferentEmailAddress",message:"Try a different email address"})))},sZ=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{i18n:a,_:o}=nO(),i=!!n.directLoginForSingleMembership?.status,{createOrganizationEnabled:s}=oI();tZ(()=>{if(u)return;let t=((e,t)=>{if(!t?.status)return null;let r=e.filter(e=>"active_member"===e.membership.type),n=e.some(e=>("pending_member"===e.membership.type||"invited_member"===e.membership.type)&&!t.ignoreInvites||sG(e.membership.type)&&!t.ignoreJitProvisioning);return 1!==r.length||n?null:r[0]})(e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership);i&&null!==t&&l(t)},[i,e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership]);let l=e=>{let r=e.organization;if(e.primary_required){let n=e.primary_required.allowed_auth_methods;n&&1===n.length&&"sso"===n[0]&&r.sso_default_connection_id?c(r.sso_default_connection_id):t({type:"select_discovered_organization",discoveredOrganization:e})}else d({organizationId:r.organization_id})},c=t0(e=>{r.sso.start({connection_id:e,login_redirect_url:n.ssoOptions?.loginRedirectURL,signup_redirect_url:n.ssoOptions?.signupRedirectURL})},[r,n.ssoOptions]),{trigger:d,isMutating:u}=oM("stytch.discovery.intermediateSessions.exchange",(e,{arg:{organizationId:t}})=>r.discovery.intermediateSessions.exchange({organization_id:t,session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),{trigger:h,isMutating:m}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}});if(u)return rZ.createElement(i3,null);if(m)return rZ.createElement(i4,null);if(0===e.formState.discoveryState.discoveredOrganizations.length)return rZ.createElement(sY,null);let p=e.formState.discoveryState.discoveredOrganizations.map(e=>{let t,{organization:r,membership:n}=e;return sG(n.type)||"pending_member"===n.type?t=a._({id:"organizationDiscovery.join",message:"Join"}):"invited_member"===n.type&&(t=a._({id:"organizationDiscovery.acceptInvite",message:"Accept Invite"})),rZ.createElement(sW,{key:r.organization_id,organization:r,action:t,onClick:()=>l(e)})}),_=s&&!n.disableCreateOrganization?rZ.createElement(oZ,{variant:"outline",onClick:()=>h()},a._({id:"button.createAnOrganization",message:"Create an organization"})):null,g=rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"transition",screen:at})},a._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"organizationDiscovery.title",message:"Select an organization to continue"})),_?rZ.createElement(iw,{top:p,bottom:rZ.createElement(rZ.Fragment,null,_,g)}):rZ.createElement(id,{gap:4},rZ.createElement(iw,null,p),g))},sJ=e=>e===aP||e===aT,sQ=()=>{var e;let t,r,n,a,o,{options:i}=t2(nq),[l]=t2(aW).state,{i18n:c,_:d}=nO(),{primaryAuthMethods:u,email:h,emailVerified:m}=l.primary,p=t2(aW).config,{products:_}=iG(),g=l.flowState.type===s.Organization&&!l.flowState.organization,f=(r=(e=l.flowState).type,a=((n=new Set(_.map(e=>e.id))).has("emailMagicLinks")||n.has("emailOtp"))&&n.has("passwords"),o=r===s.Organization?aA:ax,Array.from(_.reduce((t,n)=>{switch(n.id){case"emailMagicLinks":case"emailOtp":a?t.add(o):t.add(r===s.Organization?aE:aC);break;case"oauth":t.add(aP);break;case"sso":(r===s.Discovery||r===s.Organization&&(e.organization?.sso_active_connections?.length??0)>0)&&t.add(aT);break;case"passwords":t.add(a?o:aO)}return t},new Set)).reduce((e,t,r,n)=>{let a=r>0?n[r-1]:void 0;if(a&&sJ(t)&&sJ(a))e[e.length-1].push(t);else{let r=e.length>0?e[e.length-1]:void 0;r&&sJ(r[0])!==sJ(t)&&e.push([aD]),e.push([t])}return e},[])),y=oN(p,"mainScreen"),{SsoAndOAuthButtons:v}=oN(p,"ssoAndOAuthButtons"),b=l.flowState.organization?.organization_name;switch(l.flowState.type){case s.Discovery:t=c._({id:"login.title",message:"Sign up or log in"});break;case s.PasswordReset:t="";break;default:t=b?c._({id:"organizationLogin.title",message:"Continue to {organizationName}",values:{organizationName:b}}):c._({id:"organizationLogin.titleUnknown",message:"Continue to ..."})}return g?rZ.createElement(i4,null):rZ.createElement(id,{gap:6},!i.hideHeaderText&&(h&&!1===m&&u?rZ.createElement(rZ.Fragment,null,rZ.createElement(nZ,{variant:"header"},c._({id:"emailVerification.title",message:"Verify your email"})),rZ.createElement(nZ,null,c._({id:"emailVerification.content",message:"Confirm your email address with one of the following:"}))):t&&rZ.createElement(nZ,{variant:"header",align:"center"},t)),rZ.createElement(id,{gap:4},f.map(e=>e.every(sJ)?rZ.createElement(v,{key:"buttons",buttons:e}):e.map((e,t)=>{let r=y[e];return r?rZ.createElement(r,{key:e}):e===aD?rZ.createElement(ib,{key:"divider"+t}):null}))))},sX={[d.totp]:{messageDescriptor:{id:"mfa.enrollment.option.totp",message:"Use an authenticator app"},screen:af},[d.smsOtp]:{messageDescriptor:{id:"mfa.enrollment.option.sms",message:"Text me a code"},screen:ap}},s1=()=>{let{i18n:e,_:t}=nO(),{mfaProductInclude:r,mfaProductOrder:n}=t2(aW).config,[a,o]=t2(aW).state,{organizationMfaOptionsSupported:i}=a.mfa.primaryInfo,s=t1(()=>{let e=aU({allMethods:aj,orgSupportedMethods:i,uiIncludedMethods:r}),t=[];for(let r of n??aj)e.has(r)&&(t.push(r),e.delete(r));return t.push(...e),t},[r,n,i]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e._({id:"mfa.enrollment.title",message:"Set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},e._({id:"mfa.enrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(iw,null,s.map(t=>{let{messageDescriptor:r,screen:n}=sX[t];return rZ.createElement(oZ,{key:t,variant:"outline",onClick:()=>{o({type:"transition",screen:n,history:"push"})}},e._(r))})))};nW(".RecoveryCodeEntryScreen_module_input__0b7ea085.RecoveryCodeEntryScreen_module_input__0b7ea085{font-family:var(--st-font-family-mono)}");let s0=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{memberId:i,organizationId:s}=a.mfa.primaryInfo,{trigger:l,isMutating:c,error:d}=oM("stytch.recoveryCodes.recover",(t,{arg:{recoveryCode:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.recoveryCodes.recover({recovery_code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{throwOnError:!1,onSuccess:()=>{o({type:"recovery_code/authenticate_success"})}}),[u,h]=tG(""),m=d?r._({id:"recoveryCodes.entry.error.invalidCode",message:"Invalid backup code, please try again."}):void 0,p=async e=>{e.preventDefault(),l({recoveryCode:u,memberId:i,organizationId:s,sessionDurationMinutes:t})};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},r._({id:"recoveryCodes.entry.title",message:"Enter backup code"})),rZ.createElement(nZ,{variant:"body"},r._({id:"recoveryCodes.entry.content",message:"Enter one of the backup codes you saved when setting up your authenticator app."})),rZ.createElement(iN,{id:"recovery-code",className:"RecoveryCodeEntryScreen_module_input__0b7ea085",value:u,onChange:e=>{h(e.target.value)},placeholder:r._({id:"formField.backupCode.placeholder",message:"Enter backup code"}),label:r._({id:"formField.backupCode.ariaLabel",message:"Backup code"}),hideLabel:!0,required:!0,autoComplete:"off",spellCheck:!1,error:m}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:c,type:"submit",disabled:!u||c},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"}))))};nW(".CodeContainer_module_container__1b0ae913{background:var(--st-accent);padding:var(--st-spacing-2) var(--st-spacing-4)}");let s2=({children:e,className:t,...r})=>rZ.createElement("div",{className:nj(t,"CodeContainer_module_container__1b0ae913"),...r},e);nW(".RecoveryCodeSaveScreen_module_codes__5283da32{column-gap:4ch;display:grid;grid-template-columns:repeat(auto-fill,var(--st-max-code-length));justify-content:center;list-style:none;margin:0 auto;max-width:calc(var(--st-max-code-length)*2 + 4ch)}.RecoveryCodeSaveScreen_module_codes__5283da32 li{-webkit-user-select:all;user-select:all;white-space:nowrap}");let s3=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{recoveryCodes:a}=e.mfa.totp.enrollment,o=t1(()=>{let e="Win32"===navigator.platform?"\r\n":"\n",t=new Blob([a.join(e)],{type:"text/plain"});return URL.createObjectURL(t)},[a]),i=e.flowState.organization?.organization_name,s=i?r._({id:"recoveryCodes.filename.withOrganizationName",message:"{organizationName}-backup-codes",values:{organizationName:i}}):r._({id:"recoveryCodes.filename.noOrganizationName",message:"backup-codes"}),[l,c]=io(3),d=async()=>{try{await navigator.clipboard.writeText(a.join("\n")),c(!0)}catch{im({message:r._({id:"recoveryCodes.save.toast.copyFailed",message:"Couldn't copy codes to clipboard"})})}},u=Math.max(...a.map(e=>e.length));return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"recoveryCodes.save.title",message:"Save your backup codes!"}),body:r._({id:"recoveryCodes.save.content",message:"This is the only time you will be able to access and save your backup codes."})}),rZ.createElement(s2,null,rZ.createElement(nZ,{font:"mono"},rZ.createElement("ul",{className:"RecoveryCodeSaveScreen_module_codes__5283da32",style:{"--st-max-code-length":u+"ch"}},a.map((e,t)=>rZ.createElement("li",{key:t},e))))),rZ.createElement(iw,null,rZ.createElement(oJ,{variant:"primary",href:o,download:s+".txt"},rZ.createElement(ii,{primary:r._({id:"recoveryCodes.save.button.download",message:"Download .txt file"}),secondary:r._({id:"recoveryCodes.save.button.copied",message:"Copied!"}),triggered:l})),rZ.createElement(oZ,{variant:"outline",onClick:d},r._({id:"recoveryCodes.save.button.copyAll",message:"Copy all to clipboard"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"recovery_code/save_acknowledge"})}},r._({id:"recoveryCodes.save.button.done",message:"Done"}))))},s4=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),1e4))]);if(!n)return t;return n.national}catch{return t}},s5=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{let n=eA[r],a={isValid:!0,number:`+${n}${t}`};try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),2e3))]);if(!n)return a;return n}catch{return a}};nW(".PhoneInput_module_container__5c1958d4{display:grid;gap:var(--st-spacing-2);grid-template-columns:calc(var(--st-spacing)*22.5) 1fr}.PhoneInput_module_phone__5c1958d4{grid-area:1/2/2/3}.PhoneInput_module_select__5c1958d4{appearance:none;grid-area:1/1/2/2;padding-block:var(--st-spacing-2);padding-inline:var(--st-spacing-3) var(--st-spacing-6)}.-st-mobile .PhoneInput_module_select__5c1958d4{padding-block:var(--st-spacing-3)}.PhoneInput_module_chevron__5c1958d4{color:var(--st-muted-foreground);grid-area:1/1/2/2;margin-inline-end:var(--st-spacing-2);place-self:center end;pointer-events:none;rotate:90deg}.PhoneInput_module_error__5c1958d4{grid-area:2/1/3/3}");let s8="(201) 555-0123",s6=({phone:e,setPhone:t,country:r,setCountry:n,parsePhoneNumber:a,getExampleNumber:o,hasPasskeys:i,error:s,...l})=>{let c,{i18n:d,_:u}=nO(),h=(c=iM(),s?{error:{id:c},input:{"aria-errormessage":c,"aria-invalid":!0}}:{error:{id:c},input:{}}),m=new Intl.DisplayNames(["en"],{type:"region"}),[p,_]=tG(s8),g=tQ(null),[f,y]=tG(e);return rZ.createElement("div",{className:"PhoneInput_module_container__5c1958d4"},rZ.createElement("select",{"aria-label":d._({id:"formField.countryCode.label",message:"Country code"}),className:"PhoneInput_module_select__5c1958d4 inputBase_module_inputBase__06c14ae4",autoComplete:"tel-country-code",value:r,onChange:async e=>{let t=e.target.value;n(t),g.current?.focus();let a=await Promise.race([o(r),new Promise(e=>setTimeout(()=>e(void 0),100))]);t===e.target.value&&_(a??s8)}},Object.entries(eA).map(([e,t])=>rZ.createElement("option",{key:e,value:e},e!==r?`+${t} ${m.of(e)}`:`+${t}`))),rZ.createElement(o8,{className:"PhoneInput_module_chevron__5c1958d4",role:"presentation"}),rZ.createElement(iN,{id:"phone-input",label:d._({id:"formField.phone.label",message:"Phone number"}),hideLabel:!0,ref:g,type:"tel",autoComplete:i?"username webauthn":"tel-national",containerClassName:"PhoneInput_module_phone__5c1958d4",value:f,placeholder:p,onChange:async e=>{let n=e.target.value;y(n);let o=await s4({parsePhoneNumber:a,phoneNumber:n,country:r});n===e.target.value&&(t(o),y(o))},required:!0,...h.input,...i?iz:{},...l}),s&&rZ.createElement("div",{className:"PhoneInput_module_error__5c1958d4"},rZ.createElement(iB,h.error,s)))};class s7 extends b{constructor(){super("InvalidPhoneNumberError","Invalid phone number")}}let s9=()=>{let e,t=t2(aW).client,[r,n]=t2(aW).state,{i18n:a,_:o}=nO(),{smsOtpOptions:i}=t2(aW).config,{mfa:{smsOtp:{isSending:s,sendError:l,enrolledNumber:c}}}=r,{memberId:d,organizationId:u}=r.mfa.primaryInfo,[h,m]=rZ.useState(c?.countryCode??"US"),[p,_]=rZ.useState(c?.phoneNumber??""),g=rZ.useMemo(()=>{if(l)return l instanceof s7?a._({id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."}):ic(l,o)},[l,o]),{parsePhoneNumber:f,getExampleNumber:y}=(e=r1(t).clientsideServices,{getExampleNumber:t=>e.getExamplePhoneNumber({regionCode:t}).then(e=>e.phoneNumber),parsePhoneNumber:(t,r)=>e.parsedPhoneNumber({phoneNumber:t,regionCode:r})}),{trigger:v}=oM("stytch.otps.sms.send",async(e,{arg:{parsedNumber:r,locale:n}})=>t.otps.sms.send({mfa_phone_number:r,member_id:d,organization_id:u,locale:n}),{onSuccess:e=>{n({type:"sms_otp/send_success",response:e,countryCode:h,phoneNumber:p,formattedPhoneNumber:`+${eA[h]} ${p}`})},onError:e=>{n({type:"sms_otp/send_error",error:e})}}),b=async e=>{e.preventDefault(),n({type:"sms_otp/send"});try{let e=await s5({parsePhoneNumber:f,phoneNumber:p,country:h});if(!e.isValid)throw new s7;await v({parsedNumber:e.number,locale:i?.locale})}catch(e){n({type:"sms_otp/send_error",error:e})}};return rZ.createElement(id,{as:"form",gap:6,onSubmit:b},rZ.createElement(nZ,{variant:"header"},a._({id:"mfa.smsEnrollment.title",message:"Enter your phone number to set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},a._({id:"mfa.smsEnrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(s6,{country:h,setCountry:m,phone:p,setPhone:_,parsePhoneNumber:f,getExampleNumber:y,error:g}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:s,type:"submit",disabled:!p||s},a._({id:"button.continue",message:"Continue"})),r.screenHistory.length>0&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>n({type:"navigate_back"})},a._({id:"button.goBack",message:"Go back"}))))},le=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t},smsOtpOptions:r}=t2(aW).config,{i18n:n,_:a}=nO(),[o,i]=t2(aW).state,{mfa:{isEnrolling:s,smsOtp:l,primaryInfo:c}}=o,{codeExpiration:u,formattedDestination:h}=l,{enrolledMfaMethods:m,memberId:p,memberPhoneNumber:_,organizationId:g,organizationMfaOptionsSupported:f}=c,y=ie(),{trigger:v,isMutating:b,error:w}=oM("stytch.otps.sms.send",(t,{arg:{memberId:r,organizationId:n,locale:a}})=>(i({type:"sms_otp/send"}),e.otps.sms.send({member_id:r,organization_id:n,locale:a})),{onSuccess:e=>{i({type:"sms_otp/send_success",response:e})},onError:e=>{let t=ic(e,a);t&&im({message:t}),i({type:"sms_otp/send_error",error:t})},throwOnError:!0}),{trigger:k,isMutating:S,error:E}=oM("stytch.otps.sms.authenticate",(t,{arg:{otp:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.sms.authenticate({code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{onSuccess:()=>{i({type:"sms_otp/authenticate_success"})},onError:()=>{y.clear()}}),C=null===u&&!b&&!w;tZ(()=>{C&&v({memberId:p,organizationId:g,locale:r?.locale}).catch(()=>{})},[p,g,v,C,r?.locale]),tZ(()=>{!h&&_&&(async()=>{i({type:"sms_otp/format_destination",formattedPhoneNumber:await s4({parsePhoneNumber:t=>r1(e).clientsideServices.parsedPhoneNumber({phoneNumber:t}),phoneNumber:_})})})()},[i,h,e,_]);let P=t1(()=>!s&&m.includes(d.totp)&&(0===f.length||f.includes(d.totp)),[m,s,f]),T=E?n._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0,O=t1(()=>s||0===m.length||f.length>0&&!m.some(e=>f.includes(e)),[m,s,f]),A=async()=>{await v({memberId:p,organizationId:g,locale:r?.locale})},x=rZ.createElement(i5,{countdown:y,isSubmitting:S,resendOTP:A}),D=P&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"transition",history:"push",screen:ay})}},n._({id:"mfa.methods.authenticatorApp",message:"Use an authenticator app"})),z=O&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"navigate_back"})}},n._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},null!==u?rZ.createElement(sp,{isSubmitting:S,onSubmit:e=>{k({otp:e,memberId:p,organizationId:g,sessionDurationMinutes:t})},errorMessage:T,expiration:u.getTime(),formattedDestination:h??_??""}):rZ.createElement(i4,null),D&&z?rZ.createElement(iw,{top:x,bottom:rZ.createElement(rZ.Fragment,null,D,z)}):rZ.createElement(iw,null,x,D,z))};nW(".TOTPEnrollManualScreen_module_codeContainer__dc7a0e56{cursor:pointer}.TOTPEnrollManualScreen_module_code__dc7a0e56{column-gap:1ch;display:grid;grid-template-columns:repeat(var(--st-column-count,auto-fill),var(--st-chunk-size,4ch));justify-content:center}");let lt=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),[a,o]=io(3),{secret:i}=e.mfa.totp.enrollment,s=i.toLowerCase(),l=s.split(RegExp("(.{4})","g")).filter(Boolean),{codeRef:c,columnCount:d}=function(e){let t=tQ(null),[r,n]=tG();return tJ(()=>{let r=()=>{if(!t.current)return;let r=Math.floor(t.current.clientWidth/Math.max(...Array.from(t.current.querySelectorAll("span")).map(e=>e.clientWidth))),a=Math.ceil(e/(r-Math.floor(r/4)));n(Math.ceil(e/a))};if(r(),!window.ResizeObserver||!t.current)return;let a=new ResizeObserver(r);return a.observe(t.current),()=>a.disconnect()},[e]),{codeRef:t,columnCount:r}}(l.length),u=async()=>{try{await navigator.clipboard.writeText(s),o(!0)}catch{im({message:r._({id:"mfa.totpEnrollment.toast.copyFailed",message:"Couldn't copy code to clipboard"})});let e=window.getSelection();if(c.current&&e){e.empty();let t=document.createRange();t.selectNodeContents(c.current),e.addRange(t)}}};return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"mfa.totpEnrollment.title",message:"Having trouble scanning the QR code?"}),body:r._({id:"mfa.totpEnrollment.content",message:"Click to copy the code below. Enter into your authenticator app to link your account."})}),rZ.createElement(s2,{className:"TOTPEnrollManualScreen_module_codeContainer__dc7a0e56",onClick:u},rZ.createElement(nZ,{ref:c,className:"TOTPEnrollManualScreen_module_code__dc7a0e56",style:{"--st-column-count":d,"--st-chunk-size":"4ch"},font:"mono"},l.map((e,t)=>rZ.createElement("span",{key:t},e)))),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:u},rZ.createElement(ii,{primary:r._({id:"mfa.totpEnrollment.copyCode.label",message:"Copy to clipboard"}),secondary:r._({id:"mfa.totpEnrollment.copyCode.codeCopied",message:"Copied!"}),triggered:a})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{t({type:"transition",history:"push",screen:ay})}},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"navigate_back"})},r._({id:"button.totpQrRetry",message:"Try to scan the QR code again"}))))};nW(".TOTPEnrollQRScreen_module_qr__ae8d607c{display:block;margin:0 auto}");let lr=()=>{let e=t2(aW).client,[t,r]=t2(aW).state,n=aZ(),a=aY(),{i18n:o,_:i}=nO(),{memberId:s,organizationId:l}=t.mfa.primaryInfo,{data:c}=ox(["stytch.totp.create",s,l],()=>e.totp.create({member_id:s,organization_id:l}),{revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,onSuccess:e=>{n({type:eu.B2BTOTPCreate,data:e}),r({type:"totp/create_success",response:e,memberId:s,organizationId:l})},onError:e=>{let t=ic(e,i);t&&im({message:t}),a(e)}});return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"totp.setupQr.title",message:"Scan the QR code to link your authenticator app"})),rZ.createElement(nZ,{variant:"body"},o._({id:"totp.setupQr.content",message:"Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."})),c?rZ.createElement(rZ.Fragment,null,rZ.createElement("img",{alt:o._({id:"mfaTotpEnrollment.qrAltText",message:"QR code for TOTP enrollment"}),src:c.qr_code,className:"TOTPEnrollQRScreen_module_qr__ae8d607c"}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>{r({type:"transition",history:"push",screen:ay})}},o._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{r({type:"totp/show_code",method:"manual"})}},o._({id:"button.totpQrManual",message:"Having trouble scanning?"})))):rZ.createElement(i4,null))},ln=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{mfa:{isEnrolling:i}}=a,{enrolledMfaMethods:s,memberId:l,organizationId:c,organizationMfaOptionsSupported:u}=a.mfa.primaryInfo,{trigger:h,isMutating:m,error:p}=oM("stytch.totp.authenticate",(t,{arg:{memberId:r,organizationId:n,otp:a,sessionDurationMinutes:o}})=>e.totp.authenticate({code:a,member_id:r,organization_id:n,session_duration_minutes:o}),{onSuccess:()=>{o({type:"totp/authenticate_success"})}}),_=t1(()=>!i&&s.includes(d.smsOtp)&&(0===u.length||u.includes(d.smsOtp)),[s,i,u]),g=p?r._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0;return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"totp.title",message:"Enter verification code"}),instruction:r._({id:"totp.content",message:"Enter the 6-digit code from your authenticator app."}),helperContent:i?r._({id:"mfa.totpEntry.getNewCode",message:"If the verification code doesn’t work, go back to your authenticator app to get a new code."}):null,isSubmitting:m,onSubmit:e=>h({memberId:l,organizationId:c,otp:e,sessionDurationMinutes:t}),errorMessage:g}),rZ.createElement(iw,{top:null,bottom:rZ.createElement(rZ.Fragment,null,_&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:a_})}},r._({id:"mfa.totpEntry.switchToSms",message:"Text me a code instead"})),!i&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:ah})}},r._({id:"mfa.totpEntry.useBackupCode",message:"Use a backup code"})),i&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"})))}))},la={discovery:{mutationKey:"stytch.magicLinks.discovery.authenticate",onSuccess:oL,defaultError:aM},discovery_oauth:{mutationKey:"stytch.oauth.discovery.authenticate",onSuccess:oL},oauth:{mutationKey:"stytch.oauth.authenticate",onSuccess:oR},sso:{mutationKey:"stytch.sso.authenticate",onSuccess:oR},multi_tenant_magic_links:{mutationKey:"stytch.magicLinks.authenticate",onSuccess:oR,defaultError:aM},multi_tenant_impersonation:{mutationKey:"stytch.impersonation.authenticate",onSuccess:oR}},lo={ad_blocker_detected:aL},li=()=>{let e,[t,r]=t2(aW).state,n=t2(aW).client,a=aY(),o=aZ(),i=t2(aW).config,{displayWatermark:l,theme:c,options:d}=t2(nq),u=oU(),h=t.screen,m=oN(i,"screens"),[p,_]=tG(!1),{mutate:g}=a9(oS,t2(oE)),{slug:f,resultPending:y}=(()=>{let[e,t]=t2(aW).state,[r,n]=tG(),a=t2(aW).config,o=t2(aW).client,i=a.organizationSlug??((e,t)=>{if(null===e)return null;let r=new URL(t);r.search="";let n=r.toString().trim(),a=new RegExp(e.replace(/\./g,"\\.").replace(/\*/g,"(?:[^.]+)").replace("{{slug}}","(.+)")),o=n.match(a);return o&&o[1]?o?.[1]:null})(r||null,window.location.href),{trigger:l,isMutating:c}=oM("stytch.organization.getBySlug",(e,{arg:{slug:t}})=>o.organization.getBySlug({organization_slug:t}),{onSuccess:({organization:e})=>{null===e?t({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}):t({type:"set_organization",organization:{...e}})}});return tZ(()=>{r1(o).bootstrap.getAsync().then(({slugPattern:e})=>{n(e)})},[o]),tZ(()=>{null!==i&&null===e.flowState.organization&&e.screen===at&&e.flowState.type==s.Organization&&l({slug:i})},[i,e.flowState,e.screen]),{slug:i,resultPending:void 0===r||c}})();if(tZ(()=>{if(u||t.flowState.type==s.PasswordReset)return;let e=n.parseAuthenticateUrl();if(!e?.handled)return;let{mutationKey:l,defaultError:c,onSuccess:d}=la[e.tokenType];_(!0),g(l,n.authenticateByUrl({session_duration_minutes:i.sessionOptions.sessionDurationMinutes})).then(e=>{if(!e?.handled)return;let{data:t}=e,n=oz[l];n&&o({type:n,data:t}),d(t,r,i)},e=>{a(e),((e,t=az)=>{r({type:"set_error_message_and_transition",errorType:lo[is(e)]??t,canGoBack:!1})})(e,c)}).finally(()=>_(!1))},[]),tZ(()=>{if(u||p)return;let e=n.parseAuthenticateUrl();!e?.handled&&(f||y||null!==t.flowState.organization||t.screen!==at||t.flowState.type!=s.Organization||r({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}))},[r,u,p,y,f,t.flowState.organization,t.flowState.type,t.screen,n,a]),u)return rZ.createElement(o1,null);if(p)return rZ.createElement(sH,{theme:c,displayWatermark:!1},rZ.createElement(i3,null));if(t.flowState.organization?.organization_logo_url){let{organization_name:r,organization_logo_url:n}=t.flowState.organization;e={url:n,alt:r??""}}let v={[at]:sQ,[an]:sj,[aa]:sZ,[ao]:sF,[au]:s1,[ap]:s9,[a_]:le,[ah]:s0,[am]:s3,[af]:lr,[ag]:lt,[ay]:ln}[h]??m[h];return rZ.createElement(sH,{theme:c,displayWatermark:l},rZ.createElement(sN,{appLogo:d.logo,orgLogo:e}),rZ.createElement(v,null))},ls=({client:e,presentation:t,callbacks:r,config:n,strings:a})=>{let[o,i]=tG(()=>{let{displayWatermark:t}=r1(e).bootstrap.getSync();return t});tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_login_screen",details:{options:n,bootstrap:t}}),i(t.displayWatermark)})},[e]);let c=new URL(window.location.href).searchParams.get("stytch_redirect_type")===l.ResetPassword?s.PasswordReset:n.authFlowType,d={...aV,screen:c===s.PasswordReset?as:at,flowState:{...aV.flowState,type:c}},u=t1(()=>({...n,sessionOptions:n.sessionOptions??{}}),[n]),h=nF(t,o,u,"B2BProduct");return rZ.createElement(aG,{client:e,callbacks:r,config:u,initialState:d},rZ.createElement(nq.Provider,{value:h},rZ.createElement(nD,{messages:rQ,overrides:a},rZ.createElement(li,null))))},ll={text:"Verify your identity",details:["View information stored within your account"]},lc={text:"Maintain access to your data even when you're not actively using the app",details:["Access your data even when you are offline.","Synchronize data and process background tasks on your behalf."]},ld="openid",lu="profile",lh="email",lm="phone",lp="offline_access",l_=new Set([ld,lu,lh,lm,"full_access",lp]),lg=[ld,lh,lu],lf=(e,t)=>{if(!t)return[];let r=[];for(let n of e){if(l_.has(n))continue;let e=t.scopes.find(e=>e.scope===n);e&&e.description?r.push(e.description):r.push(`Use the ${n} scope`)}return r},ly=e=>{let t={client_id:"",redirect_uri:"",response_type:"code",scopes:[...lg]};for(let r of["client_id","redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}for(let r of["response_type","scope","code_challenge","state","nonce","prompt"]){let n=e.get(r);n&&("scope"===r?t.scopes=n.split(" ").filter(Boolean):t[r]=n)}return e.has("resource")&&(t.resources=e.getAll("resource")),{error:null,result:t}},lv=e=>{let t={client_id:"",post_logout_redirect_uri:""};for(let r of["client_id","post_logout_redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}return t.id_token_hint=e.get("id_token_hint")||void 0,t.state=e.get("state")||void 0,{error:null,result:t}};nW(".IDPConsentManifest_module_manifest__9dc43278 details{overflow:clip}.IDPConsentManifest_module_manifest__9dc43278 summary,.IDPConsentManifest_module_summaryNoDetail__9dc43278{align-items:center;display:flex;justify-content:space-between}.IDPConsentManifest_module_manifest__9dc43278 summary{cursor:pointer;outline:0}.IDPConsentManifest_module_manifest__9dc43278 details,.IDPConsentManifest_module_summaryNoDetail__9dc43278{padding:var(--st-spacing-2) var(--st-spacing-3)}.IDPConsentManifest_module_summaryNoDetail__9dc43278{min-height:var(--st-spacing-9)}.IDPConsentManifest_module_ungrantable__9dc43278{background:var(--st-muted)}.IDPConsentManifest_module_outerList__9dc43278 details,.IDPConsentManifest_module_ungrantable__9dc43278{border-radius:var(--st-rounded-md)}.IDPConsentManifest_module_outerList__9dc43278 details:has(:focus-visible),.IDPConsentManifest_module_ungrantable__9dc43278:has(:focus-visible){box-shadow:var(--st-focus-ring-shadow)}@supports not selector(:has(:focus-visible)){.IDPConsentManifest_module_outerList__9dc43278 details:focus-within,.IDPConsentManifest_module_ungrantable__9dc43278:focus-within{box-shadow:var(--st-focus-ring-shadow)}}.IDPConsentManifest_module_borderBetween__9dc43278:not(:last-child){border-bottom:1px solid var(--st-border)}.IDPConsentManifest_module_outerList__9dc43278{list-style:none}.IDPConsentManifest_module_nestedList__9dc43278{list-style:disc;padding-block:var(--st-spacing) var(--st-spacing-2);padding-inline-start:var(--st-spacing-4)}.IDPConsentManifest_module_chevron__9dc43278{flex-shrink:0;transition:transform var(--st-transition-duration) ease}details[open] .IDPConsentManifest_module_chevron__9dc43278{transform:rotate(90deg)}");var lb={manifest:"IDPConsentManifest_module_manifest__9dc43278",summaryNoDetail:"IDPConsentManifest_module_summaryNoDetail__9dc43278",ungrantable:"IDPConsentManifest_module_ungrantable__9dc43278 IDPConsentManifest_module_manifest__9dc43278",outerList:"IDPConsentManifest_module_outerList__9dc43278",borderBetween:"IDPConsentManifest_module_borderBetween__9dc43278",nestedList:"IDPConsentManifest_module_nestedList__9dc43278 IDPConsentManifest_module_borderBetween__9dc43278",chevron:"IDPConsentManifest_module_chevron__9dc43278 i18n_module_rtlIcon__278ecfc9"};let lw=({item:e,as:t="li"})=>{"string"==typeof e&&(e={text:e});let r=rZ.createElement(nZ,{variant:"helper"},e.text);return e.details?.length?rZ.createElement(t,{className:lb.borderBetween},rZ.createElement("details",{className:lb.details},rZ.createElement("summary",{onClick:lC},r,rZ.createElement(o8,{className:lb.chevron,role:"presentation"})),rZ.createElement("ul",{className:lb.nestedList},e.details?.map(e=>rZ.createElement(nZ,{as:"li",variant:"helper",key:e},e))))):rZ.createElement(t,{className:nj(lb.summaryNoDetail,lb.borderBetween)},r)},lk=({section:e})=>rZ.createElement(id,{gap:2},rZ.createElement(nZ,{weight:"medium"},e.header),rZ.createElement("ul",{className:lb.outerList},e.items.map((e,t)=>rZ.createElement(lw,{key:t,item:e})))),lS=({manifest:e,clientName:t})=>{let{i18n:r,_:n}=nO(),a="object"==typeof e[0]&&"header"in e[0]?e:[{header:r._({id:"idpConsent.allowClientTo",message:"Allow {clientName} to:",values:{clientName:t}}),items:e}];return rZ.createElement("div",{className:lb.manifest},a.map((e,t)=>rZ.createElement(lk,{key:t,section:e})))},lE=({clientName:e,ungrantableScopeDescriptions:t})=>{let{i18n:r,_:n}=nO();if(!t.length)return null;let a={text:r._({id:"idpConsent.noPermissionsToGrant",message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:e}}),details:t};return rZ.createElement("div",{className:lb.ungrantable},rZ.createElement(lw,{item:a,as:"div"}))};function lC(e){let t=e.currentTarget.parentElement;if(t?.tagName!=="DETAILS")return;e.preventDefault();let r=t.open,n=e.currentTarget.clientHeight+"px",a=getComputedStyle(t),o=`calc(${n} + ${a.paddingTop} + ${a.paddingBottom})`,i={duration:iu(e.currentTarget),easing:"ease-in-out"};if(r){let e=t.clientHeight+"px";t.animate([{height:e},{height:o}],i).finished.then(()=>{t.open=!1})}else t.open=!0,requestAnimationFrame(()=>{let e=t.clientHeight+"px";t.animate([{height:o},{height:e}],i)})}let lP=(e,t)=>{switch(t.type){case"START_SUBMIT":return{...e,loading:!0};case"COMPLETE_SUBMIT":return{...e,loading:!1,success:!0};case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,client:t.client,consent_required:t.consent_required,grantable_scope:t.grantable_scope,ungrantable_scope:t.ungrantable_scope};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lT=({bootstrap:e,bootstrapNotLoaded:t,state:r,submit:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l,success:c,client:d}=r,u=t2(nz),h=t1(()=>{let e=r.client?.client_name??"";if(!e)try{e=new URL(r.redirect_uri).hostname}catch(t){eC("Unable to parse host from redirect URI.",t),e=a._({id:"idpConsent.defaultClientName",message:"The App"})}return e},[r.client?.client_name,r.redirect_uri,o]),m=t1(()=>{if(u)try{return u({scopes:r.grantable_scope.split(" "),clientName:h})}catch(e){eP("Error rendering custom consent screen. Falling back to default consent screen.",e)}return(({scopes:e,clientName:t,rbacPolicy:r})=>{let n;return[{header:`${t} is requesting to:`,items:(n=[],e.includes(ld)&&n.push(ll),(e.includes(lh)||e.includes(lu)||e.includes(lm))&&n.push((({containsProfile:e,containsEmail:t,containsPhoneNumber:r})=>{let n=[];return e&&n.push("Your name, profile picture, and language preferences"),t&&n.push("Your email address"),r&&n.push("Your phone number"),{text:"View your personal profile information",details:n}})({containsEmail:e.includes(lh),containsPhoneNumber:e.includes(lm),containsProfile:e.includes(lu)})),e.includes(lp)&&n.push(lc),n).concat(lf(e,r))}]})({scopes:r.grantable_scope.split(" "),rbacPolicy:e.rbacPolicy,clientName:h})},[u,r.grantable_scope,h,e.rbacPolicy]),p=t1(()=>""===r.ungrantable_scope?[]:lf(r.ungrantable_scope.split(" "),e.rbacPolicy),[r.ungrantable_scope,e.rbacPolicy]);return i||t?rZ.createElement(i4,null):s?rZ.createElement(sU,{text:s}):l?rZ.createElement(sU,{text:a._({id:"idpConsent.denied",message:"Access to the application was denied."})}):c?rZ.createElement(sK,null):rZ.createElement(lO,{client:d,submit:n,grantableScope:r.grantable_scope,projectName:e.projectName},rZ.createElement(lE,{ungrantableScopeDescriptions:p,clientName:h}),rZ.createElement(lS,{manifest:m,clientName:h}))},lO=({client:e,submit:t,grantableScope:r,projectName:n,children:a})=>{let{i18n:o,_:i}=nO(),{options:s}=t2(nq),l=e.client_name,c=r.split(" ").some(e=>!l_.has(e))?o._({id:"idpConsent.customScopes.title",message:"{clientName} wants to access your {projectName} account",values:{clientName:l,projectName:n}}):o._({id:"idpConsent.signIn.title",message:"Sign in to {clientName} with {projectName}",values:{clientName:l,projectName:n}});return rZ.createElement(id,{gap:6},s.logo&&rZ.createElement(sN,{appLogo:s.logo}),rZ.createElement(nZ,{variant:"header",align:"center"},c),a,rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},o._({id:"idpConsent.button.allow",message:"Allow"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},o._({id:"idpConsent.button.deny",message:"Deny"}))))},lA=(e,t)=>{switch(t.type){case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,consent_required:t.consent_required,redirect_uri:t.redirect_uri};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lx=e=>{window.location.href=e},lD=({state:e,submit:t,bootstrap:r,bootstrapNotLoaded:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l}=e;if(i||n)return rZ.createElement(i4,null);if(s)return rZ.createElement(sU,{text:s});if(l)return rZ.createElement(sK,{text:a._({id:"idpLogout.notLoggedOut",message:"You have not been logged out. You may close this page."})});let c=r.projectName;return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header",align:"center"},a._({id:"idpLogout.title",message:"Log out?"})),rZ.createElement(nZ,{variant:"body"},a._({id:"idpLogout.confirmMessage",message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:c}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},a._({id:"idpLogout.yes",message:"Yes"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},a._({id:"idpLogout.no",message:"No"}))))},lz=({initialError:e,initialParams:t})=>{let r=t2(aW).client,n=aY(),a=aZ(),{oauthAuthorizeStart:o,oauthAuthorizeSubmit:i}=r.idp,s=oI(),l=(({initialError:e,initialParams:t,oauthAuthorizeStart:r,oauthAuthorizeSubmit:n,onError:a,onEvent:o})=>{let[i,s]=tY(lP,{loading:!e,preflight:!!e,error:e,success:!1,denied:!1,consent_required:!1,client:null,grantable_scope:"",ungrantable_scope:"",redirect_uri:t.redirect_uri});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async({consent_required:e,consent_granted:r})=>{s({type:"START_SUBMIT"});let a=await n({...t,consent_granted:r});a.authorization_code&&s({type:"COMPLETE_SUBMIT"}),window.location.href=a.redirect_uri,e&&!r?(s({type:"CONSENT_DENIED"}),o({type:eu.OAuthAuthorizeFlowConsentDenied,data:{}})):o({type:eu.OAuthAuthorizeFlowComplete,data:{}})},[n,t,o]),c=t0(({consent_granted:e})=>l({consent_granted:e,consent_required:!0}),[l]),d=t0(async()=>{let e;s({type:"START_PREFLIGHT"}),o({type:eu.OAuthAuthorizeFlowStart,data:{client_id:t.client_id,redirect_uri:t.redirect_uri,scope:t.scopes.join(" ")}});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}if(e.consent_required){let t=e.scope_results.filter(e=>e.is_grantable).map(e=>e.scope).join(" "),r=e.scope_results.filter(e=>!e.is_grantable).map(e=>e.scope).join(" ");s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,client:e.client,grantable_scope:t,ungrantable_scope:r});return}await l({consent_required:!1,consent_granted:!1})},[o,t,r,a,l]);return tZ(()=>{i.preflight||d()},[d,i.preflight]),{state:i,submit:c}})({initialError:e,initialParams:t,oauthAuthorizeStart:o,oauthAuthorizeSubmit:i,onError:n,onEvent:a});return rZ.createElement(lT,{bootstrap:s,bootstrapNotLoaded:!1,...l})},lM=({initialError:e,initialParams:t,navigate:r})=>{let n=t2(aW).client,a=aY(),{oauthLogoutStart:o}=n.idp,i=oI(),s=(({initialError:e,initialParams:t,oauthLogoutStart:r,revokeSession:n,onError:a,navigate:o=lx})=>{let[i,s]=tY(lA,{loading:!e,preflight:!!e,error:e,denied:!1,consent_required:!1,redirect_uri:""});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async e=>{try{await n()}catch{}o(e)},[n,o]),c=t0(async()=>{let e;s({type:"START_PREFLIGHT"});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}e.consent_required?s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,redirect_uri:e.redirect_uri}):l(e.redirect_uri)},[t,r,a,l]);tZ(()=>{i.preflight||c()},[c,i.preflight]);let d=t0(async({consent_granted:e})=>{if(e)return l(i.redirect_uri);s({type:"CONSENT_DENIED"})},[l,i]);return{state:i,submit:d}})({initialError:e,initialParams:t,oauthLogoutStart:o,revokeSession:()=>n.session.revoke({forceClear:!0}),onError:a,navigate:r});return rZ.createElement(lD,{...s,bootstrap:i,bootstrapNotLoaded:!1})},lI=({searchParams:e=window.location.search,navigate:t}={})=>{let r,[{flow:n,error:a}]=tG((e=>{let t=new URLSearchParams(e);if(t.has("post_logout_redirect_uri")){let e=lv(t);return{error:e.error,flow:{type:"Logout",params:e.result}}}let r=ly(t);return{error:r.error,flow:{type:"Authorize",params:r.result}}})(e)),{theme:o,displayWatermark:i}=t2(nq);return"Authorize"===n.type?r=rZ.createElement(lR,null,rZ.createElement(lz,{initialError:a,initialParams:n.params})):"Logout"===n.type&&(r=rZ.createElement(lM,{initialError:a,initialParams:n.params,navigate:t})),rZ.createElement(sH,{theme:o,displayWatermark:i},r)},lR=({children:e})=>{let t,{i18n:r,_:n}=nO(),a=rG((t=t2(aW).client).onStateChange,()=>t.self.getSync()),o=aY(),i=tQ(o);tZ(()=>{i.current=o},[o]);let s=t2(aW).client,l=t2(nM),[c,d]=tG(!1),[u,h]=tG(!1);return(tZ(()=>{c||u||(async e=>{if(e?.trustedAuthToken&&e?.tokenProfileID){d(!0);let t=e.trustedAuthToken,r=e.tokenProfileID,n=s.self.getSync();n&&await s.session.revoke();try{await s.session.attest({token:t,profile_id:r,organization_id:n?.organization_id,session_duration_minutes:60})}catch(e){i.current(e)}finally{d(!1),h(!0)}}h(!0)})(l)},[l,c,u,s]),tZ(()=>{a||i.current(new w)},[a]),c)?rZ.createElement(i4,null):a?e:rZ.createElement(sU,{text:r._({id:"idpConsent.noActiveSession",message:"No active session detected. Please log in to continue."})})};class lL extends Event{stytchEventType;stytchEventData;constructor(e){super("stytch-event",{composed:!0}),this.stytchEventType=e.type,this.stytchEventData=e.data}}class lB extends Event{error;constructor(e){super("stytch-error",{composed:!0}),this.error=e}}function lN(e,{propNames:r,attributeNames:n=[]}){if("u"<typeof window)return class{render(){}flushRender(){}};let a=Object.fromEntries(n.map(e=>[e.toLowerCase(),e]));return class o extends HTMLElement{#e;static observedAttributes=Object.keys(a);#t;#r=!1;#n={};constructor({shadow:e}={}){for(const t of(super(),this.#t=e??null!=this.getAttribute("shadow"),o.observedAttributes)){const e=this.getAttribute(t);if(null!=e){const r=a[t];this.#n[r]=e}}for(const e of r)Object.hasOwn(this,e)&&(this.#n[e]=this[e]),Object.defineProperty(this,e,{get:()=>this.#n[e],set:t=>{n.includes(e)&&this.setAttribute(e,t),this.#n[e]=t,this.#a()}})}connectedCallback(){if(!this.#e)if(this.#e=document.createElement("div"),this.#t){this.setAttribute("shadow","true");let e=this.attachShadow({mode:"open"});e.appendChild(nG()),e.appendChild(this.#e)}else t||(t=nG(),document.head.appendChild(t)),this.appendChild(this.#e);this.#a()}disconnectedCallback(){this.#e&&rq(this.#e)}attributeChangedCallback(e,t,r){let n=a[e];this.#n[n]=r}render(e){Object.assign(this,e)}flushRender(){rj(()=>{this.#o()})}#a(){this.#r||(this.#r=!0,window.queueMicrotask(()=>{this.#o()}))}#i(e){var t;let r=(t=e,t?.config);if(r?.oauthOptions?.providers.some(e=>"object"==typeof e&&"google"===e.type&&e.one_tap)&&!this.querySelector("#google-parent-prompt")){let e=document.createElement("div");e.id="google-parent-prompt",e.slot="one-tap",this.appendChild(e)}}#s={onError:e=>{this.#n.callbacks?.onError?.(e),this.dispatchEvent(new lB(e))},onEvent:e=>{this.#n.callbacks?.onEvent?.(e),this.dispatchEvent(new lL(e))}};#o(){if(!this.#e||(this.#r=!1,0===Object.keys(this.#n).length))return;this.#i(this.#n);let t=this.#n;this.#t&&(t=function(e){let{presentation:t}=e;return lF(e)?e:{...e,presentation:{...t,options:{...t?.options,enableShadowDOM:!0}}}}(t)),rC(rZ.createElement(e,{...t,callbacks:this.#s}),this.#e)}}}function lU(e,t){return"u"<typeof window?()=>null:({elementId:r,...n})=>{let a;customElements.get(e)||customElements.define(e,t);let o=document.querySelector(r);if(!o)throw Error(`The selector you specified (${r}) applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin().`);return o.firstChild?.nodeName.toLowerCase()===e.toLowerCase()?(a=o.firstChild).render(n):(a=new t({shadow:lF(n)}),o.appendChild(a)),a}}function lF(e){let{config:t,presentation:r}=e;return r?.options?.enableShadowDOM??t?.enableShadowDOM}let lq=lN(({client:e,presentation:t,callbacks:r,strings:n,getIDPConsentManifest:a,trustedAuthTokenParams:o,styles:i})=>{let s=nF(t,!1,{products:[]});return tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_idp_screen",details:{bootstrap:t}})})},[e]),i&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide"),rZ.createElement(aG,{client:e,config:{},callbacks:r,initialState:aV},rZ.createElement(nI,{consentManifestGenerator:a,authTokenParams:o},rZ.createElement(nq.Provider,{value:s},rZ.createElement(nD,{messages:rQ,overrides:n},rZ.createElement(lI,null)))))},{propNames:["client","presentation","callbacks","strings","getIDPConsentManifest","trustedAuthTokenParams"]}),lH=lU("stytch-identity-provider",lq),lK=lN(({config:e,styles:t,...r})=>{t&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide");let n={...e,organizationProducts:Object.values(sL)};return rZ.createElement(ls,{config:n,...r})},{propNames:["client","config","presentation","callbacks","strings"]}),lj=lU("stytch-ui",lK),l$=Symbol("__stytch_SSRStubKey"),lV=e=>new Proxy(()=>{},{get:(t,r)=>r===l$||lV(e+"."+String(r)),apply(){throw Error(`[Stytch] Invalid server-side function call to ${e}.
|
|
46
|
+
}`;nW(".OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*64)}.-st-mobile .OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*70)}.OtpInput_module_slotsContainer__1e43b599{display:flex;gap:var(--st-spacing-2);justify-content:start;width:fit-content}.OtpInput_module_otpSlot__1e43b599{align-items:center;display:flex;height:calc(var(--st-spacing)*9);justify-content:center;width:calc(var(--st-spacing)*9)}.-st-mobile .OtpInput_module_otpSlot__1e43b599{height:calc(var(--st-spacing)*10);width:calc(var(--st-spacing)*10)}.OtpInput_module_disabled__1e43b599 .OtpInput_module_otpSlot__1e43b599{color:var(--st-muted-foreground)}.OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1.5s step-start infinite;border-right:1px solid var(--st-foreground);display:inline-block;height:calc(var(--st-text-sm)*1.25);width:0}.OtpInput_module_safari__1e43b599 .OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1s ease-in-out infinite;border-right-width:2px}@keyframes OtpInput_module_caretBlink__1e43b599{0%,to{opacity:0}50%{opacity:1}}");let sd=e=>e.replace(/\D/g,"").slice(0,6),su=({slots:e})=>rZ.createElement("div",{className:"OtpInput_module_slotsContainer__1e43b599"},e.map((e,t)=>rZ.createElement("div",{key:t,className:nj("OtpInput_module_otpSlot__1e43b599 inputBase_module_inputBase__06c14ae4",{"OtpInput_module_active__1e43b599 inputBase_module_forceFocusRing__06c14ae4":e.isActive})},rZ.createElement("span",null,e.char),e.hasFakeCaret&&rZ.createElement("div",{className:"OtpInput_module_caret__1e43b599"})))),sh=({defaultOtp:e,onSubmit:t,disabled:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(e),l=t1(()=>{let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrom")},[]);return rZ.createElement(ss,{"aria-label":a._({id:"formField.otp.ariaLabel",message:"One-time passcode"}),containerClassName:nj("OtpInput_module_inputContainer__1e43b599",{OtpInput_module_disabled__1e43b599:r,OtpInput_module_safari__1e43b599:l}),maxLength:6,value:i,onChange:e=>s(sd(e)),pasteTransformer:sd,disabled:r,onComplete:t,pattern:"[0-9]*",render:su,...n})},sm=({header:e,body:t,helper:r,align:n})=>rZ.createElement(id,{gap:4},rZ.createElement(nZ,{variant:"header",align:n},e),t&&rZ.createElement(nZ,{align:n},t),r&&rZ.createElement(nZ,{variant:"helper",align:n},r)),sp=({header:e,helperContent:t,instruction:r,isSubmitting:n,onSubmit:a,errorMessage:o})=>{let{i18n:i,_:s}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:e,body:r}),rZ.createElement(id,{gap:2},rZ.createElement(id,null,rZ.createElement(sh,{onSubmit:a,disabled:n}),rZ.createElement(i6,{isOpen:n},rZ.createElement(id,{className:"OTPEntry_module_progressInner__6b10f31d",gap:2},rZ.createElement(nZ,{variant:"helper"},i._({id:"formField.passcode.status.verifying",message:"Verifying passcode..."})),rZ.createElement(i7,{isLoading:n})))),rZ.createElement(id,null,!n&&o&&rZ.createElement(iB,null,o),rZ.createElement(nZ,{variant:"helper",className:ia()},t))))},s_=({expiration:e,formattedDestination:t,isSubmitting:r,onSubmit:n,errorMessage:a})=>{let o,{i18n:i,_:s}=nO(),[l,c]=ir(e),d=(o=Math.floor(l/60))+":"+String(l-60*o).padStart(2,"0"),u=c?i._({id:"passcode.expirationCountdown",message:"Your code expires in {timeRemaining}.",values:{timeRemaining:d}}):i._({id:"passcode.expired",message:"Your code has expired."});return rZ.createElement(sp,{header:i._({id:"passcode.title",message:"Enter passcode"}),helperContent:u,instruction:rZ.createElement(nx,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:rZ.createElement("b",null)},values:{destination:t}}),isSubmitting:r,onSubmit:n,errorMessage:a})},sg=({password:e,setPassword:t,type:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(!1),l=tQ(null);return tZ(()=>{let e=l.current?.form;if(!e)return;let t=new AbortController;return e.addEventListener("submit",()=>{l.current&&(l.current.type="password"),s(!1)},{signal:t.signal}),()=>t.abort()},[]),rZ.createElement(iN,{id:`${r}-password`,label:a._({id:"formField.password.label",message:"Password"}),ref:l,autoComplete:`${r}-password`,type:i?"text":"password",value:e,onChange:e=>t(e.target.value),required:!0,action:rZ.createElement(oZ,{variant:"ghost",onClick:()=>s(!i)},i?a._({id:"button.hidePassword",message:"Hide"}):a._({id:"button.showPassword",message:"Show"})),...n})},sf=()=>{let[e,t]=t2(aW).state,r=t2(aW).config,n=t2(aW).client,{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=tG(e.formState.passwordState.email),[d,u]=tG(""),[h,m]=tG(""),[p,_]=tG(!1),g=e.flowState.organization;return{stytch:n,onError:s,email:l,setEmail:c,password:d,setPassword:u,organization:g,errorMessage:h,setErrorMessage:m,isSubmitting:p,setIsSubmitting:_,submitPassword:e=>{m(""),_(!0),n.passwords.authenticate({email_address:l,organization_id:e,password:d,session_duration_minutes:r.sessionOptions?.sessionDurationMinutes??30,locale:r.passwordOptions?.locale}).then(e=>{_(!1),i({type:eu.B2BPasswordAuthenticate,data:e}),oR(e,t,r)}).catch(e=>{_(!1),s(e),m(ic(e,o))})},submitDiscoveryPassword:()=>{m(""),_(!0),n.passwords.discovery.authenticate({email_address:l,password:d}).then(e=>{_(!1),i({type:eu.B2BPasswordDiscoveryAuthenticate,data:e}),t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations}),t({type:"transition",screen:aa})}).catch(e=>{_(!1),s(e),m(ic(e,o))})},handleNonMemberReset:()=>{if(g){if(!(({email_jit_provisioning:e,email_allowed_domains:t},r)=>{switch(e){case"ALL_ALLOWED":return!0;case"NOT_ALLOWED":return!1;case"RESTRICTED":{let e=r.split("@").pop();return null!=e&&t.includes(e)}}})(g,l)){_(!1);let e=g.organization_name;m(a._({id:"error.emailNoAccessToOrg",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin.",values:{email:l,organizationName:e}}));return}r1(n).dataLayer.setItem("reset-email-value",l),n.magicLinks.email.loginOrSignup({email_address:l,organization_id:g.organization_id,login_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,signup_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}).then(()=>{_(!1),t({type:"set_password_state",email:l}),t({type:"transition",screen:al})}).catch(e=>{s(e),m(ic(e,o)),_(!1)})}}}},sy=()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),n=iX(),{stytch:a,email:o,setEmail:i,password:s,setPassword:l,organization:c,errorMessage:d,setErrorMessage:u,isSubmitting:h,setIsSubmitting:m,submitPassword:p,submitDiscoveryPassword:_,handleNonMemberReset:g}=sf(),[f,y]=tG(!!c&&!o),v=async r=>{if(r.preventDefault(),!c)return void _();let i=c.organization_id;f?o.match(n5)?(u(""),m(!0),r1(a).searchManager.searchMember(o,c.organization_id).then(({member:t})=>{if(t){y(!1),m(!1),e({type:"set_password_state",email:o});return}g()}).catch(e=>{m(!1),u(n(e,{email:o,org:i}))})):u(t._({id:"error.invalidEmailAddress",message:"Invalid email address"})):p(i)};return rZ.createElement(id,{as:"form",onSubmit:v,gap:2},rZ.createElement(iU,{email:o,setEmail:i,error:f?d:void 0}),!f&&rZ.createElement(sg,{password:s,setPassword:l,type:"current",error:d}),rZ.createElement(oZ,{variant:"primary",loading:h,type:"submit"},t._({id:"button.continue",message:"Continue"})),!f&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:o}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})))},sv=()=>{let e,t,r=((t=(e=new URL(window.location.toString())).searchParams).delete("token"),t.delete("stytch_token_type"),e);window.history.replaceState(null,document.title,r)};nW('.PasswordError_module_item__c070e7fb{margin-left:var(--st-spacing-6);text-indent:calc(var(--st-spacing-6)*-1)}.PasswordError_module_item__c070e7fb svg{display:inline-block;height:var(--st-spacing-4);margin-right:var(--st-spacing-2);vertical-align:middle;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb{display:inline-block;margin-right:var(--st-spacing-2);text-align:center;text-indent:0;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb:before{content:"•"}');nW(".PasswordStrengthCheck_module_container__75d2aaf0{border-radius:var(--st-rounded-full);display:flex;gap:var(--st-spacing-0_5);height:0;overflow:clip;transition:height var(--st-transition-duration)}.PasswordStrengthCheck_module_container__75d2aaf0:is(.PasswordStrengthCheck_module_weak__75d2aaf0,.PasswordStrengthCheck_module_strong__75d2aaf0){height:var(--st-spacing)}.PasswordStrengthCheck_module_block__75d2aaf0{background:var(--st-muted);flex:1 1 auto;height:var(--st-spacing)}.PasswordStrengthCheck_module_weak__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-destructive)}.PasswordStrengthCheck_module_strong__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-success)}");let sb=({score:e})=>{let t,{i18n:r,_:n}=nO();return 1===e||2===e?t="PasswordStrengthCheck_module_weak__75d2aaf0":(3===e||4===e)&&(t="PasswordStrengthCheck_module_strong__75d2aaf0"),rZ.createElement("div",{className:nj("PasswordStrengthCheck_module_container__75d2aaf0",t)},null!=e&&e>0&&rZ.createElement(rZ.Fragment,null,[,,,,].fill(void 0).map((t,r)=>rZ.createElement("div",{key:r,className:nj("PasswordStrengthCheck_module_block__75d2aaf0",{PasswordStrengthCheck_module_filled__75d2aaf0:e>r})})),rZ.createElement(iI,null,r._({id:"password.strength",message:"Password strength: {score} out of 4.",values:{score:e}}))))},sw={"Short keyboard patterns are easy to guess.":{id:"password.zxcvbn.warning.shortKeyboardPatterns",message:"Short keyboard patterns are easy to guess."},"Straight rows of keys are easy to guess.":{id:"password.zxcvbn.warning.straightRows",message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:"password.zxcvbn.warning.repeats",message:'Repeats like "aaa" are easy to guess.'},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:"password.zxcvbn.warning.longerRepeats",message:'Repeats like "abcabcabc" are only slightly harder to guess than "abc".'},'Sequences like "abc" or "6543" are easy to guess.':{id:"password.zxcvbn.warning.sequences",message:'Sequences like "abc" or "6543" are easy to guess.'},"Recent years are easy to guess.":{id:"password.zxcvbn.warning.recentYears",message:"Recent years are easy to guess."},"Dates are often easy to guess.":{id:"password.zxcvbn.warning.dates",message:"Dates are often easy to guess."},"This is a top-10 common password.":{id:"password.zxcvbn.warning.top10CommonPassword",message:"This is a top-10 common password."},"This is a top-100 common password.":{id:"password.zxcvbn.warning.top100CommonPassword",message:"This is a top-100 common password."},"This is a very common password.":{id:"password.zxcvbn.warning.veryCommonPassword",message:"This is a very common password."},"This is similar to a commonly used password.":{id:"password.zxcvbn.warning.similarToCommonPassword",message:"This is similar to a commonly used password."},"A word by itself is easy to guess.":{id:"password.zxcvbn.warning.wordByItself",message:"A word by itself is easy to guess."},"Names and surnames by themselves are easy to guess.":{id:"password.zxcvbn.warning.names",message:"Names and surnames by themselves are easy to guess."},"Common names and surnames are easy to guess.":{id:"password.zxcvbn.warning.commonNames",message:"Common names and surnames are easy to guess."}},sk={"Use a few words, avoid common phrases.":{id:"password.zxcvbn.suggestion.useAFewWords",message:"Use a few words, avoid common phrases."},"No need for symbols, digits, or uppercase letters.":{id:"password.zxcvbn.suggestion.noSymbolsDigitsUppercase",message:"No need for symbols, digits, or uppercase letters."},"Add another word or two. Uncommon words are better.":{id:"password.zxcvbn.suggestion.addWords",message:"Add another word or two. Uncommon words are better."},"Use a longer keyboard pattern with more turns.":{id:"password.zxcvbn.suggestion.longerKeyboardPattern",message:"Use a longer keyboard pattern with more turns."},"Avoid repeated words and characters.":{id:"password.zxcvbn.suggestion.avoidRepeats",message:"Avoid repeated words and characters."},"Avoid sequences.":{id:"password.zxcvbn.suggestion.avoidSequences",message:"Avoid sequences."},"Avoid recent years.":{id:"password.zxcvbn.suggestion.avoidRecentYears",message:"Avoid recent years."},"Avoid years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou",message:"Avoid years that are associated with you."},"Avoid dates and years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou",message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:"password.zxcvbn.suggestion.capitalization",message:"Capitalization doesn't help very much."},"All-uppercase is almost as easy to guess as all-lowercase.":{id:"password.zxcvbn.suggestion.allUppercase",message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:"password.zxcvbn.suggestion.reversed",message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:"password.zxcvbn.suggestion.predictableSubstitutions",message:"Predictable substitutions like '@' instead of 'a' don't help very much."}},sS={fulfilled:{id:"password.requirement.fulfilled",message:"Fulfilled"},notFulfilled:{id:"password.requirement.notFulfilled",message:"Not fulfilled"},warning:{id:"password.requirement.warning",message:"Warning"},suggestion:{id:"password.requirement.suggestion",message:"Suggestion"}},sE=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"currentColor"})),sC=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"currentColor"})),sP=({children:e,type:t})=>{let{i18n:r,_:n}=nO(),a="suggestion"===t?rZ.createElement("span",{role:"presentation",className:"PasswordError_module_bullet__c070e7fb"}):"fulfilled"===t?rZ.createElement(sC,null):rZ.createElement(sE,null);return rZ.createElement(nZ,{variant:"helper",className:"PasswordError_module_item__c070e7fb",color:"suggestion"===t?void 0:"fulfilled"===t?"success":"destructive","aria-atomic":!0},a,rZ.createElement("span",null,rZ.createElement(iI,null,r._(sS[t]),": "),e))},sT=({bootstrap:e,...t})=>{let{i18n:r,_:n}=nO(),a=e.passwordConfig?.ludsComplexity??0,o=e.passwordConfig?.ludsMinimumCount??0;if("notLoaded"===t.policy)return null;let{passwordInvalid:i,isPasswordBreached:s}=t,l=s?rZ.createElement(sP,{type:"warning"},r._({id:"password.strengthError.breached",message:"This password may have been used on a different site that experienced a security issue. Please choose another password."})):null;if("zxcvbn"===t.policy){let{passwordScore:e,passwordWarning:n,passwordSuggestions:a}=t,o=n?sw[n]??n:null,s=[...new Set(a)].map(e=>sk[e]??e);return rZ.createElement(id,{gap:1,"aria-live":"polite"},rZ.createElement(sb,{score:e}),rZ.createElement(iI,null,i?r._({id:"password.strength.notAccepted",message:"Password not accepted."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement("div",null,o&&rZ.createElement(sP,{type:"warning"},r._(o)),s.map(e=>rZ.createElement(sP,{key:e.id,type:"suggestion"},r._(e))),l))}let{missingCharacters:c,missingComplexity:d}=t;return rZ.createElement("div",{"aria-live":"polite"},rZ.createElement(iI,null,i?r._({id:"password.strength.requirementsNotMet",message:"Your password must meet all requirements."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement(sP,{type:0===c?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.minimumLength",message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:o}})),rZ.createElement(sP,{type:0===d?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.complexity",message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:a}})),l)},sO=()=>{throw Error("Assertion failure")};function sA(e){return`sso:${e.connection_id}`}function sx(e){return"oauth"===e.type?e.provider.type:"sso"===e.type?sA(e.connection):"sso-discovery"}let sD=({buttons:e})=>{let{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{oauthProviderSettings:o=[]}=iG(),i=t2(nq),[l,d]=o$(),u=t2(aW).config,{loginRedirectURL:h,signupRedirectURL:m,discoveryRedirectURL:p,customScopes:_,providerParams:g}=u.oauthOptions??{},{B2BGoogleOneTap:f,OAuthB2BButton:y,SSOButton:v}=oN(u,"ssoAndOAuthButtons"),b=n.flowState.type===s.Discovery,w=e.flatMap(e=>e===aP?o.map(e=>({type:"oauth",provider:e})):e===aT?b?{type:"sso-discovery"}:n.flowState.organization?.sso_active_connections?.map(e=>({type:"sso",connection:e}))??[]:void sO());if(0===w.length)return null;let[k,S]=eT(w,e=>sx(e)===l);return rZ.createElement(iw,null,k.map((e,r)=>{let o=(()=>{switch(e.type){case"oauth":var r,o,s;let l,u,b;return b={customScopes:(o=r=e.provider,0==Object.keys(l=o.customScopes).length&&(l=_),l),providerParams:(s=n.primary.email,0==Object.keys(u=r.providerParams).length&&(u=g??{}),!s||r.type!==c.Google&&r.type!==c.Microsoft||"login_hint"in u||(u={...u,login_hint:s}),u)},r.one_tap?rZ.createElement(f,{key:r.type,...b,cancelOnTapOutside:r.cancel_on_tap_outside}):rZ.createElement(y,{key:r.type,providerType:r.type,loginRedirectUrl:h,signupRedirectUrl:m,discoveryRedirectUrl:p,onSuccess:()=>d(r.type),...b});case"sso":return rZ.createElement(v,{key:e.connection.display_name,connection:e.connection,onStart:()=>d(sA(e.connection))});case"sso-discovery":return rZ.createElement(oZ,{key:"sso-discovery",variant:"outline",id:nH("sso-discovery",i.options),onClick:()=>{a({type:"transition",screen:aw,history:"push"})}},t._({id:"provider.continueWithSSO",message:"Use single sign-on"}));default:sO()}})();return S&&0===r?rZ.createElement(nQ,{key:sx(e)},o):o}))},sz=({availableConnections:e})=>{let[t,r]=o$(),n=t?.startsWith("sso:")?t.slice(4):void 0,[a,o]=eT(e,e=>e.connection_id===n);return tm(id,{gap:2},a.map((e,t)=>{let n=tm(o9,{key:e.display_name,connection:e,onStart:e=>r(sA(e))});return o&&0===t?tm(nQ,{key:e.display_name},n):n}))},sM=()=>rZ.createElement(i1,{showPasswordButton:!1}),sI=()=>rZ.createElement(i1,{showPasswordButton:!0}),sR=()=>rZ.createElement(i0,{showPasswordButton:!1}),sL=()=>rZ.createElement(i0,{showPasswordButton:!0});var sB=Object.freeze({__proto__:null,emailMagicLinks:{id:"emailMagicLinks",screens:{[ar]:iD,[av]:i3},mainScreen:{[aE]:sM,[aC]:sR,[aA]:sI,[ax]:sL},icons:o4},emailOtp:{id:"emailOtp",screens:{[ab]:()=>{let e=t2(aW).client,t=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{codeExpiration:i}=a.formState.otpState,l=ie(),{userSuppliedEmail:c}=a.formState.emailState,d=iJ({throwOnError:!0}),u=iZ({throwOnError:!0}),h=d.isMutating||u.isMutating,m=d.error||u.error,p=oM("stytch.otps.email.discovery.authenticate",(t,{arg:{otp:r,email:n}})=>e.otps.email.discovery.authenticate({code:r,email_address:n}),{onSuccess:e=>{oL(e,o)},throwOnError:!0}),_=oM("stytch.otps.email.authenticate",(t,{arg:{otp:r,emailAddress:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.email.authenticate({code:r,email_address:n,organization_id:a,session_duration_minutes:o}),{onSuccess:e=>{oR(e,o,t)},throwOnError:!0}),g=p.isMutating||_.isMutating,f=p.error||_.error||m,y=f?ic(f,n):void 0,v=()=>{for(let e of[d,u,_,p])e.reset()},b=async e=>{v();try{a.flowState.type===s.Discovery?await p.trigger({otp:e,email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&a.formState.emailState.userSuppliedEmail&&await _.trigger({otp:e,emailAddress:a.formState.emailState.userSuppliedEmail,organizationId:a.flowState.organization.organization_id,sessionDurationMinutes:t.sessionOptions.sessionDurationMinutes})}catch{l.clear()}},w=async()=>{v(),!h&&(a.flowState.type===s.Discovery?await u.trigger({email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&await d.trigger({email:c,organization_id:a.flowState.organization.organization_id}))};return rZ.createElement(id,{gap:6},null!==i?rZ.createElement(s_,{isSubmitting:g,onSubmit:b,errorMessage:y,expiration:i.getTime(),formattedDestination:c}):rZ.createElement(i5,null),rZ.createElement(iw,null,rZ.createElement(i8,{countdown:l,resendOTP:w,isSubmitting:g}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{o({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[av]:i3,[ar]:iD},mainScreen:{[aE]:sM,[aC]:sR,[aA]:sI,[ax]:sL},icons:o4},oauth:{id:"oauth",screens:{},ssoAndOAuthButtons:{SsoAndOAuthButtons:sD,B2BGoogleOneTap:o1,OAuthB2BButton:oX},icons:{google:o2,microsoft:o3,hubspot:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#FF7A59",fillRule:"evenodd",d:"M13.93 13.97a2.4 2.4 0 0 1-2.43-2.4c0-1.34 1.09-2.42 2.43-2.42a2.4 2.4 0 0 1 2.43 2.41c0 1.33-1.08 2.41-2.43 2.41m.73-7.05V4.78c.56-.26.96-.83.96-1.49v-.05c0-.9-.75-1.64-1.66-1.64h-.05c-.92 0-1.67.74-1.67 1.64v.05c0 .66.4 1.23.96 1.5v2.13q-1.27.21-2.24.98L5 3.32q.07-.21.07-.46C5.08 1.83 4.24 1 3.2 1s-1.88.83-1.88 1.86a1.87 1.87 0 0 0 2.8 1.6l5.85 4.51a4.6 4.6 0 0 0 .07 5.29l-1.77 1.76a1.54 1.54 0 0 0-1.98 1.46 1.54 1.54 0 0 0 3.09 0q-.02-.23-.08-.44l1.76-1.74a4.75 4.75 0 0 0 7.62-3.74 4.7 4.7 0 0 0-4.02-4.64",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#E01E5A",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0z"}),tm("path",{fill:"#36C5F0",d:"M7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79z"}),tm("path",{fill:"#2EB67D",d:"M15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0z"}),tm("path",{fill:"#ECB22E",d:"M12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#24292F",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd",className:o0}))}},passwords:{id:"passwords",screens:{"Password Email":sy,[ai]:()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{email:n,setEmail:a,password:o,setPassword:i,organization:s,errorMessage:l,setErrorMessage:c,isSubmitting:d,submitPassword:u,submitDiscoveryPassword:h}=sf(),m=async e=>{e.preventDefault(),n.match(n5)?s?u(s.organization_id):h():c(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"password.login.title",message:"Log in with email and password"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:4},rZ.createElement(iU,{email:n,setEmail:a}),rZ.createElement(sg,{password:o,setPassword:i,type:"current",error:l}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:d,type:"submit"},t._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:n}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},t._({id:"button.goBack",message:"Go back"})))))},[ac]:()=>{let[,e]=t2(aW).state,t=t2(aW).config,r=aZ(),{i18n:n,_:a}=nO(),{stytch:o,email:i,setEmail:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,handleNonMemberReset:m}=sf(),p=async s=>{(s.preventDefault(),i.match(n5))?(d(""),h(!0),l?r1(o).searchManager.searchMember(i,l.organization_id).then(({member:n})=>{n?o.passwords.resetByEmailStart({email_address:i,organization_id:l.organization_id,login_redirect_url:t.passwordOptions?.loginRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(t=>{h(!1),r({type:eu.B2BPasswordResetByEmailStart,data:t}),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))}):m()}).catch(e=>{h(!1),d(ic(e,a))}):o.passwords.discovery.resetByEmailStart({email_address:i,discovery_redirect_url:t.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(()=>{h(!1),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))})):d(n._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},n._({id:"password.forgot.title",message:"Check your email for help signing in"})),rZ.createElement(nZ,{variant:"body"},l?n._({id:"password.forgot.content.organization",message:"We'll email you a login link to sign in to your account directly or reset your password if you have one."}):n._({id:"password.forgot.content.discovery",message:"We'll email you a verification link to sign up for an account or reset your password if you have one."})),rZ.createElement(iU,{email:i,setEmail:s,error:c}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},n._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},n._({id:"button.goBack",message:"Go back"}))))},[ad]:()=>{let[,e]=t2(aW).state,t=aZ(),r=t2(aW).config,{i18n:n,_:a}=nO(),{stytch:o,onError:i,email:s,organization:l,setIsSubmitting:c}=sf();return rZ.createElement(ik,{header:n._({id:"password.reset.emailSent.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"password.reset.emailSent.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:s}}),resend:()=>l?o.passwords.resetByEmailStart({email_address:s,organization_id:l.organization_id,login_redirect_url:r.passwordOptions?.loginRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordResetByEmailStart,data:e})}).catch(e=>{throw i(e),e}):o.passwords.discovery.resetByEmailStart({email_address:s,discovery_redirect_url:r.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordDiscoveryResetStart,data:e})}),goBack:()=>e({type:"transition",screen:at})})},[as]:()=>{let e=t2(aW).client,t=t2(aW).config,[,r]=t2(aW).state,n=oI(),{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=t1(()=>{let t=e.parseAuthenticateUrl();return t?[t.token,t.tokenType]:["",""]},[e]),d=r1(e).dataLayer.getItem("reset-email-value"),[u,h]=tG(""),[m,p]=tG(""),[_,g]=tG({policy:"notLoaded"}),[f,y]=tG(!1),v=t1(()=>((e,t=500)=>{let r;return(...n)=>{clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}})(t=>(p(""),e.passwords.strengthCheck({password:t}).then(({score:e,valid_password:t,zxcvbn_feedback:r,luds_feedback:n,strength_policy:a,breached_password:o})=>{let i={passwordInvalid:!t,isPasswordBreached:o};"zxcvbn"===a?g({policy:a,...i,passwordScore:e,passwordWarning:r.warning,passwordSuggestions:r.suggestions}):"luds"===a&&g({policy:a,...i,missingCharacters:n.missing_characters,missingComplexity:n.missing_complexity})}).catch(e=>{p(ic(e,o))}))),[e.passwords,o]);tZ(()=>{if("multi_tenant_magic_links"===c)return void e.magicLinks.authenticate({magic_links_token:l,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.emailMagicLinksOptions?.locale}).then(e=>{sv(),r({type:"primary_authenticate_success",response:e,includedMfaMethods:t.mfaProductInclude,resetTokenType:c})}).catch(e=>{p(ic(e,o)),s(e)})},[c]);let b=function(e,t){if("notLoaded"===t||"zxcvbn"===t||null==e.passwordConfig)return{type:"new",passwordrules:"allowed: unicode; minlength: 10"};let{ludsComplexity:r,ludsMinimumCount:n}=e.passwordConfig,a=["special","digit","upper","lower"].slice(0,r);return{type:"new",minLength:n,passwordrules:`allowed: unicode; minlength: ${n}; ${a.map(e=>`required: ${e}`).join("; ")}`}}(n,_.policy);return rZ.createElement(id,{gap:6,as:"form",onSubmit:n=>{n.preventDefault(),p(""),y(!0),"multi_tenant_passwords"==c?e.passwords.resetByEmail({password_reset_token:l,password:u,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.passwordOptions?.locale}).then(e=>{y(!1),i({type:eu.B2BPasswordResetByEmail,data:e}),oR(e,r,t)}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):"discovery"==c?e.passwords.discovery.resetByEmail({password_reset_token:l,password:u}).then(e=>{y(!1),i({type:eu.B2BDiscoveryPasswordReset,data:e}),r({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations}),r({type:"transition",screen:aa})}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):e.passwords.resetBySession({password:u}).then(e=>{y(!1),i({type:eu.B2BPasswordResetBySession,data:e}),r({type:"transition",screen:an})}).catch(e=>{s(e),p(ic(e,o)),y(!1)})}},rZ.createElement(nZ,{variant:"header"},a._({id:"password.setNew.title",message:"Set a new password"})),rZ.createElement(id,{gap:2},d?rZ.createElement(iU,{email:d,setEmail:n6,disabled:!0}):null,rZ.createElement(sg,{password:u,setPassword:e=>{h(e),v(e)},error:m,...b}),rZ.createElement(sT,{bootstrap:n,..._}),rZ.createElement(oZ,{variant:"primary",loading:f,type:"submit",disabled:"notLoaded"===_.policy||_.passwordInvalid},a._({id:"button.continue",message:"Continue"}))))},[al]:()=>{let{i18n:e,_:t}=nO(),[r,n]=t2(aW).state,a=ix(),o=r.formState.passwordState.email;return rZ.createElement(ik,{header:e._({id:"password.verification.title",message:"Verify your email first."}),description:rZ.createElement(nx,{id:"password.verification.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:o}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:a,providerInfo:iS}),rZ.createElement(iP,{emailDomain:a,providerInfo:iC}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{n({type:"set_user_supplied_email",email:""}),n({type:"transition",screen:at})}},e._({id:"button.retry",message:"Try again"})))})}},mainScreen:{[aO]:sy,[aA]:sI,[ax]:sL},icons:o4},sso:{id:"sso",screens:{[aw]:()=>{let e,[,t]=t2(aW).state,[r,n]=tG(""),{i18n:a,_:o}=nO(),[i,s]=tG(),[l,c]=tG(!1),{trigger:d}=(e=t2(aW).client,oM("stytch.sso.discoverConnections",async(t,{arg:{emailAddress:r}})=>await e.sso.discoverConnections(r),{throwOnError:!0})),u=t2(aW).client,{ssoOptions:h}=t2(aW).config,m=async e=>{e.preventDefault(),s(void 0);let n=async()=>{try{let e=await d({emailAddress:r});if(!e)return[];return e.connections}catch(e){s(((e,t)=>{if(e&&"object"==typeof e){if("error_message"in e&&"string"==typeof e.error_message)return e.error_message;if(t)return t;if("message"in e&&"string"==typeof e.message)return e.message}})(e,a._({id:"ssoDiscovery.email.error.unknown",message:"Something went wrong. Try again later or contact your admin for help."})))}};try{c(!0);let e=await n();if(e?.length===1){let[t]=e;await u.sso.start({connection_id:t.connection_id,login_redirect_url:h?.loginRedirectURL,signup_redirect_url:h?.signupRedirectURL});return}c(!1),e&&t({type:"set_sso_discovery_state",connections:e})}catch(e){throw c(!1),e}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"ssoDiscovery.email.title",message:"Enter your email to continue"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:2},rZ.createElement(iU,{email:r,setEmail:n,hideLabel:!0,error:i}),rZ.createElement(oZ,{variant:"primary",loading:l,type:"submit"},a._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},a._({id:"button.goBack",message:"Go back"}))))},[aS]:()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO();return tm(id,{gap:6},tm(nZ,{variant:"header"},r._({id:"ssoDiscovery.title",message:"Select a connection to continue"})),tm(id,{gap:4},tm(sz,{availableConnections:e.formState.ssoDiscoveryState.connections}),tm(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[ak]:()=>{let[,e]=t2(aW).state,[t,r]=tG(""),[n,a]=tG(),[o,i]=tG(!1),s=t2(aW).client,{ssoOptions:l}=t2(aW).config,{i18n:c,_:d}=nO(),{trigger:u}=oM("stytch.organization.getBySlug",async(e,{arg:{slug:t}})=>s.organization.getBySlug({organization_slug:t}),{onError:()=>{a(c._({id:"ssoDiscovery.fallback.error.unknown",message:"An error occurred. Please try again."})),i(!1)}}),h=async r=>{r.preventDefault(),a(void 0),i(!0);let n=await u({slug:t});if(n){let{organization:t}=n;if(null===t)a(c._({id:"ssoDiscovery.fallback.error.orgNotFound",message:"Organization not found. Please try again."})),i(!1);else if(1===t.sso_active_connections.length){let[e]=t.sso_active_connections;await s.sso.start({connection_id:e.connection_id,login_redirect_url:l?.loginRedirectURL,signup_redirect_url:l?.signupRedirectURL})}else e({type:"set_organization",organization:t}),e({type:"transition",screen:at})}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},c._({id:"ssoDiscovery.fallback.title",message:"Sorry, we couldn't find any connections"})),rZ.createElement(nZ,null,c._({id:"ssoDiscovery.fallback.content",message:"Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."})),rZ.createElement(id,{as:"form",onSubmit:h,gap:2},rZ.createElement(iN,{id:"organization-slug",hideLabel:!0,label:c._({id:"formField.orgSlug.label",message:"Organization slug"}),value:t,onChange:e=>r(e.target.value),placeholder:c._({id:"formField.orgSlug.label",message:"Organization slug"}),error:n}),rZ.createElement(oZ,{variant:"primary",loading:o,type:"submit",disabled:!t||o},c._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"transition",screen:at})}},c._({id:"ssoDiscovery.fallback.button.reset",message:"Try another method"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{e({type:"navigate_back"})}},c._({id:"button.goBack",message:"Go back"}))))}},ssoAndOAuthButtons:{SsoAndOAuthButtons:sD,SSOButton:o9},icons:{google:o2,microsoft:o3,okta:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#191919",fillRule:"evenodd",d:"m10.9 1.13-.37 4.56a5 5 0 0 0-1.19.01l-.2-2.2q0-.12.11-.13h.38l-.18-2.24q.01-.12.11-.13h1.23q.11.01.11.13m-3.09.22q-.04-.1-.15-.08l-1.15.42q-.11.06-.07.16l.94 2.04-.36.13q-.1.06-.06.16l.95 2a4 4 0 0 1 1.12-.42zM5 2.62l2.65 3.73q-.51.33-.9.78l-1.6-1.56a.12.12 0 0 1 .01-.18l.3-.23-1.58-1.6a.12.12 0 0 1 0-.18l.94-.78a.12.12 0 0 1 .17.02M2.77 4.78q-.1-.05-.17.04l-.61 1.06a.12.12 0 0 0 .05.17L4.07 7l-.2.32a.12.12 0 0 0 .06.17l2.02.92q.22-.56.59-1.04zm-1.5 2.88q.03-.11.15-.1l4.42 1.16q-.17.57-.19 1.18l-2.21-.18a.12.12 0 0 1-.1-.14l.06-.37L1.16 9q-.11-.02-.1-.14zm-.16 2.99q-.12.02-.1.14l.2 1.2q.05.12.15.1l2.17-.56.07.37c0 .06.08.1.14.09l2.14-.59q-.19-.56-.22-1.17zm.7 3.17a.12.12 0 0 1 .06-.17L6 11.7q.24.55.62 1.02L4.8 14.01a.12.12 0 0 1-.17-.04l-.19-.33-1.84 1.28q-.1.05-.17-.04zm5.02-.86L3.6 16.21a.12.12 0 0 0 0 .18l.95.79q.1.06.17-.02l1.3-1.84.29.25q.1.07.18-.03l1.26-1.82a5 5 0 0 1-.93-.76m-.64 5.22a.12.12 0 0 1-.07-.16l1.91-4.15q.53.27 1.13.39L8.6 16.4a.12.12 0 0 1-.16.07l-.35-.12-.6 2.16q-.04.1-.15.08zm3.28-3.87-.37 4.56q0 .12.12.13h1.22q.12-.01.12-.13l-.18-2.23h.37q.12-.02.12-.14l-.2-2.2a4 4 0 0 1-1.2.01M13.9 1.97a.12.12 0 0 0-.07-.17l-1.15-.41q-.12-.03-.16.08l-.6 2.16-.35-.13q-.1-.02-.15.08l-.56 2.15q.6.12 1.12.39zm2.5 1.81-3.21 3.26a4 4 0 0 0-.93-.76l1.26-1.83a.12.12 0 0 1 .18-.03l.29.25 1.3-1.83a.12.12 0 0 1 .17-.02l.94.79q.09.08.01.17m1.75 2.56q.1-.05.05-.17l-.62-1.05a.12.12 0 0 0-.17-.04l-1.84 1.27-.2-.32q-.06-.1-.16-.04l-1.82 1.29q.38.46.62 1.02zM18.79 8l.2 1.2a.12.12 0 0 1-.1.15l-4.55.42a4 4 0 0 0-.23-1.17l2.14-.59q.12-.02.15.1l.06.37 2.17-.57q.12-.03.15.1zm-.2 4.43q.1.01.14-.1l.2-1.2a.12.12 0 0 0-.1-.15l-2.23-.2.06-.37a.12.12 0 0 0-.1-.14l-2.22-.18q-.01.6-.19 1.18l4.43 1.15m-1.19 2.75a.12.12 0 0 1-.17.04l-3.77-2.6q.36-.48.59-1.04l2.02.92q.1.06.05.16l-.19.33 2.03.96q.1.05.05.17zm-5.04-1.54 2.65 3.73q.08.08.17.02l.94-.79a.12.12 0 0 0 0-.17l-1.57-1.6.3-.23q.08-.09 0-.18l-1.59-1.56q-.4.46-.9.78m-.02 5.08q-.12.03-.16-.08l-1.2-4.41q.59-.14 1.1-.43l.96 2.01c.03.06 0 .14-.06.16l-.36.13.94 2.04q.04.1-.07.16z",clipRule:"evenodd",className:o0}))}}});nW(".Logo_module_container__f17fe7db{align-items:center;display:flex;gap:var(--st-spacing-2);justify-content:center}.Logo_module_logo__f17fe7db{max-height:50px;max-width:100px}");var sN="Logo_module_logo__f17fe7db";let sU=({orgLogo:e,appLogo:t})=>e||t?rZ.createElement("div",{className:"Logo_module_container__f17fe7db"},e&&rZ.createElement("img",{className:sN,src:e.url,alt:e.alt}),t&&rZ.createElement("img",{className:sN,src:t.url,alt:t.alt})):null,sF=({text:e,onGoBack:t})=>{let{i18n:r,_:n}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"error.title",message:"Looks like there was an error!"}),body:e}),t&&rZ.createElement(oZ,{variant:"outline",onClick:t},r._({id:"button.goBack",message:"Go back"})))},sq=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{type:a,canGoBack:o}=e.error,i=e.flowState.organization?.organization_name,s={[az]:r._({id:"error.default",message:"Something went wrong. Try again later or contact your admin for help."}),[aM]:r._({id:"error.eml",message:"Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."}),[aI]:r._({id:"error.organization",message:"The organization you are looking for could not be found. If you think this is a mistake, contact your admin."}),[aR]:i?r._({id:"error.authPolicyWithOrg",message:"Unable to join due to {organizationName}'s authentication policy. Please contact your admin for more information.",values:{organizationName:i}}):r._({id:"error.authPolicyNoOrg",message:"Unable to join due to the organization's authentication policy. Please contact your admin for more information."}),[aL]:r._({id:"error.adBlockerDetected",message:"The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."}),[aB]:r._({id:"error.claimedDomain",message:"Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."})},l=t1(()=>{if(o)return()=>t({type:"transition",screen:at})},[o,t]);return rZ.createElement(sF,{text:s[a],onGoBack:l})};nW(".Root_module_root__870c11a1{color-scheme:var(--st-color-scheme);font-family:var(--st-font-family);isolation:isolate}:where(.Root_module_root__870c11a1),:where(.Root_module_root__870c11a1) *{box-sizing:border-box;margin:0;padding:0}:where(.Root_module_root__870c11a1) :is(span,strong,em,p,a){font-feature-settings:inherit;font-size:inherit;font-variant:inherit;line-height:inherit}:where(.Root_module_root__870c11a1) :is(span,strong,em,p){color:inherit}:where(.Root_module_root__870c11a1) :is(span,em,p){font-weight:inherit}:where(.Root_module_root__870c11a1) :is(img,svg){display:block}.Root_module_root__870c11a1 a{-webkit-text-decoration:none;text-decoration:none}.Root_module_root__870c11a1 :is(b,strong){font-weight:var(--st-font-weight-bold)}.Root_module_root__870c11a1{--st-font-weight-normal:400;--st-font-weight-medium:500;--st-font-weight-semibold:600;--st-font-weight-bold:700;--st-rounded-md:calc(var(--st-rounded-base)*2);--st-rounded-2xl:calc(var(--st-rounded-base)*6);--st-rounded-full:calc(var(--st-rounded-base)*9999);--st-text-xs:calc(var(--st-text-base)*0.75);--st-text-sm:calc(var(--st-text-base)*0.875);--st-text-2xl:calc(var(--st-text-base)*1.5);--st-line-height-xs:1.33333;--st-line-height-sm:1.42857;--st-line-height-base:1.5;--st-line-height-2xl:1.33333;--st-spacing-0_5:calc(var(--st-spacing)*0.5);--st-spacing-2:calc(var(--st-spacing)*2);--st-spacing-3:calc(var(--st-spacing)*3);--st-spacing-4:calc(var(--st-spacing)*4);--st-spacing-5:calc(var(--st-spacing)*5);--st-spacing-6:calc(var(--st-spacing)*6);--st-spacing-7:calc(var(--st-spacing)*7);--st-spacing-8:calc(var(--st-spacing)*8);--st-spacing-9:calc(var(--st-spacing)*9);--st-spacing-10:calc(var(--st-spacing)*10);--st-tab-background:color-mix(in oklab,var(--st-accent) 80%,transparent);--st-primary-button-hover:color-mix(in oklab,var(--st-primary) 90%,transparent);--st-secondary-button-hover:color-mix(in oklab,var(--st-secondary) 80%,transparent);--st-destructive-button-hover:color-mix(in oklab,var(--st-destructive) 80%,transparent);--st-divider-color:color-mix(in oklab,var(--st-border) 50%,transparent);--st-focus-ring-shadow:0 0 0 3px color-mix(in oklab,var(--st-ring) 50%,transparent);--st-shadow:0 0;--st-shadow-input:var(--st-shadow);--st-shadow-button:var(--st-shadow);--st-button-radius:var(--st-rounded-md);--st-input-radius:var(--st-rounded-md);--st-container-radius:var(--st-rounded-2xl);--st-container-border:var(--st-border);--st-header-font:var(--st-font-family)}"),nW(".inputBase_module_inputBase__06c14ae4{background-color:var(--st-background);border:1px solid var(--st-input);border-radius:var(--st-input-radius);box-shadow:var(--st-shadow-input);color:var(--st-foreground);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm)}.inputBase_module_forceFocusRing__06c14ae4,:is(.inputBase_module_focusRing__06c14ae4,.inputBase_module_inputBase__06c14ae4):focus-visible{border-color:var(--st-ring);box-shadow:var(--st-shadow-input),var(--st-focus-ring-shadow);outline:0}");nW("[dir=rtl] .i18n_module_rtlIcon__278ecfc9{scale:-1 1}.i18n_module_rtlIcon__278ecfc9:dir(rtl){scale:-1 1}"),nW("a.Watermark_module_watermark__6a046c31{align-items:center;border-radius:var(--st-rounded-md);color:var(--st-muted-foreground);display:flex;padding:var(--st-spacing-2) var(--st-spacing-3);transition:background var(--st-transition-duration),color var(--st-transition-duration)}a.Watermark_module_watermark__6a046c31:hover{background:var(--st-accent);color:var(--st-accent-foreground)}a.Watermark_module_watermark__6a046c31 span{font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);line-height:var(--st-line-height-sm)}a.Watermark_module_watermark__6a046c31 svg{height:24px}a.Watermark_module_watermark__6a046c31 path{fill:hsl(218.92,100%,calc(7.25%*(1 + var(--st-dark-mode, 0)*100)))}");let sH=({poweredBy:e,label:t})=>rZ.createElement("a",{className:nj("Watermark_module_watermark__6a046c31","inputBase_module_focusRing__06c14ae4"),href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},rZ.createElement("span",null,e,"\xa0"),rZ.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 47 24","aria-label":t},rZ.createElement("path",{fillRule:"evenodd",d:"M3.58 9.1c0 .86.37 1.26 1.4 1.5v.01l1.36.33c2 .5 2.9 1.47 2.9 3.18 0 2.3-1.56 3.6-4.09 3.6S1.19 16.57 1 14.37h2.19c.14 1.1.83 1.66 1.96 1.66 1.14 0 1.87-.61 1.87-1.56 0-.9-.45-1.35-1.62-1.61l-1.37-.31c-1.22-.3-2.67-1.09-2.67-3.2C1.36 7.35 2.9 6 5.18 6c2.46 0 3.73.98 3.89 2.98H6.79c-.1-.89-.64-1.32-1.64-1.32-.93 0-1.57.56-1.57 1.43Zm31.95 2.84c-.16-.83-.7-1.22-1.68-1.22h-.14c-1.3 0-2.13 1.02-2.13 2.6 0 1.57.84 2.59 2.13 2.59h.14c.98 0 1.52-.39 1.68-1.22h2.15c-.2 1.96-1.58 3.03-3.9 3.03-2.46 0-4.18-1.81-4.18-4.4 0-2.6 1.72-4.41 4.18-4.41 2.32 0 3.7 1.07 3.9 3.03h-2.15Zm-8.5 2.9v-4.17h2.27V8.9h-1.48a.8.8 0 0 1-.8-.8V6h-2.17v2.9h-1.8a1.9 1.9 0 0 0-1.74 1.16l-1.88 4.44-2-4.47a1.9 1.9 0 0 0-1.72-1.13h-2.6a.8.8 0 0 1-.8-.8V6h-2.16v9.47c0 1.47.78 2.25 2.25 2.25h2.06v-1.8h-1.08c-.84 0-1.06-.23-1.06-1.08v-4.17h2.64c.24 0 .42.1.5.28l2.92 6.14v.45c0 .87-.24.9-1.06.9h-2.73v1.85h3.6c1.39 0 2.25-.98 2.25-2.57l.01-.73 2.8-6.04c.08-.18.26-.28.5-.28h1.1v4.8c0 1.47.78 2.25 2.25 2.25h2.12v-1.81H28.1c-.85 0-1.07-.22-1.07-1.07Zm13.7-4.77.15-.18c.5-.62 1.02-.98 2.16-.98 1.93 0 3.04 1.21 3.04 3.33v5.48h-2.16v-5.21c0-.66-.2-1.18-.54-1.51-.29-.27-.67-.4-1.11-.37-1.05.07-1.53.88-1.53 2.56v4.53h-2.17V6h2.17v4.07Z"}),rZ.createElement("path",{d:"M29.82 22.74v.4h-.57v-3.13h.58v1.4c.16-.3.4-.5.73-.5.48 0 .8.42.8 1.11v.06c0 .72-.38 1.12-.82 1.12a.75.75 0 0 1-.72-.46Zm.95-.68v-.02c0-.46-.2-.7-.47-.7-.3 0-.5.25-.5.7v.02c0 .47.19.7.5.7.28 0 .46-.22.46-.7Zm.97 1.88v-.4c.07.02.18.03.28.03.26 0 .41-.1.5-.44l.02-.02h-.3l-.67-2.15h.62l.49 1.74.48-1.74h.6l-.74 2.29c-.18.6-.48.75-.88.75-.16 0-.3-.02-.4-.06Zm3.7-3.16h-.81v-.5h2.23v.5h-.83v2.37h-.59v-2.37Zm1.36.18h.6l.36 1.73.4-1.73h.67l.42 1.7.35-1.7h.59l-.53 2.19h-.78l-.4-1.67-.38 1.67h-.78l-.51-2.2Zm3.71-.67c0-.21.12-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.15-.96h.58v3.15h-.58V20Zm1.1.29c0-.21.11-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.04 1.12v-.06c0-.68.45-1.12 1.08-1.12.64 0 1.08.44 1.08 1.12v.06c0 .7-.45 1.12-1.08 1.12-.67 0-1.09-.43-1.09-1.12Zm1.57-.02v-.02c0-.47-.2-.7-.49-.7s-.5.23-.5.7v.02c0 .47.19.7.5.7.3 0 .49-.22.49-.7Z"})));nW(".MainContainer_module_container__d1278a0c{background-color:var(--st-background);border:1px solid var(--st-container-border);border-radius:var(--st-container-radius);color:var(--st-foreground);max-width:var(--st-container-width);padding:var(--st-spacing-10) var(--st-spacing-9);width:100%}.MainContainer_module_watermarkContainer__d1278a0c{display:flex;justify-content:center}");let sK=({children:e,displayWatermark:t,theme:r})=>{let{i18n:n,_:a}=nO(),o=tQ(null),{className:i,style:s}=function(e,t){let r=e["mobile-breakpoint"],[n,a]=tG(r);tZ(()=>{a(function e(t,r){if(!r)return t;let n=t.replace(/var\s*\([^)]+\)/gi,e=>{let[t,n]=e.match(/\(([^)]+)\)/)[1].split(",").map(e=>e.trim());return window.getComputedStyle(r).getPropertyValue(t)||n||e});return n===t?n:e(n,r)}(r,t.current))},[r,t]);let o=nR(`(max-width: ${n})`);return{style:t1(()=>(function(e){let{"color-scheme":t,...r}=e,n=Object.fromEntries(Object.entries(r).map(([e,t])=>[`--st-${e}`,t]));return"shadcn"===e["color-scheme"]?n["--st-color-scheme"]="inherit":(n["--st-color-scheme"]=t,n["--st-dark-mode"]="dark"===e["color-scheme"]?"1":"0"),n})(e),[e]),className:nj({"-st-mobile":o})}}(r,o);return rZ.createElement(id,{gap:6,style:s,className:nj("MainContainer_module_container__d1278a0c Root_module_root__870c11a1",i),ref:o},e,t&&rZ.createElement("div",{className:"MainContainer_module_watermarkContainer__d1278a0c"},rZ.createElement(sH,{poweredBy:n._({id:"watermark.poweredBy",message:"Powered by"}),label:n._({id:"watermark.altText",message:"Stytch by Twilio"})})),rZ.createElement(iy,null))},sj=({header:e,text:t})=>{let{i18n:r,_:n}=nO(),a=r._({id:"success.title",message:"Success!"}),o=r._({id:"login.success.content",message:"You have successfully logged in."});return tm(sm,{header:e??a,body:t??o,align:"center"})},s$=()=>{let e=aZ();return iR(()=>{e({type:eu.AuthenticateFlowComplete,data:{}})}),tm(sj,null)};nW(".OrganizationRow_module_organizationRow__bee3960a{justify-content:space-between;text-align:left;width:100%}.OrganizationRow_module_left__bee3960a{align-items:center;display:flex;gap:var(--st-spacing-2)}.OrganizationRow_module_nameText__bee3960a{overflow-wrap:anywhere}.OrganizationRow_module_logo__bee3960a{background-color:var(--st-primary);border-radius:var(--st-rounded-base);color:var(--st-primary-foreground);flex:0 0 auto;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);height:var(--st-spacing-6);line-height:calc(var(--st-spacing-6) - 1px);text-align:center;width:var(--st-spacing-6)}.OrganizationRow_module_right__bee3960a{flex:0 0 auto}.OrganizationRow_module_rightContent__bee3960a{align-items:center;color:var(--st-muted-foreground);display:flex;height:var(--st-spacing-6);justify-content:end;min-width:20px}");var sV="OrganizationRow_module_logo__bee3960a";let sW=()=>rZ.createElement("svg",{className:"OrganizationRow_module_arrow__bee3960a i18n_module_rtlIcon__278ecfc9",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M14.707 10L10.3535 14.3545L9.64648 13.6475L12.793 10.5H6V9.5H12.793L9.64648 6.35352L10.3535 5.64648L14.707 10Z",fill:"currentColor"})),sG=({organization:e,action:t,onClick:r})=>{let{organization_name:n,organization_logo_url:a}=e,o=a?rZ.createElement("img",{className:sV,src:a,alt:""}):rZ.createElement("div",{className:sV,role:"presentation"},Array.from(n)[0]);return rZ.createElement("button",{className:nj("OrganizationRow_module_organizationRow__bee3960a","VerticalTransition_module_hoverTrigger__9366f503",oG({variant:"outline"})),onClick:r},rZ.createElement("div",{className:"OrganizationRow_module_left__bee3960a"},o,rZ.createElement("div",{className:"OrganizationRow_module_nameText__bee3960a"},n)),rZ.createElement(ii,{trigger:"hover",rootClassName:"OrganizationRow_module_right__bee3960a",className:"OrganizationRow_module_rightContent__bee3960a",primary:t&&rZ.createElement(nJ,null,t),secondary:rZ.createElement(sW,null)}))},sY=e=>"eligible_to_join_by_email_domain"===e||"eligible_to_join_by_oauth_tenant"===e,sZ=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{createOrganizationEnabled:a}=oI(),{i18n:o,_:i}=nO(),s=()=>t({type:"transition",screen:at}),{trigger:l,isMutating:c}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),d=a&&n.directCreateOrganizationForNoMembership;if(tZ(()=>{d&&l()},[d,l]),d||c)return rZ.createElement(i5,null);let u=e.formState.discoveryState.email;return a&&!n.disableCreateOrganization?rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.create.title",message:"Create an organization to get started"})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.create.content",message:"{email} does not have an account. Think this is a mistake? Try a different email address, or contact your admin.",values:{email:u}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>l()},o._({id:"button.createAnOrganization",message:"Create an organization"})),rZ.createElement(oZ,{variant:"ghost",onClick:s},o._({id:"button.goBack",message:"Go back"})))):rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.title",message:"{email} does not belong to any organizations.",values:{email:u}})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.content",message:"Make sure your email address is correct. Otherwise, you might need to be invited by your admin."})),rZ.createElement(oZ,{variant:"outline",onClick:s},o._({id:"button.tryDifferentEmailAddress",message:"Try a different email address"})))},sJ=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{i18n:a,_:o}=nO(),i=!!n.directLoginForSingleMembership?.status,{createOrganizationEnabled:s}=oI();tZ(()=>{if(u)return;let t=((e,t)=>{if(!t?.status)return null;let r=e.filter(e=>"active_member"===e.membership.type),n=e.some(e=>("pending_member"===e.membership.type||"invited_member"===e.membership.type)&&!t.ignoreInvites||sY(e.membership.type)&&!t.ignoreJitProvisioning);return 1!==r.length||n?null:r[0]})(e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership);i&&null!==t&&l(t)},[i,e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership]);let l=e=>{let r=e.organization;if(e.primary_required){let n=e.primary_required.allowed_auth_methods;n&&1===n.length&&"sso"===n[0]&&r.sso_default_connection_id?c(r.sso_default_connection_id):t({type:"select_discovered_organization",discoveredOrganization:e})}else d({organizationId:r.organization_id})},c=t0(e=>{r.sso.start({connection_id:e,login_redirect_url:n.ssoOptions?.loginRedirectURL,signup_redirect_url:n.ssoOptions?.signupRedirectURL})},[r,n.ssoOptions]),{trigger:d,isMutating:u}=oM("stytch.discovery.intermediateSessions.exchange",(e,{arg:{organizationId:t}})=>r.discovery.intermediateSessions.exchange({organization_id:t,session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),{trigger:h,isMutating:m}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}});if(u)return rZ.createElement(i4,null);if(m)return rZ.createElement(i5,null);if(0===e.formState.discoveryState.discoveredOrganizations.length)return rZ.createElement(sZ,null);let p=e.formState.discoveryState.discoveredOrganizations.map(e=>{let t,{organization:r,membership:n}=e;return sY(n.type)||"pending_member"===n.type?t=a._({id:"organizationDiscovery.join",message:"Join"}):"invited_member"===n.type&&(t=a._({id:"organizationDiscovery.acceptInvite",message:"Accept Invite"})),rZ.createElement(sG,{key:r.organization_id,organization:r,action:t,onClick:()=>l(e)})}),_=s&&!n.disableCreateOrganization?rZ.createElement(oZ,{variant:"outline",onClick:()=>h()},a._({id:"button.createAnOrganization",message:"Create an organization"})):null,g=rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"transition",screen:at})},a._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"organizationDiscovery.title",message:"Select an organization to continue"})),_?rZ.createElement(iw,{top:p,bottom:rZ.createElement(rZ.Fragment,null,_,g)}):rZ.createElement(id,{gap:4},rZ.createElement(iw,null,p),g))},sQ=e=>e===aP||e===aT,sX=()=>{var e;let t,r,n,a,o,{options:i}=t2(nq),[l]=t2(aW).state,{i18n:c,_:d}=nO(),{primaryAuthMethods:u,email:h,emailVerified:m}=l.primary,p=t2(aW).config,{products:_}=iG(),g=l.flowState.type===s.Organization&&!l.flowState.organization,f=(r=(e=l.flowState).type,a=((n=new Set(_.map(e=>e.id))).has("emailMagicLinks")||n.has("emailOtp"))&&n.has("passwords"),o=r===s.Organization?aA:ax,Array.from(_.reduce((t,n)=>{switch(n.id){case"emailMagicLinks":case"emailOtp":a?t.add(o):t.add(r===s.Organization?aE:aC);break;case"oauth":t.add(aP);break;case"sso":(r===s.Discovery||r===s.Organization&&(e.organization?.sso_active_connections?.length??0)>0)&&t.add(aT);break;case"passwords":t.add(a?o:aO)}return t},new Set)).reduce((e,t,r,n)=>{let a=r>0?n[r-1]:void 0;if(a&&sQ(t)&&sQ(a))e[e.length-1].push(t);else{let r=e.length>0?e[e.length-1]:void 0;r&&sQ(r[0])!==sQ(t)&&e.push([aD]),e.push([t])}return e},[])),y=oN(p,"mainScreen"),{SsoAndOAuthButtons:v}=oN(p,"ssoAndOAuthButtons"),b=l.flowState.organization?.organization_name;switch(l.flowState.type){case s.Discovery:t=c._({id:"login.title",message:"Sign up or log in"});break;case s.PasswordReset:t="";break;default:t=b?c._({id:"organizationLogin.title",message:"Continue to {organizationName}",values:{organizationName:b}}):c._({id:"organizationLogin.titleUnknown",message:"Continue to ..."})}return g?rZ.createElement(i5,null):rZ.createElement(id,{gap:6},!i.hideHeaderText&&(h&&!1===m&&u?rZ.createElement(rZ.Fragment,null,rZ.createElement(nZ,{variant:"header"},c._({id:"emailVerification.title",message:"Verify your email"})),rZ.createElement(nZ,null,c._({id:"emailVerification.content",message:"Confirm your email address with one of the following:"}))):t&&rZ.createElement(nZ,{variant:"header",align:"center"},t)),rZ.createElement(id,{gap:4},f.map(e=>e.every(sQ)?rZ.createElement(v,{key:"buttons",buttons:e}):e.map((e,t)=>{let r=y[e];return r?rZ.createElement(r,{key:e}):e===aD?rZ.createElement(ib,{key:"divider"+t}):null}))))},s1={[d.totp]:{messageDescriptor:{id:"mfa.enrollment.option.totp",message:"Use an authenticator app"},screen:af},[d.smsOtp]:{messageDescriptor:{id:"mfa.enrollment.option.sms",message:"Text me a code"},screen:ap}},s0=()=>{let{i18n:e,_:t}=nO(),{mfaProductInclude:r,mfaProductOrder:n}=t2(aW).config,[a,o]=t2(aW).state,{organizationMfaOptionsSupported:i}=a.mfa.primaryInfo,s=t1(()=>{let e=aU({allMethods:aj,orgSupportedMethods:i,uiIncludedMethods:r}),t=[];for(let r of n??aj)e.has(r)&&(t.push(r),e.delete(r));return t.push(...e),t},[r,n,i]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e._({id:"mfa.enrollment.title",message:"Set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},e._({id:"mfa.enrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(iw,null,s.map(t=>{let{messageDescriptor:r,screen:n}=s1[t];return rZ.createElement(oZ,{key:t,variant:"outline",onClick:()=>{o({type:"transition",screen:n,history:"push"})}},e._(r))})))};nW(".RecoveryCodeEntryScreen_module_input__0b7ea085.RecoveryCodeEntryScreen_module_input__0b7ea085{font-family:var(--st-font-family-mono)}");let s2=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{memberId:i,organizationId:s}=a.mfa.primaryInfo,{trigger:l,isMutating:c,error:d}=oM("stytch.recoveryCodes.recover",(t,{arg:{recoveryCode:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.recoveryCodes.recover({recovery_code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{throwOnError:!1,onSuccess:()=>{o({type:"recovery_code/authenticate_success"})}}),[u,h]=tG(""),m=d?r._({id:"recoveryCodes.entry.error.invalidCode",message:"Invalid backup code, please try again."}):void 0,p=async e=>{e.preventDefault(),l({recoveryCode:u,memberId:i,organizationId:s,sessionDurationMinutes:t})};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},r._({id:"recoveryCodes.entry.title",message:"Enter backup code"})),rZ.createElement(nZ,{variant:"body"},r._({id:"recoveryCodes.entry.content",message:"Enter one of the backup codes you saved when setting up your authenticator app."})),rZ.createElement(iN,{id:"recovery-code",className:"RecoveryCodeEntryScreen_module_input__0b7ea085",value:u,onChange:e=>{h(e.target.value)},placeholder:r._({id:"formField.backupCode.placeholder",message:"Enter backup code"}),label:r._({id:"formField.backupCode.ariaLabel",message:"Backup code"}),hideLabel:!0,required:!0,autoComplete:"off",spellCheck:!1,error:m}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:c,type:"submit",disabled:!u||c},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"}))))};nW(".CodeContainer_module_container__1b0ae913{background:var(--st-accent);padding:var(--st-spacing-2) var(--st-spacing-4)}");let s3=({children:e,className:t,...r})=>rZ.createElement("div",{className:nj(t,"CodeContainer_module_container__1b0ae913"),...r},e);nW(".RecoveryCodeSaveScreen_module_codes__5283da32{column-gap:4ch;display:grid;grid-template-columns:repeat(auto-fill,var(--st-max-code-length));justify-content:center;list-style:none;margin:0 auto;max-width:calc(var(--st-max-code-length)*2 + 4ch)}.RecoveryCodeSaveScreen_module_codes__5283da32 li{-webkit-user-select:all;user-select:all;white-space:nowrap}");let s4=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{recoveryCodes:a}=e.mfa.totp.enrollment,o=t1(()=>{let e="Win32"===navigator.platform?"\r\n":"\n",t=new Blob([a.join(e)],{type:"text/plain"});return URL.createObjectURL(t)},[a]),i=e.flowState.organization?.organization_name,s=i?r._({id:"recoveryCodes.filename.withOrganizationName",message:"{organizationName}-backup-codes",values:{organizationName:i}}):r._({id:"recoveryCodes.filename.noOrganizationName",message:"backup-codes"}),[l,c]=io(3),d=async()=>{try{await navigator.clipboard.writeText(a.join("\n")),c(!0)}catch{im({message:r._({id:"recoveryCodes.save.toast.copyFailed",message:"Couldn't copy codes to clipboard"})})}},u=Math.max(...a.map(e=>e.length));return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"recoveryCodes.save.title",message:"Save your backup codes!"}),body:r._({id:"recoveryCodes.save.content",message:"This is the only time you will be able to access and save your backup codes."})}),rZ.createElement(s3,null,rZ.createElement(nZ,{font:"mono"},rZ.createElement("ul",{className:"RecoveryCodeSaveScreen_module_codes__5283da32",style:{"--st-max-code-length":u+"ch"}},a.map((e,t)=>rZ.createElement("li",{key:t},e))))),rZ.createElement(iw,null,rZ.createElement(oJ,{variant:"primary",href:o,download:s+".txt"},rZ.createElement(ii,{primary:r._({id:"recoveryCodes.save.button.download",message:"Download .txt file"}),secondary:r._({id:"recoveryCodes.save.button.copied",message:"Copied!"}),triggered:l})),rZ.createElement(oZ,{variant:"outline",onClick:d},r._({id:"recoveryCodes.save.button.copyAll",message:"Copy all to clipboard"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"recovery_code/save_acknowledge"})}},r._({id:"recoveryCodes.save.button.done",message:"Done"}))))},s5=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),1e4))]);if(!n)return t;return n.national}catch{return t}},s8=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{let n=eA[r],a={isValid:!0,number:`+${n}${t}`};try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),2e3))]);if(!n)return a;return n}catch{return a}};nW(".PhoneInput_module_container__5c1958d4{display:grid;gap:var(--st-spacing-2);grid-template-columns:calc(var(--st-spacing)*22.5) 1fr}.PhoneInput_module_phone__5c1958d4{grid-area:1/2/2/3}.PhoneInput_module_select__5c1958d4{appearance:none;grid-area:1/1/2/2;padding-block:var(--st-spacing-2);padding-inline:var(--st-spacing-3) var(--st-spacing-6)}.-st-mobile .PhoneInput_module_select__5c1958d4{padding-block:var(--st-spacing-3)}.PhoneInput_module_chevron__5c1958d4{color:var(--st-muted-foreground);grid-area:1/1/2/2;margin-inline-end:var(--st-spacing-2);place-self:center end;pointer-events:none;rotate:90deg}.PhoneInput_module_error__5c1958d4{grid-area:2/1/3/3}");let s6="(201) 555-0123",s7=({phone:e,setPhone:t,country:r,setCountry:n,parsePhoneNumber:a,getExampleNumber:o,hasPasskeys:i,error:s,...l})=>{let c,{i18n:d,_:u}=nO(),h=(c=iM(),s?{error:{id:c},input:{"aria-errormessage":c,"aria-invalid":!0}}:{error:{id:c},input:{}}),m=new Intl.DisplayNames(["en"],{type:"region"}),[p,_]=tG(s6),g=tQ(null),[f,y]=tG(e);return rZ.createElement("div",{className:"PhoneInput_module_container__5c1958d4"},rZ.createElement("select",{"aria-label":d._({id:"formField.countryCode.label",message:"Country code"}),className:"PhoneInput_module_select__5c1958d4 inputBase_module_inputBase__06c14ae4",autoComplete:"tel-country-code",value:r,onChange:async e=>{let t=e.target.value;n(t),g.current?.focus();let a=await Promise.race([o(r),new Promise(e=>setTimeout(()=>e(void 0),100))]);t===e.target.value&&_(a??s6)}},Object.entries(eA).map(([e,t])=>rZ.createElement("option",{key:e,value:e},e!==r?`+${t} ${m.of(e)}`:`+${t}`))),rZ.createElement(o8,{className:"PhoneInput_module_chevron__5c1958d4",role:"presentation"}),rZ.createElement(iN,{id:"phone-input",label:d._({id:"formField.phone.label",message:"Phone number"}),hideLabel:!0,ref:g,type:"tel",autoComplete:i?"username webauthn":"tel-national",containerClassName:"PhoneInput_module_phone__5c1958d4",value:f,placeholder:p,onChange:async e=>{let n=e.target.value;y(n);let o=await s5({parsePhoneNumber:a,phoneNumber:n,country:r});n===e.target.value&&(t(o),y(o))},required:!0,...h.input,...i?iz:{},...l}),s&&rZ.createElement("div",{className:"PhoneInput_module_error__5c1958d4"},rZ.createElement(iB,h.error,s)))};class s9 extends b{constructor(){super("InvalidPhoneNumberError","Invalid phone number")}}let le=()=>{let e,t=t2(aW).client,[r,n]=t2(aW).state,{i18n:a,_:o}=nO(),{smsOtpOptions:i}=t2(aW).config,{mfa:{smsOtp:{isSending:s,sendError:l,enrolledNumber:c}}}=r,{memberId:d,organizationId:u}=r.mfa.primaryInfo,[h,m]=rZ.useState(c?.countryCode??"US"),[p,_]=rZ.useState(c?.phoneNumber??""),g=rZ.useMemo(()=>{if(l)return l instanceof s9?a._({id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."}):ic(l,o)},[l,o]),{parsePhoneNumber:f,getExampleNumber:y}=(e=r1(t).clientsideServices,{getExampleNumber:t=>e.getExamplePhoneNumber({regionCode:t}).then(e=>e.phoneNumber),parsePhoneNumber:(t,r)=>e.parsedPhoneNumber({phoneNumber:t,regionCode:r})}),{trigger:v}=oM("stytch.otps.sms.send",async(e,{arg:{parsedNumber:r,locale:n}})=>t.otps.sms.send({mfa_phone_number:r,member_id:d,organization_id:u,locale:n}),{onSuccess:e=>{n({type:"sms_otp/send_success",response:e,countryCode:h,phoneNumber:p,formattedPhoneNumber:`+${eA[h]} ${p}`})},onError:e=>{n({type:"sms_otp/send_error",error:e})}}),b=async e=>{e.preventDefault(),n({type:"sms_otp/send"});try{let e=await s8({parsePhoneNumber:f,phoneNumber:p,country:h});if(!e.isValid)throw new s9;await v({parsedNumber:e.number,locale:i?.locale})}catch(e){n({type:"sms_otp/send_error",error:e})}};return rZ.createElement(id,{as:"form",gap:6,onSubmit:b},rZ.createElement(nZ,{variant:"header"},a._({id:"mfa.smsEnrollment.title",message:"Enter your phone number to set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},a._({id:"mfa.smsEnrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(s7,{country:h,setCountry:m,phone:p,setPhone:_,parsePhoneNumber:f,getExampleNumber:y,error:g}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:s,type:"submit",disabled:!p||s},a._({id:"button.continue",message:"Continue"})),r.screenHistory.length>0&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>n({type:"navigate_back"})},a._({id:"button.goBack",message:"Go back"}))))},lt=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t},smsOtpOptions:r}=t2(aW).config,{i18n:n,_:a}=nO(),[o,i]=t2(aW).state,{mfa:{isEnrolling:s,smsOtp:l,primaryInfo:c}}=o,{codeExpiration:u,formattedDestination:h}=l,{enrolledMfaMethods:m,memberId:p,memberPhoneNumber:_,organizationId:g,organizationMfaOptionsSupported:f}=c,y=ie(),{trigger:v,isMutating:b,error:w}=oM("stytch.otps.sms.send",(t,{arg:{memberId:r,organizationId:n,locale:a}})=>(i({type:"sms_otp/send"}),e.otps.sms.send({member_id:r,organization_id:n,locale:a})),{onSuccess:e=>{i({type:"sms_otp/send_success",response:e})},onError:e=>{let t=ic(e,a);t&&im({message:t}),i({type:"sms_otp/send_error",error:t})},throwOnError:!0}),{trigger:k,isMutating:S,error:E}=oM("stytch.otps.sms.authenticate",(t,{arg:{otp:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.sms.authenticate({code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{onSuccess:()=>{i({type:"sms_otp/authenticate_success"})},onError:()=>{y.clear()}}),C=null===u&&!b&&!w;tZ(()=>{C&&v({memberId:p,organizationId:g,locale:r?.locale}).catch(()=>{})},[p,g,v,C,r?.locale]),tZ(()=>{!h&&_&&(async()=>{i({type:"sms_otp/format_destination",formattedPhoneNumber:await s5({parsePhoneNumber:t=>r1(e).clientsideServices.parsedPhoneNumber({phoneNumber:t}),phoneNumber:_})})})()},[i,h,e,_]);let P=t1(()=>!s&&m.includes(d.totp)&&(0===f.length||f.includes(d.totp)),[m,s,f]),T=E?n._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0,O=t1(()=>s||0===m.length||f.length>0&&!m.some(e=>f.includes(e)),[m,s,f]),A=async()=>{await v({memberId:p,organizationId:g,locale:r?.locale})},x=rZ.createElement(i8,{countdown:y,isSubmitting:S,resendOTP:A}),D=P&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"transition",history:"push",screen:ay})}},n._({id:"mfa.methods.authenticatorApp",message:"Use an authenticator app"})),z=O&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"navigate_back"})}},n._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},null!==u?rZ.createElement(s_,{isSubmitting:S,onSubmit:e=>{k({otp:e,memberId:p,organizationId:g,sessionDurationMinutes:t})},errorMessage:T,expiration:u.getTime(),formattedDestination:h??_??""}):rZ.createElement(i5,null),D&&z?rZ.createElement(iw,{top:x,bottom:rZ.createElement(rZ.Fragment,null,D,z)}):rZ.createElement(iw,null,x,D,z))};nW(".TOTPEnrollManualScreen_module_codeContainer__dc7a0e56{cursor:pointer}.TOTPEnrollManualScreen_module_code__dc7a0e56{column-gap:1ch;display:grid;grid-template-columns:repeat(var(--st-column-count,auto-fill),var(--st-chunk-size,4ch));justify-content:center}");let lr=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),[a,o]=io(3),{secret:i}=e.mfa.totp.enrollment,s=i.toLowerCase(),l=s.split(RegExp("(.{4})","g")).filter(Boolean),{codeRef:c,columnCount:d}=function(e){let t=tQ(null),[r,n]=tG();return tJ(()=>{let r=()=>{if(!t.current)return;let r=Math.floor(t.current.clientWidth/Math.max(...Array.from(t.current.querySelectorAll("span")).map(e=>e.clientWidth))),a=Math.ceil(e/(r-Math.floor(r/4)));n(Math.ceil(e/a))};if(r(),!window.ResizeObserver||!t.current)return;let a=new ResizeObserver(r);return a.observe(t.current),()=>a.disconnect()},[e]),{codeRef:t,columnCount:r}}(l.length),u=async()=>{try{await navigator.clipboard.writeText(s),o(!0)}catch{im({message:r._({id:"mfa.totpEnrollment.toast.copyFailed",message:"Couldn't copy code to clipboard"})});let e=window.getSelection();if(c.current&&e){e.empty();let t=document.createRange();t.selectNodeContents(c.current),e.addRange(t)}}};return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"mfa.totpEnrollment.title",message:"Having trouble scanning the QR code?"}),body:r._({id:"mfa.totpEnrollment.content",message:"Click to copy the code below. Enter into your authenticator app to link your account."})}),rZ.createElement(s3,{className:"TOTPEnrollManualScreen_module_codeContainer__dc7a0e56",onClick:u},rZ.createElement(nZ,{ref:c,className:"TOTPEnrollManualScreen_module_code__dc7a0e56",style:{"--st-column-count":d,"--st-chunk-size":"4ch"},font:"mono"},l.map((e,t)=>rZ.createElement("span",{key:t},e)))),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:u},rZ.createElement(ii,{primary:r._({id:"mfa.totpEnrollment.copyCode.label",message:"Copy to clipboard"}),secondary:r._({id:"mfa.totpEnrollment.copyCode.codeCopied",message:"Copied!"}),triggered:a})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{t({type:"transition",history:"push",screen:ay})}},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"navigate_back"})},r._({id:"button.totpQrRetry",message:"Try to scan the QR code again"}))))};nW(".TOTPEnrollQRScreen_module_qr__ae8d607c{display:block;margin:0 auto}");let ln=()=>{let e=t2(aW).client,[t,r]=t2(aW).state,n=aZ(),a=aY(),{i18n:o,_:i}=nO(),{memberId:s,organizationId:l}=t.mfa.primaryInfo,{data:c}=ox(["stytch.totp.create",s,l],()=>e.totp.create({member_id:s,organization_id:l}),{revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,onSuccess:e=>{n({type:eu.B2BTOTPCreate,data:e}),r({type:"totp/create_success",response:e,memberId:s,organizationId:l})},onError:e=>{let t=ic(e,i);t&&im({message:t}),a(e)}});return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"totp.setupQr.title",message:"Scan the QR code to link your authenticator app"})),rZ.createElement(nZ,{variant:"body"},o._({id:"totp.setupQr.content",message:"Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."})),c?rZ.createElement(rZ.Fragment,null,rZ.createElement("img",{alt:o._({id:"mfaTotpEnrollment.qrAltText",message:"QR code for TOTP enrollment"}),src:c.qr_code,className:"TOTPEnrollQRScreen_module_qr__ae8d607c"}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>{r({type:"transition",history:"push",screen:ay})}},o._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{r({type:"totp/show_code",method:"manual"})}},o._({id:"button.totpQrManual",message:"Having trouble scanning?"})))):rZ.createElement(i5,null))},la=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{mfa:{isEnrolling:i}}=a,{enrolledMfaMethods:s,memberId:l,organizationId:c,organizationMfaOptionsSupported:u}=a.mfa.primaryInfo,{trigger:h,isMutating:m,error:p}=oM("stytch.totp.authenticate",(t,{arg:{memberId:r,organizationId:n,otp:a,sessionDurationMinutes:o}})=>e.totp.authenticate({code:a,member_id:r,organization_id:n,session_duration_minutes:o}),{onSuccess:()=>{o({type:"totp/authenticate_success"})}}),_=t1(()=>!i&&s.includes(d.smsOtp)&&(0===u.length||u.includes(d.smsOtp)),[s,i,u]),g=p?r._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0;return rZ.createElement(id,{gap:6},rZ.createElement(sp,{header:r._({id:"totp.title",message:"Enter verification code"}),instruction:r._({id:"totp.content",message:"Enter the 6-digit code from your authenticator app."}),helperContent:i?r._({id:"mfa.totpEntry.getNewCode",message:"If the verification code doesn’t work, go back to your authenticator app to get a new code."}):null,isSubmitting:m,onSubmit:e=>h({memberId:l,organizationId:c,otp:e,sessionDurationMinutes:t}),errorMessage:g}),rZ.createElement(iw,{top:null,bottom:rZ.createElement(rZ.Fragment,null,_&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:a_})}},r._({id:"mfa.totpEntry.switchToSms",message:"Text me a code instead"})),!i&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:ah})}},r._({id:"mfa.totpEntry.useBackupCode",message:"Use a backup code"})),i&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"})))}))},lo={discovery:{mutationKey:"stytch.magicLinks.discovery.authenticate",onSuccess:oL,defaultError:aM},discovery_oauth:{mutationKey:"stytch.oauth.discovery.authenticate",onSuccess:oL},oauth:{mutationKey:"stytch.oauth.authenticate",onSuccess:oR},sso:{mutationKey:"stytch.sso.authenticate",onSuccess:oR},multi_tenant_magic_links:{mutationKey:"stytch.magicLinks.authenticate",onSuccess:oR,defaultError:aM},multi_tenant_impersonation:{mutationKey:"stytch.impersonation.authenticate",onSuccess:oR}},li={ad_blocker_detected:aL},ls=()=>{let e,[t,r]=t2(aW).state,n=t2(aW).client,a=aY(),o=aZ(),i=t2(aW).config,{displayWatermark:l,theme:c,options:d}=t2(nq),u=oU(),h=t.screen,m=oN(i,"screens"),[p,_]=tG(!1),{mutate:g}=a9(oS,t2(oE)),{slug:f,resultPending:y}=(()=>{let[e,t]=t2(aW).state,[r,n]=tG(),a=t2(aW).config,o=t2(aW).client,i=a.organizationSlug??((e,t)=>{if(null===e)return null;let r=new URL(t);r.search="";let n=r.toString().trim(),a=new RegExp(e.replace(/\./g,"\\.").replace(/\*/g,"(?:[^.]+)").replace("{{slug}}","(.+)")),o=n.match(a);return o&&o[1]?o?.[1]:null})(r||null,window.location.href),{trigger:l,isMutating:c}=oM("stytch.organization.getBySlug",(e,{arg:{slug:t}})=>o.organization.getBySlug({organization_slug:t}),{onSuccess:({organization:e})=>{null===e?t({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}):t({type:"set_organization",organization:{...e}})}});return tZ(()=>{r1(o).bootstrap.getAsync().then(({slugPattern:e})=>{n(e)})},[o]),tZ(()=>{null!==i&&null===e.flowState.organization&&e.screen===at&&e.flowState.type==s.Organization&&l({slug:i})},[i,e.flowState,e.screen]),{slug:i,resultPending:void 0===r||c}})();if(tZ(()=>{if(u||t.flowState.type==s.PasswordReset)return;let e=n.parseAuthenticateUrl();if(!e?.handled)return;let{mutationKey:l,defaultError:c,onSuccess:d}=lo[e.tokenType];_(!0),g(l,n.authenticateByUrl({session_duration_minutes:i.sessionOptions.sessionDurationMinutes})).then(e=>{if(!e?.handled)return;let{data:t}=e,n=oz[l];n&&o({type:n,data:t}),d(t,r,i)},e=>{a(e),((e,t=az)=>{r({type:"set_error_message_and_transition",errorType:li[is(e)]??t,canGoBack:!1})})(e,c)}).finally(()=>_(!1))},[]),tZ(()=>{if(u||p)return;let e=n.parseAuthenticateUrl();!e?.handled&&(f||y||null!==t.flowState.organization||t.screen!==at||t.flowState.type!=s.Organization||r({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}))},[r,u,p,y,f,t.flowState.organization,t.flowState.type,t.screen,n,a]),u)return rZ.createElement(o1,null);if(p)return rZ.createElement(sK,{theme:c,displayWatermark:!1},rZ.createElement(i4,null));if(t.flowState.organization?.organization_logo_url){let{organization_name:r,organization_logo_url:n}=t.flowState.organization;e={url:n,alt:r??""}}let v={[at]:sX,[an]:s$,[aa]:sJ,[ao]:sq,[au]:s0,[ap]:le,[a_]:lt,[ah]:s2,[am]:s4,[af]:ln,[ag]:lr,[ay]:la}[h]??m[h];return rZ.createElement(sK,{theme:c,displayWatermark:l},rZ.createElement(sU,{appLogo:d.logo,orgLogo:e}),rZ.createElement(v,null))},ll=({client:e,presentation:t,callbacks:r,config:n,strings:a})=>{let[o,i]=tG(()=>{let{displayWatermark:t}=r1(e).bootstrap.getSync();return t});tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_login_screen",details:{options:n,bootstrap:t}}),i(t.displayWatermark)})},[e]);let c=new URL(window.location.href).searchParams.get("stytch_redirect_type")===l.ResetPassword?s.PasswordReset:n.authFlowType,d={...aV,screen:c===s.PasswordReset?as:at,flowState:{...aV.flowState,type:c}},u=t1(()=>({...n,sessionOptions:n.sessionOptions??{}}),[n]),h=nF(t,o,u,"B2BProduct");return rZ.createElement(aG,{client:e,callbacks:r,config:u,initialState:d},rZ.createElement(nq.Provider,{value:h},rZ.createElement(nD,{messages:rQ,overrides:a},rZ.createElement(ls,null))))},lc={text:"Verify your identity",details:["View information stored within your account"]},ld={text:"Maintain access to your data even when you're not actively using the app",details:["Access your data even when you are offline.","Synchronize data and process background tasks on your behalf."]},lu="openid",lh="profile",lm="email",lp="phone",l_="offline_access",lg=new Set([lu,lh,lm,lp,"full_access",l_]),lf=[lu,lm,lh],ly=(e,t)=>{if(!t)return[];let r=[];for(let n of e){if(lg.has(n))continue;let e=t.scopes.find(e=>e.scope===n);e&&e.description?r.push(e.description):r.push(`Use the ${n} scope`)}return r},lv=e=>{let t={client_id:"",redirect_uri:"",response_type:"code",scopes:[...lf]};for(let r of["client_id","redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}for(let r of["response_type","scope","code_challenge","state","nonce","prompt"]){let n=e.get(r);n&&("scope"===r?t.scopes=n.split(" ").filter(Boolean):t[r]=n)}return e.has("resource")&&(t.resources=e.getAll("resource")),{error:null,result:t}},lb=e=>{let t={client_id:"",post_logout_redirect_uri:""};for(let r of["client_id","post_logout_redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}return t.id_token_hint=e.get("id_token_hint")||void 0,t.state=e.get("state")||void 0,{error:null,result:t}};nW(".IDPConsentManifest_module_manifest__9dc43278 details{overflow:clip}.IDPConsentManifest_module_manifest__9dc43278 summary,.IDPConsentManifest_module_summaryNoDetail__9dc43278{align-items:center;display:flex;justify-content:space-between}.IDPConsentManifest_module_manifest__9dc43278 summary{cursor:pointer;outline:0}.IDPConsentManifest_module_manifest__9dc43278 details,.IDPConsentManifest_module_summaryNoDetail__9dc43278{padding:var(--st-spacing-2) var(--st-spacing-3)}.IDPConsentManifest_module_summaryNoDetail__9dc43278{min-height:var(--st-spacing-9)}.IDPConsentManifest_module_ungrantable__9dc43278{background:var(--st-muted)}.IDPConsentManifest_module_outerList__9dc43278 details,.IDPConsentManifest_module_ungrantable__9dc43278{border-radius:var(--st-rounded-md)}.IDPConsentManifest_module_outerList__9dc43278 details:has(:focus-visible),.IDPConsentManifest_module_ungrantable__9dc43278:has(:focus-visible){box-shadow:var(--st-focus-ring-shadow)}@supports not selector(:has(:focus-visible)){.IDPConsentManifest_module_outerList__9dc43278 details:focus-within,.IDPConsentManifest_module_ungrantable__9dc43278:focus-within{box-shadow:var(--st-focus-ring-shadow)}}.IDPConsentManifest_module_borderBetween__9dc43278:not(:last-child){border-bottom:1px solid var(--st-border)}.IDPConsentManifest_module_outerList__9dc43278{list-style:none}.IDPConsentManifest_module_nestedList__9dc43278{list-style:disc;padding-block:var(--st-spacing) var(--st-spacing-2);padding-inline-start:var(--st-spacing-4)}.IDPConsentManifest_module_chevron__9dc43278{flex-shrink:0;transition:transform var(--st-transition-duration) ease}details[open] .IDPConsentManifest_module_chevron__9dc43278{transform:rotate(90deg)}");var lw={manifest:"IDPConsentManifest_module_manifest__9dc43278",summaryNoDetail:"IDPConsentManifest_module_summaryNoDetail__9dc43278",ungrantable:"IDPConsentManifest_module_ungrantable__9dc43278 IDPConsentManifest_module_manifest__9dc43278",outerList:"IDPConsentManifest_module_outerList__9dc43278",borderBetween:"IDPConsentManifest_module_borderBetween__9dc43278",nestedList:"IDPConsentManifest_module_nestedList__9dc43278 IDPConsentManifest_module_borderBetween__9dc43278",chevron:"IDPConsentManifest_module_chevron__9dc43278 i18n_module_rtlIcon__278ecfc9"};let lk=({item:e,as:t="li"})=>{"string"==typeof e&&(e={text:e});let r=rZ.createElement(nZ,{variant:"helper"},e.text);return e.details?.length?rZ.createElement(t,{className:lw.borderBetween},rZ.createElement("details",{className:lw.details},rZ.createElement("summary",{onClick:lP},r,rZ.createElement(o8,{className:lw.chevron,role:"presentation"})),rZ.createElement("ul",{className:lw.nestedList},e.details?.map(e=>rZ.createElement(nZ,{as:"li",variant:"helper",key:e},e))))):rZ.createElement(t,{className:nj(lw.summaryNoDetail,lw.borderBetween)},r)},lS=({section:e})=>rZ.createElement(id,{gap:2},rZ.createElement(nZ,{weight:"medium"},e.header),rZ.createElement("ul",{className:lw.outerList},e.items.map((e,t)=>rZ.createElement(lk,{key:t,item:e})))),lE=({manifest:e,clientName:t})=>{let{i18n:r,_:n}=nO(),a="object"==typeof e[0]&&"header"in e[0]?e:[{header:r._({id:"idpConsent.allowClientTo",message:"Allow {clientName} to:",values:{clientName:t}}),items:e}];return rZ.createElement("div",{className:lw.manifest},a.map((e,t)=>rZ.createElement(lS,{key:t,section:e})))},lC=({clientName:e,ungrantableScopeDescriptions:t})=>{let{i18n:r,_:n}=nO();if(!t.length)return null;let a={text:r._({id:"idpConsent.noPermissionsToGrant",message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:e}}),details:t};return rZ.createElement("div",{className:lw.ungrantable},rZ.createElement(lk,{item:a,as:"div"}))};function lP(e){let t=e.currentTarget.parentElement;if(t?.tagName!=="DETAILS")return;e.preventDefault();let r=t.open,n=e.currentTarget.clientHeight+"px",a=getComputedStyle(t),o=`calc(${n} + ${a.paddingTop} + ${a.paddingBottom})`,i={duration:iu(e.currentTarget),easing:"ease-in-out"};if(r){let e=t.clientHeight+"px";t.animate([{height:e},{height:o}],i).finished.then(()=>{t.open=!1})}else t.open=!0,requestAnimationFrame(()=>{let e=t.clientHeight+"px";t.animate([{height:o},{height:e}],i)})}let lT=(e,t)=>{switch(t.type){case"START_SUBMIT":return{...e,loading:!0};case"COMPLETE_SUBMIT":return{...e,loading:!1,success:!0};case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,client:t.client,consent_required:t.consent_required,grantable_scope:t.grantable_scope,ungrantable_scope:t.ungrantable_scope};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lO=({bootstrap:e,bootstrapNotLoaded:t,state:r,submit:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l,success:c,client:d}=r,u=t2(nz),h=t1(()=>{let e=r.client?.client_name??"";if(!e)try{e=new URL(r.redirect_uri).hostname}catch(t){eC("Unable to parse host from redirect URI.",t),e=a._({id:"idpConsent.defaultClientName",message:"The App"})}return e},[r.client?.client_name,r.redirect_uri,o]),m=t1(()=>{if(u)try{return u({scopes:r.grantable_scope.split(" "),clientName:h})}catch(e){eP("Error rendering custom consent screen. Falling back to default consent screen.",e)}return(({scopes:e,clientName:t,rbacPolicy:r})=>{let n;return[{header:`${t} is requesting to:`,items:(n=[],e.includes(lu)&&n.push(lc),(e.includes(lm)||e.includes(lh)||e.includes(lp))&&n.push((({containsProfile:e,containsEmail:t,containsPhoneNumber:r})=>{let n=[];return e&&n.push("Your name, profile picture, and language preferences"),t&&n.push("Your email address"),r&&n.push("Your phone number"),{text:"View your personal profile information",details:n}})({containsEmail:e.includes(lm),containsPhoneNumber:e.includes(lp),containsProfile:e.includes(lh)})),e.includes(l_)&&n.push(ld),n).concat(ly(e,r))}]})({scopes:r.grantable_scope.split(" "),rbacPolicy:e.rbacPolicy,clientName:h})},[u,r.grantable_scope,h,e.rbacPolicy]),p=t1(()=>""===r.ungrantable_scope?[]:ly(r.ungrantable_scope.split(" "),e.rbacPolicy),[r.ungrantable_scope,e.rbacPolicy]);return i||t?rZ.createElement(i5,null):s?rZ.createElement(sF,{text:s}):l?rZ.createElement(sF,{text:a._({id:"idpConsent.denied",message:"Access to the application was denied."})}):c?rZ.createElement(sj,null):rZ.createElement(lA,{client:d,submit:n,grantableScope:r.grantable_scope,projectName:e.projectName},rZ.createElement(lC,{ungrantableScopeDescriptions:p,clientName:h}),rZ.createElement(lE,{manifest:m,clientName:h}))},lA=({client:e,submit:t,grantableScope:r,projectName:n,children:a})=>{let{i18n:o,_:i}=nO(),{options:s}=t2(nq),l=e.client_name,c=r.split(" ").some(e=>!lg.has(e))?o._({id:"idpConsent.customScopes.title",message:"{clientName} wants to access your {projectName} account",values:{clientName:l,projectName:n}}):o._({id:"idpConsent.signIn.title",message:"Sign in to {clientName} with {projectName}",values:{clientName:l,projectName:n}});return rZ.createElement(id,{gap:6},s.logo&&rZ.createElement(sU,{appLogo:s.logo}),rZ.createElement(nZ,{variant:"header",align:"center"},c),a,rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},o._({id:"idpConsent.button.allow",message:"Allow"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},o._({id:"idpConsent.button.deny",message:"Deny"}))))},lx=(e,t)=>{switch(t.type){case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,consent_required:t.consent_required,redirect_uri:t.redirect_uri};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lD=e=>{window.location.href=e},lz=({state:e,submit:t,bootstrap:r,bootstrapNotLoaded:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l}=e;if(i||n)return rZ.createElement(i5,null);if(s)return rZ.createElement(sF,{text:s});if(l)return rZ.createElement(sj,{text:a._({id:"idpLogout.notLoggedOut",message:"You have not been logged out. You may close this page."})});let c=r.projectName;return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header",align:"center"},a._({id:"idpLogout.title",message:"Log out?"})),rZ.createElement(nZ,{variant:"body"},a._({id:"idpLogout.confirmMessage",message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:c}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},a._({id:"idpLogout.yes",message:"Yes"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},a._({id:"idpLogout.no",message:"No"}))))},lM=({initialError:e,initialParams:t})=>{let r=t2(aW).client,n=aY(),a=aZ(),{oauthAuthorizeStart:o,oauthAuthorizeSubmit:i}=r.idp,s=oI(),l=(({initialError:e,initialParams:t,oauthAuthorizeStart:r,oauthAuthorizeSubmit:n,onError:a,onEvent:o})=>{let[i,s]=tY(lT,{loading:!e,preflight:!!e,error:e,success:!1,denied:!1,consent_required:!1,client:null,grantable_scope:"",ungrantable_scope:"",redirect_uri:t.redirect_uri});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async({consent_required:e,consent_granted:r})=>{s({type:"START_SUBMIT"});let a=await n({...t,consent_granted:r});a.authorization_code&&s({type:"COMPLETE_SUBMIT"}),window.location.href=a.redirect_uri,e&&!r?(s({type:"CONSENT_DENIED"}),o({type:eu.OAuthAuthorizeFlowConsentDenied,data:{}})):o({type:eu.OAuthAuthorizeFlowComplete,data:{}})},[n,t,o]),c=t0(({consent_granted:e})=>l({consent_granted:e,consent_required:!0}),[l]),d=t0(async()=>{let e;s({type:"START_PREFLIGHT"}),o({type:eu.OAuthAuthorizeFlowStart,data:{client_id:t.client_id,redirect_uri:t.redirect_uri,scope:t.scopes.join(" ")}});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}if(e.consent_required){let t=e.scope_results.filter(e=>e.is_grantable).map(e=>e.scope).join(" "),r=e.scope_results.filter(e=>!e.is_grantable).map(e=>e.scope).join(" ");s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,client:e.client,grantable_scope:t,ungrantable_scope:r});return}await l({consent_required:!1,consent_granted:!1})},[o,t,r,a,l]);return tZ(()=>{i.preflight||d()},[d,i.preflight]),{state:i,submit:c}})({initialError:e,initialParams:t,oauthAuthorizeStart:o,oauthAuthorizeSubmit:i,onError:n,onEvent:a});return rZ.createElement(lO,{bootstrap:s,bootstrapNotLoaded:!1,...l})},lI=({initialError:e,initialParams:t,navigate:r})=>{let n=t2(aW).client,a=aY(),{oauthLogoutStart:o}=n.idp,i=oI(),s=(({initialError:e,initialParams:t,oauthLogoutStart:r,revokeSession:n,onError:a,navigate:o=lD})=>{let[i,s]=tY(lx,{loading:!e,preflight:!!e,error:e,denied:!1,consent_required:!1,redirect_uri:""});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async e=>{try{await n()}catch{}o(e)},[n,o]),c=t0(async()=>{let e;s({type:"START_PREFLIGHT"});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}e.consent_required?s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,redirect_uri:e.redirect_uri}):l(e.redirect_uri)},[t,r,a,l]);tZ(()=>{i.preflight||c()},[c,i.preflight]);let d=t0(async({consent_granted:e})=>{if(e)return l(i.redirect_uri);s({type:"CONSENT_DENIED"})},[l,i]);return{state:i,submit:d}})({initialError:e,initialParams:t,oauthLogoutStart:o,revokeSession:()=>n.session.revoke({forceClear:!0}),onError:a,navigate:r});return rZ.createElement(lz,{...s,bootstrap:i,bootstrapNotLoaded:!1})},lR=({searchParams:e=window.location.search,navigate:t}={})=>{let r,[{flow:n,error:a}]=tG((e=>{let t=new URLSearchParams(e);if(t.has("post_logout_redirect_uri")){let e=lb(t);return{error:e.error,flow:{type:"Logout",params:e.result}}}let r=lv(t);return{error:r.error,flow:{type:"Authorize",params:r.result}}})(e)),{theme:o,displayWatermark:i}=t2(nq);return"Authorize"===n.type?r=rZ.createElement(lL,null,rZ.createElement(lM,{initialError:a,initialParams:n.params})):"Logout"===n.type&&(r=rZ.createElement(lI,{initialError:a,initialParams:n.params,navigate:t})),rZ.createElement(sK,{theme:o,displayWatermark:i},r)},lL=({children:e})=>{let t,{i18n:r,_:n}=nO(),a=rG((t=t2(aW).client).onStateChange,()=>t.self.getSync()),o=aY(),i=tQ(o);tZ(()=>{i.current=o},[o]);let s=t2(aW).client,l=t2(nM),[c,d]=tG(!1),[u,h]=tG(!1);return(tZ(()=>{c||u||(async e=>{if(e?.trustedAuthToken&&e?.tokenProfileID){d(!0);let t=e.trustedAuthToken,r=e.tokenProfileID,n=s.self.getSync();n&&await s.session.revoke();try{await s.session.attest({token:t,profile_id:r,organization_id:n?.organization_id,session_duration_minutes:60})}catch(e){i.current(e)}finally{d(!1),h(!0)}}h(!0)})(l)},[l,c,u,s]),tZ(()=>{a||i.current(new w)},[a]),c)?rZ.createElement(i5,null):a?e:rZ.createElement(sF,{text:r._({id:"idpConsent.noActiveSession",message:"No active session detected. Please log in to continue."})})};class lB extends Event{stytchEventType;stytchEventData;constructor(e){super("stytch-event",{composed:!0}),this.stytchEventType=e.type,this.stytchEventData=e.data}}class lN extends Event{error;constructor(e){super("stytch-error",{composed:!0}),this.error=e}}function lU(e,{propNames:r,attributeNames:n=[]}){if("u"<typeof window)return class{render(){}flushRender(){}};let a=Object.fromEntries(n.map(e=>[e.toLowerCase(),e]));return class o extends HTMLElement{#e;static observedAttributes=Object.keys(a);#t;#r=!1;#n={};constructor({shadow:e}={}){for(const t of(super(),this.#t=e??null!=this.getAttribute("shadow"),o.observedAttributes)){const e=this.getAttribute(t);if(null!=e){const r=a[t];this.#n[r]=e}}for(const e of r)Object.hasOwn(this,e)&&(this.#n[e]=this[e]),Object.defineProperty(this,e,{get:()=>this.#n[e],set:t=>{n.includes(e)&&this.setAttribute(e,t),this.#n[e]=t,this.#a()}})}connectedCallback(){if(!this.#e)if(this.#e=document.createElement("div"),this.#t){this.setAttribute("shadow","true");let e=this.attachShadow({mode:"open"});e.appendChild(nG()),e.appendChild(this.#e)}else t||(t=nG(),document.head.appendChild(t)),this.appendChild(this.#e);this.#a()}disconnectedCallback(){this.#e&&rq(this.#e)}attributeChangedCallback(e,t,r){let n=a[e];this.#n[n]=r}render(e){Object.assign(this,e)}flushRender(){rj(()=>{this.#o()})}#a(){this.#r||(this.#r=!0,window.queueMicrotask(()=>{this.#o()}))}#i(e){var t;let r=(t=e,t?.config);if(r?.oauthOptions?.providers.some(e=>"object"==typeof e&&"google"===e.type&&e.one_tap)&&!this.querySelector("#google-parent-prompt")){let e=document.createElement("div");e.id="google-parent-prompt",e.slot="one-tap",this.appendChild(e)}}#s={onError:e=>{this.#n.callbacks?.onError?.(e),this.dispatchEvent(new lN(e))},onEvent:e=>{this.#n.callbacks?.onEvent?.(e),this.dispatchEvent(new lB(e))}};#o(){if(!this.#e||(this.#r=!1,0===Object.keys(this.#n).length))return;this.#i(this.#n);let t=this.#n;this.#t&&(t=function(e){let{presentation:t}=e;return lq(e)?e:{...e,presentation:{...t,options:{...t?.options,enableShadowDOM:!0}}}}(t)),rC(rZ.createElement(e,{...t,callbacks:this.#s}),this.#e)}}}function lF(e,t){return"u"<typeof window?()=>null:({elementId:r,...n})=>{let a;customElements.get(e)||customElements.define(e,t);let o=document.querySelector(r);if(!o)throw Error(`The selector you specified (${r}) applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin().`);return o.firstChild?.nodeName.toLowerCase()===e.toLowerCase()?(a=o.firstChild).render(n):(a=new t({shadow:lq(n)}),o.appendChild(a)),a}}function lq(e){let{config:t,presentation:r}=e;return r?.options?.enableShadowDOM??t?.enableShadowDOM}let lH=lU(({client:e,presentation:t,callbacks:r,strings:n,getIDPConsentManifest:a,trustedAuthTokenParams:o,styles:i})=>{let s=nF(t,!1,{products:[]});return tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_idp_screen",details:{bootstrap:t}})})},[e]),i&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide"),rZ.createElement(aG,{client:e,config:{},callbacks:r,initialState:aV},rZ.createElement(nI,{consentManifestGenerator:a,authTokenParams:o},rZ.createElement(nq.Provider,{value:s},rZ.createElement(nD,{messages:rQ,overrides:n},rZ.createElement(lR,null)))))},{propNames:["client","presentation","callbacks","strings","getIDPConsentManifest","trustedAuthTokenParams"]}),lK=lF("stytch-identity-provider",lH),lj=lU(({config:e,styles:t,...r})=>{t&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide");let n={...e,organizationProducts:Object.values(sB)};return rZ.createElement(ll,{config:n,...r})},{propNames:["client","config","presentation","callbacks","strings"]}),l$=lF("stytch-ui",lj),lV=Symbol("__stytch_SSRStubKey"),lW=e=>new Proxy(()=>{},{get:(t,r)=>r===lV||lW(e+"."+String(r)),apply(){throw Error(`[Stytch] Invalid server-side function call to ${e}.
|
|
47
47
|
The Stytch JavaScript SDK is intended to only be used on the client side.
|
|
48
48
|
Make sure to wrap your API calls in a hook to ensure they are executed on the client.
|
|
49
49
|
|
|
@@ -60,5 +60,5 @@ const myComponent = () => {
|
|
|
60
60
|
\`\`\`
|
|
61
61
|
|
|
62
62
|
If you want to make API calls from server environments, please use the Stytch Node Library
|
|
63
|
-
https://www.npmjs.com/package/stytch.`)}}),lW="bootstrap",lG=()=>({displayWatermark:!1,projectName:null,cnameDomain:null,emailDomains:["stytch.com"],captchaSettings:{enabled:!1},pkceRequiredForEmailMagicLinks:!1,pkceRequiredForPasswordResets:!1,pkceRequiredForOAuth:!1,pkceRequiredForSso:!1,slugPattern:null,createOrganizationEnabled:!1,passwordConfig:null,runDFPProtectedAuth:!1,rbacPolicy:null,siweRequiredForCryptoWallets:!1,vertical:null});class lY{_publicToken;_networkClient;_dataLayer;_bootstrapDataPromise;constructor(e,t,r){this._publicToken=e,this._networkClient=t,this._dataLayer=r,this._bootstrapDataPromise=this._networkClient.fetchSDK({url:`/projects/bootstrap/${this._publicToken}`,method:"GET"}).then(lY.mapBootstrapData).then(e=>(this._dataLayer.setItem(lW,JSON.stringify(e)),e)).catch(e=>(eP(e),lG()))}static mapBootstrapData(e){let t=null!==e.password_config?{ludsComplexity:e.password_config.luds_complexity,ludsMinimumCount:e.password_config.luds_minimum_count}:null;return{projectName:e.project_name,displayWatermark:!e.disable_sdk_watermark,captchaSettings:e.captcha_settings,cnameDomain:e.cname_domain,emailDomains:e.email_domains,pkceRequiredForEmailMagicLinks:e.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:e.pkce_required_for_password_resets,pkceRequiredForOAuth:e.pkce_required_for_oauth,pkceRequiredForSso:e.pkce_required_for_sso,slugPattern:e.slug_pattern,createOrganizationEnabled:e.create_organization_enabled,passwordConfig:t,runDFPProtectedAuth:e.dfp_protected_auth_enabled??!1,dfpProtectedAuthMode:e.dfp_protected_auth_mode,rbacPolicy:e.rbac_policy??null,siweRequiredForCryptoWallets:e.siwe_required_for_crypto_wallets,vertical:e.vertical}}getSync(){let e=this._dataLayer.getItem(lW);if(null===e)return lG();try{return JSON.parse(e)}catch{return lG()}}getAsync(){return this._bootstrapDataPromise}}class lZ{bootstrapPromise;state;constructor(e){this.bootstrapPromise=e,this.state=e.then(async e=>{let t;return e.captchaSettings.enabled?{configured:!0,captchaClient:await (t=e.captchaSettings.siteKey,eD(`https://www.google.com/recaptcha/enterprise.js?render=${t}`,()=>window.grecaptcha.enterprise)),siteKey:e.captchaSettings.siteKey}:{configured:!1}})}executeRecaptcha=async()=>{let{captchaClient:e,configured:t,siteKey:r}=await this.state;if(t)return await new Promise(t=>e.ready(t)),e.execute(r,{action:"LOGIN"})}}class lJ{iframeURL;_frameClient;constructor(e){this.iframeURL=e}get frameClient(){return this._frameClient=this._frameClient??new e0(this.iframeURL),this._frameClient}call(e,t){return this.frameClient.call(e,[t])}oneTapStart=e=>this.call("oneTapStart",e);oneTapSubmit=e=>this.call("oneTapSubmit",e);parsedPhoneNumber=e=>this.call("parsedPhoneNumber",e);getExamplePhoneNumber=e=>this.call("getExamplePhoneNumber",e)}class lQ{_publicToken;_subscriptionDataLayer;additionalTelemetryDataFn;eventLogger;baseURL;constructor(e,t,r,n,a){this._publicToken=e,this._subscriptionDataLayer=t,this.additionalTelemetryDataFn=a,this.baseURL=r,(e=>e.includes("public-token-test"))(e)&&(this.baseURL=n),this.eventLogger=new eR({maxBatchSize:15,intervalDurationMs:800,logEventURL:this.buildSDKUrl("/events")})}updateSessionToken=()=>null;logEvent({name:e,details:t,error:r={}}){this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:e,details:t,error_code:r.error_code,error_description:r.error_description,http_status_code:r.http_status_code})}createTelemetryBlob(){return{event_id:`event-id-${ek()}`,app_session_id:`app-session-id-${ek()}`,persistent_id:`persistent-id-${ek()}`,client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.additionalTelemetryDataFn(),app:{identifier:window.location.hostname},sdk:{identifier:"Stytch.js Javascript SDK",version:"@stytch/vanilla-js@6.0.9"}}}async fetchSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return eg({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async submitFormSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return ef({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async retriableFetchSDK({url:e,body:t,method:r,retryCallback:n}){let a=this._subscriptionDataLayer.readSessionCookie().session_token,o="Basic "+window.btoa(this._publicToken+":"+(a||this._publicToken)),i=window.btoa(JSON.stringify(this.createTelemetryBlob())),s=window.location.origin;return e_({basicAuthHeader:o,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:i,xSDKParentHostHeader:s,retryCallback:n})}buildSDKUrl(e){return`${this.baseURL}/sdk/v1${e}`}}function lX(e){let t=e.toString(16);return 1===t.length&&(t="0"+t),t}class l1{_dataLayer;namespace;constructor(e,t){this._dataLayer=e,this.namespace=t}key(){return`PKCE_VERIFIER:${this.namespace}`}async startPKCETransaction(){let e=await l1.createProofkeyPair();return this._dataLayer.setItem(this.key(),JSON.stringify(e)),e}getPKPair(){let e=this._dataLayer.getItem(this.key());if(null!==e)try{return JSON.parse(e)}catch{eC("Found malformed Proof Key pair in localstorage.");return}}clearPKPair(){return this._dataLayer.removeItem(this.key())}static async createProofkeyPair(){var e;let t=new Uint32Array(16);window.crypto.getRandomValues(t);let r=Array.from(t).map(lX).join("");return{code_challenge:(e=await window.crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)),btoa(String.fromCharCode.call(null,...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")),code_verifier:r}}}function l0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var l2=function e(t,r){function n(e,n,a){if("u">typeof document){"number"==typeof(a=l0({},r,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in a)a[i]&&(o+="; "+i,!0!==a[i]&&(o+="="+a[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+o}}return Object.create({set:n,get:function(e){if("u">typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},a=0;a<r.length;a++){var o=r[a].split("="),i=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=t.read(i,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",l0({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,l0({},this.attributes,t))},withConverter:function(t){return e(l0({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});let l3="seen_domains";class l4{publicToken;state;_opaqueTokenCookieName=null;_jwtCookieName=null;_cookiePath=null;_domain=null;_cookieAvailableToSubdomains=!1;_istCookieName=null;subscriptions;_localStorage;browserSessionStorage;constructor(e,t){let r;this.publicToken=e,this.state=null,this.subscriptions={},this._localStorage=oj(oH,e),this.browserSessionStorage=oj(oK,e),t?.cookieOptions&&(this._opaqueTokenCookieName=t.cookieOptions.opaqueTokenCookieName||null,this._jwtCookieName=t.cookieOptions.jwtCookieName||null,this._cookiePath=t.cookieOptions.path||null,this._domain=t.cookieOptions.domain||null,this._cookieAvailableToSubdomains=t.cookieOptions.availableToSubdomains||!1,this._istCookieName=t.cookieOptions.istCookieName||null);const n=this._localStorage.getItem("");if(!n)return;try{r=JSON.parse(n)}catch{this.syncToLocalStorage();return}this.state=r}get opaqueTokenCookieName(){return this._opaqueTokenCookieName??"stytch_session"}get jwtCookieName(){return this._jwtCookieName??"stytch_session_jwt"}get istCookieName(){return this._istCookieName??"stytch_intermediate_session_token"}readSessionCookie(){return{session_token:l2.get(this.opaqueTokenCookieName),session_jwt:l2.get(this.jwtCookieName)}}readIntermediateSessionTokenCookie(){return l2.get(this.istCookieName)}writeSessionCookie(e){let{state:t,session_token:r,session_jwt:n}=e,a=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});a.domain&&this.addSeenDomain(a.domain),l2.set(this.opaqueTokenCookieName,r,a),l2.set(this.jwtCookieName,n,a);let o=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});o.domain&&this.addSeenDomain(o.domain),n8(this.jwtCookieName)&&l2.remove(this.jwtCookieName,o),n8(this.opaqueTokenCookieName)&&l2.remove(this.opaqueTokenCookieName,o),n8(this.jwtCookieName)&&eC("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."),n8(this.opaqueTokenCookieName)&&eC("Could not remove extraneous opaque token cookie.")}writeIntermediateSessionTokenCookie(e){let t=new Date(Date.now()+6e5),r=l4.generateCookieOpts({expiresAt:t.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});l2.set(this.istCookieName,e,r)}removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName])}removeISTCookie(){this.removeCookies([this.istCookieName])}removeCookies(e){let t=this.getSeenDomains(),r=[...new Set([this._domain,null,...t])];[!0,!1].forEach(t=>{[this._cookiePath,null].forEach(n=>{r.forEach(r=>{let a=l4.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:t,path:n,domain:r});e.forEach(e=>{l2.remove(e,a)})})})})}syncToLocalStorage(){this._localStorage.setItem("",JSON.stringify(this.state))}getItem(e){return this._localStorage.getItem(e)}setItem(e,t){this._localStorage.setItem(e,t)}removeItem(e){this._localStorage.removeItem(e)}getSeenDomains(){let e=this.getItem(l3);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}addSeenDomain(e){if(!e)return;let t=this.getSeenDomains();t.includes(e)||(t.push(e),this.setItem(l3,JSON.stringify(t)))}static generateCookieOpts({path:e,domain:t,availableToSubdomains:r,expiresAt:n}){let a={expires:new Date(n),sameSite:"lax"};return e&&(a.path=e),"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)?a.secure=!1:(r&&(a.domain=t||window.location.host),a.secure=!0),a}}class l5 extends l4{}let l8=Symbol.for("__stytch_b2b_DataLayer"),l6=(e,t)=>{Object.values(e).forEach(e=>e(t))},l7=(({KEYS_TO_EXCLUDE:e=[]}={})=>{let t=(r,n)=>typeof r==typeof n&&(null===r||null===n?r===n:"object"==typeof r?!(Object.keys(r).length!==Object.keys(n).length||Object.keys(r).some(e=>!(e in n)))&&Object.entries(r).filter(([t])=>!e.includes(t)).every(([e,r])=>t(r,n[e])):r===n);return t})({KEYS_TO_EXCLUDE:["last_accessed_at"]});class l9{_publicToken;_datalayer;fromCache=!0;constructor(e,t,{usingCustomApiEndpoint:r}){if(this._publicToken=e,this._datalayer=t,window.addEventListener("storage",this._listen),!r){const{session_token:e}=this._datalayer.readSessionCookie();if(!e)return void this.destroySession()}}_listen=e=>{if(e.key!==oF(this._publicToken,""))return;let t=null===e.newValue||"null"===e.newValue?null:JSON.parse(e.newValue);this.updateState(t,!0)};getTokens(){let{session_token:e,session_jwt:t}=this._datalayer.readSessionCookie();return"string"!=typeof e||"string"!=typeof t?null:{session_token:e,session_jwt:t}}getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null}destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null})}destroySession(){this._datalayer.removeSessionCookie(),this.updateState(null)}_updateStateAndTokensInternal(e,t){let r=this._datalayer.state,n=null===e.state?null:{...this._datalayer.state,...e.state};this._datalayer.state=n;let a=this.getFromCache();if(this.setCacheRefreshed(),a||!l7(r,n)){let e;e=null==n||t.fromCache?n:{...n,sessionDurationMinutes:t.sessionDurationMinutes},l6(this._datalayer.subscriptions,e)}}updateStateAndTokens(e,t={fromCache:!1}){e.state?("string"==typeof e.session_token?this._datalayer.writeSessionCookie(e):this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()):e.intermediate_session_token?("string"==typeof e.intermediate_session_token?this._datalayer.writeIntermediateSessionTokenCookie(e.intermediate_session_token):this._datalayer.removeISTCookie(),this._datalayer.removeSessionCookie()):(this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()),this._updateStateAndTokensInternal(e,t),this._datalayer.syncToLocalStorage()}updateState(e,t=!1){let r=this._datalayer.state,n=null===e?null:{...this._datalayer.state,...e};this._datalayer.state=n;let a=this.getFromCache();this.setCacheRefreshed();let o=!l7(r,n);(a||o)&&(l6(this._datalayer.subscriptions,n),o&&!t&&this._datalayer.syncToLocalStorage())}updateTokens(e){let{session_token:t,session_jwt:r}=e,n={...this._datalayer.readSessionCookie(),session_token:t,session_jwt:r};"string"==typeof t||"string"==typeof r?(this._datalayer.writeSessionCookie(n),this._datalayer.removeISTCookie()):this._datalayer.removeSessionCookie()}subscribeToState(e){var t;let r;return t=this._datalayer.subscriptions,t[r=Math.random().toString(36).slice(-10)]=e,()=>delete t[r]}getState(){return this._datalayer.state}destroy(){window.removeEventListener("storage",this._listen)}syncFromDeviceStorage(){return null}getFromCache(){return this.fromCache}setCacheRefreshed(){this.fromCache=!1}}class ce extends l9{updateMember=e=>this.updateState({member:e});getMember=()=>this.getState()?.member??null;updateOrganization=e=>this.updateState({organization:e});getOrganization=()=>this.getState()?.organization??null;getSession=()=>this.getState()?.session??null;updateSession=(e,t)=>{if("member_session"in e&&e.member_session){let r=e.session_token&&e.session_jwt?{session_token:e.session_token,session_jwt:e.session_jwt}:{session_token:!0,session_jwt:!0};this.updateStateAndTokens({state:{session:e.member_session,member:e.member,organization:e.organization},...r,intermediate_session_token:null},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})}else this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:e.intermediate_session_token||!0},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})};withUpdateSession=e=>async t=>{let r=await e(t);return this.updateSession(r,{sessionDurationMinutes:t?.session_duration_minutes}),r}}class ct extends eH{_oneTap;constructor(e,t,r,n,a,o=eM(),i){super(e,t,r,n,a,o),this._oneTap=i}startOneTapDiscovery=async e=>{let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnDiscoverySuccessHandler({discoveryRedirectUrl:e.discovery_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};startOneTap=async e=>{if(!e.organization_id)throw new h("stytch.oauth.googleOneTap.start","organization_id is a required argument");let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnSuccessHandler({organizationId:e.organization_id,signupRedirectUrl:e.signup_redirect_url,loginRedirectUrl:e.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};googleOneTap={discovery:{start:this.startOneTapDiscovery},start:this.startOneTap}}let cr="u">typeof window&&"IdentityCredential"in window,cn=e=>e===er.forceLegacyEmbedded?"force":e===er.embeddedOnly||e===er.embedded||e===er.floatingOrEmbedded;class ca{_googleClient;_clientId;constructor(e,t){this._googleClient=e,this._clientId=t}cancel(){this._googleClient.cancel()}async render({callback:e,onOneTapCancelled:t,style:r,cancelOnTapOutside:n=!0}){let a,o=cn(r.position),i="force"===(a=cn(r.position))||a&&!cr,s={client_id:this._clientId,callback:e,auto_select:!1,context:"use",itp_support:!0,use_fedcm_for_prompt:"force"!==o,cancel_on_tap_outside:n};return i&&(s.prompt_parent_id="google-parent-prompt",s.cancel_on_tap_outside=!1),this._googleClient.initialize(s),new Promise(e=>{this._googleClient.prompt(r=>{if(r.isSkippedMoment()){let n=r.getSkippedReason?.()??"unknown_reason";return"user_cancel"===n&&t?.(),e({success:!1,reason:n})}return!r.isNotDisplayed&&i||r.isNotDisplayed?.()?e({success:!1,reason:r.getNotDisplayedReason?.()??"unknown_reason"}):r.isDismissedMoment()?void 0:(this.styleFrame(i),e({success:!0}))})})}styleFrame(e){e&&Array.from(document.getElementsByTagName("iframe")).forEach(e=>{e.src.includes(a)&&(e.style.width="100%")})}}let co=Promise.resolve({pkceRequiredForOAuth:!1});class ci{_networkClient;_pkceManager;_config;googleClientID;constructor(e,t,r=co){this._networkClient=e,this._pkceManager=t,this._config=r}async fetchGoogleStart(){if(this.googleClientID)return this.googleClientID;let e=await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/start",method:"GET"});return this.googleClientID=e.google_client_id,this.googleClientID}async submitGoogleOneTapTokenDiscovery({credential:e,discoveryRedirectUrl:t}){let r,{pkceRequiredForOAuth:n}=await this._config;return n?r=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/discovery/submit",method:"POST",body:{id_token:e,discovery_redirect_url:t,pkce_code_challenge:r}})}async submitGoogleOneTapToken({credential:e,organizationId:t,signupRedirectUrl:r,loginRedirectUrl:n}){let a,{pkceRequiredForOAuth:o}=await this._config;return o?a=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/submit",method:"POST",body:{id_token:e,organization_id:t,signup_redirect_url:r,login_redirect_url:n,pkce_code_challenge:a}})}async createOneTapClient(){let e;try{e=await this.fetchGoogleStart()}catch(e){return{success:!1,reason:v.from(e).error_type}}return""===e?{success:!1,reason:"oauth_config_not_found"}:{success:!0,client:new ca(await eD(o,()=>window.google.accounts.id),e)}}createOnDiscoverySuccessHandler=({discoveryRedirectUrl:e,onSuccess:t,onError:r})=>async n=>{let{credential:a}=n,o=this.submitGoogleOneTapTokenDiscovery({credential:a,discoveryRedirectUrl:e}).then(e=>t(e.redirect_url));r&&(o=o.catch(e=>r(e))),await o};createOnSuccessHandler=({organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r,onSuccess:n,onError:a})=>async o=>{let{credential:i}=o,s=this.submitGoogleOneTapToken({credential:i,organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r}).then(e=>n(e.redirect_url));a&&(s=s.catch(e=>a(e))),await s};redirectOnSuccess=e=>{window.location.href=e}}class cs{_subscriptionService;_sessionManager;_networkClient;_dataLayer;_stateChangeClient;magicLinks;session;member;self;organization;oauth;sso;discovery;passwords;otps;totp;recoveryCodes;rbac;scim;impersonation;idp;onStateChange;parseAuthenticateUrl;authenticateByUrl;constructor(e,t){if("u"<typeof window)throw Error("`new StytchB2BClient()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `createStytchB2BClient()` instead.");(e=>{"string"!=typeof e?eC(`Public token is malformed. Expected a string, got ${typeof e}.${eO}`):""===e?eC(`Public token is malformed. Expected "public-token-...", got an empty string.${eO}`):e.startsWith("public-token-")||eC(`Public token is malformed. Expected "public-token-...", got ${e}.${eO}`)})(e);const r=e??"",n=((e,t={})=>{let{cookieOptions:r,keepSessionAlive:n}=t;return eL(e,t,{keepSessionAlive:"optionalBoolean"}),r&&eL(`${e}.cookieOptions`,r,{opaqueTokenCookieName:"optionalString",jwtCookieName:"optionalString",istCookieName:"optionalString",path:"optionalString",domain:"optionalString"}),{cookieOptions:r,keepSessionAlive:n,endpoints:{testAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.testApiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"testApiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.testAPIURL??"https://test.stytch.com"})(t),liveAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.apiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"apiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.liveAPIURL??"https://api.stytch.com"})(t),dfpBackendURL:(e=>{let t=e?.dfppaUrl??e?.endpointOptions?.dfppaDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfppaUrl?"dfppaUrl":"dfppaDomain";eC(`Unable to use custom DFPPA domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.dfpBackendURL??"https://telemetry.stytch.com"})(t),dfpCdnURL:(e=>{let t=e?.dfpCdnUrl??e?.endpointOptions?.dfpCdnDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfpCdnUrl?"dfpCdnUrl":"dfpCdnDomain";eC(`Unable to use custom DFP CDN domain \`${t}\`. ${r} should be a valid domain.`)}}return"https://elements.stytch.com"})(t),clientsideServicesIframeURL:t?.endpoints?.clientsideServicesIframeURL??"https://js.stytch.com/clientside-services/index.html"}}})(this.constructor.name,t),a=((e,t={})=>{let{customBaseUrl:r,endpointOptions:n}=t;return e.includes("public-token-test")?!!(r||n?.testApiDomain):!!(r||n?.apiDomain)})(r,t);this._dataLayer=((e,t)=>{let r,n=((r=window)[l8]||(r[l8]={}),r[l8]);return n[e]||(n[e]=new l5(e,t)),n[e]})(r,n),this._subscriptionService=new ce(r,this._dataLayer,{usingCustomApiEndpoint:a}),this._stateChangeClient=new e5(this._subscriptionService,{}),this.onStateChange=(...e)=>this._stateChangeClient.onStateChange(...e);const o=()=>({stytch_member_id:this._dataLayer.state?.member?.member_id,stytch_member_session_id:this._dataLayer.state?.session?.member_session_id}),i=new l1(this._dataLayer,"passwords"),s=new lQ(r,this._dataLayer,n.endpoints.liveAPIURL,n.endpoints.testAPIURL,o);this._networkClient=s;const l=new lY(r,s,this._dataLayer),c=new lZ(l.getAsync()),d=new ez(r,n.endpoints.dfpBackendURL,n.endpoints.dfpCdnURL,l.getAsync(),c.executeRecaptcha),u=new lJ(n.endpoints.clientsideServicesIframeURL),h=new l1(this._dataLayer,"oauth"),m=new ci(s,h,l.getAsync());this.organization=new eK(s,s,this._subscriptionService),this.member=new eJ(s,s,this._subscriptionService),this.self=new eJ(s,s,this._subscriptionService),this.session=new eQ(s,this._subscriptionService),this.magicLinks=new eq(s,this._subscriptionService,new l1(this._dataLayer,"magic_links"),i,l.getAsync(),d),this.oauth=new ct(s,this._subscriptionService,h,l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d,m),this.sso=new eX(s,this._subscriptionService,new l1(this._dataLayer,"sso"),l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d),this.discovery=new eB(s,this._subscriptionService),this.passwords=new eV(s,this._subscriptionService,i,l.getAsync(),d),this.otps=new ej(s,this._subscriptionService,d),this.totp=new e1(s,this._subscriptionService,d),this.recoveryCodes=new eY(s,this._subscriptionService,d),this.rbac=new eG(l.getSync(),l.getAsync(),this._subscriptionService),this.scim=new eZ(this._networkClient,this._subscriptionService),this.impersonation=new eU(this._networkClient,this._subscriptionService,d),this.idp=new eN(s),this._sessionManager=new e4(this._subscriptionService,this.session,r,{keepSessionAlive:n.keepSessionAlive});const p=new e2(s,d);(a||this._dataLayer.readSessionCookie().session_token)&&this._sessionManager.performBackgroundRefresh();const{authenticateByUrl:_,parseAuthenticateUrl:g}=(e=>{let t=Object.keys(e),r=(e=window.location.href)=>{let r=new URL(e),n=r.searchParams.get("stytch_token_type"),a=r.searchParams.get("token");return a&&n?t.includes(n)?{handled:!0,token:a,tokenType:n}:{handled:!1,token:a,tokenType:n}:null};return{authenticateByUrl:async({clearParams:t,...n},a=window.location.href)=>{let o=t??a===window.location.href,i=r(a);if(null==i)return null;if(!i.handled)return i;let{token:s,tokenType:l}=i,c=e[l];return o&&sy(),{handled:!0,tokenType:l,data:await c(s,n)}},parseAuthenticateUrl:r}})({discovery:e=>this.magicLinks.discovery.authenticate({discovery_magic_links_token:e}),discovery_oauth:e=>this.oauth.discovery.authenticate({discovery_oauth_token:e}),oauth:(e,t)=>this.oauth.authenticate({oauth_token:e,...t}),sso:(e,t)=>this.sso.authenticate({sso_token:e,...t}),multi_tenant_magic_links:(e,t)=>this.magicLinks.authenticate({magic_links_token:e,...t}),multi_tenant_impersonation:e=>this.impersonation.authenticate({impersonation_token:e})});this.authenticateByUrl=_,this.parseAuthenticateUrl=g,s.logEvent({name:"b2b_sdk_instance_instantiated",details:{event_callback_registered:!1,error_callback_registered:!1,success_callback_registered:!1}}),l.getAsync().then(e=>{"CONSUMER"===e.vertical&&eP("This application is using a Stytch client for B2B projects, but the public token is for a Stytch Consumer project. Use a Consumer Stytch client instead, or verify that the public token is correct.")}),((e,t)=>{Object.assign(e,{[rX]:t})})(this,{bootstrap:l,clientsideServices:u,publicToken:r,searchManager:p,dataLayer:this._dataLayer,networkClient:s,oneTap:m})}}let cl=(...e)=>"u"<typeof window?lV("stytch"):new cs(...e),cc={"color-scheme":"shadcn","font-family":`var(--font-sans, ${nL["font-family"]})`,"font-family-mono":`var(--font-mono, ${nL["font-family-mono"]})`,"text-base":"var(--text-base)","transition-duration":nL["transition-duration"],spacing:"var(--spacing)","mobile-breakpoint":"var(--breakpoint-sm)","rounded-base":"calc(var(--radius) / 2.5)","container-width":nL["container-width"],"container-radius":"var(--radius-xl)",shadow:"var(--shadow)",background:"var(--background)",foreground:"var(--foreground)",primary:"var(--primary)","primary-foreground":"var(--primary-foreground)",secondary:"var(--secondary)","secondary-foreground":"var(--secondary-foreground)",muted:"var(--muted)","muted-foreground":"var(--muted-foreground)",accent:"var(--accent)","accent-foreground":"var(--accent-foreground)",border:"var(--border)",input:"var(--input)",ring:"var(--ring)",destructive:"var(--destructive)","destructive-foreground":nL["destructive-foreground"],success:nB.success,warning:nB.warning};return e.AuthFlowType=s,e.B2BMFAProducts=d,e.B2BOAuthProviders=c,e.B2BProducts=sL,e.BiometricRegistrationIdIsNullOrBlank=X,e.BiometricsAlreadyEnrolledError=class extends b{constructor(){super("BiometricsAlreadyEnrolledError","There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.")}},e.BiometricsFailedError=F,e.BiometricsUnavailableError=E,e.ChallengeSigningFailedError=R,e.DFPNotConfigured=ee,e.DeviceCredentialsNotAllowedError=x,e.FailedCodeChallengeError=B,e.FailedToDecryptDataError=U,e.IDPOAuthFlowMissingParamError=et,e.InternalError=k,e.InvalidAuthorizationCredentialError=z,e.InvalidCredentialTypeError=j,e.InvalidPrivateKeyLength=Q,e.InvalidRedirectSchemeError=H,e.InvalidStartUrlError=q,e.JSONDataNotConvertibleToStringError=V,e.KeyInvalidatedError=C,e.KeystoreUnavailableError=P,e.MissingAttestationObjectError=$,e.MissingAuthorizationCredentialIDTokenError=D,e.MissingCipherIv=J,e.MissingGoogleClientIDError=class extends b{constructor(){super("MissingGoogleClientIDError","No Google client ID was found in the project.")}},e.MissingPKCEError=class extends b{constructor(){super("MissingPKCEError","Make sure this flow is completed on the same device on which it was started.")}},e.MissingPublicKeyError=I,e.MissingUrlError=K,e.NoBiometricsEnrolledError=T,e.NoBiometricsRegistrationError=S,e.NoCredentialsPresentError=M,e.NoCurrentSessionError=w,e.OAuthProviders={Google:"google",Microsoft:"microsoft",Apple:"apple",Github:"github",GitLab:"gitlab",Facebook:"facebook",Discord:"discord",Salesforce:"salesforce",Slack:"slack",Amazon:"amazon",Bitbucket:"bitbucket",LinkedIn:"linkedin",Coinbase:"coinbase",Twitch:"twitch",Twitter:"twitter",TikTok:"tiktok",Snapchat:"snapchat",Figma:"figma",Yahoo:"yahoo"},e.OTPMethods={SMS:"sms",WhatsApp:"whatsapp",Email:"email"},e.OneTapPositions=er,e.PasskeysInvalidEncoding=G,e.PasskeysMisconfigured=Y,e.PasskeysUnsupportedError=N,e.RNUIProducts=eh,e.RandomNumberGenerationFailed=W,e.RedirectURLType=l,e.SDKAPIUnreachableError=u,e.SDKNotConfiguredError=L,e.SignInWithAppleMisconfigured=Z,e.StytchAPIError=v,e.StytchAPISchemaError=y,e.StytchAPIUnreachableError=f,e.StytchB2B=lK,e.StytchB2BClient=cs,e.StytchB2BHeadlessClient=cs,e.StytchB2BIdentityProvider=lq,e.StytchB2BUIClient=class extends cs{constructor(e,t){super(e,t),eC("StytchB2BUIClient is deprecated. Use the Stytch web components directly instead.")}mount=lj;mountIdentityProvider=lH},e.StytchError=g,e.StytchEventType=eu,e.StytchSDKAPIError=p,e.StytchSDKError=b,e.StytchSDKSchemaError=m,e.StytchSDKUsageError=h,e.UNRECOVERABLE_ERROR_TYPES=_,e.UserCancellationError=O,e.UserLockedOutError=A,e.Wallets={Phantom:"Phantom",Metamask:"Metamask",Coinbase:"Coinbase",Binance:"Binance",GenericEthereumWallet:"GenericEthereumWallet",GenericSolanaWallet:"GenericSolanaWallet"},e.createStytchB2BClient=cl,e.createStytchB2BHeadlessClient=cl,e.defaultDarkTheme=nN,e.defaultTheme=nB,e.errorToStytchError=function(e){if(e instanceof b)return e;switch(e.message){case"no_current_session":return new w;case"no_biometrics_registration":return new S;case"biometrics_unavailable":case"device_hardware_error":case"biometrics_not_available":return new E;case"key_invalidated":case"no_biometric_key":return new C;case"no_biometrics_enrolled":return new T;case"keystore_unavailable":return new P;case"device_credentials_not_allowed":return new x;case"user_cancellation":return new O;case"user_locked_out":return new A;case"google_onetap_missing_id_token":case"oauth_apple_missing_id_token":case"missing_authorization_credential_id_token":return new D;case"google_onetap_missing_member":case"oauth_apple_credential_invalid":case"invalid_authorization_credential":return new z;case"missing_public_key":return new I;case"challenge_signing_failed":return new R;case"no_credentials_present":return new M;case"sdk_not_configured":return new L;case"failed_code_challenge":return new B;case"passkeys_unsupported":return new N;case"failed_to_decrypt_data":return new U;case"biometrics_failed":return new F;case"invalid_start_url":return new q;case"invalid_redirect_scheme":return new H;case"missing_url":return new K;case"invalid_credential_type":return new j;case"missing_attestation_object":return new $;case"json_data_not_convertible_to_string":return new V;case"random_number_generation_failed":return new W;case"passkeys_invalid_encoding":return new G;case"passkeys_misconfigured":return new Y;case"signinwithapple_misconfigured":return new Z;case"missing_cipher_iv":return new J;case"invalid_private_key_length":return new Q;case"biometric_registration_id_is_null_or_blank":return new X;case"dfp_not_configured":return new ee;default:return new k(e)}},e.iconsBlack={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49q-.35-.03-1.04-.03c-1.48 0-2.05.55-2.05 2V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#000",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#000",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#000",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#000",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#000",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#000",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#000",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#000",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#000",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.iconsWhite={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49Q13.83 7 13.14 7c-1.48 0-2.05.56-2.05 2.02V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#fff",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#fff",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#fff",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#fff",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#fff",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#fff",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#fff",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#fff",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#fff",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.mount=lj,e.mountIdentityProvider=lH,e.parseOAuthAuthorizeParams=ly,e.parseOAuthLogoutParams=lv,e.shadcnTheme=cc,e}({});
|
|
63
|
+
https://www.npmjs.com/package/stytch.`)}}),lG="bootstrap",lY=()=>({displayWatermark:!1,projectName:null,cnameDomain:null,emailDomains:["stytch.com"],captchaSettings:{enabled:!1},pkceRequiredForEmailMagicLinks:!1,pkceRequiredForPasswordResets:!1,pkceRequiredForOAuth:!1,pkceRequiredForSso:!1,slugPattern:null,createOrganizationEnabled:!1,passwordConfig:null,runDFPProtectedAuth:!1,rbacPolicy:null,siweRequiredForCryptoWallets:!1,vertical:null});class lZ{_publicToken;_networkClient;_dataLayer;_bootstrapDataPromise;constructor(e,t,r){this._publicToken=e,this._networkClient=t,this._dataLayer=r,this._bootstrapDataPromise=this._networkClient.fetchSDK({url:`/projects/bootstrap/${this._publicToken}`,method:"GET"}).then(lZ.mapBootstrapData).then(e=>(this._dataLayer.setItem(lG,JSON.stringify(e)),e)).catch(e=>(eP(e),lY()))}static mapBootstrapData(e){let t=null!==e.password_config?{ludsComplexity:e.password_config.luds_complexity,ludsMinimumCount:e.password_config.luds_minimum_count}:null;return{projectName:e.project_name,displayWatermark:!e.disable_sdk_watermark,captchaSettings:e.captcha_settings,cnameDomain:e.cname_domain,emailDomains:e.email_domains,pkceRequiredForEmailMagicLinks:e.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:e.pkce_required_for_password_resets,pkceRequiredForOAuth:e.pkce_required_for_oauth,pkceRequiredForSso:e.pkce_required_for_sso,slugPattern:e.slug_pattern,createOrganizationEnabled:e.create_organization_enabled,passwordConfig:t,runDFPProtectedAuth:e.dfp_protected_auth_enabled??!1,dfpProtectedAuthMode:e.dfp_protected_auth_mode,rbacPolicy:e.rbac_policy??null,siweRequiredForCryptoWallets:e.siwe_required_for_crypto_wallets,vertical:e.vertical}}getSync(){let e=this._dataLayer.getItem(lG);if(null===e)return lY();try{return JSON.parse(e)}catch{return lY()}}getAsync(){return this._bootstrapDataPromise}}class lJ{bootstrapPromise;state;constructor(e){this.bootstrapPromise=e,this.state=e.then(async e=>{let t;return e.captchaSettings.enabled?{configured:!0,captchaClient:await (t=e.captchaSettings.siteKey,eD(`https://www.google.com/recaptcha/enterprise.js?render=${t}`,()=>window.grecaptcha.enterprise)),siteKey:e.captchaSettings.siteKey}:{configured:!1}})}executeRecaptcha=async()=>{let{captchaClient:e,configured:t,siteKey:r}=await this.state;if(t)return await new Promise(t=>e.ready(t)),e.execute(r,{action:"LOGIN"})}}class lQ{iframeURL;_frameClient;constructor(e){this.iframeURL=e}get frameClient(){return this._frameClient=this._frameClient??new e0(this.iframeURL),this._frameClient}call(e,t){return this.frameClient.call(e,[t])}oneTapStart=e=>this.call("oneTapStart",e);oneTapSubmit=e=>this.call("oneTapSubmit",e);parsedPhoneNumber=e=>this.call("parsedPhoneNumber",e);getExamplePhoneNumber=e=>this.call("getExamplePhoneNumber",e)}class lX{_publicToken;_subscriptionDataLayer;additionalTelemetryDataFn;eventLogger;baseURL;constructor(e,t,r,n,a){this._publicToken=e,this._subscriptionDataLayer=t,this.additionalTelemetryDataFn=a,this.baseURL=r,(e=>e.includes("public-token-test"))(e)&&(this.baseURL=n),this.eventLogger=new eR({maxBatchSize:15,intervalDurationMs:800,logEventURL:this.buildSDKUrl("/events")})}updateSessionToken=()=>null;logEvent({name:e,details:t,error:r={}}){this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:e,details:t,error_code:r.error_code,error_description:r.error_description,http_status_code:r.http_status_code})}createTelemetryBlob(){return{event_id:`event-id-${ek()}`,app_session_id:`app-session-id-${ek()}`,persistent_id:`persistent-id-${ek()}`,client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.additionalTelemetryDataFn(),app:{identifier:window.location.hostname},sdk:{identifier:"Stytch.js Javascript SDK",version:"@stytch/vanilla-js@6.0.11"}}}async fetchSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return eg({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async submitFormSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return ef({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async retriableFetchSDK({url:e,body:t,method:r,retryCallback:n}){let a=this._subscriptionDataLayer.readSessionCookie().session_token,o="Basic "+window.btoa(this._publicToken+":"+(a||this._publicToken)),i=window.btoa(JSON.stringify(this.createTelemetryBlob())),s=window.location.origin;return e_({basicAuthHeader:o,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:i,xSDKParentHostHeader:s,retryCallback:n})}buildSDKUrl(e){return`${this.baseURL}/sdk/v1${e}`}}function l1(e){let t=e.toString(16);return 1===t.length&&(t="0"+t),t}class l0{_dataLayer;namespace;constructor(e,t){this._dataLayer=e,this.namespace=t}key(){return`PKCE_VERIFIER:${this.namespace}`}async startPKCETransaction(){let e=await l0.createProofkeyPair();return this._dataLayer.setItem(this.key(),JSON.stringify(e)),e}getPKPair(){let e=this._dataLayer.getItem(this.key());if(null!==e)try{return JSON.parse(e)}catch{eC("Found malformed Proof Key pair in localstorage.");return}}clearPKPair(){return this._dataLayer.removeItem(this.key())}static async createProofkeyPair(){var e;let t=new Uint32Array(16);window.crypto.getRandomValues(t);let r=Array.from(t).map(l1).join("");return{code_challenge:(e=await window.crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)),btoa(String.fromCharCode.call(null,...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")),code_verifier:r}}}function l2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)"__proto__"!==n&&(e[n]=r[n])}return e}var l3=function e(t,r){function n(e,n,a){if("u">typeof document){"number"==typeof(a=l2({},r,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in a)a[i]&&(o+="; "+i,!0!==a[i]&&(o+="="+a[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+o}}return Object.create({set:n,get:function(e){if("u">typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},a=0;a<r.length;a++){var o=r[a].split("="),i=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(s in n||(n[s]=t.read(i,s)),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",l2({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,l2({},this.attributes,t))},withConverter:function(t){return e(l2({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});let l4="seen_domains";class l5{publicToken;state;_opaqueTokenCookieName=null;_jwtCookieName=null;_cookiePath=null;_domain=null;_cookieAvailableToSubdomains=!1;_istCookieName=null;subscriptions;_localStorage;browserSessionStorage;constructor(e,t){let r;this.publicToken=e,this.state=null,this.subscriptions={},this._localStorage=oj(oH,e),this.browserSessionStorage=oj(oK,e),t?.cookieOptions&&(this._opaqueTokenCookieName=t.cookieOptions.opaqueTokenCookieName||null,this._jwtCookieName=t.cookieOptions.jwtCookieName||null,this._cookiePath=t.cookieOptions.path||null,this._domain=t.cookieOptions.domain||null,this._cookieAvailableToSubdomains=t.cookieOptions.availableToSubdomains||!1,this._istCookieName=t.cookieOptions.istCookieName||null);const n=this._localStorage.getItem("");if(!n)return;try{r=JSON.parse(n)}catch{this.syncToLocalStorage();return}this.state=r}get opaqueTokenCookieName(){return this._opaqueTokenCookieName??"stytch_session"}get jwtCookieName(){return this._jwtCookieName??"stytch_session_jwt"}get istCookieName(){return this._istCookieName??"stytch_intermediate_session_token"}readSessionCookie(){return{session_token:l3.get(this.opaqueTokenCookieName),session_jwt:l3.get(this.jwtCookieName)}}readIntermediateSessionTokenCookie(){return l3.get(this.istCookieName)}writeSessionCookie(e){let{state:t,session_token:r,session_jwt:n}=e,a=l5.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});a.domain&&this.addSeenDomain(a.domain),l3.set(this.opaqueTokenCookieName,r,a),l3.set(this.jwtCookieName,n,a);let o=l5.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});o.domain&&this.addSeenDomain(o.domain),n8(this.jwtCookieName)&&l3.remove(this.jwtCookieName,o),n8(this.opaqueTokenCookieName)&&l3.remove(this.opaqueTokenCookieName,o),n8(this.jwtCookieName)&&eC("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."),n8(this.opaqueTokenCookieName)&&eC("Could not remove extraneous opaque token cookie.")}writeIntermediateSessionTokenCookie(e){let t=new Date(Date.now()+6e5),r=l5.generateCookieOpts({expiresAt:t.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});l3.set(this.istCookieName,e,r)}removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName])}removeISTCookie(){this.removeCookies([this.istCookieName])}removeCookies(e){let t=this.getSeenDomains(),r=[...new Set([this._domain,null,...t])];[!0,!1].forEach(t=>{[this._cookiePath,null].forEach(n=>{r.forEach(r=>{let a=l5.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:t,path:n,domain:r});e.forEach(e=>{l3.remove(e,a)})})})})}syncToLocalStorage(){this._localStorage.setItem("",JSON.stringify(this.state))}getItem(e){return this._localStorage.getItem(e)}setItem(e,t){this._localStorage.setItem(e,t)}removeItem(e){this._localStorage.removeItem(e)}getSeenDomains(){let e=this.getItem(l4);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}addSeenDomain(e){if(!e)return;let t=this.getSeenDomains();t.includes(e)||(t.push(e),this.setItem(l4,JSON.stringify(t)))}static generateCookieOpts({path:e,domain:t,availableToSubdomains:r,expiresAt:n}){let a={expires:new Date(n),sameSite:"lax"};return e&&(a.path=e),"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)?a.secure=!1:(r&&(a.domain=t||window.location.host),a.secure=!0),a}}class l8 extends l5{}let l6=Symbol.for("__stytch_b2b_DataLayer"),l7=(e,t)=>{Object.values(e).forEach(e=>e(t))},l9=(({KEYS_TO_EXCLUDE:e=[]}={})=>{let t=(r,n)=>typeof r==typeof n&&(null===r||null===n?r===n:"object"==typeof r?!(Object.keys(r).length!==Object.keys(n).length||Object.keys(r).some(e=>!(e in n)))&&Object.entries(r).filter(([t])=>!e.includes(t)).every(([e,r])=>t(r,n[e])):r===n);return t})({KEYS_TO_EXCLUDE:["last_accessed_at"]});class ce{_publicToken;_datalayer;fromCache=!0;constructor(e,t,{usingCustomApiEndpoint:r}){if(this._publicToken=e,this._datalayer=t,window.addEventListener("storage",this._listen),!r){const{session_token:e}=this._datalayer.readSessionCookie();if(!e)return void this.destroySession()}}_listen=e=>{if(e.key!==oF(this._publicToken,""))return;let t=null===e.newValue||"null"===e.newValue?null:JSON.parse(e.newValue);this.updateState(t,!0)};getTokens(){let{session_token:e,session_jwt:t}=this._datalayer.readSessionCookie();return"string"!=typeof e||"string"!=typeof t?null:{session_token:e,session_jwt:t}}getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null}destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null})}destroySession(){this._datalayer.removeSessionCookie(),this.updateState(null)}_updateStateAndTokensInternal(e,t){let r=this._datalayer.state,n=null===e.state?null:{...this._datalayer.state,...e.state};this._datalayer.state=n;let a=this.getFromCache();if(this.setCacheRefreshed(),a||!l9(r,n)){let e;e=null==n||t.fromCache?n:{...n,sessionDurationMinutes:t.sessionDurationMinutes},l7(this._datalayer.subscriptions,e)}}updateStateAndTokens(e,t={fromCache:!1}){e.state?("string"==typeof e.session_token?this._datalayer.writeSessionCookie(e):this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()):e.intermediate_session_token?("string"==typeof e.intermediate_session_token?this._datalayer.writeIntermediateSessionTokenCookie(e.intermediate_session_token):this._datalayer.removeISTCookie(),this._datalayer.removeSessionCookie()):(this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()),this._updateStateAndTokensInternal(e,t),this._datalayer.syncToLocalStorage()}updateState(e,t=!1){let r=this._datalayer.state,n=null===e?null:{...this._datalayer.state,...e};this._datalayer.state=n;let a=this.getFromCache();this.setCacheRefreshed();let o=!l9(r,n);(a||o)&&(l7(this._datalayer.subscriptions,n),o&&!t&&this._datalayer.syncToLocalStorage())}updateTokens(e){let{session_token:t,session_jwt:r}=e,n={...this._datalayer.readSessionCookie(),session_token:t,session_jwt:r};"string"==typeof t||"string"==typeof r?(this._datalayer.writeSessionCookie(n),this._datalayer.removeISTCookie()):this._datalayer.removeSessionCookie()}subscribeToState(e){var t;let r;return t=this._datalayer.subscriptions,t[r=Math.random().toString(36).slice(-10)]=e,()=>delete t[r]}getState(){return this._datalayer.state}destroy(){window.removeEventListener("storage",this._listen)}syncFromDeviceStorage(){return null}getFromCache(){return this.fromCache}setCacheRefreshed(){this.fromCache=!1}}class ct extends ce{updateMember=e=>this.updateState({member:e});getMember=()=>this.getState()?.member??null;updateOrganization=e=>this.updateState({organization:e});getOrganization=()=>this.getState()?.organization??null;getSession=()=>this.getState()?.session??null;updateSession=(e,t)=>{if("member_session"in e&&e.member_session){let r=e.session_token&&e.session_jwt?{session_token:e.session_token,session_jwt:e.session_jwt}:{session_token:!0,session_jwt:!0};this.updateStateAndTokens({state:{session:e.member_session,member:e.member,organization:e.organization},...r,intermediate_session_token:null},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})}else this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:e.intermediate_session_token||!0},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})};withUpdateSession=e=>async t=>{let r=await e(t);return this.updateSession(r,{sessionDurationMinutes:t?.session_duration_minutes}),r}}class cr extends eH{_oneTap;constructor(e,t,r,n,a,o=eM(),i){super(e,t,r,n,a,o),this._oneTap=i}startOneTapDiscovery=async e=>{let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnDiscoverySuccessHandler({discoveryRedirectUrl:e.discovery_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};startOneTap=async e=>{if(!e.organization_id)throw new h("stytch.oauth.googleOneTap.start","organization_id is a required argument");let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnSuccessHandler({organizationId:e.organization_id,signupRedirectUrl:e.signup_redirect_url,loginRedirectUrl:e.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};googleOneTap={discovery:{start:this.startOneTapDiscovery},start:this.startOneTap}}let cn="u">typeof window&&"IdentityCredential"in window,ca=e=>e===er.forceLegacyEmbedded?"force":e===er.embeddedOnly||e===er.embedded||e===er.floatingOrEmbedded;class co{_googleClient;_clientId;constructor(e,t){this._googleClient=e,this._clientId=t}cancel(){this._googleClient.cancel()}async render({callback:e,onOneTapCancelled:t,style:r,cancelOnTapOutside:n=!0}){let a,o=ca(r.position),i="force"===(a=ca(r.position))||a&&!cn,s={client_id:this._clientId,callback:e,auto_select:!1,context:"use",itp_support:!0,use_fedcm_for_prompt:"force"!==o,cancel_on_tap_outside:n};return i&&(s.prompt_parent_id="google-parent-prompt",s.cancel_on_tap_outside=!1),this._googleClient.initialize(s),new Promise(e=>{this._googleClient.prompt(r=>{if(r.isSkippedMoment()){let n=r.getSkippedReason?.()??"unknown_reason";return"user_cancel"===n&&t?.(),e({success:!1,reason:n})}return!r.isNotDisplayed&&i||r.isNotDisplayed?.()?e({success:!1,reason:r.getNotDisplayedReason?.()??"unknown_reason"}):r.isDismissedMoment()?void 0:(this.styleFrame(i),e({success:!0}))})})}styleFrame(e){e&&Array.from(document.getElementsByTagName("iframe")).forEach(e=>{e.src.includes(a)&&(e.style.width="100%")})}}let ci=Promise.resolve({pkceRequiredForOAuth:!1});class cs{_networkClient;_pkceManager;_config;googleClientID;constructor(e,t,r=ci){this._networkClient=e,this._pkceManager=t,this._config=r}async fetchGoogleStart(){if(this.googleClientID)return this.googleClientID;let e=await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/start",method:"GET"});return this.googleClientID=e.google_client_id,this.googleClientID}async submitGoogleOneTapTokenDiscovery({credential:e,discoveryRedirectUrl:t}){let r,{pkceRequiredForOAuth:n}=await this._config;return n?r=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/discovery/submit",method:"POST",body:{id_token:e,discovery_redirect_url:t,pkce_code_challenge:r}})}async submitGoogleOneTapToken({credential:e,organizationId:t,signupRedirectUrl:r,loginRedirectUrl:n}){let a,{pkceRequiredForOAuth:o}=await this._config;return o?a=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/submit",method:"POST",body:{id_token:e,organization_id:t,signup_redirect_url:r,login_redirect_url:n,pkce_code_challenge:a}})}async createOneTapClient(){let e;try{e=await this.fetchGoogleStart()}catch(e){return{success:!1,reason:v.from(e).error_type}}return""===e?{success:!1,reason:"oauth_config_not_found"}:{success:!0,client:new co(await eD(o,()=>window.google.accounts.id),e)}}createOnDiscoverySuccessHandler=({discoveryRedirectUrl:e,onSuccess:t,onError:r})=>async n=>{let{credential:a}=n,o=this.submitGoogleOneTapTokenDiscovery({credential:a,discoveryRedirectUrl:e}).then(e=>t(e.redirect_url));r&&(o=o.catch(e=>r(e))),await o};createOnSuccessHandler=({organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r,onSuccess:n,onError:a})=>async o=>{let{credential:i}=o,s=this.submitGoogleOneTapToken({credential:i,organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r}).then(e=>n(e.redirect_url));a&&(s=s.catch(e=>a(e))),await s};redirectOnSuccess=e=>{window.location.href=e}}class cl{_subscriptionService;_sessionManager;_networkClient;_dataLayer;_stateChangeClient;magicLinks;session;member;self;organization;oauth;sso;discovery;passwords;otps;totp;recoveryCodes;rbac;scim;impersonation;idp;onStateChange;parseAuthenticateUrl;authenticateByUrl;constructor(e,t){if("u"<typeof window)throw Error("`new StytchB2BClient()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `createStytchB2BClient()` instead.");(e=>{"string"!=typeof e?eC(`Public token is malformed. Expected a string, got ${typeof e}.${eO}`):""===e?eC(`Public token is malformed. Expected "public-token-...", got an empty string.${eO}`):e.startsWith("public-token-")||eC(`Public token is malformed. Expected "public-token-...", got ${e}.${eO}`)})(e);const r=e??"",n=((e,t={})=>{let{cookieOptions:r,keepSessionAlive:n}=t;return eL(e,t,{keepSessionAlive:"optionalBoolean"}),r&&eL(`${e}.cookieOptions`,r,{opaqueTokenCookieName:"optionalString",jwtCookieName:"optionalString",istCookieName:"optionalString",path:"optionalString",domain:"optionalString"}),{cookieOptions:r,keepSessionAlive:n,endpoints:{testAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.testApiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"testApiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.testAPIURL??"https://test.stytch.com"})(t),liveAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.apiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"apiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.liveAPIURL??"https://api.stytch.com"})(t),dfpBackendURL:(e=>{let t=e?.dfppaUrl??e?.endpointOptions?.dfppaDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfppaUrl?"dfppaUrl":"dfppaDomain";eC(`Unable to use custom DFPPA domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.dfpBackendURL??"https://telemetry.stytch.com"})(t),dfpCdnURL:(e=>{let t=e?.dfpCdnUrl??e?.endpointOptions?.dfpCdnDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfpCdnUrl?"dfpCdnUrl":"dfpCdnDomain";eC(`Unable to use custom DFP CDN domain \`${t}\`. ${r} should be a valid domain.`)}}return"https://elements.stytch.com"})(t),clientsideServicesIframeURL:t?.endpoints?.clientsideServicesIframeURL??"https://js.stytch.com/clientside-services/index.html"}}})(this.constructor.name,t),a=((e,t={})=>{let{customBaseUrl:r,endpointOptions:n}=t;return e.includes("public-token-test")?!!(r||n?.testApiDomain):!!(r||n?.apiDomain)})(r,t);this._dataLayer=((e,t)=>{let r,n=((r=window)[l6]||(r[l6]={}),r[l6]);return n[e]||(n[e]=new l8(e,t)),n[e]})(r,n),this._subscriptionService=new ct(r,this._dataLayer,{usingCustomApiEndpoint:a}),this._stateChangeClient=new e5(this._subscriptionService,{}),this.onStateChange=(...e)=>this._stateChangeClient.onStateChange(...e);const o=()=>({stytch_member_id:this._dataLayer.state?.member?.member_id,stytch_member_session_id:this._dataLayer.state?.session?.member_session_id}),i=new l0(this._dataLayer,"passwords"),s=new lX(r,this._dataLayer,n.endpoints.liveAPIURL,n.endpoints.testAPIURL,o);this._networkClient=s;const l=new lZ(r,s,this._dataLayer),c=new lJ(l.getAsync()),d=new ez(r,n.endpoints.dfpBackendURL,n.endpoints.dfpCdnURL,l.getAsync(),c.executeRecaptcha),u=new lQ(n.endpoints.clientsideServicesIframeURL),h=new l0(this._dataLayer,"oauth"),m=new cs(s,h,l.getAsync());this.organization=new eK(s,s,this._subscriptionService),this.member=new eJ(s,s,this._subscriptionService),this.self=new eJ(s,s,this._subscriptionService),this.session=new eQ(s,this._subscriptionService),this.magicLinks=new eq(s,this._subscriptionService,new l0(this._dataLayer,"magic_links"),i,l.getAsync(),d),this.oauth=new cr(s,this._subscriptionService,h,l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d,m),this.sso=new eX(s,this._subscriptionService,new l0(this._dataLayer,"sso"),l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d),this.discovery=new eB(s,this._subscriptionService),this.passwords=new eV(s,this._subscriptionService,i,l.getAsync(),d),this.otps=new ej(s,this._subscriptionService,d),this.totp=new e1(s,this._subscriptionService,d),this.recoveryCodes=new eY(s,this._subscriptionService,d),this.rbac=new eG(l.getSync(),l.getAsync(),this._subscriptionService),this.scim=new eZ(this._networkClient,this._subscriptionService),this.impersonation=new eU(this._networkClient,this._subscriptionService,d),this.idp=new eN(s),this._sessionManager=new e4(this._subscriptionService,this.session,r,{keepSessionAlive:n.keepSessionAlive});const p=new e2(s,d);(a||this._dataLayer.readSessionCookie().session_token)&&this._sessionManager.performBackgroundRefresh();const{authenticateByUrl:_,parseAuthenticateUrl:g}=(e=>{let t=Object.keys(e),r=(e=window.location.href)=>{let r=new URL(e),n=r.searchParams.get("stytch_token_type"),a=r.searchParams.get("token");return a&&n?t.includes(n)?{handled:!0,token:a,tokenType:n}:{handled:!1,token:a,tokenType:n}:null};return{authenticateByUrl:async({clearParams:t,...n},a=window.location.href)=>{let o=t??a===window.location.href,i=r(a);if(null==i)return null;if(!i.handled)return i;let{token:s,tokenType:l}=i,c=e[l];return o&&sv(),{handled:!0,tokenType:l,data:await c(s,n)}},parseAuthenticateUrl:r}})({discovery:e=>this.magicLinks.discovery.authenticate({discovery_magic_links_token:e}),discovery_oauth:e=>this.oauth.discovery.authenticate({discovery_oauth_token:e}),oauth:(e,t)=>this.oauth.authenticate({oauth_token:e,...t}),sso:(e,t)=>this.sso.authenticate({sso_token:e,...t}),multi_tenant_magic_links:(e,t)=>this.magicLinks.authenticate({magic_links_token:e,...t}),multi_tenant_impersonation:e=>this.impersonation.authenticate({impersonation_token:e})});this.authenticateByUrl=_,this.parseAuthenticateUrl=g,s.logEvent({name:"b2b_sdk_instance_instantiated",details:{event_callback_registered:!1,error_callback_registered:!1,success_callback_registered:!1}}),l.getAsync().then(e=>{"CONSUMER"===e.vertical&&eP("This application is using a Stytch client for B2B projects, but the public token is for a Stytch Consumer project. Use a Consumer Stytch client instead, or verify that the public token is correct.")}),((e,t)=>{Object.assign(e,{[rX]:t})})(this,{bootstrap:l,clientsideServices:u,publicToken:r,searchManager:p,dataLayer:this._dataLayer,networkClient:s,oneTap:m})}}let cc=(...e)=>"u"<typeof window?lW("stytch"):new cl(...e),cd={"color-scheme":"shadcn","font-family":`var(--font-sans, ${nL["font-family"]})`,"font-family-mono":`var(--font-mono, ${nL["font-family-mono"]})`,"text-base":"var(--text-base)","transition-duration":nL["transition-duration"],spacing:"var(--spacing)","mobile-breakpoint":"var(--breakpoint-sm)","rounded-base":"calc(var(--radius) / 2.5)","container-width":nL["container-width"],"container-radius":"var(--radius-xl)",shadow:"var(--shadow)",background:"var(--background)",foreground:"var(--foreground)",primary:"var(--primary)","primary-foreground":"var(--primary-foreground)",secondary:"var(--secondary)","secondary-foreground":"var(--secondary-foreground)",muted:"var(--muted)","muted-foreground":"var(--muted-foreground)",accent:"var(--accent)","accent-foreground":"var(--accent-foreground)",border:"var(--border)",input:"var(--input)",ring:"var(--ring)",destructive:"var(--destructive)","destructive-foreground":nL["destructive-foreground"],success:nB.success,warning:nB.warning};return e.AuthFlowType=s,e.B2BMFAProducts=d,e.B2BOAuthProviders=c,e.B2BProducts=sB,e.BiometricRegistrationIdIsNullOrBlank=X,e.BiometricsAlreadyEnrolledError=class extends b{constructor(){super("BiometricsAlreadyEnrolledError","There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.")}},e.BiometricsFailedError=F,e.BiometricsUnavailableError=E,e.ChallengeSigningFailedError=R,e.DFPNotConfigured=ee,e.DeviceCredentialsNotAllowedError=x,e.FailedCodeChallengeError=B,e.FailedToDecryptDataError=U,e.IDPOAuthFlowMissingParamError=et,e.InternalError=k,e.InvalidAuthorizationCredentialError=z,e.InvalidCredentialTypeError=j,e.InvalidPrivateKeyLength=Q,e.InvalidRedirectSchemeError=H,e.InvalidStartUrlError=q,e.JSONDataNotConvertibleToStringError=V,e.KeyInvalidatedError=C,e.KeystoreUnavailableError=P,e.MissingAttestationObjectError=$,e.MissingAuthorizationCredentialIDTokenError=D,e.MissingCipherIv=J,e.MissingGoogleClientIDError=class extends b{constructor(){super("MissingGoogleClientIDError","No Google client ID was found in the project.")}},e.MissingPKCEError=class extends b{constructor(){super("MissingPKCEError","Make sure this flow is completed on the same device on which it was started.")}},e.MissingPublicKeyError=I,e.MissingUrlError=K,e.NoBiometricsEnrolledError=T,e.NoBiometricsRegistrationError=S,e.NoCredentialsPresentError=M,e.NoCurrentSessionError=w,e.OAuthProviders={Google:"google",Microsoft:"microsoft",Apple:"apple",Github:"github",GitLab:"gitlab",Facebook:"facebook",Discord:"discord",Salesforce:"salesforce",Slack:"slack",Amazon:"amazon",Bitbucket:"bitbucket",LinkedIn:"linkedin",Coinbase:"coinbase",Twitch:"twitch",Twitter:"twitter",TikTok:"tiktok",Snapchat:"snapchat",Figma:"figma",Yahoo:"yahoo"},e.OTPMethods={SMS:"sms",WhatsApp:"whatsapp",Email:"email"},e.OneTapPositions=er,e.PasskeysInvalidEncoding=G,e.PasskeysMisconfigured=Y,e.PasskeysUnsupportedError=N,e.RNUIProducts=eh,e.RandomNumberGenerationFailed=W,e.RedirectURLType=l,e.SDKAPIUnreachableError=u,e.SDKNotConfiguredError=L,e.SignInWithAppleMisconfigured=Z,e.StytchAPIError=v,e.StytchAPISchemaError=y,e.StytchAPIUnreachableError=f,e.StytchB2B=lj,e.StytchB2BClient=cl,e.StytchB2BHeadlessClient=cl,e.StytchB2BIdentityProvider=lH,e.StytchB2BUIClient=class extends cl{constructor(e,t){super(e,t),eC("StytchB2BUIClient is deprecated. Use the Stytch web components directly instead.")}mount=l$;mountIdentityProvider=lK},e.StytchError=g,e.StytchEventType=eu,e.StytchSDKAPIError=p,e.StytchSDKError=b,e.StytchSDKSchemaError=m,e.StytchSDKUsageError=h,e.UNRECOVERABLE_ERROR_TYPES=_,e.UserCancellationError=O,e.UserLockedOutError=A,e.Wallets={Phantom:"Phantom",Metamask:"Metamask",Coinbase:"Coinbase",Binance:"Binance",GenericEthereumWallet:"GenericEthereumWallet",GenericSolanaWallet:"GenericSolanaWallet"},e.createStytchB2BClient=cc,e.createStytchB2BHeadlessClient=cc,e.defaultDarkTheme=nN,e.defaultTheme=nB,e.errorToStytchError=function(e){if(e instanceof b)return e;switch(e.message){case"no_current_session":return new w;case"no_biometrics_registration":return new S;case"biometrics_unavailable":case"device_hardware_error":case"biometrics_not_available":return new E;case"key_invalidated":case"no_biometric_key":return new C;case"no_biometrics_enrolled":return new T;case"keystore_unavailable":return new P;case"device_credentials_not_allowed":return new x;case"user_cancellation":return new O;case"user_locked_out":return new A;case"google_onetap_missing_id_token":case"oauth_apple_missing_id_token":case"missing_authorization_credential_id_token":return new D;case"google_onetap_missing_member":case"oauth_apple_credential_invalid":case"invalid_authorization_credential":return new z;case"missing_public_key":return new I;case"challenge_signing_failed":return new R;case"no_credentials_present":return new M;case"sdk_not_configured":return new L;case"failed_code_challenge":return new B;case"passkeys_unsupported":return new N;case"failed_to_decrypt_data":return new U;case"biometrics_failed":return new F;case"invalid_start_url":return new q;case"invalid_redirect_scheme":return new H;case"missing_url":return new K;case"invalid_credential_type":return new j;case"missing_attestation_object":return new $;case"json_data_not_convertible_to_string":return new V;case"random_number_generation_failed":return new W;case"passkeys_invalid_encoding":return new G;case"passkeys_misconfigured":return new Y;case"signinwithapple_misconfigured":return new Z;case"missing_cipher_iv":return new J;case"invalid_private_key_length":return new Q;case"biometric_registration_id_is_null_or_blank":return new X;case"dfp_not_configured":return new ee;default:return new k(e)}},e.iconsBlack={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49q-.35-.03-1.04-.03c-1.48 0-2.05.55-2.05 2V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#000",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#000",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#000",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#000",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#000",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#000",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#000",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#000",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#000",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.iconsWhite={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49Q13.83 7 13.14 7c-1.48 0-2.05.56-2.05 2.02V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#fff",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#fff",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#fff",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#fff",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#fff",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#fff",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#fff",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#fff",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#fff",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.mount=l$,e.mountIdentityProvider=lK,e.parseOAuthAuthorizeParams=lv,e.parseOAuthLogoutParams=lb,e.shadcnTheme=cd,e}({});
|
|
64
64
|
//# sourceMappingURL=index.js.map
|