PageSourceSearch

https://makersweare.com/assets/password-CRNI5qlE.js

js makersweare.com collected 2026-10-03 18:31:15 UTC 4,853 bytes, 1 lines download raw bytes

1import{a as l,p as a}from"./chunk-BV7QT456-DdeNQK3V.js";import{g as A,o as O,A as v}from"./i18nInstance-DFZXkL9T.js";import{u as S}from"./useMutation-Q57BkF3t.js";import{a as T,c as h}from"./css-CtSQ2U0U.js";import{u as _}from"./useTranslation-BujEXuts.js";import{u as z}from"./AuthContext-ITX5IgHz.js";import{l as j}from"./errorMessage-BTh1tC8w.js";import{D as k}from"./Dropdown-BTG8i1G8.js";import{A as M}from"./index-DWZFVQP2.js";import{m as $}from"./proxy-J6dblATp.js";import{s as C}from"./schemas-DA8tnxNz.js";async function B({email:s,type:e}){const t=await A(),o={json:{email:s,type:e}};e==="change-email"&&(o.headers={Authorization:`Bearer ${t}`});const i=await O.post("api/otp",o).json();if(!i.success)throw new Error("Failed to send OTP request");return i}function P({onSuccess:s,onError:e}){return S({mutationFn:B,onSuccess:s,onError:e})}function V({email:s,type:e,className:t,disabled:o,autoStart:i=!1,onSuccess:c,onError:n}){const{t:r}=_(),[d,{startCountdown:p,resetCountdown:w}]=T({countStart:60,intervalMs:1e3}),[f,x]=l.useState(!!i),{mutate:u,isPending:g}=P({onSuccess:b=>{if(b.success){w(),p(),x(!0),c==null||c(b);return}},onError:b=>{w(),p(),x(!0),n==null||n(b)}});l.useEffect(()=>{i&&(p(),x(!0))},[i]);const m=r(e==="login"?"login.otp.resend_otp_btn":e==="change-email"?"profile.get_otp":"register.otp_btn"),y=()=>
1{if(!s){n==null||n(new v("missing_credentials"));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){n==null||n(new v("invalid_email_format"));return}f&&d>0||g||u({email:s,type:e})},N=h("btn btn-link underline text-gray-500 p-0 text-sm",t);return a.jsxs("button",{type:"button",onClick:y,disabled:o||g||f&&d>0,className:N,children:[g&&a.jsx("span",{className:"loading loading-spinner"}),m," ",f&&d>0?`(${d})`:""]})}const E=({errorKey:s,pageKey:e})=>{const{t}=_(),{redirectToLogin:o}=z();return l.useEffect(()=>{s==="session_not_found"&&(alert(j(t,s,e)),o())},[s]),s==="session_not_found"?null:a.jsx("div",{style:{backgroundColor:"#ffe6e6",border:"1px solid #ffcccc",padding:"10px",borderRadius:"5px",color:"#cc0000",margin:"10px 0"},children:j(t,s,e)})},R=[31,29,31,30,31,30,31,31,30,31,30,31],I=s=>s>=1&&s<=12?R[s-1]:31,K=({monthValue:s,dayValue:e,disabled:t,onMonthChange:o,onDayChange:i,dropdownClassName:c,error:n})=>{const{t:r}=_(),d=parseInt(s)||0,p=d>0?I(d):31,w=l.useMemo(()=>{const u=r("field.month_unit");return Array.from({length:12},(g,m)=>({label:`${m+1}${u}`,value:String(m+1)}))},[r]),f=l.useMemo(()=>{const u=r("field.day_unit");return Array.from({length:p},(g,m)=>({label:`${m+1}${u}`,value:String(m+1)}))},[p,r]),x=u=>{o==null||o(u),i==null||i("")};return a.jsxs("div",{className:"flex gap-2",children:[a.jsx(k,{options:w,disabled:t,value:s,onChange:x,placeholder:r("field.month")||"Month",size:"md",variant:"bordered",containerClassName:h("flex-1"),labelClassName:"font-semibold",triggerClassName:c,error:n}),a.jsx(k,{options:f,disabled:t,value:e,onChange:i,placeholder:r("field.day")||"Day",size:"md",variant:"bordered",containerClassName:h("flex-1"),labelClassName:"font-semibold",triggerClassName:c,error:n},s)]})};function L(){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("path",{d:"M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0Z",fill:"black"}),a.jsx("path",{d:"M12.666 5.3335L8.20645 10.4301C7.56124 11.1675 7.23863 11.5362 6.81245 11.5556C6.38627 11.575 6.03151 11.2371 5.32199 10.5614L3.33268 8.66683",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]})}function ss({visible:s,message:e,topOffset:t=80}){return a.jsx(M,{children:s&&a.jsx($.div,{className:"fixed left-0 right-0 z-50 flex justify-center pointer-events-none",style:{top:t},initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.95},transition:{duration:.3,ease:"easeOut"},children:a.jsxs("div",{className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-[50px] border border-white",style:{background:"rgba(255, 255, 255, 0.70)",boxShadow:"0 5px 13.9px 0 rgba(0, 0, 0, 0.20)",backdropFilter:"blur(5px)"},children:[a.jsx(L,{}),a.jsx("span",{className:"text-black text-sm",children:e})]})},"toast")})}function es({duration:s=3e3}={}){const[e,t]=l.useState(!1),[o,i]=l.useState(""),c=l.useCallback(r=>{i(r),t(!0),setTimeout(()=>t(!1),s)},[s]),n=l.useCallback(()=>{t(!1)},[]);return{visible:e,message:o,show:c,hide:n}}const ts=s=>C().min(1,s("errors.empty_password")).min(8,s("errors.invalid_password_format")).regex(/[A-Z]/,s("errors.invalid_password_format")).regex(/[a-z]/,s("errors.invalid_password_format")).regex(/[0-9]/,s("errors.invalid_password_format")).regex(/[^A-Za-z0-9]/,s("errors.invalid_password_format")),ns=s=>C().min(1,s("errors.empty_password"));export{K as B,V as G,E as O,ss as T,ts as a,ns as g,es as u};

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.