1"use strict";(globalThis.webpackChunkdraftyai_frontend=globalThis.webpackChunkdraftyai_frontend||[]).push([[1894],{2657(e,t,s){s.d(t,{A:()=>m});var r=s(9950),a=s(6946),l=s(6657),i=s(7091),n=s(4414);const o=[{key:"minLength",label:`At least ${i.AG} characters`},{key:"upperCase",label:"One uppercase letter"},{key:"lowerCase",label:"One lowercase letter"},{key:"number",label:"One number"},{key:"specialChar",label:"One special character"}],d=e=>{let{className:t="h-2.5 w-2.5"}=e;return(0,n.jsx)("svg",{viewBox:"0 0 24 24",className:t,fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M5 13l4 4L19 7",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"})})},c=e=>{let{ok:t,label:s}=e;return(0,n.jsxs)("li",{className:"flex items-start gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"shrink-0 inline-flex h-[14px] w-[14px] mt-[2px] items-center justify-center rounded-full transition-all duration-300 "+(t?"text-white shadow-sm":"bg-white text-transparent ring-1 ring-slate-300"),style:t?{backgroundColor:"#10b981"}:void 0,"aria-hidden":"true",children:t?(0,n.jsx)(d,{className:"h-2 w-2 auth-check-pop"},"check"):(0,n.jsx)(d,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"text-xs leading-snug transition-colors duration-300 "+(t?"text-slate-700 font-medium":"text-slate-500"),children:s})]})},u=(0,r.forwardRef)((e,t)=>{let{id:s="signup-password",value:d,onChange:u,touched:m,isValid:h=!1,spotlight:p=!1}=e;const[x,b]=(0,r.useState)(!1),g=(0,r.useMemo)(()=>(0,i.vq)(d),[d]),w=h?"border-emerald-200 focus-within:ring-emerald-100":p?"border-blue-300 focus-within:ring-blue-100":"border-slate-300 focus-within:ring-blue-100",f=m||d&&d.length>0;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:`flex w-full rounded-xl border bg-white shadow-sm focus-within:ring-4 focus-within:border-blue-500 transition-all duration-200 ${w}`,children:[(0,n.jsx)("input",{ref:t,id:s,value:d,onChange:e=>u(e.target.value),type:x?"text":"password",autoComplete:"new-password",className:"flex-1 rounded-l-xl px-4 py-3 text-base border-0 focus:outline-none bg-transparent min-w-0",placeholder:"Pick a strong password",required:!0,"aria-describedby":f?`${s}-rules`:void 0,"data-cy":"signup-password-input"}),(0,n.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"px-3 text-slate-500 hover:text-slate-700 focus:outline-none focus-visible:text-blue-600","aria-label":x?"Hide password":"Show password","aria-pressed":x,"data-cy":"signup-password-toggle",children:x?(0,n.jsx)(a.A,{className:"h-5 w-5"}):(0,n.jsx)(l.A,{className:"h-5 w-5"})})]}),f&&(0,n.jsx)("div",{id:`${s}-rules`,className:"mt-2.5 rounded-xl bg-slate-50/80 ring-1 ring-slate-200/70 px-3.5 py-3",children:(0,n.jsx)("ul",{className:"space-y-1.5","aria-label":"Password requirements",children:o.map(e=>(0,n.jsx)(c,{ok:Boolean(g[e.key]),label:e.label},e.key))})})]})});u.displayName="PasswordInput";const m=u},1894(e,t,s){s.r(t),s.d(t,{default:()=>O});var r,a,l,i,n,o,d,c,u,m,h=s(4167),p=s(793),x=s(9950),b=s(5999),g=s(7088),w=s(2283),f=s(5146),y=s(8258),v=s(1413),j=s(2772),N=s(4929),A=s(6243),k=s(2657),C=s(5920),I=s(4414);const M=new(r=class{constructor(){(0,h.A)(this,"isVisible",a,this),(0,h.A)(this,"toggleVisibility",l,this)}},a=(0,p.A)(r.prototype,"isVisible",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),l=(0,p.A)(r.prototype,"toggleVisibility",[b.XI],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isVisible=!this.isVisible}}}),r);let E=(0,g.WQ)("store")(i=(0,g.PA)((n=class extends x.Component{constructor(){super(),(0,h.A)(this,"email",o,this),(0,h.A)(this,"password",d,this),(0,h.A)(this,"code",c,this),(0,h.A)(this,"errorMessage",u,this),(0,h.A)(this,"loading",m,this),this.onChange=e=>{this.currentPromptOption=e},this.onChangeAny=(e,t)=>{this[t]=e,this.errorMessage=""},(0,b.Gn)(this)}componentDidMount(){j.m,document.title="Password Reset - DraftyAI";const e=localStorage.getItem("localEmail");e&&(this.email=e),M.isVisible=!1}resetValues(){this.email="",this.password="",this.code=""}render(){return(0,I.jsx)("div",{className:"flex items-center justify-center min-h-screen py-6 sm:py-10 px-4 sm:px-6 lg:px-8",children:(0,I.jsxs)("div",{className:"w-full max-w-xl space-y-4 sm:sp
1ace-y-6",children:[(0,I.jsx)("div",{className:"flex justify-center px-4",children:(0,I.jsx)("img",{className:"h-auto w-48 sm:w-[280px] logo-style",src:"/logo.avif",alt:"DraftyAI"})}),(0,I.jsxs)("div",{className:"bg-white p-5 sm:p-7 rounded-xl sm:rounded-2xl shadow-xl mx-2 sm:mx-0",children:[(0,I.jsx)(V,{email:this.email,password:this.password,code:this.code,onChange:this.onChangeAny,errorMessage:this.errorMessage}),this.errorMessage&&(0,I.jsx)("div",{className:"text-red-500 text-sm text-center mt-3 sm:mt-4",children:this.errorMessage}),(0,I.jsx)(v.N_,{to:"/forgot-password",className:"block text-center bg-gray-50 text-gray-600 text-sm py-2.5 sm:py-3 mt-5 sm:mt-6 rounded-lg hover:bg-gray-100 transition-colors duration-200",children:"Back to Account Recovery Page"})]})]})})}},o=(0,p.A)(n.prototype,"email",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),d=(0,p.A)(n.prototype,"password",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=(0,p.A)(n.prototype,"code",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),u=(0,p.A)(n.prototype,"errorMessage",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),m=(0,p.A)(n.prototype,"loading",[b.sH],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),i=n))||i)||i;const V=(0,g.PA)(e=>{let{email:t,password:s,code:r,onChange:a,handleSubmit:l,errorMessage:i}=e;const[n,o]=(0,x.useState)(!1),[d,c]=(0,x.useState)(!1),[u,m]=(0,x.useState)(!1),[h,p]=(0,x.useState)(null);l=async e=>{m(!0);try{e.preventDefault();const l={Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJmcm9udGVuZCIsInNjb3BlcyI6W10sImV4cCI6MTk5ODQ2NDQ0OH0.4UXQYJP2OQXx-EUpdtUDVkHVDnu1-mraDtyH_wyAywA"};await N.A.post(`${A.Ay.papiUrl}/users/forgot-password-reset`,{email:t,new_password:s,confirmation_code:r},{headers:l}).then(e=>{M.toggleVisibility(),a("","email"),a("","password"),a("","code"),m(!1),c(!1)})}catch(d){var l,n,o;if(null!==d&&void 0!==d&&null!==(l=d.response)&&void 0!==l&&l.data)i=null===d||void 0===d||null===(n=d.response)||void 0===n?void 0:n.data,p(null===d||void 0===d||null===(o=d.response)||void 0===o?void 0:o.data);m(!1)}};const b=(0,I.jsxs)(I.Fragment,{children:["Invalid code provided, please request a code again from our.",(0,I.jsx)(v.N_,{to:"/forgot-password",className:"text-blue-500 hover:text-blue-700",children:'"Forgot your password?"'})," feature."]});return(0,I.jsxs)("form",{onSubmit:l,className:"mt-3 sm:mt-4 space-y-5 sm:space-y-6",children:[(0,I.jsxs)("div",{className:"flex flex-col items-center",children:[(0,I.jsx)("div",{className:"flex-shrink-0 flex items-center justify-center h-16 sm:h-20 w-16 sm:w-20 rounded-full bg-blue-100 transition-all duration-300 transform hover:scale-105",children:(0,I.jsx)(y.A,{className:"h-8 sm:h-10 w-8 sm:w-10 text-blue-600","aria-hidden":"true"})}),(0,I.jsx)("h2",{className:"mt-4 sm:mt-5 text-xl sm:text-2xl font-bold text-gray-900",children:"Reset Your Password"}),(0,I.jsx)("p",{className:"mt-1 sm:mt-1.5 text-sm sm:text-base text-gray-600 text-center px-4",children:"Enter the code from your email and your new password"})]}),(0,I.jsxs)("div",{className:"space-y-4 sm:space-y-5",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Email Address"}),(0,I.jsx)("input",{type:"email",value:t,onChange:e=>a(e.target.value,"email"),className:"mt-1 sm:mt-1.5 block w-full rounded-md text-base sm:text-lg px-3 sm:px-4 py-2 sm:py-2.5 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"[email protected]",required:!0})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Reset Code"}),(0,I.jsx)("input",{type:"text",value:r,onChange:e=>a(e.target.value,"code"),className:"mt-1 sm:mt-1.5 block w-full rounded-md text-base sm:text-lg px-3 sm:px-4 py-2 sm:py-2.5 border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"Enter the code from your email",required:!0})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"New Password"}),(0,I.jsx)("div",{className:"mt-1 sm:mt-1.5",children:(0,I.jsx)(k.A,{value:s,onChange:e=>{c(!0),a(e,"password");const t={minLength:e.length<8,number:!/\d/.test(e),specialChar:!/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(e),upperCase:!/[A-Z]/.test(e),lowerCase:!/[a-z]/.test(e)};o(!Object.values(t).some(e=>e))},touched:d})})]})]}),(0,I.jsx)("div",{className:"mt-5 sm:mt-6",children:(0,I.jsx)("button",{type:"submit",className:"w-full py-2.5 sm:py-3.5 px-6 sm:px-7 text-base sm:text-lg font-medium flex items-center justify-center",style:{boxShadow:"6px 6px 12px rgba(0, 0, 0, 0.1), -6px -6px 12px rgba(255, 255, 255, 0.7)",backgroundColor:"#e0e0e0",border:"none",borderRadius:"9999px",transition:"box-shadow 0.3s ease, background-color 0.3s ease",...t&&s&&r?{backgroundColor:"#3b82f6",boxShadow:"8px 8px 16px rgba(0, 0, 0, 0.15), -8px -8px 16px rgba(255, 255, 255, 0.85)",color:"#ffffff"}:{backgroundColor:"#d1d5db",boxShadow:"6px 6px 12px rgba(0, 0, 0, 0.1), -6px -6px 12px rgba(255, 255, 255, 0.7)",cursor:"not-allowed",color:"#a1a1aa"}},disabled:!t||!s||!r||u,children:u?(0,I.jsx)(w.pR,{height:"28",width:"28",color:"#ffffff",wrapperStyle:{},wrapperClass:"flex items-center justify-center",visible:!0,ariaLabel:"circles-with-bar-loading"}):"Reset Password"})}),h&&(0,I.jsx)(C.A,{handleDisplayError:()=>{p(null)},errorDisplay:h.includes("An error occurred")?b:h}),M.isVisible&&(0,I.jsxs)("div",{className:"text-center space-y-3 sm:space-y-3.5 mt-5 sm:mt-6",children:[(0,I.jsx)("div",{className:"flex items-center justify-center",children:(0,I.jsx)(f.A,{className:"h-10 sm:h-12 w-10 sm:w-12 text-green-500","aria-hidden":"true"})}),(0,I.jsxs)("div",{className:"space-y-2 sm:space-y-2.5",children:[(0,I.jsx)("p",{className:"text-base sm:text-lg text-green-600",children:"Your password has been successfully updated."}),(0,I.jsx)("p",{children:(0,I.jsx)(v.N_,{to:"/login",className:"text-base sm:text-lg text-blue-600 hover:text-blue-500 font-medium underline hover:no-underline",children:"Click here to login with your new password"})})]})]})]})}),O=e=>{const t=(0,v.Zp)();return(0,I.jsx)(E,{...e,navigate:t})}},7091(e,t,s){s.d(t,{AG:()=>a,NX:()=>d,YY:()=>o,cy:()=>c,vq:()=>n,xd:()=>i});const r=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,a=8,l=/[ `!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/,i=e=>r.test(e||""),n=e=>{const t=e||"";return{minLength:t.length>
1=a,number:/\d/.test(t),specialChar:l.test(t),upperCase:/[A-Z]/.test(t),lowerCase:/[a-z]/.test(t)}},o=e=>{const t=n(e);return Object.values(t).every(Boolean)},d=e=>{let{email:t,password:s,agreed:r}=e;return i(t)&&o(s)&&Boolean(r)},c=e=>{let{email:t,password:s,agreed:r}=e;return t?i(t)?o(s)?r?null:"Confirm the attorney attestation to continue":"Finish the password rules above to continue":"Fix the email above to continue":"Enter your work email to continue"}},8258(e,t,s){s.d(t,{A:()=>l});var r=s(9950);function a(e,t){let{title:s,titleId:a,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},l),s?r.createElement("title",{id:a},s):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const l=r.forwardRef(a)},6657(e,t,s){s.d(t,{A:()=>l});var r=s(9950);function a(e,t){let{title:s,titleId:a,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},l),s?r.createElement("title",{id:a},s):null,r.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),r.createElement("path",{fillRule:"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",clipRule:"evenodd"}))}const l=r.forwardRef(a)},6946(e,t,s){s.d(t,{A:()=>l});var r=s(9950);function a(e,t){let{title:s,titleId:a,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},l),s?r.createElement("title",{id:a},s):null,r.createElement("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"}),r.createElement("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"}),r.createElement("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"}))}const l=r.forwardRef(a)}}]);
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.