1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4597],{74597:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(79490),r=a(77066),l=a(39162),n=a(34600),i=a(74914),o=a(61837),d=a(87345),c=a(43352),u=a(87929);let m=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,p=/^\d{6}$/,h="w-full px-3 py-2 rounded-lg border border-brand-input-border font-noto text-sm placeholder:text-brand-text-light focus:outline-none focus:border-coral transition-colors disabled:bg-[#F4F4F4] disabled:cursor-not-allowed";function x(e){return e.trim().toLowerCase()}function f(e){return m.test(x(e))}function b(e){let{open:t,onSkip:a,onSuccess:m,onManualLoginRequired:b}=e,v=(0,l.c)("student.bindEmailPrompt"),{rotatePasswordSession:w,refreshAuthState:g}=(0,c.As)(),[y,j]=(0,r.useState)(""),[k,N]=(0,r.useState)(null),[C,E]=(0,r.useState)(""),[F,S]=(0,r.useState)(""),[L,A]=(0,r.useState)(!1),[P,_]=(0,r.useState)(0),[M,q]=(0,r.useState)("idle"),[R,D]=(0,r.useState)(null),[O,B]=(0,r.useState)(null),[I,U]=(0,r.useState)(null),$=(0,r.useRef)(!1),z="idle"!==M,H="verifying-email"===M||"rotating-session"===M,J=P>0,T=x(y),V=(0,i.Oj)(F).isValid,W=f(y)&&0===P&&!z;(0,r.useEffect)(()=>{if(!J)return;let e=window.setInterval(()=>{_(e=>Math.max(0,e-1))},1e3);return()=>window.clearInterval(e)},[J]);let Y=()=>{D(null),B(null),U(null)},Z=async()=>{if(!$.current&&W){$.current=!0,q("sending-code"),Y();try{if(k===T)await n.apiClient.post("/api/v1/auth/resend-email-change-code",{new_email:T});else{let e=await n.apiClient.post("/api/v1/auth/change-email",{new_email:T,current_password:""});if(e.data&&!1===e.data.success)throw Error("send-failed")}N(T),_(60)}catch(e){D(/already in use/i.test(function(e){var t,a;let s=null==e||null==(a=e.response)||null==(t=a.data)?void 0:t.message;return"string"==typeof s?s:""}(e))?v("emailAlreadyRegistered"):v("sendFailed"))}finally{$.current=!1,q("idle")}}},G=async()=>{var e,t;return x(null!=(t=null==(e=(await n.authClient.getCurrentUser({bustCache:!0})).user)?void 0:e.email)?t:"")===k},K=async()=>{q("rotating-session");let e=await w({email:T,newPassword:F});if(e.ok){await g({bustCache:!0}),m();return}e.requiresManualLogin&&b()},Q=async()=>{if(!$.current&&!z&&!(()=>{let e=f(y)?null:v("invalidEmail"),t=C.trim()&&p.test(C)?null:v("codeRequired"),a=F.trim()?V?null:v("passwordInvalid"):v("passwordRequired");return D(e),B(t),U(a),!!(e||t||a)})()){$.current=!0,Y();try{if(!L){q("verifying-email");try{let e=await n.apiClient.post("/api/v1/auth/verify-email-change",{verification_code:C});if(e.data&&!1===e.data.success)throw Object.assign(Error("verify-failed"),{response:{status:400}});A(!0)}catch(e){if((0,u.J)(e))return void B(v("verifyFailed"));try{if(!await G())return void B(v("verifyFailed"));A(!0)}catch(e){B(v("verifyFailed"));return}}}await K()}catch(e){if((0,u.J)(e))return void U(v("passwordFailed"));U(v("passwordFailed"))}finally{$.current=!1,q("idle")}}};return(0,s.jsx)(o.vL,{open:t,title:v("title"),size:"medium",centered:!0,footer:null,fitMobileStudentChrome:!0,closable:!z,maskClosable:!z,keyboard:!z,onClose:z?void 0:a,children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(o.EY,{variant:"small",className:"text-brand-text-muted",children:v("description")}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"bind-email-prompt-email",className:"mb-1.5 block text-sm font-noto text-brand-text-dark",children:v("emailLabel")}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start",children:[(0,s.jsx)("input",{id:"bind-email-prompt-email",type:"email",autoComplete:"email",value:y,disabled:z,placeholder:v("emailPlaceholder"),className:h,onChange:e=>{j(e.target.value),N(null),E(""),A(!1),_(0),Y()}}),(0,s.jsx)(o.qg,{type:"button",variant:"outline",disabled:!W,onClick:()=>void Z(),className:"shrink-0",children:k?v("resend"):v("sendCode")})]}),P>0?(0,s.jsx)("p",{className:"mt-1 text-xs font-noto text-brand-text-muted",children:v("resendCountdown",{seconds:P})}):null,k?(0,s.jsx)("p",{className:"mt-1 text-xs font-noto text-brand-text-muted",children:v("codeSent",{email:k})}):null,R?(0,s.jsx)("p",{className:"mt-1 text-xs font-noto text-red-600",children:R}):null]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"bind-email-prompt-code",className:"mb-1.5 block text-sm font-noto text-brand-text-dark",children:v("codeLabel")}),(0,s.jsx)("input",{id:"bind-email-prompt-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,value:C,disabled:z,placeholder:v("codePlaceholder"),className:h,onChange:e=>{E(e.target.value),B(null)}}),O?(0,s.jsx)("p",{className:"mt-1 text-xs font-noto text-red-600",children:O}):null]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"bind-email-prompt-password",className:"mb-1.5 block text-sm font-noto text-brand-text-dark",children:v("passwordLabel")}),(0,s.jsxs)("div",{className:"group",children:[(0,s.jsx)("input",{id:"bind-email-prompt-password",type:"password",autoComplete:"new-password",value:F,disabled:z,placeholder:v("passwordPlaceholder"),className:h,onChange:e=>{S(e.target.value),U(null)}}),(0,s.jsx)(d.A,{password:F})]}),I?(0,s.jsx)("p",{className:"mt-1 text-xs font-noto text-red-600",children:I}):null]}),(0,s.jsx)(o.EY,{variant:"caption",className:"text-brand-text-muted",children:v("skipHint")}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(o.qg,{type:"button",variant:"primary",disabled:z,loading:H,className:H?"opacity-70":void 0,onClick:()=>void Q(),children:v("save")})})]})})}},74914:(e,t,a)=>{function s(e){let t=/[A-Z]/.test(e),a=/[a-z]/.test(e),s=/[0-9]/.test(e),r=/[!@#$%^&*()_+\-=\[\]{}|;:,.<>
1?]/.test(e),l=[t,a,s,r].filter(Boolean).length;return{hasUppercase:t,hasLowercase:a,hasNumber:s,hasSpecialChar:r,count:l}}function r(e){if(!e)return"weak";let{count:t}=s(e),a=e.length,r=0;return(a>=8&&(r+=1),a>=12&&(r+=1),a>=16&&(r+=1),t>=2&&(r+=1),t>=3&&(r+=1),4===t&&(r+=1),r<=1)?"weak":r<=3?"medium":r<=4?"strong":"very-strong"}function l(e){let t=[],{hasUppercase:a,hasLowercase:l,hasNumber:n,hasSpecialChar:i,count:o}=s(e);if(e.length<8&&t.push("Password must be at least 8 characters long"),o<3){let e=[];a||e.push("uppercase letter"),l||e.push("lowercase letter"),n||e.push("number"),i||e.push("special character"),0===o?t.push("Password must include at least 3 of: uppercase letter, lowercase letter, number, special character"):1===o?t.push("Password must include at least 2 more character types. Missing: ".concat(e.join(", "))):t.push("Password must include at least 1 more character type. Missing: ".concat(e.join(", ")))}let d=r(e);return{isValid:0===t.length,errors:t,strength:d,hasUppercase:a,hasLowercase:l,hasNumber:n,hasSpecialChar:i,characterTypesCount:o}}a.d(t,{Oj:()=>l,jw:()=>r})},87345:(e,t,a)=>{a.d(t,{A:()=>m});var s=a(79490),r=a(34399),l=a(92579),n=a(39162),i=a(74914);let o="#2F9E62",d="#E24B4A",c="text-sm font-normal leading-[19px]";function u(e){return"weak"===e?d:"medium"===e?"#F59E0B":o}function m(e){let{password:t,strengthLabels:a}=e,m=(0,n.c)("auth.passwordRules"),p=(0,i.Oj)(t),h=(0,i.jw)(t),x=t.length>0,f=p.characterTypesCount>=3,b=[{key:"minLength",met:t.length>=8},{key:"uppercase",met:p.hasUppercase,leftover:f&&!p.hasUppercase},{key:"lowercase",met:p.hasLowercase,leftover:f&&!p.hasLowercase},{key:"number",met:p.hasNumber,leftover:f&&!p.hasNumber},{key:"special",met:p.hasSpecialChar,leftover:f&&!p.hasSpecialChar}],v=a?"very-strong"===h?a.veryStrong:"strong"===h?a.strong:"medium"===h?a.medium:a.weak:null;return(0,s.jsx)("div",{className:"mt-2 hidden group-focus-within:block",children:(0,s.jsxs)("div",{className:"rounded-token-lg border border-token-border bg-token-surface-accent px-4 py-3 text-left font-noto",children:[(0,s.jsx)("p",{className:"mb-2.5 text-[#636162] ".concat(c),children:m("typesHint")}),(0,s.jsx)("ol",{className:"list-none space-y-2 p-0",children:b.map((e,t)=>{let a=x&&e.met,n=x&&!e.met&&!e.leftover,i=a?o:n?d:"#636162";return(0,s.jsxs)("li",{className:"flex items-center gap-2 transition-colors duration-150 ".concat(c),style:{color:i},children:[(0,s.jsxs)("span",{className:"inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border transition-colors duration-150",style:{borderColor:a?o:n?d:"#D9D9D9",backgroundColor:a?"#E8F6EE":n?"#FDECEC":"var(--color-surface)"},"aria-hidden":!0,children:[a&&(0,s.jsx)(r.A,{className:"h-3 w-3",strokeWidth:2.75}),n&&(0,s.jsx)(l.A,{className:"h-3 w-3",strokeWidth:2.75})]}),(0,s.jsxs)("span",{children:[t+1,". ",m(e.key)]})]},e.key)})}),x&&a&&v&&(0,s.jsxs)("div",{className:"mt-3 border-t border-token-border pt-3",children:[(0,s.jsxs)("div",{className:"mb-1.5 flex items-center justify-between ".concat(c),children:[(0,s.jsx)("span",{className:"text-[#636162]",children:a.label}),(0,s.jsx)("span",{className:"font-medium",style:{color:u(h)},children:v})]}),(0,s.jsx)("div",{className:"h-2 w-full overflow-hidden rounded-full bg-token-surface",children:(0,s.jsx)("div",{className:"h-2 rounded-full transition-all duration-300",style:{width:"very-strong"===h?"100%":"strong"===h?"75%":"medium"===h?"50%":"25%",backgroundColor:u(h)}})})]})]})})}}}]);
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.