!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9f9c8c35-8619-4f1c-927d-c966c1d758f7",e._sentryDebugIdIdentifier="sentry-dbid-9f9c8c35-8619-4f1c-927d-c966c1d758f7")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9605],{71744:function(e,t,s){Promise.resolve().then(s.bind(s,67716))},67716:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return P}});var n=s(94236),r=s(89958),i=s(44560),l=s(83674),a=s(74970),c=s(8400),o=s(110),d=s(73858),u=s(47018),m=s(22118),x=s(95241),h=s(4778),f=s(34077),p=s(41310),j=s(37931),g=()=>{let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>t(!0),[]),e},b=s(97327),y=s(60167),N=s(15668),E=s(74961),w=s(46335),v=s(25495),P=()=>{let e=(0,l.useSearchParams)(),[t,s]=(0,r.useState)(""),[P,T]=(0,r.useState)(""),[_,A]=(0,r.useState)(!1),[D,I]=(0,r.useState)(""),[L,M]=(0,r.useState)(!1),S=g(),{t:C}=(0,c.$G)("authentication"),k=(0,a.useSession)(),R=!(0,b.Ju)(t)||P.length<8,K=(0,j.Q2)({pathname:"/auth/redirect",searchParams:e});(0,r.useEffect)(()=>{(null==k?void 0:k.status)===d.$.AUTHENTICATED&&window.location.assign((0,j.Q2)({pathname:"/auth/redirect",searchParams:e}))},[k]),(0,r.useEffect)(()=>{let t=e.get("error");if(!S||!t)return;let s=null;t&&("AccessDenied"===t?s=C("accessDeniedError"):(f.uT("Login error",{extra:{errorCode:t}}),s=C("loginError")));let r=o.A.error((0,n.jsx)(h.PK,{children:(0,n.jsx)(h.Mi,{children:s})}),{duration:1e4});return()=>{o.A.dismiss(r)}},[S]);let O=async()=>{M(!0),I(""),(0,p.X)("Log In Clicked");try{let e=await(0,a.signIn)("credentials",{email:t,password:P,redirect:!1});(null==e?void 0:e.error)||!e.ok?(M(!1),(null==e?void 0:e.error)==="NeedsVerification"?A(!0):(null==e?void 0:e.error)==="TooManyRequests"?o.A.error((0,n.jsx)(h.PK,{children:(0,n.jsx)(h.Mi,{children:C("tooManyRequestsError")})}),{duration:1e4}):I("Login failed.")):window.location.assign(K)}catch(e){f.Tb(e)}},U=async()=>{await(0,a.signIn)("apple",{callbackUrl:K})},Z=async()=>{await(0,a.signIn)("google",{callbackUrl:K})},Y=C("login.loginButton"),F=C("common:loading");return(null==k?void 0:k.status)===d.$.AUTHENTICATED?(0,n.jsx)("div",{className:"h-full w-full",children:(0,n.jsx)(u.Z,{})}):(0,n.jsxs)("div",{children:[(0,n.jsx)(N.Z,{}),(0,n.jsx)(E.Z,{activeTab:"login"}),(0,n.jsx)("div",{className:"-mt-1 mb-7 h-1 w-full border-b border-gray-500 border-opacity-10"}),_?(0,n.jsx)(v.Z,{email:t,callbackUrl:K}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:"text-3xl font-bold",children:(0,n.jsx)(m.default,{namespace:"authentication",i18nKey:"login.heading"})}),(0,n.jsx)(w.Z,{onClickGoogle:Z,onClickApple:U}),(0,n.jsx)("h3",{className:"text-xs",children:(0,n.jsx)(m.default,{namespace:"authentication",i18nKey:"login.subheading",components:{b:(0,n.jsx)("span",{className:"font-bold"})}})}),(0,n.jsx)("div",{className:"my-7 h-1 w-full border-b border-gray-500 border-opacity-10"}),(0,n.jsxs)("form",{dir:"ltr",children:[(0,n.jsx)(x.Z,{type:"email",placeholder:C("emailPlaceholder"),value:t,onChange:s}),(0,n.jsx)(x.Z,{type:"password",placeholder:C("passwordPlaceholder"),value:P,onChange:T}),(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)(i.default,{href:"/forgot-password",className:"text-xs text-gray-400",children:(0,n.jsx)(m.default,{namespace:"authentication",i18nKey:"login.forgotPassword"})})}),D&&(0,n.jsx)("p",{className:"mt-4 text-base text-red-600",children:D}),(0,n.jsx)(y.Z,{label:L?F:Y,isDisabled:R||L,onClick:!L&&O})]})]})]})}},47018:function(e,t,s){"use strict";s.d(t,{Z:function(){return l}});var n=s(94236),r=s(41860),i=s(22118);function l(){return(0,n.jsxs)("div",{className:"flex h-full flex-col items-center justify-center p-8",children:[(0,n.jsx)("div",{className:"w-1/5",children:(0,n.jsx)(r.default,{src:"/logo.svg",width:"39",height:"24",priority:!0,alt:"Logo",sizes:"100vw",style:{width:"100%",height:"auto"}})}),(0,n.jsx)("p",{className:"my-8 text-lg",children:(0,n.jsx)(i.default,{namespace:"common",i18nKey:"loading"})})]})}},4778:function(e,t,s){"use strict";s.d(t,{Mi:function(){return o},PK:function(){return m},dO:function(){return u}});var n=s(94236),r=s(79094),i=s(2221),l=s(92464),a=s(22118);let c=e=>{let{className:t,children:s}=e;return(0,n.jsx)("div",{className:(0,l.cn)("text-pretty text-sm md:max-w-sm md:text-base",t),children:s})},o=e=>{let{children:t}=e;return(0,n.jsx)("p",{className:"font-semibold",children:t})},d=e=>{let{children:t}=e;return(0,n.jsx)("p",{className:"font-medium md:pb-1",children:t})},u=e=>{let{title:t,detail:s,children:i}=e;return(0,n.jsxs)(c,{className:"flex items-center gap-x-4 text-blue-600",children:[(0,n.jsx)(r.Z,{size:32,className:"h-[24px] w-[24px] shrink-0 text-blue-500 md:h-[32px] md:w-[32px]"}),(0,n.jsx)("div",{children:null!=i?i:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o,{children:t}),s&&(0,n.jsx)(d,{children:s})]})})]})},m=e=>{let{title:t,detail:s,includeSupportLink:r=!1,children:l}=e,u=!!s,m=!!r,x=u||m,h=null==s?void 0:s.endsWith(".");return(0,n.jsxs)(c,{className:"flex items-center gap-x-4",children:[(0,n.jsx)(i.Z,{size:32,className:"h-[24px] w-[24px] shrink-0 text-red-500 md:h-[32px] md:w-[32px]"}),(0,n.jsx)("div",{children:null!=l?l:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o,{children:t}),x&&(0,n.jsxs)(d,{children:[u&&s,u&&m&&!h&&". ",m&&(0,n.jsx)(a.default,{namespace:"errors",i18nKey:"supportLink",components:{email:(0,n.jsx)("a",{className:"underline",href:"mailto:support@tarteel.ai"})}})]})]})})]})}},73858:function(e,t,s){"use strict";var n,r,i,l;s.d(t,{$:function(){return n},b:function(){return r}}),(i=n||(n={})).LOADING="loading",i.AUTHENTICATED="authenticated",i.UNAUTHENTICATED="unauthenticated",(l=r||(r={})).RC_PROMO_PREMIUM_DAILY="Premium: Daily Promo",l.TARTEEL_9999_1Y_1M0="Premium: Yearly Subscription",l.PROD_KUCIQOLAAAMEY9="Premium: Yearly Subscription",l.PROD_KCETDL88PXLHBS="Premium: Yearly Subscription (Test)",l.TARTEEL_999_1M_1M0="Premium: Monthly Subscription",l.PROD_KUCJUULJWNU8ES="Premium: Monthly Subscription",l.PROD_K9LY1DFIEXNZJA="Premium: Monthly Subscription (Test)",l.TARTEEL_29999_LIFETIME="Premium: Lifetime Subscription",l.PROD_PM6RGFQD27H6YH="Family Plan"}},function(e){e.O(0,[3037,8400,1422,145,1175,4970,7603,6646,5259,5126,2620,242,1744],function(){return e(e.s=71744)}),_N_E=e.O()}]);