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