1import{r as e}from"./rolldown-runtime-C60lm6uB.js";import{i as t,r as n}from"./framework-D_rUT4EX.js";import{C as r,o as i,s as a,v as o}from"./button-CaXgBm2Q.js";import{f as s,o as c,r as l,t as u}from"./utils-JQccsTV3.js";import{t as d}from"./useRefWithInit-C8C2XJMj.js";import{_ as f,f as p,g as m,h,m as g,p as _,s as v,t as y}from"./createBaseUIEventDetails-dVAdOM-t.js";import{t as b}from"./useBaseUiId-BkkcxrRx.js";var x=e(t(),1);function S(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:l}=p(),u=b(t),f=n?i:void 0,m=d(()=>Symbol()),h=x.useRef(!1),g=x.useRef(t!=null),_=a(()=>{!h.current||l===c||(h.current=!1,l(m.current,void 0))});return s(()=>{if(l===c)return;let e;if(n){let n=r?.current;e=o(n)&&n.closest(`label`)!=null?t??null:f??u}else if(t!=null)g.current=!0,e=t;else if(g.current)e=u;else{_();return}if(e===void 0){_();return}h.current=!0,l(m.current,e)},[t,r,f,l,n,u,m,_]),x.useEffect(()=>_,[_]),i??u}function C(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function w(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&r(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function T(e){return`composedPath`in e?e.composedPath()[0]:e.target}var E=x.forwardRef(function(e,t){let{render:n,className:r,id:o,name:c,value:u,disabled:d=!1,onValueChange:b,defaultValue:w,autoFocus:T=!1,style:E,...D}=e,{state:O,name:k,disabled:A,setTouched:j,setDirty:M,validityData:N,setFocused:P,setFilled:F,validationMode:I,validation:L}=h(),{clearErrors:R}=_(),z=A||d,B=k??c,V={...O,disabled:z},{labelId:H}=p(),U=S({id:o});s(()=>{let e=u!=null;L.inputRef.current?.value||e&&u!==``?F(!0):e&&u===``&&F(!1)},[L.inputRef,F,u]);let W=x.useRef(null);s(()=>{T&&W.current===C(i(W.current))&&P(!0)},[T,P]);let[G]=f({controlled:u,default:w,name:`FieldControl`,state:`value`}),K=u!==void 0,q=K?G:void 0,J=a(()=>L.inputRef.current?.value);return g(L.inputRef,U,q,J,!z,c),l(`input`,e,{ref:[t,W],state:V,props:[{id:U,disabled:z,name:B,ref:L.inputRef,"aria-labelledby":H,autoFocus:T,...K?{value:q}:{defaultValue:w},onChange(e){let t=e.currentTarget.value;b?.(t,y(v,e.nativeEvent)),M(t!==(N.initialValue??``)),F(t!==``),e.nativeEvent.defaultPrevented||(R(B),L.change(t))},onFocus(){P(!0)},onBlur(e){j(!0),P(!1),I===`onBlur`&&L.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(j(!0),L.commit(e.currentTarget.value))}},D,e=>L.getValidationProps(z,e)],stateAttributesMapping:m})}),D=n(),O=x.forwardRef(function(e,t){return(0,D.jsx)(E,{ref:t,...e})});function k({className:e,type:t,...n}){return(0,D.jsx)(O,{type:t,"data-slot":`input`,className:u(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}export{S as a,T as i,C as n,w as r,k as t};
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.