import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{Ct as n,Dt as r,Et as i,St as a,Tt as o,bt as s,xt as c,yt as l}from"./StreamlitMarkdown.CwaSe4JX.js";import{r as u,t as d}from"./Autocomplete.BaNFm-08.js";import{t as f}from"./Label.CGzIOlkG.js";import{t as p}from"./Text.CGzIOlkG.js";import{n as m,o as h}from"./useFormValidation.B5xiRxcJ.js";import{fn as g,ln as _,mn as v}from"./index.BfkDCGNp.js";var y=e(t(),1),b=(0,y.createContext)({}),x=(0,y.createContext)(null),S=u(function(e,t){[e,t]=c(e,t,x);let{validationBehavior:u}=r(m)||{},S=e.validationBehavior??u??`native`,C=(0,y.useRef)(null);[e,C]=c(e,C,d);let[w,T]=n(!e[`aria-label`]&&!e[`aria-labelledby`]),[E,D]=(0,y.useState)(`input`),{labelProps:O,inputProps:k,descriptionProps:A,errorMessageProps:j,...M}=_({...i(e),inputElementType:E,label:T,validationBehavior:S},C),N=(0,y.useCallback)(e=>{C.current=e,e&&D(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[C]),P=a({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:M.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),F=l(e,{global:!0});return delete F.id,y.createElement(o.div,{...F,...P,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":M.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},y.createElement(s,{values:[[f,{...O,ref:w}],[g,{...k,ref:N}],[b,{...k,ref:N}],[v,{role:`presentation`,isInvalid:M.isInvalid,isDisabled:e.isDisabled||!1}],[p,{slots:{description:A,errorMessage:j}}],[h,M]]},P.children))});export{S as t};