PageSourceSearch

https://ferrovelho.app/_next/static/chunks/app/cliente/(auth)/cadastro/page-8a8925e12d848f0e.js

js ferrovelho.app collected 2026-10-02 00:42:52 UTC 15,440 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1097],{171:(e,t,a)=>{"use strict";a.d(t,{BackButton:()=>n});var s=a(655),r=a(1932),l=a(4742);function n(e){let{label:t="Voltar"}=e,a=(0,r.useRouter)();return(0,s.jsxs)("button",{onClick:()=>a.back(),className:"inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs font-semibold text-brown-900 hover:bg-brown-900/10 transition-colors -ml-2","aria-label":"Voltar",children:[(0,s.jsx)(l.A,{size:18,strokeWidth:2.5}),t]})}},861:(e,t,a)=>{Promise.resolve().then(a.bind(a,9736))},1932:(e,t,a)=>{"use strict";var s=a(2892);a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}}),a.o(s,"useSearchParams")&&a.d(t,{useSearchParams:function(){return s.useSearchParams}})},2108:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(4169).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},3879:(e,t,a)=>{"use strict";a.d(t,{W:()=>r});var s=a(655);function r(e){let{children:t,maxWidth:a="max-w-6xl"}=e;return(0,s.jsxs)("section",{className:"relative",style:{background:"#fbcc01"},children:[(0,s.jsxs)("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[(0,s.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(135deg, #ffe066 0%, #fbcc01 40%, #e6a800 75%, #c47f00 100%)"}}),(0,s.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 70% 80% at 85% 50%, rgba(255,180,0,0.45) 0%, transparent 65%)"}}),(0,s.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 40% 60% at 10% 30%, rgba(255,240,120,0.5) 0%, transparent 60%)"}}),(0,s.jsx)("div",{className:"absolute left-0 top-0 bottom-0 hidden lg:block",style:{width:"180px",backgroundImage:"radial-gradient(circle, rgba(140,70,0,0.35) 1.2px, transparent 1.2px)",backgroundSize:"14px 14px",WebkitMaskImage:"linear-gradient(to right, black 0%, transparent 100%)",maskImage:"linear-gradient(to right, black 0%, transparent 100%)"}})]}),(0,s.jsx)("div",{className:"relative z-10 mx-auto ".concat(a," px-4"),children:t})]})}},4169:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var s=a(4519),r=a(8697);let l=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n=a(6514);let c=(e,t)=>{let a=(0,s.forwardRef)((a,c)=>{let{className:i,...o}=a;return(0,s.createElement)(n.default,{ref:c,iconNode:t,className:(0,r.z)("lucide-".concat(l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),i),...o})});return a.displayName=l(e),a}},4372:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(4169).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},4461:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(4169).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4742:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(4169).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},5796:(e,t,a)=>{"use strict";a.d(t,{F:()=>c});var s=a(655),r=a(4519),l=a(1932),n=a(56);function c(e){let{next:t,defaultRole:a="CLIENT"}=e,c=(0,l.useRouter)(),[d,u]=(0,r.useState)(null);if("true"!==n.env.NEXT_PUBLIC_SOCIAL_AUTH_ENABLED)return null;async function x(e){u(e);try{let r="ADVERTISER"===a?"".concat(e,"[email protected]"):"".concat(e,"[email protected]"),l=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r,password:"social-mock"})}),n=await l.json();if(n.user){var s;let e=t&&t.startsWith("/")?t:(s=n.user).isAdmin?"/admin/dashboard":"CLIENT"===s.userType?"/cliente/desejos":"/anunciante/dashboard";c.replace(e)}}catch(e){u(null)}}let h="flex items-center justify-center gap-2.5 w-full rounded-xl border py-3 text-sm font-semibold transition hover:bg-zinc-50 active:scale-[0.99] disabled:opacity-60";return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"h-px flex-1 bg-zinc-200"}),(0,s.jsx)("span",{className:"text-xs text-zinc-400",children:"ou"}),(0,s.jsx)("span",{className:"h-px flex-1 bg-zinc-200"})]}),(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>void x("google"),disabled:null!==d,className:h,style:{borderColor:"#e4e4e7",color:"#3f3f46",background:"#fff"},children:[(0,s.jsx)(i,{}),"google"===d?"Entrando...":"Continuar com Google"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void x("apple"),disabled:null!==d,className:"".concat(h," hover:opacity-90"),style:{borderColor:"#000",color:"#fff",background:"#000"},children:[(0,s.jsx)(o,{}),"apple"===d?"Entrando...":"Continuar com Apple"]})]})]})}function i(){return(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 48 48","aria-hidden":!0,
1children:[(0,s.jsx)("path",{fill:"#FFC107",d:"M43.6 20.5H42V20H24v8h11.3c-1.6 4.7-6.1 8-11.3 8-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.3 6.1 29.4 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.3-.4-3.5z"}),(0,s.jsx)("path",{fill:"#FF3D00",d:"M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.3 6.1 29.4 4 24 4 16.3 4 9.7 8.3 6.3 14.7z"}),(0,s.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3C29.3 35.1 26.8 36 24 36c-5.2 0-9.6-3.3-11.2-8l-6.5 5C9.6 39.6 16.2 44 24 44z"}),(0,s.jsx)("path",{fill:"#1976D2",d:"M43.6 20.5H42V20H24v8h11.3c-.8 2.2-2.2 4.1-4 5.5l6.3 5.3C41.6 34.6 44 29.8 44 24c0-1.3-.1-2.3-.4-3.5z"})]})}function o(){return(0,s.jsx)("svg",{width:"15",height:"17",viewBox:"0 0 384 512",fill:"#fff","aria-hidden":!0,children:(0,s.jsx)("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}},5844:(e,t,a)=>{"use strict";a.d(t,{z:()=>n});var s=a(655),r=a(3879),l=a(171);function n(e){let{title:t,subtitle:a,eyebrow:n,align:c="left",maxWidth:i="max-w-6xl",children:o,showBack:d=!1}=e;return(0,s.jsx)(r.W,{maxWidth:i,children:(0,s.jsxs)("div",{className:"py-6 sm:py-10 ".concat("center"===c?"text-center":""),children:[d&&(0,s.jsx)("div",{className:"mb-2 ".concat("center"===c?"flex justify-center":""),children:(0,s.jsx)(l.BackButton,{})}),n&&(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-widest text-brown-700 mb-1",children:n}),(0,s.jsx)("h1",{className:"text-xl sm:text-3xl font-black text-brown-900 leading-tight mb-1.5 sm:mb-2",children:t}),a&&(0,s.jsx)("p",{className:"text-xs sm:text-sm text-brown-700 leading-relaxed",children:a}),o]})})}},9424:(e,t,a)=>{"use strict";async function s(e){let t=e.replace(/\D/g,"");if(8!==t.length)return null;try{var a,s;let e=await fetch("https://viacep.com.br/ws/".concat(t,"/json/"));if(!e.ok)return null;let r=await e.json();if(r.erro||!r.localidade||!r.uf)return null;return{cep:t,street:null!=(a=r.logradouro)?a:"",neighborhood:null!=(s=r.bairro)?s:"",city:r.localidade,state:r.uf}}catch(e){return null}}function r(e){return e.replace(/\D/g,"").slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}a.d(t,{J:()=>r,y:()=>s})},9736:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var s=a(655),r=a(4519),l=a(3483),n=a.n(l),c=a(1932),i=a(4461),o=a(2108),d=a(4372),u=a(5844),x=a(5796),h=a(9424);function m(){var e;let t=(0,c.useRouter)(),a=!(e=(0,c.useSearchParams)().get("next"))||!e.startsWith("/")||e.startsWith("//")?null:e,[l,m]=(0,r.useState)({name:"",email:"",phone:"",document:"",cep:"",street:"",number:"",city:"",state:"",password:"",confirmPassword:""}),[p,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),[N,y]=(0,r.useState)(""),[C,w]=(0,r.useState)(!1);async function k(e){if(e.preventDefault(),l.password!==l.confirmPassword)return void y("As senhas n\xe3o coincidem.");if(l.password.length<6)return void y("Senha deve ter no m\xednimo 6 caracteres.");if(l.phone.replace(/\D/g,"").length<10)return void y("Informe um WhatsApp v\xe1lido com DDD.");let s=l.document.replace(/\D/g,"");if(11!==s.length&&14!==s.length)return void y("Informe seu CPF (11 d\xedgitos) ou CNPJ (14 d\xedgitos).");w(!0),y("");try{let e=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,userType:"CLIENT"})}),s=await e.json();if(!e.ok){var r;y(null!=(r=s.error)?r:"Erro ao criar conta.");return}t.replace(null!=a?a:"/cliente/desejos")}catch(e){y("Erro de conex\xe3o.")}finally{w(!1)}}async function z(e){let t=(0,h.J)(e);if(m(e=>({...e,cep:t})),8===t.replace(/\D/g,"").length){b(!0);let e=await (0,h.y)(t);b(!1),e&&m(t=>({...t,city:e.city,state:e.state,street:e.street}))}}let A="w-full rounded-lg px-3 py-3 text-sm text-brown-900 placeholder-zinc-400 outline-none focus:ring-2 focus:ring-brown-900/20 transition border border-zinc-200 bg-white",S="block text-xs font-bold text-zinc-600 uppercase tracking-wider mb-1";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.z,{eyebrow:"Cliente",title:"Criar conta"}),(0,s.jsx)("main",{className:"flex items-start justify-center px-4 py-8",children:(0,s.jsxs)("div",{className:"w-full max-w-sm",children:[(0,s.jsxs)("div",{className:"flex gap-2 mb-6",children:[(0,s.jsx)("div",{className:"flex-1 rounded-xl py-2.5 text-center text-sm font-bold text-white",style:{background:"#3e2623"},children:"Cliente"}),(0,s.jsx)(n(),{href:"/anunciante/cadastro",className:"flex-1 rounded-xl py-2.5 text-center text-sm font-bold text-zinc-600 border border-zinc-200 bg-white hover:border-brown-900 hover:text-brown-900 transition",children:"Anunciante"})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm",children:[(0,s.jsx)("h2",{className:"text-base font-black text-brown-900 mb-1 text-center",children:"Criar sua conta"}),(0,s.jsx)("p",{className:"mb-5 text-center text-xs text-zinc-500",children:"Cadastro completo — assim voc\xea j\xe1 pode publicar desejos e vender pe\xe7as e ve\xedculos."}),N&&(0,s.jsx)("div",{className:"mb-4 rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-700 text-center",children:N}),(0,s.jsxs)("form",{onSubmit:k,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"Nome"}),(0,s.jsx)("input",{required:!0,value:l.name,onChange:e=>m(t=>({...t,name:e.target.value})),className:A,placeholder:"Seu nome completo",autoComplete:"name"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"E-mail"}),(0,s.jsx)("input",{required:!0,type:"email",value:l.email,onChange:e=>m(t=>({...t,email:e.target.value})),className:A,placeholder:"[email protected]",autoComplete:"email"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"WhatsApp"}),(0,s.jsx)("input",{required:!0,type:"tel",value:l.phone,onChange:e=>m(t=>({...t,phone:e.target.value})),className:A,placeholder:"(11) 99999-9999",autoComplete:"tel"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"CEP"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{required:!0,inputMode:"numeric",value:l.cep,onChange:e=>void z(e.target.value),className:A,placeholder:"00000-000",maxLength:9,autoComplete:"postal-code"}),p&&(0,s.jsx)(i.A,{size:15,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-zinc-400"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_88px] gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"Rua"}),(0,s.jsx)("input",{required:!0,value:l.street,onChange:e=>m(t=>({...t,street:e.target.value})),className:A,placeholder:"Rua / Avenida",autoComplete:"address-line1"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"N\xba"}),(0,s.jsx)("input",{required:!0,value:l.number,onChange:e=>m(t=>({...t,number:e.target.value})),className:A,placeholder:"123"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_64px] gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"Cidade"}),(0,s.jsx)("input",{required:!0,value:l.city,onChange:e=>m(t=>({...t,city:e.target.value})),className:A,placeholder:"Sua cidade",autoComplete:"address-level2"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"UF"}),(0,s.jsx)("input",{required:!0,value:l.state,onChange:e=>m(t=>({...t,state:e.target.value})),className:A,placeholder:"UF",maxLength:2,autoComplete:"address-level1"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"CPF ou CNPJ"}),(0,s.jsx)("input",{required:!0,value:l.document,onChange:e=>m(t=>({...t,document:e.target.value})),inputMode:"numeric",className:A,placeholder:"CPF ou CNPJ"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"Senha"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{required:!0,type:f?"text":"password",minLength:6,value:l.password,onChange:e=>m(t=>({...t,password:e.target.value})),className:A,placeholder:"M\xednimo 6 caracteres",autoComplete:"new-password"}),(0,s.jsx)("button",{type:"button",onClick:()=>g(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-brown-900",children:f?(0,s.jsx)(o.A,{size:16}):(0,s.jsx)(d.A,{size:16})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:S,children:"Confirmar senha"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{required:!0,type:j?"text":"password",value:l.confirmPassword,onChange:e=>m(t=>({...t,confirmPassword:e.target.value})),className:A,placeholder:"Repita a senha",autoComplete:"new-password"}),(0,s.jsx)("button",{type:"button",onClick:()=>v(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-brown-900",children:j?(0,s.jsx)(o.A,{size:16}):(0,s.jsx)(d.A,{size:16})})]})]}),(0,s.jsx)("button",{type:"submit",disabled:C,className:"btn-3d-brown w-full rounded-xl py-3.5 text-sm font-black",children:C?"Cadastrando...":"Criar conta"}),(0,s.jsx)("p",{className:"text-center text-[11px] text-zinc-400",children:"Ao criar a conta voc\xea j\xe1 entra direto — sem espera."})]}),(0,s.jsx)(x.F,{next:a,defaultRole:"CLIENT"})]}),(0,s.jsxs)("div",{className:"mt-4 text-center space-y-2",children:[(0,s.jsxs)("p",{className:"text-sm text-zinc-500",children:["J\xe1 tem cadastro?"," ",(0,s.jsx)(n(),{href:"/login".concat(a?"?next=".concat(encodeURIComponent(a)):""),className:"font-bold text-brown-900 hover:underline",children:"Fa\xe7a o login"})]}),(0,s.jsx)(n(),{href:"/",className:"block text-sm text-zinc-400 hover:text-brown-900 transition-colors",children:"Voltar ao in\xedcio"})]})]})})]})}function p(){return(0,s.jsx)(r.Suspense,{fallback:null,children:(0,s.jsx)(m,{})})}}},e=>{e.O(0,[3080,7575,4695,7358],()=>e(e.s=861)),_N_E=e.O()}]);

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.