import{ao as e,aT as m,a_ as g,e4 as v,ba as P,e5 as C,e3 as k,co as f,aq as S,e6 as $,aJ as w,c8 as L,e7 as u,by as z}from"./app-k0jcl5PQ.js";import{V as H}from"./Di9d6zcy.chunk.js";import{V as I}from"./CKctgafI.chunk.js";function A(s){const{label:o,checkboxLabelClassName:a,checkboxLabelFontWeight:n,className:r,infoText:i,infoTooltip:t,infoTooltipPlacement:c,...d}=s;return e.jsxs(m.Group,{className:"form-group",children:[e.jsxs("div",{className:`form-check ${r||""}`,children:[e.jsx(N,{className:"form-check-input",...d}),e.jsxs("div",{className:"d-inline-flex align-items-center",children:[e.jsx(m.Label,{className:`form-check-label cursor-pointer ${n==="normal"?"fw-normal":""} 
          ${a}`,htmlFor:d.id,children:o}),t&&e.jsx(g,{className:"svg-container text-secondary ms-1",svg:v,title:t,tooltipSpanHackClassName:"d-inline-flex align-items-center",tooltipPlacement:c,tooltipSpanHack:!0})]}),s.checkboxAppLink&&s.checkboxAppLinkText&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" "}),e.jsx(P,{appLink:s.checkboxAppLink,className:"info-link",children:s.checkboxAppLinkText})]})]}),i&&e.jsx(m.Text,{className:"text-secondary",children:i})]})}function E(s,o){let a="";switch(s){case"select":a="form-select";break;default:a="form-control"}return o==="sm"&&(a+=` ${a}-sm`),o==="lg"&&(a+=` ${a}-lg`),a}const O={getCustomFormControlClassName(s,o,a,n,r,i){let t="";return t=E(i,n),C(o,a)&&C(s,a)&&(t+=" is-invalid"),r&&(t+=` ${r}`),t}};function D(s){const{values:o}=k(),a=f.get(o,s.fieldName);return typeof a!="string"?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"float-end text-secondary fw-normal",children:[a.length,"/",s.limit," characters"]})}const G="_revealPassword_1htoy_1",V="_passwordInput_1htoy_7",W="_passwordContainer_1htoy_14",q="_passwordContainerDisabled_1htoy_26",R="_infoTooltip_1htoy_29",J="_spinner_1htoy_32",p={revealPassword:G,passwordInput:V,passwordContainer:W,passwordContainerDisabled:q,infoTooltip:R,spinner:J},M="shared.formField";N.defaultProps={autoComplete:"off"};function N(s){const{children:o,showLoadingSpinner:a,...n}=s,[r,i]=w.useState(s.type);function t(){i(r==="password"?"text":"password")}const c=L.isFunction(o)?h=>o(h):w.Children.count(o)?o:null;if(n.type!=="password")return a?e.jsxs("div",{className:"position-relative",children:[e.jsx(u,{...f.omit(n,["formSize"]),children:c}),e.jsx("div",{className:p.spinner,children:e.jsx(z,{animation:"border",size:"sm"})})]}):e.jsx(u,{...f.omit(n,["formSize"]),children:c});let d=`position-relative ${p.passwordContainer}`;return n.className&&(d+=` ${n.className}`),n.disabled&&(d+=` ${p.passwordContainerDisabled}`),e.jsxs("div",{className:d,children:[e.jsx(u,{...f.omit(n,["formSize","type","className"]),type:r,className:`${p.passwordInput} border-0 w-100 h-100 outline-none rounded`,children:c}),n.type==="password"&&e.jsx(g,{svg:r==="password"?I:H,className:`svg-container cursor-pointer ${p.revealPassword}`,onClick:t})]})}B.defaultProps={autoComplete:"off",infoTooltipPlacement:"top"};function B(s){const{label:o,className:a,showCharacterCounter:n,showRequiredStar:r,infoTooltip:i,infoTooltipPlacement:t,infoText:c,formSize:d,showOptionalLabel:h,formGroupClassname:y,labelClassName:T,...l}=s,{errors:F,touched:_}=k(),j=()=>{};if(l.type==="checkbox"){const x=f.omit(s,["formSize","infoTooltipPlacement"]);return s.disabled&&(x.onChange=j),e.jsx(A,{...x})}const b={...l,className:O.getCustomFormControlClassName(F,_,l.name,d,a,typeof s.as=="string"?s.as:null)};return s.disabled&&(b.onChange=j),e.jsxs(m.Group,{className:`form-group ${y}`,children:[!!o&&e.jsxs(m.Label,{htmlFor:l.id,className:`d-flex align-items-center ${T}`,children:[o,r&&e.jsx("span",{className:"text-danger",children:"*"}),i&&e.jsx(g,{className:`svg-container text-secondary ${p.infoTooltip}`,svg:v,title:i,tooltipPlacement:t,tooltipSpanHack:!0}),h&&e.jsxs("span",{className:"text-secondary",children:[" ",e.jsx(S,{namespace:M,phrase:"optional"})]}),!!n&&!!l.maxLength&&e.jsx("div",{className:"ms-auto",children:e.jsx(D,{fieldName:l.name,limit:l.maxLength})})]}),s.description&&e.jsx("p",{children:s.description}),e.jsx(N,{...b,"aria-errormessage":`${l.name}Error`}),!!c&&e.jsx(m.Text,{className:"text-secondary",children:c}),e.jsx($,{name:l.name,children:x=>e.jsx(m.Control.Feedback,{id:`${l.name}Error`,type:"invalid",role:"status",children:x})})]})}export{B as F,N as a,O as b};
//# sourceMappingURL=DV1GpLCe.chunk.js.map
