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]="6ca8da24-3512-690d-2acc-103fae77e87a")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,139758,597515,e=>{"use strict";var t=e.i(991865),r=e.i(120786),s=e.i(92808),a=e.i(651682),n=e.i(513935),i=e.i(843476),l=e.i(522016),o=e.i(653145),c=e.i(700224),u=e.i(555897),d=e.i(286179),h=e.i(499141),m=e.i(718720),f=e.i(271645),p=e.i(639372),g=e.i(672464),v=e.i(948148),x=e.i(618566),b=e.i(17701),w=e.i(35249);e.i(623854);var j=e.i(128769),N=e.i(413569);function _(e){var t=e.className,r=e.delayMs;return(0,i.jsx)("div",{className:(0,j.cn)("auth-skeleton",t),style:{"--shimmer-delay":"".concat(void 0===r?0:r,"ms")}})}function S(e){var t=e.showSignup,r=e.checkingLabel,s=e.active;return(0,i.jsxs)("div",{"aria-busy":s||void 0,children:[s?(0,i.jsx)("p",{className:"sr-only",children:r}):null,(0,i.jsxs)("div",{"aria-hidden":"true",children:[(0,i.jsx)("div",{className:"flex justify-center py-4",children:(0,i.jsx)(_,{className:"h-8 w-56 rounded-lg sm:w-72"})}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(_,{className:"mt-1 h-10 rounded-md",delayMs:80}),(0,i.jsx)(_,{className:"mt-1 h-10 rounded-md",delayMs:140}),(0,i.jsx)(_,{className:"h-10 rounded-lg",delayMs:200}),(0,i.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,i.jsx)(_,{className:"h-10 rounded-lg",delayMs:260}),(0,i.jsx)(_,{className:"h-10 rounded-lg",delayMs:300})]})]}),t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,i.jsx)("div",{className:"h-px flex-1 bg-slate-300 dark:bg-white/20"}),(0,i.jsx)(_,{className:"h-3 w-24 rounded-full",delayMs:340}),(0,i.jsx)("div",{className:"h-px flex-1 bg-slate-300 dark:bg-white/20"})]}),(0,i.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,i.jsx)(_,{className:"h-16 rounded-lg",delayMs:380}),(0,i.jsx)(_,{className:"h-16 rounded-lg",delayMs:420}),(0,i.jsx)(_,{className:"h-16 rounded-lg",delayMs:460})]}),(0,i.jsxs)("div",{className:"border-border-strong/70 -mx-4 mt-4 -mb-4 border-t bg-slate-200/55 p-4 dark:border-white/15 dark:bg-black/20",children:[(0,i.jsx)("div",{className:"flex justify-center pb-4",children:(0,i.jsx)(_,{className:"h-5 w-40 rounded-md",delayMs:500})}),(0,i.jsx)(_,{className:"h-10 rounded-lg",delayMs:540})]})]}):null]})]})}var y=e.i(738995),k=e.i(301030);e.s(["AUTH_FRAME_ENTER_MS",0,320,"default",0,function(e){var t=e.children,r=e.className,s=e.innerClassName;return(0,i.jsx)("div",{className:(0,j.cn)("animate-in fade-in-0 zoom-in-95 motion-reduce:animate-none","[animation-duration:320ms] [animation-timing-function:cubic-bezier(0.22,1,0.36,1)]","p-px shadow-elevation-2","bg-[linear-gradient(165deg,rgba(255,255,255,0.72)_0%,rgba(255,255,255,0.18)_36%,rgba(15,23,42,0.12)_100%)]","dark:bg-[linear-gradient(165deg,rgba(255,255,255,0.28)_0%,rgba(255,255,255,0.08)_40%,rgba(0,0,0,0.45)_100%)]",r),children:(0,i.jsxs)("div",{className:(0,j.cn)("bg-surface-raised relative isolate overflow-hidden px-4 pb-4",s),children:[(0,i.jsxs)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 z-0 h-8 overflow-hidden rounded-t-[inherit]",children:[(0,i.jsx)("div",{className:"absolute inset-x-0 top-0 h-8 bg-gradient-to-b from-white/14 to-transparent dark:from-white/[0.07]"}),(0,i.jsx)("div",{className:"absolute inset-x-8 top-0 h-px bg-linear-to-r from-transparent via-white/70 to-transparent dark:via-white/20"})]}),(0,i.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-20 overflow-hidden rounded-[inherit]",children:(0,i.jsx)("div",{className:"auth-frame-sheen absolute -inset-[40%] bg-[linear-gradient(125deg,transparent_38%,rgba(255,255,255,0.34)_50%,transparent_62%)] dark:bg-[linear-gradient(125deg,transparent_38%,rgba(255,255,255,0.2)_50%,transparent_62%)]"})}),(0,i.jsx)("div",{className:"relative z-10",children:t})]})})}],597515);var A=e.i(682336),I=e.i(412290),M=e.i(398486),C=e.i(160034),E=e.i(857652),L=e.i(494946),P=function(e,t){if(!e)return{};switch(e.code){case"auth/too-many-requests":return{password:t("too_many_attempts_error")};case"auth/wrong-password":return{password:t("password_incorrect_error")};case"auth/invalid-email":return{email:t("invalid_email_error")};case"auth/user-disabled":case"auth/user-not-found":return{email:t("user_not_found_or_disabled_error")};default:return{}}};function T(){return function(){}}function U(e){var t=e.index,r=e.children,s=e.className;return(0,i.jsx)("div",{className:(0,j.cn)("auth-form-row",s),style:{animationDelay:"".concat(45*t,"ms")},children:r})}e.s(["default",0,function(e){var _=e.onSuccessfulLogin,Z=e.redirectQueryOverride,R=(0,a._)((0,f.useState)(!1),2),F=R[0],O=R[1],z=(0,a._)((0,f.useState)(!1),2),W=z[0],D=z[1],q=(0,a._)((0,f.useState)(null),2),G=q[0],B=q[1],V=(0,w.useAuth)().login,H=(0,g.useAtomValue)(I.authStateAtom),Q=(0,p.getDefaultStore)(),K=(0,o.useForm)(),J=K.register,$=K.handleSubmit,X=K.setFocus,Y=(0,x.useSearchParams)(),ee=(0,v.useTranslations)("auth"),et=(0,v.useTranslations)("common"),er=(0,f.useContext)(A.ScopeContext).title||"Sporfie",es=(0,g.useAtomValue)(I.authErrorAtom),ea=P(es,ee),en=!!(es&&!ea.email&&!ea.password),ei=(0,f.useSyncExternalStore)(T,function(){return!0},function(){return!1})?H:M.AuthState.initial,el=ei===M.AuthState.initial||ei===M.AuthState.checkingAuthStatus;(0,f.useEffect)(function(){B((0,L.getLastLoginMethod)())},[]),(0,f.useEffect)(function(){var e=window.setTimeout(function(){D(!0)},1320);return function(){return window.clearTimeout(e)}},[]),(0,f.useEffect)(function(){W&&X("email")},[W,X]);var eo=(0,f.useMemo)(function(){return Z||(null==Y?void 0:Y.get("redirect"))||void 0},[Z,Y]),ec=(null==Y?void 0:Y.get("ref"))||void 0,eu=(0,E.getTvPlatformFromSearchParams)(Y),ed=(0,E.isSignupDisabled)(Y),eh=function(e){var t=new URLSearchParams;eo&&t.set("redirect",eo),eu&&t.set("platform",eu),ec&&t.set("ref",ec);var r=t.toString();return r?"".concat(e,"?").concat(r):e},em=eh("/auth/register"),ef=eh("/auth/password-reset"),ep=eh("/auth/passwordless-login"),eg=0,ev=function(){return eg++};return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{className:(0,j.cn)("absolute inset-0 z-10",!el&&"hidden"),"aria-hidden":!el,children:(0,i.jsx)(S,{showSignup:!ed,checkingLabel:ee("checking_status"),active:el})}),(0,i.jsxs)("div",{"data-auth-ready":el?"false":"true",className:(0,j.cn)(el&&"invisible"),inert:el||void 0,children:[(0,i.jsx)(U,{index:ev(),children:(0,i.jsx)("div",{className:"prose prose-slate py-4 text-center",children:(0,i.jsx)("h2",{className:"dark:text-slate-50",children:ee("login_title",{scope:er})})})}),(0,i.jsxs)("form",{onSubmit:$(function(e){return(0,t._)(function(){return(0,n._)(this,function(t){switch(t.label){case 0:return[4,V(e.email,e.password)];case 1:return t.sent(),Q.get(I.authStateAtom)===M.AuthState.signedIn&&((0,L.setLastLoginMethod)("password"),B("password"),null==_||_()),[2]}})})()}),className:"space-y-2",inert:el||!W||void 0,children:[(0,i.jsxs)(U,{index:ev(),children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("input",(0,s._)((0,r._)({type:"email","data-testid":C.TEST_ID.AUTH_LOGIN_EMAIL_INPUT,className:(0,j.cn)("form-input",ea.email&&"form-input--error"),placeholder:et("labels.email")},J("email",{pattern:/^[^@]+@[^@]+$/i})),{autoComplete:W?"email":"off",readOnly:!W,tabIndex:W?void 0:-1})),(0,i.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:ea.email&&(0,i.jsx)(c.WarningCircleIcon,{className:"pointer-events-none h-5 w-5 text-red-500","aria-hidden":"true"})})]}),ea.email&&(0,i.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"password-error",children:ea.email})]}),(0,i.jsxs)(U,{index:ev(),children:[(0,i.jsx)("div",{className:"relative flex items-center",children:(0,i.jsxs)("div",{className:"relative flex-1",children:[(0,i.jsx)("input",(0,r._)({type:F?"text":"password",autoComplete:"current-password","data-testid":C.TEST_ID.AUTH_LOGIN_PASSWORD_INPUT,className:(0,j.cn)("form-input",ea.password&&"form-input--error"),placeholder:et("labels.password")},J("password"))),(0,i.jsxs)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:[(0,i.jsx)("button",{onClick:function(){return O(!F)},type:"button",className:"ml-2 p-1",children:F?(0,i.jsx)(d.EyeSlashIcon,{className:"h-4 w-4"}):(0,i.jsx)(u.EyeIcon,{className:"h-4 w-4"})}),ea.password&&(0,i.jsx)(c.WarningCircleIcon,{className:"pointer-events-none h-5 w-5 text-red-500","aria-hidden":"true"})]})]})}),ea.password&&(0,i.jsx)("p",{className:"mt-2 text-sm text-red-600",id:"password-error",children:ea.password})]}),en?(0,i.jsx)(U,{index:ev(),children:(0,i.jsx)(k.default,{title:ee("login_error_title"),error:es,className:"mt-2"})}):null,(0,i.jsxs)(U,{index:ev(),className:"relative",children:["password"===G?(0,i.jsx)(y.default,{}):null,(0,i.jsxs)("button",{type:"submit","data-testid":C.TEST_ID.AUTH_LOGIN_SUBMIT_BUTTON,disabled:ei!==M.AuthState.initial&&ei!==M.AuthState.signedOut,className:"btn btn--block btn--primary",children:[(0,i.jsx)(h.LockIcon,{className:"mr-3 -ml-1 h-5 w-5","aria-hidden":"true"}),function(e,t){switch(e){case M.AuthState.fetchingUserProfile:case M.AuthState.fetchingIdToken:return t("retrieving_user_profile");case M.AuthState.signedIn:return t("signed_in");case M.AuthState.signingIn:return t("signing_in");default:return t("log_in")}}(ei,ee)]})]}),(0,i.jsxs)(U,{index:ev(),className:"grid gap-2 sm:grid-cols-2",children:[(0,i.jsx)("div",{children:(0,i.jsx)(l.default,{href:ef,className:"btn btn--sm btn--block whitespace-nowrap dark:bg-slate-900 dark:text-white",children:ee("reset_password_title")})}),(0,i.jsxs)("div",{className:"relative min-w-0",children:["passwordless"===G?(0,i.jsx)(y.default,{}):null,(0,i.jsxs)(l.default,{href:ep,className:"btn btn--block bg-slate-200 whitespace-nowrap dark:bg-white/30 dark:text-white",children:[(0,i.jsx)(m.EnvelopeIcon,{className:"mr-2 -ml-1 h-4 w-4 shrink-0","aria-hidden":"true"}),(0,i.jsx)("span",{className:"whitespace-nowrap",children:ee("passwordless_login")})]})]})]})]}),!ed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U,{index:ev(),children:(0,i.jsx)(b.default,{className:"my-4",text:ee("or_log_in_with")})}),(0,i.jsx)(U,{index:ev(),children:(0,i.jsx)(N.default,{mode:"LOGIN",showErrorAlert:!1,onSuccessfulLogin:_})})]}),!ed&&(0,i.jsxs)(U,{index:ev(),className:"border-border-strong/70 -mx-4 mt-4 -mb-4 border-t bg-slate-200/55 p-4 dark:border-white/15 dark:bg-black/20",children:[(0,i.jsx)("div",{children:(0,i.jsx)("h3",{className:"pb-4 text-center font-bold",children:ee("no_account_title")})}),(0,i.jsx)(l.default,{href:em,className:"btn btn--block dark:bg-white/20 dark:text-white",children:ee("sign_up_title")})]})]})]})}],139758)},611365,428401,e=>{"use strict";var t=e.i(396538);e.s(["GoogleAuthProvider",()=>t.X],611365),e.s(["signInWithPopup",()=>t.c],428401)},477566,e=>{"use strict";var t=e.i(396538);e.s(["signInWithEmailAndPassword",()=>t.ab])},700224,e=>{"use strict";var t=e.i(120786),r=e.i(92808),s=e.i(271645),a=e.i(769464),n=new Map([["bold",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",s.createElement(s.Fragment,null,s.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",s.createElement(s.Fragment,null,s.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),i=s.forwardRef(function(e,i){return s.createElement(a.default,(0,r._)((0,t._)({ref:i},e),{weights:n}))});i.displayName="WarningCircleIcon",e.s(["WarningCircleIcon",0,i],700224)},297562,244933,54067,584702,673964,e=>{"use strict";var t=e.i(843476);e.s(["default",0,function(e){var r=e.className;return(0,t.jsx)("svg",{className:r,version:"1.1",viewBox:"0 0 1024 1024",children:(0,t.jsx)("g",{children:(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{clipRule:"evenodd",fill:"currentColor",d:"M901.285,348.137C743.548,447.423,758.485,674.191,929,751.812c-5.608,14.846-10.838,29.97-16.978,44.717c-25.439,61.099-61.176,115.913-103.757,166.259 c-23.68,27.997-51.368,50.852-89.077,57.357c-28.846,4.97
27-56.276-0.616-83.222-11.277c-22.031-8.716-44.07-18.454-67.035-23.539c-39.511-8.751-78.309-2.984-116.102,12.019c-23.737,9.424-48.049,18.04-72.825,24.049c-30.153,7.31-58.873-1.161-82.04-20.544c-22.479-18.806-43.76-39.819-62.113-62.641c-73.223-91.051-117.941-195.095-134.846-310.656c-11.528-78.798-8.549-156.85,27.495-229.575c46.455-93.736,121.71-145.898,228.213-147.828c28.41-0.513,54.986,9.275,81.271,19.128c18.652,6.992,37.232,14.197,56.042,20.735c16.446,5.715,33.151,5.738,49.643-0.292c26.98-9.868,53.831-20.101,80.917-29.67c95.157-33.624,210.581-0.684,269.547,77.972C896.604,341.32,898.895,344.749,901.285,348.137z",fillRule:"evenodd"}),(0,t.jsx)("path",{clipRule:"evenodd",fill:"currentColor",d:"M511.399,237.306c-3.656-25.967-1.37-49.134,5.836-71.504C545.589,77.778,604.962,23.071,695.231,2.466c21.5-4.908,21.935-4.113,21.912,17.66c-0.105,97.149-72.172,191.02-163.462,212.074C540.142,235.322,525.952,235.623,511.399,237.306z",fillRule:"evenodd"})]})})})}],297562);var r=e.i(396538);e.s(["FacebookAuthProvider",()=>r.W],244933),e.s(["fetchSignInMethodsForEmail",()=>r.af],54067),e.s(["linkWithPopup",()=>r.d],584702),e.s(["OAuthProvider",()=>r.Z],673964)},489712,e=>{"use strict";var t=e.i(843476);e.s(["default",0,function(e){var r=e.className;return(0,t.jsx)("svg",{className:r,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsxs)("g",{fill:"#000",fillRule:"evenodd",children:[(0,t.jsx)("path",{d:"M9 3.48c1.69 0 2.83.73 3.48 1.34l2.54-2.48C13.46.89 11.43 0 9 0 5.48 0 2.44 2.02.96 4.96l2.91 2.26C4.6 5.05 6.62 3.48 9 3.48z",fill:"#EA4335"}),(0,t.jsx)("path",{d:"M17.64 9.2c0-.74-.06-1.28-.19-1.84H9v3.34h4.96c-.1.83-.64 2.08-1.84 2.92l2.84 2.2c1.7-1.57 2.68-3.88 2.68-6.62z",fill:"#4285F4"}),(0,t.jsx)("path",{d:"M3.88 10.78A5.54 5.54 0 0 1 3.58 9c0-.62.11-1.22.29-1.78L.96 4.96A9.008 9.008 0 0 0 0 9c0 1.45.35 2.82.96 4.04l2.92-2.26z",fill:"#FBBC05"}),(0,t.jsx)("path",{d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.84-2.2c-.76.53-1.78.9-3.12.9-2.38 0-4.4-1.57-5.12-3.74L.97 13.04C2.45 15.98 5.48 18 9 18z",fill:"#34A853"}),(0,t.jsx)("path",{fill:"none",d:"M0 0h18v18H0z"})]})})}])},413569,738995,e=>{"use strict";var t=e.i(991865),r=e.i(651682),s=e.i(513935),a=e.i(843476),n=e.i(420953),i=e.i(297562),l=e.i(489712);e.i(151718);var o=e.i(244933),c=e.i(54067),u=e.i(611365),d=e.i(584702),h=e.i(673964),m=e.i(428401),f=e.i(916774),p=e.i(657642),g=e.i(35249),v=e.i(807578),x=e.i(271645),b=e.i(639372),w=e.i(301030),j=e.i(120786),N=e.i(330056);e.i(623854);var _=e.i(128769),S=e.i(700224),y=e.i(555897),k=e.i(286179),A=e.i(653145),I=e.i(477566),M=e.i(948148);let C=function(e){var n=(0,r._)((0,x.useState)(!1),2),i=n[0],l=n[1],o=(0,r._)((0,x.useState)(),2),c=o[0],u=o[1],d=(0,A.useForm)(),h=d.register,m=d.handleSubmit,p=d.formState.errors,g=(0,M.useTranslations)("auth"),v=(0,M.useTranslations)("common");return(0,a.jsxs)(N.default,{isOpen:e.isOpen,onClose:e.onClose,children:[(0,a.jsx)(N.ModalTitle,{children:g("enter_password_title")}),(0,a.jsx)("p",{children:g("link_existing_account_description")}),(0,a.jsxs)("form",{onSubmit:m(function(r){return(0,t._)(function(){var t;return(0,s._)(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,I.signInWithEmailAndPassword)(f.auth,e.email,r.password)];case 1:return(t=s.sent()).user&&(e.onSuccessfulLogin(t.user),e.onClose()),[3,3];case 2:return u(s.sent()),[3,3];case 3:return[2]}})})()}),children:[c&&(0,a.jsx)(w.default,{title:g("login_error_title"),error:c,className:"mb-4"}),(0,a.jsx)("input",{type:"text",className:"form-input",disabled:!0,defaultValue:e.email}),(0,a.jsx)("div",{className:"relative flex items-center",children:(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("input",(0,j._)({type:i?"text":"password",className:(0,_.cn)("form-input",p.password&&"form-input--error"),placeholder:v("labels.password")},h("password"))),(0,a.jsxs)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:[(0,a.jsx)("button",{onClick:function(){return l(!i)},type:"button",className:"ml-2 p-1",children:i?(0,a.jsx)(k.EyeSlashIcon,{className:"h-4 w-4"}):(0,a.jsx)(y.EyeIcon,{className:"h-4 w-4"})}),p.password&&(0,a.jsx)(S.WarningCircleIcon,{className:"pointer-events-none h-5 w-5 text-red-500","aria-hidden":"true"})]})]})}),(0,a.jsx)(N.ModalActions,{onCancel:e.onClose})]})]})};function E(e){var t=e.className,r=(0,M.useTranslations)("auth");return(0,a.jsx)("span",{className:(0,_.cn)("pointer-events-none absolute -top-2 right-1.5 z-10 rounded-full","bg-slate-900 px-1.5 py-0.5 text-[10px] font-semibold tracking-wide","text-white uppercase shadow-sm dark:bg-white dark:text-slate-950",t),children:r("last_used")})}e.s(["default",0,E],738995);var L=e.i(412290),P=e.i(398486),T=e.i(494946),U=new Set(["auth/popup-closed-by-user","auth/cancelled-popup-request"]),Z=function(e){var t;switch(e){case"facebook.com":(t=new o.FacebookAuthProvider).addScope("email");break;case"apple.com":(t=new h.OAuthProvider("apple.com")).addScope("email"),t.addScope("name");break;case"google.com":(t=new u.GoogleAuthProvider).addScope("email");break;default:return console.error("Unsupported provider ".concat(e))}return t};
2e.s(["default",0,function(e){var o,u=(0,g.useAuth)().checkAuthStatus,h=(0,b.getDefaultStore)(),j=(0,r._)((0,x.useState)(null),2),N=j[0],S=j[1],y=(0,r._)((0,x.useState)(!1),2),k=y[0],A=y[1],I=(0,r._)((0,x.useState)(""),2),R=I[0],F=I[1],O=(0,r._)((0,x.useState)(),2),z=O[0],W=O[1],D=(0,r._)((0,x.useState)(null),2),q=D[0],G=D[1],B=null==(o=e.showErrorAlert)||o,V=(0,M.useTranslations)("auth"),H="LOGIN"===e.mode?"logging in":"signing up";(0,x.useEffect)(function(){G((0,T.getLastLoginMethod)())},[]);var Q=function(){e.onSuccessfulLogin&&h.get(L.authStateAtom)===P.AuthState.signedIn&&e.onSuccessfulLogin()},K=function(e){(0,T.setLastLoginMethod)(e),G(e)},J=function(e,r,a){return(0,t._)(function(){var t,n,i,l,o;return(0,s._)(this,function(s){switch(s.label){case 0:return[4,r.getIdToken()];case 1:if(n=s.sent(),(0,v.setAuthToken)(n),(i=(0,p.getPendingReferralCode)())&&(0,p.attributeReferral)(i).catch(function(){}),!(l=null==(t=r.providerData[0])?void 0:t.email))return[3,5];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,(0,f.updateUserProfile)(r.uid,{email:l})];case 3:return s.sent(),[3,5];case 4:return o=s.sent(),B&&S(o),[3,5];case 5:return K(e),[4,u()];case 6:return s.sent(),(null==a?void 0:a.suppressSuccessCallback)||Q(),[2]}})})()},$=function(e,r){return(0,t._)(function(){var t,a,n,i;return(0,s._)(this,function(s){switch(s.label){case 0:if(!(t=Z(e)))return[2];S(null),s.label=1;case 1:return s.trys.push([1,4,,14]),[4,(0,m.signInWithPopup)(f.auth,t)];case 2:return[4,J(e,s.sent().user,r)];case 3:return s.sent(),[3,14];case 4:if((null==(a=s.sent())?void 0:a.code)!=="auth/account-exists-with-different-credential")return[3,11];return n=a.customData.email,[4,(0,c.fetchSignInMethodsForEmail)(f.auth,n)];case 5:if("password"!==(i=s.sent()[0]))return[3,6];return A(!0),F(n),W(t),[3,10];case 6:return[4,$(i,{suppressSuccessCallback:!0})];case 7:return s.sent(),[4,(0,d.linkWithPopup)(f.auth.currentUser,t).catch(function(e){console.log("error while linking",e)})];case 8:return s.sent(),K(e),[4,u()];case 9:s.sent(),Q(),s.label=10;case 10:case 14:return[2];case 11:if(!function(e,t){if(!t)return!1;var r=null==e?void 0:e.code;return"string"==typeof r&&U.has(r)}(a,f.auth.currentUser))return[3,13];return[4,J(e,f.auth.currentUser,r)];case 12:return s.sent(),[2];case 13:if((null==a?void 0:a.code)==="auth/popup-closed-by-user")return[2];return console.error("Error while ".concat(H," with provider ").concat(e),a),[3,14]}})})()},X=[{id:"facebook.com",label:V("provider_facebook"),icon:(0,a.jsx)(n.default,{className:"size-5 shrink-0","aria-hidden":"true"}),className:"border-transparent bg-[#4460aa] text-white hover:bg-[#4460aa]/90"},{id:"apple.com",label:V("provider_apple"),icon:(0,a.jsx)(i.default,{className:"size-5 shrink-0","aria-hidden":"true"}),className:"border-transparent bg-black text-white hover:bg-black/90"},{id:"google.com",label:V("provider_google"),icon:(0,a.jsx)(l.default,{className:"size-5 shrink-0","aria-hidden":"true"}),className:"border-slate-900 bg-white text-black hover:bg-white/90"}];return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2",children:X.map(function(e){return(0,a.jsxs)("button",{type:"button",className:(0,_.cn)("btn relative flex h-auto! w-full flex-col items-center justify-center gap-1.5 px-2 py-3 text-xs font-semibold sm:text-sm",e.className),onClick:function(){return $(e.id)},children:[q===e.id?(0,a.jsx)(E,{}):null,e.icon,(0,a.jsx)("span",{className:"leading-none",children:e.label})]},e.id)})}),B&&N?(0,a.jsx)(w.default,{title:V("LOGIN"===e.mode?"login_error_title":"sign_up_error_title"),error:N}):null,(0,a.jsx)(C,{isOpen:k,email:R,onSuccessfulLogin:function(e){return(0,t._)(function(){return(0,s._)(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),console.log("should link",z,"for",e),[4,(0,d.linkWithPopup)(e,z).catch(function(e){console.log("error while linking",e)})];case 1:return t.sent(),(0,T.setLastLoginMethod)("password"),G("password"),[4,u()];case 2:return t.sent(),Q(),[3,4];case 3:return console.error(t.sent()),[3,4];case 4:return[2]}})})()},onClose:function(){return A(!1)}})]})},"getAuthProvider",0,Z],413569)},17701,e=>{"use strict";var t=e.i(843476);e.i(623854);var r=e.i(128769),s=e.i(471394);e.s(["default",0,function(e){var a=e.text,n=e.className,i=(0,s.default)("common").t;return(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center gap-3",n),role:"separator","aria-label":a||i("labels.or"),children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"h-px flex-1 bg-gradient-to-r from-transparent to-slate-300 dark:to-white/30"}),(0,t.jsx)("span",{className:"text-subtle shrink-0 text-xs tracking-wide uppercase",children:a||i("labels.or")}),(0,t.jsx)("div",{"aria-hidden":"true",className:"h-px flex-1 bg-gradient-to-r from-slate-300 to-transparent dark:from-white/30"})]})}])},494946,e=>{"use strict";var t="sporfie:last-login-method",r=new Set(["password","passwordless","facebook.com","apple.com","google.com"]);e.s(["getLastLoginMethod",0,function(){try{var e=window.localStorage.getItem(t);if(!e)return null;var s=JSON.parse(e);return"string"==typeof s&&r.has(s)?s:null}catch(e){return null}},"setLastLoginMethod",0,function(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch(e){}}])},857652,e=>{"use strict";function t(e){return"appletv"===e||"firetv"===e?e:void 0}function r(e){return t(null==e?void 0:e.get("platform"))}e.s(["getTvPlatformFromSearchParams",0,r,"isSignupDisabled",0,function(e){return void 0!==r(e)},"parseTvPlatform",0,t])},916774,e=>{"use strict";var t=e.i(233027),r=e.i(103026);e.i(151718);var s=e.i(963433),a=e.i(427945);e.i(685661);var n=(0,s.getAuth)(r.default);e.s(["MIN_PASSWORD_LENGTH",0,8,"auth",0,n,"requestPasswordResetLink",0,function(e){return a.default.post("/reset-password-request/",e)},"requestPasswordlessLoginLink",0,function(e){return a.unauthenticatedClient.post("v3/passwordless-authentication-requests/",e)},"setPassword",0,function(e){var r=e.userId,s=(0,t._)(e,["userId"]);return a.default.post("/reset-password/".concat(r),s)},"signupWithEmailPassword",0,function(e){return a.default.post("/user-creation",e)},"updateUserProfile",0,function(e,t){return a.default.put("/users/".concat(e),t)},"validateSporfieToken",0,function(e){return a.default.post("/sporfie-token-validation-requests/",e)}])},657642,e=>{"use strict";var t=e.i(991865),r=e.i(500075),s=e.i(513935),a=e.i(954616),n=e.i(266027),i=e.i(912598),l=e.i(601611),o=e.i(46121),c=e.i(427945),u=e.i(121366),d=function(e){return["user-referrals",e]},h=function(e){return e?Array.isArray(e)?e:Object.values(e):[]},m=function(e,t){if(t)return t;var r=window.location.origin||l.APP_URL||"";return r&&e?"".concat(r.replace(/\/$/,""),"/auth/register?ref=").concat(encodeURIComponent(e)):""},f=function(e){var t,r=null!=(t=null==e?void 0:e.code)?t:"";
2return{code:r,shareUrl:m(r,(null==e?void 0:e.shareUrl)||(null==e?void 0:e.shareURL)),invites:h(null==e?void 0:e.invites),referees:h(null==e?void 0:e.referees)}},p=function(){return(0,t._)(function(){return(0,s._)(this,function(e){switch(e.label){case 0:return[4,(0,u.localFetcher)("/user/referrals")];case 1:return[2,f(e.sent())]}})})()},g=function(e){return(0,t._)(function(){var t;return(0,s._)(this,function(s){switch(s.label){case 0:return[4,c.localClient.post("/user/referrals/invites",{emails:e})];case 1:if(!(null==(t=s.sent())?void 0:t.data)||"object"!==(0,r._)(t.data)||!t.data.code&&!t.data.invites&&!t.data.referees)return[2,void 0];return[2,f(t.data)]}})})()};e.s(["attributeReferral",0,function(e){return c.localClient.post("/user/referrals/attribute",{referralCode:e})},"getPendingReferralCode",0,function(e){var t,r,s=null==e||null==(t=e.get("ref"))?void 0:t.trim();return s||(null==(r=new URLSearchParams(window.location.search).get("ref"))?void 0:r.trim())||void 0},"useSendReferralInvites",0,function(){var e=(0,i.useQueryClient)(),t=(0,o.default)().user;return(0,a.useMutation)({mutationFn:g,onSuccess:function(r){(null==r?void 0:r.code)&&e.setQueryData(d(null==t?void 0:t.uid),r),e.invalidateQueries({queryKey:d(null==t?void 0:t.uid)})}})},"useUserReferrals",0,function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,o.default)(),r=t.didCheckAuthStatus,s=t.isLoggedIn,a=t.user;return(0,n.useQuery)({queryKey:d(null==a?void 0:a.uid),queryFn:p,enabled:e&&r&&s,retry:!1})}])}]); 3 4//# debugId=6ca8da24-3512-690d-2acc-103fae77e87a
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.