import{c as d,j as m,az as b,aA as C,aB as j,r as f,S as v,aC as N,aD as h}from"./index-_B-Zy6Ft.js";import{c as u}from"./button-B3OIs7uK.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=a):a=e[4];let r;return e[5]!==o||e[6]!==a?(r=m.jsx(b,{"data-slot":"label",className:a,...o}),e[5]=o,e[6]=a,e[7]=r):r=e[7],r}const y=C,I=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let a;e[4]!==s?(a=m.jsx(j,{...s}),e[4]=s,e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==a?(r=m.jsx(I.Provider,{value:o,children:a}),e[6]=o,e[7]=a,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(I),s=f.useContext($),{getFieldState:o}=N();let a;t[0]!==e.name?(a={name:e.name},t[0]=e.name,t[1]=a):a=t[1];const r=h(a);let n;t[2]!==e.name||t[3]!==r||t[4]!==o?(n=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=n):n=t[5];const l=n;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},$=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=f.useId();let r;e[3]!==a?(r={id:a},e[3]=a,e[4]=r):r=e[4];let n;e[5]!==s?(n=u("grid gap-2",s),e[5]=s,e[6]=n):n=e[6];let l;e[7]!==o||e[8]!==n?(l=m.jsx("div",{"data-slot":"form-item",className:n,...o}),e[7]=o,e[8]=n,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=m.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:a,formItemId:r}=x(),n=!!a;let l;e[3]!==s?(l=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==n||e[8]!==l?(i=m.jsx(S,{"data-slot":"form-label","data-error":n,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:a,formDescriptionId:r,formMessageId:n}=x(),l=o?`${r} ${n}`:`${r}`,i=!!o;let c;return e[2]!==a||e[3]!==s||e[4]!==l||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:a,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=a,e[3]=s,e[4]=l,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:a}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let n;return e[5]!==a||e[6]!==o||e[7]!==r?(n=m.jsx("p",{"data-slot":"form-description",id:a,className:r,...o}),e[5]=a,e[6]=o,e[7]=r,e[8]=n):n=e[8],n}function z(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:a,formMessageId:r}=x(),n=a?String(a?.message??""):o.children;if(!n)return null;let l;e[3]!==s?(l=u("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==l?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:n}),e[5]=n,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,S as L,y as a,M as b,L as c,P as d,R as e,z as f};
