PageSourceSearch

https://ai.stackspot.com/assets/out-Cd0s02Uk.js

js stackspot.com collected 2026-09-28 10:20:06 UTC 23,613 bytes, 36 lines download raw bytes

1import{r as e}from"./chunk-QTnfLwEv.js";import{A as t,C as n,E as r,M as i,X as a,b as o,c as s,d as c,nt as l,rt as u,tt as d,x as f,y as p}from"./dist-Dwy9VqNa.js";import{i as m,l as h,o as g,u as _}from"./react-dom-HmaMECB0.js";import{Lt as v,T as y,y as b}from"./dist-ANAaXWpR.js";import{b as x,i as S}from"./svg-DtNqJVFy.js";import{c as ee,d as C,f as w,l as T,u as E}from"./theme-ej_kzrAb.js";import{S as te,x as D}from"./dist-t3ukwVdS.js";var O=l(),k=e(u(),1),A=a(),j={en:{welcome:`Welcome to StackSpot AI`,loginWithEmail:`Log in with your email.`,loginWithSocialAccount1:`Sign up or access your `,loginWithSocialAccount2:` freemium account `,loginWithSocialAccount3:` with a social login`,label:`Corporate email`,placeholder:`[email protected]`,continue:`Continue`,or:`Or`,loginWith:`Continue with $0`,emailNotAllowedTitle:`Your email is linked to an Enterprise account.`,emailNotAllowedSubtitle:`Please log in with your corporate email.`,socialLogin:`Login or register with a social account`,corporateLoginTitle:`Already have a StackSpot Enterprise account?`,corporateLoginButton:`Enter Enterprise account`,socialLoginTitle:`Do you want to access another way?`,emailNotFoundError:`We couldn't find an account for this email.`,errorMobileDesktop:`It looks like you are using a mobile device in desktop mode. We recommend adjusting this setting before continuing for a complete experience.`,loginTemporarilyUnavailable:`Login temporarily unavailable.`},pt:{welcome:`Boas vindas à StackSpot AI`,loginWithEmail:`Faça login com seu e-mail.`,loginWithSocialAccount1:`Cadastre-se ou acesse sua `,loginWithSocialAccount2:` conta freemium `,loginWithSocialAccount3:` com uma conta social`,label:`Email corporativo`,placeholder:`[email protected]`,continue:`Continuar`,or:`Ou`,loginWith:`Continuar com $0`,emailNotAllowedTitle:`"Este e-mail está vinculado a uma conta Enterprise.`,emailNotAllowedSubtitle:`Faça login com seu email corporativo.`,socialLogin:`Entre ou cadastre-se com uma conta social`,corporateLoginTitle:`Já possui uma conta StackSpot Enterprise?`,corporateLoginButton:`Entrar na conta Enterprise`,socialLoginTitle:`Você quer entrar de outro jeito?`,emailNotFoundError:`Não encontramos uma conta para este e-mail.`,errorMobileDesktop:`Parece que você está utilizando um dispositivo móvel na versão desktop. Recomendamos ajustar essa configuração antes de continuar para uma experiência completa.`,loginTemporarilyUnavailable:`Login indisponível temporariamente.`}},M=()=>_(j),N=`stk-session${E()}`,P=Object.freeze({set:(e,t={})=>w(N,JSON.stringify(e),t),get:()=>{try{let e=T(N);return e?JSON.parse(e):void 0}catch(e){console.error(e)}},delete:()=>C(N)}),F=e=>{let t=RegExp(`^https?://[a-zA-Z0-9.-]*${E().replaceAll(`.`,`.`)}(:[0-9]{2,4})*.*$`,`g`),n=new RegExp(/^https:\/\/[a-zA-Z0-9.-]+\.stackspot\.com.*$/,`g`);return t.test(e)||n.test(e)},I=async e=>
1{if(!F(e))throw Error(`Redirect URL invalid domain`);window.location.href=e,await new Promise(()=>``)},L=Object.defineProperty,ne=Object.defineProperties,re=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oe=(e,t)=>{for(var n in t||={})ie.call(t,n)&&z(e,n,t[n]);if(R)for(var n of R(t))ae.call(t,n)&&z(e,n,t[n]);return e},se=(e,t)=>ne(e,re(t)),B=(e,t,n)=>(z(e,typeof t==`symbol`?t:t+``,n),n),V=`session`,H=class e{constructor(t){B(this,`current`),B(this,`auth`),B(this,`config`),B(this,`changeListeners`,[]),B(this,`logger`),t.loginUrl||=location.origin;let n=(t.redirectUrl||t.loginUrl).replace(/([^/])$/,`$1/`);this.config=t,this.auth=new D(se(oe({},t),{redirectUrl:n,storage:localStorage,sessionPersistence:{load:()=>localStorage.getItem(V),save:e=>localStorage.setItem(V,e)}})),this.logger=this.auth.config.logger,e.instance=this,addEventListener(`focus`,()=>this.validateSharedSession())}static create(t){return e.instance??new e(t)}setSession(e){this.current=e,this.changeListeners.forEach(t=>t(e)),e&&this.setSessionCookie(e)}async restoreSession(){let e=await this.auth.restoreSession();this.logger.log(`Validating shared session.`);let t=await this.validateSharedSession(e);this.setSession(t?e:void 0)}async validateSharedSession(e=this.current){if(this.urlHasThirdPartyLoginData())return this.logger.log(`Session is invalid because there's another authentication in progress.`),!1;let t=P.get();if(!t)return this.logger.log(`Session is invalid because no shared session cookie was found, i.e, a logout was performed in another portal. Forcing log off.`),e&&await this.logout(),!1;let n=t.sub!=e?.getTokenData().sub;return this.config.blockedAuthTypes?.includes(t.type)?(this.logger.log(`Session is invalid because shared sessions have been blocked in the SessionManager's configuration (blockedAuthTypes).`),!1):n||!e?(this.logger.log(n?`Session is invalid because a different session is already active.`:`Session is invalid because it's undefined.`),this.logger.log(`Starting login with tenant from the session cookie.`),await this.startThirdPartyLoginUsingTenant(t),!1):!0}hasSession(){return!!this.current&&!this.current.isExpired()}getSession(){if(!this.hasSession())throw this.endSession(),Error(`Session is not available, redirecting to login.`);return this.current}async endSession(e=!0){this.current=void 0,localStorage.removeItem(V),P.delete(),e&&this.config.loginUrl&&await I(this.config.loginUrl)}async restartSession(){await this.logout({endSession:!1}),this.current=void 0,localStorage.removeItem(V),await this.restoreSession()}async logout({endSession:e}={endSession:!0}){try{await this.current?.logout()}catch(e){console.error(`Could not logout from IDM.
2${e}`)}e&&await this.endSession()}async startThirdPartyLogin(e){let t=new URLSearchParams(location.search);await I(await this.auth.startThirdPartyLogin(e,{from:location.href,finalRedirect:t.get(`finalRedirect`)}))}urlHasThirdPartyLoginData(){let e=new URL(location.toString());return e.searchParams.has(`state`)&&!e.searchParams.has(`error`)}async startThirdPartyLoginUsingTenant(e){let t=new URLSearchParams(location.search),n=P.get();if(!n||!n.tenant){this.logger.log(`Login out because no tenant information is available in the following data:`,JSON.stringify(e)),await this.logout();return}await I(await this.auth.getThirdPartyLoginFromTenant(e,n.tenant,{from:location.href,finalRedirect:t.get(`finalRedirect`)}))}async completeThirdPartyLogin(){let e=new URL(location.toString());if(e.searchParams.has(`error`))throw Error(`Error while signing in: ${e.searchParams.get(`error_description`)}`);let{session:t,data:{from:n,finalRedirect:r}}=await this.auth.completeThirdPartyLogin(location.search);this.setSession(t),history.replaceState(null,``,n||location.toString().replace(/\?.*$/,``)),this.sendLoginEventRd(this.current?.getTokenData()),r&&await I(r)}getEmailForLogin(){let e=P.get();return e?.type==`sso`?e.email:void 0}async switchAccount(e){this.logger.log(`Switching accounts`,e,this.current?.getTokenData().account_id_v2);try{this.current&&await this.auth.switchAccount(e,this.current)}catch(e){throw this.logger.error(`Error while switching accounts`,e),e}this.setSession(this.current)}onChange(e){return this.changeListeners.push(e),()=>{let t=this.changeListeners.indexOf(e);t!=-1&&this.changeListeners.splice(t,1)}}setSessionCookie(e){let{email:t,account_type:n,sub:r,tenant:i}=e.getTokenData(),{provider:a,refresh_expires_in:o}=e.getSessionData();if(!t||!r||!i)return;let s=n==`FREEMIUM`,c={"Max-Age":o,path:`/`};s?P.set({type:`idp`,provider:a,sub:r,tenant:i},c):P.set({email:t,type:`sso`,sub:r,tenant:i},c)}async sendLoginEventRd(e){if(!this.config.rdUrl)return;if(!e){console.error(`Unable to trigger login hook. No sessionEmail or name identified.`);return}let{email:t,name:n,account_type:r,client_id:i,account_name:a,trial_account_status:o}=e,s=i===`stackspot-portal-ai`;if(!s&&i!==`stackspot-portal`&&o===`PENDING`)return;let c=r===`FREEMIUM`?`TRIAL`:`ENTERPRISE`,l={event_type:`CONVERSION`,event_family:`CDP`,payload:{email:t,name:n,conversion_identifier:s?`login_ai`:`login_edp`,cf_leadtype:c,cf_account_name:c===`TRIAL`?c:a}},u=await fetch(this.config.rdUrl,{method:`POST`,body:JSON.stringify(l),headers:{"content-type":`application/json`}}),d=await u.json();u.ok||console.error(`Error while sending event to RD Station`,d)}async getTrialEnabledProviders(){try{let e=await fetch(`${this.config.accountUrl}/v1/accounts/trial/sso`),t=await e.json();return e.ok||console.error(`Error while fetching available login providers`,t),Object.keys(t||{}).filter(e=>t[e]===!0)}catch(e){return console.error(`Error while fetching available login providers`,e),[]}}};B(H,`instance`);var U=H;function ce(){let e=U.instance,[t,n]=(0,k.useState)(e?.hasSession()?e.getSession():void 0);return(0,k.useEffect)(()=>e?.onChange(n),[]),t}var le=({enabled:e=!0})=>{let[t,n]=(0,k.useState)(e),[r,i]=(0,k.useState)([]);return(0,k.useEffect)(()=>{(async()=>
2{if(!(!U.instance||!e))try{i(await U.instance.getTrialEnabledProviders()),n(!1)}catch(e){console.error(e),n(!1)}})()},[U.instance]),[r,t]},ue=Object.defineProperty,de=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,G=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,he=(e,t)=>{for(var n in t||={})pe.call(t,n)&&G(e,n,t[n]);if(W)for(var n of W(t))me.call(t,n)&&G(e,n,t[n]);return e},ge=(e,t)=>de(e,fe(t)),_e=(0,k.forwardRef)((e,t)=>(0,O.jsxs)(`svg`,ge(he({ref:t},e),{width:`25`,height:`25`,viewBox:`0 0 25 25`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,O.jsxs)(`g`,{"clip-path":`url(#clip0_1215_2072)`,children:[(0,O.jsx)(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M12.0011 4.38525C10.1019 4.38624 8.26498 5.05889 6.81881 6.28294C5.37263 7.50698 4.4115 9.20259 4.10726 11.0666C3.80302 12.9306 4.17551 14.8414 5.15814 16.4574C6.14077 18.0733 7.66946 19.2891 9.47085 19.8872C9.86827 19.961 10.018 19.7147 10.018 19.5053C10.018 19.2958 10.01 18.6886 10.0074 18.0247C7.78183 18.5055 7.31155 17.0856 7.31155 17.0856C6.94858 16.1635 6.42399 15.9212 6.42399 15.9212C5.69804 15.4286 6.4783 15.4378 6.4783 15.4378C7.28241 15.4944 7.705 16.2584 7.705 16.2584C8.4177 17.4741 9.57683 17.1225 10.0325 16.917C10.1041 16.402 10.312 16.0516 10.5412 15.8527C8.76345 15.6525 6.89559 14.9702 6.89559 11.9222C6.88457 11.1317 7.17958 10.3673 7.71957 9.78704C7.63744 9.58683 7.36321 8.77808 7.79772 7.67954C7.79772 7.67954 8.46936 7.46616 9.99809 8.49488C11.3093 8.13834 12.6928 8.13834 14.0041 8.49488C15.5315 7.46616 16.2018 7.67954 16.2018 7.67954C16.6376 8.77544 16.3634 9.58419 16.2813 9.78704C16.823 10.3674 17.1186 11.1332 17.1066 11.9248C17.1066 14.9794 15.2347 15.6525 13.4543 15.8487C13.7404 16.0964 13.9961 16.5798 13.9961 17.3227C13.9961 18.387 13.9868 19.2431 13.9868 19.5053C13.9868 19.7173 14.1312 19.9649 14.5366 19.8872C16.3382 19.289 17.867 18.0731 18.8496 16.4568C19.8323 14.8406 20.2046 12.9295 19.9 11.0653C19.5954 9.20112 18.6338 7.50549 17.1871 6.28166C15.7405 5.05782 13.9031 4.38561 12.0037 4.38525H12.0011Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M9.35091 17.3684C9.35091 17.4329 9.27673 17.4882 9.18135 17.4896C9.08597 17.4909 9.00781 17.4382 9.00781 17.3736C9.00781 17.3091 9.08199 17.2538 9.17737 17.2525C9.27275 17.2511 9.35091 17.3025 9.35091 17.3684Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M9.96094 17.2672C9.97286 17.3317 9.90662 17.3989 9.81124 17.4147C9.71586 17.4305 9.63241 17.3923 9.62048 17.3291C9.60856 17.2659 9.67745 17.1974 9.77018 17.1803C9.86291 17.1631 9.94902 17.2027 9.96094 17.2672Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M8.6968 17.324C8.67693 17.3859 8.58685 17.4136 8.49676 17.3872C8.40668 17.3609 8.34707 17.2871 8.36429 17.2239C8.38151 17.1607 8.47292 17.1317 8.56433 17.1607C8.65573 17.1897 8.71402 17.2595 8.6968 17.324Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M8.09774 17.0658C8.05402 17.1145 7.96527 17.1013 7.89241 17.0355C7.81955 16.9696 7.80232 16.88 7.84604 16.8326C7.88975 16.7852 7.97851 16.7984 8.05402 16.8629C8.12953 16.9274 8.1441 17.0183 8.09774 17.0658V17.0658Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M7.6686 16.6231C7.61959 16.6574 7.53612 16.6231 7.48976 16.5546C7.47694 16.5423 7.46674 16.5276 7.45978 16.5113C7.45281 16.495 7.44922 16.4775 7.44922 16.4598C7.44922 16.4421 7.45281 16.4246 7.45978 16.4083C7.46674 16.392 7.47694 16.3772 7.48976 16.3649C7.53877 16.332 7.62224 16.3649 7.6686 16.4321C7.71497 16.4993 7.71629 16.5889 7.6686 16.6231V16.6231Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M7.3535 16.1662C7.32607 16.1799 7.29468 16.1838 7.26472 16.177C7.23475 16.1703 7.20807 16.1534 7.18924 16.1293C7.13757 16.074 7.12697 15.9976 7.16671 15.9633C7.20645 15.9291 7.27799 15.9449 7.32966 16.0002C7.38132 16.0555 7.39324 16.1319 7.3535 16.1662Z`,fill:`white`}),(0,O.jsx)(`path`,{d:`M7.02905 15.8062C7.01183 15.8457 6.94825 15.8576 6.89658 15.8299C6.84492 15.8022 6.8065 15.7509 6.82505 15.71C6.8436 15.6692 6.90586 15.6587 6.95752 15.6863C7.00919 15.714 7.04893 15.7667 7.02905 15.8062Z`,fill:`white`})]}),(0,O.jsx)(`defs`,{children:(0,O.jsx)(`clipPath`,{id:`clip0_1215_2072`,children:(0,O.jsx)(`rect`,{width:`16`,height:`16`,fill:`white`,transform:`translate(4 4.05176)`})})})]}))),ve=Object.defineProperty,ye=Object.defineProperties,be=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,q=(e,t,n
2)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||={})xe.call(t,n)&&q(e,n,t[n]);if(K)for(var n of K(t))Se.call(t,n)&&q(e,n,t[n]);return e},we=(e,t)=>ye(e,be(t)),Te=(0,k.forwardRef)((e,t)=>(0,O.jsxs)(`svg`,we(Ce({ref:t},e),{width:`25`,height:`25`,viewBox:`0 0 25 25`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,O.jsxs)(`g`,{"clip-path":`url(#clip0_1215_2403)`,children:[(0,O.jsx)(`path`,{d:`M20.3442 12.2359C20.3442 11.6921 20.3001 11.1454 20.206 10.6104H12.6602V13.691H16.9813C16.802 14.6846 16.2258 15.5635 15.3822 16.122V18.1209H17.9602C19.4741 16.7276 20.3442 14.6699 20.3442 12.2359Z`,fill:`#4285F4`}),(0,O.jsx)(`path`,{d:`M12.6607 20.0525C14.8184 20.0525 16.6379 19.344 17.9637 18.1212L15.3857 16.1223C14.6684 16.6103 13.7425 16.8866 12.6637 16.8866C10.5766 16.8866 8.80696 15.4785 8.17202 13.5854H5.51172V15.6461C6.86979 18.3475 9.63592 20.0525 12.6607 20.0525V20.0525Z`,fill:`#34A853`}),(0,O.jsx)(`path`,{d:`M8.16852 13.5856C7.83341 12.592 7.83341 11.5161 8.16852 10.5225V8.46191H5.51116C4.37649 10.7224 4.37649 13.3857 5.51116 15.6462L8.16852 13.5856V13.5856Z`,fill:`#FBBC04`}),(0,O.jsx)(`path`,{d:`M12.6607 7.2182C13.8013 7.20056 14.9036 7.62974 15.7296 8.41754L18.0136 6.1335C16.5674 4.77543 14.6479 4.02878 12.6607 4.0523C9.63592 4.0523 6.86979 5.75724 5.51172 8.46163L8.16908 10.5223C8.80108 8.62625 10.5736 7.2182 12.6607 7.2182V7.2182Z`,fill:`#EA4335`})]}),(0,O.jsx)(`defs`,{children:(0,O.jsx)(`clipPath`,{id:`clip0_1215_2403`,children:(0,O.jsx)(`rect`,{width:`16`,height:`16`,fill:`white`,transform:`translate(4.5 4.05176)`})})})]}))),Ee=Object.defineProperty,De=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,Y=(e,t,n)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,je=(e,t)=>{for(var n in t||={})ke.call(t,n)&&Y(e,n,t[n]);if(J)for(var n of J(t))Ae.call(t,n)&&Y(e,n,t[n]);return e},Me=(e,t)=>De(e,Oe(t)),Ne=(0,k.forwardRef)((e,t)=>(0,O.jsxs)(`svg`,Me(je({ref:t},e),{width:`25`,height:`25`,viewBox:`0 0 25 25`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,O.jsx)(`path`,{d:`M5.19531 4.74707H12.1518V11.7036H5.19531V4.74707Z`,fill:`#F35325`}),(0,O.jsx)(`path`,{d:`M12.8477 4.74707H19.8042V11.7036H12.8477V4.74707Z`,fill:`#81BC06`}),(0,O.jsx)(`path`,{d:`M5.19531 12.3994H12.1518V19.3559H5.19531V12.3994Z`,fill:`#05A6F0`}),(0,O.jsx)(`path`,{d:`M12.8477 12.3994H19.8042V19.3559H12.8477V12.3994Z`,fill:`#FFBA08`})]}))),Pe={github:(0,O.jsx)(_e,{}),google:(0,O.jsx)(Te,{}),microsoft:(0,O.jsx)(Ne,{})},Fe=({provider:e,login:n,loading:a,disabled:o})=>{let s=M();return(0,O.jsx)(i,{children:(0,O.jsx)(t,{colorScheme:`light`,type:`button`,size:`md`,sx:{width:`100%`},onClick:()=>n(`idp`,e),disabled:a||o,children:a?(0,O.jsx)(b,{}):(0,O.jsxs)(r,{alignItems:`center`,style:{gap:`4px`},children:[Pe[e],m(s.loginWith,(0,A.capitalize)(e))]})})})};function Ie(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function Le(){return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Re(){return!Le()&&Ie()}var ze=({trialProviders:e,loading:i,loginProvider:a,onSubmit:s,onChangeMode:c})=>{let l=M();return(0,O.jsxs)(O.Fragment,{children:[Re()&&(0,O.jsxs)(r,{bg:`warning`,p:4,role:`alert`,flexWrap:`nowrap`,children:[(0,O.jsx)(n,{colorIcon:`warning.contrastText`,children:(0,O.jsx)(v,{})}),(0,O.jsx)(o,{appearance:`body2`,ml:2,colorScheme:`warning.contrastText`,children:l.errorMobileDesktop})]}),(0,O.jsx)(r,{flexDirection:`column`,gap:!0,children:e?.map(e=>(0,O.jsx)(Fe,{provider:e,login:s,loading:i&&a===e,disabled:i},e))}),(0,O.jsx)(`p`,{className:`separator`,children:(0,O.jsx)(o,{appearance:`microtext1`,colorScheme:`light.700`,children:l.or})}),(0,O.jsx)(o,{colorScheme:`light.700`,align:`center`,children:l.corporateLoginTitle}),(0,O.jsx)(t,{size:`md`,disabled:i,colorScheme:`light`,onClick:()=>c(`sso`),children:l.corporateLoginButton})]})},X=`lastLoginType`,Be=[`guided-tour`,`@stack-spot/opa:user`,`CHAT_AGENTS`,`RATED_US_IN`];function Ve(){let e=localStorage.getItem(X);if(e===`idp`||e===`sso`)return e;if(T(`stk-session.stackspot.com`))return`sso`;for(let e of Be)if(localStorage.getItem(e))return`sso`;return`idp`}function He(e){localStorage.setItem(X,e)}
2var Ue=({value:e,onChange:n,loading:i,disabled:a,hasProvider:s,onChangeMode:c,idpLoginEnabled:l})=>{let u=M();return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(r,{flexDirection:`column`,style:{gap:`4px`,marginTop:`4px`},children:[(0,O.jsx)(p,{htmlFor:`email`,children:u.label}),(0,O.jsx)(f,{id:`email`,type:`email`,name:`email`,value:e,onChange:e=>n(e.target.value),placeholder:u.placeholder}),(0,O.jsx)(t,{colorScheme:`primary`,size:`md`,style:{marginTop:`12px`},disabled:a||i,children:i&&!s?(0,O.jsx)(b,{}):(0,O.jsx)(o,{children:u.continue})})]}),l&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`separator`,children:(0,O.jsx)(o,{appearance:`microtext1`,colorScheme:`light.700`,children:u.or})}),(0,O.jsx)(o,{colorScheme:`light.700`,align:`center`,children:u.socialLoginTitle}),(0,O.jsx)(t,{size:`md`,disabled:i,colorScheme:`light`,onClick:()=>c(`idp`),children:u.socialLogin})]})]})},We=d.form`
3  display: flex;
4  flex-direction: column;
5  justify-content: center;
6  gap: 24px;
7
8  header {
9    display: flex;
10    flex-direction: column;
11    align-items: center;
12    gap: 24px;
13  }
14
15  .separator {
16    padding: 0 8px;
17    display: flex;
18    flex-direction: row;
19    align-items: center;
20    justify-content: center;
21    gap: 8px;
22    margin: 0;
23
24    &:before, &:after {
25      content: '';
26      height: 1px;
27      flex: 1;
28      background-color: ${c.color.light[500]};
29    }
30  }
31
32  .error {
33    color: ${c.color.danger[500]};
34    line-height: 1.5rem;
35  }
36`,Ge=()=>{let e=M();return(0,O.jsx)(y,{children:(0,O.jsxs)(r,{justifyContent:`center`,children:[(0,O.jsx)(o,{appearance:`body2`,children:e.emailNotAllowedTitle}),(0,O.jsx)(o,{appearance:`body2`,colorScheme:`light.700`,children:e.emailNotAllowedSubtitle})]})})},Ke={position:`fixed`,top:0,left:0,width:`100%`},qe=({onSubmit:e,initialValue:t=``,showLogin:n=!0,welcomeText:a,removeLoadingOnSuccess:s,className:c,style:l,banner:u,loginTypes:d=[`idp`,`sso`]})=>{let f=M(),[p,m]=le({enabled:d.includes(`idp`)}),h=new URLSearchParams(location.search),[g,_]=(0,k.useState)(h.get(`error_description`)||h.get(`error`)||``),[v]=(0,k.useState)(h.get(`error_code`)||``),[y,x]=(0,k.useState)(!1),C=h.get(`provider`),[w,T]=(0,k.useState)(),[E,D]=(0,k.useState)(t||h.get(`email`)||``),A=!E.match(/\w+@\w+/),j=d.includes(`idp`)&&!!p?.length,[N,P]=(0,k.useState)();(0,k.useEffect)(()=>{P(j?Ve():`sso`)},[j]),(0,k.useEffect)(()=>{C&&(C===`email`?F(`sso`):p?.includes(C)&&F(`idp`,C))},[p,m]);
36async function F(t,n){_(``),x(!0),n!==w&&T(n);try{let r=t===`idp`&&n?{type:`idp`,provider:`external-idp:${n}`}:{type:`sso`,email:E};He(r.type),await e(r),s&&x(!1)}catch(e){x(!1),T(void 0),e instanceof te?_(f.emailNotFoundError):_(e.message||e.toString())}}(0,k.useEffect)(()=>{let e=document.createElement(`meta`);e.name=`adopt-website-id`,e.content=`a32fe656-2333-4dc5-8039-dddac6464587`,document.head.appendChild(e);let t=document.createElement(`script`);return t.src=`//tag.goadopt.io/injector.js?website_code=a32fe656-2333-4dc5-8039-dddac6464587`,t.className=`adopt-injector`,t.async=!0,document.body.appendChild(t),()=>{document.head.removeChild(e),document.body.removeChild(t)}},[]);function I(e){e.preventDefault(),!A&&F(`sso`)}if(m||!N)return(0,O.jsxs)(r,{alignContent:`center`,justifyContent:`center`,my:5,children:[(0,O.jsx)(b,{}),` `]});let L=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{children:f.loginWithSocialAccount1}),(0,O.jsx)(`span`,{style:{fontWeight:`bold`},children:f.loginWithSocialAccount2}),(0,O.jsx)(`span`,{children:f.loginWithSocialAccount3})]});return(0,O.jsxs)(O.Fragment,{children:[u&&(0,O.jsx)(i,{style:Ke,children:(0,O.jsx)(ee,{showCloseButton:!1,children:u})}),n?(0,O.jsxs)(We,{onSubmit:I,className:c,style:l,children:[(0,O.jsxs)(`header`,{children:[(0,O.jsx)(S,{}),(0,O.jsxs)(r,{flexDirection:`column`,alignItems:`center`,children:[(0,O.jsx)(o,{appearance:`body1`,weight:`medium`,children:a||f.welcome}),(0,O.jsx)(o,{appearance:`body2`,colorScheme:`light.700`,align:`center`,children:N===`idp`?L:f.loginWithEmail})]})]}),v&&v===`EMAIL_IS_NOT_ALLOWED`&&(0,O.jsx)(Ge,{}),N===`sso`?(0,O.jsx)(Ue,{disabled:A,loading:y,hasProvider:!w,value:E,onChange:D,onChangeMode:P,idpLoginEnabled:j}):(0,O.jsx)(ze,{loading:y,loginProvider:w,onSubmit:F,trialProviders:p,onChangeMode:P}),g&&(0,O.jsx)(o,{className:`error`,align:`center`,children:g})]}):(0,O.jsxs)(r,{flexDirection:`column`,alignItems:`center`,children:[(0,O.jsx)(S,{}),(0,O.jsx)(o,{appearance:`body1`,weight:`medium`,children:a||f.welcome}),(0,O.jsx)(o,{mt:4,children:f.loginTemporarilyUnavailable})]})]})},Je=Object.defineProperty,Ye=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Q=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||={})Ze.call(t,n)&&Q(e,n,t[n]);if(Z)for(var n of Z(t))Qe.call(t,n)&&Q(e,n,t[n]);return e},$e=(e,t)=>Ye(e,Xe(t)),et=({children:e,onLogin:t,onSession:n,customLoginProps:i,sessionManager:a,onChangeStatus:o})=>{let[c,l]=(0,k.useState)(`unknown`),u=h(g);if(a??=U.instance,!a)throw Error(`Please, provide a sessionManager`);return x(()=>{async function e(){if(!a)throw Error(`Please, provide a sessionManager`);await a.restoreSession(),a.urlHasThirdPartyLoginData()&&(await a.completeThirdPartyLogin(),t?.()),a.hasSession()?(l(`authenticated`),n?.(),o?.(`authenticated`)):(l(`unauthenticated`),o?.(`unauthenticated`))}e()}),c===`unknown`?null:c===`authenticated`?e:(0,O.jsx)(s,{children:(0,O.jsx)(r,{justifyContent:`center`,alignItems:`center`,flex:1,style:{height:`100%`},children:(0,O.jsx)(qe,$({style:{width:`360px`},onSubmit:e=>a.startThirdPartyLogin($e($({},e),{locale:u})),initialValue:a.getEmailForLogin()},i||{}))})})};export{U as n,ce as r,et as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.