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