PageSourceSearch

https://app.curri.com/_next/static/chunks/0dt_-voy3obgb.js

js curri.com collected 2026-09-24 10:25:40 UTC 39,619 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="f0b05b7c-2ee5-69fb-4ccb-0bd46d832629")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,146982,e=>{"use strict";var t=e.i(888165);e.i(368855);var r=e.i(690467),a=e.i(869800);e.s(["PoweredByCurri",0,e=>{let{alignment:i="center",surface:s="theme"}=e,n="map"===s;return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col justify-center gap-xxs","left"===i?"items-start":"items-center",n&&"[filter:drop-shadow(1px_0_0_rgb(255_255_255/0.9))_drop-shadow(-1px_0_0_rgb(255_255_255/0.9))_drop-shadow(0_1px_0_rgb(255_255_255/0.9))_drop-shadow(0_-1px_0_rgb(255_255_255/0.9))]"),children:[(0,t.jsx)("p",{className:(0,r.cn)("m-0 text-[10px] leading-normal font-medium",n?"text-black":"text-text-primary"),children:"Powered by"}),(0,t.jsx)(a.Logo,{black:!n,lightBackdrop:n,width:112,alt:"Curri"})]})}])},157979,e=>{e.q("/_next/static/media/SRSHeritage.07hnpql6q6rtj.png")},977385,e=>{"use strict";var t=e.i(888165),r=e.i(250815),a=e.i(425034);let i={src:e.i(883639).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRvgAAABXRUJQVlA4TOwAAAAvBcABAM1VICICHghADgIAAIBhJHxU/wIAAEAAAoMAAAAAAAAAAAAAhAKIAPSwCQAAEAAAE0CsmRwAAIAHgnaEAAAAcP7/bUkTCQBkCgAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAACuAJdL5YEA5CAAAACc//1+bUkAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkFQCj+b+L3MooIEtmiPG4aVrVGORsXOSyMINnuzQ/zffcnzVyUbnW5Zd5z38I7WyH1Sj7wWcAgAHIXafcLckgGRFoaG0+d+ne/2SxJd/HufWpHl33+jX7FQ=="},s={src:e.i(481253).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRuYAAABXRUJQVlA4TNkAAAAvBcABAM1VICICHghACgMAAIBH9vfYPjAAAAAAAAAAAAACAAAAAAAAAAAAYAAQICAAGTwAkMDgXwMAADwQtBQGAACA8//vnzAwoQaDyQgAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAALjzQEBSIAAAAM5/1gcAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3oJIIXcbWc4MKQovtluH+FkwQsKwIYBEABASIgAHRlud7qt1evb7eyzP/VO/tlw/93H6PM9d7V12vaVBOZwv4HMI5eKmc0QlAA=="},n={src:e.i(859108).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRpQAAABXRUJQVlA4TIcAAAAvBcABAM1VICICHghADgIAAIBOe2Z9NgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFD8aJY39wEAAB6IBAAAAADA+TcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCIr2gRQof6mEJkAF/AilYS6JP5Ct4ezpp3I6PzwgfVgdQAA"},o={src:e.i(642959).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRvAAAABXRUJQVlA4TOMAAAAvBcABAM1VICICHgiADQIAAIDnefkDXyEEcTgQAAAAAAAAAAAAAAACAAAAIDgAABAuhB8XcinQFagfAADAAwE3YgAAADj/pL8NAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyF/jgQDbMAAAAJx/0if7fgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAKZN5Pgfhw1mTioyA+PezZ1SIMJfDvlENiCpdJq6s8I4aCZgfE+OA1suM+973debK6zaUwU6eUz8IMQ7rdXdc/77rgvtYu7WLL9KSrWgDQA="},l={src:e.i(681101).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRuYAAABXRUJQVlA4TNkAAAAvBcABAM1VICICHghACgMAAID6fIERAAMAAAAAAAAAAAAAAAAAAADGAAABAIAZQwEEINBgZD1stB0AAIAHUrDCAAAAcP7vZgkMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEDQ/nkgIDcMAAAA53+fdKsBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsWS9ymXEg1LviefwaBhD0+tb2fdceS6oldaa7gnBVYfLOV1O1ULzx5m8JMB5FDi3/bXM8P8bp1KvZEI2n7nrMMZXwI3cBAA=="},A={src:e.i(858957).default,width:2510,height:3200,blurWidth:6,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRvAAAABXRUJQVlA4TOQAAAAvBcABAM1VICICHgiADQIAAIBuBZ5rAQEBAAAAAAAAAAAAAgAAAAAEABwAAIcAAAIA/r8YR6cupgUAAMADAUZCAAAAOP/t5hRAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACF63X4eCLANAwAAwPlnmbznBwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMaLNELsfpmY+YTQTGpBIabIGJ99FwOQDr97n12qnNOrPe4A5Bzhru3gXpZuD4nzSVR4Xx6xeusnVZ0UWi1O7avwJnq/vQNcbBfQdYl+HdzSM="};var d=e.i(800539);let c=e=>{let{images:r,duration:a=15e3,children:i}=e,[s,n]=(0,d.useState)(0),[o,l]=(0,d.useState)(!1),[A,c]=(0,d.useState)(100),u=(0,d.useRef)(null),m=(0,d.useRef)(null),h=(0,d.useRef)(null),g=Math.max(1e3,Math.min(a,3e5)),p=e=>"string"==typeof e?e:e.src,f=r&&r.length>1;return((0,d.useEffect)(()=>
2{if(f)return u.current&&clearInterval(u.current),u.current=setInterval(()=>{c(e=>{let t=e-100/(g/100);return t<=0?0:t})},100),m.current=setInterval(()=>{l(!0),h.current=setTimeout(()=>{n(e=>(e+1)%r.length),l(!1),c(100)},1e3)},g),()=>{u.current&&(clearInterval(u.current),u.current=null),m.current&&(clearInterval(m.current),m.current=null),h.current&&(clearTimeout(h.current),h.current=null)}},[r.length,g,f]),r&&0!==r.length)?(0,t.jsxs)(t.Fragment,{children:[r.map((e,r)=>(0,t.jsx)("div",{"aria-hidden":r!==s,className:"absolute inset-0 rounded-xs bg-cover bg-center transition-opacity duration-1000",style:{backgroundImage:`url(${p(e)})`,opacity:r!==s||o?0:1}},`${p(e)}-${r}`)),i,f&&(0,t.jsx)("div",{className:"absolute bottom-sm left-sm h-px w-[200px] overflow-hidden bg-white/30",children:(0,t.jsx)("div",{className:"h-full bg-white/75 transition-[width] duration-100",style:{width:`${A}%`}})})]}):(0,t.jsx)(t.Fragment,{children:i})};e.s(["LoginTemplate",0,e=>{let{children:d}=e;return(0,t.jsx)(a.default,{children:(0,t.jsxs)("div",{className:"flex min-h-screen bg-background-primary max-md:h-screen max-md:flex-col max-md:overflow-y-auto",children:[(0,t.jsx)("div",{className:"w-full p-md md:min-h-screen md:w-1/2 md:p-xl",children:(0,t.jsx)(r.Surface,{className:"relative h-full min-h-[250px]",children:(0,t.jsx)(c,{images:[i,s,n,o,l,A],children:(0,t.jsx)("div",{className:"absolute bottom-xl right-[60px] hidden border-r border-black pr-xl text-right text-heading-small uppercase leading-heading-small md:block"})})})}),(0,t.jsx)("div",{className:"flex w-full justify-center bg-background-primary px-md py-xl md:h-screen md:w-1/2 md:overflow-y-auto md:px-[8vw] xl:px-[6vw]",children:(0,t.jsx)("div",{className:"flex w-full max-w-[400px] flex-col justify-start text-left md:justify-center",children:d})})]})})}],977385)},883639,e=>{e.q("/_next/static/media/background-1.2-_qq30cb1-i0.webp")},481253,e=>{e.q("/_next/static/media/background-2.1suxchedokzxe.webp")},859108,e=>{e.q("/_next/static/media/background-3.1wq6nowtyrc-x.webp")},642959,e=>{e.q("/_next/static/media/background-4.2gpg8rt01itoe.webp")},681101,e=>{e.q("/_next/static/media/background-5.3_tfvf43m3t5t.webp")},858957,e=>{e.q("/_next/static/media/background-6.3lcfwd7r8axmq.webp")},968649,e=>{e.q("/_next/static/media/pickup-truck-delivering-roofing-material-background.0do12t02en4nk.webp")},485502,e=>{"use strict";var t=e.i(888165),r=e.i(17609),a=e.i(710633),i=e.i(328449);e.s(["AuthMethodChooser",0,function(e){let{lastUsedMethod:s,onBack:n,onChoosePassword:o,onChooseProvider:l,passwordTestId:A,providers:d}=e;return(0,t.jsxs)(t.Fragment,{children:[d.map(e=>(0,t.jsx)(i.OAuthProviderButton,{intent:"sign_in",lastUsed:s===e,onClick:()=>l(e),providerId:e},e)),(0,t.jsxs)(r.Button,{className:"relative w-full","data-e2e-id":A,onClick:o,size:"base",type:"button",variant:"secondary",children:[(0,t.jsx)("span",{className:"flex w-full items-center justify-center gap-sm",children:"Continue with Password"}),"password"===s&&(0,t.jsx)(a.LastUsedBadge,{})]}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("button",{className:"text-body-medium leading-body-medium font-body-medium text-text-brand hover:underline",onClick:n,type:"button",children:"Use a different email"})})]})}])},328449,710633,760311,e=>{"use strict";var t=e.i(888165),r=e.i(17609),a=e.i(800539),i=e.i(500847);function s(){return(0,t.jsx)(i.Badge,{className:"absolute -top-[6px] right-[8px]",variant:"default",children:"Last used"})}e.s(["LastUsedBadge",0,s],710633),e.i(368855);var n=e.i(690467);function o(e){let{className:r,...a}=e;return(0,t.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:(0,n.cn)("shrink-0",r),"aria-hidden":!0,...a,children:[(0,t.jsx)("path",{fill:"#F25022",d:"M1 1h6.6v6.6H1z"}),(0,t.jsx)("path",{fill:"#7FBA00",d:"M8.4 1H15v6.6H8.4z"}),(0,t.jsx)("path",{fill:"#00A4EF",d:"M1 8.4h6.6V15H1z"}),(0,t.jsx)("path",{fill:"#FFB900",d:"M8.4 8.4H15V15H8.4z"})]})}e.s(["MicrosoftSsoIcon",0,o],760311);let l={google:{connectLabel:"Connect Google",icon:function(e){let{className:r,...a}=e;return(0,t.jsxs)("svg",{viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",className:(0,n.cn)("shrink-0",r),"aria-hidden":!0,...a,children:[(0,t.jsx)("path",{fill:"#4285F4",d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.258h2.909c1.702-1.567 2.683-3.874 2.683-6.614Z"}),(0,t.jsx)("path",{fill:"#34A853",d:"M9 18c2.43 0 4.467-.806 5.957-2.181l-2.909-2.258c-.806.54-1.837.859
2-3.048.859-2.344 0-4.328-1.583-5.036-3.71H.957v2.332A8.997 8.997 0 0 0 9 18Z"}),(0,t.jsx)("path",{fill:"#FBBC05",d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.997 8.997 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332Z"}),(0,t.jsx)("path",{fill:"#EA4335",d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58Z"})]})},label:"Google",signInLabel:"Continue with Google"},microsoft:{connectLabel:"Connect Microsoft",icon:o,label:"Microsoft",signInLabel:"Continue with Microsoft"}};function A(e){return e in l}e.s(["OAuthProviderButton",0,function(e){let{providerId:i,disabled:n=!1,intent:o="sign_in",lastUsed:A=!1,onClick:d}=e,[c,u]=(0,a.useState)(!1),m=l[i],h=m.icon,g="connect"===o?m.connectLabel:m.signInLabel;return(0,t.jsxs)(r.Button,{className:"relative w-full",disabled:n,loading:c,onClick:async()=>{u(!0);try{await d()}finally{u(!1)}},size:"base",type:"button",variant:"secondary",children:[(0,t.jsxs)("span",{className:"flex w-full items-center justify-center gap-sm",children:[(0,t.jsx)(h,{}),g]}),A&&(0,t.jsx)(s,{})]})},"isOAuthProviderId",0,A,"oauthProviderLabel",0,function(e){return A(e)?l[e].label:void 0}],328449)},14892,934407,266520,431687,e=>{"use strict";var t=e.i(888165),r=e.i(328950),a=e.i(17609),i=e.i(511429);e.i(918562);var s=e.i(588572),n=e.i(155524);e.i(658944);var o=e.i(35741),l=e.i(340722),A=e.i(30533),d=e.i(486232),c=e.i(800539),u=e.i(191656),m=e.i(275554),h=e.i(445264),g=e.i(977385),p=e.i(869800),f=e.i(485502),w=e.i(328449),x=e.i(349934),y=e.i(7184),b=e.i(223575),v=e.i(336700),_=e.i(236515),j=e.i(673320),I=e.i(169934),S=e.i(31670),k=e.i(369196),C=e.i(670292),E=e.i(522024),B=e.i(146982);let N={src:e.i(157979).default,width:700,height:158,blurWidth:8,blurHeight:2,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAIAAADq9gq6AAAAPUlEQVR42gEyAM3/ALirrKmlpeHh4dHa4b/M1sDN18jT28bS2gCzra2xrKzi4ODS2+LJ1NzT3OPU3ePR2uGm8iZRoYULPwAAAABJRU5ErkJggg=="};e.s(["default",0,N],934407);var P=e.i(250815),R=e.i(425034);let D={src:e.i(968649).default,width:1051,height:1057,blurWidth:8,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRg4BAABXRUJQVlA4TAEBAAAvB8ABEM1VICICHgiADQIAAACdwnsGEJCSIkAAAAgAEAAAkAAAAAAAAAAIAQjgoCS9o4BaSBDwgpwCAADwQIBtGAAAAM4/SdYyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC4+7fGAwHJYQQAADj/7l3TpqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAArx8dieymA/mn943Ww8BH2QJA+g6XU6wFCOYnVHhBtEh0Iw9uNzX3mo1ver6OVGIbm2EiYzOZT8Dc4/tCTBDox8yKXCfnQoIMkdvyl6sbbm3Pk0/sVuQHDGivPdKnjufUar9aFF
2x1vAf8qo7AAA="},L=e=>{let{children:r}=e;return(0,t.jsx)(R.default,{children:(0,t.jsxs)("div",{className:"flex min-h-screen bg-background-primary max-[800px]:h-screen max-[800px]:flex-col max-[800px]:overflow-y-auto",children:[(0,t.jsx)("div",{className:"w-full p-md max-[800px]:h-[30%] max-[800px]:min-h-[250px] md:min-h-screen md:w-1/2 md:p-xl",children:(0,t.jsxs)(P.Surface,{className:"relative h-full min-h-[250px]",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${D.src})`},"aria-hidden":!0}),(0,t.jsx)("div",{className:"absolute right-[60px] bottom-xl hidden border-r border-solid border-border-bold pr-xl text-right text-heading-small leading-heading-small uppercase md:block"})]})}),(0,t.jsx)("div",{className:"flex w-full justify-center bg-background-primary px-md py-xl max-[800px]:block max-[800px]:h-auto max-[800px]:overflow-visible md:h-screen md:w-1/2 md:overflow-y-auto md:px-[8vw] xl:px-[6vw]",children:(0,t.jsx)("div",{className:"flex w-full flex-col justify-start text-center md:justify-center",children:r})})]})})};e.s(["SRSLoginTemplate",0,L],266520);let O=m.z.object({emailAddress:m.z.string().email("Enter a valid email address"),password:m.z.string().optional()}),U=e=>{let{onLogin:r,isLoggingIn:m}=e,g=(0,d.useRouter)(),p=g.query.email||"",f=(0,u.useForm)({defaultValues:{emailAddress:p,password:""},mode:"onBlur",resolver:(0,n.zodResolver)(O)}),w=f.watch("emailAddress"),x=f.watch("password")||"",[y,{loading:b}
2]=(0,s.useSsoProvidersByDomainLazyQuery)({onCompleted:e=>{let t=e?.ssoProvidersByDomain,r=t?.providers??[];r.length?g.push({pathname:`/login/${r[0].companyId}`,query:{...g.query,email:w}}):t?.hasPolicy?S(!0):U("email")}}),[v]=(0,s.useSsoProvidersByDomainLazyQuery)({onCompleted:e=>{let t=(0,I.getDomainLoginDecision)(e?.ssoProvidersByDomain);t.ssoRedirectCompanyId?g.push({pathname:`/login/${t.ssoRedirectCompanyId}`,query:{...g.query,email:w}}):t.denied&&S(!0)}}),[_,S]=(0,c.useState)(!1),[k,C]=(0,c.useState)(!1),[P,R]=(0,c.useState)(!1),[D,U]=(0,c.useState)(o.QueryParams.getParameterByName("loginType")),[T,M]=(0,c.useState)(!w),[H,Q]=(0,c.useState)(!!o.QueryParams.getParameterByName("error"));return(0,t.jsxs)(L,{children:[(0,t.jsx)(h.DefaultHead,{}),(0,t.jsx)(l.default,{children:(0,t.jsx)("title",{children:(0,j.createPageTitle)("Login")})}),(0,t.jsxs)("div",{className:"mt-[30%]",children:[(0,t.jsx)("h1",{className:"mb-xs font-[Inter] text-heading-large font-semibold tracking-xs text-text-primary",children:"Hotshot Hub"}),(0,t.jsx)("h2",{className:"m-0 font-light tracking-xl text-text-secondary",children:"Log in below to continue"}),(0,t.jsx)("h1",{className:"mt-xl text-[1.8vw] font-light max-[800px]:mt-sm max-[800px]:text-heading-medium",children:"email"===D?"Enter your email and password":"Log in below to continue"}),k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mt-md"}),(0,t.jsx)("p",{className:"m-0 rounded-xs bg-background-system-danger p-md text-body-medium leading-heading-small text-text-danger [&_a]:text-text-danger",children:"Unable to log you in. Please check your email and password and try again. If you just signed up, make sure you've verified your email address."})]}),H&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"mt-md"}),(0,t.jsx)("p",{className:"m-0 rounded-xs bg-background-system-danger p-md text-body-medium leading-heading-small text-text-danger [&_a]:text-text-danger",children:"Unable to log in with SSO. Please contact your administrator."})]}),_&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"mt-md"}),(0,t.jsx)("p",{className:"m-0 rounded-xs bg-background-system-danger p-md text-body-medium leading-heading-small text-text-danger [&_a]:text-text-danger",children:"No login method is available for your account. Please contact your administrator."})]}),(0,t.jsx)("div",{className:"mb-xxl"}),!_&&(0,t.jsxs)("form",{onSubmit:f.handleSubmit(async e=>{if("email"===D){if(!e.password)return void f.setError("password",{message:"Enter your password",type:"manual"});try{R(!0),await r({emailAddress:e.emailAddress,password:e.password})}catch(e){C(!0)}finally{R(!1)}}}),children:[!m&&(0,t.jsx)(i.TextInput,{autoFocus:T,className:"w-full","data-e2e-id":"login-email",label:"Email",placeholder:"[email protected]",size:"large",type:"email",value:w,onChange:e=>{f.setValue("emailAddress",e.target.value,{shouldDirty:!0})},onBlur:()=>{"email"===D&&v({variables:{domain:w?.split("@")[1],email:w}}),f.trigger("emailAddress").then()},error:!!f.formState.errors.emailAddress,errorText:f.formState.errors.emailAddress?.message}),!D&&(0,t.jsx)(a.Button,{className:"w-full",size:"base",variant:"brand",loading:m||b,onClick:async()=>{await f.trigger("emailAddress")&&(C(!1),Q(!1),y({variables:{domain:w?.split("@")[1],email:w}}),M(!1))},children:"Continue"}),"email"===D&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.TextInput,{autoFocus:!T,className:"w-full","data-e2e-id":"login-password",label:"Password",size:"large",type:"password",maxLength:E.Password.PASSWORD_MAX_LENGTH,value:x,onChange:e=>{f.setValue("password",e.target.value,{shouldDirty:!0})},onBlur:()=>f.trigger("password").then(),error:!!f.formState.errors.password,errorText:f.formState.errors.password?.message}),(0,t.jsx)(a.Button,{className:"w-full",size:"base",variant:"brand",disabled:P,type:"submit","data-e2e-id":"login-submit",loading:P,children:"Log in"}),(0,t.jsx)("div",{className:"mb-sm"}),(0,t.jsx)("div",{className:"mt-sm text-center",children:(0,t.jsx)(A.default,{href:"/password/reset",className:"text-body-medium font-heading-semi-bold text-text-brand hover:underline",children:"Forgot password"})})]})]}),(0,t.jsx)("div",{className:"mb-lg"}),(0,t.jsx)("img",{width:300,src:N.src,alt:""})]}),(0,t.jsx)("div",{className:"mt-auto",children:(0,t.jsx)(B.PoweredByCurri,{})})]})};e.s(["default",0,U],431687);let T=m.z.object({emailAddress:m.z.string().email("Enter a valid email address"),password:m.z.string().optional()});e.s(["Login",0,e=>{let{onLogin:m,isLoggingIn:E,showBeaconError:B=!1,onOAuthLinked:N}=e,P=(0,d.useRouter)(),R=P.query.email||"",D=P.query.oauth,L="link_required"===D,[O,M]=(0,c.useState)(),[H,Q]=(0,c.useState)(),[z,V]=(0,c.useState)(!1),q=async e=>{M(void 0);try{let t=await fetch("/api/auth/oauth-link-confirm",{body:JSON.stringify({password:e}),headers:{"Content-Type":"application/json"},method:"POST"});if(t.ok)return await t.json();let r=await t.json().catch(()=>null);M(r?.reason==="password_unavailable"?"This account cannot be confirmed with a password. Reset your password first, then connect Google from account settings.":r?.reason==="no_pending_link"?"That took too long. Sign in with your password, then connect Google from account settings.":r?.reason==="invalid_password"?"That password is incorrect.":"Could not connect Google. Sign in with your password and try from account settings.");return}catch{M("Could not connect Google. Sign in with your password and try from account settings.");return}},F=async e=>{(0,k.trackAuthMethodClicked)({flow:"login",method:e,surface:"generic_login"}),await (0,_.initiateOAuthSignIn)({emailAddress:G||void 0,flow:"login",providerId:e,surface:"generic_login"})},$=(0,u.useForm)({defaultValues:{emailAddress:R,password:""},mode:"onBlur",resolver:(0,n.zodResolver)(T)}),G=$.watch("emailAddress"),J=$.watch("password")||"",[X,{loading:Y}
2]=(0,s.useSsoProvidersByDomainLazyQuery)({onCompleted:e=>{let t=e?.ssoProvidersByDomain,r=t?.providers??[];r.length?P.push({pathname:`/login/${r[0].companyId}`,query:{...P.query,email:G}}):t?.hasPolicy?eu(!0):(ei("email"),en(!0))}}),[W]=(0,s.useSsoProvidersByDomainLazyQuery)({onCompleted:e=>{let t=(0,I.getDomainLoginDecision)(e?.ssoProvidersByDomain);t.ssoRedirectCompanyId?P.push({pathname:`/login/${t.ssoRedirectCompanyId}`,query:{...P.query,email:G}}):t.denied&&eu(!0)}}),Z=P.query.slug,[K,ee]=(0,c.useState)(!1),[et,er]=(0,c.useState)(!1),[ea,ei]=(0,c.useState)(o.QueryParams.getParameterByName("loginType")),[es,en]=(0,c.useState)(!1),[eo,el]=(0,c.useState)(void 0),[eA,ed]=(0,c.useState)(!G),[ec,eu]=(0,c.useState)(!1),[em,eh]=(0,c.useState)(!!o.QueryParams.getParameterByName("error")),[eg]=(0,c.useState)(()=>(0,y.readOAuthDenialReason)(o.QueryParams.getParameterByName(y.OAUTH_DENIAL_REASON_PARAM))),[ep]=(0,c.useState)(()=>(0,y.readProviderErrorCode)(o.QueryParams.getParameterByName(y.OAUTH_PROVIDER_CODE_PARAM))),[ef]=(0,c.useState)(()=>{let e=o.QueryParams.getParameterByName(y.OAUTH_DENIAL_PROVIDER_PARAM);return e&&(0,w.isOAuthProviderId)(e)?e:void 0}),[ew,ex]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=(0,C.readAndClearSsoIdpError)();if(e){(0,S.trackOAuthDeniedForIdpError)(e.provider),ex(e);return}let t=o.QueryParams.getParameterByName("error");t&&(0,S.trackOAuthDeniedFromLoginPage)({nextAuthError:t,providerDenialReason:eg,providerErrorCode:ep,providerId:ef})},[]);let ey=ew?(0,C.formatSsoIdpErrorDetails)(ew):null,eb=(0,c.useMemo)(()=>es&&!L?v.SELF_SERVE_PROVIDERS:v.NO_PROVIDERS,[es,L]),ev=(0,c.useMemo)(()=>[...eb,"password"],[eb]),e_="email"===ea&&!eo&&!L&&eb.length>0,[ej,eI]=(0,c.useState)(void 0);(0,c.useEffect)(()=>{eI((0,b.readLastUsedAuthMethod)())},[]),(0,x.useAuthMethodImpressions)({active:"email"===ea&&!L,flow:"login",methods:ev,surface:"generic_login"}),(0,x.useOAuthButtonImpressions)({active:"email"===ea,flow:"login",providers:eb,surface:"generic_login"});let eS=L&&void 0!==H,ek=L&&z&&void 0===H,eC=e=>{ee(!1),eh(!1),ed(!1),X({variables:{domain:e?.split("@")[1],email:e}})},eE=async()=>{await $.trigger("emailAddress")&&eC($.getValues("emailAddress"))};return(0,c.useEffect)(()=>{if(!L)return;let e=!1;return(async()=>{try{let t=await fetch("/api/auth/oauth-link-confirm");if(e)return;let r=t.ok?await t.json():void 0;if(e)return;r?.emailAddress&&(Q(r.emailAddress),$.setValue("emailAddress",r.emailAddress,{shouldDirty:!1}),eC(r.emailAddress)),V(!0)}catch{e||V(!0)}})(),()=>{e=!0}},[L]),(0,t.jsxs)(t.Fragment,{children:["srs"===Z&&(0,t.jsx)(U,{onLogin:m,isLoggingIn:E}),"srs"!==Z&&(0,t.jsxs)(g.LoginTemplate,{userEmail:G,children:[(0,t.jsx)(h.DefaultHead,{}),(0,t.jsx)(l.default,{children:(0,t.jsx)("title",{children:(0,j.createPageTitle)("Login")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-xl",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-md text-center",children:[(0,t.jsx)(p.Logo,{width:160,black:!0,className:"mx-auto"}),(0,t.jsx)("h1",{className:"text-heading-small font-heading-semi-bold text-text-primary md:text-heading-medium",children:eS?"Enter your password to connect Google":"email"!==ea?"Log in below to continue":e_?"Choose how to sign in":"Enter your password"})]}),K&&(0,t.jsx)(r.AlertBanner,{type:"danger",children:B?"Please use your @qxo.com email address.":"Unable to log you in. Please check your email and password and try again. If you just signed up, make sure you've verified your email address."}),ew&&ey?(0,t.jsx)(r.AlertBanner,{type:"danger",title:"Your organization's single sign-on rejected this login",children:(0,t.jsxs)("div",{className:"flex flex-col gap-xs text-left",children:[(0,t.jsx)("span",{children:"This is a configuration issue on your identity provider, not Curri. Please share the details below with your IT administrator."}),ey.message&&(0,t.jsx)("span",{className:"break-words",children:ey.message}),ey.details.length>0&&(0,t.jsx)("dl",{className:"flex flex-col gap-xxxs rounded-xs bg-background-primary/50 p-xs text-body-small",children:ey.details.map(e=>{let{label:r,value:a}=e;return(0,t.jsxs)("div",{className:"flex gap-xs",children:[(0,t.jsxs)("dt",{className:"shrink-0 text-text-secondary",children:[r,":"]}),(0,t.jsx)("dd",{className:"break-all font-mono",children:a})]},r)})}),ew.errorUri?.startsWith("https://")&&(0,t.jsx)("a",{href:ew.errorUri,target:"_blank",rel:"noreferrer",className:"text-text-brand hover:underline",children:"More information"})]})}):eg?(0,t.jsx)(r.AlertBanner,{type:"danger",title:(0,y.isCurriSideDenial)(eg)?"Sign-in is temporarily unavailable":"We could not sign you in",children:(0,y.oauthDenialMessage)(eg,"login")}):em&&(0,t.jsx)(r.AlertBanner,{type:"danger",children:"Unable to log in with SSO. Please contact your administrator."}),ec&&(0,t.jsx)(r.AlertBanner,{type:"danger",children:"No login method is available for your account. Please contact your administrator."}),eS&&!ec&&(0,t.jsxs)(r.AlertBanner,{type:"information",children:["You already have a Curri account with ",H,". Enter your password below to connect Google, and you can use it to sign in from now on."]}),O&&!ec&&(0,t.jsx)(r.AlertBanner,{type:"danger",children:O}),("account_exists"===D||ek)&&!ec&&(0,t.jsx)(r.AlertBanner,{type:"information",children:"You already have a Curri account with that email address. Sign in below to continue."}),"account_suspended"===D&&!ec&&(0,t.jsx)(r.AlertBanner,{type:"danger",title:"This account is suspended",children:"We could not sign you in. Please contact support."}),"signup_not_allowed"===D&&!ec&&(0,t.jsx)(r.AlertBanner,{type:"danger",title:"We could not create an account",children:"That email address cannot be used to sign up for Curri. Try your work email, or contact support."}),"provider_account_unusable"===D&&!ec&&(0,t.jsx)(r.AlertBanner,{type:"danger",title:"We could not use that account",children:"Sign in with your password below, or try a different account."}),!ec&&(0,t.jsxs)("form",{className:"flex flex-col gap-sm",onSubmit:$.handleSubmit(async e=>{if(!ea)return void await eE();if("email"===ea){if(!e.password)return void $.setError("password",{message:"Enter your password",type:"manual"});L||(0,k.trackAuthMethodClicked)({flow:"login",method:"password",surface:"generic_login"});try{if(er(!0),eS){let t=await q(e.password);if(!t)return;if(N)return void await N(t)}await m({emailAddress:e.emailAddress,password:e.password})}catch(e){ee(!0)}finally{er(!1)}}}),children:[!E&&(0,t.jsx)(i.TextInput,{autoFocus:eA,className:"w-full","data-e2e-id":"login-email",disabled:eS,label:"Email",placeholder:"[email protected]",size:"large",type:"email",value:G,onChange:e=>{$.setValue("emailAddress",e.target.value,{shouldDirty:!0})},onBlur:()=>{let e=G?.split("@")[1];"email"===ea&&e&&W({variables:{domain:e,email:G}}),G&&$.trigger("emailAddress").then()},error:K||!!$.formState.errors.emailAddress,errorText:$.formState.errors.emailAddress?.message}),!ea&&(0,t.jsx)(a.Button,{className:"w-full",loading:E||Y,onClick:eE,size:"base",type:"submit",variant:"brand",children:"Continue"}),e_&&(0,t.jsx)(f.AuthMethodChooser,{lastUsedMethod:ej,onBack:()=>{ei(""),el(void 0),en(!1),$.setValue("password","")},onChoosePassword:()=>el("password"),onChooseProvider:F,passwordTestId:"login-choose-password",providers:eb}),"email"===ea&&!e_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.TextInput,{autoFocus:!eA,className:"w-full","data-e2e-id":"login-password",error:K,label:"Password",size:"large",type:"password",value:J,onChange:e=>{$.setValue("password",e.target.value,{shouldDirty:!0})},onBlur:()=>$.trigger("password").then(),errorText:$.formState.errors.password?.message}),(0,t.jsx)(a.Button,{className:"w-full",disabled:et,type:"submit","data-e2e-id":"login-submit",loading:et,size:"base",variant:"brand",children:"Log in"}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)(A.default,{href:"/password/reset",className:"text-body-medium leading-body-medium font-body-medium text-text-brand hover:underline",children:"Forgot password"})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-sm border-t border-border-primary pt-lg text-center",children:[(0,t.jsx)("p",{className:"text-body-medium leading-body-medium font-body-regular text-text-secondary",children:"Don't have an account?"}),(0,t.jsx)(a.Button,{className:"w-full",onClick:()=>P.push("/signup"),size:"base",type:"button",variant:"primary",children:"Sign up"})]})]})]})]})}],14892)},349934,e=>{"use strict";var t=e.i(800539),r=e.i(369196),a=e.i(31670);function i(e,r,a){let i=(0,t.useRef)(new Set),s=(0,t.useRef)(a);s.current=a,(0,t.useEffect)(()=>
2{if(e)for(let e of r)i.current.has(e)||(i.current.add(e),s.current(e))},[e,r])}e.s(["useAuthMethodImpressions",0,function(e){let{active:t,flow:a,methods:s,surface:n}=e;i(t,s,e=>(0,r.trackAuthMethodShown)({flow:a,method:e,surface:n}))},"useOAuthButtonImpressions",0,function(e){let{active:t,flow:r,providers:s,surface:n}=e;i(t,s,e=>(0,a.trackOAuthButtonShown)({flow:r,providerId:e,surface:n}))}])},369196,e=>{"use strict";var t=e.i(901606);e.s(["AUTH_METHODS",0,["google","microsoft","password"],"trackAuthMethodClicked",0,function(e){(0,t.trackEvent)("auth_method_clicked",e)},"trackAuthMethodShown",0,function(e){(0,t.trackEvent)("auth_method_shown",e)}])},223575,e=>{"use strict";var t=e.i(369196);let r="last_used_auth_method";function a(e){return t.AUTH_METHODS.includes(e)}e.s(["isAuthMethod",0,a,"readLastUsedAuthMethod",0,function(){try{let e=window.localStorage.getItem(r);return a(e)?e:void 0}catch{return}},"writeLastUsedAuthMethod",0,function(e){try{window.localStorage.setItem(r,e)}catch{}}])},7184,e=>{"use strict";let t=["admin_consent_required","app_not_multi_tenant","app_misconfigured","account_not_in_tenant","user_cancelled","provider_unavailable","provider_error"],r={account_not_in_tenant:"Your Microsoft account is not allowed to use Curri.",admin_consent_required:"Your organization has not approved Curri for Microsoft sign-in yet, so Microsoft turned the request down.",app_misconfigured:"Something is wrong on our end with Microsoft sign-in, and we have been notified.",app_not_multi_tenant:"Something is wrong on our end with Microsoft sign-in, and we have been notified.",provider_error:"Your provider could not complete the sign-in.",provider_unavailable:"Your provider is having trouble right now.",user_cancelled:"Sign-in was cancelled before it finished."},a=new Set(["account_not_in_tenant","admin_consent_required"]),i={login:"You can sign in with your password instead.",signup:"You can finish signing up with a password below."},s={provider_error:"Please try again.",provider_unavailable:"Please try again in a minute.",user_cancelled:"You can try again."};e.s(["OAUTH_DENIAL_PROVIDER_PARAM",0,"oauth_provider","OAUTH_DENIAL_REASON_PARAM",0,"oauth_reason","OAUTH_PROVIDER_CODE_PARAM",0,"oauth_code","isCurriSideDenial",0,function(e){return"app_misconfigured"===e||"app_not_multi_tenant"===e},"oauthDenialMessage",0,function(e,t){let n=[r[e]];a.has(e)&&n.push("Ask your IT administrator to approve it.");let o=s[e];return o&&n.push(o),n.push(i[t]),n.join(" ")},"readOAuthDenialReason",0,function(e){let r=Array.isArray(e)?e[0]:e;return t.includes(r)?r:void 0},"readProviderErrorCode",0,function(e){let t=Array.isArray(e)?e[0]:e;if("string"==typeof t)return/^\d{4,7}$/.test(t)?t:void 0}])},336700,e=>{"use strict";let t={google:"google",microsoft:"microsoft-entra-id"},r=Object.freeze(Object.keys(t)),a=Object.freeze([]);e.s(["NO_PROVIDERS",0,a,"SELF_SERVE_PROVIDERS",0,r,"toNextAuthProviderId",0,function(e){return t[e]??e}])},236515,e=>{"use strict";var t=e.i(976220),r=e.i(697779),a=e.i(669737),i=e.i(336700),s=e.i(31670),n=e.i(670292),o=e.i(180715);async function l(e){if(!(await fetch("/api/auth/expected-email",{body:JSON.stringify({email:e}),headers:{"Content-Type":"application/json"},method:"POST"})).ok)throw Error("OAuth expected-email cookie request failed")}async function A(e){try{let t=await fetch("/api/auth/signup-context",{body:JSON.stringify({context:e}),headers:{"Content-Type":"application/json"},method:"POST"});if(!t.ok)throw Error(`OAuth signup-context cookie request failed: ${t.status}`)}catch(e){t.captureException(e,{tags:{feature:"oauth-signup-context"}})}}async function d(e){let{providerId:t,flow:a,surface:o,emailAddress:d,setExpectedEmailCookie:c=!1,signupContext:u}=e;d&&((0,n.setSsoSigninEmailCookie)(d),c&&await l(d)),u&&await A(u),(0,s.setOAuthPendingSession)({flow:a,providerId:t,surface:o}),(0,s.trackOAuthInitiated)({flow:a,providerId:t,surface:o});try{await (0,r.signIn)((0,i.toNextAuthProviderId)(t),void 0,d?{login_hint:d}:void 0)}catch(e){throw(0,s.clearOAuthPendingSession)(),e}}async function c(e){let{emailAddress:t,linkUserId:r,providerId:i,returnTo:s}=e;if((0,o.isImpersonating)())throw Error("Cannot connect a provider while impersonating");let n=(0,a.getJwt)();if(!n)throw Error("OAuth settings connect requires a session");if(!(await fetch("/api/auth/oauth-link-session",{body:JSON.stringify({linkUserId:r,returnTo:s}),headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},method:"POST"})).ok)throw Error("OAuth link session request failed");await d({emailAddress:t,flow:"connect",providerId:i,setExpectedEmailCookie:!0,surface:"account_settings"})}e.s(["initiateOAuthSettingsConnect",0,c,"initiateOAuthSignIn",0,d])},31670,e=>{"use strict";var t=e.i(901606);let r="oauth_pending",a=["connect","login","signup","unknown"],i=["account_settings","company_login","generic_login","signup","unknown"];function s(){try{window.sessionStorage.removeItem(r)}catch{}}function n(){let e=function(e){try{return window.sessionStorage.getItem(e)}catch{return null}}(r);if(s(),!e)return null;try{var t,n;let r=JSON.parse(e);if("string"==typeof r.providerId&&r.providerId.length>0&&(t=r.flow,a.includes(t))&&(n=r.surface,i.includes(n))&&"number"==typeof r.startedAt&&Number.isFinite(r.startedAt)&&Date.now()-r.startedAt<=6e5)return{flow:r.flow,providerId:r.providerId,surface:r.surface}}catch{}return null}function o(e){(0,t.trackEvent)("oauth_completed",e)}
2function l(e){(0,t.trackEvent)("oauth_denied",e)}e.s(["clearOAuthPendingSession",0,s,"setOAuthPendingSession",0,function(e){var t=JSON.stringify({...e,startedAt:Date.now()});try{window.sessionStorage.setItem(r,t)}catch{}},"trackOAuthButtonShown",0,function(e){(0,t.trackEvent)("oauth_button_shown",e)},"trackOAuthCompletedFromLoginPage",0,function(){let e=n();if(e)return o(e),e.providerId},"trackOAuthDeniedForIdpError",0,function(e){let t=n();t&&l({denialReason:"idp_error",flow:t.flow,providerId:e,surface:t.surface})},"trackOAuthDeniedFromLoginPage",0,function(e){let{nextAuthError:t,providerDenialReason:r,providerErrorCode:a,providerId:i}=e,s=n(),o=i??s?.providerId;o&&l({denialReason:function(e){switch(e){case"AccessDenied":return"access_denied";case"Configuration":return"configuration";case"OAuthCallbackError":return"callback_error";default:return"unknown"}}(t),flow:s?.flow??"unknown",nextAuthError:t??void 0,providerDenialReason:r,providerErrorCode:a,providerId:o,surface:s?.surface??"unknown"})},"trackOAuthInitiated",0,function(e){(0,t.trackEvent)("oauth_initiated",e)},"trackOAuthSettingsOutcome",0,function(e,t){let r=n();if(r){if("connected"===e)return void o(r);l({...r,denialReason:t??"unknown"})}}])},670292,e=>{"use strict";let t="sso_idp_error",r=/^([A-Z]{2,10}\d{4,6}):\s*/,a=/(Trace ID|Correlation ID|Timestamp)\s*:\s*/gi,i={"correlation id":"correlationId",timestamp:"timestamp","trace id":"traceId"};e.s(["formatSsoIdpErrorDetails",0,function(e){var t;let s,{code:n,rest:o}=(s=(t=e.errorDescription??"").match(r))?{code:s[1],rest:t.slice(s[0].length)}:{rest:t},l=function(e){let t=[...e.matchAll(a)];if(0===t.length)return{body:e};let r=t[0].index??e.length,s={body:e.slice(0,r).trimEnd()};return t.forEach((r,a)=>{let n=i[r[1].toLowerCase()],o=(r.index??0)+r[0].length,l=t[a+1]?.index??e.length,A=e.slice(o,l).trim();A&&(s[n]=A)}),s}(o),A=[];n&&A.push({label:"Error code",value:n});let d=e.correlationId??l.correlationId;d&&A.push({label:"Correlation ID",value:d});let c=e.traceId??l.traceId;return c&&A.push({label:"Trace ID",value:c}),l.timestamp&&A.push({label:"Timestamp",value:l.timestamp}),{code:n,message:l.body,details:A}},"readAndClearSsoIdpError",0,function(){if("u"<typeof document)return null;let e=document.cookie.match(RegExp(`(?:^|; )${t}=([^;]*)`));if(!e)return null;document.cookie=`${t}=; Path=/login; Max-Age=0; SameSite=Lax`;var r=e[1];try{let e=JSON.parse(decodeURIComponent(r));if(e&&"object"==typeof e&&"string"==typeof e.errorDescription)return e}catch{}return null},"setSsoSigninEmailCookie",0,function(e){if("u"<typeof document||!e)return;let t=[`sso_signin_email=${encodeURIComponent(e)}`,"Path=/api/auth/callback","Max-Age=300","SameSite=Lax"];t.push("Secure"),document.cookie=t.join("; ")}])},169934,e=>{"use strict";e.s(["getDomainLoginDecision",0,e=>{let t=e?.providers??[];return e?.hasPolicy?0===t.length?{ssoRedirectCompanyId:null,passwordAllowed:!1,denied:!0}:t.some(e=>"Password"===e.type)?{ssoRedirectCompanyId:null,passwordAllowed:!0,denied:!1}:{ssoRedirectCompanyId:t[0].companyId??null,passwordAllowed:!1,denied:!1}:{ssoRedirectCompanyId:null,passwordAllowed:!0,denied:!1}}])},697779,e=>{"use strict";var t=e.i(354524);e.i(888165);var r=e.i(800539);class a extends Error{constructor(e,t){e instanceof Error?super(void 0,{cause:{err:e,...e.cause,...t}}):"string"==typeof e?(t instanceof Error&&(t={err:t,...t.cause}),super(e,t)):super(void 0,e),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);const r=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${r}`}}class i extends a{}async function s(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=`${n(t)}/${e}`;try{let e={headers:{"Content-Type":"application/json",...a?.headers?.cookie?{cookie:a.headers.cookie}:{}}};a?.body&&(e.body=JSON.stringify(a.body),e.method="POST");let t=await fetch(s,e),r=await t.json();if(!t.ok)throw r;return r}catch(e){return r.error(new i(e.message,e)),null}}function n(e){return"u"<typeof window?`${e.baseUrlServer}${e.basePathServer}`:e.basePath}function o(e){let t=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let r=new URL(e||t),a=("/"===r.pathname?t.pathname:r.pathname).replace(/\/$/,""),i=`${r.origin}${a}`;return{origin:r.origin,host:r.host,path:a,base:i,toString:()=>i}}let l={baseUrl:o(t.default.env.NEXTAUTH_URL??t.default.env.VERCEL_URL).origin,basePath:o(t.default.env.NEXTAUTH_URL).path,baseUrlServer:o(t.default.env.NEXTAUTH_URL_INTERNAL??t.default.env.NEXTAUTH_URL??t.default.env.VERCEL_URL).origin,basePathServer:o(t.default.env.NEXTAUTH_URL_INTERNAL??t.default.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:()=>{}},A=null,d={debug:console.debug,error:console.error,warn:console.warn};async function c(){let e=await s("csrf",l,d);return e?.csrfToken??""}async function u(){return s("providers",l,d)}async function m(e,t,r){let{callbackUrl:a,...i}=t??{},{redirect:s=!0,redirectTo:o=a??window.location.href,...A}=i,d=n(l),m=await u();if(!m){let e=`${d}/error`;window.location.href=e;return}if(!e||!m[e]){let e=`${d}/signin?${new URLSearchParams({callbackUrl:o})}`;window.location.href=e;return}let h=m[e].type;if("webauthn"===h)throw TypeError(`Provider id "${e}" refers to a WebAuthn provider.
3Please use \`import { signIn } from "next-auth/webauthn"\` instead.`);let g=`${d}/${"credentials"===h?"callback":"signin"}/${e}`,p=await c(),f=await fetch(`${g}?${new URLSearchParams(r)}`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({...A,csrfToken:p,callbackUrl:o})}),w=await f.json();if(s){let e=w.url??o;window.location.href=e,e.includes("#")&&window.location.reload();return}let x=new URL(w.url).searchParams.get("error")??void 0,y=new URL(w.url).searchParams.get("code")??void 0;return f.ok&&await l._getSession({event:"storage"}),{error:x,code:y,status:f.status,ok:f.ok,url:x?null:w.url}}async function h(e){let{redirect:t=!0,redirectTo:r=e?.callbackUrl??window.location.href}=e??{},a=n(l),i=await c(),s=await fetch(`${a}/signout`,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Auth-Return-Redirect":"1"},body:new URLSearchParams({csrfToken:i,callbackUrl:r})}),o=await s.json();if((null===A&&(A="u"<typeof BroadcastChannel?{postMessage:()=>{},addEventListener:()=>{},removeEventListener:()=>{},name:"next-auth",onmessage:null,onmessageerror:null,close:()=>{},dispatchEvent:()=>!1}:new BroadcastChannel("next-auth")),A).postMessage({event:"session",data:{trigger:"signout"}}),t){let e=o.url??r;window.location.href=e,e.includes("#")&&window.location.reload();return}return await l._getSession({event:"storage"}),o}r.createContext?.(void 0),e.s(["signIn",0,m,"signOut",0,h],697779)},35741,e=>{"use strict";var t=e.i(944340);e.s(["QueryParams",()=>t.query_params_exports])}]);
4
5//# debugId=f0b05b7c-2ee5-69fb-4ccb-0bd46d832629

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.