import{j as e,r as a}from"./vendor-react-AXa6hZO5.js";import{aO as t}from"./index-C_tZnXTW.js";import{D as s}from"./cfcbb3627-B0TqFxbU.js";import{u as r,M as o}from"./vendor-intl-BdADXLLt.js";import{n as l}from"./cec18ad9a-DiLjrOUd.js";import{u as i,m as n}from"./c32f15cb4-D__VzGPN.js";function d({onChange:a,value:t,locale:o,dayAriaLabel:l,monthAriaLabel:i,yearAriaLabel:n,dayPlaceholder:d,monthPlaceholder:c,yearPlaceholder:m}){const x=r();return e.jsx(s,{onChange:a,value:t,locale:o??x.locale,disableCalendar:!0,clearIcon:null,dayAriaLabel:l??x.formatMessage({defaultMessage:"Day",id:"7pXrnqU8wt"}),monthAriaLabel:i??x.formatMessage({defaultMessage:"Month",id:"TBovrxFZgY"}),yearAriaLabel:n??x.formatMessage({defaultMessage:"Year",id:"IFo1ooSAuf"}),dayPlaceholder:d??x.formatMessage({defaultMessage:"DD",id:"N2DECLxiUG"}),monthPlaceholder:c??x.formatMessage({defaultMessage:"MM",id:"ghxcLS6Ly1"}),yearPlaceholder:m??x.formatMessage({defaultMessage:"YYYY",id:"tmu18xW1Q9"})})}function c({className:a,...t}){return e.jsx("div",{...t,className:l("text-center text-text-400 text-sm",a)})}const m=({className:a,...t})=>e.jsx("div",{role:"alert",className:l("text-danger-000 text-center text-sm",a),...t});function x({setIsValidAge:s,errorMessage:l}){const{minimumAge:c,useBirthdatePicker:x}=i(),[u,f]=a.useState(null),g=u instanceof Date,h=g&&n(u,c),[b,M]=a.useState(!1),j=r();return a.useEffect(()=>{s(x?h:b)},[b,h,s,x]),x?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"border-0.5 border-border-200 inline-flex items-center justify-center gap-2 rounded-xl px-3 py-2",children:[e.jsx("div",{className:"select-none text-sm text-text-200",children:e.jsx(o,{defaultMessage:"Enter your birthdate",id:"I84av1m3Qh"})}),e.jsx("div",{className:"shrink grow basis-0 text-right text-sm text-text-400",children:e.jsx(d,{onChange:f,value:u})})]}),g&&!h&&e.jsx(m,{children:l??e.jsx(o,{defaultMessage:"You cannot create an account because you do not meet the minimum age requirement.",id:"DoatyX0etY"})})]}):e.jsx(t,{label:j.formatMessage({defaultMessage:"I confirm that I am at least {minimumAge} years of age",id:"KomV7lUi/T"},{minimumAge:c}),labelClassName:"border-0.5 border-border-200 rounded-xl py-3 px-3.5 text-sm items-center text-text-300 hover:text-text-100 hover:border-border-100 transition-colors",checked:b,onChange:e=>{M(e)},id:"age-verification",testId:"age-verification"})}export{x as A,d as D,c as F,m as I};
