@react-solutions/inputs 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var _n=Object.defineProperty,Zn=Object.defineProperties;var Jn=Object.getOwnPropertyDescriptors;var Pt=Object.getOwnPropertySymbols;var Zt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var _t=(e,l,i)=>l in e?_n(e,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[l]=i,r=(e,l)=>{for(var i in l||(l={}))Zt.call(l,i)&&_t(e,i,l[i]);if(Pt)for(var i of Pt(l))Jt.call(l,i)&&_t(e,i,l[i]);return e},p=(e,l)=>Zn(e,Jn(l));var x=(e,l)=>{var i={};for(var a in e)Zt.call(e,a)&&l.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&Pt)for(var a of Pt(e))l.indexOf(a)<0&&Jt.call(e,a)&&(i[a]=e[a]);return i};import{memo as or}from"react";import{Controller as nr}from"react-hook-form";import{FormControl as Qn,InputAdornment as Qt,TextField as jn}from"@mui/material";import{forwardRef as er,memo as tr,useCallback as jt,useMemo as Te}from"react";import{jsx as Tt}from"react/jsx-runtime";var eo=tr(er((Z,X)=>{var $=Z,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onEnterPress:u,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:c="outlined",size:F,color:f="primary",fullWidth:b=!0,required:y,multiline:g=!1,rows:T,minRows:S,maxRows:L,resize:N="both",maxLength:V,minLength:z,type:H="text",autoComplete:J="off",startAdornment:D,endAdornment:B,inputStyles:A,formControlStyles:q,slotProps:W,slots:M,textTransform:_}=$,O=x($,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textTransform"]);let E=jt(C=>{C.key==="Enter"&&!g&&u&&u(i),O.onKeyDown&&O.onKeyDown(C)},[g,u,i,O.onKeyDown]),h=jt(C=>{if(a)if(_){let{value:w}=C.target,k=w;switch(_){case"uppercase":k=w.toUpperCase();break;case"lowercase":k=w.toLowerCase();break;case"capitalize":k=w.replace(/\b\w/g,U=>U.toUpperCase());break}C.target.value=k,a(C)}else a(C)},[a,_]),v=Te(()=>r({maxLength:V,minLength:z},O.inputProps||{}),[V,z,O]),I=Te(()=>D?Tt(Qt,{position:"start",children:D}):void 0,[D]),G=Te(()=>B?Tt(Qt,{position:"end",children:B}):void 0,[B]),R=Te(()=>p(r({},W),{input:r(r(p(r({},W==null?void 0:W.input),{inputProps:v}),I&&{startAdornment:I}),G&&{endAdornment:G})}),[W,v,I,G]),K=Te(()=>g?p(r({},A),{"& textarea":{resize:N}}):A,[g,A,N]),P=Te(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Tt(Qn,{error:!!t,disabled:o,required:y,fullWidth:b,sx:q,children:Tt(jn,p(r({},O),{name:e,label:l,value:i,onChange:h,onFocus:m,onBlur:d,onKeyDown:E,placeholder:s,variant:c,size:F,color:f,fullWidth:b,required:y,error:!!t,disabled:o,multiline:g,rows:T,minRows:S,maxRows:L,type:g?void 0:H,autoComplete:J,slotProps:R,slots:M,sx:K,ref:X,helperText:P}))})}));eo.displayName="TextInputField";var de=eo;import{jsx as to}from"react/jsx-runtime";var oo=or(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a="",onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return to(nr,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return to(de,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:"",onChange:b=>{n.onChange(b),m==null||m(b.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});oo.displayName="FormInputTextField";var Je=oo;import{memo as rr}from"react";import{Controller as lr}from"react-hook-form";import{jsx as no}from"react/jsx-runtime";var ro=rr(s=>{var c=s,{name:e,label:l,control:i,rows:a,minRows:m,maxRows:d,resize:u,defaultValue:t="",onChange:n}=c,o=x(c,["name","label","control","rows","minRows","maxRows","resize","defaultValue","onChange"]);return no(lr,{name:e,control:i,defaultValue:t,render:({field:F,fieldState:{error:f}})=>{var T;let g=o,{size:b}=g,y=x(g,["size"]);return no(de,p(r({},y),{name:e,label:l,value:(T=F.value)!=null?T:"",onChange:S=>{F.onChange(S),n==null||n(S.target.value)},onBlur:F.onBlur,multiline:!0,rows:a,minRows:m,maxRows:d,resize:u,size:b,error:f,helperText:f==null?void 0:f.message}))}})});ro.displayName="FormInputTextArea";var Qe=ro;import{memo as gr}from"react";import{Controller as xr}from"react-hook-form";import ar from"@mui/icons-material/Visibility";import ir from"@mui/icons-material/VisibilityOff";import{FormControl as sr,FormHelperText as lo,IconButton as mr,InputAdornment as ur,TextField as pr}from"@mui/material";import{forwardRef as dr,useState as cr,memo as fr,useCallback as ao,useMemo as Rt}from"react";import{jsx as xe,jsxs as io}from"react/jsx-runtime";var Fr=e=>{if(!e)return"weak";let l=0;return e.length>=8&&l++,e.length>=12&&l++,/[a-z]/.test(e)&&l++,/[A-Z]/.test(e)&&l++,/[0-9]/.test(e)&&l++,/[^a-zA-Z0-9]/.test(e)&&l++,l<=2?"weak":l<=4?"medium":l<=5?"strong":"very-strong"},br=e=>{switch(e){case"weak":return"#f44336";case"medium":return"#ff9800";case"strong":return"#4caf50";case"very-strong":return"#2196f3";default:return"#9e9e9e"}},so=fr(dr((M,W)=>{var _=M,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onVisibilityToggle:u,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:c="outlined",size:F,color:f,fullWidth:b=!0,required:y,showPasswordStrength:g=!1,minLength:T,maxLength:S,defaultShowPassword:L=!1,visibilityIcon:N=xe(ar,{}),visibilityOffIcon:V=xe(ir,{}),iconButtonProps:z,getPasswordStrength:H=Fr,inputStyles:J,formControlStyles:D,slotProps:B,slots:A}=_,q=x(_,["name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","visibilityOffIcon","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots"]);let[O,X]=cr(L),Z=ao(()=>{X(R=>{let K=!R;return u&&u(K),K})},[u]),$=Rt(()=>g?H(i):null,[g,i]),E=()=>{if(!$||!i)return null;let R=br($),K=$.charAt(0).toUpperCase()+$.slice(1).replace("-"," ");return xe("div",{style:{marginTop:"4px",fontSize:"0.75rem"},children:io("span",{style:{color:R,fontWeight:500},children:["Strength: ",K]})})},h=ao(R=>{let K=R.target.value;S&&K.length>S||a&&a(R)},[S,a]),v=Rt(()=>xe(ur,{position:"end",children:xe(mr,p(r({onClick:Z,onMouseDown:R=>R.preventDefault(),edge:"end",disabled:o},z),{children:O?V:N}))}),[Z,o,z,O,V,N]),I=Rt(()=>{var R;return p(r({},B),{input:p(r(r({},B==null?void 0:B.input),T||S?{inputProps:r(r({minLength:T,maxLength:S},((R=B==null?void 0:B.input)==null?void 0:R.inputProps)||{}),q.inputProps||{})}:{}),{endAdornment:v})})},[B,T,S,q,v]),G=Rt(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return io(sr,{fullWidth:b,error:!!t,disabled:o,required:y,sx:D,children:[xe(pr,p(r({},q),{name:e,label:l,type:O?"text":"password",value:i,onChange:h,onFocus:m,onBlur:d,placeholder:s,variant:c,size:F,color:f,fullWidth:b,required:y,error:!!t,disabled:o,slotProps:I,slots:A,sx:J,ref:W,helperText:G})),g&&E(),t&&!n&&t.message&&xe(lo,{children:t.message}),!t&&n&&xe(lo,{children:n})]})}));so.displayName="PasswordField";var Re=so;import{jsx as mo}from"react/jsx-runtime";var uo=gr(t=>{var n=t,{name:e,label:l,control:i,size:a,defaultValue:m="",onChange:d}=n,u=x(n,["name","label","control","size","defaultValue","onChange"]);return mo(xr,{name:e,control:i,defaultValue:m,render:({field:o,fieldState:{error:s}})=>{var b;let f=u,{size:c}=f,F=x(f,["size"]);return mo(Re,p(r({},F),{name:e,label:l,value:(b=o.value)!=null?b:"",onChange:y=>{o.onChange(y),d==null||d(y.target.value)},onBlur:o.onBlur,error:s,helperText:s==null?void 0:s.message,size:a!=null?a:c}))}})});uo.displayName="FormInputPasswordField";var je=uo;import{memo as Lr}from"react";import{Controller as Br}from"react-hook-form";import{FormControl as yr,InputAdornment as po,TextField as vr}from"@mui/material";import{forwardRef as Cr,useState as hr,useEffect as Ir,useCallback as Pr,memo as Tr,useMemo as Pe}from"react";import{jsx as Et}from"react/jsx-runtime";var ce=e=>e.replace(/\D/g,""),co=(e,l)=>{if(!l||!e)return e;let i="",a=0;for(let m=0;m<l.length&&a<e.length;m++)l[m]==="X"?(i+=e[a],a++):i+=l[m];return i},Rr=e=>e?e.replace(/X/g,"0"):"",Er=e=>{let l=ce(e);return l.length<=3?l:l.length<=6?`(${l.slice(0,3)}) ${l.slice(3)}`:`(${l.slice(0,3)}) ${l.slice(3,6)}-${l.slice(6,10)}`},Sr=e=>{var a;let l=e.replace(/\D/g,"");return(((a=l.match(/.{1,4}/g))==null?void 0:a.join(" "))||l).slice(0,19)},fo=(e,l=!0)=>{let i=e.replace(/[^\d.]/g,"");if(!l)return i.replace(/\D/g,"");let a=i.split(".");return a.length>2?a[0]+"."+a.slice(1).join(""):a.length===2&&a[1].length>2?a[0]+"."+a[1].slice(0,2):i},wr=e=>{let l=e.replace(/\D/g,"");return l.length<=3?l:l.length<=5?`${l.slice(0,3)}-${l.slice(3)}`:`${l.slice(0,3)}-${l.slice(3,5)}-${l.slice(5,9)}`},Dr=e=>{let l=e.replace(/\D/g,"");return l.length<=5?l:`${l.slice(0,5)}-${l.slice(5,9)}`},kr=e=>e.replace(/\D/g,"").slice(0,3),Fo=Tr(Cr((O,_)=>{var X=O,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onEnterPress:u,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:c="outlined",size:F,color:f="primary",fullWidth:b=!0,required:y,pattern:g="integer",customPattern:T,customFormatter:S,min:L,max:N,step:V,allowDecimals:z=!0,decimalPlaces:H=2,startAdornment:J,endAdornment:D,inputStyles:B,formControlStyles:A,slotProps:q,slots:W}=X,M=x(X,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","customPattern","customFormatter","min","max","step","allowDecimals","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let[Z,$]=hr(i),E=typeof g=="string"&&g.includes("X"),h=E?g:void 0,v=E?void 0:g,I=Pr(Y=>{if(!Y)return"";if(h){let oe=ce(Y);return co(oe,h)}switch(v){case"phone":return Er(Y);case"credit-card":return Sr(Y);case"currency":return fo(Y,z);case"ssn":return wr(Y);case"zip-code":return Dr(Y);case"percentage":return kr(Y);case"decimal":return fo(Y,z);case"integer":return ce(Y);case"custom":return S?S(Y):ce(Y);default:return ce(Y)}},[h,v,z,S,T]);Ir(()=>{let Y=I(i);$(oe=>oe!==Y?Y:oe)},[i,I]);let G=(Y,oe)=>{if(["Backspace","Delete","Tab","Escape","Enter"].includes(oe)||oe==="a"||oe==="c"||oe==="v"||oe==="x"||(v==="decimal"||v==="currency")&&z&&oe===".")return!0;if(!/^\d$/.test(oe))return!1;if(h){let ne=(h.match(/X/g)||[]).length;return ce(Y).length<ne}if(v==="custom"&&T){let ne=Y+oe;return T.test(ne)}return!0},R=Y=>{let oe=Y.target.value,ne=I(oe);$(ne);let ie=h?ce(oe):ne,ue=p(r({},Y),{target:p(r({},Y.target),{value:ie}),currentTarget:p(r({},Y.currentTarget),{value:ie})});a&&a(ue)},K=Y=>{if(o)return;Y.preventDefault();let oe=Y.clipboardData.getData("text"),ne=ce(oe),ie=h?(h.match(/X/g)||[]).length:void 0,ue=ie?ne.slice(0,ie):ne,At=h?co(ue,h):I(ue);$(At);let Q=p(r({},Y),{target:p(r({},Y.target),{value:ue}),currentTarget:p(r({},Y.currentTarget),{value:ue})});a&&a(Q)},P=Y=>{let oe=Y.currentTarget.querySelector("input");if(!oe)return;let ne=oe.value||"",ie=Y.key;if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(ie)){ie==="Enter"&&u&&u(Z),M.onKeyDown&&M.onKeyDown(Y);return}if(Y.ctrlKey||Y.metaKey){M.onKeyDown&&M.onKeyDown(Y);return}if(!G(ne,ie)){Y.preventDefault();return}M.onKeyDown&&M.onKeyDown(Y)},C=Pe(()=>r({min:L,max:N,step:V,inputMode:v==="phone"?"tel":v==="decimal"||v==="currency"?"decimal":"numeric",maxLength:h?h.length:void 0},M.inputProps||{}),[L,N,V,v,h,M]),w=Pe(()=>J?Et(po,{position:"start",children:J}):void 0,[J]),k=Pe(()=>D?Et(po,{position:"end",children:D}):void 0,[D]),U=Pe(()=>p(r({},q),{input:r(r(p(r({},q==null?void 0:q.input),{inputProps:C}),w&&{startAdornment:w}),k&&{endAdornment:k})}),[q,C,w,k]),j=Pe(()=>v==="phone"?"tel":"text",[v]),le=Pe(()=>s||(h?Rr(h):s),[s,h]),me=Pe(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Et(yr,{error:!!t,disabled:o,required:y,fullWidth:b,sx:A,children:Et(vr,p(r({},M),{name:e,label:l,value:Z,onChange:R,onFocus:m,onBlur:d,onKeyDown:P,onPaste:K,placeholder:le,variant:c,size:F,color:f,fullWidth:b,required:y,error:!!t,disabled:o,type:j,autoComplete:"off",slotProps:U,slots:W,sx:B,ref:_,helperText:me}))})}));Fo.displayName="NumberField";var Ee=Fo;import{jsx as bo}from"react/jsx-runtime";var go=Lr(F=>{var f=F,{name:e,label:l,control:i,pattern:a,min:m,max:d,step:u,allowDecimals:t,decimalPlaces:n,defaultValue:o="",onChange:s}=f,c=x(f,["name","label","control","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange"]);return bo(Br,{name:e,control:i,defaultValue:o,render:({field:b,fieldState:{error:y}})=>{var L;let S=c,{size:g}=S,T=x(S,["size"]);return bo(Ee,p(r({},T),{name:e,label:l,value:(L=b.value)!=null?L:"",onChange:N=>{b.onChange(N),s==null||s(N.target.value)},onBlur:b.onBlur,pattern:a,min:m,max:d,step:u,allowDecimals:t,decimalPlaces:n,size:g,error:y,helperText:y==null?void 0:y.message}))}})});go.displayName="FormInputNumberField";var et=go;import{memo as qr}from"react";import{Controller as Gr}from"react-hook-form";import{FormControl as Mr,InputAdornment as zt,TextField as Hr}from"@mui/material";import{forwardRef as Ar,useState as zr,useEffect as Or,useRef as Nr,memo as Vr,useCallback as Ot,useMemo as Se}from"react";import{jsx as tt}from"react/jsx-runtime";var St=e=>e.replace(/\D/g,""),Nt=(e,l)=>{if(!l||!e)return e;let i="",a=0;for(let m=0;m<l.length&&a<e.length;m++)l[m]==="X"?(i+=e[a],a++):i+=l[m];return i},Wr=e=>e?e.replace(/X/g,"0"):"0000000000",xo=Vr(Ar((W,q)=>{var M=W,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onEnterPress:u,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:c="outlined",size:F,color:f="primary",fullWidth:b=!0,required:y,pattern:g="XXXXXXXXXX",maxLength:T,countryCode:S="+1",showCountryCode:L=!1,startAdornment:N,endAdornment:V,inputStyles:z,formControlStyles:H,countryCodeStyles:J,slotProps:D,slots:B}=M,A=x(M,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots"]);let[_,O]=zr(""),X=Nr(null),Z=T||(g?g.length:15);Or(()=>{let C=St(i),w=g?Nt(C,g):C;O(k=>k!==w?w:k),X.current&&setTimeout(()=>{if(X.current){let k=w.length;X.current.setSelectionRange(k,k)}},0)},[i,g]);let $=Ot(C=>{if(o)return;let w=C.target.value,k=St(w),U=Z?k.slice(0,Z):k,j=g?Nt(U,g):U;O(j);let le=p(r({},C),{target:p(r({},C.target),{value:U}),currentTarget:p(r({},C.currentTarget),{value:U})});a&&a(le)},[o,Z,g,a]),E=Ot(C=>{if(o)return;C.preventDefault();let w=C.clipboardData.getData("text"),k=St(w),U=Z?k.slice(0,Z):k,j=g?Nt(U,g):U;O(j);let le=p(r({},C),{target:p(r({},C.target),{value:U}),currentTarget:p(r({},C.currentTarget),{value:U})});a&&a(le)},[o,Z,g,a]),h=Ot(C=>{if(o)return;let w=C.key,k=/[0-9]/.test(w),U=w==="Backspace"||w==="Delete"||w==="Tab"||w==="Escape"||w==="Enter"||w==="ArrowLeft"||w==="ArrowRight"||w==="ArrowUp"||w==="ArrowDown"||w==="Home"||w==="End"||(C.ctrlKey||C.metaKey)&&(w==="a"||w==="c"||w==="v"||w==="x");if(!k&&!U){C.preventDefault();return}w==="Enter"&&u&&u(St(_)),A.onKeyDown&&A.onKeyDown(C)},[o,u,_,A.onKeyDown]),v=Se(()=>r({maxLength:Z,inputMode:"tel",autoComplete:"tel"},A.inputProps||{}),[Z,A]),I=Se(()=>L?tt(zt,{position:"start",sx:J,children:S}):N?tt(zt,{position:"start",children:N}):void 0,[L,J,S,N]),G=Se(()=>V?tt(zt,{position:"end",children:V}):void 0,[V]),R=Se(()=>p(r({},D),{input:r(r(p(r({},D==null?void 0:D.input),{inputProps:v}),I&&{startAdornment:I}),G&&{endAdornment:G})}),[D,v,I,G]),K=Se(()=>s||(g?Wr(g):""),[s,g]),P=Se(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return tt(Mr,{error:!!t,disabled:o,required:y,fullWidth:b,sx:H,children:tt(Hr,p(r({},A),{name:e,label:l,value:_,onChange:$,onFocus:m,onBlur:d,onKeyDown:h,onPaste:E,placeholder:K,variant:c,size:F,color:f,fullWidth:b,required:y,error:!!t,disabled:o,type:"tel",autoComplete:"tel",slotProps:R,slots:B,sx:z,ref:q,inputRef:X,helperText:P}))})}));xo.displayName="TeliField";var we=xo;import{jsx as yo}from"react/jsx-runtime";var vo=qr(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a="",onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return yo(Gr,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return yo(we,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:"",onChange:b=>{n.onChange(b),m==null||m(b.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});vo.displayName="FormInputTelField";var ot=vo;import{memo as jr}from"react";import{Controller as el}from"react-hook-form";import Kr from"@mui/icons-material/Close";import Xr from"@mui/icons-material/Search";import{FormControl as $r,IconButton as Co,InputAdornment as Ur,TextField as Yr}from"@mui/material";import{forwardRef as _r,useEffect as Zr,useRef as Vt,memo as Jr,useCallback as De,useMemo as ho}from"react";import{jsx as ke,jsxs as Qr}from"react/jsx-runtime";var Io=Jr(_r((Z,X)=>{var $=Z,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onSearch:u,onClear:t,onEnterPress:n,error:o,helperText:s,disabled:c=!1,placeholder:F,variant:f="outlined",size:b,color:y="primary",fullWidth:g=!0,required:T,showClearButton:S=!0,showSearchButton:L=!0,clearIcon:N,searchIcon:V,clearButtonProps:z,searchButtonProps:H,enableDebounce:J=!0,debounceDelay:D=300,enableThrottle:B=!1,throttleDelay:A=300,inputStyles:q,formControlStyles:W,slotProps:M,slots:_}=$,O=x($,["name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots"]);let E=Vt(null),h=Vt(null),v=Vt(0);Zr(()=>()=>{E.current&&clearTimeout(E.current),h.current&&clearTimeout(h.current)},[]);let I=De(U=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{u&&u(U)},D)},[u,D]),G=De(U=>{let j=Date.now(),le=j-v.current;le>=A?(v.current=j,u&&u(U)):(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{v.current=Date.now(),u&&u(U)},A-le))},[u,A]),R=De(U=>{let j=U.target.value;a&&a(U),u&&(J&&!B?I(j):B&&!J?G(j):J&&B?I(j):u(j))},[a,u,J,B,I,G]),K=De(()=>{E.current&&(clearTimeout(E.current),E.current=null),h.current&&(clearTimeout(h.current),h.current=null),t&&t(),u&&u(""),a&&a({target:{value:"",name:e||""},currentTarget:{value:"",name:e||""}})},[t,u,a,e,E,h]),P=De(()=>{E.current&&(clearTimeout(E.current),E.current=null),h.current&&(clearTimeout(h.current),h.current=null),u&&u(i)},[u,i,E,h]),C=De(U=>{U.key==="Enter"&&(E.current&&(clearTimeout(E.current),E.current=null),h.current&&(clearTimeout(h.current),h.current=null),n&&n(i),u&&u(i)),O.onKeyDown&&O.onKeyDown(U)},[n,u,i,E,h,O.onKeyDown]),w=ho(()=>Qr(Ur,{position:"end",children:[S&&i&&ke(Co,p(r({onClick:K,disabled:c,edge:"end",size:b},z),{children:N||ke(Kr,{})})),L&&ke(Co,p(r({onClick:P,disabled:c,edge:"end",size:b},H),{children:V||ke(Xr,{})}))]}),[S,i,K,c,b,z,N,L,P,H,V]),k=ho(()=>s!=null?s:o!=null&&o.message?o.message:void 0,[s,o==null?void 0:o.message]);return ke($r,{error:!!o,disabled:c,required:T,fullWidth:g,sx:W,children:ke(Yr,p(r({},O),{name:e,label:l,value:i,onChange:R,onFocus:m,onBlur:d,onKeyDown:C,placeholder:F,variant:f,size:b,color:y,fullWidth:g,required:T,error:!!o,disabled:c,slotProps:p(r({},M),{input:p(r({},M==null?void 0:M.input),{endAdornment:w})}),slots:_,sx:q,ref:X,helperText:k}))})}));Io.displayName="SearchField";var Le=Io;import{jsx as Po}from"react/jsx-runtime";var To=jr(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a="",onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return Po(el,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return Po(Le,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:"",onChange:b=>{n.onChange(b),m==null||m(b.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});To.displayName="FormInputSearchField";var nt=To;import{memo as ll}from"react";import{Controller as al}from"react-hook-form";import{FormControl as tl,FormHelperText as Ro,TextField as ol,Box as Eo}from"@mui/material";import{forwardRef as nl,useState as rl,useRef as Be,useEffect as wt}from"react";import{jsx as rt,jsxs as So}from"react/jsx-runtime";var wo=nl((A,B)=>{var q=A,{name:e,label:l,value:i,onChange:a,onComplete:m,onFocus:d,onBlur:u,onEnterPress:t,error:n,helperText:o,disabled:s=!1,variant:c="outlined",size:F,color:f="primary",fullWidth:b=!0,required:y,length:g=6,spacing:T=1,autoFocus:S=!1,autoSubmit:L=!1,containerStyles:N,inputStyles:V,formControlStyles:z,slotProps:H,slots:J}=q,D=x(q,["name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots"]);let[W,M]=rl(Array(g).fill("")),_=Be([]),O=Be(""),X=Be(!1),Z=Be(Array(g).fill("")),$=Be(!1),E=Be(null);wt(()=>{Z.current=W},[W]),wt(()=>{let P=Z.current.join("");if($.current){if(i===O.current)return;let C=P,w=i||"";if(C===w&&C.length>0||w.length===C.length&&w===O.current)return}if(!(X.current&&(X.current=!1,i===O.current))&&i!==P)if(i){let C=i.split("").slice(0,g),w=[...C,...Array(g-C.length).fill("")];M(w)}else M(Array(g).fill(""))},[i,g]),wt(()=>{S&&_.current[0]&&_.current[0].focus()},[S]),wt(()=>()=>{E.current&&clearTimeout(E.current)},[]);let h=(P,C)=>{if(s)return;let w=C.target.value;if(w===""){v(P,"",!1);return}let k=w.slice(-1);/^\d$/.test(k)&&v(P,k,!0)},v=(P,C,w=!0)=>{let k=[...W];k[P]=C,X.current=!0,$.current=!0,E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{$.current=!1},500),M(k);let U=k.join("");O.current=U,a&&a(U),C&&P<g-1&&w&&setTimeout(()=>{var j;(j=_.current[P+1])==null||j.focus()},0),k.every(j=>j!=="")&&(m&&m(U),L&&t&&t(U))},I=(P,C)=>{var k,U,j;if(s)return;let w=C.key;if(w==="Backspace"){W[P]===""&&P>0?((k=_.current[P-1])==null||k.focus(),v(P-1,"",!1)):v(P,"",!1),C.preventDefault();return}if(w==="Delete"){v(P,"",!1),C.preventDefault();return}if(w==="ArrowLeft"&&P>0){(U=_.current[P-1])==null||U.focus(),C.preventDefault();return}if(w==="ArrowRight"&&P<g-1){(j=_.current[P+1])==null||j.focus(),C.preventDefault();return}if(w==="Enter"&&t){let le=W.join("");t(le);return}(C.ctrlKey||C.metaKey)&&w==="v"||/^\d$/.test(w)||["Tab","Escape","Home","End"].includes(w)||C.preventDefault()},G=(P,C)=>{var oe;if(s)return;C.preventDefault();let k=C.clipboardData.getData("text").replace(/\D/g,"").slice(0,g);if(k.length===0)return;let U=[...W],j=P;for(let ne=0;ne<k.length&&j+ne<g;ne++)U[j+ne]=k[ne];M(U);let le=U.join("");a&&a(le);let me=U.findIndex(ne=>ne===""),Y=me!==-1?me:Math.min(j+k.length,g-1);(oe=_.current[Y])==null||oe.focus(),U.every(ne=>ne!=="")&&(m&&m(le),L&&t&&t(le))},R=(P,C)=>{C.target.select(),d&&d(C)},K=(P,C)=>{u&&u(C)};return So(tl,{error:!!n,disabled:s,required:y,fullWidth:b,sx:z,children:[l&&So(Eo,{component:"label",sx:{mb:1,display:"block"},children:[l,y&&rt("span",{style:{color:"error.main"},children:" *"})]}),rt(Eo,{ref:B,sx:r({display:"flex",gap:T,justifyContent:"flex-start"},N),children:W.map((P,C)=>{var w;return rt(ol,r({inputRef:k=>{_.current[C]=k},name:e?`${e}-${C}`:void 0,value:P,onChange:k=>h(C,k),onKeyDown:k=>I(C,k),onPaste:k=>G(C,k),onFocus:k=>R(C,k),onBlur:k=>K(C,k),variant:c,size:F,color:f,error:!!n,disabled:s,required:y,slotProps:p(r({},H),{input:p(r({},H==null?void 0:H.input),{inputProps:r({maxLength:1,inputMode:"numeric",pattern:"[0-9]*",style:{textAlign:"center",fontSize:F==="small"?"1rem":"1.25rem",fontWeight:"bold"}},((w=H==null?void 0:H.input)==null?void 0:w.inputProps)||{})})}),slots:J,sx:r({width:F==="small"?"40px":"48px"},V)},D),C)})}),n&&rt(Ro,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&rt(Ro,{children:o})]})});wo.displayName="OTPField";var Me=wo;import{jsx as Do}from"react/jsx-runtime";var ko=ll(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a="",onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return Do(al,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return Do(Me,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:"",onChange:b=>{n.onChange(b),m==null||m(b)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});ko.displayName="FormInputOTPField";var lt=ko;import{memo as cl,useMemo as fl}from"react";import{Controller as Fl}from"react-hook-form";import{FormControl as il,FormHelperText as Lo,InputLabel as sl,MenuItem as ml,Select as ul}from"@mui/material";import{forwardRef as pl}from"react";import{jsx as at,jsxs as dl}from"react/jsx-runtime";var Bo=pl((_,M)=>{var O=_,{name:e,label:l,value:i,onChange:a,onOpen:m,onClose:d,options:u,error:t,helperText:n,disabled:o=!1,variant:s="outlined",size:c,color:F,fullWidth:f=!0,required:b,multiple:y=!1,icon:g,renderValue:T,renderMenuItem:S,menuItemStyles:L,selectStyles:N,formControlStyles:V,labelStyles:z,slotProps:H,slots:J,displayEmpty:D=!1,autoWidth:B=!1,native:A=!1,MenuProps:q}=O,W=x(O,["name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps"]);let X=v=>{var I;if(y&&Array.isArray(v))return v.length===0?"":v.map(G=>{var K;let R=u.find(P=>P.value===G);return(K=R==null?void 0:R.name)!=null?K:String(G)}).join(", ");if(!y&&v!==""&&v!==null&&v!==void 0){let G=u.find(R=>R.value===v);return(I=G==null?void 0:G.name)!=null?I:String(v)}return""},Z=(v,I)=>{let G=typeof L=="function"?L(v,I):L;return at(ml,{value:v.value,disabled:v.disabled,sx:G,children:S?S(v,I):v.name},`${v.value}-${I}`)},$=(v,I)=>{a&&a(v,I)},E=l?`${e||"select"}-label`:void 0,h=l?`${e||"select"}-select`:void 0;return dl(il,{fullWidth:f,error:!!t,disabled:o,required:b,size:c,variant:s,sx:V,children:[l&&at(sl,{id:E,sx:z,children:l}),at(ul,p(r({},W),{labelId:E,id:h,name:e,value:i,label:l,onChange:$,onOpen:m,onClose:d,disabled:o,multiple:y,displayEmpty:D,autoWidth:B,native:A,MenuProps:q,IconComponent:g,renderValue:T!=null?T:X,slotProps:H,slots:J,sx:N,ref:M,children:u&&Array.isArray(u)&&u.map((v,I)=>Z(v,I))})),t&&at(Lo,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&at(Lo,{children:n})]})});Bo.displayName="SelectInputField";var fe=Bo;import{jsx as Mo}from"react/jsx-runtime";var Ho=cl(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:m="",onChange:d}=n,u=x(n,["name","label","control","options","defaultValue","onChange"]);let o=fl(()=>a,[a]);return Mo(Fl,{name:e,control:i,defaultValue:m,render:({field:s,fieldState:{error:c}})=>{var y;let b=u,{size:F}=b,f=x(b,["size"]);return Mo(fe,p(r({},f),{name:e,label:l,options:o,value:(y=s.value)!=null?y:"",onChange:g=>{s.onChange(g),d==null||d(g.target.value)},onBlur:s.onBlur,size:F,error:c,helperText:c==null?void 0:c.message}))}})});Ho.displayName="FormInputSelect";var it=Ho;import{memo as bl,useMemo as gl}from"react";import{Controller as xl}from"react-hook-form";import{jsx as Ao}from"react/jsx-runtime";var zo=bl(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:m=[],onChange:d}=n,u=x(n,["name","label","control","options","defaultValue","onChange"]);let o=gl(()=>a,[a]);return Ao(xl,{name:e,control:i,defaultValue:m,render:({field:s,fieldState:{error:c}})=>{let y=u,{size:F}=y,f=x(y,["size"]),b=Array.isArray(s.value)?s.value:[];return Ao(fe,p(r({},f),{name:e,label:l,options:o,multiple:!0,value:b,onChange:g=>{s.onChange(g),d==null||d(g.target.value)},onBlur:s.onBlur,size:F,error:c,helperText:c==null?void 0:c.message}))}})});zo.displayName="FormInputMultiSelect";var st=zo;import{memo as Rl}from"react";import{Controller as El}from"react-hook-form";import{Autocomplete as yl,FormControl as vl,FormHelperText as Cl,TextField as hl}from"@mui/material";import{forwardRef as Il,memo as Pl,useCallback as Wt}from"react";import{jsx as qt,jsxs as Tl}from"react/jsx-runtime";var Oo=Pl(Il((E,$)=>{var h=E,{name:e,label:l,value:i,onChange:a,onInputChange:m,onOpen:d,onClose:u,options:t,error:n,helperText:o,disabled:s=!1,placeholder:c,variant:F="outlined",size:f,color:b,fullWidth:y=!0,required:g,getOptionLabel:T,isOptionEqualToValue:S,renderOption:L,popupIcon:N,inputStyles:V,autocompleteStyles:z,formControlStyles:H,loading:J=!1,loadingText:D="Loading...",noOptionsText:B="No options",filterOptions:A,autoHighlight:q=!0,autoSelect:W=!1,disablePortal:M=!1,disableListWrap:_=!1,slotProps:O,slots:X}=h,Z=x(h,["name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots"]);let v=Wt(R=>{var K,P;return typeof R=="string"?R:(P=R==null?void 0:R.name)!=null?P:String((K=R==null?void 0:R.value)!=null?K:"")},[]),I=Wt((R,K)=>(R==null?void 0:R.name)===(K==null?void 0:K.name)&&(R==null?void 0:R.value)===(K==null?void 0:K.value),[]),G=Wt((R,K,P)=>{a&&a(R,K,P)},[a]);return Tl(vl,{fullWidth:y,error:!!n,sx:H,children:[qt(yl,p(r({options:t,value:i,onChange:G,onInputChange:m,onOpen:d,onClose:u,getOptionLabel:T||v,isOptionEqualToValue:S||I,disabled:s,loading:J,loadingText:D,noOptionsText:B,filterOptions:A,autoHighlight:q,autoSelect:W,disablePortal:M,disableListWrap:_,popupIcon:N,slotProps:O,slots:X,sx:z,ref:$},Z),{renderInput:R=>qt(hl,p(r({},R),{name:e,label:l,variant:F,size:f,color:b,placeholder:c,required:g,error:!!n,disabled:s,slotProps:{input:p(r({},R.InputProps),{inputProps:r({},R.inputProps)})},sx:V,helperText:o!=null?o:""}))})),n&&!o&&n.message&&qt(Cl,{children:n.message})]})}));Oo.displayName="AutoCompleteField";var Fe=Oo;import{jsx as No}from"react/jsx-runtime";var Vo=Rl(o=>{var s=o,{name:e,label:l,control:i,options:a=[],disabled:m,placeholder:d,defaultValue:u=null,onChange:t}=s,n=x(s,["name","label","control","options","disabled","placeholder","defaultValue","onChange"]);return No(El,{name:e,control:i,defaultValue:u,render:({field:c,fieldState:{error:F}})=>{let{value:f,onBlur:b}=c,T=n,{size:y}=T,g=x(T,["size"]);return No(Fe,p(r({name:e,label:l,placeholder:d,disabled:m,options:a,value:f!=null?f:null,size:y,error:F,helperText:F==null?void 0:F.message},g),{onChange:(S,L)=>{c.onChange(L),t==null||t(L)},onBlur:b}))}})});Vo.displayName="FormInputAutoComplete";var mt=Vo;import{memo as Sl,useMemo as wl}from"react";import{Controller as Dl}from"react-hook-form";import{jsx as Wo}from"react/jsx-runtime";var qo=Sl(o=>{var s=o,{name:e,label:l,control:i,options:a=[],disabled:m,placeholder:d,defaultValue:u=[],onChange:t}=s,n=x(s,["name","label","control","options","disabled","placeholder","defaultValue","onChange"]);let c=wl(()=>a,[a]);return Wo(Dl,{name:e,control:i,defaultValue:u,render:({field:F,fieldState:{error:f}})=>{let{value:b,onBlur:y}=F,L=n,{size:g}=L,T=x(L,["size"]),S=Array.isArray(b)?b:[];return Wo(Fe,p(r({},T),{name:e,label:l,placeholder:d,disabled:m,options:c,multiple:!0,value:S,onChange:(N,V)=>{F.onChange(V),t==null||t(V)},onBlur:y,size:g,error:f,helperText:f==null?void 0:f.message}))}})});qo.displayName="FormInputMultiAutoComplete";var ut=qo;import{memo as ql}from"react";import{Controller as Gl}from"react-hook-form";import{Box as kl,FormControl as Ll,InputAdornment as Bl,TextField as Ml}from"@mui/material";import{forwardRef as Hl,memo as Al,useCallback as Dt,useEffect as zl,useMemo as Gt,useRef as Go,useState as Ol}from"react";import{jsx as kt,jsxs as Wl}from"react/jsx-runtime";var Nl=e=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e),Vl=e=>{let l=e.replace("#","");return l.length===3&&(l=l.split("").map(i=>i+i).join("")),"#"+l},Ko=Al(Hl((W,q)=>{var M=W,{name:e,label:l,value:i,onChange:a,onFocus:m,onBlur:d,onEnterPress:u,error:t,helperText:n,disabled:o=!1,placeholder:s="#000000",variant:c="outlined",size:F,color:f="primary",fullWidth:b=!0,required:y,format:g="hex",showPreview:T=!0,showNativeInput:S=!0,showPopoverPicker:L=!0,presetColors:N=["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF"],showPresetColors:V=!1,previewStyles:z,formControlStyles:H,inputStyles:J,slotProps:D,slots:B}=M,A=x(M,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots"]);let[_,O]=Ol(i||""),X=Go(null),Z=Go(null);zl(()=>{i!==void 0&&O(i||"")},[i]);let $=Nl(_)?Vl(_):_||"",E=Dt(P=>{if(o)return;let C=P.target.value;O(C),a&&a(C)},[a]),h=Dt(P=>{if(o)return;P.stopPropagation();let C=P.target.value;O(C),a&&a(C)},[a]),v=Dt(P=>{o||(P.preventDefault(),P.stopPropagation(),X.current&&X.current.click())},[o,X]),I=Dt(P=>{P.key==="Enter"&&u&&u($),A.onKeyDown&&A.onKeyDown(P)},[u,$,A.onKeyDown]),G=Gt(()=>kt(Bl,{position:"start",children:kt(kl,{ref:Z,onClick:o?void 0:v,sx:r({width:F==="small"?24:32,height:F==="small"?24:32,borderRadius:1,border:"1px solid",borderColor:t?"error.main":"divider",backgroundColor:$,cursor:o?"default":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{opacity:o?1:.8}},z),title:o?void 0:"Click to open color picker"})}),[Z,o,v,F,t,$,z]),R=Gt(()=>{var P;return p(r({},D),{input:r(p(r({},D==null?void 0:D.input),{inputProps:r({},((P=D==null?void 0:D.input)==null?void 0:P.inputProps)||{})}),T&&{startAdornment:G})})},[D,T,G]),K=Gt(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Wl(Ll,{error:!!t,disabled:o,required:y,fullWidth:b,sx:H,children:[kt(Ml,p(r({},A),{ref:q,name:e,label:l,value:$,onChange:E,onFocus:m,onBlur:d,onKeyDown:I,placeholder:s,variant:c,size:F,color:f,fullWidth:b,required:y,error:!!t,disabled:o,slotProps:R,slots:B,sx:J,helperText:K})),kt("input",{ref:X,type:"color",value:$,onChange:h,disabled:o,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",visibility:"hidden"},"aria-hidden":"true"})]})}));Ko.displayName="ColorPickerField";var He=Ko;import{jsx as Xo}from"react/jsx-runtime";var $o=ql(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a="#000000",onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return Xo(Gl,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return Xo(He,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:a,onChange:b=>{n.onChange(b),m==null||m(b)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});$o.displayName="FormInputColorPicker";var pt=$o;import{memo as Ql,useRef as jl}from"react";import{Controller as ea}from"react-hook-form";import Kl from"@mui/icons-material/Clear";import Xl from"@mui/icons-material/CloudUpload";import{FormControl as $l,FormHelperText as Ul,IconButton as Uo,InputAdornment as Yl,TextField as _l}from"@mui/material";import{forwardRef as Zl,useRef as Jl,useState as Yo}from"react";import{jsx as ye,jsxs as Kt}from"react/jsx-runtime";var _o=Zl((h,E)=>{var v=h,{name:e,label:l,value:i,onChange:a,onFileSelect:m,onFileRemove:d,onValidationError:u,onDrop:t,error:n,helperText:o,disabled:s=!1,accept:c,multiple:F=!1,maxSize:f,minSize:b,allowedTypes:y,showPreview:g=!0,enableDragDrop:T=!1,placeholder:S="No file chosen",variant:L="outlined",size:N,color:V,fullWidth:z=!0,required:H,buttonText:J="Upload",buttonVariant:D="contained",buttonColor:B="primary",buttonSize:A,uploadIcon:q=ye(Xl,{}),inputStyles:W,buttonStyles:M,formControlStyles:_,containerStyles:O,slotProps:X,slots:Z}=v,$=x(v,["name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots"]);let I=Jl(null),[G,R]=Yo(!1),[,K]=Yo(0),P=E&&typeof E=="object"&&"current"in E?E:I,C=()=>i?i instanceof File?i.name:Array.isArray(i)?i.length===0?"":i.length===1?i[0].name:`${i.length} files selected`:typeof i=="object"&&"name"in i?i.name:"":"",w=Q=>{if(f&&Q.size>f)return`File size exceeds maximum allowed size of ${k(f)}`;if(b&&Q.size<b)return`File size is below minimum required size of ${k(b)}`;if(y&&y.length>0){let ae=Q.type||U(Q.name);if(!y.some(se=>se.startsWith(".")?Q.name.toLowerCase().endsWith(se.toLowerCase()):ae.includes(se)||ae===se))return`File type not allowed. Allowed types: ${y.join(", ")}`}return null},k=Q=>{if(Q===0)return"0 Bytes";let ae=1024,ge=["Bytes","KB","MB","GB"],se=Math.floor(Math.log(Q)/Math.log(ae));return Math.round(Q/Math.pow(ae,se)*100)/100+" "+ge[se]},U=Q=>Q.slice((Q.lastIndexOf(".")-1>>>0)+2),j=Q=>{let ae=Q.target.files;if(!ae||ae.length===0){a&&a(void 0),m&&m(void 0);return}let ge=Array.from(ae),se=[],Ut=!1;for(let Ze of ge){let Yt=w(Ze);Yt?(Ut=!0,u&&u(Yt)):se.push(Ze)}if(se.length>0){let Ze=F?se:se[0];a&&a(Ze),m&&m(Ze)}},le=()=>{var Q;s||(Q=P.current)==null||Q.click()},me=()=>{P.current&&(P.current.value=""),a&&a(void 0),d&&d()},Y=Q=>{Q.preventDefault(),Q.stopPropagation(),K(ae=>ae+1),Q.dataTransfer.items&&Q.dataTransfer.items.length>0&&R(!0)},oe=Q=>{Q.preventDefault(),Q.stopPropagation(),K(ae=>{let ge=ae-1;return ge===0&&R(!1),ge})},ne=Q=>{Q.preventDefault(),Q.stopPropagation()},ie=Q=>{if(Q.preventDefault(),Q.stopPropagation(),R(!1),K(0),s)return;let ae=Q.dataTransfer.files;ae&&ae.length>0&&(t&&t(ae),j({target:{files:ae}}))},ue=C(),At=g&&ue?ue:S;return Kt($l,{error:!!n,disabled:s,required:H,fullWidth:z,sx:_,children:[Kt("div",{style:O,onDragEnter:T?Y:void 0,onDragLeave:T?oe:void 0,onDragOver:T?ne:void 0,onDrop:T?ie:void 0,children:[ye("input",{type:"file",accept:c,multiple:F,name:e,id:e?`file-upload-${e}`:void 0,onChange:j,style:{display:"none"},ref:P,disabled:s}),ye(_l,p(r({},$),{label:l,value:At,placeholder:S,variant:L,size:N,color:V,fullWidth:z,required:H,error:!!n,disabled:s,name:e,sx:W,slotProps:p(r({},X),{input:p(r({},X==null?void 0:X.input),{readOnly:!0,endAdornment:Kt(Yl,{position:"end",children:[g&&ue&&ye(Uo,{onClick:me,disabled:s,children:ye(Kl,{})}),ye(Uo,{onClick:le,disabled:s,sx:M,children:q})]})})}),slots:Z,helperText:o!=null?o:n!=null&&n.message?n.message:void 0})),T&&G&&ye("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.05)",border:"2px dashed",borderColor:"primary.main",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:"Drop files here"})]}),n&&!o&&n.message&&ye(Ul,{children:n.message})]})});_o.displayName="FileUploadField";var Ae=_o;import{jsx as Zo}from"react/jsx-runtime";var Jo=Ql(t=>{var n=t,{name:e,label:l,control:i,size:a,defaultValue:m=null,onChange:d}=n,u=x(n,["name","label","control","size","defaultValue","onChange"]);let o=jl(null);return Zo(ea,{name:e,control:i,defaultValue:m,render:({field:s,fieldState:{error:c}})=>{var F;return Zo(Ae,p(r({},u),{name:e,label:l,value:(F=s.value)!=null?F:null,size:a,ref:o,onChange:f=>{s.onChange(f),d==null||d(f)},onBlur:s.onBlur,error:c,helperText:c==null?void 0:c.message}))}})});Jo.displayName="FormInputFileUpload";var dt=Jo;import{memo as ca}from"react";import{Controller as fa}from"react-hook-form";import ta from"@mui/icons-material/Clear";import{Box as oa,FormControl as na,FormHelperText as ra,FormLabel as la,IconButton as aa,TextField as ia}from"@mui/material";import{DatePicker as sa,LocalizationProvider as ma}from"@mui/x-date-pickers";import{AdapterDateFns as ua}from"@mui/x-date-pickers/AdapterDateFns";import pa,{forwardRef as Qo,useRef as da}from"react";import{jsx as ve,jsxs as tn}from"react/jsx-runtime";var jo=Qo((U,k)=>{var j=U,{name:e,label:l,value:i,defaultValue:a,onChange:m,onFocus:d,onBlur:u,onViewChange:t,onMonthChange:n,onYearChange:o,onOpen:s,onClose:c,error:F,helperText:f,disabled:b=!1,fullWidth:y=!0,required:g,minDate:T,maxDate:S,shouldDisableDate:L,shouldDisableMonth:N,shouldDisableYear:V,size:z="medium",variant:H="outlined",color:J="primary",placeholder:D,readOnly:B=!1,showClearButton:A=!0,disablePast:q=!1,disableFuture:W=!1,referenceDate:M,view:_,format:O,openTo:X="day",pickerStyles:Z,formControlStyles:$,formLabelStyles:E,containerStyles:h,textFieldStyles:v,slotProps:I,slots:G,title:R=!1,dateAdapter:K=ua,reduceAnimations:P=!1,autoFocus:C=!1}=j,w=x(j,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","title","dateAdapter","reduceAnimations","autoFocus"]);let le=da(null),me=ie=>{m&&m(ie)},Y=()=>{m&&m(null),le.current&&le.current.focus()},oe=D||"MM/DD/YYYY",ne=p(r({},I),{textField:p(r({},I==null?void 0:I.textField),{error:!!F,size:z,variant:H,color:J,helperText:F?f!=null?f:F.message:f,fullWidth:y,placeholder:oe,autoFocus:C,onFocus:d,onBlur:u,inputRef:k||le,clearable:A,showClear:!!i,onClear:Y,sx:r(r({},v),I!=null&&I.textField&&typeof I.textField=="object"&&"sx"in I.textField?I.textField.sx:{}),InputProps:r({},I!=null&&I.textField&&typeof I.textField=="object"&&"InputProps"in I.textField?I.textField.InputProps:{})})});return tn(na,{error:!!F,disabled:b,required:g,fullWidth:y,sx:$,children:[l&&R&&ve(la,{sx:r({mb:1},E),children:l}),ve(oa,{ref:k,sx:r({},h),children:ve(ma,{dateAdapter:K,children:ve(sa,p(r({},w),{name:e,enableAccessibleFieldDOMStructure:!1,label:l,value:i,defaultValue:a,onChange:me,onViewChange:t,onMonthChange:n,onYearChange:o,onOpen:s,onClose:c,disabled:b,minDate:T,maxDate:S,shouldDisableDate:L,shouldDisableMonth:N,shouldDisableYear:V,disablePast:q,disableFuture:W,referenceDate:M,view:_,format:O,openTo:X,reduceAnimations:P,slotProps:ne,slots:p(r({},G),{textField:en}),sx:Z}))})}),!F&&f&&ve(ra,{children:f})]})}),en=Qo((e,l)=>{var o;let n=e,{clearable:i,onClear:a,showClear:m,InputProps:d,slotProps:u}=n,t=x(n,["clearable","onClear","showClear","InputProps","slotProps"]);return ve(ia,p(r({},t),{ref:l,slotProps:p(r({},u),{input:p(r(r({},d),u==null?void 0:u.input),{endAdornment:tn(pa.Fragment,{children:[i&&m&&ve(aa,{onClick:a,size:"small",edge:"end",sx:{marginRight:.5},children:ve(ta,{fontSize:"small"})}),d==null?void 0:d.endAdornment,(o=u==null?void 0:u.input)==null?void 0:o.endAdornment]})})})}))});en.displayName="ActionableDatePickerTextField";jo.displayName="DatePickerField";var ze=jo;import{jsx as on}from"react/jsx-runtime";var nn=ca(c=>{var F=c,{name:e,label:l,control:i,size:a,readOnly:m,shouldDisableDate:d,disabled:u,placeholder:t,defaultValue:n=null,onChange:o}=F,s=x(F,["name","label","control","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange"]);return on(fa,{name:e,control:i,defaultValue:n,render:({field:f,fieldState:{error:b}})=>{var V;let N=s,{views:y,ampm:g,ampmInClock:T,timezone:S}=N,L=x(N,["views","ampm","ampmInClock","timezone"]);return on(ze,p(r({},L),{name:e,label:l,disabled:u,value:(V=f.value)!=null?V:null,onChange:z=>{f.onChange(z),o==null||o(z)},onBlur:f.onBlur,shouldDisableDate:d,size:a,error:b,helperText:b==null?void 0:b.message,readOnly:m}))}})});nn.displayName="FormInputDatePicker";var ct=nn;import{memo as Ea}from"react";import{Controller as Sa}from"react-hook-form";import Fa from"@mui/icons-material/Clear";import{Box as ba,FormControl as ga,FormHelperText as xa,FormLabel as ya,IconButton as va,TextField as Ca}from"@mui/material";import{LocalizationProvider as ha,TimePicker as Ia}from"@mui/x-date-pickers";import{AdapterDateFns as Pa}from"@mui/x-date-pickers/AdapterDateFns";import Ta,{forwardRef as rn,useRef as Ra}from"react";import{jsx as Ce,jsxs as sn}from"react/jsx-runtime";var ln=rn((P,K)=>{var C=P,{name:e,label:l,title:i,value:a,defaultValue:m,onChange:d,onFocus:u,onBlur:t,onViewChange:n,onOpen:o,onClose:s,error:c,helperText:F,disabled:f=!1,fullWidth:b=!0,required:y,minTime:g,maxTime:T,shouldDisableTime:S,size:L="medium",variant:N="outlined",color:V="primary",placeholder:z,readOnly:H=!1,showClearButton:J=!0,disablePast:D=!1,disableFuture:B=!1,ampm:A=!0,views:q,view:W,openTo:M="hours",format:_,pickerStyles:O,formControlStyles:X,formLabelStyles:Z,containerStyles:$,textFieldStyles:E,slotProps:h,slots:v,dateAdapter:I=Pa,autoFocus:G=!1}=C,R=x(C,["name","label","title","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","autoFocus"]);let w=Ra(null),k=me=>{d&&d(me)},U=()=>{d&&d(null),w.current&&w.current.focus()},j=z||(A?"hh:mm AM/PM":"hh:mm"),le=p(r({},h),{textField:p(r({},h==null?void 0:h.textField),{error:!!c,size:L,variant:N,color:V,helperText:c?F!=null?F:c.message:F,fullWidth:b,placeholder:j,autoFocus:G,onFocus:u,onBlur:t,inputRef:K||w,clearable:J,showClear:!!a,onClear:U,sx:r(r({},E),h!=null&&h.textField&&typeof h.textField=="object"&&"sx"in h.textField?h.textField.sx:{}),InputProps:r({},h!=null&&h.textField&&typeof h.textField=="object"&&"InputProps"in h.textField?h.textField.InputProps:{})})});return sn(ga,{error:!!c,disabled:f,required:y,fullWidth:b,sx:X,children:[l&&i&&Ce(ya,{sx:r({mb:1},Z),children:l}),Ce(ba,{ref:K,sx:r({},$),children:Ce(ha,{dateAdapter:I,children:Ce(Ia,p(r({},R),{name:e,enableAccessibleFieldDOMStructure:!1,label:l&&void 0,value:a,defaultValue:m,onChange:k,onViewChange:n,onOpen:o,onClose:s,disabled:f,minTime:g,maxTime:T,shouldDisableTime:S,disablePast:D,disableFuture:B,ampm:A,views:q,view:W,openTo:M,format:_,slotProps:le,slots:p(r({},v),{textField:an}),sx:O}))})}),!c&&F&&Ce(xa,{sx:{margin:"4px"},children:F})]})}),an=rn((e,l)=>{var o;let n=e,{clearable:i,onClear:a,showClear:m,InputProps:d,slotProps:u}=n,t=x(n,["clearable","onClear","showClear","InputProps","slotProps"]);return Ce(Ca,p(r({},t),{ref:l,slotProps:p(r({},u),{input:p(r(r({},d),u==null?void 0:u.input),{endAdornment:sn(Ta.Fragment,{children:[i&&m&&Ce(va,{onClick:a,size:"small",edge:"end",sx:{marginRight:.5},children:Ce(Fa,{fontSize:"small"})}),d==null?void 0:d.endAdornment,(o=u==null?void 0:u.input)==null?void 0:o.endAdornment]})})})}))});an.displayName="ActionableTimePickerTextField";ln.displayName="TimePickerField";var Oe=ln;import{jsx as mn}from"react/jsx-runtime";var un=Ea(n=>{var o=n,{name:e,label:l,control:i,ampm:a=!0,timezone:m,defaultValue:d=null,onChange:u}=o,t=x(o,["name","label","control","ampm","timezone","defaultValue","onChange"]);return mn(Sa,{name:e,control:i,defaultValue:d,render:({field:s,fieldState:{error:c}})=>{var y;let b=t,{size:F}=b,f=x(b,["size"]);return mn(Oe,p(r({},f),{name:e,label:l,value:(y=s.value)!=null?y:null,onChange:g=>{s.onChange(g),u==null||u(g)},onBlur:s.onBlur,ampm:a,timezone:m,size:F,error:c,helperText:c==null?void 0:c.message}))}})});un.displayName="FormInputTimePicker";var ft=un;import{Box as Oa,FormLabel as Na}from"@mui/material";import{memo as Va,useMemo as Wa}from"react";import{Controller as qa}from"react-hook-form";import{Box as wa,Button as Da,FormControl as ka,FormHelperText as pn,Stack as La}from"@mui/material";import{LocalizationProvider as Ba,TimeClock as Ma}from"@mui/x-date-pickers";import{AdapterDateFns as Ha}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as Aa,useState as za}from"react";import{jsx as Ne,jsxs as dn}from"react/jsx-runtime";var cn=Aa(($,Z)=>{var E=$,{name:e,label:l,value:i,defaultValue:a,onChange:m,error:d,helperText:u,disabled:t=!1,fullWidth:n=!1,required:o,views:s=["hours","minutes"],ampmInClock:c=!1,ampm:F=!0,disablePast:f=!1,disableFuture:b=!1,minTime:y,maxTime:g,shouldDisableTime:T,clockStyles:S,formControlStyles:L,formLabelStyles:N,containerStyles:V,buttonsStackStyles:z,buttonStyles:H,activeButtonStyles:J,showViewButtons:D=!0,initialView:B="hours",view:A,onViewChange:q,slotProps:W,slots:M,dateAdapter:_=Ha,autoFocus:O=!1}=E,X=x(E,["name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","view","onViewChange","slotProps","slots","dateAdapter","autoFocus"]);let[h,v]=za(B),I=A!=null?A:h,G=q!=null?q:v,R=P=>{m&&m(P)},K=P=>{G(P)};return dn(ka,{error:!!d,disabled:t,required:o,fullWidth:n,sx:L,children:[dn(wa,{ref:Z,sx:r({},V),mt:2,mb:2,children:[D&&s&&s.length>1&&Ne(La,{direction:"row",justifyContent:"center",spacing:1,sx:r({},z),children:s.map(P=>Ne(Da,{size:"small",variant:I===P?"contained":"outlined",onClick:()=>K(P),disabled:t,sx:I===P?r(r({},H),J):H,children:P},P))}),Ne(Ba,{dateAdapter:_,children:Ne(Ma,p(r({},X),{value:i,defaultValue:a,onChange:R,view:I,onViewChange:K,disabled:t,views:s,ampmInClock:c,ampm:F,disablePast:f,disableFuture:b,minTime:y,maxTime:g,shouldDisableTime:T,autoFocus:O,slotProps:W,slots:M,sx:S}))})]}),d&&Ne(pn,{sx:{margin:"4px"},children:u!=null?u:d!=null&&d.message?d.message:""}),!d&&u&&Ne(pn,{sx:{margin:"4px"},children:u})]})});cn.displayName="TimeClockField";var Ve=cn;import{jsx as Xt,jsxs as Ga}from"react/jsx-runtime";var fn=Va(F=>{var f=F,{name:e,label:l,control:i,readOnly:a,disabled:m,ampm:d=!0,views:u,ampmInClock:t=!0,disablePast:n=!1,defaultValue:o=null,onChange:s}=f,c=x(f,["name","label","control","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange"]);let b=Wa(()=>typeof d=="boolean"?d:void 0,[d]);return Ga(Oa,{sx:{border:y=>`1px solid ${y.palette.grey[600]}`,borderRadius:y=>y.spacing(.5),display:"flex",flexDirection:"column"},children:[Xt(Na,{sx:y=>({borderBottom:`1px solid ${y.palette.grey[600]}`,padding:g=>g.spacing(1)}),children:l}),Xt(qa,{name:e,control:i,defaultValue:o,render:({field:y,fieldState:{error:g}})=>{var T;return Xt(Ve,p(r({},c),{name:e,value:(T=y.value)!=null?T:null,onChange:S=>{y.onChange(S),s==null||s(S)},ampm:b,disabled:m,readOnly:a,ampmInClock:t,disablePast:n,views:u,error:g,helperText:g==null?void 0:g.message}))}})]})});fn.displayName="FormInputTimeClock";var Ft=fn;import{Box as Ja,FormLabel as Qa}from"@mui/material";import{memo as ja}from"react";import{Controller as ei}from"react-hook-form";import{Box as Ka,FormControl as Xa,FormHelperText as Fn}from"@mui/material";import{DateCalendar as $a,LocalizationProvider as Ua}from"@mui/x-date-pickers";import{AdapterDateFns as Ya}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as _a}from"react";import{jsx as bt,jsxs as Za}from"react/jsx-runtime";var bn=_a((O,_)=>{var X=O,{name:e,label:l,value:i,defaultValue:a,onChange:m,onViewChange:d,onMonthChange:u,onYearChange:t,error:n,helperText:o,disabled:s=!1,fullWidth:c=!1,required:F,minDate:f,maxDate:b,shouldDisableDate:y,shouldDisableMonth:g,shouldDisableYear:T,calendarStyles:S,formControlStyles:L,formLabelStyles:N,containerStyles:V,slotProps:z,slots:H,dateAdapter:J=Ya,showDaysOutsideCurrentMonth:D=!1,disablePast:B=!1,disableFuture:A=!1,referenceDate:q,view:W}=X,M=x(X,["name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view"]);let Z=$=>{m&&m($)};return Za(Xa,{error:!!n,disabled:s,required:F,fullWidth:c,sx:L,children:[bt(Ka,{ref:_,sx:r({},V),children:bt(Ua,{dateAdapter:J,children:bt($a,p(r({},M),{value:i,defaultValue:a,onChange:Z,onViewChange:d,onMonthChange:u,onYearChange:t,disabled:s,minDate:f,maxDate:b,shouldDisableDate:y,shouldDisableMonth:g,shouldDisableYear:T,showDaysOutsideCurrentMonth:D,disablePast:B,disableFuture:A,referenceDate:q,view:W,slotProps:z,slots:H,sx:S}))})}),n&&bt(Fn,{sx:{margin:"4px"},children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&bt(Fn,{sx:{margin:"4px"},children:o})]})});bn.displayName="DateCalendarField";var We=bn;import{jsx as $t,jsxs as ti}from"react/jsx-runtime";var gn=ja(n=>{var o=n,{name:e,label:l,control:i,readOnly:a,disabled:m,defaultValue:d=null,onChange:u}=o,t=x(o,["name","label","control","readOnly","disabled","defaultValue","onChange"]);return ti(Ja,{sx:{border:s=>`1px solid ${s.palette.grey[600]}`,borderRadius:s=>s.spacing(.5),display:"flex",flexDirection:"column"},children:[$t(Qa,{sx:s=>({borderBottom:`1px solid ${s.palette.grey[600]}`,padding:c=>c.spacing(1)}),children:l}),$t(ei,{name:e,control:i,defaultValue:d,render:({field:s,fieldState:{error:c}})=>{var y;let b=t,{views:F}=b,f=x(b,["views"]);return $t(We,p(r({},f),{name:e,value:(y=s.value)!=null?y:null,onChange:g=>{s.onChange(g),u==null||u(g)},disabled:m,readOnly:a,error:c,helperText:c==null?void 0:c.message,sx:r({height:"300px"},f.sx)}))}})]})});gn.displayName="FormInputCalendar";var gt=gn;import{memo as ii}from"react";import{Controller as si}from"react-hook-form";import{Checkbox as oi,FormControl as ni,FormControlLabel as ri,FormHelperText as xn}from"@mui/material";import{forwardRef as li}from"react";import{jsx as Lt,jsxs as ai}from"react/jsx-runtime";var yn=li((D,J)=>{var B=D,{name:e,label:l,value:i,onChange:a,onClick:m,onFocus:d,onBlur:u,error:t,helperText:n,disabled:o=!1,color:s="primary",size:c,fullWidth:F=!1,required:f,labelPlacement:b="end",checkedIcon:y,icon:g,indeterminate:T=!1,checkboxStyles:S,labelStyles:L,formControlStyles:N,slotProps:V,slots:z}=B,H=x(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots"]);let A=(W,M)=>{a&&a(M)},q=W=>{m&&m(W)};return ai(ni,{error:!!t,disabled:o,required:f,fullWidth:F,size:c==="large"?"medium":c,sx:N,children:[Lt(ri,{control:Lt(oi,p(r({},H),{checked:i,indeterminate:T,onChange:A,onClick:q,onFocus:d,onBlur:u,disabled:o,color:s,size:c,checkedIcon:y,icon:g,name:e,slotProps:V,slots:z,sx:S,ref:J})),label:l,labelPlacement:b,sx:L}),t&&Lt(xn,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&Lt(xn,{children:n})]})});yn.displayName="CheckboxField";var qe=yn;import{jsx as vn}from"react/jsx-runtime";var Cn=ii(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a=!1,onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return vn(si,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return vn(qe,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:!1,onChange:b=>{n.onChange(b),m==null||m(b)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});Cn.displayName="FormInputCheckBox";var xt=Cn;import{memo as bi,useMemo as gi}from"react";import{Controller as xi}from"react-hook-form";import{Box as mi,Checkbox as ui,FormControl as pi,FormControlLabel as di,FormHelperText as hn,FormLabel as ci}from"@mui/material";import{forwardRef as fi}from"react";import{jsx as Ge,jsxs as Fi}from"react/jsx-runtime";var In=fi((_,M)=>{var O=_,{name:e,label:l,value:i,options:a,onChange:m,onFocus:d,onBlur:u,onClick:t,error:n,helperText:o,disabled:s=!1,fullWidth:c=!0,required:F,color:f="primary",size:b,labelPlacement:y="end",row:g=!1,checkedIcon:T,icon:S,checkboxStyles:L,labelStyles:N,formControlStyles:V,renderCheckbox:z,slotProps:H,sxProps:J,slots:D,formLabelStyles:B,formLabelProps:A,formControlLabelProps:q}=O,W=x(O,["name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","renderCheckbox","slotProps","sxProps","slots","formLabelStyles","formLabelProps","formControlLabelProps"]);let X=v=>I=>{if(s)return;let G=I.target.checked,R;G?R=[...i,v]:R=i.filter(K=>K!==v),m&&m(R)},Z=v=>I=>{d&&d(I,v)},$=v=>I=>{u&&u(I,v)},E=v=>I=>{t&&t(I,v)},h=(v,I,G,R)=>Ge(di,r({control:Ge(ui,{name:e?`${e}-${v.value}`:void 0,checked:G,onChange:R,onFocus:Z(v.value),onBlur:$(v.value),onClick:E(v.value),disabled:s||v.disabled,color:f,size:b,checkedIcon:T,icon:S,slotProps:H==null?void 0:H.checkbox,slots:D==null?void 0:D.checkbox,sx:L}),label:v.label,labelPlacement:y,slotProps:H==null?void 0:H.formControlLabel,sx:N},q),`${v.value}-${I}`);return Fi(pi,p(r({},W),{error:!!n,disabled:s,required:F,fullWidth:c,component:"fieldset",sx:V,children:[l&&Ge(ci,p(r({component:"legend",sx:B},A),{children:l})),Ge(mi,{ref:M,sx:r({display:"flex",flexDirection:g?"row":"column",flexWrap:g?"wrap":"nowrap",gap:1,mt:l?1:0},J),children:a.map((v,I)=>{let G=i.includes(v.value),R=X(v.value);return z?z(v,I,G,R):h(v,I,G,R)})}),n&&Ge(hn,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&Ge(hn,{children:o})]}))});In.displayName="CheckboxFieldGroup";var Ke=In;import{jsx as Pn}from"react/jsx-runtime";var Tn=bi(s=>{var c=s,{name:e,label:l,control:i,options:a=[],defaultValue:m=[],onChange:d,row:u,color:t,labelPlacement:n}=c,o=x(c,["name","label","control","options","defaultValue","onChange","row","color","labelPlacement"]);let F=gi(()=>a.map(f=>({value:f.value,label:f.name,disabled:f.disabled})),[a]);return Pn(xi,{name:e,control:i,defaultValue:m,render:({field:f,fieldState:{error:b}})=>{let S=o,{size:y}=S,g=x(S,["size"]),T=Array.isArray(f.value)?f.value:[];return Pn(Ke,p(r({},g),{name:e,label:l,value:T,options:F,onChange:L=>{f.onChange(L),d==null||d(L)},onBlur:f.onBlur,row:u,color:t,labelPlacement:n,size:y,error:b,helperText:b==null?void 0:b.message}))}})});Tn.displayName="FormInputCheckBoxGroup";var yt=Tn;import{memo as hi}from"react";import{Controller as Ii}from"react-hook-form";import{FormControl as Rn,FormControlLabel as yi,FormHelperText as En,Switch as vi}from"@mui/material";import{forwardRef as Ci}from"react";import{jsx as Bt,jsxs as Sn}from"react/jsx-runtime";var wn=Ci((J,H)=>{var D=J,{name:e,label:l,value:i,onChange:a,onClick:m,onFocus:d,onBlur:u,error:t,helperText:n,disabled:o=!1,color:s="primary",size:c,fullWidth:F=!1,required:f,labelPlacement:b="end",edge:y,switchStyles:g,labelStyles:T,formControlStyles:S,slotProps:L,slots:N,formControlLabelProps:V}=D,z=x(D,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let B=(W,M)=>{a&&a(M)},A=W=>{m&&m(W)},q=Bt(vi,p(r({},z),{checked:i,onChange:B,onClick:A,onFocus:d,onBlur:u,disabled:o,color:s,size:c,edge:y,name:e,slotProps:L,slots:N,sx:g,ref:H}));return l?Sn(Rn,{error:!!t,disabled:o,required:f,fullWidth:F,size:c,sx:r({display:"flex",flexDirection:"column"},S),children:[Bt(yi,r({control:q,label:l,labelPlacement:b,disabled:o,sx:T},V)),(t||n)&&Bt(En,{sx:{marginLeft:b==="start"?"72px":0,marginRight:0},children:t?n!=null?n:t!=null&&t.message?t.message:"":n})]}):Sn(Rn,{error:!!t,disabled:o,required:f,fullWidth:F,sx:r({display:"inline-flex",flexDirection:"column"},S),children:[q,(t||n)&&Bt(En,{sx:{marginLeft:0,marginRight:0},children:t?n!=null?n:t!=null&&t.message?t.message:"":n})]})});wn.displayName="SwitchField";var Xe=wn;import{jsx as Dn}from"react/jsx-runtime";var kn=hi(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a=!1,onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return Dn(Ii,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return Dn(Xe,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:!1,onChange:b=>{n.onChange(b),m==null||m(b)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});kn.displayName="FormInputSwitch";var vt=kn;import{memo as wi}from"react";import{Controller as Di}from"react-hook-form";import{FormControl as Pi,FormHelperText as Ln,FormLabel as Ti,Slider as Ri}from"@mui/material";import{forwardRef as Ei}from"react";import{jsx as Mt,jsxs as Si}from"react/jsx-runtime";var Bn=Ei((M,W)=>{var _=M,{name:e,label:l,value:i,onChange:a,onChangeCommitted:m,onFocus:d,onBlur:u,error:t,helperText:n,disabled:o=!1,fullWidth:s=!0,required:c,orientation:F="horizontal",min:f=0,max:b=100,step:y=1,valueLabelDisplay:g="auto",valueLabelFormat:T,color:S="primary",size:L,marks:N,track:V="normal",sliderStyles:z,formControlStyles:H,formLabelStyles:J,slotProps:D,slots:B,formLabelProps:A}=_,q=x(_,["name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps"]);let O=($,E,h)=>{a&&a(E)},X=($,E)=>{m&&m(E)},Z=F==="vertical";return Si(Pi,{error:!!t,disabled:o,required:c,fullWidth:s&&!Z,sx:r(r({},H),Z&&{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"100%",width:"auto"}),children:[l&&Mt(Ti,p(r({sx:J},A),{children:l})),Mt(Ri,p(r({},q),{name:e,value:i,onChange:O,onChangeCommitted:X,onFocus:d,onBlur:u,orientation:F,min:f,max:b,step:y,valueLabelDisplay:g,valueLabelFormat:T,color:S,size:L,marks:N===!0?!0:N||!1,track:V,disabled:o,slotProps:D,slots:B,sx:r(r({},z),Z&&{height:"100%","& .MuiSlider-track":{width:"6px"},"& .MuiSlider-rail":{width:"6px"}}),ref:W})),t&&Mt(Ln,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&Mt(Ln,{children:n})]})});Bn.displayName="SliderField";var $e=Bn;import{jsx as Mn}from"react/jsx-runtime";var Hn=wi(u=>{var t=u,{name:e,label:l,control:i,defaultValue:a=0,onChange:m}=t,d=x(t,["name","label","control","defaultValue","onChange"]);return Mn(Di,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var f;let F=d,{size:s}=F,c=x(F,["size"]);return Mn($e,p(r({},c),{name:e,label:l,value:(f=n.value)!=null?f:a,onChange:b=>{n.onChange(b),m==null||m(b)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});Hn.displayName="FormInputSlider";var Ct=Hn;import{memo as Ai}from"react";import{Controller as zi}from"react-hook-form";import{FormControl as ki,FormControlLabel as Li,FormHelperText as An,Radio as Bi}from"@mui/material";import{forwardRef as Mi}from"react";import{jsx as Ht,jsxs as Hi}from"react/jsx-runtime";var zn=Mi((D,J)=>{var B=D,{name:e,label:l,value:i,onChange:a,onClick:m,onFocus:d,onBlur:u,error:t,helperText:n,disabled:o=!1,color:s="primary",size:c,fullWidth:F=!1,required:f,labelPlacement:b="end",checkedIcon:y,icon:g,radioStyles:T,labelStyles:S,formControlStyles:L,slotProps:N,slots:V,formControlLabelProps:z}=B,H=x(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let A=(W,M)=>{a&&a(M)},q=W=>{m&&m(W)};return Hi(ki,{error:!!t,disabled:o,required:f,fullWidth:F,size:c,sx:L,children:[Ht(Li,r({control:Ht(Bi,p(r({},H),{checked:i,onChange:A,onClick:q,onFocus:d,onBlur:u,disabled:o,color:s,size:c,checkedIcon:y,icon:g,name:e,slotProps:N,slots:V,sx:T,ref:J})),label:l,labelPlacement:b,sx:S},z)),t&&Ht(An,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&Ht(An,{children:n})]})});zn.displayName="RadioButtonField";var Ue=zn;import{jsx as On}from"react/jsx-runtime";var Nn=Ai(o=>{var s=o,{name:e,label:l,control:i,checked:a=!1,defaultValue:m=!1,onChange:d,color:u,labelPlacement:t}=s,n=x(s,["name","label","control","checked","defaultValue","onChange","color","labelPlacement"]);return On(zi,{name:e,control:i,defaultValue:m,render:({field:c,fieldState:{error:F}})=>{var g;let y=n,{size:f}=y,b=x(y,["size"]);return On(Ue,p(r({},b),{name:e,label:l,value:(g=c.value)!=null?g:!1,onChange:T=>{c.onChange(T),d==null||d(T)},onBlur:c.onBlur,color:u,labelPlacement:t,size:f,error:F,helperText:F==null?void 0:F.message}))}})});Nn.displayName="FormInputRadioButton";var ht=Nn;import{memo as Xi,useMemo as $i}from"react";import{Controller as Ui}from"react-hook-form";import{FormControl as Oi,FormControlLabel as Ni,FormHelperText as Vn,FormLabel as Vi,Radio as Wi,RadioGroup as qi}from"@mui/material";import{forwardRef as Gi}from"react";import{jsx as Ye,jsxs as Ki}from"react/jsx-runtime";var Wn=Gi((_,M)=>{var O=_,{name:e,label:l,value:i,onChange:a,onClick:m,onFocus:d,onBlur:u,options:t,error:n,helperText:o,disabled:s=!1,color:c="primary",size:F,fullWidth:f=!1,required:b,labelPlacement:y="end",row:g=!1,checkedIcon:T,icon:S,radioStyles:L,labelStyles:N,formControlStyles:V,formLabelStyles:z,renderRadio:H,sxProps:J,slotProps:D,slots:B,formLabelProps:A,formControlLabelProps:q}=O,W=x(O,["name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","renderRadio","sxProps","slotProps","slots","formLabelProps","formControlLabelProps"]);let X=E=>{var G;let h=E.target.value,v=(G=t.find(R=>String(R.value)===h))==null?void 0:G.value;a&&a(typeof v=="number"?v:h)},Z=E=>{m&&m(E)},$=E=>Ye(Ni,p(r({value:String(E.value),control:Ye(Wi,{color:c,size:F,disabled:s||E.disabled,checkedIcon:T,icon:S,onClick:Z,onFocus:d,onBlur:u,slotProps:D==null?void 0:D.radio,slots:B==null?void 0:B.radio,sx:L}),label:E.name,labelPlacement:y,disabled:s||E.disabled,sx:N},q),{slotProps:D==null?void 0:D.formControlLabel,slots:B==null?void 0:B.formControlLabel}),E.value);return Ki(Oi,{component:"fieldset",error:!!n,disabled:s,required:b,fullWidth:f,sx:V,children:[l&&Ye(Vi,p(r({component:"legend",sx:z},A),{children:l})),Ye(qi,p(r({name:e,value:i!==null?String(i):"",onChange:X,row:g,ref:M,sx:J},W),{children:t&&Array.isArray(t)&&t.map((E,h)=>H?H(E,h):$(E))})),n&&Ye(Vn,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&Ye(Vn,{children:o})]})});Wn.displayName="RadioButtonFieldGroup";var _e=Wn;import{jsx as qn}from"react/jsx-runtime";var Gn=Xi(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:m="",onChange:d}=n,u=x(n,["name","label","control","options","defaultValue","onChange"]);let o=$i(()=>Array.isArray(a)?a:[],[a]);return qn(Ui,{name:e,control:i,defaultValue:m,render:({field:s,fieldState:{error:c}})=>{var y;let b=u,{size:F}=b,f=x(b,["size"]);return qn(_e,p(r({},f),{name:e,label:l,value:(y=s.value)!=null?y:"",onChange:g=>{s.onChange(g),d==null||d(g)},onBlur:s.onBlur,options:o,size:F,error:c,helperText:c==null?void 0:c.message}))}})});Gn.displayName="FormInputRadioButtonGroup";var It=Gn;import{useState as Kn}from"react";import{Box as be,Paper as Yi,Typography as Xn,Button as $n,Divider as _i}from"@mui/material";import{jsx as te,jsxs as he}from"react/jsx-runtime";var Zi=()=>{let[e,l]=Kn({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}),[i,a]=Kn({}),m=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],d=[{value:"check1",label:"Checkbox 1"},{value:"check2",label:"Checkbox 2"},{value:"check3",label:"Checkbox 3"}],u=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}],t=o=>s=>{l(c=>p(r({},c),{[o]:s})),i[o]&&a(c=>{let F=r({},c);return delete F[o],F})};return he(Yi,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[te(Xn,{variant:"h4",gutterBottom:!0,children:"Normal Form (Direct FormInputs)"}),te(Xn,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using FormInputs directly with useState"}),te(_i,{sx:{my:2}}),te("form",{onSubmit:o=>{o.preventDefault(),console.log("Normal Form Data:",e);let s={};e.text||(s.text="Text is required"),e.password||(s.password="Password is required"),a(s)},children:he(be,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(3, 1fr)"},gap:2},children:[he(be,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(de,{name:"text",label:"Text Field",value:e.text,onChange:o=>t("text")(o.target.value),error:i.text?{message:i.text}:null}),te(Re,{name:"password",label:"Password",value:e.password,onChange:o=>t("password")(o.target.value),error:i.password?{message:i.password}:null})]}),te(de,{name:"textarea",label:"Text Area",value:e.textarea,onChange:o=>t("textarea")(o.target.value),multiline:!0,rows:4}),he(be,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(Ee,{name:"number",label:"Number",pattern:"credit-card",value:e.number,onChange:o=>t("number")(o.target.value)}),te(we,{name:"tel",label:"Telephone",pattern:"XX-XXXX-XXXX",value:e.tel,onChange:o=>t("tel")(o.target.value)})]}),te(Le,{name:"search",label:"Search",value:e.search,onChange:o=>t("search")(o.target.value)}),te(Me,{name:"otp",value:e.otp,onChange:t("otp"),length:6,spacing:2}),te(fe,{name:"select",label:"Select",value:e.select,onChange:o=>t("select")(o.target.value),options:m}),te(fe,{name:"multiselect",label:"Multi Select",value:e.multiselect,onChange:o=>t("multiselect")(o.target.value),options:m,multiple:!0}),te(Fe,{name:"autocomplete",label:"Autocomplete",value:e.autocomplete,onChange:(o,s)=>t("autocomplete")(s),options:m}),te(Fe,{name:"multiautocomplete",label:"Multi Autocomplete",value:e.multiautocomplete,onChange:(o,s)=>t("multiautocomplete")(s),options:m,multiple:!0}),te(He,{name:"color",label:"Color Picker",value:e.color,onChange:t("color")}),te(Ae,{name:"file",label:"File Upload",value:e.file,onChange:t("file")}),te(ze,{name:"date",value:e.date,onChange:t("date")}),he(be,{children:[te(Oe,{name:"time",value:e.time,onChange:t("time")}),he(be,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[te(Ke,{name:"checkboxgroup",label:"Checkbox Group",value:e.checkboxgroup,onChange:t("checkboxgroup"),options:d}),te(_e,{name:"radiogroup",label:"Radio Group",value:e.radiogroup,onChange:t("radiogroup"),options:u})]}),he(be,{sx:{display:"flex",gap:2,mt:2},children:[te(qe,{name:"checkbox",label:"Checkbox",value:e.checkbox,onChange:t("checkbox")}),te(Ue,{name:"singleradio",label:"Radio",value:e.singleradio,onChange:t("singleradio")}),te(Xe,{name:"switch",label:"Switch",value:e.switch,onChange:t("switch")})]})]}),te(be,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(Ve,{name:"timeclock",label:"Time Clock",value:e.timeclock,onChange:t("timeclock")})}),te(be,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(We,{name:"calendar",label:"Calendar",value:e.calendar,onChange:t("calendar")})}),te($e,{name:"slider",label:"Slider",value:e.slider,onChange:t("slider"),min:0,max:100}),he(be,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[te($n,{variant:"outlined",onClick:()=>l({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}),children:"Reset"}),te($n,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},Ji=Zi;import{Box as pe,Button as Un,Divider as Qi,Paper as ji,Typography as Yn}from"@mui/material";import{useForm as es}from"react-hook-form";import{jsx as ee,jsxs as Ie}from"react/jsx-runtime";var re="small",ts=()=>{let{control:e,handleSubmit:l,formState:{errors:i},reset:a}=es({defaultValues:{text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:""}}),m=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],d=[{name:"Checkbox 1",value:"check1"},{name:"Checkbox 2",value:"check2"},{name:"Checkbox 3",value:"check3"}],u=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}];return Ie(ji,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[ee(Yn,{variant:"h4",gutterBottom:!0,children:"React Hook Form (HookFormFields)"}),ee(Yn,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using HookFormFields with react-hook-form"}),ee(Qi,{sx:{my:2}}),ee("form",{onSubmit:l(n=>{console.log("React Hook Form Data:",n)}),children:Ie(pe,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(3, 1fr)"},gap:2},children:[Ie(pe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[ee(Je,{name:"text",label:"Text Field",control:e,size:re}),ee(je,{name:"password",label:"Password",control:e,size:re})]}),ee(Qe,{name:"textarea",label:"Text Area",control:e,rows:4,size:re}),Ie(pe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[ee(et,{name:"number",label:"Number",pattern:"zip-code",control:e,size:re}),ee(ot,{name:"tel",label:"Telephone",pattern:"XX-XXX-XXXXXX-X-XX",control:e,size:re})]}),ee(nt,{name:"search",label:"Search",control:e,size:re}),ee(lt,{name:"otp",control:e,spacing:2,size:re}),ee(it,{name:"select",label:"Select",control:e,options:m,size:re}),ee(st,{name:"multiselect",label:"Multi Select",control:e,options:m,size:re}),ee(mt,{name:"autocomplete",label:"Autocomplete",control:e,options:m,size:re}),ee(ut,{name:"multiautocomplete",label:"Multi Autocomplete",control:e,options:m,size:re}),ee(pt,{name:"color",label:"Color Picker",control:e,size:re}),ee(dt,{name:"file",label:"File Upload",control:e,size:re}),ee(ct,{name:"date",control:e,size:re}),Ie(pe,{children:[ee(ft,{name:"time",control:e,size:re}),Ie(pe,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[ee(yt,{name:"checkboxgroup",label:"Select Options",control:e,options:d,size:re}),ee(It,{name:"radiogroup",label:"Radio Group",control:e,options:u,size:re})]}),Ie(pe,{sx:{display:"flex",gap:2,mt:2},children:[ee(xt,{name:"checkbox",label:"Checkbox",control:e,size:re}),ee(ht,{name:"singleradio",label:"Radio",control:e,size:re}),ee(vt,{name:"switch",label:"Switch",control:e,size:re})]})]}),ee(pe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:ee(Ft,{name:"timeclock",label:"Time Clock",control:e,size:re})}),ee(pe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:ee(gt,{name:"calendar",label:"Calendar",control:e,size:re})}),ee(pe,{children:ee(Ct,{name:"slider",label:"Slider",control:e,size:re})}),Ie(pe,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[ee(Un,{variant:"outlined",onClick:()=>a(),children:"Reset"}),ee(Un,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},os=ts;var ns={FormInputTextField:Je,FormInputTextArea:Qe,FormInputPasswordField:je,FormInputNumberField:et,FormInputTelField:ot,FormInputSearchField:nt,FormInputOTPField:lt,FormInputSelect:it,FormInputMultiSelect:st,FormInputAutoComplete:mt,FormInputMultiAutoComplete:ut,FormInputColorPicker:pt,FormInputFileUpload:dt,FormInputDatePicker:ct,FormInputTimePicker:ft,FormInputTimeClock:Ft,FormInputCalendar:gt,FormInputCheckBox:xt,FormInputCheckBoxGroup:yt,FormInputSwitch:vt,FormInputSlider:Ct,FormInputSingleRadio:ht,FormInputRadioButtonGroup:It,TextInputField:de,PasswordField:Re,NumberField:Ee,TelInputField:we,SearchInputField:Le,OTPField:Me,SelectInputField:fe,AutoCompleteField:Fe,ColorPickerField:He,FileUploadField:Ae,DatePickerField:ze,TimePickerField:Oe,TimeClockField:Ve,DateCalendarField:We,CheckBoxField:qe,CheckBoxFieldGroup:Ke,RadioButtonField:Ue,RadioButtonFieldGroup:_e,SwitchField:Xe,SliderField:$e},If=ns;export{Fe as AutoCompleteField,qe as CheckBoxField,Ke as CheckBoxFieldGroup,He as ColorPickerField,We as DateCalendarField,ze as DatePickerField,Ji as DemoForm,os as DemoHookForm,Ae as FileUploadField,mt as FormInputAutoComplete,gt as FormInputCalendar,xt as FormInputCheckBox,yt as FormInputCheckBoxGroup,pt as FormInputColorPicker,ct as FormInputDatePicker,dt as FormInputFileUpload,ut as FormInputMultiAutoComplete,st as FormInputMultiSelect,et as FormInputNumberField,lt as FormInputOTPField,je as FormInputPasswordField,It as FormInputRadioButtonGroup,nt as FormInputSearchField,it as FormInputSelect,ht as FormInputSingleRadio,Ct as FormInputSlider,vt as FormInputSwitch,ot as FormInputTelField,Qe as FormInputTextArea,Je as FormInputTextField,Ft as FormInputTimeClock,ft as FormInputTimePicker,Ee as NumberField,Me as OTPField,Re as PasswordField,Ue as RadioButtonField,_e as RadioButtonFieldGroup,Le as SearchInputField,fe as SelectInputField,$e as SliderField,Xe as SwitchField,we as TelInputField,de as TextInputField,Ve as TimeClockField,Oe as TimePickerField,If as default};
1
+ "use client";var Jn=Object.defineProperty,Qn=Object.defineProperties;var jn=Object.getOwnPropertyDescriptors;var Et=Object.getOwnPropertySymbols;var jt=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable;var Qt=(e,l,i)=>l in e?Jn(e,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[l]=i,r=(e,l)=>{for(var i in l||(l={}))jt.call(l,i)&&Qt(e,i,l[i]);if(Et)for(var i of Et(l))eo.call(l,i)&&Qt(e,i,l[i]);return e},m=(e,l)=>Qn(e,jn(l));var y=(e,l)=>{var i={};for(var a in e)jt.call(e,a)&&l.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&Et)for(var a of Et(e))l.indexOf(a)<0&&eo.call(e,a)&&(i[a]=e[a]);return i};import{Box as ge,Button as jo,Divider as ei,Paper as ti,Typography as en}from"@mui/material";import{useState as tn}from"react";import{Checkbox as er,FormControl as tr,FormControlLabel as or,FormHelperText as to}from"@mui/material";import{forwardRef as nr}from"react";import{jsx as Dt,jsxs as rr}from"react/jsx-runtime";var oo=nr((E,Y)=>{var B=E,{name:e,label:l,value:i,onChange:a,onClick:u,onFocus:F,onBlur:p,error:t,helperText:n,disabled:o=!1,color:s="primary",size:d,fullWidth:g=!1,required:c,labelPlacement:f="end",checkedIcon:x,icon:b,indeterminate:P=!1,checkboxStyles:R,labelStyles:w,formControlStyles:V,slotProps:q,slots:z}=B,M=y(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","indeterminate","checkboxStyles","labelStyles","formControlStyles","slotProps","slots"]);let A=(N,H)=>{a&&a(H)},W=N=>{u&&u(N)};return rr(tr,{error:!!t,disabled:o,required:c,fullWidth:g,size:d==="large"?"medium":d,sx:V,children:[Dt(or,{control:Dt(er,m(r({},M),{checked:i,indeterminate:P,onChange:A,onClick:W,onFocus:F,onBlur:p,disabled:o,color:s,size:d,checkedIcon:x,icon:b,name:e,slotProps:q,slots:z,sx:R,ref:Y})),label:l,labelPlacement:f,sx:w}),t&&Dt(to,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&Dt(to,{children:n})]})});oo.displayName="CheckboxField";var Pe=oo;import{Box as lr,Checkbox as ar,FormControl as ir,FormControlLabel as sr,FormHelperText as no,FormLabel as ur}from"@mui/material";import{forwardRef as mr}from"react";import{jsx as Re,jsxs as pr}from"react/jsx-runtime";var ro=mr((Z,H)=>{var O=Z,{name:e,label:l,value:i,options:a,onChange:u,onFocus:F,onBlur:p,onClick:t,error:n,helperText:o,disabled:s=!1,fullWidth:d=!0,required:g,color:c="primary",size:f,labelPlacement:x="end",row:b=!1,checkedIcon:P,icon:R,checkboxStyles:w,labelStyles:V,formControlStyles:q,renderCheckbox:z,slotProps:M,sxProps:Y,slots:E,formLabelStyles:B,formLabelProps:A,formControlLabelProps:W}=O,N=y(O,["name","label","value","options","onChange","onFocus","onBlur","onClick","error","helperText","disabled","fullWidth","required","color","size","labelPlacement","row","checkedIcon","icon","checkboxStyles","labelStyles","formControlStyles","renderCheckbox","slotProps","sxProps","slots","formLabelStyles","formLabelProps","formControlLabelProps"]);let X=v=>I=>{if(s)return;let K=I.target.checked,D;K?D=[...i,v]:D=i.filter($=>$!==v),u&&u(D)},J=v=>I=>{F&&F(I,v)},U=v=>I=>{p&&p(I,v)},S=v=>I=>{t&&t(I,v)},h=(v,I,K,D)=>Re(sr,r({control:Re(ar,{name:e?`${e}-${v.value}`:void 0,checked:K,onChange:D,onFocus:J(v.value),onBlur:U(v.value),onClick:S(v.value),disabled:s||v.disabled,color:c,size:f,checkedIcon:P,icon:R,slotProps:M==null?void 0:M.checkbox,slots:E==null?void 0:E.checkbox,sx:w}),label:v.label,labelPlacement:x,slotProps:M==null?void 0:M.formControlLabel,sx:V},W),`${v.value}-${I}`);return pr(ir,m(r({},N),{error:!!n,disabled:s,required:g,fullWidth:d,component:"fieldset",sx:q,children:[l&&Re(ur,m(r({component:"legend",sx:B},A),{children:l})),Re(lr,{ref:H,sx:r({display:"flex",flexDirection:b?"row":"column",flexWrap:b?"wrap":"nowrap",gap:1,mt:l?1:0},Y),children:a.map((v,I)=>{let K=i.includes(v.value),D=X(v.value);return z?z(v,I,K,D):h(v,I,K,D)})}),n&&Re(no,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&Re(no,{children:o})]}))});ro.displayName="CheckboxFieldGroup";var Ee=ro;import{FormControl as dr,FormControlLabel as cr,FormHelperText as lo,Radio as fr}from"@mui/material";import{forwardRef as Fr}from"react";import{jsx as St,jsxs as gr}from"react/jsx-runtime";var ao=Fr((E,Y)=>{var B=E,{name:e,label:l,value:i,onChange:a,onClick:u,onFocus:F,onBlur:p,error:t,helperText:n,disabled:o=!1,color:s="primary",size:d,fullWidth:g=!1,required:c,labelPlacement:f="end",checkedIcon:x,icon:b,radioStyles:P,labelStyles:R,formControlStyles:w,slotProps:V,slots:q,formControlLabelProps:z}=B,M=y(B,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let A=(N,H)=>{a&&a(H)},W=N=>{u&&u(N)};return gr(dr,{error:!!t,disabled:o,required:c,fullWidth:g,size:d,sx:w,children:[St(cr,r({control:St(fr,m(r({},M),{checked:i,onChange:A,onClick:W,onFocus:F,onBlur:p,disabled:o,color:s,size:d,checkedIcon:x,icon:b,name:e,slotProps:V,slots:q,sx:P,ref:Y})),label:l,labelPlacement:f,sx:R},z)),t&&St(lo,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&St(lo,{children:n})]})});ao.displayName="RadioButtonField";var De=ao;import{FormControl as br,FormControlLabel as yr,FormHelperText as io,FormLabel as xr,Radio as vr,RadioGroup as Cr}from"@mui/material";import{forwardRef as hr}from"react";import{jsx as Se,jsxs as Ir}from"react/jsx-runtime";var so=hr((Z,H)=>{var O=Z,{name:e,label:l,value:i,onChange:a,onClick:u,onFocus:F,onBlur:p,options:t,error:n,helperText:o,disabled:s=!1,color:d="primary",size:g,fullWidth:c=!1,required:f,labelPlacement:x="end",row:b=!1,checkedIcon:P,icon:R,radioStyles:w,labelStyles:V,formControlStyles:q,formLabelStyles:z,renderRadio:M,sxProps:Y,slotProps:E,slots:B,formLabelProps:A,formControlLabelProps:W}=O,N=y(O,["name","label","value","onChange","onClick","onFocus","onBlur","options","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","row","checkedIcon","icon","radioStyles","labelStyles","formControlStyles","formLabelStyles","renderRadio","sxProps","slotProps","slots","formLabelProps","formControlLabelProps"]);let X=S=>{var K;let h=S.target.value,v=(K=t.find(D=>String(D.value)===h))==null?void 0:K.value;a&&a(typeof v=="number"?v:h)},J=S=>{u&&u(S)},U=S=>Se(yr,m(r({value:String(S.value),control:Se(vr,{color:d,size:g,disabled:s||S.disabled,checkedIcon:P,icon:R,onClick:J,onFocus:F,onBlur:p,slotProps:E==null?void 0:E.radio,slots:B==null?void 0:B.radio,sx:w}),label:S.name,labelPlacement:x,disabled:s||S.disabled,sx:V},W),{slotProps:E==null?void 0:E.formControlLabel,slots:B==null?void 0:B.formControlLabel}),S.value);return Ir(br,{component:"fieldset",error:!!n,disabled:s,required:f,fullWidth:c,sx:q,children:[l&&Se(xr,m(r({component:"legend",sx:z},A),{children:l})),Se(Cr,m(r({name:e,value:i!==null?String(i):"",onChange:X,row:b,ref:H,sx:Y},N),{children:t&&Array.isArray(t)&&t.map((S,h)=>M?M(S,h):U(S))})),n&&Se(io,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&Se(io,{children:o})]})});so.displayName="RadioButtonFieldGroup";var ke=so;import{FormControl as Tr,FormHelperText as uo,FormLabel as Pr,Slider as Rr}from"@mui/material";import{forwardRef as Er}from"react";import{jsx as kt,jsxs as Dr}from"react/jsx-runtime";var mo=Er((H,N)=>{var Z=H,{name:e,label:l,value:i,onChange:a,onChangeCommitted:u,onFocus:F,onBlur:p,error:t,helperText:n,disabled:o=!1,fullWidth:s=!0,required:d,orientation:g="horizontal",min:c=0,max:f=100,step:x=1,valueLabelDisplay:b="auto",valueLabelFormat:P,color:R="primary",size:w,marks:V,track:q="normal",sliderStyles:z,formControlStyles:M,formLabelStyles:Y,slotProps:E,slots:B,formLabelProps:A}=Z,W=y(Z,["name","label","value","onChange","onChangeCommitted","onFocus","onBlur","error","helperText","disabled","fullWidth","required","orientation","min","max","step","valueLabelDisplay","valueLabelFormat","color","size","marks","track","sliderStyles","formControlStyles","formLabelStyles","slotProps","slots","formLabelProps"]);let O=(U,S,h)=>{a&&a(S)},X=(U,S)=>{u&&u(S)},J=g==="vertical";return Dr(Tr,{error:!!t,disabled:o,required:d,fullWidth:s&&!J,sx:r(r({},M),J&&{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"100%",width:"auto"}),children:[l&&kt(Pr,m(r({sx:Y},A),{children:l})),kt(Rr,m(r({},W),{name:e,value:i,onChange:O,onChangeCommitted:X,onFocus:F,onBlur:p,orientation:g,min:c,max:f,step:x,valueLabelDisplay:b,valueLabelFormat:P,color:R,size:w,marks:V===!0?!0:V||!1,track:q,disabled:o,slotProps:E,slots:B,sx:r(r({},z),J&&{height:"100%","& .MuiSlider-track":{width:"6px"},"& .MuiSlider-rail":{width:"6px"}}),ref:N})),t&&kt(uo,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&kt(uo,{children:n})]})});mo.displayName="SliderField";var we=mo;import{FormControl as po,FormControlLabel as Sr,FormHelperText as co,Switch as kr}from"@mui/material";import{forwardRef as wr}from"react";import{jsx as wt,jsxs as fo}from"react/jsx-runtime";var Fo=wr((Y,M)=>{var E=Y,{name:e,label:l,value:i,onChange:a,onClick:u,onFocus:F,onBlur:p,error:t,helperText:n,disabled:o=!1,color:s="primary",size:d,fullWidth:g=!1,required:c,labelPlacement:f="end",edge:x,switchStyles:b,labelStyles:P,formControlStyles:R,slotProps:w,slots:V,formControlLabelProps:q}=E,z=y(E,["name","label","value","onChange","onClick","onFocus","onBlur","error","helperText","disabled","color","size","fullWidth","required","labelPlacement","edge","switchStyles","labelStyles","formControlStyles","slotProps","slots","formControlLabelProps"]);let B=(N,H)=>{a&&a(H)},A=N=>{u&&u(N)},W=wt(kr,m(r({},z),{checked:i,onChange:B,onClick:A,onFocus:F,onBlur:p,disabled:o,color:s,size:d,edge:x,name:e,slotProps:w,slots:V,sx:b,ref:M}));return l?fo(po,{error:!!t,disabled:o,required:c,fullWidth:g,size:d,sx:r({display:"flex",flexDirection:"column"},R),children:[wt(Sr,r({control:W,label:l,labelPlacement:f,disabled:o,sx:P},q)),(t||n)&&wt(co,{sx:{marginLeft:f==="start"?"72px":0,marginRight:0},children:t?n!=null?n:t!=null&&t.message?t.message:"":n})]}):fo(po,{error:!!t,disabled:o,required:c,fullWidth:g,sx:r({display:"inline-flex",flexDirection:"column"},R),children:[W,(t||n)&&wt(co,{sx:{marginLeft:0,marginRight:0},children:t?n!=null?n:t!=null&&t.message?t.message:"":n})]})});Fo.displayName="SwitchField";var Be=Fo;import{FormControl as Br,FormHelperText as Lr,FormLabel as Mr,ToggleButton as Hr,ToggleButtonGroup as Ar}from"@mui/material";import{forwardRef as zr}from"react";import{jsx as Bt,jsxs as Or}from"react/jsx-runtime";var go=zr((q,V)=>{var z=q,{name:e,label:l,title:i=!1,value:a,onChange:u,options:F,error:p,helperText:t,disabled:n=!1,fullWidth:o=!1,required:s,size:d="medium",orientation:g="horizontal",exclusive:c=!0,buttonStyles:f,formControlStyles:x,formLabelStyles:b,groupStyles:P,renderButton:R}=z,w=y(z,["name","label","title","value","onChange","options","error","helperText","disabled","fullWidth","required","size","orientation","exclusive","buttonStyles","formControlStyles","formLabelStyles","groupStyles","renderButton"]);let M=(E,B)=>{u&&u(B)},Y=E=>Bt(Hr,{value:E.value,disabled:n||E.disabled,color:E.color||w.color||"primary",sx:r({flex:o?1:void 0},f),children:E.name},E.value);return Or(Br,{error:!!p,disabled:n,required:s,fullWidth:o,sx:x,children:[l&&Bt(Mr,{sx:r({mb:1},b),children:l}),Bt(Ar,m(r({},w),{ref:V,value:a,onChange:M,exclusive:c,size:d,orientation:g,fullWidth:o,disabled:n,sx:r({},P),children:F&&Array.isArray(F)&&F.map((E,B)=>R?R(E,B):Y(E))})),(p||t)&&Bt(Lr,{sx:{margin:"4px"},children:p?t!=null?t:p.message:t})]})});go.displayName="ToggleButtonField";var Le=go;import{Box as Nr,FormControl as Vr,FormHelperText as bo}from"@mui/material";import{DateCalendar as Wr,LocalizationProvider as Gr}from"@mui/x-date-pickers";import{AdapterDateFns as qr}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as Kr}from"react";import{jsx as je,jsxs as $r}from"react/jsx-runtime";var yo=Kr((O,Z)=>{var X=O,{name:e,label:l,value:i,defaultValue:a,onChange:u,onViewChange:F,onMonthChange:p,onYearChange:t,error:n,helperText:o,disabled:s=!1,fullWidth:d=!1,required:g,minDate:c,maxDate:f,shouldDisableDate:x,shouldDisableMonth:b,shouldDisableYear:P,calendarStyles:R,formControlStyles:w,formLabelStyles:V,containerStyles:q,slotProps:z,slots:M,dateAdapter:Y=qr,showDaysOutsideCurrentMonth:E=!1,disablePast:B=!1,disableFuture:A=!1,referenceDate:W,view:N}=X,H=y(X,["name","label","value","defaultValue","onChange","onViewChange","onMonthChange","onYearChange","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","calendarStyles","formControlStyles","formLabelStyles","containerStyles","slotProps","slots","dateAdapter","showDaysOutsideCurrentMonth","disablePast","disableFuture","referenceDate","view"]);let J=U=>{u&&u(U)};return $r(Vr,{error:!!n,disabled:s,required:g,fullWidth:d,sx:w,children:[je(Nr,{ref:Z,sx:r({},q),children:je(Gr,{dateAdapter:Y,children:je(Wr,m(r({},H),{value:i,defaultValue:a,onChange:J,onViewChange:F,onMonthChange:p,onYearChange:t,disabled:s,minDate:c,maxDate:f,shouldDisableDate:x,shouldDisableMonth:b,shouldDisableYear:P,showDaysOutsideCurrentMonth:E,disablePast:B,disableFuture:A,referenceDate:W,view:N,slotProps:z,slots:M,sx:R}))})}),n&&je(bo,{sx:{margin:"4px"},children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&je(bo,{sx:{margin:"4px"},children:o})]})});yo.displayName="DateCalendarField";var Me=yo;import Xr from"@mui/icons-material/Clear";import{Box as Ur,FormControl as _r,FormHelperText as Yr,FormLabel as Zr,IconButton as Jr,InputAdornment as Qr}from"@mui/material";import{DatePicker as jr,LocalizationProvider as el}from"@mui/x-date-pickers";import{AdapterDateFns as tl}from"@mui/x-date-pickers/AdapterDateFns";import ol,{forwardRef as nl,useRef as rl}from"react";import{jsx as ye,jsxs as xo}from"react/jsx-runtime";var vo=nl((_,L)=>{var ee=_,{name:e,label:l,value:i,defaultValue:a,onChange:u,onFocus:F,onBlur:p,onViewChange:t,onMonthChange:n,onYearChange:o,onOpen:s,onClose:d,error:g,helperText:c,disabled:f=!1,fullWidth:x=!0,required:b,minDate:P,maxDate:R,shouldDisableDate:w,shouldDisableMonth:V,shouldDisableYear:q,size:z="medium",variant:M="outlined",color:Y="primary",placeholder:E,readOnly:B=!1,showClearButton:A=!0,disablePast:W=!1,disableFuture:N=!1,referenceDate:H,view:Z,format:O,openTo:X="day",pickerStyles:J,formControlStyles:U,formLabelStyles:S,containerStyles:h,textFieldStyles:v,slotProps:I,slots:K,title:D=!1,dateAdapter:$=tl,reduceAnimations:T=!1,autoFocus:C=!1}=ee,k=y(ee,["name","label","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onMonthChange","onYearChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","referenceDate","view","format","openTo","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","title","dateAdapter","reduceAnimations","autoFocus"]);var ie,se;let le=rl(null),me=Je=>{u&&u(Je)},G=()=>{u&&u(null),le.current&&le.current.focus()},oe=E||"MM/DD/YYYY",ne=m(r({},I),{textField:m(r({},I==null?void 0:I.textField),{error:!!g,size:z,variant:M,color:Y,helperText:g?c!=null?c:g.message:c,fullWidth:x,placeholder:oe,autoFocus:C,onFocus:F,onBlur:p,inputRef:L||le,sx:r(r({},v),I!=null&&I.textField&&typeof I.textField=="object"&&"sx"in I.textField?I.textField.sx:{}),InputProps:m(r({},I!=null&&I.textField&&typeof I.textField=="object"&&"InputProps"in I.textField?I.textField.InputProps:{}),{endAdornment:xo(ol.Fragment,{children:[A&&i&&ye(Qr,{position:"end",children:ye(Jr,{onClick:G,size:"small",edge:"end",sx:{marginRight:.5},children:ye(Xr,{fontSize:"small"})})}),(se=(ie=I==null?void 0:I.textField)==null?void 0:ie.InputProps)==null?void 0:se.endAdornment]})})})});return xo(_r,{error:!!g,disabled:f,required:b,fullWidth:x,sx:U,children:[l&&D&&ye(Zr,{sx:r({marginBottom:1},S),children:l}),ye(Ur,{ref:L,sx:r({},h),children:ye(el,{dateAdapter:$,children:ye(jr,m(r({},k),{name:e,label:l,value:i,defaultValue:a,onChange:me,onViewChange:t,onMonthChange:n,onYearChange:o,onOpen:s,onClose:d,disabled:f,minDate:P,maxDate:R,shouldDisableDate:w,shouldDisableMonth:V,shouldDisableYear:q,disablePast:W,disableFuture:N,referenceDate:H,view:Z,format:O,openTo:X,reduceAnimations:T,slotProps:ne,slots:K,sx:J}))})}),!g&&c&&ye(Yr,{children:c})]})});vo.displayName="DatePickerField";var He=vo;import{Box as ll,Button as al,FormControl as il,FormHelperText as Co,Stack as sl}from"@mui/material";import{LocalizationProvider as ul,TimeClock as ml}from"@mui/x-date-pickers";import{AdapterDateFns as pl}from"@mui/x-date-pickers/AdapterDateFns";import{forwardRef as dl,useState as cl}from"react";import{jsx as Ae,jsxs as ho}from"react/jsx-runtime";var Io=dl((U,J)=>{var S=U,{name:e,label:l,value:i,defaultValue:a,onChange:u,error:F,helperText:p,disabled:t=!1,fullWidth:n=!1,required:o,views:s=["hours","minutes"],ampmInClock:d=!1,ampm:g=!0,disablePast:c=!1,disableFuture:f=!1,minTime:x,maxTime:b,shouldDisableTime:P,clockStyles:R,formControlStyles:w,formLabelStyles:V,containerStyles:q,buttonsStackStyles:z,buttonStyles:M,activeButtonStyles:Y,showViewButtons:E=!0,initialView:B="hours",view:A,onViewChange:W,slotProps:N,slots:H,dateAdapter:Z=pl,autoFocus:O=!1}=S,X=y(S,["name","label","value","defaultValue","onChange","error","helperText","disabled","fullWidth","required","views","ampmInClock","ampm","disablePast","disableFuture","minTime","maxTime","shouldDisableTime","clockStyles","formControlStyles","formLabelStyles","containerStyles","buttonsStackStyles","buttonStyles","activeButtonStyles","showViewButtons","initialView","view","onViewChange","slotProps","slots","dateAdapter","autoFocus"]);let[h,v]=cl(B),I=A!=null?A:h,K=W!=null?W:v,D=T=>{u&&u(T)},$=T=>{K(T)};return ho(il,{error:!!F,disabled:t,required:o,fullWidth:n,sx:w,children:[ho(ll,{ref:J,sx:r({},q),mt:2,mb:2,children:[E&&s&&s.length>1&&Ae(sl,{spacing:1,sx:r({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},z),children:s.map(T=>Ae(al,{size:"small",variant:I===T?"contained":"outlined",onClick:()=>$(T),disabled:t,sx:I===T?r(r({},M),Y):M,children:T},T))}),Ae(ul,{dateAdapter:Z,children:Ae(ml,m(r({},X),{value:i,defaultValue:a,onChange:D,view:I,onViewChange:$,disabled:t,views:s,ampmInClock:d,ampm:g,disablePast:c,disableFuture:f,minTime:x,maxTime:b,shouldDisableTime:P,autoFocus:O,slotProps:N,slots:H,sx:R}))})]}),F&&Ae(Co,{sx:{margin:"4px"},children:p!=null?p:F!=null&&F.message?F.message:""}),!F&&p&&Ae(Co,{sx:{margin:"4px"},children:p})]})});Io.displayName="TimeClockField";var ze=Io;import fl from"@mui/icons-material/Clear";import{Box as Fl,FormControl as gl,FormHelperText as bl,FormLabel as yl,IconButton as xl,InputAdornment as vl}from"@mui/material";import{LocalizationProvider as Cl,TimePicker as hl}from"@mui/x-date-pickers";import{AdapterDateFns as Il}from"@mui/x-date-pickers/AdapterDateFns";import Tl,{forwardRef as Pl,useRef as Rl}from"react";import{jsx as xe,jsxs as To}from"react/jsx-runtime";var Po=Pl((T,$)=>{var C=T,{name:e,label:l,title:i,value:a,defaultValue:u,onChange:F,onFocus:p,onBlur:t,onViewChange:n,onOpen:o,onClose:s,error:d,helperText:g,disabled:c=!1,fullWidth:f=!0,required:x,minTime:b,maxTime:P,shouldDisableTime:R,size:w="medium",variant:V="outlined",color:q="primary",placeholder:z,readOnly:M=!1,showClearButton:Y=!0,disablePast:E=!1,disableFuture:B=!1,ampm:A=!0,views:W,view:N,openTo:H="hours",format:Z,pickerStyles:O,formControlStyles:X,formLabelStyles:J,containerStyles:U,textFieldStyles:S,slotProps:h,slots:v,dateAdapter:I=Il,autoFocus:K=!1}=C,D=y(C,["name","label","title","value","defaultValue","onChange","onFocus","onBlur","onViewChange","onOpen","onClose","error","helperText","disabled","fullWidth","required","minTime","maxTime","shouldDisableTime","size","variant","color","placeholder","readOnly","showClearButton","disablePast","disableFuture","ampm","views","view","openTo","format","pickerStyles","formControlStyles","formLabelStyles","containerStyles","textFieldStyles","slotProps","slots","dateAdapter","autoFocus"]);var me,G;let k=Rl(null),L=oe=>{F&&F(oe)},_=()=>{F&&F(null),k.current&&k.current.focus()},ee=z||(A?"hh:mm AM/PM":"hh:mm"),le=m(r({},h),{textField:m(r({},h==null?void 0:h.textField),{error:!!d,size:w,variant:V,color:q,helperText:d?g!=null?g:d.message:g,fullWidth:f,placeholder:ee,autoFocus:K,onFocus:p,onBlur:t,inputRef:$||k,sx:r(r({},S),h!=null&&h.textField&&typeof h.textField=="object"&&"sx"in h.textField?h.textField.sx:{}),InputProps:m(r({},h!=null&&h.textField&&typeof h.textField=="object"&&"InputProps"in h.textField?h.textField.InputProps:{}),{endAdornment:To(Tl.Fragment,{children:[Y&&a&&xe(vl,{position:"end",children:xe(xl,{onClick:_,size:"small",edge:"end",sx:{marginRight:.5},children:xe(fl,{fontSize:"small"})})}),(G=(me=h==null?void 0:h.textField)==null?void 0:me.InputProps)==null?void 0:G.endAdornment]})})})});return To(gl,{error:!!d,disabled:c,required:x,fullWidth:f,sx:X,children:[l&&i&&xe(yl,{sx:r({mb:1},J),children:l}),xe(Fl,{ref:$,sx:r({},U),children:xe(Cl,{dateAdapter:I,children:xe(hl,m(r({},D),{name:e,label:l&&void 0,value:a,defaultValue:u,onChange:L,onViewChange:n,onOpen:o,onClose:s,disabled:c,minTime:b,maxTime:P,shouldDisableTime:R,disablePast:E,disableFuture:B,ampm:A,views:W,view:N,openTo:H,format:Z,slotProps:le,slots:v,sx:O}))})}),!d&&g&&xe(bl,{sx:{margin:"4px"},children:g})]})});Po.displayName="TimePickerField";var Oe=Po;import{Autocomplete as El,FormControl as Dl,FormHelperText as Sl,TextField as kl}from"@mui/material";import{forwardRef as wl,memo as Bl,useCallback as Vt}from"react";import{jsx as Wt,jsxs as Ll}from"react/jsx-runtime";var Ro=Bl(wl((S,U)=>{var h=S,{name:e,label:l,value:i,onChange:a,onInputChange:u,onOpen:F,onClose:p,options:t,error:n,helperText:o,disabled:s=!1,placeholder:d,variant:g="outlined",size:c,color:f,fullWidth:x=!0,required:b,getOptionLabel:P,isOptionEqualToValue:R,renderOption:w,popupIcon:V,inputStyles:q,autocompleteStyles:z,formControlStyles:M,loading:Y=!1,loadingText:E="Loading...",noOptionsText:B="No options",filterOptions:A,autoHighlight:W=!0,autoSelect:N=!1,disablePortal:H=!1,disableListWrap:Z=!1,slotProps:O,slots:X}=h,J=y(h,["name","label","value","onChange","onInputChange","onOpen","onClose","options","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","getOptionLabel","isOptionEqualToValue","renderOption","popupIcon","inputStyles","autocompleteStyles","formControlStyles","loading","loadingText","noOptionsText","filterOptions","autoHighlight","autoSelect","disablePortal","disableListWrap","slotProps","slots"]);let v=Vt(D=>{var $,T;return typeof D=="string"?D:(T=D==null?void 0:D.name)!=null?T:String(($=D==null?void 0:D.value)!=null?$:"")},[]),I=Vt((D,$)=>(D==null?void 0:D.name)===($==null?void 0:$.name)&&(D==null?void 0:D.value)===($==null?void 0:$.value),[]),K=Vt((D,$,T)=>{a&&a(D,$,T)},[a]);return Ll(Dl,{fullWidth:x,error:!!n,sx:M,children:[Wt(El,m(r({options:t,value:i,onChange:K,onInputChange:u,onOpen:F,onClose:p,getOptionLabel:P||v,isOptionEqualToValue:R||I,disabled:s,loading:Y,loadingText:E,noOptionsText:B,filterOptions:A,autoHighlight:W,autoSelect:N,disablePortal:H,disableListWrap:Z,popupIcon:V,slotProps:O,slots:X,sx:z,ref:U},J),{renderInput:D=>Wt(kl,m(r({},D),{name:e,label:l,variant:g,size:c,color:f,placeholder:d,required:b,error:!!n,disabled:s,sx:q,helperText:o!=null?o:""}))})),n&&!o&&n.message&&Wt(Sl,{children:n.message})]})}));Ro.displayName="AutoCompleteField";var de=Ro;import{Box as Ml,FormControl as Hl,InputAdornment as Al,TextField as zl}from"@mui/material";import{forwardRef as Ol,memo as Nl,useCallback as Lt,useEffect as Vl,useMemo as Gt,useRef as Eo,useState as Wl}from"react";import{jsx as Mt,jsxs as Kl}from"react/jsx-runtime";var Gl=e=>/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e),ql=e=>{let l=e.replace("#","");return l.length===3&&(l=l.split("").map(i=>i+i).join("")),`#${l}`},Do=Nl(Ol((N,W)=>{var H=N,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onEnterPress:p,error:t,helperText:n,disabled:o=!1,placeholder:s="#000000",variant:d="outlined",size:g,color:c="primary",fullWidth:f=!0,required:x,format:b="hex",showPreview:P=!0,showNativeInput:R=!0,showPopoverPicker:w=!0,presetColors:V=["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF"],showPresetColors:q=!1,previewStyles:z,formControlStyles:M,inputStyles:Y,slotProps:E,slots:B}=H,A=y(H,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","format","showPreview","showNativeInput","showPopoverPicker","presetColors","showPresetColors","previewStyles","formControlStyles","inputStyles","slotProps","slots"]);let[Z,O]=Wl(i||""),X=Eo(null),J=Eo(null);Vl(()=>{i!==void 0&&O(i||"")},[i]);let U=Gl(Z)?ql(Z):Z||"",S=Lt(T=>{if(o)return;let C=T.target.value;O(C),a&&a(C)},[a]),h=Lt(T=>{if(o)return;T.stopPropagation();let C=T.target.value;O(C),a&&a(C)},[a]),v=Lt(T=>{o||(T.preventDefault(),T.stopPropagation(),X.current&&X.current.click())},[o,X]),I=Lt(T=>{T.key==="Enter"&&p&&p(U),A.onKeyDown&&A.onKeyDown(T)},[p,U,A.onKeyDown]),K=Gt(()=>Mt(Al,{position:"start",children:Mt(Ml,{ref:J,onClick:o?void 0:v,sx:r({width:g==="small"?24:32,height:g==="small"?24:32,borderRadius:1,border:"1px solid",borderColor:t?"error.main":"divider",backgroundColor:U,cursor:o?"default":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{opacity:o?1:.8}},z),title:o?void 0:"Click to open color picker"})}),[J,o,v,g,t,U,z]),D=Gt(()=>{var T;return m(r({},E),{input:r(m(r({},E==null?void 0:E.input),{inputProps:r({},((T=E==null?void 0:E.input)==null?void 0:T.inputProps)||{})}),P&&{startAdornment:K})})},[E,P,K]),$=Gt(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Kl(Hl,{error:!!t,disabled:o,required:x,fullWidth:f,sx:M,children:[Mt(zl,m(r({},A),{ref:W,name:e,label:l,value:U,onChange:S,onFocus:u,onBlur:F,onKeyDown:I,placeholder:s,variant:d,size:g,color:c,fullWidth:f,required:x,error:!!t,disabled:o,slotProps:D,slots:B,sx:Y,helperText:$})),Mt("input",{ref:X,type:"color",value:U,onChange:h,disabled:o,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",visibility:"hidden"},"aria-hidden":"true"})]})}));Do.displayName="ColorPickerField";var Ne=Do;import $l from"@mui/icons-material/Clear";import Xl from"@mui/icons-material/CloudUpload";import{FormControl as Ul,FormHelperText as _l,IconButton as So,InputAdornment as Yl,TextField as Zl}from"@mui/material";import{forwardRef as Jl,useRef as Ql,useState as ko}from"react";import{jsx as ve,jsxs as qt}from"react/jsx-runtime";var wo=Jl((h,S)=>{var v=h,{name:e,label:l,value:i,onChange:a,onFileSelect:u,onFileRemove:F,onValidationError:p,onDrop:t,error:n,helperText:o,disabled:s=!1,accept:d,multiple:g=!1,maxSize:c,minSize:f,allowedTypes:x,showPreview:b=!0,enableDragDrop:P=!1,placeholder:R="No file chosen",variant:w="outlined",size:V,color:q,fullWidth:z=!0,required:M,buttonText:Y="Upload",buttonVariant:E="contained",buttonColor:B="primary",buttonSize:A,uploadIcon:W=ve(Xl,{}),inputStyles:N,buttonStyles:H,formControlStyles:Z,containerStyles:O,slotProps:X,slots:J}=v,U=y(v,["name","label","value","onChange","onFileSelect","onFileRemove","onValidationError","onDrop","error","helperText","disabled","accept","multiple","maxSize","minSize","allowedTypes","showPreview","enableDragDrop","placeholder","variant","size","color","fullWidth","required","buttonText","buttonVariant","buttonColor","buttonSize","uploadIcon","inputStyles","buttonStyles","formControlStyles","containerStyles","slotProps","slots"]);let I=Ql(null),[K,D]=ko(!1),[,$]=ko(0),T=S&&typeof S=="object"&&"current"in S?S:I,C=()=>i?i instanceof File?i.name:Array.isArray(i)?i.length===0?"":i.length===1?i[0].name:`${i.length} files selected`:typeof i=="object"&&"name"in i?i.name:"":"",k=Q=>{if(c&&Q.size>c)return`File size exceeds maximum allowed size of ${L(c)}`;if(f&&Q.size<f)return`File size is below minimum required size of ${L(f)}`;if(x&&x.length>0){let ae=Q.type||_(Q.name);if(!x.some(ue=>ue.startsWith(".")?Q.name.toLowerCase().endsWith(ue.toLowerCase()):ae.includes(ue)||ae===ue))return`File type not allowed. Allowed types: ${x.join(", ")}`}return null},L=Q=>{if(Q===0)return"0 Bytes";let ae=1024,be=["Bytes","KB","MB","GB"],ue=Math.floor(Math.log(Q)/Math.log(ae));return`${Math.round(Q/ae**ue*100)/100} ${be[ue]}`},_=Q=>Q.slice((Q.lastIndexOf(".")-1>>>0)+2),ee=Q=>{let{files:ae}=Q.target;if(!ae||ae.length===0){a&&a(void 0),u&&u(void 0);return}let be=Array.from(ae),ue=[],Zt=!1;for(let Qe of be){let Jt=k(Qe);Jt?(Zt=!0,p&&p(Jt)):ue.push(Qe)}if(ue.length>0){let Qe=g?ue:ue[0];a&&a(Qe),u&&u(Qe)}},le=()=>{var Q;s||(Q=T.current)==null||Q.click()},me=()=>{T.current&&(T.current.value=""),a&&a(void 0),F&&F()},G=Q=>{Q.preventDefault(),Q.stopPropagation(),$(ae=>ae+1),Q.dataTransfer.items&&Q.dataTransfer.items.length>0&&D(!0)},oe=Q=>{Q.preventDefault(),Q.stopPropagation(),$(ae=>{let be=ae-1;return be===0&&D(!1),be})},ne=Q=>{Q.preventDefault(),Q.stopPropagation()},ie=Q=>{if(Q.preventDefault(),Q.stopPropagation(),D(!1),$(0),s)return;let{files:ae}=Q.dataTransfer;ae&&ae.length>0&&(t&&t(ae),ee({target:{files:ae}}))},se=C(),Je=b&&se?se:R;return qt(Ul,{error:!!n,disabled:s,required:M,fullWidth:z,sx:Z,children:[qt("div",{style:O,onDragEnter:P?G:void 0,onDragLeave:P?oe:void 0,onDragOver:P?ne:void 0,onDrop:P?ie:void 0,children:[ve("input",{type:"file",accept:d,multiple:g,name:e,id:e?`file-upload-${e}`:void 0,onChange:ee,style:{display:"none"},ref:T,disabled:s}),ve(Zl,m(r({},U),{label:l,value:Je,placeholder:R,variant:w,size:V,color:q,fullWidth:z,required:M,error:!!n,disabled:s,name:e,sx:N,slotProps:m(r({},X),{input:m(r({},X==null?void 0:X.input),{readOnly:!0,endAdornment:qt(Yl,{position:"end",children:[b&&se&&ve(So,{onClick:me,disabled:s,children:ve($l,{})}),ve(So,{onClick:le,disabled:s,sx:H,children:W})]})})}),slots:J,helperText:o!=null?o:n!=null&&n.message?n.message:void 0})),P&&K&&ve("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.05)",border:"2px dashed",borderColor:"primary.main",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:"Drop files here"})]}),n&&!o&&n.message&&ve(_l,{children:n.message})]})});wo.displayName="FileUploadField";var Ve=wo;import{FormControl as jl,FormHelperText as Bo,InputLabel as ea,MenuItem as ta,Select as oa}from"@mui/material";import{forwardRef as na}from"react";import{jsx as et,jsxs as ra}from"react/jsx-runtime";var Lo=na((Z,H)=>{var O=Z,{name:e,label:l,value:i,onChange:a,onOpen:u,onClose:F,options:p,error:t,helperText:n,disabled:o=!1,variant:s="outlined",size:d,color:g,fullWidth:c=!0,required:f,multiple:x=!1,icon:b,renderValue:P,renderMenuItem:R,menuItemStyles:w,selectStyles:V,formControlStyles:q,labelStyles:z,slotProps:M,slots:Y,displayEmpty:E=!1,autoWidth:B=!1,native:A=!1,MenuProps:W}=O,N=y(O,["name","label","value","onChange","onOpen","onClose","options","error","helperText","disabled","variant","size","color","fullWidth","required","multiple","icon","renderValue","renderMenuItem","menuItemStyles","selectStyles","formControlStyles","labelStyles","slotProps","slots","displayEmpty","autoWidth","native","MenuProps"]);let X=v=>{var I;if(x&&Array.isArray(v))return v.length===0?"":v.map(K=>{var $;let D=p.find(T=>T.value===K);return($=D==null?void 0:D.name)!=null?$:String(K)}).join(", ");if(!x&&v!==""&&v!==null&&v!==void 0){let K=p.find(D=>D.value===v);return(I=K==null?void 0:K.name)!=null?I:String(v)}return""},J=(v,I)=>{let K=typeof w=="function"?w(v,I):w;return et(ta,{value:v.value,disabled:v.disabled,sx:K,children:R?R(v,I):v.name},`${v.value}-${I}`)},U=(v,I)=>{a&&a(v,I)},S=l?`${e||"select"}-label`:void 0,h=l?`${e||"select"}-select`:void 0;return ra(jl,{fullWidth:c,error:!!t,disabled:o,required:f,size:d,variant:s,sx:q,children:[l&&et(ea,{id:S,sx:z,children:l}),et(oa,m(r({},N),{labelId:S,id:h,name:e,value:i,label:l,onChange:U,onOpen:u,onClose:F,disabled:o,multiple:x,displayEmpty:E,autoWidth:B,native:A,MenuProps:W,IconComponent:b,renderValue:P!=null?P:X,slotProps:M,slots:Y,sx:V,ref:H,children:p&&Array.isArray(p)&&p.map((v,I)=>J(v,I))})),t&&et(Bo,{children:n!=null?n:t!=null&&t.message?t.message:""}),!t&&n&&et(Bo,{children:n})]})});Lo.displayName="SelectInputField";var ce=Lo;import{FormControl as la,InputAdornment as Mo,TextField as aa}from"@mui/material";import{forwardRef as ia,memo as sa,useCallback as ua,useEffect as ma,useMemo as Te,useState as pa}from"react";import{jsx as Ht}from"react/jsx-runtime";var fe=e=>e.replace(/\D/g,""),Ho=(e,l)=>{if(!l||!e)return e;let i="",a=0;for(let u=0;u<l.length&&a<e.length;u++)l[u]==="X"?(i+=e[a],a++):i+=l[u];return i},da=e=>e?e.replace(/X/g,"0"):"",ca=e=>{let l=fe(e);return l.length<=3?l:l.length<=6?`(${l.slice(0,3)}) ${l.slice(3)}`:`(${l.slice(0,3)}) ${l.slice(3,6)}-${l.slice(6,10)}`},fa=e=>{var a;let l=e.replace(/\D/g,"");return(((a=l.match(/.{1,4}/g))==null?void 0:a.join(" "))||l).slice(0,19)},Ao=(e,l=!0)=>{let i=e.replace(/[^\d.]/g,"");if(!l)return i.replace(/\D/g,"");let a=i.split(".");return a.length>2?`${a[0]}.${a.slice(1).join("")}`:a.length===2&&a[1].length>2?`${a[0]}.${a[1].slice(0,2)}`:i},Fa=e=>{let l=e.replace(/\D/g,"");return l.length<=3?l:l.length<=5?`${l.slice(0,3)}-${l.slice(3)}`:`${l.slice(0,3)}-${l.slice(3,5)}-${l.slice(5,9)}`},ga=e=>{let l=e.replace(/\D/g,"");return l.length<=5?l:`${l.slice(0,5)}-${l.slice(5,9)}`},ba=e=>e.replace(/\D/g,"").slice(0,3),zo=sa(ia((O,Z)=>{var X=O,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onEnterPress:p,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:d="outlined",size:g,color:c="primary",fullWidth:f=!0,required:x,pattern:b="integer",customPattern:P,customFormatter:R,min:w,max:V,step:q,allowDecimals:z=!0,decimalPlaces:M=2,startAdornment:Y,endAdornment:E,inputStyles:B,formControlStyles:A,slotProps:W,slots:N}=X,H=y(X,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","customPattern","customFormatter","min","max","step","allowDecimals","decimalPlaces","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots"]);let[J,U]=pa(i),S=typeof b=="string"&&b.includes("X"),h=S?b:void 0,v=S?void 0:b,I=ua(G=>{if(!G)return"";if(h){let oe=fe(G);return Ho(oe,h)}switch(v){case"phone":return ca(G);case"credit-card":return fa(G);case"currency":return Ao(G,z);case"ssn":return Fa(G);case"zip-code":return ga(G);case"percentage":return ba(G);case"decimal":return Ao(G,z);case"integer":return fe(G);case"custom":return R?R(G):fe(G);default:return fe(G)}},[h,v,z,R,P]);ma(()=>{let G=I(i);U(oe=>oe!==G?G:oe)},[i,I]);let K=(G,oe)=>{if(["Backspace","Delete","Tab","Escape","Enter"].includes(oe)||oe==="a"||oe==="c"||oe==="v"||oe==="x"||(v==="decimal"||v==="currency")&&z&&oe===".")return!0;if(!/^\d$/.test(oe))return!1;if(h){let ne=(h.match(/X/g)||[]).length;return fe(G).length<ne}if(v==="custom"&&P){let ne=G+oe;return P.test(ne)}return!0},D=G=>{let oe=G.target.value,ne=I(oe);U(ne);let ie=h?fe(oe):ne,se=m(r({},G),{target:m(r({},G.target),{value:ie}),currentTarget:m(r({},G.currentTarget),{value:ie})});a&&a(se)},$=G=>{if(o)return;G.preventDefault();let oe=G.clipboardData.getData("text"),ne=fe(oe),ie=h?(h.match(/X/g)||[]).length:void 0,se=ie?ne.slice(0,ie):ne,Je=h?Ho(se,h):I(se);U(Je);let Q=m(r({},G),{target:m(r({},G.target),{value:se}),currentTarget:m(r({},G.currentTarget),{value:se})});a&&a(Q)},T=G=>{let oe=G.currentTarget.querySelector("input");if(!oe)return;let ne=oe.value||"",{key:ie}=G;if(["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(ie)){ie==="Enter"&&p&&p(J),H.onKeyDown&&H.onKeyDown(G);return}if(G.ctrlKey||G.metaKey){H.onKeyDown&&H.onKeyDown(G);return}if(!K(ne,ie)){G.preventDefault();return}H.onKeyDown&&H.onKeyDown(G)},C=Te(()=>r({min:w,max:V,step:q,inputMode:v==="phone"?"tel":v==="decimal"||v==="currency"?"decimal":"numeric",maxLength:h?h.length:void 0},H.inputProps||{}),[w,V,q,v,h,H]),k=Te(()=>Y?Ht(Mo,{position:"start",children:Y}):void 0,[Y]),L=Te(()=>E?Ht(Mo,{position:"end",children:E}):void 0,[E]),_=Te(()=>m(r({},W),{input:r(r(m(r({},W==null?void 0:W.input),{inputProps:C}),k&&{startAdornment:k}),L&&{endAdornment:L})}),[W,C,k,L]),ee=Te(()=>v==="phone"?"tel":"text",[v]),le=Te(()=>s||(h?da(h):s),[s,h]),me=Te(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Ht(la,{error:!!t,disabled:o,required:x,fullWidth:f,sx:A,children:Ht(aa,m(r({},H),{name:e,label:l,value:J,onChange:D,onFocus:u,onBlur:F,onKeyDown:T,onPaste:$,placeholder:le,variant:d,size:g,color:c,fullWidth:f,required:x,error:!!t,disabled:o,type:ee,autoComplete:"off",slotProps:_,slots:N,sx:B,ref:Z,helperText:me}))})}));zo.displayName="NumberField";var We=zo;import{Box as Oo,FormControl as ya,FormHelperText as No,TextField as xa}from"@mui/material";import{forwardRef as va,useEffect as At,useRef as Ge,useState as Ca}from"react";import{jsx as tt,jsxs as Vo}from"react/jsx-runtime";var Wo=va((A,B)=>{var W=A,{name:e,label:l,value:i,onChange:a,onComplete:u,onFocus:F,onBlur:p,onEnterPress:t,error:n,helperText:o,disabled:s=!1,variant:d="outlined",size:g,color:c="primary",fullWidth:f=!0,required:x,length:b=6,spacing:P=1,autoFocus:R=!1,autoSubmit:w=!1,containerStyles:V,inputStyles:q,formControlStyles:z,slotProps:M,slots:Y}=W,E=y(W,["name","label","value","onChange","onComplete","onFocus","onBlur","onEnterPress","error","helperText","disabled","variant","size","color","fullWidth","required","length","spacing","autoFocus","autoSubmit","containerStyles","inputStyles","formControlStyles","slotProps","slots"]);let[N,H]=Ca(Array(b).fill("")),Z=Ge([]),O=Ge(""),X=Ge(!1),J=Ge(Array(b).fill("")),U=Ge(!1),S=Ge(null);At(()=>{J.current=N},[N]),At(()=>{let T=J.current.join("");if(U.current){if(i===O.current)return;let C=T,k=i||"";if(C===k&&C.length>0||k.length===C.length&&k===O.current)return}if(!(X.current&&(X.current=!1,i===O.current))&&i!==T)if(i){let C=i.split("").slice(0,b),k=[...C,...Array(b-C.length).fill("")];H(k)}else H(Array(b).fill(""))},[i,b]),At(()=>{R&&Z.current[0]&&Z.current[0].focus()},[R]),At(()=>()=>{S.current&&clearTimeout(S.current)},[]);let h=(T,C)=>{if(s)return;let k=C.target.value;if(k===""){v(T,"",!1);return}let L=k.slice(-1);/^\d$/.test(L)&&v(T,L,!0)},v=(T,C,k=!0)=>{let L=[...N];L[T]=C,X.current=!0,U.current=!0,S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{U.current=!1},500),H(L);let _=L.join("");O.current=_,a&&a(_),C&&T<b-1&&k&&setTimeout(()=>{var ee;(ee=Z.current[T+1])==null||ee.focus()},0),L.every(ee=>ee!=="")&&(u&&u(_),w&&t&&t(_))},I=(T,C)=>{var L,_,ee;if(s)return;let{key:k}=C;if(k==="Backspace"){N[T]===""&&T>0?((L=Z.current[T-1])==null||L.focus(),v(T-1,"",!1)):v(T,"",!1),C.preventDefault();return}if(k==="Delete"){v(T,"",!1),C.preventDefault();return}if(k==="ArrowLeft"&&T>0){(_=Z.current[T-1])==null||_.focus(),C.preventDefault();return}if(k==="ArrowRight"&&T<b-1){(ee=Z.current[T+1])==null||ee.focus(),C.preventDefault();return}if(k==="Enter"&&t){let le=N.join("");t(le);return}(C.ctrlKey||C.metaKey)&&k==="v"||/^\d$/.test(k)||["Tab","Escape","Home","End"].includes(k)||C.preventDefault()},K=(T,C)=>{var oe;if(s)return;C.preventDefault();let L=C.clipboardData.getData("text").replace(/\D/g,"").slice(0,b);if(L.length===0)return;let _=[...N],ee=T;for(let ne=0;ne<L.length&&ee+ne<b;ne++)_[ee+ne]=L[ne];H(_);let le=_.join("");a&&a(le);let me=_.findIndex(ne=>ne===""),G=me!==-1?me:Math.min(ee+L.length,b-1);(oe=Z.current[G])==null||oe.focus(),_.every(ne=>ne!=="")&&(u&&u(le),w&&t&&t(le))},D=(T,C)=>{C.target.select(),F&&F(C)},$=(T,C)=>{p&&p(C)};return Vo(ya,{error:!!n,disabled:s,required:x,fullWidth:f,sx:z,children:[l&&Vo(Oo,{component:"label",sx:{mb:1,display:"block"},children:[l,x&&tt("span",{style:{color:"error.main"},children:" *"})]}),tt(Oo,{ref:B,sx:r({display:"flex",gap:P,justifyContent:"flex-start"},V),children:N.map((T,C)=>{var k;return tt(xa,r({inputRef:L=>{Z.current[C]=L},name:e?`${e}-${C}`:void 0,value:T,onChange:L=>h(C,L),onKeyDown:L=>I(C,L),onPaste:L=>K(C,L),onFocus:L=>D(C,L),onBlur:L=>$(C,L),variant:d,size:g,color:c,error:!!n,disabled:s,required:x,slotProps:m(r({},M),{input:m(r({},M==null?void 0:M.input),{inputProps:r({maxLength:1,inputMode:"numeric",pattern:"[0-9]*",style:{textAlign:"center",fontSize:g==="small"?"1rem":"1.25rem",fontWeight:"bold"}},((k=M==null?void 0:M.input)==null?void 0:k.inputProps)||{})})}),slots:Y,sx:r({width:g==="small"?"40px":"48px"},q)},E),C)})}),n&&tt(No,{children:o!=null?o:n!=null&&n.message?n.message:""}),!n&&o&&tt(No,{children:o})]})});Wo.displayName="OTPField";var qe=Wo;import ha from"@mui/icons-material/Visibility";import Ia from"@mui/icons-material/VisibilityOff";import{FormControl as Ta,FormHelperText as Go,IconButton as Pa,InputAdornment as Ra,TextField as Ea}from"@mui/material";import{forwardRef as Da,memo as Sa,useCallback as qo,useMemo as zt,useState as ka}from"react";import{jsx as Ce,jsxs as Ko}from"react/jsx-runtime";var wa=e=>{if(!e)return"weak";let l=0;return e.length>=8&&l++,e.length>=12&&l++,/[a-z]/.test(e)&&l++,/[A-Z]/.test(e)&&l++,/[0-9]/.test(e)&&l++,/[^a-zA-Z0-9]/.test(e)&&l++,l<=2?"weak":l<=4?"medium":l<=5?"strong":"very-strong"},Ba=e=>{switch(e){case"weak":return"#f44336";case"medium":return"#ff9800";case"strong":return"#4caf50";case"very-strong":return"#2196f3";default:return"#9e9e9e"}},$o=Sa(Da((H,N)=>{var Z=H,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onVisibilityToggle:p,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:d="outlined",size:g,color:c,fullWidth:f=!0,required:x,showPasswordStrength:b=!1,minLength:P,maxLength:R,defaultShowPassword:w=!1,visibilityIcon:V=Ce(ha,{}),visibilityOffIcon:q=Ce(Ia,{}),iconButtonProps:z,getPasswordStrength:M=wa,inputStyles:Y,formControlStyles:E,slotProps:B,slots:A}=Z,W=y(Z,["name","label","value","onChange","onFocus","onBlur","onVisibilityToggle","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showPasswordStrength","minLength","maxLength","defaultShowPassword","visibilityIcon","visibilityOffIcon","iconButtonProps","getPasswordStrength","inputStyles","formControlStyles","slotProps","slots"]);let[O,X]=ka(w),J=qo(()=>{X(D=>{let $=!D;return p&&p($),$})},[p]),U=zt(()=>b?M(i):null,[b,i]),S=()=>{if(!U||!i)return null;let D=Ba(U),$=U.charAt(0).toUpperCase()+U.slice(1).replace("-"," ");return Ce("div",{style:{marginTop:"4px",fontSize:"0.75rem"},children:Ko("span",{style:{color:D,fontWeight:500},children:["Strength: ",$]})})},h=qo(D=>{let $=D.target.value;R&&$.length>R||a&&a(D)},[R,a]),v=zt(()=>Ce(Ra,{position:"end",children:Ce(Pa,m(r({onClick:J,onMouseDown:D=>D.preventDefault(),edge:"end",disabled:o},z),{children:O?q:V}))}),[J,o,z,O,q,V]),I=zt(()=>{var D;return m(r({},B),{input:m(r(r({},B==null?void 0:B.input),P||R?{inputProps:r(r({minLength:P,maxLength:R},((D=B==null?void 0:B.input)==null?void 0:D.inputProps)||{}),W.inputProps||{})}:{}),{endAdornment:v})})},[B,P,R,W,v]),K=zt(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Ko(Ta,{fullWidth:f,error:!!t,disabled:o,required:x,sx:E,children:[Ce(Ea,m(r({},W),{name:e,label:l,type:O?"text":"password",value:i,onChange:h,onFocus:u,onBlur:F,placeholder:s,variant:d,size:g,color:c,fullWidth:f,required:x,error:!!t,disabled:o,slotProps:I,slots:A,sx:Y,ref:N,helperText:K})),b&&S(),t&&!n&&t.message&&Ce(Go,{children:t.message}),!t&&n&&Ce(Go,{children:n})]})}));$o.displayName="PasswordField";var Ke=$o;import La from"@mui/icons-material/Close";import Ma from"@mui/icons-material/Search";import{FormControl as Ha,IconButton as Xo,InputAdornment as Aa,TextField as za}from"@mui/material";import{forwardRef as Oa,memo as Na,useCallback as $e,useEffect as Va,useMemo as Uo,useRef as Kt}from"react";import{jsx as Xe,jsxs as Wa}from"react/jsx-runtime";var _o=Na(Oa((J,X)=>{var U=J,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onSearch:p,onClear:t,onEnterPress:n,error:o,helperText:s,disabled:d=!1,placeholder:g,variant:c="outlined",size:f,color:x="primary",fullWidth:b=!0,required:P,showClearButton:R=!0,showSearchButton:w=!0,clearIcon:V,searchIcon:q,clearButtonProps:z,searchButtonProps:M,enableDebounce:Y=!0,debounceDelay:E=300,enableThrottle:B=!1,throttleDelay:A=300,inputStyles:W,formControlStyles:N,slotProps:H,slots:Z}=U,O=y(U,["name","label","value","onChange","onFocus","onBlur","onSearch","onClear","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","showClearButton","showSearchButton","clearIcon","searchIcon","clearButtonProps","searchButtonProps","enableDebounce","debounceDelay","enableThrottle","throttleDelay","inputStyles","formControlStyles","slotProps","slots"]);let S=Kt(null),h=Kt(null),v=Kt(0);Va(()=>()=>{S.current&&clearTimeout(S.current),h.current&&clearTimeout(h.current)},[]);let I=$e(_=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{p&&p(_)},E)},[p,E]),K=$e(_=>{let ee=Date.now(),le=ee-v.current;le>=A?(v.current=ee,p&&p(_)):(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{v.current=Date.now(),p&&p(_)},A-le))},[p,A]),D=$e(_=>{let ee=_.target.value;a&&a(_),p&&(Y&&!B?I(ee):B&&!Y?K(ee):Y&&B?I(ee):p(ee))},[a,p,Y,B,I,K]),$=$e(()=>{S.current&&(clearTimeout(S.current),S.current=null),h.current&&(clearTimeout(h.current),h.current=null),t&&t(),p&&p(""),a&&a({target:{value:"",name:e||""},currentTarget:{value:"",name:e||""}})},[t,p,a,e,S,h]),T=$e(()=>{S.current&&(clearTimeout(S.current),S.current=null),h.current&&(clearTimeout(h.current),h.current=null),p&&p(i)},[p,i,S,h]),C=$e(_=>{_.key==="Enter"&&(S.current&&(clearTimeout(S.current),S.current=null),h.current&&(clearTimeout(h.current),h.current=null),n&&n(i),p&&p(i)),O.onKeyDown&&O.onKeyDown(_)},[n,p,i,S,h,O.onKeyDown]),k=Uo(()=>Wa(Aa,{position:"end",children:[R&&i&&Xe(Xo,m(r({onClick:$,disabled:d,edge:"end",size:f},z),{children:V||Xe(La,{})})),w&&Xe(Xo,m(r({onClick:T,disabled:d,edge:"end",size:f},M),{children:q||Xe(Ma,{})}))]}),[R,i,$,d,f,z,V,w,T,M,q]),L=Uo(()=>s!=null?s:o!=null&&o.message?o.message:void 0,[s,o==null?void 0:o.message]);return Xe(Ha,{error:!!o,disabled:d,required:P,fullWidth:b,sx:N,children:Xe(za,m(r({},O),{name:e,label:l,value:i,onChange:D,onFocus:u,onBlur:F,onKeyDown:C,placeholder:g,variant:c,size:f,color:x,fullWidth:b,required:P,error:!!o,disabled:d,slotProps:m(r({},H),{input:m(r({},H==null?void 0:H.input),{endAdornment:k})}),slots:Z,sx:W,ref:X,helperText:L}))})}));_o.displayName="SearchField";var Ue=_o;import{FormControl as Ga,InputAdornment as $t,TextField as qa}from"@mui/material";import{forwardRef as Ka,memo as $a,useCallback as Xt,useEffect as Xa,useMemo as _e,useRef as Ua,useState as _a}from"react";import{jsx as ot}from"react/jsx-runtime";var Ot=e=>e.replace(/\D/g,""),Ut=(e,l)=>{if(!l||!e)return e;let i="",a=0;for(let u=0;u<l.length&&a<e.length;u++)l[u]==="X"?(i+=e[a],a++):i+=l[u];return i},Ya=e=>e?e.replace(/X/g,"0"):"0000000000",Yo=$a(Ka((N,W)=>{var H=N,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onEnterPress:p,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:d="outlined",size:g,color:c="primary",fullWidth:f=!0,required:x,pattern:b="XXXXXXXXXX",maxLength:P,countryCode:R="+1",showCountryCode:w=!1,startAdornment:V,endAdornment:q,inputStyles:z,formControlStyles:M,countryCodeStyles:Y,slotProps:E,slots:B}=H,A=y(H,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","pattern","maxLength","countryCode","showCountryCode","startAdornment","endAdornment","inputStyles","formControlStyles","countryCodeStyles","slotProps","slots"]);let[Z,O]=_a(""),X=Ua(null),J=P||(b?b.length:15);Xa(()=>{let C=Ot(i),k=b?Ut(C,b):C;O(L=>L!==k?k:L),X.current&&setTimeout(()=>{if(X.current){let L=k.length;X.current.setSelectionRange(L,L)}},0)},[i,b]);let U=Xt(C=>{if(o)return;let k=C.target.value,L=Ot(k),_=J?L.slice(0,J):L,ee=b?Ut(_,b):_;O(ee);let le=m(r({},C),{target:m(r({},C.target),{value:_}),currentTarget:m(r({},C.currentTarget),{value:_})});a&&a(le)},[o,J,b,a]),S=Xt(C=>{if(o)return;C.preventDefault();let k=C.clipboardData.getData("text"),L=Ot(k),_=J?L.slice(0,J):L,ee=b?Ut(_,b):_;O(ee);let le=m(r({},C),{target:m(r({},C.target),{value:_}),currentTarget:m(r({},C.currentTarget),{value:_})});a&&a(le)},[o,J,b,a]),h=Xt(C=>{if(o)return;let{key:k}=C,L=/[0-9]/.test(k),_=k==="Backspace"||k==="Delete"||k==="Tab"||k==="Escape"||k==="Enter"||k==="ArrowLeft"||k==="ArrowRight"||k==="ArrowUp"||k==="ArrowDown"||k==="Home"||k==="End"||(C.ctrlKey||C.metaKey)&&(k==="a"||k==="c"||k==="v"||k==="x");if(!L&&!_){C.preventDefault();return}k==="Enter"&&p&&p(Ot(Z)),A.onKeyDown&&A.onKeyDown(C)},[o,p,Z,A.onKeyDown]),v=_e(()=>r({maxLength:J,inputMode:"tel",autoComplete:"tel"},A.inputProps||{}),[J,A]),I=_e(()=>w?ot($t,{position:"start",sx:Y,children:R}):V?ot($t,{position:"start",children:V}):void 0,[w,Y,R,V]),K=_e(()=>q?ot($t,{position:"end",children:q}):void 0,[q]),D=_e(()=>m(r({},E),{input:r(r(m(r({},E==null?void 0:E.input),{inputProps:v}),I&&{startAdornment:I}),K&&{endAdornment:K})}),[E,v,I,K]),$=_e(()=>s||(b?Ya(b):""),[s,b]),T=_e(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return ot(Ga,{error:!!t,disabled:o,required:x,fullWidth:f,sx:M,children:ot(qa,m(r({},A),{name:e,label:l,value:Z,onChange:U,onFocus:u,onBlur:F,onKeyDown:h,onPaste:S,placeholder:$,variant:d,size:g,color:c,fullWidth:f,required:x,error:!!t,disabled:o,type:"tel",autoComplete:"tel",slotProps:D,slots:B,sx:z,ref:W,inputRef:X,helperText:T}))})}));Yo.displayName="TeliField";var Ye=Yo;import{FormControl as Za,InputAdornment as Zo,TextField as Ja}from"@mui/material";import{forwardRef as Qa,memo as ja,useCallback as Jo,useMemo as Ze}from"react";import{jsx as Nt}from"react/jsx-runtime";var Qo=ja(Qa((J,X)=>{var U=J,{name:e,label:l,value:i,onChange:a,onFocus:u,onBlur:F,onEnterPress:p,error:t,helperText:n,disabled:o=!1,placeholder:s,variant:d="outlined",size:g,color:c="primary",fullWidth:f=!0,required:x,multiline:b=!1,rows:P,minRows:R,maxRows:w,resize:V="both",maxLength:q,minLength:z,type:M="text",autoComplete:Y="off",startAdornment:E,endAdornment:B,inputStyles:A,formControlStyles:W,slotProps:N,slots:H,textTransform:Z}=U,O=y(U,["name","label","value","onChange","onFocus","onBlur","onEnterPress","error","helperText","disabled","placeholder","variant","size","color","fullWidth","required","multiline","rows","minRows","maxRows","resize","maxLength","minLength","type","autoComplete","startAdornment","endAdornment","inputStyles","formControlStyles","slotProps","slots","textTransform"]);let S=Jo(C=>{C.key==="Enter"&&!b&&p&&p(i),O.onKeyDown&&O.onKeyDown(C)},[b,p,i,O.onKeyDown]),h=Jo(C=>{if(a)if(Z){let{value:k}=C.target,L=k;switch(Z){case"uppercase":L=k.toUpperCase();break;case"lowercase":L=k.toLowerCase();break;case"capitalize":L=k.replace(/\b\w/g,_=>_.toUpperCase());break}C.target.value=L,a(C)}else a(C)},[a,Z]),v=Ze(()=>r({maxLength:q,minLength:z},O.inputProps||{}),[q,z,O]),I=Ze(()=>E?Nt(Zo,{position:"start",children:E}):void 0,[E]),K=Ze(()=>B?Nt(Zo,{position:"end",children:B}):void 0,[B]),D=Ze(()=>m(r({},N),{input:r(r(m(r({},N==null?void 0:N.input),{inputProps:v}),I&&{startAdornment:I}),K&&{endAdornment:K})}),[N,v,I,K]),$=Ze(()=>b?m(r({},A),{"& textarea":{resize:V}}):A,[b,A,V]),T=Ze(()=>n!=null?n:t!=null&&t.message?t.message:void 0,[n,t==null?void 0:t.message]);return Nt(Za,{error:!!t,disabled:o,required:x,fullWidth:f,sx:W,children:Nt(Ja,m(r({},O),{name:e,label:l,value:i,onChange:h,onFocus:u,onBlur:F,onKeyDown:S,placeholder:s,variant:d,size:g,color:c,fullWidth:f,required:x,error:!!t,disabled:o,multiline:b,rows:P,minRows:R,maxRows:w,type:b?void 0:M,autoComplete:Y,slotProps:D,slots:H,sx:$,ref:X,helperText:T}))})}));Qo.displayName="TextInputField";var Fe=Qo;import{jsx as te,jsxs as he}from"react/jsx-runtime";var oi=()=>{let[e,l]=tn({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:"",status:"ACTIVE"}),[i,a]=tn({}),u=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],F=[{value:"check1",label:"Checkbox 1"},{value:"check2",label:"Checkbox 2"},{value:"check3",label:"Checkbox 3"}],p=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}],t=o=>s=>{l(d=>m(r({},d),{[o]:s})),i[o]&&a(d=>{let g=r({},d);return delete g[o],g})};return he(ti,{sx:{padding:3,maxWidth:"100%",margin:"auto"},children:[te(en,{variant:"h4",gutterBottom:!0,children:"Normal Form (Direct FormInputs)"}),te(en,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using FormInputs directly with useState"}),te(ei,{sx:{my:2}}),te("form",{onSubmit:o=>{o.preventDefault(),console.log("Normal Form Data:",e)},children:he(ge,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:2},children:[he(ge,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(Fe,{name:"text",label:"Text Field",value:e.text,onChange:o=>t("text")(o.target.value),error:i.text?{message:i.text}:null}),te(Ke,{name:"password",label:"Password",value:e.password,onChange:o=>t("password")(o.target.value),error:i.password?{message:i.password}:null})]}),te(Fe,{name:"textarea",label:"Text Area",value:e.textarea,onChange:o=>t("textarea")(o.target.value),multiline:!0,rows:4}),he(ge,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[te(We,{name:"number",label:"Number",pattern:"credit-card",value:e.number,onChange:o=>t("number")(o.target.value)}),te(Ye,{name:"tel",label:"Telephone",pattern:"XX-XXXX-XXXX",value:e.tel,onChange:o=>t("tel")(o.target.value)})]}),te(Ue,{name:"search",label:"Search",value:e.search,onChange:o=>t("search")(o.target.value)}),te(qe,{name:"otp",value:e.otp,onChange:t("otp"),length:6,spacing:2}),te(ce,{name:"select",label:"Select",value:e.select,onChange:o=>t("select")(o.target.value),options:u}),te(ce,{name:"multiselect",label:"Multi Select",value:e.multiselect,onChange:o=>t("multiselect")(o.target.value),options:u,multiple:!0}),te(de,{name:"autocomplete",label:"Autocomplete",value:e.autocomplete,onChange:(o,s)=>t("autocomplete")(s),options:u}),te(de,{name:"multiautocomplete",label:"Multi Autocomplete",value:e.multiautocomplete,onChange:(o,s)=>t("multiautocomplete")(s),options:u,multiple:!0}),te(Ne,{name:"color",label:"Color Picker",value:e.color,onChange:t("color")}),te(Ve,{name:"file",label:"File Upload",value:e.file,onChange:t("file")}),te(He,{name:"date",value:e.date,onChange:t("date")}),he(ge,{children:[te(Oe,{name:"time",value:e.time,onChange:t("time")}),he(ge,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[te(Ee,{name:"checkboxgroup",label:"Checkbox Group",value:e.checkboxgroup,onChange:t("checkboxgroup"),options:F}),te(ke,{name:"radiogroup",label:"Radio Group",value:e.radiogroup,onChange:t("radiogroup"),options:p})]}),he(ge,{sx:{display:"flex",gap:2,mt:2},children:[te(Pe,{name:"checkbox",label:"Checkbox",value:e.checkbox,onChange:t("checkbox")}),te(De,{name:"singleradio",label:"Radio",value:e.singleradio,onChange:t("singleradio")}),te(Be,{name:"switch",label:"Switch",value:e.switch,onChange:t("switch")})]})]}),te(ge,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(ze,{name:"timeclock",label:"Time Clock",value:e.timeclock,onChange:t("timeclock")})}),te(ge,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:te(Me,{name:"calendar",label:"Calendar",value:e.calendar,onChange:t("calendar")})}),te(we,{name:"slider",label:"Slider",value:e.slider,onChange:t("slider"),min:0,max:100}),te(Le,{name:"status",label:"Status",value:e.status,onChange:t("status"),options:[{name:"Active",value:"ACTIVE",color:"success"},{name:"Inactive",value:"INACTIVE",color:"error"}],exclusive:!0,fullWidth:!0}),he(ge,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[te(jo,{variant:"outlined",onClick:()=>l({text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"#000000",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:"",status:"ACTIVE"}),children:"Reset"}),te(jo,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},ni=oi;import{Box as pe,Button as Yn,Divider as ds,Paper as cs,Typography as Zn}from"@mui/material";import{useForm as fs}from"react-hook-form";import{memo as ri}from"react";import{Controller as li}from"react-hook-form";import{jsx as on}from"react/jsx-runtime";var nn=ri(g=>{var c=g,{name:e,label:l,control:i,pattern:a,min:u,max:F,step:p,allowDecimals:t,decimalPlaces:n,defaultValue:o="",onChange:s}=c,d=y(c,["name","label","control","pattern","min","max","step","allowDecimals","decimalPlaces","defaultValue","onChange"]);return on(li,{name:e,control:i,defaultValue:o,render:({field:f,fieldState:{error:x}})=>{var w;let R=d,{size:b}=R,P=y(R,["size"]);return on(We,m(r({},P),{name:e,label:l,value:(w=f.value)!=null?w:"",onChange:V=>{f.onChange(V),s==null||s(V.target.value)},onBlur:f.onBlur,pattern:a,min:u,max:F,step:p,allowDecimals:t,decimalPlaces:n,size:b,error:x,helperText:x==null?void 0:x.message}))}})});nn.displayName="FormInputNumberField";var nt=nn;import{memo as ai}from"react";import{Controller as ii}from"react-hook-form";import{jsx as rn}from"react/jsx-runtime";var ln=ai(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a="",onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return rn(ii,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return rn(qe,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:"",onChange:f=>{n.onChange(f),u==null||u(f)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});ln.displayName="FormInputOTPField";var rt=ln;import{memo as si}from"react";import{Controller as ui}from"react-hook-form";import{jsx as an}from"react/jsx-runtime";var sn=si(t=>{var n=t,{name:e,label:l,control:i,size:a,defaultValue:u="",onChange:F}=n,p=y(n,["name","label","control","size","defaultValue","onChange"]);return an(ui,{name:e,control:i,defaultValue:u,render:({field:o,fieldState:{error:s}})=>{var f;let c=p,{size:d}=c,g=y(c,["size"]);return an(Ke,m(r({},g),{name:e,label:l,value:(f=o.value)!=null?f:"",onChange:x=>{o.onChange(x),F==null||F(x.target.value)},onBlur:o.onBlur,error:s,helperText:s==null?void 0:s.message,size:a!=null?a:d}))}})});sn.displayName="FormInputPasswordField";var lt=sn;import{memo as mi}from"react";import{Controller as pi}from"react-hook-form";import{jsx as un}from"react/jsx-runtime";var mn=mi(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a="",onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return un(pi,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return un(Ue,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:"",onChange:f=>{n.onChange(f),u==null||u(f.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});mn.displayName="FormInputSearchField";var at=mn;import{memo as di}from"react";import{Controller as ci}from"react-hook-form";import{jsx as pn}from"react/jsx-runtime";var dn=di(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a="",onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return pn(ci,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return pn(Ye,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:"",onChange:f=>{n.onChange(f),u==null||u(f.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});dn.displayName="FormInputTelField";var it=dn;import{memo as fi}from"react";import{Controller as Fi}from"react-hook-form";import{jsx as cn}from"react/jsx-runtime";var fn=fi(s=>{var d=s,{name:e,label:l,control:i,rows:a,minRows:u,maxRows:F,resize:p,defaultValue:t="",onChange:n}=d,o=y(d,["name","label","control","rows","minRows","maxRows","resize","defaultValue","onChange"]);return cn(Fi,{name:e,control:i,defaultValue:t,render:({field:g,fieldState:{error:c}})=>{var P;let b=o,{size:f}=b,x=y(b,["size"]);return cn(Fe,m(r({},x),{name:e,label:l,value:(P=g.value)!=null?P:"",onChange:R=>{g.onChange(R),n==null||n(R.target.value)},onBlur:g.onBlur,multiline:!0,rows:a,minRows:u,maxRows:F,resize:p,size:f,error:c,helperText:c==null?void 0:c.message}))}})});fn.displayName="FormInputTextArea";var st=fn;import{memo as gi}from"react";import{Controller as bi}from"react-hook-form";import{jsx as Fn}from"react/jsx-runtime";var gn=gi(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a="",onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return Fn(bi,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return Fn(Fe,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:"",onChange:f=>{n.onChange(f),u==null||u(f.target.value)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});gn.displayName="FormInputTextField";var ut=gn;import{memo as yi}from"react";import{Controller as xi}from"react-hook-form";import{jsx as bn}from"react/jsx-runtime";var yn=yi(o=>{var s=o,{name:e,label:l,control:i,options:a=[],disabled:u,placeholder:F,defaultValue:p=null,onChange:t}=s,n=y(s,["name","label","control","options","disabled","placeholder","defaultValue","onChange"]);return bn(xi,{name:e,control:i,defaultValue:p,render:({field:d,fieldState:{error:g}})=>{let{value:c,onBlur:f}=d,P=n,{size:x}=P,b=y(P,["size"]);return bn(de,m(r({name:e,label:l,placeholder:F,disabled:u,options:a,value:c!=null?c:null,size:x,error:g,helperText:g==null?void 0:g.message},b),{onChange:(R,w)=>{d.onChange(w),t==null||t(w)},onBlur:f}))}})});yn.displayName="FormInputAutoComplete";var mt=yn;import{memo as vi}from"react";import{Controller as Ci}from"react-hook-form";import{jsx as xn}from"react/jsx-runtime";var vn=vi(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a="#000000",onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return xn(Ci,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return xn(Ne,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:a,onChange:f=>{n.onChange(f),u==null||u(f)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});vn.displayName="FormInputColorPicker";var pt=vn;import{memo as hi,useRef as Ii}from"react";import{Controller as Ti}from"react-hook-form";import{jsx as Cn}from"react/jsx-runtime";var hn=hi(t=>{var n=t,{name:e,label:l,control:i,size:a,defaultValue:u=null,onChange:F}=n,p=y(n,["name","label","control","size","defaultValue","onChange"]);let o=Ii(null);return Cn(Ti,{name:e,control:i,defaultValue:u,render:({field:s,fieldState:{error:d}})=>{var g;return Cn(Ve,m(r({},p),{name:e,label:l,value:(g=s.value)!=null?g:null,size:a,ref:o,onChange:c=>{s.onChange(c),F==null||F(c)},onBlur:s.onBlur,error:d,helperText:d==null?void 0:d.message}))}})});hn.displayName="FormInputFileUpload";var dt=hn;import{memo as Pi,useMemo as Ri}from"react";import{Controller as Ei}from"react-hook-form";import{jsx as In}from"react/jsx-runtime";var Tn=Pi(o=>{var s=o,{name:e,label:l,control:i,options:a=[],disabled:u,placeholder:F,defaultValue:p=[],onChange:t}=s,n=y(s,["name","label","control","options","disabled","placeholder","defaultValue","onChange"]);let d=Ri(()=>a,[a]);return In(Ei,{name:e,control:i,defaultValue:p,render:({field:g,fieldState:{error:c}})=>{let{value:f,onBlur:x}=g,w=n,{size:b}=w,P=y(w,["size"]),R=Array.isArray(f)?f:[];return In(de,m(r({},P),{name:e,label:l,placeholder:F,disabled:u,options:d,multiple:!0,value:R,onChange:(V,q)=>{g.onChange(q),t==null||t(q)},onBlur:x,size:b,error:c,helperText:c==null?void 0:c.message}))}})});Tn.displayName="FormInputMultiAutoComplete";var ct=Tn;import{memo as Di,useMemo as Si}from"react";import{Controller as ki}from"react-hook-form";import{jsx as Pn}from"react/jsx-runtime";var Rn=Di(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:u=[],onChange:F}=n,p=y(n,["name","label","control","options","defaultValue","onChange"]);let o=Si(()=>a,[a]);return Pn(ki,{name:e,control:i,defaultValue:u,render:({field:s,fieldState:{error:d}})=>{let x=p,{size:g}=x,c=y(x,["size"]),f=Array.isArray(s.value)?s.value:[];return Pn(ce,m(r({},c),{name:e,label:l,options:o,multiple:!0,value:f,onChange:b=>{s.onChange(b),F==null||F(b.target.value)},onBlur:s.onBlur,size:g,error:d,helperText:d==null?void 0:d.message}))}})});Rn.displayName="FormInputMultiSelect";var ft=Rn;import{memo as wi,useMemo as Bi}from"react";import{Controller as Li}from"react-hook-form";import{jsx as En}from"react/jsx-runtime";var Dn=wi(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:u="",onChange:F}=n,p=y(n,["name","label","control","options","defaultValue","onChange"]);let o=Bi(()=>a,[a]);return En(Li,{name:e,control:i,defaultValue:u,render:({field:s,fieldState:{error:d}})=>{var x;let f=p,{size:g}=f,c=y(f,["size"]);return En(ce,m(r({},c),{name:e,label:l,options:o,value:(x=s.value)!=null?x:"",onChange:b=>{s.onChange(b),F==null||F(b.target.value)},onBlur:s.onBlur,size:g,error:d,helperText:d==null?void 0:d.message}))}})});Dn.displayName="FormInputSelect";var Ft=Dn;import{Box as Mi,FormLabel as Hi}from"@mui/material";import{memo as Ai}from"react";import{Controller as zi}from"react-hook-form";import{jsx as _t,jsxs as Oi}from"react/jsx-runtime";var Sn=Ai(n=>{var o=n,{name:e,label:l,control:i,readOnly:a,disabled:u,defaultValue:F=null,onChange:p}=o,t=y(o,["name","label","control","readOnly","disabled","defaultValue","onChange"]);return Oi(Mi,{sx:{border:s=>`1px solid ${s.palette.grey[600]}`,borderRadius:s=>s.spacing(.5),display:"flex",flexDirection:"column"},children:[_t(Hi,{sx:s=>({borderBottom:`1px solid ${s.palette.grey[600]}`,padding:"4px"}),children:l}),_t(zi,{name:e,control:i,defaultValue:F,render:({field:s,fieldState:{error:d}})=>{var c;let g=y(t,[]);return _t(Me,m(r({},g),{name:e,value:(c=s.value)!=null?c:null,onChange:f=>{s.onChange(f),p==null||p(f)},disabled:u,readOnly:a,error:d,helperText:d==null?void 0:d.message,sx:r({height:"300px"},g.sx)}))}})]})});Sn.displayName="FormInputCalendar";var gt=Sn;import{memo as Ni}from"react";import{Controller as Vi}from"react-hook-form";import{jsx as kn}from"react/jsx-runtime";var wn=Ni(d=>{var g=d,{name:e,label:l,control:i,size:a,readOnly:u,shouldDisableDate:F,disabled:p,placeholder:t,defaultValue:n=null,onChange:o}=g,s=y(g,["name","label","control","size","readOnly","shouldDisableDate","disabled","placeholder","defaultValue","onChange"]);return kn(Vi,{name:e,control:i,defaultValue:n,render:({field:c,fieldState:{error:f}})=>{var R;let P=s,{views:x}=P,b=y(P,["views"]);return kn(He,m(r({},b),{name:e,label:l,placeholder:t,disabled:p,value:(R=c.value)!=null?R:null,onChange:w=>{c.onChange(w),o==null||o(w)},onBlur:c.onBlur,shouldDisableDate:F,size:a,error:f,helperText:f==null?void 0:f.message,readOnly:u}))}})});wn.displayName="FormInputDatePicker";var bt=wn;import{Box as Wi,FormLabel as Gi}from"@mui/material";import{memo as qi,useMemo as Ki}from"react";import{Controller as $i}from"react-hook-form";import{jsx as Yt,jsxs as Xi}from"react/jsx-runtime";var Bn=qi(g=>{var c=g,{name:e,label:l,control:i,readOnly:a,disabled:u,ampm:F=!0,views:p,ampmInClock:t=!0,disablePast:n=!1,defaultValue:o=null,onChange:s}=c,d=y(c,["name","label","control","readOnly","disabled","ampm","views","ampmInClock","disablePast","defaultValue","onChange"]);let f=Ki(()=>typeof F=="boolean"?F:void 0,[F]);return Xi(Wi,{sx:{border:x=>`1px solid ${x.palette.grey[600]}`,borderRadius:x=>x.spacing(.5),display:"flex",flexDirection:"column"},children:[Yt(Gi,{sx:x=>({borderBottom:`1px solid ${x.palette.grey[600]}`,padding:b=>b.spacing(1)}),children:l}),Yt($i,{name:e,control:i,defaultValue:o,render:({field:x,fieldState:{error:b}})=>{var P;return Yt(ze,m(r({},d),{name:e,value:(P=x.value)!=null?P:null,onChange:R=>{x.onChange(R),s==null||s(R)},ampm:f,disabled:u,readOnly:a,ampmInClock:t,disablePast:n,views:p,error:b,helperText:b==null?void 0:b.message}))}})]})});Bn.displayName="FormInputTimeClock";var yt=Bn;import{memo as Ui}from"react";import{Controller as _i}from"react-hook-form";import{jsx as Ln}from"react/jsx-runtime";var Mn=Ui(n=>{var o=n,{name:e,label:l,control:i,ampm:a=!0,timezone:u,defaultValue:F=null,onChange:p}=o,t=y(o,["name","label","control","ampm","timezone","defaultValue","onChange"]);return Ln(_i,{name:e,control:i,defaultValue:F,render:({field:s,fieldState:{error:d}})=>{var x;let f=t,{size:g}=f,c=y(f,["size"]);return Ln(Oe,m(r({},c),{name:e,label:l,value:(x=s.value)!=null?x:null,onChange:b=>{s.onChange(b),p==null||p(b)},onBlur:s.onBlur,ampm:a,timezone:u,size:g,error:d,helperText:d==null?void 0:d.message}))}})});Mn.displayName="FormInputTimePicker";var xt=Mn;import{memo as Yi}from"react";import{Controller as Zi}from"react-hook-form";import{jsx as Hn}from"react/jsx-runtime";var An=Yi(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a=!1,onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return Hn(Zi,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return Hn(Pe,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:!1,onChange:f=>{n.onChange(f),u==null||u(f)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});An.displayName="FormInputCheckBox";var vt=An;import{memo as Ji,useMemo as Qi}from"react";import{Controller as ji}from"react-hook-form";import{jsx as zn}from"react/jsx-runtime";var On=Ji(s=>{var d=s,{name:e,label:l,control:i,options:a=[],defaultValue:u=[],onChange:F,row:p,color:t,labelPlacement:n}=d,o=y(d,["name","label","control","options","defaultValue","onChange","row","color","labelPlacement"]);let g=Qi(()=>a.map(c=>({value:c.value,label:c.name,disabled:c.disabled})),[a]);return zn(ji,{name:e,control:i,defaultValue:u,render:({field:c,fieldState:{error:f}})=>{let R=o,{size:x}=R,b=y(R,["size"]),P=Array.isArray(c.value)?c.value:[];return zn(Ee,m(r({},b),{name:e,label:l,value:P,options:g,onChange:w=>{c.onChange(w),F==null||F(w)},onBlur:c.onBlur,row:p,color:t,labelPlacement:n,size:x,error:f,helperText:f==null?void 0:f.message}))}})});On.displayName="FormInputCheckBoxGroup";var Ct=On;import{memo as es}from"react";import{Controller as ts}from"react-hook-form";import{jsx as Nn}from"react/jsx-runtime";var Vn=es(n=>{var o=n,{name:e,label:l,control:i,defaultValue:a=!1,onChange:u,color:F,labelPlacement:p}=o,t=y(o,["name","label","control","defaultValue","onChange","color","labelPlacement"]);return Nn(ts,{name:e,control:i,defaultValue:a,render:({field:s,fieldState:{error:d}})=>{var x;let f=t,{size:g}=f,c=y(f,["size"]);return Nn(De,m(r({},c),{name:e,label:l,value:(x=s.value)!=null?x:!1,onChange:b=>{s.onChange(b),u==null||u(b)},onBlur:s.onBlur,color:F,labelPlacement:p,size:g,error:d,helperText:d==null?void 0:d.message}))}})});Vn.displayName="FormInputRadioButton";var ht=Vn;import{memo as os,useMemo as ns}from"react";import{Controller as rs}from"react-hook-form";import{jsx as Wn}from"react/jsx-runtime";var Gn=os(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:u="",onChange:F}=n,p=y(n,["name","label","control","options","defaultValue","onChange"]);let o=ns(()=>Array.isArray(a)?a:[],[a]);return Wn(rs,{name:e,control:i,defaultValue:u,render:({field:s,fieldState:{error:d}})=>{var x;let f=p,{size:g}=f,c=y(f,["size"]);return Wn(ke,m(r({},c),{name:e,label:l,value:(x=s.value)!=null?x:"",onChange:b=>{s.onChange(b),F==null||F(b)},onBlur:s.onBlur,options:o,size:g,error:d,helperText:d==null?void 0:d.message}))}})});Gn.displayName="FormInputRadioButtonGroup";var It=Gn;import{memo as ls}from"react";import{Controller as as}from"react-hook-form";import{jsx as qn}from"react/jsx-runtime";var Kn=ls(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a=0,onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return qn(as,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return qn(we,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:a,onChange:f=>{n.onChange(f),u==null||u(f)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});Kn.displayName="FormInputSlider";var Tt=Kn;import{memo as is}from"react";import{Controller as ss}from"react-hook-form";import{jsx as $n}from"react/jsx-runtime";var Xn=is(p=>{var t=p,{name:e,label:l,control:i,defaultValue:a=!1,onChange:u}=t,F=y(t,["name","label","control","defaultValue","onChange"]);return $n(ss,{name:e,control:i,defaultValue:a,render:({field:n,fieldState:{error:o}})=>{var c;let g=F,{size:s}=g,d=y(g,["size"]);return $n(Be,m(r({},d),{name:e,label:l,value:(c=n.value)!=null?c:!1,onChange:f=>{n.onChange(f),u==null||u(f)},onBlur:n.onBlur,size:s,error:o,helperText:o==null?void 0:o.message}))}})});Xn.displayName="FormInputSwitch";var Pt=Xn;import{memo as us,useMemo as ms}from"react";import{Controller as ps}from"react-hook-form";import{jsx as Un}from"react/jsx-runtime";var _n=us(t=>{var n=t,{name:e,label:l,control:i,options:a=[],defaultValue:u="",onChange:F}=n,p=y(n,["name","label","control","options","defaultValue","onChange"]);let o=ms(()=>Array.isArray(a)?a:[],[a]);return Un(ps,{name:e,control:i,defaultValue:u,render:({field:s,fieldState:{error:d}})=>{var x;let f=p,{size:g}=f,c=y(f,["size"]);return Un(Le,m(r({},c),{name:e,label:l,value:(x=s.value)!=null?x:u,onChange:b=>{s.onChange(b),F==null||F(b)},onBlur:s.onBlur,options:o,size:g,error:d,helperText:d==null?void 0:d.message}))}})});_n.displayName="FormInputToggleButton";var Rt=_n;import{jsx as j,jsxs as Ie}from"react/jsx-runtime";var re="small",Fs=()=>{let{control:e,handleSubmit:l,reset:i}=fs({defaultValues:{text:"",textarea:"",password:"",number:"",tel:"",search:"",otp:"",select:"",multiselect:[],autocomplete:null,multiautocomplete:[],color:"",file:null,date:null,time:null,timeclock:null,calendar:null,checkbox:!1,checkboxgroup:[],switch:!1,slider:0,singleradio:!1,radiogroup:"",status:"ACTIVE"}}),a=[{name:"Option 1",value:"opt1"},{name:"Option 2",value:"opt2"},{name:"Option 3",value:"opt3"}],u=[{name:"Checkbox 1",value:"check1"},{name:"Checkbox 2",value:"check2"},{name:"Checkbox 3",value:"check3"}],F=[{name:"Radio 1",value:"radio1"},{name:"Radio 2",value:"radio2"},{name:"Radio 3",value:"radio3"}];return Ie(cs,{sx:{padding:3,maxWidth:"100%",margin:"auto"},children:[j(Zn,{variant:"h4",gutterBottom:!0,children:"React Hook Form (HookFormFields)"}),j(Zn,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"Using HookFormFields with react-hook-form"}),j(ds,{sx:{my:2}}),j("form",{onSubmit:l(t=>{console.log("React Hook Form Data:",t)}),children:Ie(pe,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:2},children:[Ie(pe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[j(ut,{name:"text",label:"Text Field",control:e,size:re}),j(lt,{name:"password",label:"Password",control:e,size:re})]}),j(st,{name:"textarea",label:"Text Area",control:e,rows:4,size:re}),Ie(pe,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[j(nt,{name:"number",label:"Number",pattern:"zip-code",control:e,size:re}),j(it,{name:"tel",label:"Telephone",pattern:"XX-XXX-XXXXXX-X-XX",control:e,size:re})]}),j(at,{name:"search",label:"Search",control:e,size:re}),j(rt,{name:"otp",control:e,spacing:2,size:re}),j(Ft,{name:"select",label:"Select",control:e,options:a,size:re}),j(ft,{name:"multiselect",label:"Multi Select",control:e,options:a,size:re}),j(mt,{name:"autocomplete",label:"Autocomplete",control:e,options:a,size:re}),j(ct,{name:"multiautocomplete",label:"Multi Autocomplete",control:e,options:a,size:re}),j(pt,{name:"color",label:"Color Picker",control:e,size:re}),j(dt,{name:"file",label:"File Upload",control:e,size:re}),j(bt,{name:"date",control:e,size:re}),Ie(pe,{children:[j(xt,{name:"time",control:e,size:re}),Ie(pe,{sx:{display:"grid",gridTemplateColumns:{md:"1fr 1fr"},gap:2,mt:2},children:[j(Ct,{name:"checkboxgroup",label:"Select Options",control:e,options:u,size:re}),j(It,{name:"radiogroup",label:"Radio Group",control:e,options:F,size:re})]}),Ie(pe,{sx:{display:"flex",gap:2,mt:2},children:[j(vt,{name:"checkbox",label:"Checkbox",control:e,size:re}),j(ht,{name:"singleradio",label:"Radio",control:e,size:re}),j(Pt,{name:"switch",label:"Switch",control:e,size:re})]})]}),j(pe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:j(yt,{name:"timeclock",label:"Time Clock",control:e,size:re})}),j(pe,{sx:{border:1,borderColor:"grey.300",borderRadius:1,p:2},children:j(gt,{name:"calendar",label:"Calendar",control:e,size:re})}),j(pe,{children:j(Tt,{name:"slider",label:"Slider",control:e,size:re})}),j(pe,{children:j(Rt,{name:"status",label:"Status",control:e,options:[{name:"Active",value:"ACTIVE"},{name:"Inactive",value:"INACTIVE"},{name:"Done",value:"DONE"}],exclusive:!0,fullWidth:!0,size:re})}),Ie(pe,{sx:{gridColumn:{xs:"1",md:"1 / -1"},display:"flex",gap:2,justifyContent:"flex-end"},children:[j(Yn,{variant:"outlined",onClick:()=>i(),children:"Reset"}),j(Yn,{type:"submit",variant:"contained",children:"Submit"})]})]})})]})},gs=Fs;var bs={FormInputTextField:ut,FormInputTextArea:st,FormInputPasswordField:lt,FormInputNumberField:nt,FormInputTelField:it,FormInputSearchField:at,FormInputOTPField:rt,FormInputSelect:Ft,FormInputMultiSelect:ft,FormInputAutoComplete:mt,FormInputMultiAutoComplete:ct,FormInputColorPicker:pt,FormInputFileUpload:dt,FormInputDatePicker:bt,FormInputTimePicker:xt,FormInputTimeClock:yt,FormInputCalendar:gt,FormInputCheckBox:vt,FormInputCheckBoxGroup:Ct,FormInputSwitch:Pt,FormInputSlider:Tt,FormInputSingleRadio:ht,FormInputRadioButtonGroup:It,FormInputToggleButton:Rt,TextInputField:Fe,PasswordField:Ke,NumberField:We,TelInputField:Ye,SearchInputField:Ue,OTPField:qe,SelectInputField:ce,AutoCompleteField:de,ColorPickerField:Ne,FileUploadField:Ve,DatePickerField:He,TimePickerField:Oe,TimeClockField:ze,DateCalendarField:Me,CheckBoxField:Pe,CheckBoxFieldGroup:Ee,RadioButtonField:De,RadioButtonFieldGroup:ke,SwitchField:Be,SliderField:we,ToggleButtonField:Le},kF=bs;export{de as AutoCompleteField,Pe as CheckBoxField,Ee as CheckBoxFieldGroup,Ne as ColorPickerField,Me as DateCalendarField,He as DatePickerField,ni as DemoForm,gs as DemoHookForm,Ve as FileUploadField,mt as FormInputAutoComplete,gt as FormInputCalendar,vt as FormInputCheckBox,Ct as FormInputCheckBoxGroup,pt as FormInputColorPicker,bt as FormInputDatePicker,dt as FormInputFileUpload,ct as FormInputMultiAutoComplete,ft as FormInputMultiSelect,nt as FormInputNumberField,rt as FormInputOTPField,lt as FormInputPasswordField,It as FormInputRadioButtonGroup,at as FormInputSearchField,Ft as FormInputSelect,ht as FormInputSingleRadio,Tt as FormInputSlider,Pt as FormInputSwitch,it as FormInputTelField,st as FormInputTextArea,ut as FormInputTextField,yt as FormInputTimeClock,xt as FormInputTimePicker,Rt as FormInputToggleButton,We as NumberField,qe as OTPField,Ke as PasswordField,De as RadioButtonField,ke as RadioButtonFieldGroup,Ue as SearchInputField,ce as SelectInputField,we as SliderField,Be as SwitchField,Ye as TelInputField,Fe as TextInputField,ze as TimeClockField,Oe as TimePickerField,Le as ToggleButtonField,kF as default};
2
2
  //# sourceMappingURL=index.mjs.map