import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Mi as t,ki as r}from"./vendor-frame-CwiylG4Y.js";import{nn as s,rn as a}from"./vendor-all-2-BJdkbLSj.js";import{Tu as o}from"./shared-4-6CEyRAHb.js";import{nn as i,tn as n}from"./shared-13-Uoqh3mCb.js";import{n as m,r as d}from"./cbc4150d0-DH4l_q2H.js";var l=e(t()),c=r();function x({setIsValidAge:e,errorMessage:t}){const{minimumAge:r,useBirthdatePicker:x}=i(),[u,f]=(0,l.useState)(null),g=u instanceof Date,h=g&&n(u,r),[j,b]=(0,l.useState)(!1),p=a();return(0,l.useEffect)(()=>{e(x?h:j)},[j,h,e,x]),x?(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsxs)("div",{className:"border-0.5 border-border-200 inline-flex items-center justify-center gap-2 rounded-xl px-3 py-2",children:[(0,c.jsx)("div",{className:"select-none text-sm text-text-200",children:(0,c.jsx)(s,{defaultMessage:"Enter your birthdate",id:"I84av1m3Qh"})}),(0,c.jsx)("div",{className:"shrink grow basis-0 text-right text-sm text-text-400",children:(0,c.jsx)(d,{onChange:f,value:u})})]}),g&&!h&&(0,c.jsx)(m,{children:t??(0,c.jsx)(s,{defaultMessage:"You cannot create an account because you do not meet the minimum age requirement.",id:"DoatyX0etY"})})]}):(0,c.jsx)(o,{label:p.formatMessage({defaultMessage:"I confirm that I am at least {minimumAge} years of age",id:"KomV7lUi/T"},{minimumAge:r}),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:j,onChange:e=>{b(e)},id:"age-verification",testId:"age-verification"})}export{x as t};