PageSourceSearch

https://bd.chile.rugby/assets/LoginPage-B7lDowAQ.js

js chile.rugby collected 2026-09-25 07:19:51 UTC 3,789 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-DXQz-G-n.js";import{u as A,r as f}from"./vendor-react-UDtOjBVY.js";import{u as g}from"./vendor-ui-GdHffJNH.js";import{R as S,u as E,a as k,b as M,D as R,c as P,d as D}from"./index-BZHYFz0Q.js";import{u as F}from"./hooks-B21-mOef.js";import{I as b}from"./input-DC8dNGoe.js";import{B as I}from"./button-gaxnaY7A.js";import"./IconCalendar-DBkCqNtU.js";function j(s,a){return s.some(t=>t.section===a)}function O({role:s,permissions:a,user:t}){const n=(t==null?void 0:t.roles)??[],c=n.length===1&&n[0]==="circulars-manager",m=j(a,"bw_circulars"),l=j(a,"bw_concussions");return c||s==="bienestar"&&m&&!l?"/circulares":S[s??""]??"/dashboard"}const N="self-center text-sm font-medium text-primary-600 underline underline-offset-4 hover:text-primary-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2";function Q(){var p,h;const s=E(),a=A(),{credentials:t,rememberMe:n,setCredentials:c,setRememberMe:m}=k(),l=F(),{data:o}=M(),x=((p=o==null?void 0:o.data)==null?void 0:p.logo_url)??R,[i,v]=f.useState((t==null?void 0:t.username)??""),[u,y]=f.useState((t==null?void 0:t.password)??""),w=r=>{if(r.preventDefault(),!i||!u){g.error(s("auth.login.validation.requiredCredentials"));return}n&&c({username:i,password:""}),l.mutate({username:i,password:u},{onSuccess:()=>{const{role:d,permissions:C,user:_}=D.getState(),L=O({role:d,permissions:C,user:_});a(L,{replace:!0})},onError:d=>{g.error(d.message||s("auth.login.error.fallback"))}})};return e.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background",children:e.jsxs("div",{className:"w-full max-w-md rounded-2xl bg-white px-8 py-10 shadow-card",children:[e.jsx("div",{className:"mb-6 flex justify-center",children:x?e.jsx("img",{src:x,alt:((h=o==null?void 0:o.data)==null?void 0:h.app_name)??P,className:"h-20"}):null}),e.jsxs("div",{className:"mb-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-primary-900 sm:text-3xl",children:s("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-primary-500",children:s("auth.login.subtitle.web")})]}),e.jsxs("form",{onSubmit:w,className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"username",className:"text-sm font-medium text-primary-700",children:s("auth.fields.username.label")}),e.jsx(b,{id:"username",type:"text",placeholder:s("auth.fields.username.placeholder"),value:i,onChange:r=>v(r.target.value),autoComplete:"username"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"password",className:"text-sm font-medium text-primary-700",children:s("auth.fields.password.label")}),e.jsx(b,{id:"password",type:"password",placeholder:s("auth.fields.password.placeholder"),value:u,onChange:r=>y(r.target.value),autoComplete:"current-password"})]}),e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:r=>m(r.target.checked),className:"h-4 w-4 rounded border-primary-300 accent-accent"}),e.jsx("span",{className:"text-sm text-primary-600",children:s("auth.login.rememberMe")})]}),e.jsx("button",{type:"button",onClick:()=>a("/forgot-password"),className:"self-end text-sm font-medium text-primary-600 hover:text-primary-800",children:s("auth.login.forgotPassword")}),e.jsx(I,{type:"submit",variant:"outline-accent",size:"lg",loading:l.isPending,className:"mt-2 w-full",children:s("auth.login.submit")}),e.jsx("button",{type:"button",onClick:()=>a("/registro"),className:N,children:s("auth.login.registrationPortal")}),e.jsx("button",{type:"button",onClick:()=>a("/registro/documentos"),className:N,children:s("registration.documentationAccess.pendingCta")})]})]})})}export{Q as default};

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.