@ilife-tech/react-application-flow-renderer 1.4.8 → 1.4.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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -99,4 +99,4 @@
99
99
  animation: ${Xk} 1.4s linear infinite;
100
100
  `:null,eO="string"!=typeof Zk?Ky`
101
101
  animation: ${Zk} 1.4s ease-in-out infinite;
102
- `:null,tO=Ey("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ag(n.color)}`]]}})(ig(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Jk||{animation:`${Xk} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),nO=Ey("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),rO=Ey("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ag(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(ig(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:eO||{animation:`${Zk} 1.4s ease-in-out infinite`}}]}))),oO=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,p={...n,color:o,disableShrink:i,size:a,thickness:l,value:u,variant:c},f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Np({root:["root",n,`color${ag(r)}`],svg:["svg"],circle:["circle",`circle${ag(n)}`,o&&"circleDisableShrink"]},Kk,t)})(p),m={},h={},v={};if("determinate"===c){const e=2*Math.PI*((44-l)/2);m.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,h.transform="rotate(-90deg)"}return(0,Iy.jsx)(tO,{className:Lp(f.root,r),style:{width:a,height:a,...h,...s},ownerState:p,ref:t,role:"progressbar",...v,...d,children:(0,Iy.jsx)(nO,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,Iy.jsx)(rO,{className:f.circle,style:m,ownerState:p,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function iO(e){return mg("MuiIconButton",e)}const aO=hg("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),sO=Ey(Yk,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${ag(n.color)}`],n.edge&&t[`edge${ag(n.edge)}`],t[`size${ag(n.size)}`]]}})(ig(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),ig(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${aO.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${aO.loading}`]:{color:"transparent"}}))),lO=Ey("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),uO=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:p,...f}=n,m=bk(c),h=p??(0,Iy.jsx)(oO,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:h,size:u},y=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:a}=e;return Np({root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${ag(r)}`,o&&`edge${ag(o)}`,`size${ag(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},iO,t)})(v);return(0,Iy.jsxs)(sO,{id:d?m:c,className:Lp(y.root,i),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:v,children:["boolean"==typeof d&&(0,Iy.jsx)("span",{className:y.loadingWrapper,style:{display:"contents"},children:(0,Iy.jsx)(lO,{className:y.loadingIndicator,ownerState:v,children:d&&h})}),o]})});function cO(e){return cO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cO(e)}function dO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dO(Object(n),!0).forEach(function(t){fO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fO(e,t,n){return(t=function(e){var t=function(e){if("object"!=cO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mO=function(e){var t=e.tooltip,r=e.placement,o=void 0===r?"top":r,i=e.sx,a=void 0===i?{}:i;return t?n().createElement(Tk,{title:t,arrow:!0,placement:o},n().createElement(uO,{size:"small",sx:pO({padding:"2px",marginLeft:"4px",verticalAlign:"middle",minWidth:"auto",width:"18px",height:"18px","&:hover":{backgroundColor:"transparent"}},a),"aria-label":t},n().createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"10px",fontWeight:"bold",lineHeight:1}},"i"))):null};mO.propTypes={tooltip:o().string,placement:o().oneOf(["top","bottom","left","right"]),sx:o().object};const hO=mO;function vO(e){return vO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vO(e)}function yO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yO(Object(n),!0).forEach(function(t){bO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bO(e,t,n){return(t=function(e){var t=function(e){if("object"!=vO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wO=function(t){var r=t.questionId,o=t.label,i=t.defaultValue,a=t.validation,s=t.value,l=t.required,u=t.disabled,c=void 0!==u&&u,d=t.placeholder,p=t.onChange,f=t.type,m=void 0===f?"text":f,h=t.maskInput,v=t.format,y=t.helperText,g=(t._encrypted,t._maskingType,t._maskingLength,t._validationErrorMessages,t._showCheckBox,t._isEsignDoc,t._isOpenInNewTab,t._addAdditional,t._addMedication,t.header),b=t.maxLength,w=t.minLength,S=t.visible,x=t.inputProps,k=void 0===x?{}:x,O=t.styleName,_=t.customTheme,E=void 0===_?{}:_,C=(t._props,t.onSearch),I=t.onBlur,T=t.tooltip,A=void 0===T?"":T,P=t.showQuestionLabels,D=void 0===P||P,j=t.testId,R=(0,e.useRef)(null),M=sd(),L=k["data-item-index"],N=k["data-parent-id"],F=$S({questionId:r,itemIndex:L,defaultValue:i,defaultVisible:!0,defaultDisabled:!1}),V=F.disabled,B=F.error,q=V||c,Q=(0,e.useMemo)(function(){var e=M.textField||{};return YS(e,E)},[M,E]),z=(0,e.useMemo)(function(){var e=gO(gO({},Q.container),{},{width:"100%"}),t=ZS(Q.input,B&&Q.error,q&&Q.disabled);return{container:KS(e,Q.responsive),input:t}},[Q,B,q]);(0,e.useEffect)(function(){if(h&&R.current){var e=function(e){var t={placeholder:"",insertMode:!0,rightAlign:!1,clearMaskOnLostFocus:!1,showMaskOnHover:!1,showMaskOnFocus:!1,jitMasking:!0,greedy:!1};if("string"==typeof e){var n=e;return"#####-####"===e.replaceAll("9","#")&&(n="#####[-####]"),new(Qa())(js(js({},t),{},{mask:n.replaceAll("#","9")}))}var r=e.alias,o=e.inputFormat,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ts);return new(Qa())(js(js({},t),{},{alias:r,inputFormat:o},i))}(h);return e.mask(R.current),function(){e.remove()}}},[h,m]);var $=(0,e.useMemo)(function(){return Ms(m)},[m]),U=(0,e.useMemo)(function(){return"number"!==m?{}:{onWheel:function(e){e.target.blur()},onKeyDown:function(e){var t=e.key;"ArrowUp"!==t&&"ArrowDown"!==t&&"PageUp"!==t&&"PageDown"!==t||e.preventDefault(),("e"===t||"E"===t||"+"===t||"="===t&&e.shiftKey)&&e.preventDefault()}}},[m]),W=(0,e.useMemo)(function(){if("number"===m)return{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},[m]),H=(0,e.useMemo)(function(){return ZS(W,XS(Q.disabled))},[W,Q.disabled]);if(!S)return null;var G=m,Y=b,K=void 0===L?r:"".concat(r,"-").concat(L);return n().createElement("div",{className:"form-field ".concat(O||""),style:z.container},g&&n().createElement("div",{className:"field-header",style:M.header},g),n().createElement("div",{style:{position:"relative"}},n().createElement(NS,{inputRef:R,value:s,onChange:function(e){var t=Is(e.target.value,m,h);C&&C(t),al({name:r,validation:a,required:l,type:m,format:v,questionType:m},e.target.value),p&&p(gO(gO({},e),{},{target:{value:t,name:r,type:m}}))},onBlur:I,sx:H,disabled:q,required:l,autoComplete:"off",placeholder:d+"sdwd",type:G,inputMode:$,error:!!B,helperText:B||y,label:D?o:"",id:String(K),name:String(K),slotProps:{input:gO(gO({},k),{},{inputProps:gO(gO({maxLength:Y,minLength:w},U),{},{"data-testid":j}),inputMode:Ms(m)}),inputLabel:{style:M.label,required:D&&l},formHelperText:{style:B?M.error:M.helperText}},"data-item-index":L,"data-parent-id":N,fullWidth:!0}),D&&A&&o&&n().createElement("div",{style:{position:"absolute",top:"8px",right:"8px"}},n().createElement(hO,{tooltip:A}))))};wO.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,defaultValue:o().string,validation:o().object,value:o().oneOfType([o().string,o().number]),required:o().bool,disabled:o().bool,placeholder:o().string,onChange:o().func,type:o().oneOf(["text","email","tel","password","url","number"]),maskInput:o().oneOfType([o().string,o().object,o().func]),format:o().string,helperText:o().string,_encrypted:o().any,_maskingType:o().any,_maskingLength:o().oneOfType([o().string,o().number]),_validationErrorMessages:o().any,_showCheckBox:o().any,_isEsignDoc:o().any,_isOpenInNewTab:o().any,_addAdditional:o().any,_addMedication:o().any,header:o().string,maxLength:o().number,minLength:o().number,visible:o().bool,inputProps:o().object,styleName:o().string,tooltip:o().string,customTheme:o().object,_props:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),onSearch:o().func,onBlur:o().func,showQuestionLabels:o().bool,testId:o().string};const SO=wO;var xO=["name","addressGroup","label","required","disabled","className","apiConfig","inputProps","testId"],kO=["onChange"];function OO(){return OO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OO.apply(null,arguments)}function _O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IO(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function EO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function CO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||IO(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IO(e,t){if(e){if("string"==typeof e)return TO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TO(e,t):void 0}}function TO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var AO=function(t){function r(r){var o,i,a,s=r.apiConfig,l=r.onAddressSelect,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,kp),c=(Vc()||{}).isSanitizeAddress,d=null!==(o=u.isSanitizeAddress)&&void 0!==o?o:c,p=(null==s||null===(i=s.googlePlaces)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.debounceTime)||ep.debounceTime,f=Dp((0,e.useState)(null),2),m=f[0],h=f[1],v=Dp((0,e.useState)([]),2),y=v[0],g=v[1],b=Dp((0,e.useState)(!1),2),w=b[0],S=b[1],x=Dp((0,e.useState)(null),2),k=x[0],O=x[1],_=Dp((0,e.useState)(!1),2),E=_[0],C=_[1],I=Dp((0,e.useState)(-1),2),T=I[0],A=I[1],P=(0,e.useRef)(null);(0,e.useEffect)(function(){function e(){return(e=Pp(_p().m(function e(){var t,n,r,o;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null==s||null===(t=s.googlePlaces)||void 0===t||!t.apiKey){e.n=4;break}return e.p=1,n=Sp.getInstance(s.googlePlaces.apiKey,Ip(Ip(Ip({},ep),s.googlePlaces.options),s.googlePlaces.nonce?{nonce:s.googlePlaces.nonce}:{})),e.n=2,n.initialize();case 2:h(n),e.n=4;break;case 3:e.p=3,o=e.v,r=up(o),O(r.message);case 4:return e.a(2)}},e,null,[[1,3]])}))).apply(this,arguments)}!function(){e.apply(this,arguments)}()},[s]);var D=(0,e.useCallback)(function(){var e=Pp(_p().m(function e(t){var n,r,o;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!m||!t){e.n=6;break}return e.p=1,S(!0),O(null),e.n=2,m.searchAddress(t);case 2:n=e.v,g(n),C(!0),e.n=4;break;case 3:e.p=3,o=e.v,r=up(o),O(r.message),g([]),C(!1);case 4:return e.p=4,S(!1),e.f(4);case 5:e.n=7;break;case 6:g([]),C(!1);case 7:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[m]),j=(0,e.useRef)();(0,e.useEffect)(function(){var e,t,n,r;return j.current=(e=D,t=p,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout(function(){clearTimeout(n),e.apply(void 0,o)},t)},r.cancel=function(){clearTimeout(n)},r),function(){var e;null!==(e=j.current)&&void 0!==e&&e.cancel&&j.current.cancel()}},[D,p]);var R=(0,e.useCallback)(function(e){j.current(e)},[j]),M=(0,e.useCallback)(function(){var e=Pp(_p().m(function e(t){var n,r,o,i,a,s,c,p,f;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!m||!t){e.n=5;break}return e.p=1,S(!0),e.n=2,m.getPlaceDetails(t.place_id);case 2:o=e.v,i=null!==(n=null===(r=u.question)||void 0===r?void 0:r.format)&&void 0!==n?n:u.format,a=J(o,{allowedRegex:i},d),s=[a.street_number,a.street].filter(Boolean).join(" ").trim(),c={address:s,city:a.city,state:a.state_short||a.state,zipcode:a.zipcode},null==l||l(o,c),g([]),C(!1),e.n=4;break;case 3:e.p=3,f=e.v,p=up(f),O(p.message);case 4:return e.p=4,S(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[m,l,null===(a=u.question)||void 0===a?void 0:a.format,u.format,d]);return(0,e.useEffect)(function(){A(-1)},[y]),(0,e.useEffect)(function(){var e,t;if(!(T<0)){var n=null===(e=P.current)||void 0===e||null===(e=e.children)||void 0===e?void 0:e[T];null==n||null===(t=n.scrollIntoView)||void 0===t||t.call(n,{block:"nearest"})}},[T]),(0,e.useEffect)(function(){return function(){g([]),C(!1)}},[]),n().createElement("div",{className:"address-autocomplete-container",style:{position:"relative"},role:"presentation",onKeyDown:function(e){if(E&&y.length>0)switch(e.key){case"ArrowDown":e.preventDefault(),A(function(e){return(e+1)%y.length});break;case"ArrowUp":e.preventDefault(),A(function(e){return e<=0?y.length-1:e-1});break;case"Enter":T>=0&&(e.preventDefault(),M(y[T]));break;case"Escape":e.stopPropagation(),C(!1),A(-1)}}},n().createElement(t,Op({},u,{onSearch:R,loading:w,error:k})),E&&y.length>0&&n().createElement("div",{ref:P,role:"listbox",className:"address-predictions-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto"}},y.map(function(e,t){return n().createElement("button",{key:e.place_id,type:"button",role:"option",tabIndex:-1,"aria-selected":t===T,onClick:function(){return M(e)},onMouseDown:function(e){return e.preventDefault()},onMouseEnter:function(){return A(t)},style:{backgroundColor:t===T?"#e8f0fe":"transparent",padding:"8px 12px",cursor:"pointer",borderBottom:"1px solid #eee",width:"100%",textAlign:"left",border:"none"},"aria-label":"Select ".concat(e.description)},e.description)})))}return r.propTypes={apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,nonce:o().string,options:o().shape({region:o().string,language:o().string,debounceTime:o().number})})}).isRequired,onAddressSelect:o().func,question:o().shape({format:o().string}),format:o().string,isSanitizeAddress:o().string},r}(SO),PO=function(e){return e?e.split("_address")[0]:""},DO=function(e){return Boolean(e["data-parent-id"]&&void 0!==e["data-item-index"])},jO=["address","city","state","zipcode"],RO=function(e,t){for(var n={},r="".concat(e,"_"),o=function(){var o=a[i],s="".concat(e,"_").concat(o);if(s in t)n[o]=s;else{var l="_".concat(o),u=Object.keys(t).find(function(e){return e.startsWith(r)&&e.endsWith(l)});u&&(n[o]=u)}},i=0,a=jO;i<a.length;i++)o();return n},MO=["city","state","zipcode"],LO=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};e?r(t,n["data-parent-id"],n["data-item-index"],!0,o):r(t,null,-1,!0,o)},NO=function(t){var r=t.name,o=t.addressGroup,i=t.label,a=t.required,s=t.disabled,l=t.className,u=t.apiConfig,c=t.inputProps,d=void 0===c?{}:c,p=t.testId,f=EO(t,xO),m=f.onChange,h=EO(f,kO),v=Vc(),y=v.batchUpdate,g=v.validateAddressFields,b=v.formSchema,w=v.state,S=function(e,t,n){null!=e&&e.addressGroup&&!1!==n[e.questionId]&&(t[e.addressGroup]=e.questionId)},x=function(e,t,n){var r;if("cardlist"===e.questionType&&null!==(r=e.customQuestionValueList)&&void 0!==r&&r.editQuestions&&!1!==n[e.questionId]){var o,i=_O(e.customQuestionValueList.editQuestions);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.addressGroup&&(t[a.addressGroup]=a.questionId)}}catch(e){i.e(e)}finally{i.f()}}},k=(0,e.useMemo)(function(){return b&&Array.isArray(b)?function(e,t){var n={};try{var r,o=_O(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(null!=i&&i.questions){var a,s=_O(i.questions);try{for(s.s();!(a=s.n()).done;){var l=a.value;S(l,n,t),x(l,n,t)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){o.e(e)}finally{o.f()}}catch(e){console.error("Error creating addressGroup mapping:",e)}return n}(b,w.visibility):{}},[b,w.visibility]),O=(0,e.useCallback)(function(e,t){if(e&&o){var n=PO(o),r=function(e,t,n){for(var r={},o=0,i=Object.entries(e);o<i.length;o++){var a=CO(i[o],2),s=a[0],l=a[1];n[s]&&t[l]&&(r[t[l]]=n[s])}return r}(RO(n,k),k,t),i=DO(d);LO(i,r,d,y,{clearErrorsForKeys:Object.keys(r)}),g(o)}},[o,y,g,k,d]),_=(0,e.useCallback)(function(e){if(o){var t=PO(o),n=function(e,t){for(var n={},r=0,o=MO;r<o.length;r++){var i=e[o[r]],a=i&&t[i];a&&(n[a]="")}return n}(RO(t,k),k);if(Object.keys(n).length>0){var r=DO(d);LO(r,n,d,y,{clearErrorsForKeys:Object.keys(n)}),g(o)}}null==m||m(e)},[o,k,d,y,g,m]);return n().createElement(AO,OO({},h,{name:r,label:i,required:a,disabled:s,className:l,apiConfig:u,onChange:_,onAddressSelect:O,addressGroup:o,inputProps:d,testId:p}))};function FO(e){return FO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FO(e)}function VO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VO(Object(n),!0).forEach(function(t){qO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qO(e,t,n){return(t=function(e){var t=function(e){if("object"!=FO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}NO.propTypes={name:o().string.isRequired,addressGroup:o().string.isRequired,label:o().string,required:o().bool,disabled:o().bool,className:o().string,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})})}).isRequired,inputProps:o().object,onChange:o().func,testId:o().string};var zO=function(t){var r,o=t.name,i=t.label,a=t.value,s=t.validation,l=void 0===s?{}:s,u=t.className,c=void 0===u?"":u,d=t.renderInput,p=t.renderLabel,f=t.formState,m=t.skipValidation,h=void 0!==m&&m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.apiConfig,S=Vc(),x=sd(),k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return QO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QO(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null),2),O=k[0],_=k[1],E=f||(null==S?void 0:S.state)||S,C=String(o);if((0,e.useEffect)(function(){if(E){var e=E.serverValidationErrors,t=void 0===e?{}:e,n=E.errors,r=void 0===n?{}:n,o=t[C]||r[C];_(o)}else console.warn("BaseField: formState is undefined. Make sure the component is wrapped in a FormProvider or receives formState as a prop.")},[E,C]),E){var I=E.disabled,T=void 0===I?{}:I,A=E.required,P=void 0===A?{}:A,D=E.editable,j=void 0===D?{}:D,R=E.onChange,M=T[C]||!1,L=P[C]||!1,N=!1!==j[C],F=BO(BO({},x),b);return r=d({name:C,value:a,onChange:function(e){var t,n=(t=e,h?null:l.required&&(!t||Array.isArray(t)&&0===t.length)?l.requiredMessage||"This field is required":l.custom?l.custom(t,h):null);_(n),R&&!M&&N&&R(C,e)},disabled:M,required:L,_editable:N,_error:O,_theme:F,_apiConfig:w}),n().createElement("div",{className:"form-field ".concat(c," ").concat(y||""),style:F.field},v&&n().createElement("div",{className:"field-header",style:F.header},v),null==p?void 0:p({label:i,isRequired:L,theme:F}),r)}return null};zO.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,validation:o().object,className:o().string,renderInput:o().func.isRequired,renderLabel:o().func,formState:o().object,skipValidation:o().bool,header:o().node,styleName:o().string,customTheme:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})})};const $O=zO;var UO=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/ButtonField.css"),WO={};function HO(e){return HO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HO(e)}function GO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return YO(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(YO(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,YO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,YO(d,"constructor",u),YO(u,"constructor",l),l.displayName="GeneratorFunction",YO(u,o,"GeneratorFunction"),YO(d),YO(d,o,"Generator"),YO(d,r,function(){return this}),YO(d,"toString",function(){return"[object Generator]"}),(GO=function(){return{w:i,m:p}})()}function YO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}YO=function(e,t,n,r){function i(t,n){YO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},YO(e,t,n,r)}function KO(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function XO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XO(Object(n),!0).forEach(function(t){JO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JO(e,t,n){return(t=function(e){var t=function(e){if("object"!=HO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=HO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}WO.styleTagTransform=kl(),WO.setAttributes=bl(),WO.insert=yl().bind(null,"head"),WO.domAPI=hl(),WO.insertStyleElement=Sl(),fl()(UO.A,WO),UO.A&&UO.A.locals&&UO.A.locals;var e_=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.onChange,c=t.onClick,d=t.customTheme,p=void 0===d?{}:d,f=t.variant,m=void 0===f?"primary":f,h=t.size,v=void 0===h?"medium":h,y=t.icon,g=t.fullWidth,b=void 0!==g&&g,w=t.styleName,S=t.testId,x=Vc().setValue,k=sd(),O=(0,e.useMemo)(function(){var e=k.buttonField||{};return YS(e,p)},[k,p]),_=(0,e.useMemo)(function(){var e=ZO(ZO({},O.container),b&&{width:"100%"}),t=ZS(O.button,O[m],O[v],b&&O.fullWidth,s&&O.disabled);return{container:KS(e,O.responsive),button:t,icon:O.icon}},[O,m,v,b,s]),E=o,C=function(){var e,t=(e=GO().m(function e(t){return GO().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),x(r,E),!c){e.n=1;break}return e.n=1,c(t);case 1:null==u||u({target:{name:r,value:E}});case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){KO(i,r,o,a,s,"next",e)}function s(e){KO(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}();return n().createElement(zO,{name:r,label:"",value:i,validation:a,className:"button-field ".concat(w||""," ").concat(l||""),customTheme:O,renderInput:function(){return n().createElement("button",{type:"button",onClick:C,disabled:s,style:_.button,"data-testid":S},y&&n().createElement("span",{style:_.icon},y),E)}})};function t_(e){return t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t_(e)}function n_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r_(Object(n),!0).forEach(function(t){i_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i_(e,t,n){return(t=function(e){var t=function(e){if("object"!=t_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=t_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e_.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,disabled:o().bool,className:o().string,onChange:o().func,onClick:o().func,customTheme:o().object,variant:o().oneOf(["primary","secondary","success","danger","warning","outline","text"]),size:o().oneOf(["small","medium","large"]),icon:o().node,fullWidth:o().bool,styleName:o().string,testId:o().string};var a_=function(e){return e.map(function(e){return e?o_({name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return o_(o_({},e),{},{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null,disabled:Boolean(e.disabled),required:Boolean(e.required)})}):[]},void 0!==e.__isPending__&&{__isPending__:e.__isPending__}):null})},s_=function(e){return!!(Array.isArray(e)&&e.length>0)&&e.every(function(e){return!e||!Array.isArray(e.properties)||0===e.properties.length})},l_=function(e){return mt(null==e?void 0:e.customQuestionValuesList).map(function(t){return function(e,t){return null!=e&&e.properties?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return o_(o_({},e),{},{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null,disabled:Boolean(e.disabled),required:Boolean(e.required)})}):[]}:{name:"".concat(null==e?void 0:e.name," - 1"),properties:Object.entries(e||{}).map(function(e){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?n_(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=r[0],i=r[1];return{property:o,value:i,editQuestionId:null==t||null===(n=t.editQuestions)||void 0===n||null===(n=n.find(function(e){return e.name===o}))||void 0===n?void 0:n.questionId,renderMode:null,disabled:!1,required:!1}})}}(t,e)})},u_=function(e,t,n){if(null==n||!n.preventCardDeletion)return!1;var r=n.scope,o=n.n;return!(!Number.isInteger(o)||o<=0)&&("FIRST_N"===r?e<o:"LAST_N"===r&&e>=t-o)};function c_(e){return c_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c_(e)}var d_=["name","label","questionId","customQuestionValueList","onChange","validation","max","min","className","disabled","readOnly","questionRuleDetails","apiConfig","customTheme","visible","isCardlistModal","cardDeletionProperties"];function p_(e){return function(e){if(Array.isArray(e))return b_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f_(Object(n),!0).forEach(function(t){h_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h_(e,t,n){return(t=function(e){var t=function(e){if("object"!=c_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function y_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||g_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g_(e,t){if(e){if("string"==typeof e)return b_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b_(e,t):void 0}}function b_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var w_=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),S_=function(e){return"true"!==e.getAttribute("aria-hidden")&&!e.closest('[aria-hidden="true"]')&&(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0)},x_=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/common/Modal.css"),k_={};k_.styleTagTransform=kl(),k_.setAttributes=bl(),k_.insert=yl().bind(null,"head"),k_.domAPI=hl(),k_.insertStyleElement=Sl(),fl()(x_.A,k_),x_.A&&x_.A.locals&&x_.A.locals;var O_=0,__=function(t){var r=t.isOpen,o=t.onClose,i=t.title,a=t.children,s=t.size,l=void 0===s?"medium":s,u=t.showCloseButton,c=void 0===u||u,d=t.closeOnOverlayClick,p=void 0===d||d,f=t.className,m=void 0===f?"":f,h=t.testId,v=(0,e.useRef)(null);v.current||(O_+=1,v.current="modal-title-".concat(O_));var y=v.current,g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onKeyDown,r=(t._onFocus,t._onBlur,t.focusFirst),o=void 0!==r&&r,i=t.trapFocus,a=void 0!==i&&i,s=t.autoFocus,l=void 0!==s&&s,u=t.disabled,c=void 0!==u&&u,d=t.returnFocus,p=void 0===d||d,f=t.enabled,m=void 0===f||f,h=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(n);y.current=n;var g=(0,e.useCallback)(function(){return h.current?Array.from(h.current.querySelectorAll(w_)).filter(S_):[]},[]),b=(0,e.useCallback)(function(e){var t;if(null===(t=y.current)||void 0===t||t.call(y,e),a&&h.current){var n=g();if(0!==n.length){var r=n[0],o=n.at(-1);"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(o.focus(),e.preventDefault()):document.activeElement===o&&(r.focus(),e.preventDefault()))}}},[a,g]);return(0,e.useEffect)(function(){if(m&&!c){v.current=document.activeElement;var e=h.current,t=requestAnimationFrame(function(){if(l||o){var t=g();t.length>0?t[0].focus():e&&"function"==typeof e.focus&&e.focus()}});return function(){if(cancelAnimationFrame(t),p&&v.current){var e=v.current;"function"==typeof e.focus&&e.focus()}}}},[m,c,l,o,p,g]),(0,e.useEffect)(function(){if(m&&!c){var e=h.current;if(e){e.addEventListener("keydown",b);var t=function(t){if(a&&!e.contains(t.target)){var n=g();n.length>0?n[0].focus():"function"==typeof e.focus&&e.focus()}};return a&&document.addEventListener("focusin",t),function(){e.removeEventListener("keydown",b),a&&document.removeEventListener("focusin",t)}}}},[m,c,a,b,g]),{containerRef:h,getFocusableElements:g,focusFirst:function(){var e=g();e.length>0&&e[0].focus()},focusLast:function(){var e=g();e.length>0&&e.at(-1).focus()},focusNext:function(){var e=g(),t=e.indexOf(document.activeElement);t>-1&&t<e.length-1&&e[t+1].focus()},focusPrevious:function(){var e=g(),t=e.indexOf(document.activeElement);t>0&&e[t-1].focus()}}}({enabled:r,trapFocus:!0,focusFirst:!0,returnFocus:!0}),b=g.containerRef;if((0,e.useEffect)(function(){if(r){var e=function(e){"Escape"===e.key&&(e.stopPropagation(),o())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[r,o]),(0,e.useEffect)(function(){if(r){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[r]),!r)return null;var w="modal-".concat(l);return n().createElement("div",{className:"modal-overlay",onClick:function(e){p&&e.target===e.currentTarget&&o()},"data-testid":h},n().createElement("div",{ref:b,className:"modal-container ".concat(w," ").concat(m),role:"dialog","aria-modal":"true","aria-labelledby":i?y:void 0,tabIndex:-1},n().createElement("div",{className:"modal-header"},i&&n().createElement("h2",{id:y,className:"modal-title"},i),c&&n().createElement("button",{type:"button",className:"modal-close-button",onClick:o,"aria-label":"Close modal"},"×")),n().createElement("div",{className:"modal-content"},a)))};__.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,title:o().string,children:o().node.isRequired,size:o().oneOf(["small","medium","large","fullscreen"]),showCloseButton:o().bool,closeOnOverlayClick:o().bool,className:o().string,testId:o().string};const E_=__;function C_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I_(e){return I_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I_(e)}var T_=function(e,t,n){if(e&&"object"===I_(e)){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(Object.prototype.hasOwnProperty.call(e,n))return e[n];var r=te(t);return Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0}},A_=function(e,t){if(null==e||!e.properties||!Array.isArray(e.properties))return null;var n=te(t);return e.properties.find(function(e){return te(e.editQuestionId)===n})||null};function P_(e){return P_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P_(e)}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(t){R_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R_(e,t,n){return(t=function(e){var t=function(e){if("object"!=P_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=P_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=N_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function L_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||N_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N_(e,t){if(e){if("string"==typeof e)return F_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F_(e,t):void 0}}function F_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V_=function(t){var r,o=t.isOpen,i=t.onClose,a=t.onSave,s=t.cardItem,l=t.itemIndex,u=t.cardListId,c=t.cardListName,d=t.customQuestionValueList,p=t.questionRuleDetails,f=t.apiConfig,m=t.disabled,h=void 0!==m&&m,v=t.readOnly,y=void 0!==v&&v,g=Vc(),b=g.state,w=g.setValue,S=g.setNestedState,x=g.rulesEngine,k=g.updateCardList,O=(0,e.useRef)(null),_=(0,e.useRef)(!1),E=(0,e.useRef)(!1),C=(0,e.useRef)(null),I=(0,e.useRef)(null),T=(0,e.useRef)(!1),A=L_((0,e.useState)(new Map),2),P=A[0],D=A[1],j=(0,e.useCallback)(function(){if(x&&null!=d&&d.editQuestions&&!(l<0)){var e={cardListId:u,instanceIndex:l};D(function(t){var n,r,o=new Map(t),i=!1,a=null===(n=b.values)||void 0===n?void 0:n[u],s=Array.isArray(a)&&a[l]?a[l]:null,c=M_(d.editQuestions);try{var p=function(){var n,a=r.value,c=a.questionId||a.name,d=te(c),p=null==s||null===(n=s.properties)||void 0===n?void 0:n.find(function(e){return te(e.editQuestionId)===te(c)}),f=null==p?void 0:p.value,m=null!=f,h=x.getCardListInstanceState(u,l,d),v=x.getQuestionValueWithCardListContext(c,e),y="",g=void 0!==(null==h?void 0:h.value)&&null!==(null==h?void 0:h.value),b=null!=v;y=m?g&&h.value!==f?h.value:f:g?h.value:b?v:t.has(c)?t.get(c):a.value||a.defaultValue||"",h&&""===h.value&&t.has(c)&&""!==t.get(c)&&(y=""),t.get(c)!==y&&(o.set(c,y),i=!0)};for(c.s();!(r=c.n()).done;)p()}catch(e){c.e(e)}finally{c.f()}return i?o:t})}},[x,u,l,d,b.values]);(0,e.useEffect)(function(){if(o){var e=C.current!==l;if(!E.current||e){var t;E.current=!0,C.current=l,O.current=s?JSON.stringify(s):null,_.current=!1;var n=new Map;if(null!=d&&d.editQuestions){var r,i={cardListId:u,instanceIndex:l},a=M_(d.editQuestions);try{var p=function(){var e=r.value,t=e.questionId||e.name,o="",a=!1;if(null!=s&&s.properties){var c=s.properties.find(function(e){return te(e.editQuestionId)===te(t)});void 0!==(null==c?void 0:c.value)&&null!==(null==c?void 0:c.value)&&(o=c.value,a=!0)}if(!a&&x){var p=x.getQuestionValueWithCardListContext(t,i);null!=p&&""!==p&&(o=p)}if(a||""!==o&&null!=o||(o=e.value||e.defaultValue||""),n.set(t,o),x&&l>=0){var f=te(t),m=x.getCardListInstanceState(u,l,f);!m&&d.editQuestions&&(x.initializeCardListChildStates(u,l,d.editQuestions),m=x.getCardListInstanceState(u,l,f)),m&&(a||void 0===m.value||null===m.value||""===m.value?(m.value=o,x.setCardListInstanceState(u,l,f,m)):n.set(t,m.value))}};for(a.s();!(r=a.n()).done;)p()}catch(e){a.e(e)}finally{a.f()}}if(D(n),x&&l>=0){var f,m=(null==d?void 0:d.editQuestions)||[],h="".concat(u,"_").concat(l),v=null===(f=x.cardListInstanceStates)||void 0===f?void 0:f.has(h);if(!v&&m.length>0)x.executeRulesForNewCardListInstance(u,l,m),setTimeout(function(){j()},0);else if(v&&m.length>0)if(x.reExecutePageLoadRulesForInstance)x.reExecutePageLoadRulesForInstance(u,l,m),setTimeout(function(){j()},0);else{var y,g,w={cardListId:u,instanceIndex:l},I=new Set(m.map(function(e){return e.questionId||e.name})),A=(null===(y=x.questionRuleDetails)||void 0===y?void 0:y.filter(function(e){return("PAGE_LOAD"===e.ruleExecutionType||"REFLEXIVE_LOAD"===e.ruleExecutionType)&&(I.has(e.triggerQuestionId)||I.has(e.targetQuestionId))}))||[],P=M_(A);try{for(P.s();!(g=P.n()).done;){var R=g.value;try{var M,L,N,F="".concat(R.conditionId,"_").concat(R.triggerQuestionId,"_").concat(u,"_").concat(l);null!==(M=x.evaluationQueue)&&void 0!==M&&M.has(F)||(null===(L=x.evaluationQueue)||void 0===L||L.add(F),x.evaluateRule(R,R.triggerQuestionId,w,!1),null===(N=x.evaluationQueue)||void 0===N||N.delete(F))}catch(e){console.warn("Error re-evaluating rule for CardList instance:",e)}}}catch(e){P.e(e)}finally{P.f()}setTimeout(function(){j()},0)}}var V="".concat(u,"_").concat(l),B=null===(t=b.nestedStates)||void 0===t?void 0:t[V];if(S(u,l,B?{errors:{}}:{visibility:{},disabled:{},required:{},errors:{},ruleValidationErrors:{}}),!s&&null!=d&&d.editQuestions&&l>=0){var q,Q=null===(q=b.values)||void 0===q?void 0:q[u],z=Array.isArray(Q)?Q:[];if(z.length<=l){T.current=!0;for(var $=function(e,t,n){return Array.isArray(n)?{name:"".concat(e," - ").concat(t+1),properties:n.map(function(e){return{property:e.name||e.label,value:e.value||e.defaultValue||"",editQuestionId:te(e.questionId||e.name),renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}),__isPending__:!0}:{name:"".concat(e," - ").concat(t+1),properties:[],__isPending__:!0}}(c,l,d.editQuestions),U=function(e){return function(e){if(Array.isArray(e))return F_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||N_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(z);U.length<=l;)U.push({name:"",properties:[]});U[l]=$,k(u,U,"add","",l)}else T.current=!1,D(function(e){var t,n=new Map(e),r=M_(d.editQuestions);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.questionId||o.name;if(!n.has(i)){var a=o.value||o.defaultValue||"";if(n.set(i,a),x&&l>=0){var s=te(i),c=x.getCardListInstanceState(u,l,s);c||(x.initializeCardListChildStates(u,l,d.editQuestions),c=x.getCardListInstanceState(u,l,s)),c&&(c.value=a,x.setCardListInstanceState(u,l,s,c))}}}}catch(e){r.e(e)}finally{r.f()}return n})}else T.current=!1}}else o||(E.current=!1,C.current=null,T.current=!1,D(new Map),_.current=!1)},[o,l,u,j]),(0,e.useEffect)(function(){if(!o||!x||l<0||null==d||!d.editQuestions||!E.current)return function(){};var e=setTimeout(function(){E.current&&j()},100);return function(){clearTimeout(e)}},[o,x,l,u,d,j,b.values]);var R=(0,e.useCallback)(function(e,t){_.current=!0,D(function(n){var r=new Map(n);return r.set(e,t),r});var n={cardListId:u,instanceIndex:l};if(x){var r=te(e),o=x.getCardListInstanceState(u,l,r);if(!o&&null!=d&&d.editQuestions&&(x.initializeCardListChildStates(u,l,d.editQuestions),o=x.getCardListInstanceState(u,l,r)),o){o.value=t,x.setCardListInstanceState(u,l,r,o),x.processFieldChange(e,t,n,!0,!1,null);var i=x.getAllFieldStates(b.values).nestedStates,a="".concat(u,"_").concat(l),s=null==i?void 0:i[a];S(u,l,s?{visibility:s.visibility||{},disabled:s.disabled||{},required:s.required||{},ruleValidationErrors:s.ruleValidationErrors||{},errors:R_({},e,null)}:{errors:R_({},e,null)}),setTimeout(function(){j()},0)}}else S(u,l,{errors:R_({},e,null)})},[u,l,S,x,d,j,b.values]),M=n().useMemo(function(){var e,t;if(null==d||!d.editQuestions)return[];var n="".concat(u,"_").concat(l),r=null===(e=b.nestedStates)||void 0===e?void 0:e[n],o=null===(t=b.values)||void 0===t?void 0:t[u],i=Array.isArray(o)&&o[l]?o[l]:s;return[{groupName:"",questions:d.editQuestions.map(function(e){var t,n,o,a,s,c,d=e.questionId||e.name,p=te(d),f=A_(i,d),m=null==r||null===(t=r.disabled)||void 0===t?void 0:t[d],v=null==r||null===(n=r.disabled)||void 0===n?void 0:n[p],g=void 0!==m?m:v,b=null==r||null===(o=r.required)||void 0===o?void 0:o[d],w=null==r||null===(a=r.required)||void 0===a?void 0:a[p],S=void 0!==b?b:w,x=P.has(d)?P.get(d):void 0,k=Boolean(h||y||(void 0!==g?g:null!==(s=null==f?void 0:f.disabled)&&void 0!==s?s:e.disabled)),O=Boolean(void 0!==S?S:null!==(c=null==f?void 0:f.required)&&void 0!==c?c:e.required);return j_(j_({},e),{},{parentId:u,questionId:d,questionType:e.questionType||"text",value:x,disabled:k,required:O,readOnly:y,onChange:function(e){var t="object"===P_(e)&&null!=e&&e.target?e.target.value:e;R(d,t)},validation:j_(j_({},e.validation),{},{required:O}),inputProps:{"data-item-index":l,"data-parent-id":u}})})}]},[u,l,d,P,R,b.nestedStates,b.values,s,h,y]),L=(0,e.useCallback)(function(e){var t,n,r={cardListId:u,instanceIndex:l};if(P.has(e)){var o=P.get(e);return null!=o?o:""}if(x){var i=x.getCardListInstanceState(u,l,te(e));if(void 0!==(null==i?void 0:i.value)&&null!==(null==i?void 0:i.value)){var a=i.value;return P.has(e)&&P.get(e)===a||D(function(t){var n=new Map(t);return n.set(e,a),n}),a}var s=x.getQuestionValueWithCardListContext(e,r);if(null!=s&&""!==s)return P.has(e)&&P.get(e)===s||D(function(t){var n=new Map(t);return n.set(e,s),n}),s}var c=null===(t=b.values)||void 0===t?void 0:t[u];if(Array.isArray(c)&&c[l]){var d=c[l];if(Array.isArray(null==d?void 0:d.properties)){var p=d.properties.find(function(t){return te(t.editQuestionId)===te(e)});if(void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value))return p.value}}var f=null===(n=b.values)||void 0===n?void 0:n[e];return null!=f?f:""},[P,x,b.values,u,l]),N=(0,e.useCallback)(function(){var e={},t=M;if(t.length>0&&t[0].questions){var n,r=M_(t[0].questions);try{for(r.s();!(n=r.n()).done;){var o,i,a,s,c,d,p,f=n.value,m=f.questionId,h=te(m),v="".concat(u,"_").concat(l),y=null===(o=b.nestedStates)||void 0===o?void 0:o[v],g=null==y||null===(i=y.visibility)||void 0===i?void 0:i[m],w=null==y||null===(a=y.visibility)||void 0===a?void 0:a[h],S=void 0!==g?g:void 0!==w?w:!1!==f.visible;if(S&&!f.disabled&&!f.readOnly){var k=f.required||!1,O=null==y||null===(s=y.required)||void 0===s?void 0:s[m],_=null==y||null===(c=y.required)||void 0===c?void 0:c[h];if(void 0!==O)k=O;else if(void 0!==_)k=_;else if(x){var E=x.getFieldState(h,l);if(void 0!==(null==E?void 0:E.required))k=E.required;else if("function"==typeof x.getCardListInstanceState){var C=x.getCardListInstanceState(u,l,h);void 0!==(null==C?void 0:C.required)&&(k=C.required)}}var I=L(m);if(k&&(!I||"string"==typeof I&&""===I.trim())){var T="Please fill the required field";e[m]=T,h!==m&&(e[h]=T)}if(null!=I&&""!==I){var A,P,D=j_(j_({},f),{},{visible:S,required:k,disabled:null!==(A=f.disabled)&&void 0!==A&&A}),j=j_({},b.values),R=null!==(P=b.serverValidationErrors)&&void 0!==P&&P[m]?[{questionId:m,message:b.serverValidationErrors[m]}]:[],N=al(D,I,j,R,b.nestedStates);N&&"string"==typeof N&&""!==N.trim()&&(e[m]||(e[m]=N,h!==m&&(e[h]=N)))}var F=(null==y||null===(d=y.ruleValidationErrors)||void 0===d?void 0:d[m])||(null==y||null===(p=y.ruleValidationErrors)||void 0===p?void 0:p[h]);F&&"string"==typeof F&&""!==F.trim()&&(e[m]||(e[m]=F,h!==m&&(e[h]=F)))}}}catch(e){r.e(e)}finally{r.f()}}return e},[M,u,l,b.nestedStates,x,L]),F=(0,e.useCallback)(function(){var e,t,n,r;if(x&&null!=d&&d.editQuestions){var o={cardListId:u,instanceIndex:l};D(function(e){var t,n=new Map(e),r=!1,i=M_(d.editQuestions);try{for(i.s();!(t=i.n()).done;){var a=t.value,s=a.questionId||a.name,c=te(s),p=x.getCardListInstanceState(u,l,c),f=x.getQuestionValueWithCardListContext(s,o),m="";void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value)&&""!==(null==p?void 0:p.value)?m=p.value:null!=f&&""!==f?m=f:e.has(s)&&(m=e.get(s)),e.get(s)!==m&&(n.set(s,m),r=!0)}}catch(e){i.e(e)}finally{i.f()}return r?n:e})}var s=N();S(u,l,{errors:s});var p="".concat(u,"_").concat(l),f=null===(e=b.nestedStates)||void 0===e?void 0:e[p],m=(null==f?void 0:f.ruleValidationErrors)||{},h=Object.entries(m).some(function(e){var t=L_(e,2),n=t[0],r=t[1];return n.includes(u)&&r&&"string"==typeof r&&""!==r.trim()});if(!h&&x&&null!=d&&d.editQuestions){var v,y=M_(d.editQuestions);try{for(y.s();!(v=y.n()).done;){var g,k=v.value,E=k.questionId||k.name,C=te(E),A=null===(g=x.validationMessages)||void 0===g?void 0:g.get(C);if(A&&"string"==typeof A&&""!==A.trim()){h=!0;break}}}catch(e){y.e(e)}finally{y.f()}}var j=[".error_message_display_text",".error-message"],R=I.current,M=R?tt(j,R):tt(j);if(Object.keys(s).length>0||h||M)Kd(j,R?{root:R}:{});else{var L={cardListId:u,instanceIndex:l},F=null;try{F=O.current?JSON.parse(O.current):null}catch(e){F=null}var V=Array.isArray(null===(t=F)||void 0===t?void 0:t.properties)?F.properties:[],B=function(e){if(null==e)return!1;var t=String(e);return t.length>0&&t.includes("*")};null==x||x.endModalEdit(),P.forEach(function(e,t){var n=function(e,t){var n,r=V.find(function(t){return null!=t&&null!=t.editQuestionId&&te(t.editQuestionId)===te(e)}),o=String(null!=t?t:"");if(null==r)return""===o||B(t);var i=String(null!==(n=r.value)&&void 0!==n?n:"");return i===o||!(""!==i.trim()||!B(t))}(t,e);w(t,e,null,L,{markUserModified:!n})});var q="".concat(u,"_").concat(l),Q=null===(n=b.nestedStates)||void 0===n?void 0:n[q],z=Array.isArray(null===(r=b.values)||void 0===r?void 0:r[u])?b.values[u][l]:null,$=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i={name:"".concat(e," - ").concat(t+1),properties:[]};if(!Array.isArray(r))return i;var a,s=null==o?void 0:o.nestedState,l=null==o?void 0:o.existingRow,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(u.s();!(a=u.n()).done;){var c=a.value,d=c.questionId||c.name,p=te(d),f=n instanceof Map?n.get(d):n[d];null==f&&(f="");var m=A_(l,d),h=T_(null==s?void 0:s.disabled,d,p),v=T_(null==s?void 0:s.required,d,p),y=void 0!==h?Boolean(h):void 0!==(null==m?void 0:m.disabled)?Boolean(m.disabled):Boolean(c.disabled),g=void 0!==v?Boolean(v):void 0!==(null==m?void 0:m.required)?Boolean(m.required):Boolean(c.required);i.properties.push({property:c.name||c.label,value:f,editQuestionId:te(d),renderMode:null,disabled:y,required:g})}}catch(e){u.e(e)}finally{u.f()}return i}(c,l,P,null==d?void 0:d.editQuestions,{nestedState:Q,existingRow:z});a&&a($,l),T.current=!1,D(new Map),_.current=!1,i()}},[N,S,b.nestedStates,u,l,c,d,a,i,x,P,w]),V=(0,e.useCallback)(function(){if(T.current&&l>=0){var e,t=null===(e=b.values)||void 0===e?void 0:e[u],n=Array.isArray(t)?t:[];if(n.length>l){var r=n.filter(function(e,t){return t!==l}).map(function(e,t){return j_(j_({},e),{},{name:"".concat(c," - ").concat(t+1)})});k(u,r,"remove","",l)}T.current=!1}else{if(_.current&&O.current)try{var o=JSON.parse(O.current);if(null!=o&&o.properties){var a,s={cardListId:u,instanceIndex:l},p=M_(o.properties);try{for(p.s();!(a=p.n()).done;){var f=a.value;f.editQuestionId&&w(f.editQuestionId,f.value,null,s,{markUserModified:!1})}}catch(e){p.e(e)}finally{p.f()}}}catch(e){console.warn("Error restoring initial values:",e)}if(x&&l>=0&&O.current)try{var m=JSON.parse(O.current);if(null!=m&&m.properties&&null!=d&&d.editQuestions){var h,v=M_(d.editQuestions);try{var y=function(){var e=h.value,t=e.questionId||e.name,n=te(t),r="",o=m.properties.find(function(e){return te(e.editQuestionId)===te(t)});void 0!==(null==o?void 0:o.value)&&null!==(null==o?void 0:o.value)&&(r=o.value);var i=x.getCardListInstanceState(u,l,n);i&&(i.value=r,x.setCardListInstanceState(u,l,n,i))};for(v.s();!(h=v.n()).done;)y()}catch(e){v.e(e)}finally{v.f()}}}catch(e){console.warn("Error restoring initial values in rules engine:",e)}}D(new Map),S(u,l,{errors:{}}),_.current=!1,i()},[u,c,l,w,S,i,x,d,b.values,k]),B=n().useMemo(function(){return{isCardList:!0,itemIndex:l,parentId:u,parentValue:s}},[l,u,s]),q=null===(r=b.values)||void 0===r?void 0:r[u],Q=l>=0?l+1:(Array.isArray(q)?q.length:0)+1;return{modalContentRef:I,cardSchema:M,handleSave:F,handleCancel:V,parentContext:B,displayIndex:Q,modalTitle:s?"Edit Details":"Add New Details",disabled:h,readOnly:y,questionRuleDetails:p,apiConfig:f}},B_=function(e){var t=e.onCancel,r=e.onSave,o=e.disabled,i=e.readOnly,a=e.testIdRoot,s=o||i;return n().createElement("div",{className:"cardlist-modal-actions"},n().createElement("button",{type:"button",className:"btn btn-secondary",onClick:t,"aria-label":"Close","data-testid":dd(a,"cancel")},"Close"),n().createElement("button",{type:"button",className:"btn btn-primary",onClick:r,disabled:s,"aria-label":"Save","data-testid":dd(a,"save")},"Save"))};B_.propTypes={onCancel:o().func.isRequired,onSave:o().func.isRequired,disabled:o().bool,readOnly:o().bool,testIdRoot:o().string};const q_=B_;var Q_=function(e){var t=e.isOpen,r=e.onClose,o=e.onSave,i=e.cardItem,a=e.itemIndex,s=e.cardListId,l=e.cardListName,u=e.customQuestionValueList,c=e.questionRuleDetails,d=e.apiConfig,p=e.disabled,f=void 0!==p&&p,m=e.readOnly,h=void 0!==m&&m,v=e.testId,y=V_({isOpen:t,onClose:r,onSave:o,cardItem:i,itemIndex:a,cardListId:s,cardListName:l,customQuestionValueList:u,questionRuleDetails:c,apiConfig:d,disabled:f,readOnly:h}),g=y.modalContentRef,b=y.cardSchema,w=y.handleSave,S=y.handleCancel,x=y.parentContext,k=y.modalTitle,O=y.disabled,_=y.readOnly,E=y.questionRuleDetails,C=y.apiConfig;return t?n().createElement(E_,{isOpen:t,onClose:S,title:k,size:"large",className:"cardlist-modal",closeOnOverlayClick:!1,testId:v},n().createElement("div",{className:"cardlist-modal-wrapper"},n().createElement("div",{ref:g,className:"cardlist-modal-content"},n().createElement(mV,{questionGroups:b,disabled:O,readOnly:_,isNested:!0,questionRuleDetails:E,parentContext:x,apiConfig:C,skipFormProvider:!0})),n().createElement(q_,{onCancel:S,onSave:w,disabled:O,readOnly:_,testIdRoot:v}))):null};Q_.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onSave:o().func.isRequired,cardItem:o().object,itemIndex:o().number.isRequired,cardListId:o().oneOfType([o().string,o().number]).isRequired,cardListName:o().string.isRequired,customQuestionValueList:o().object,questionRuleDetails:o().array,apiConfig:o().object,disabled:o().bool,readOnly:o().bool,testId:o().string};const z_=Q_;var $_=function(e){var t=e.isOpen,r=e.onClose,o=e.onConfirm,i=e.testId;return n().createElement(E_,{isOpen:t,onClose:r,title:"Confirm Delete",size:"medium",closeOnOverlayClick:!0,className:"cardlist-delete-confirm-modal",testId:i},n().createElement("div",{className:"cardlist-delete-confirm-content"},n().createElement("p",{className:"cardlist-delete-confirm-message","data-testid":dd(i,"message")},"Are you sure you want to delete this entry? This action cannot be undone."),n().createElement("div",{className:"cardlist-delete-confirm-actions"},n().createElement("button",{type:"button",onClick:r,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-cancel","aria-label":"Cancel","data-testid":dd(i,"cancel")},"Cancel"),n().createElement("button",{type:"button",onClick:o,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-delete","aria-label":"Delete","data-testid":dd(i,"confirm")},"Delete"))))};$_.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onConfirm:o().func.isRequired,testId:o().string};const U_=$_;function W_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var H_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t||!Array.isArray(e)||0===e.length)return"";var n=t.split("||").map(function(e){return e.trim()}),r={};e.forEach(function(e){var t,n,o,i,a=String(null!==(t=e.questionId)&&void 0!==t?t:"").split("_")[0],s="string"==typeof(null==e?void 0:e.value)?(null!==(n=null==e?void 0:e.value)&&void 0!==n?n:"").trim():null!==(o=null==e?void 0:e.value)&&void 0!==o?o:"";"currency"===(null==e||null===(i=e.questionType)||void 0===i?void 0:i.toLowerCase())&&""!==s&&(s=function(e){if(null==e||""===e)return"";try{var t=parseFloat(String(e).replace(/[^0-9.-]+/g,""));return Number.isNaN(t)?String(e):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(t)}catch(t){return String(e)}}(s)),r[a]=s});var o,i=function(e){return e.replace(/\{(?:CQ-)?([^{}]+)\}/g,function(e,t){var n,o=null!==(n=r[t.trim()])&&void 0!==n?n:"";return String(o)})},a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return W_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(n);try{for(a.s();!(o=a.n()).done;){var s=i(o.value);if(s&&s.trim().length>0)return s}}catch(e){a.e(e)}finally{a.f()}return""},G_=function(e){var t=e.items,r=e.questionId,o=e.name,i=e.required,a=void 0!==i&&i,s=e.cardListPreviewPattern,l=e.patternPreview,u=e.editQuestions,c=e.onEdit,d=e.onDeleteClick,p=e.onAddMore,f=e.disabled,m=e.readOnly,h=e.maxItems,v=e.cardDeletionProperties,y=void 0===v?null:v,g=e.testIdRoot,b=dd(g,"add"),w=dd(g,"table"),S=function(e){return dd(g,"item",e)},x=function(e){return dd(g,"item",e,"edit")},k=function(e){return dd(g,"item",e,"remove")},O=s||l,_=!f&&!m&&(!h||t.length<h),E=!f&&!m;return 0===t.length?n().createElement("div",{className:"cardlist-view-card"},o&&n().createElement("h3",{className:"cardlist-view-title",id:"cardlist-title-".concat(r)},o,a&&n().createElement("span",{className:"cardlist-view-title-asterisk","aria-hidden":"true"},"*")),n().createElement("div",{className:"cardlist-empty-state"},n().createElement("p",null,"No items added yet."),_&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:p,disabled:f||m,"aria-label":"Add New","data-testid":b},"Add New"))):n().createElement("div",{className:"cardlist-view-card"},o&&n().createElement("h3",{className:"cardlist-view-title",id:"cardlist-title-".concat(r)},o,a&&n().createElement("span",{className:"cardlist-view-title-asterisk","aria-hidden":"true"},"*")),n().createElement("div",{className:"cardlist-table-container"},n().createElement("table",{className:"cardlist-table","data-testid":w},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",null,"S.No."),n().createElement("th",null,"Details"),n().createElement("th",null,"Actions"))),n().createElement("tbody",null,t.map(function(e,i){var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null!=e&&e.properties&&Array.isArray(t)?e.properties.map(function(e){var n=t.find(function(t){return String(null==t?void 0:t.questionId)===String(null==e?void 0:e.editQuestionId)});return n?{questionId:n.questionId,value:null==e?void 0:e.value,questionType:null==n?void 0:n.questionType}:null}).filter(Boolean):[]}(e,u),s=O&&a.length>0?H_(a,O):"",l=s&&s.trim()||"".concat(o," - ").concat(i+1),p=u_(i,t.length,y);return n().createElement("tr",{key:"".concat(r,"_").concat(i),"data-testid":S(i)},n().createElement("td",null,i+1),n().createElement("td",null,l),n().createElement("td",null,n().createElement("div",{className:"cardlist-table-actions"},n().createElement(n().Fragment,null,n().createElement("button",{type:"button",className:"btn-edit",onClick:function(){return c(e,i)},"aria-label":"Edit",title:"Edit","data-testid":x(i)},n().createElement("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",fill:"currentColor","aria-hidden":"true",style:{display:"block"}},n().createElement("path",{d:"M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"}))),E&&!p&&n().createElement("button",{type:"button",className:"btn-delete",onClick:function(){return d(i)},disabled:f||m,"aria-label":"Delete",title:"Delete","data-testid":k(i)},n().createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{display:"block"}},n().createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})))))))}))),_&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:p,disabled:f||m,"aria-label":"Add New","data-testid":b},"Add New")))};G_.propTypes={items:o().array.isRequired,questionId:o().oneOfType([o().string,o().number]).isRequired,name:o().string,required:o().bool,cardListPreviewPattern:o().string,patternPreview:o().string,editQuestions:o().arrayOf(o().shape({questionId:o().oneOfType([o().string,o().number]),questionType:o().string})),onEdit:o().func.isRequired,onDeleteClick:o().func.isRequired,onAddMore:o().func.isRequired,disabled:o().bool,readOnly:o().bool,maxItems:o().number,cardDeletionProperties:o().shape({scope:o().oneOf(["FIRST_N","LAST_N"]),n:o().number,preventCardDeletion:o().bool,childDefaults:o().array}),testIdRoot:o().string};const Y_=G_;var K_=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/CardListModal.css"),X_={};function Z_(e){return Z_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z_(e)}function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(t){tE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tE(e,t,n){return(t=function(e){var t=function(e){if("object"!=Z_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Z_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}X_.styleTagTransform=kl(),X_.setAttributes=bl(),X_.insert=yl().bind(null,"head"),X_.domAPI=hl(),X_.insertStyleElement=Sl(),fl()(K_.A,X_),K_.A&&K_.A.locals&&K_.A.locals;var nE=function(t){var r=t.name,o=t.label,i=void 0===o?"":o,a=t.questionId,s=t.customQuestionValueList,l=void 0===s?null:s,u=t.cardListPreviewPattern,c=t.patternPreview,d=t.validation,p=void 0===d?{}:d,f=t.max,m=void 0===f?null:f,h=t.min,v=void 0===h?0:h,y=t.className,g=void 0===y?"":y,b=t.disabled,w=void 0!==b&&b,S=t.readOnly,x=void 0!==S&&S,k=t.isCardlistModal,O=void 0!==k&&k,_=t.cardDeletionProperties,E=void 0===_?null:_,C=t.testIdRoot,I=dd(C,"add"),T=dd(C,"modal"),A=dd(C,"delete-confirm"),P=function(t){var r,o,i,a,s,l=t.name,u=t.label,c=void 0===u?"":u,d=t.questionId,p=t.customQuestionValueList,f=void 0===p?null:p,m=t.onChange,h=void 0===m?null:m,v=(t.validation,t.max),y=void 0===v?null:v,g=t.min,b=void 0===g?0:g,w=(t.className,t.disabled),S=void 0!==w&&w,x=t.readOnly,k=void 0!==x&&x,O=t.questionRuleDetails,_=void 0===O?[]:O,E=t.apiConfig,C=void 0===E?{}:E,I=t.customTheme,T=void 0===I?{}:I,A=t.visible,P=void 0===A||A,D=(t.isCardlistModal,t.cardDeletionProperties),j=void 0===D?null:D,R=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,d_),M=Vc(),L=M.state,N=M.updateCardList,F=M.clearError,V=M.rulesEngine,B=sd(),q=y_((0,e.useState)([]),2),Q=q[0],z=q[1],$=y_((0,e.useState)({}),2),U=$[0],W=$[1],H=y_((0,e.useState)(!0),2),G=H[0],Y=H[1],K=(0,e.useRef)(!1),X=(0,e.useRef)(new Map),Z=(0,e.useRef)(!1),J=y_((0,e.useState)(!1),2),ee=J[0],ne=J[1],re=y_((0,e.useState)(null),2),oe=re[0],ie=re[1],ae=y_((0,e.useState)(-1),2),se=ae[0],le=ae[1],ue=y_((0,e.useState)(!1),2),ce=(ue[0],ue[1]),de=y_((0,e.useState)(!1),2),pe=de[0],fe=de[1],me=y_((0,e.useState)(-1),2),he=me[0],ve=me[1],ye=YS(B.cardListField||{},T),ge=(null==L||null===(r=L.required)||void 0===r?void 0:r[d])||!1,be=(0,e.useCallback)(function(e){if(!Array.isArray(e))return!1;try{var t=e.filter(function(e){return!(null!=e&&e.__isPending__)}),n=a_(t);z(n),Z.current=!0;var r=e.length>0,o=s_(e),i=e.length,a=function(e,t,n){var r=new Set(Object.keys(n||{}).filter(function(t){return String(t||"").startsWith("".concat(e,"_"))}));return Array.from({length:t},function(t,n){return"".concat(e,"_").concat(n)}).filter(function(e){return!r.has(e)})}(d,i,null==L?void 0:L.nestedStates);return r?(o||a.length>0)&&(K.current=!0,N(d,e,"init",null,-1,!0)):K.current=!0,!0}catch(e){return console.error("CardListField: failed to seed from context",e),!1}},[d,null==L?void 0:L.nestedStates,N]);(0,e.useEffect)(function(){var e;if(!Z.current){var t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];be(t)||function(e){if(void 0===e&&null!=f&&f.customQuestionValuesList){var t=l_(f),n=JSON.stringify(Q);JSON.stringify(t)!==n&&(N(d,t,"init",null,-1,!0),z(t),Z.current=!0)}}(t)}},[d,null==L||null===(o=L.values)||void 0===o?void 0:o[d],null==f?void 0:f.customQuestionValuesList]);var we=(0,e.useCallback)(function(e,t){var n=X.current.get(e);return X.current.set(e,t),{isHiddenToVisible:!1===n&&!0===t,isFirstMountVisible:void 0===n&&!0===t}},[]),Se=(0,e.useCallback)(function(e){var t,n=null==L||null===(t=L.values)||void 0===t?void 0:t[d],r=Array.isArray(n),o=r&&n.length>0,i=s_(n);if(r&&o)(i||o)&&(K.current=!0,N(d,n,"init",null,-1,!0));else{var a=[];e&&(z(a),K.current=!0,N(d,a,"add","",-1))}},[d,null==L?void 0:L.values,N]);(0,e.useEffect)(function(){var e,t=void 0===(null==L||null===(e=L.visibility)||void 0===e?void 0:e[d])?P:L.visibility[d],n=we(d,t),r=n.isHiddenToVisible,o=n.isFirstMountVisible;if(r||o)try{Se(r)}catch(e){console.error("CardListField: failed to reinitialize nested states",e)}},[null==L||null===(i=L.visibility)||void 0===i?void 0:i[d]]),(0,e.useEffect)(function(){if(K.current){var e,t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];if(Array.isArray(t))try{var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=a_(n);z(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}finally{K.current=!1}else K.current=!1}},[null==L||null===(a=L.values)||void 0===a?void 0:a[d]]),(0,e.useEffect)(function(){if(!ee){var e,t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];if(Array.isArray(t)){var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=a_(n);z(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}else z(function(e){return e.length>0?[]:e})}},[ee,null==L?void 0:L.values,d,null==L||null===(s=L.values)||void 0===s?void 0:s[d]]);var xe=(0,e.useCallback)(function(e,t){W(function(n){var r=m_({},n);return t&&Object.keys(t).length>0?r[e]=t:delete r[e],r})},[]),ke=(0,e.useCallback)(function(){var e;if(!(y&&Q.length>=y)){"function"==typeof F&&F(d);var t={name:"".concat(l," - ").concat(Q.length+1),properties:(null==f||null===(e=f.editQuestions)||void 0===e?void 0:e.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}))||[]},n=[].concat(p_(Q),[t]);z(n),N(d,n,"add","",Q.length)}},[y,Q,null==f?void 0:f.editQuestions,d,l,N,F]),Oe=(0,e.useCallback)(function(e){var t=Q.filter(function(t,n){return n!==e}).map(function(e,t){return m_(m_({},e),{},{name:"".concat(l," - ").concat(t+1)})});W(function(t){var n=m_({},t);return delete n[e],n}),z(t),N(d,t,"remove","",e),null==h||h(null,!0)},[Q,d,l,N,h]),_e=(0,e.useCallback)(function(e){u_(e,Q.length,j)||(ve(e),fe(!0))},[Q.length,j]),Ee=(0,e.useCallback)(function(){he>=0&&(Oe(he),fe(!1),ve(-1))},[he,Oe]),Ce=(0,e.useCallback)(function(){fe(!1),ve(-1)},[]),Ie=(0,e.useCallback)(function(){var e;"function"==typeof F&&F(d),ie(null);var t=(null==L||null===(e=L.values)||void 0===e?void 0:e[d])||[],n=Array.isArray(t)?t.length:Q.length;le(n),ce(!1),ne(!0)},[Q.length,null==L?void 0:L.values,d,F]),Te=(0,e.useCallback)(function(e,t){null==V||V.beginModalEdit(d),ie(e),le(t),ce(!0),ne(!0)},[V,d]),Ae=(0,e.useCallback)(function(e,t){var n,r=m_({},e);delete r.__isPending__;var o=(null==L||null===(n=L.values)||void 0===n?void 0:n[d])||[],i=(Array.isArray(o)?p_(o):[]).map(function(e){if(null!=e&&e.__isPending__){var t=m_({},e);return delete t.__isPending__,t}return e}),a=t>=i.length||-1===t;a?i.push(r):i[t]=r;var s=i.filter(function(e){return!(null!=e&&e.__isPending__)});z(s),N(d,i,a?"add":"update","",a?i.length-1:t),null==h||h(null,!0)},[d,N,h,null==L?void 0:L.values]),Pe=(0,e.useCallback)(function(){null==V||V.endModalEdit(),ne(!1),ie(null),le(-1),ce(!1)},[V]),De=(0,e.useCallback)(function(){Y(function(e){return!e})},[]),je=(0,e.useCallback)(function(e,t){var n,r="".concat(e,"_").concat(t);return null==L||null===(n=L.nestedStates)||void 0===n||null===(n=n[r])||void 0===n||null===(n=n.visibility)||void 0===n?void 0:n[e]},[null==L?void 0:L.nestedStates]),Re=(0,e.useCallback)(function(e,t){var n,r=e.questionId||e.name,o=je(r,t);return void 0!==o?o:void 0!==(null==L||null===(n=L.visibility)||void 0===n?void 0:n[r])?L.visibility[r]:e.visible},[je,null==L?void 0:L.visibility]),Me=(0,e.useCallback)(function(e,t,n){if(Re(e,n)){var r=function(e,t){var n;return null===(n=e.properties)||void 0===n||null===(n=n.find(function(e){return e.property===t}))||void 0===n?void 0:n.value}(t,e.name),o=al(e,r);if(o)return{fieldName:e.name,message:o}}return null},[Re]),Le=(0,e.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.length-1;return null!=f&&f.editQuestions?f.editQuestions.reduce(function(n,r){var o=Me(r,e,t);return o&&(n[o.fieldName]=o.message),n},{}):{}},[null==f?void 0:f.editQuestions,Q.length,Me]),Ne=(0,e.useCallback)(function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=p_(Q),i=null===(n=L.values)||void 0===n||null===(n=n[d])||void 0===n?void 0:n[e],a=function(e,t,n,r){if(e)return e;var o,i=null,a=v_(r||[]);try{var s=function(){var e,r=o.value,a=null===(e=n.properties)||void 0===e||null===(e=e.find(function(e){return e.editQuestionId===r.questionId}))||void 0===e?void 0:e.value,s="__id__".concat(r.questionId);if(void 0!==t[s]&&t[s]!==a)return i=r.questionId,1;null===i&&t[r.name]!==a&&(i=r.questionId)};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return i}(r,t,i,null==f?void 0:f.editQuestions),s=function(e,t,n){return(null==e?void 0:e.map(function(e){var r,o,i=null===(r=t.properties)||void 0===r?void 0:r.find(function(t){return te(t.editQuestionId)===te(e.questionId)}),a=n[e.name],s=void 0!==a&&""!==(null==i?void 0:i.value)?a:null==i?void 0:i.value;return{property:e.name,value:s,editQuestionId:e.questionId,renderMode:null!==(o=null==i?void 0:i.renderMode)&&void 0!==o?o:null,disabled:void 0!==(null==i?void 0:i.disabled)?Boolean(i.disabled):Boolean(e.disabled),required:void 0!==(null==i?void 0:i.required)?Boolean(i.required):Boolean(e.required)}}))||[]}(null==f?void 0:f.editQuestions,i,t);o[e]=m_(m_({},i),{},{name:t.name||(null==i?void 0:i.name)||"".concat(l," - ").concat(e+1),properties:s});var u=Le(o[e],e);xe(e,u),z(o),N(d,o,"update",a,e)},[Q,L.values,d,l,null==f?void 0:f.editQuestions,Le,xe,N]),Fe=(0,e.useCallback)(function(e){var t=function(e,t){var n;return{name:"".concat(e," - 1"),properties:(null==t||null===(n=t.editQuestions)||void 0===n?void 0:n.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}))||[]}}(l,f);return m_(m_({},t),{},{name:"".concat(l," - ").concat(e+1),properties:t.properties.map(function(e){return m_(m_({},e),{},{value:""})})})},[l,f]),Ve=(0,e.useCallback)(function(e,t){return function(n){var r,o,i,a=null!==(r=null==n||null===(o=n.target)||void 0===o?void 0:o.value)&&void 0!==r?r:n,s=void 0===(null==n||null===(i=n.target)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.itemIndex)?t:Number.parseInt(n.target.dataset.itemIndex,10),l=m_(m_({},function(e){var t,n={},r=v_(e.properties);try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.property]=o.value,o.editQuestionId&&(n["__id__".concat(o.editQuestionId)]=o.value)}}catch(e){r.e(e)}finally{r.f()}return n}(Q[s]||Fe(s))),{},h_(h_({},e.name,a),"__id__".concat(e.questionId),a));Ne(s,l,e.questionId)}},[Q,Fe,Ne]),Be=(0,e.useCallback)(function(e,t){var n,r,o,i=e.questionId||e.name,a=(n=Q[t],r=e.questionId,null==n||null===(o=n.properties)||void 0===o||null===(o=o.find(function(e){return e.editQuestionId===r}))||void 0===o?void 0:o.value),s=Re(e,t);return m_(m_({},e),{},{parentId:R.id,questionId:i,questionType:e.questionType||"text",validation:m_(m_({},e.validation),{},{required:e.required}),visible:s,value:a,onChange:Ve(e,t),inputProps:{"data-item-index":t,"data-parent-id":R.id}})},[Q,Re,Ve,R.id]),qe=(0,e.useCallback)(function(e){return null!=f&&f.editQuestions?[m_(m_({},R),{},{groupName:"",questions:f.editQuestions.map(function(t){return Be(t,e)})})]:[]},[null==f?void 0:f.editQuestions,Be,R]),Qe=(0,e.useCallback)(function(){return Q.map(function(e,t){var r,o=(null===(r=e.properties)||void 0===r?void 0:r.length)>0?"".concat(d,"_").concat(t,"_").concat(e.properties[0].editQuestionId):"".concat(d,"_").concat(t),i=u_(t,Q.length,j);return n().createElement("div",{key:o,style:ye.cardListItem},n().createElement("div",{style:ye.cardListItemHeader},!S&&!k&&Q.length>b&&!i&&n().createElement("button",{type:"button",onClick:function(){return Oe(t)},style:ye.removeButton},"Remove")),n().createElement(mV,{questionGroups:qe(t),disabled:S,readOnly:k,isNested:!0,questionRuleDetails:_,parentContext:{isCardList:!0,itemIndex:t,parentId:d,parentValue:Q[t]},apiConfig:C}))})},[Q,d,ye,S,k,b,j,Oe,qe,_,C]),ze=c?"".concat(G?"Collapse":"Expand"," ").concat(c):void 0;return{items:Q,errors:U,isExpanded:G,showModal:ee,selectedCardItem:oe,selectedItemIndex:se,showDeleteConfirm:pe,itemToDeleteIndex:he,mergedTheme:ye,isRequired:ge,minItems:b,maxItems:y,cardDeletionProperties:j,handleAddItem:ke,handleRemoveItem:Oe,handleDeleteClick:_e,handleConfirmDelete:Ee,handleCancelDelete:Ce,handleAddMoreCardlist:Ie,handleEditCardList:Te,handleSaveCardList:Ae,handleModalClose:Pe,handleToggleExpand:De,generateCardSchemaForItem:qe,renderCardListItems:Qe,toggleButtonAriaLabel:ze}}(t),D=P.items,j=P.isExpanded,R=P.showModal,M=P.selectedCardItem,L=P.selectedItemIndex,N=P.showDeleteConfirm,F=P.mergedTheme,V=P.isRequired,B=P.maxItems,q=P.cardDeletionProperties,Q=P.handleAddItem,z=P.handleDeleteClick,$=P.handleConfirmDelete,U=P.handleCancelDelete,W=P.handleAddMoreCardlist,H=P.handleEditCardList,G=P.handleSaveCardList,Y=P.handleModalClose,K=P.handleToggleExpand,X=P.renderCardListItems,Z=P.toggleButtonAriaLabel,J=function(){return function(e,t){if(t)return null;var n=Array.isArray(e)?e:[];return v&&n.length<v?"Minimum ".concat(v," items required"):m&&n.length>m?"Maximum ".concat(m," items allowed"):null}};return O?n().createElement(n().Fragment,null,n().createElement(zO,{name:r,label:i,value:Array.isArray(D)?D:[],validation:eE(eE({},p),{},{custom:J()}),className:g,renderInput:function(){return n().createElement(Y_,{items:D,questionId:a,name:r||i,required:V,cardListPreviewPattern:u,patternPreview:c,editQuestions:null==l?void 0:l.editQuestions,onEdit:H,onDeleteClick:z,onAddMore:W,disabled:w,readOnly:x,maxItems:m,cardDeletionProperties:null!=q?q:E,testIdRoot:C})}}),n().createElement(z_,{isOpen:R,onClose:Y,onSave:G,cardItem:M,itemIndex:L,cardListId:a,cardListName:r||i,customQuestionValueList:l,questionRuleDetails:t.questionRuleDetails,apiConfig:t.apiConfig,disabled:w,readOnly:x,testId:T}),n().createElement(U_,{isOpen:N,onClose:U,onConfirm:$,testId:A})):n().createElement(zO,{name:r,label:i,value:Array.isArray(D)?D:[],validation:eE(eE({},p),{},{custom:J()}),className:g,renderInput:function(){return n().createElement("div",{style:F.container},n().createElement("button",{type:"button",style:eE(eE({},F.header),{},{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:"transparent",border:"none"}),onClick:K,"aria-expanded":j,"aria-label":Z},n().createElement("span",{style:F.title},i,V&&n().createElement("span",{className:"required-mark"},"*")),n().createElement("span",{style:eE(eE({},F.toggleButton),j&&F.toggleExpanded),"aria-hidden":"true"},"▼")),j&&n().createElement(n().Fragment,null,n().createElement("div",{style:F.itemsContainer},X()),!w&&!x&&(!B||D.length<B)&&n().createElement("button",{type:"button",onClick:Q,style:eE(eE(eE(eE({},F.actionButton),F.addButton),w&&F.disabled),B&&D.length>=B&&F.maxItemsReached),"aria-label":"Add New","data-testid":I},"Add New")))}})};function rE(e){return mg("MuiTypography",e)}nE.propTypes={id:o().oneOfType([o().string,o().number]),name:o().string.isRequired,label:o().string,questionId:o().oneOfType([o().string,o().number]),customQuestionValueList:o().oneOfType([o().array,o().object]),cardListPreviewPattern:o().string,patternPreview:o().string,onChange:o().func,validation:o().object,max:o().number,min:o().number,className:o().string,disabled:o().bool,readOnly:o().bool,questionRuleDetails:o().array,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),customTheme:o().object,visible:o().bool,isCardlistModal:o().bool,cardDeletionProperties:o().shape({scope:o().oneOf(["FIRST_N","LAST_N"]),n:o().number,preventCardDeletion:o().bool,childDefaults:o().array}),testIdRoot:o().string},hg("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const oE={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},iE=function(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Ah;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return _m(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}},aE=Ey("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${ag(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(ig(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"==typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"==typeof e).map(([t])=>({props:{color:`text${ag(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),sE={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},lE=e.forwardRef(function(e,t){const{color:n,...r}=Ay({props:e,name:"MuiTypography"}),o=iE({...r,...!oE[n]&&{color:n}}),{align:i="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:u=!1,paragraph:c=!1,variant:d="body1",variantMapping:p=sE,...f}=o,m={...o,align:i,color:n,className:a,component:s,gutterBottom:l,noWrap:u,paragraph:c,variant:d,variantMapping:p},h=s||(c?"p":p[d]||sE[d])||"span",v=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Np({root:["root",i,"inherit"!==e.align&&`align${ag(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},rE,a)})(m);return(0,Iy.jsx)(aE,{as:h,ref:t,className:Lp(v.root,a),...f,ownerState:m,style:{..."inherit"!==i&&{"--Typography-textAlign":i},...f.style}})});function uE(e){return mg("MuiFormControlLabel",e)}const cE=hg("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),dE=Ey("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${cE.label}`]:t.label},t.root,t[`labelPlacement${ag(n.labelPlacement)}`]]}})(ig(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${cE.disabled}`]:{cursor:"default"},[`& .${cE.label}`]:{[`&.${cE.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),pE=Ey("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(ig(({theme:e})=>({[`&.${cE.error}`]:{color:(e.vars||e).palette.error.main}}))),fE=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:a={},control:s,disabled:l,disableTypography:u,inputRef:c,label:d,labelPlacement:p="end",name:f,onChange:m,required:h,slots:v={},slotProps:y={},value:g,...b}=r,w=Uy(),S=l??s.props.disabled??w?.disabled,x=h??s.props.required,k={disabled:S,required:x};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===s.props[e]&&void 0!==r[e]&&(k[e]=r[e])});const O=zy({props:r,muiFormControl:w,states:["error"]}),_={...r,disabled:S,labelPlacement:p,required:x,error:O.error},E=(e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e;return Np({root:["root",n&&"disabled",`labelPlacement${ag(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]},uE,t)})(_),C={slots:v,slotProps:{...a,...y}},[I,T]=Kg("typography",{elementType:lE,externalForwardedProps:C,ownerState:_});let A=d;return null==A||A.type===lE||u||(A=(0,Iy.jsx)(I,{component:"span",...T,className:Lp(E.label,T?.className),children:A})),(0,Iy.jsxs)(dE,{className:Lp(E.root,i),ownerState:_,ref:n,...b,children:[e.cloneElement(s,k),x?(0,Iy.jsxs)("div",{children:[A,(0,Iy.jsxs)(pE,{ownerState:_,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):A]})});function mE(e){return mg("PrivateSwitchBase",e)}hg("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const hE=Ey(Yk,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),vE=Ey("input",{name:"MuiSwitchBase",shouldForwardProp:Oy})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),yE=e.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:i,disabled:a,disableFocusRipple:s=!1,edge:l=!1,icon:u,id:c,inputProps:d,inputRef:p,name:f,onBlur:m,onChange:h,onFocus:v,readOnly:y,required:g=!1,tabIndex:b,type:w,value:S,slots:x={},slotProps:k={},...O}=e,[_,E]=dS({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),C=Uy();let I=a;C&&void 0===I&&(I=C.disabled);const T="checkbox"===w||"radio"===w,A={...e,checked:_,disabled:I,disableFocusRipple:s,edge:l},P=(e=>{const{classes:t,checked:n,disabled:r,edge:o}=e;return Np({root:["root",n&&"checked",r&&"disabled",o&&`edge${ag(o)}`],input:["input"]},mE,t)})(A),D={slots:x,slotProps:{input:d,...k}},[j,R]=Kg("root",{ref:t,elementType:hE,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...D,component:"span",...O},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{v&&v(e),C&&C.onFocus&&C.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),C&&C.onBlur&&C.onBlur(e)})(t)}}),ownerState:A,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:I,role:void 0,tabIndex:null}}),[M,L]=Kg("input",{ref:p,elementType:vE,className:P.input,externalForwardedProps:D,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;E(t),h&&h(e,t)})(t)}}),ownerState:A,additionalProps:{autoFocus:n,checked:r,defaultChecked:i,disabled:I,id:T?c:void 0,name:f,readOnly:y,required:g,tabIndex:b,type:w,..."checkbox"===w&&void 0===S?{}:{value:S}}});return(0,Iy.jsxs)(j,{...R,children:[(0,Iy.jsx)(M,{...L}),_?o:u]})}),gE=ES((0,Iy.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),bE=ES((0,Iy.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),wE=ES((0,Iy.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function SE(e){return mg("MuiCheckbox",e)}const xE=hg("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),kE=Ey(yE,{shouldForwardProp:e=>Oy(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${ag(n.size)}`],"default"!==n.color&&t[`color${ag(n.color)}`]]}})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{[`&.${xE.checked}, &.${xE.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${xE.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),OE=(0,Iy.jsx)(bE,{}),_E=(0,Iy.jsx)(gE,{}),EE=(0,Iy.jsx)(wE,{}),CE=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiCheckbox"}),{checkedIcon:o=OE,color:i="primary",icon:a=_E,indeterminate:s=!1,indeterminateIcon:l=EE,inputProps:u,size:c="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:m={},...h}=r,v=s?l:a,y=s?l:o,g={...r,disableRipple:d,color:i,indeterminate:s,size:c},b=(e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i=Np({root:["root",n&&"indeterminate",`color${ag(r)}`,`size${ag(o)}`]},SE,t);return{...t,...i}})(g),w=m.input??u,[S,x]=Kg("root",{ref:n,elementType:kE,className:Lp(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:m,...h},ownerState:g,additionalProps:{type:"checkbox",icon:e.cloneElement(v,{fontSize:v.props.fontSize??c}),checkedIcon:e.cloneElement(y,{fontSize:y.props.fontSize??c}),disableRipple:d,slots:f,slotProps:{input:Bw("function"==typeof w?w(g):w,{"data-indeterminate":s})}}});return(0,Iy.jsx)(S,{...x,classes:b})}),{entries:IE,setPrototypeOf:TE,isFrozen:AE,getPrototypeOf:PE,getOwnPropertyDescriptor:DE}=Object;let{freeze:jE,seal:RE,create:ME}=Object,{apply:LE,construct:NE}="undefined"!=typeof Reflect&&Reflect;jE||(jE=function(e){return e}),RE||(RE=function(e){return e}),LE||(LE=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),NE||(NE=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const FE=JE(Array.prototype.forEach),VE=JE(Array.prototype.lastIndexOf),BE=JE(Array.prototype.pop),qE=JE(Array.prototype.push),QE=JE(Array.prototype.splice),zE=JE(String.prototype.toLowerCase),$E=JE(String.prototype.toString),UE=JE(String.prototype.match),WE=JE(String.prototype.replace),HE=JE(String.prototype.indexOf),GE=JE(String.prototype.trim),YE=JE(Object.prototype.hasOwnProperty),KE=JE(RegExp.prototype.test),XE=(ZE=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return NE(ZE,t)});var ZE;function JE(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return LE(e,t,r)}}function eC(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zE;TE&&TE(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(AE(t)||(t[r]=e),o=e)}e[o]=!0}return e}function tC(e){for(let t=0;t<e.length;t++)YE(e,t)||(e[t]=null);return e}function nC(e){const t=ME(null);for(const[n,r]of IE(e))YE(e,n)&&(Array.isArray(r)?t[n]=tC(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=nC(r):t[n]=r);return t}function rC(e,t){for(;null!==e;){const n=DE(e,t);if(n){if(n.get)return JE(n.get);if("function"==typeof n.value)return JE(n.value)}e=PE(e)}return function(){return null}}const oC=jE(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iC=jE(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),aC=jE(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sC=jE(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),lC=jE(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),uC=jE(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cC=jE(["#text"]),dC=jE(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pC=jE(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fC=jE(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mC=jE(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hC=RE(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vC=RE(/<%[\w\W]*|[\w\W]*%>/gm),yC=RE(/\$\{[\w\W]*/gm),gC=RE(/^data-[\-\w.\u00B7-\uFFFF]+$/),bC=RE(/^aria-[\-\w]+$/),wC=RE(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),SC=RE(/^(?:\w+script|data):/i),xC=RE(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kC=RE(/^html$/i),OC=RE(/^[a-z][.\w]*(-[.\w]+)+$/i);var _C=Object.freeze({__proto__:null,ARIA_ATTR:bC,ATTR_WHITESPACE:xC,CUSTOM_ELEMENT:OC,DATA_ATTR:gC,DOCTYPE_NAME:kC,ERB_EXPR:vC,IS_ALLOWED_URI:wC,IS_SCRIPT_OR_DATA:SC,MUSTACHE_EXPR:hC,TMPLIT_EXPR:yC});const EC=function(){return"undefined"==typeof window?null:window};var CC,IC=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:EC();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,h=u.prototype,v=rC(h,"cloneNode"),y=rC(h,"remove"),g=rC(h,"nextSibling"),b=rC(h,"childNodes"),w=rC(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let S,x="";const{implementation:k,createNodeIterator:O,createDocumentFragment:_,getElementsByTagName:E}=r,{importNode:C}=o;let I={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof IE&&"function"==typeof w&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:A,TMPLIT_EXPR:P,DATA_ATTR:D,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:L}=_C;let{IS_ALLOWED_URI:N}=_C,F=null;const V=eC({},[...oC,...iC,...aC,...lC,...cC]);let B=null;const q=eC({},[...dC,...pC,...fC,...mC]);let Q=Object.seal(ME(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,$=null;const U=Object.seal(ME(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,H=!0,G=!1,Y=!0,K=!1,X=!0,Z=!1,J=!1,ee=!1,te=!1,ne=!1,re=!1,oe=!0,ie=!1,ae=!0,se=!1,le={},ue=null;const ce=eC({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const pe=eC({},["audio","video","img","source","image","track"]);let fe=null;const me=eC({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ge=ye,be=!1,we=null;const Se=eC({},[he,ve,ye],$E);let xe=eC({},["mi","mo","mn","ms","mtext"]),ke=eC({},["annotation-xml"]);const Oe=eC({},["title","style","font","a","script"]);let _e=null;const Ee=["application/xhtml+xml","text/html"];let Ce=null,Ie=null;const Te=r.createElement("form"),Ae=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ie||Ie!==e){if(e&&"object"==typeof e||(e={}),e=nC(e),_e=-1===Ee.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===_e?$E:zE,F=YE(e,"ALLOWED_TAGS")?eC({},e.ALLOWED_TAGS,Ce):V,B=YE(e,"ALLOWED_ATTR")?eC({},e.ALLOWED_ATTR,Ce):q,we=YE(e,"ALLOWED_NAMESPACES")?eC({},e.ALLOWED_NAMESPACES,$E):Se,fe=YE(e,"ADD_URI_SAFE_ATTR")?eC(nC(me),e.ADD_URI_SAFE_ATTR,Ce):me,de=YE(e,"ADD_DATA_URI_TAGS")?eC(nC(pe),e.ADD_DATA_URI_TAGS,Ce):pe,ue=YE(e,"FORBID_CONTENTS")?eC({},e.FORBID_CONTENTS,Ce):ce,z=YE(e,"FORBID_TAGS")?eC({},e.FORBID_TAGS,Ce):nC({}),$=YE(e,"FORBID_ATTR")?eC({},e.FORBID_ATTR,Ce):nC({}),le=!!YE(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,N=e.ALLOWED_URI_REGEXP||wC,ge=e.NAMESPACE||ye,xe=e.MATHML_TEXT_INTEGRATION_POINTS||xe,ke=e.HTML_INTEGRATION_POINTS||ke,Q=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(H=!1),ne&&(te=!0),le&&(F=eC({},cC),B=[],!0===le.html&&(eC(F,oC),eC(B,dC)),!0===le.svg&&(eC(F,iC),eC(B,pC),eC(B,mC)),!0===le.svgFilters&&(eC(F,aC),eC(B,pC),eC(B,mC)),!0===le.mathMl&&(eC(F,lC),eC(B,fC),eC(B,mC))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?U.tagCheck=e.ADD_TAGS:(F===V&&(F=nC(F)),eC(F,e.ADD_TAGS,Ce))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?U.attributeCheck=e.ADD_ATTR:(B===q&&(B=nC(B)),eC(B,e.ADD_ATTR,Ce))),e.ADD_URI_SAFE_ATTR&&eC(fe,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(ue===ce&&(ue=nC(ue)),eC(ue,e.FORBID_CONTENTS,Ce)),e.ADD_FORBID_CONTENTS&&(ue===ce&&(ue=nC(ue)),eC(ue,e.ADD_FORBID_CONTENTS,Ce)),ae&&(F["#text"]=!0),Z&&eC(F,["html","head","body"]),F.table&&(eC(F,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw XE('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw XE('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,x=S.createHTML("")}else void 0===S&&(S=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==S&&"string"==typeof x&&(x=S.createHTML(""));jE&&jE(e),Ie=e}},De=eC({},[...iC,...aC,...sC]),je=eC({},[...lC,...uC]),Re=function(e){qE(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},Me=function(e,t){try{qE(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){qE(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=UE(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&ge===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=S?S.createHTML(e):e;if(ge===ye)try{t=(new f).parseFromString(o,_e)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ge,"template",null);try{t.documentElement.innerHTML=be?x:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ge===ye?E.call(t,Z?"html":"body")[0]:Z?t.documentElement:i},Ne=function(e){return O.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fe=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ve=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,r){FE(e,e=>{e.call(n,t,r,Ie)})}const qe=function(e){let t=null;if(Be(I.beforeSanitizeElements,e,null),Fe(e))return Re(e),!0;const r=Ce(e.nodeName);if(Be(I.uponSanitizeElement,e,{tagName:r,allowedTags:F}),X&&e.hasChildNodes()&&!Ve(e.firstElementChild)&&KE(/<[/\w!]/g,e.innerHTML)&&KE(/<[/\w!]/g,e.textContent))return Re(e),!0;if(7===e.nodeType)return Re(e),!0;if(X&&8===e.nodeType&&KE(/<[/\w]/g,e.data))return Re(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(r))&&(!F[r]||z[r])){if(!z[r]&&ze(r)){if(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,r))return!1;if(Q.tagNameCheck instanceof Function&&Q.tagNameCheck(r))return!1}if(ae&&!ue[r]){const t=w(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=v(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,g(e))}}return Re(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});const n=zE(e.tagName),r=zE(t.tagName);return!!we[e.namespaceURI]&&(e.namespaceURI===ve?t.namespaceURI===ye?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||xe[r]):Boolean(De[n]):e.namespaceURI===he?t.namespaceURI===ye?"math"===n:t.namespaceURI===ve?"math"===n&&ke[r]:Boolean(je[n]):e.namespaceURI===ye?!(t.namespaceURI===ve&&!ke[r])&&!(t.namespaceURI===he&&!xe[r])&&!je[n]&&(Oe[n]||!De[n]):!("application/xhtml+xml"!==_e||!we[e.namespaceURI]))}(e)?(Re(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!KE(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&3===e.nodeType&&(t=e.textContent,FE([T,A,P],e=>{t=WE(t,e," ")}),e.textContent!==t&&(qE(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(I.afterSanitizeElements,e,null),!1):(Re(e),!0)},Qe=function(e,t,n){if(oe&&("id"===t||"name"===t)&&(n in r||n in Te))return!1;if(H&&!$[t]&&KE(D,t));else if(W&&KE(j,t));else if(U.attributeCheck instanceof Function&&U.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(ze(e)&&(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,e)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(e))&&(Q.attributeNameCheck instanceof RegExp&&KE(Q.attributeNameCheck,t)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(t,e))||"is"===t&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,n)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(n))))return!1}else if(fe[t]);else if(KE(N,WE(n,M,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==HE(n,"data:")||!de[e])if(G&&!KE(R,WE(n,M,"")));else if(n)return!1;return!0},ze=function(e){return"annotation-xml"!==e&&UE(e,L)},$e=function(e){Be(I.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Fe(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=Ce(a),c=l;let d="value"===a?c:GE(c);if(r.attrName=u,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Be(I.uponSanitizeAttribute,e,r),d=r.attrValue,!ie||"id"!==u&&"name"!==u||(Me(a,e),d="user-content-"+d),X&&KE(/((--!?|])>)|<\/(style|title|textarea)/i,d)){Me(a,e);continue}if("attributename"===u&&UE(d,"href")){Me(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Me(a,e);continue}if(!Y&&KE(/\/>/i,d)){Me(a,e);continue}K&&FE([T,A,P],e=>{d=WE(d,e," ")});const p=Ce(e.nodeName);if(Qe(p,u,d)){if(S&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,u)){case"TrustedHTML":d=S.createHTML(d);break;case"TrustedScriptURL":d=S.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Fe(e)?Re(e):BE(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(I.afterSanitizeAttributes,e,null)},Ue=function e(t){let n=null;const r=Ne(t);for(Be(I.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Be(I.uponSanitizeShadowNode,n,null),qe(n),$e(n),n.content instanceof a&&e(n.content);Be(I.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,u=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ve(e)){if("function"!=typeof e.toString)throw XE("toString is not a function");if("string"!=typeof(e=e.toString()))throw XE("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Pe(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ce(e.nodeName);if(!F[t]||z[t])throw XE("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Le("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!K&&!Z&&-1===e.indexOf("<"))return S&&re?S.createHTML(e):e;if(r=Le(e),!r)return te?null:re?x:""}r&&ee&&Re(r.firstChild);const c=Ne(se?e:r);for(;s=c.nextNode();)qe(s),$e(s),s.content instanceof a&&Ue(s.content);if(se)return e;if(te){if(ne)for(u=_.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(B.shadowroot||B.shadowrootmode)&&(u=C.call(o,u,!0)),u}let d=Z?r.outerHTML:r.innerHTML;return Z&&F["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&KE(kC,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),K&&FE([T,A,P],e=>{d=WE(d,e," ")}),S&&re?S.createHTML(d):d},n.setConfig=function(){Pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ie=null,J=!1},n.isValidAttribute=function(e,t,n){Ie||Pe({});const r=Ce(e),o=Ce(t);return Qe(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&qE(I[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=VE(I[e],t);return-1===n?void 0:QE(I[e],n,1)[0]}return BE(I[e])},n.removeHooks=function(e){I[e]=[]},n.removeAllHooks=function(){I={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),TC=["a","p","br","span","strong","em"],AC=["href","target","rel"],PC=["target","rel"],DC={ALLOWED_TAGS:[],ALLOWED_ATTR:[]},jC=!1,RC=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jC||"function"!=typeof IC.addHook||(jC=!0,IC.addHook("afterSanitizeAttributes",function(e){"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute("rel","noopener noreferrer")}));var n={ALLOWED_TAGS:TC,ALLOWED_ATTR:AC};return Array.isArray(t.addAttr)&&(n.ADD_ATTR=t.addAttr),IC.sanitize(e,n)};function MC(e){return MC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MC(e)}var LC=["name","questionId","label","value","validation","disabled","required","className","options","header","styleName","customTheme","error","helperText","onChange","inputProps","tooltip","apiConfig","testId","testIdRoot"],NC=["apiConfig","questionId","maskInput","maskingType","maskingLength","questionRuleDetails","visible","dependsOn","formData","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup","isopeninnewtab"];function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(null,arguments)}function VC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BC(Object(n),!0).forEach(function(t){QC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QC(e,t,n){return(t=function(e){var t=function(e){if("object"!=MC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=MC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==MC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zC(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var $C=function(t){var r,o,i,a=t.name,s=t.questionId,l=t.label,u=t.value,c=t.validation,d=t.disabled,p=t.required,f=void 0!==p&&p,m=t.className,h=t.options,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.error,S=t.helperText,x=t.onChange,k=t.inputProps,O=void 0===k?{}:k,_=t.tooltip,E=void 0===_?"":_,C=(t.apiConfig,t.testId),I=(t.testIdRoot,zC(t,LC)),T=sd(),A=Vc(),P=A.setValue,D=A.state,j=O["data-item-index"],R=O["data-parent-id"],M=(0,e.useMemo)(function(){var e,t;if(!h||!Array.isArray(h))return h;var n=null===(e=D.optionVisibility)||void 0===e?void 0:e[s];return null!=R&&void 0!==j&&null!==(t=D.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[R])&&void 0!==t&&null!==(t=t[Number(j)])&&void 0!==t&&t[s]&&(n=D.optionVisibilityByInstance[R][Number(j)][s]),n?h.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):h},[h,D.optionVisibility,D.optionVisibilityByInstance,s,R,j]),L=null!==(r=null==l?void 0:l.replaceAll(String.raw(CC||(o=["\n"],i=["\\n"],i||(i=o.slice(0)),CC=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}}))))," ").trim())&&void 0!==r?r:"",N=L?RC(L,{addAttr:PC}):"",F=void 0===j?String(a):"".concat(String(a),"-").concat(j),V=null!=R&&""!==R&&null!=j,B=!0===u||"string"==typeof u&&"false"!==u.trim().toLowerCase()&&""!==u.trim(),q=(0,e.useMemo)(function(){return!(h&&Array.isArray(h)&&h.length>0)||M&&M.length>0},[h,M]),Q=(0,e.useMemo)(function(){var e=T.checkboxField||{};return YS(e,b)},[T,b]),z=(0,e.useMemo)(function(){var e=qC(qC({},Q.container),{},{width:"100%"}),t=ZS(Q.checkbox,w&&Q.error,d&&Q.disabled,B&&Q.checked);return{container:KS(e,Q.responsive),checkbox:t,label:Q.label,control:Q.control}},[Q,w,d,B]);return q?n().createElement("div",{className:"form-field ".concat(y||""),"data-theme":Q.name,"data-field-type":"checkbox",style:z.container},v&&n().createElement("div",{className:"field-header",style:T.header},v),n().createElement(zO,{name:F,label:N,value:u,validation:c,className:"checkbox-field ".concat(m||""),customTheme:Q,error:w,helperText:S,renderInput:function(){var e=Object.entries(I).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return VC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VC(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return"boolean"==typeof o?!0===o&&(e[r]="true"):null!=o&&(e[r]=o),e},{}),t=(e.apiConfig,e.questionId,e.maskInput,e.maskingType,e.maskingLength,e.questionRuleDetails,e.visible,e.dependsOn,e.formData,e.customQuestionValueList,e.fileUploads,e.allowedFileType,e.fileSizeLimit,e.numberOfFiles,e.includeExtraDropDowns,e.additionalDropDowns,e.errorMessage,e.addressGroup,e.isopeninnewtab,zC(e,NC));return n().createElement("div",{className:"checkbox-wrapper"},n().createElement(fE,{className:"checkbox-field__control",name:F,disabled:d,"data-item-index":j,"data-parent-id":R,control:n().createElement(CE,FC({className:"checkbox-field__checkbox",checked:B,disabled:d,onChange:function(e){var t,n=e.target.checked?(null==M||null===(t=M[0])||void 0===t?void 0:t.value)||"true":"";null==x||x(qC(qC({},e),{},{target:qC(qC({},e.target),{},{value:n})})),V||P(F,n)},style:z.checkbox,inputProps:{"data-testid":C}},t)),label:N?n().createElement("span",{className:"checkbox-field__label"},n().createElement("span",{dangerouslySetInnerHTML:{__html:N}}),f&&n().createElement("span",{className:"required-mark",style:Q.required},"*"),E&&n().createElement(hO,{tooltip:E})):null,style:qC(qC(qC({},z.control),z.label),{},{width:"fit-content",maxWidth:"100%",alignSelf:"flex-start"})}))}}),S&&n().createElement("div",{className:"helper-text",style:T.helperText},S)):null};function UC(e){return mg("MuiFormGroup",e)}$C.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().bool]),validation:o().object,disabled:o().bool,required:o().bool,className:o().string,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().bool]).isRequired,label:o().string.isRequired})),header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,onChange:o().func,inputProps:o().object,tooltip:o().string,apiConfig:o().object,testId:o().string,testIdRoot:o().string},hg("MuiFormGroup",["root","row","error"]);const WC=Ey("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),HC=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiFormGroup"}),{className:r,row:o=!1,...i}=n,a=zy({props:n,muiFormControl:Uy(),states:["error"]}),s={...n,row:o,error:a.error},l=(e=>{const{classes:t,row:n,error:r}=e;return Np({root:["root",n&&"row",r&&"error"]},UC,t)})(s);return(0,Iy.jsx)(WC,{className:Lp(l.root,r),ownerState:s,ref:t,...i})});function GC(e){return GC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GC(e)}var YC=["questionId","label","options","defaultValue","helperText","required","onChange","_showcheckbox","_isesigndoc","_isopeninnewtab","_addadditional","_addmedication","questionRuleDetails","formData","apiBaseUrl","dependsOn","error","customTheme","inputProps","styleName","tooltip","showQuestionLabels","testIdRoot"],KC=["apiConfig","maskInput","maskingType","maskingLength","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup"];function XC(){return XC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XC.apply(null,arguments)}function ZC(e,t){if(e){if("string"==typeof e)return JC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JC(e,t):void 0}}function JC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(t){nI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nI(e,t,n){return(t=function(e){var t=function(e){if("object"!=GC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rI(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var oI=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?[]:s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=(t._showcheckbox,t._isesigndoc,t._isopeninnewtab,t._addadditional,t._addmedication,t.questionRuleDetails,t.formData,t.apiBaseUrl,t.dependsOn,t.error),m=t.customTheme,h=void 0===m?{}:m,v=t.inputProps,y=void 0===v?{}:v,g=t.styleName,b=t.tooltip,w=void 0===b?"":b,S=t.showQuestionLabels,x=void 0===S||S,k=t.testIdRoot,O=rI(t,YC),_=y["data-item-index"],E=y["data-parent-id"],C=sd(),I=Vc(),T=I.setValue,A=I.state,P=$S({questionId:r,itemIndex:_,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),D=P.value,j=P.visible,R=P.disabled,M=P.handleChange,L=(0,e.useMemo)(function(){var e,t,n=null===(e=A.optionVisibility)||void 0===e?void 0:e[r];return null!=E&&void 0!==_&&null!==(t=A.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[E])&&void 0!==t&&null!==(t=t[Number(_)])&&void 0!==t&&t[r]&&(n=A.optionVisibilityByInstance[E][Number(_)][r]),n?a.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):a},[a,A.optionVisibility,A.optionVisibilityByInstance,r,E,_]),N=void 0===_?String(r):"".concat(String(r),"-").concat(_),F=(0,e.useMemo)(function(){var e=C.checkboxGroupField||C.checkboxField||{};return YS(e,h)},[C,h]),V=(0,e.useMemo)(function(){var e=tI(tI({},F.container),{},{width:"100%"}),t=ZS(F.label,d&&F.required,R&&F.disabled),n=ZS(F.checkbox,f&&F.error,R&&F.disabled);return{container:KS(e,F.responsive),label:t,checkbox:n,group:F.group||{},helperText:ZS(F.helperText,f&&F.error)}},[F,d,R,f]),B=Array.isArray(D)?D:Array.isArray(l)?l:[],q=function(e,t){var n=e.target.checked?[].concat(function(e){return function(e){if(Array.isArray(e))return JC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ZC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(B||[]),[t]):(B||[]).filter(function(e){return e!==t});T(r,n),M(n),p&&p(tI(tI({},e),{},{target:tI(tI({},e.target),{},{name:N,value:n})}))};if(!j)return null;var Q=Object.entries(O).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||ZC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return e[r]="boolean"==typeof o?o?o.toString():void 0:o,e},{}),z=(Q.apiConfig,Q.maskInput,Q.maskingType,Q.maskingLength,Q.customQuestionValueList,Q.fileUploads,Q.allowedFileType,Q.fileSizeLimit,Q.numberOfFiles,Q.includeExtraDropDowns,Q.additionalDropDowns,Q.errorMessage,Q.addressGroup,rI(Q,KC));return n().createElement("div",{className:"checkbox-group-field ".concat(g||""),"data-theme":F.name,"data-field-type":"checkbox-group",style:V.container},n().createElement(HC,{style:V.group},x&&o&&n().createElement("div",{className:"question_label",style:V.label},o,d&&n().createElement("span",{className:"required-mark",style:F.requiredMark},"*"),w&&n().createElement(hO,{tooltip:w})),n().createElement("div",{className:"checkbox-group-wrapper",style:V.group},L.map(function(e){var t=Array.isArray(B)?B.includes(e.value):!0===e.selected,r=dd(k,"option",e.value),o=dd(k,"option",e.value,"input");return n().createElement(fE,{key:e.value,className:"checkbox-group-field__control",name:N,"data-item-index":_,"data-parent-id":E,"data-testid":r,control:n().createElement(CE,XC({className:"checkbox-group-field__checkbox",checked:t,onChange:function(t){return q(t,e.value)},disabled:R,required:e.required||!1,style:V.checkbox,inputProps:{"data-testid":o}},z)),label:e.label,style:tI(tI(tI({},F.control||{gap:"0.25rem",margin:0,alignItems:"center"}),V.label),{},{width:"fit-content",maxWidth:"100%",alignSelf:"flex-start"})})}),u&&n().createElement("div",{style:V.helperText},u))))};oI.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number]).isRequired})),defaultValue:o().array,helperText:o().string,required:o().bool,onChange:o().func,_showcheckbox:o().bool,_isesigndoc:o().bool,_isopeninnewtab:o().bool,_addadditional:o().bool,_addmedication:o().bool,_questionRuleDetails:o().array,questionRuleDetails:o().array,formData:o().object,apiBaseUrl:o().string,dependsOn:o().oneOfType([o().string,o().array]),error:o().string,customTheme:o().object,tooltip:o().string,styleName:o().string,inputProps:o().object,showQuestionLabels:o().bool,testIdRoot:o().string};var iI=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/CurrencyField.css"),aI={};function sI(e){return sI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sI(e)}function lI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lI(Object(n),!0).forEach(function(t){cI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cI(e,t,n){return(t=function(e){var t=function(e){if("object"!=sI(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=sI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sI(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}aI.styleTagTransform=kl(),aI.setAttributes=bl(),aI.insert=yl().bind(null,"head"),aI.domAPI=hl(),aI.insertStyleElement=Sl(),fl()(iI.A,aI),iI.A&&iI.A.locals&&iI.A.locals;var pI=function(e){var t=function(e){return null==e?"":String(e).replace(ie,"")}(e);if(!t)return"";var n=t.indexOf("."),r=-1!==n,o=r?t.slice(0,n):t,i=r?t.slice(n+1).replace(/\./g,""):"",a=r&&n===t.length-1,s=o.replace(/\./g,""),l=s?Number.parseInt(s,10):0;if(Number.isNaN(l))return"";var u=new Intl.NumberFormat("en-US",{style:"decimal",maximumFractionDigits:0}).format(l);return r?a?"".concat(u,"."):"".concat(u,".").concat(i):u},fI=n().memo(function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.currency,c=void 0===u?"$":u,d=t.onChange,p=t.formState,f=t.error,m=t.customTheme,h=void 0===m?{}:m,v=t.styleName,y=t.maxLength,g=t.placeholder,b=t.onBlur,w=t.tooltip,S=void 0===w?"":w,x=t.showQuestionLabels,k=void 0===x||x,O=t.testId,_=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dI(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dI(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null==i?"":pI(i)),2),E=_[0],C=_[1],I=sd(),T=(0,e.useMemo)(function(){var e=I.currencyField||I.textField||{};return YS(e,h)},[I,h]),A=(0,e.useMemo)(function(){var e=uI(uI({},T.container),{},{width:"100%"}),t=ZS(T.input,f&&T.error,s&&T.disabled,{borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderLeftWidth:"0"});return{container:KS(e,T.responsive),input:t,currencySymbol:uI(uI({},T.currencySymbol),{},{padding:"0.5rem 1rem",backgroundColor:"#fff",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderRightWidth:"0",borderTopLeftRadius:"0.375rem",borderBottomLeftRadius:"0.375rem",color:"#64748b",display:"flex",alignItems:"center",justifyContent:"center"}),wrapper:uI(uI({},T.wrapper),{},{position:"relative",display:"flex",alignItems:"stretch",width:"100%"})}},[T,f,s]),P=function(e){var t=e.target.value.replace(/[^0-9.]/g,""),n=t.indexOf(".");-1!==n&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,"")),y&&t.length>y&&(t=t.slice(0,y));var o=t?pI(t):"";C(o),d&&d({target:{name:r,value:t}})};(0,e.useEffect)(function(){void 0!==i&&C(null===i?"":pI(i))},[i]);var D=String(r);return n().createElement(zO,{name:D,label:k?o:"",value:i,validation:a,className:"currency-field ".concat(l||""," ").concat(v||""),customTheme:T,error:f,formState:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:T.label||{}},t,r&&n().createElement("span",{style:T.required||{}},"*"),S&&n().createElement(hO,{tooltip:S})):null},renderInput:function(){return n().createElement("div",{style:A.wrapper},n().createElement("span",{className:"currency-symbol",style:A.currencySymbol},c),n().createElement("input",{type:"text",name:D,value:E,onChange:P,autoComplete:"off",disabled:s,className:"currency-input",style:A.input,placeholder:g||"Enter amount","aria-label":"Currency input in ".concat(c),onBlur:b,"data-testid":O}))}})});fI.displayName="CurrencyField",fI.propTypes={testId:o().string,name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,disabled:o().bool,className:o().string,currency:o().string,onChange:o().func,formState:o().object,error:o().string,customTheme:o().object,styleName:o().string,placeholder:o().string,maxLength:o().number,onBlur:o().func,tooltip:o().string,showQuestionLabels:o().bool};const mI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hI=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vI=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,yI=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gI(e){return e?parseInt(e):1}function bI(e){return e&&parseFloat(e.replace(",","."))||0}const wI=[31,null,31,30,31,30,31,31,30,31,30,31];function SI(e){return e%400==0||e%4==0&&e%100!=0}function xI(e,t){return+Xo(e)<+Xo(t)}function kI(e,t,n){const r=Xo(e,n?.in);return r.setHours(t),r}function OI(e,t,n){const r=Xo(e,n?.in);return r.setMinutes(t),r}function _I(e,t,n){const r=Xo(e,n?.in);return r.setSeconds(t),r}function EI(e,t){const n=Xo(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function CI(e,t){const n=Xo(e,t?.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function II(e,t){const n=Xo(e,t?.in);return n.setHours(23,59,59,999),n}function TI(e,t){const n=Xo(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function AI(e,t,n){const r=+Xo(e,n?.in),[o,i]=[+Xo(t.start,n?.in),+Xo(t.end,n?.in)].sort((e,t)=>e-t);return r>=o&&r<=i}function PI(e,t,n){const r=Xo(e,n?.in),o=r.getFullYear(),i=r.getDate(),a=Ko(n?.in||e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=function(e,t){const n=Xo(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Ko(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}(a);return r.setMonth(t,Math.min(i,s)),r}function DI(e,t,n){const r=Xo(e,n?.in),o=t-(Math.trunc(r.getMonth()/3)+1);return PI(r,r.getMonth()+3*o)}function jI(e,t){return Xo(e,t?.in).getFullYear()}function RI(e,t){return Xo(e,t?.in).getMonth()}function MI(e,t){const n=Xo(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function LI(e,t){const n=Xo(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function NI(e,t){return Xo(e,t?.in).getHours()}function FI(e,t){return Xo(e,t?.in).getMinutes()}function VI(e){return Xo(e).getSeconds()}function BI(e,t,n){const r=Xo(e,n?.in);if(isNaN(t))return Ko(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),i=Ko(n?.in||e,r.getTime());return i.setMonth(r.getMonth()+t+1,0),o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function qI(e,t,n){return BI(e,-t,n)}function QI(e,t,n){const[r,o]=Oa(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function zI(e,t,n){return BI(e,3*t,n)}function $I(e,t,n){return zI(e,-t,n)}function UI(e,t,n){const[r,o]=Oa(n?.in,e,t);return 4*(r.getFullYear()-o.getFullYear())+(LI(r)-LI(o))}function WI(e,t,n){return BI(e,12*t,n)}function HI(e,t,n){return WI(e,-t,n)}function GI(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()-o.getFullYear()}function YI(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Ko.bind(null,e));const t=Xo(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Ko(r,n||NaN)}function KI(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Ko.bind(null,e));const t=Xo(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Ko(r,n||NaN)}function XI(e,t,n){return Ko(n?.in||e,+Xo(e)+t)}function ZI(e,t,n){return XI(e,t*Go,n)}function JI(e,t,n){const r=Xo(e,n?.in);return r.setTime(r.getTime()+t*Ho),r}function eT(e,t,n){return XI(e,1e3*t,n)}function tT(e,t){return+Xo(e)>+Xo(t)}function nT(e,t){return Xo(e,t?.in).getDate()}function rT(e,t,n){return da(e,7*t,n)}function oT(e){return+Xo(e)}function iT(e,t,n){const r=Xo(e,n?.in);return isNaN(+r)?Ko(n?.in||e,NaN):(r.setFullYear(t),r)}function aT(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function sT(e,t,n){return rT(e,-t,n)}var lT="undefined"!=typeof document?e.useLayoutEffect:function(){};const uT={...t}.useInsertionEffect||(e=>e());function cT(){return"undefined"!=typeof window}function dT(e){return mT(e)?(e.nodeName||"").toLowerCase():"#document"}function pT(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fT(e){var t;return null==(t=(mT(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function mT(e){return!!cT()&&(e instanceof Node||e instanceof pT(e).Node)}function hT(e){return!!cT()&&(e instanceof Element||e instanceof pT(e).Element)}function vT(e){return!!cT()&&(e instanceof HTMLElement||e instanceof pT(e).HTMLElement)}function yT(e){return!(!cT()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof pT(e).ShadowRoot)}function gT(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=IT(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function bT(e){return/^(table|td|th)$/.test(dT(e))}function wT(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const ST=/transform|translate|scale|rotate|perspective|filter/,xT=/paint|layout|strict|content/,kT=e=>!!e&&"none"!==e;let OT;function _T(e){const t=hT(e)?IT(e):e;return kT(t.transform)||kT(t.translate)||kT(t.scale)||kT(t.rotate)||kT(t.perspective)||!ET()&&(kT(t.backdropFilter)||kT(t.filter))||ST.test(t.willChange||"")||xT.test(t.contain||"")}function ET(){return null==OT&&(OT="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),OT}function CT(e){return/^(html|body|#document)$/.test(dT(e))}function IT(e){return pT(e).getComputedStyle(e)}function TT(e){return hT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function AT(e){if("html"===dT(e))return e;const t=e.assignedSlot||e.parentNode||yT(e)&&e.host||fT(e);return yT(t)?t.host:t}function PT(e){const t=AT(e);return CT(t)?e.ownerDocument?e.ownerDocument.body:e.body:vT(t)&&gT(t)?t:PT(t)}function DT(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=PT(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=pT(o);if(i){const e=jT(a);return t.concat(a,a.visualViewport||[],gT(o)?o:[],e&&n?DT(e):[])}return t.concat(o,DT(o,[],n))}function jT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const RT=Math.min,MT=Math.max,LT=Math.round,NT=Math.floor,FT=e=>({x:e,y:e}),VT={left:"right",right:"left",bottom:"top",top:"bottom"};function BT(e,t){return"function"==typeof e?e(t):e}function qT(e){return e.split("-")[0]}function QT(e){return e.split("-")[1]}function zT(e){return"y"===e?"height":"width"}function $T(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function UT(e){return"x"===$T(e)?"y":"x"}function WT(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const HT=["left","right"],GT=["right","left"],YT=["top","bottom"],KT=["bottom","top"];function XT(e){const t=qT(e);return VT[t]+e.slice(t.length)}function ZT(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function JT(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function eA(e,t,n){let{reference:r,floating:o}=e;const i=$T(t),a=UT(t),s=zT(a),l=qT(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(QT(t)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1)}return f}async function tA(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=BT(t,e),m=ZT(f),h=s[p?"floating"===d?"reference":"floating":d],v=JT(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=JT(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-w.top+m.top)/b.y,bottom:(w.bottom-v.bottom+m.bottom)/b.y,left:(v.left-w.left+m.left)/b.x,right:(w.right-v.right+m.right)/b.x}}const nA=new Set(["left","top"]);function rA(e){const t=IT(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vT(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=LT(n)!==i||LT(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function oA(e){return hT(e)?e:e.contextElement}function iA(e){const t=oA(e);if(!vT(t))return FT(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=rA(t);let a=(i?LT(n.width):n.width)/r,s=(i?LT(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const aA=FT(0);function sA(e){const t=pT(e);return ET()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:aA}function lA(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=oA(e);let a=FT(1);t&&(r?hT(r)&&(a=iA(r)):a=iA(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==pT(e))&&t}(i,n,r)?sA(i):FT(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=pT(i),t=r&&hT(r)?pT(r):r;let n=e,o=jT(n);for(;o&&r&&t!==n;){const e=iA(o),t=o.getBoundingClientRect(),r=IT(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=pT(o),o=jT(n)}}return JT({width:c,height:d,x:l,y:u})}function uA(e,t){const n=TT(e).scrollLeft;return t?t.left+n:lA(fT(e)).left+n}function cA(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-uA(e,n),y:n.top+t.scrollTop}}function dA(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=pT(e),r=fT(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=ET();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const u=uA(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else u<=25&&(i+=u);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=fT(e),n=TT(e),r=e.ownerDocument.body,o=MT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=MT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+uA(e);const s=-n.scrollTop;return"rtl"===IT(r).direction&&(a+=MT(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(fT(e));else if(hT(t))r=function(e,t){const n=lA(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vT(e)?iA(e):FT(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=sA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return JT(r)}function pA(e,t){const n=AT(e);return!(n===t||!hT(n)||CT(n))&&("fixed"===IT(n).position||pA(n,t))}function fA(e,t,n){const r=vT(t),o=fT(t),i="fixed"===n,a=lA(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=FT(0);function u(){l.x=uA(o)}if(r||!r&&!i)if(("body"!==dT(t)||gT(o))&&(s=TT(t)),r){const e=lA(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?FT(0):cA(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function mA(e){return"static"===IT(e).position}function hA(e,t){if(!vT(e)||"fixed"===IT(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fT(e)===n&&(n=n.ownerDocument.body),n}function vA(e,t){const n=pT(e);if(wT(e))return n;if(!vT(e)){let t=AT(e);for(;t&&!CT(t);){if(hT(t)&&!mA(t))return t;t=AT(t)}return n}let r=hA(e,t);for(;r&&bT(r)&&mA(r);)r=hA(r,t);return r&&CT(r)&&mA(r)&&!_T(r)?n:r||function(e){let t=AT(e);for(;vT(t)&&!CT(t);){if(_T(t))return t;if(wT(t))return null;t=AT(t)}return null}(e)||n}const yA={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=fT(r),s=!!t&&wT(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=FT(1);const c=FT(0),d=vT(r);if((d||!d&&!i)&&(("body"!==dT(r)||gT(a))&&(l=TT(r)),d)){const e=lA(r);u=iA(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?FT(0):cA(a,l);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:fT,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?wT(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=DT(e,[],!1).filter(e=>hT(e)&&"body"!==dT(e)),o=null;const i="fixed"===IT(e).position;let a=i?AT(e):e;for(;hT(a)&&!CT(a);){const t=IT(a),n=_T(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||gT(a)&&!n&&pA(e,a))?r=r.filter(e=>e!==a):o=t,a=AT(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=dA(t,i[0],o);let s=a.top,l=a.right,u=a.bottom,c=a.left;for(let e=1;e<i.length;e++){const n=dA(t,i[e],o);s=MT(n.top,s),l=RT(n.right,l),u=RT(n.bottom,u),c=MT(n.left,c)}return{width:l-c,height:u-s,x:c,y:s}},getOffsetParent:vA,getElementRects:async function(e){const t=this.getOffsetParent||vA,n=this.getDimensions,r=await n(e.floating);return{reference:fA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=rA(e);return{width:t,height:n}},getScale:iA,isElement:hT,isRTL:function(e){return"rtl"===IT(e).direction}};function gA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bA(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=oA(e),c=o||i?[...u?DT(u):[],...t?DT(t):[]]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=fT(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;const m={rootMargin:-NT(d)+"px "+-NT(o.clientWidth-(c+p))+"px "+-NT(o.clientHeight-(d+f))+"px "+-NT(c)+"px",threshold:MT(0,RT(1,l))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||gA(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let h=l?lA(e):null;return l&&function t(){const r=lA(e);h&&!gA(h,r)&&n(),h=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const wA=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=BT(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=qT(o),g=$T(s),b=qT(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),S=p||(b||!h?[XT(s)]:function(e){const t=XT(e);return[WT(e),t,WT(t)]}(s)),x="none"!==m;!p&&x&&S.push(...function(e,t,n,r){const o=QT(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?GT:HT:t?HT:GT;case"left":case"right":return t?YT:KT;default:return[]}}(qT(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(WT)))),i}(s,h,m,w));const k=[s,...S],O=await l.detectOverflow(t,v),_=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&_.push(O[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=QT(e),o=UT(e),i=zT(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=XT(a)),[a,XT(a)]}(o,a,w);_.push(O[e[0]],O[e[1]])}if(E=[...E,{placement:o,overflows:_}],!_.every(e=>e<=0)){var C,I;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=k[e];if(t&&("alignment"!==d||g===$T(t)||E.every(e=>$T(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(I=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=E.filter(e=>{if(x){const t=$T(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},SA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=BT(e,t)||{};if(null==u)return{};const d=ZT(c),p={x:n,y:r},f=UT(o),m=zT(f),h=await a.getDimensions(u),v="y"===f,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[f]-p[f]-i.floating[m],S=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let k=x?x[b]:0;k&&await(null==a.isElement?void 0:a.isElement(x))||(k=s.floating[b]||i.floating[m]);const O=w/2-S/2,_=k/2-h[m]/2-1,E=RT(d[y],_),C=RT(d[g],_),I=E,T=k-h[m]-C,A=k/2-h[m]/2+O,P=function(e,t,n){return MT(e,RT(t,n))}(I,A,T),D=!l.arrow&&null!=QT(o)&&A!==P&&i.reference[m]/2-(A<I?E:C)-h[m]/2<0,j=D?A<I?A-I:A-T:0;return{[f]:p[f]+j,data:{[f]:P,centerOffset:A-P-j,...D&&{alignmentOffset:j}},reset:D}}}),xA=(e,t,n)=>{const r=new Map,o={platform:yA,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:tA},l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=eA(u,r,l),p=r,f=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:v,fn:y}=h,{x:g,y:b,data:w,reset:S}=await y({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=b?b:d,m[v]={...m[v],...w},S&&f<50&&(f++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(u=!0===S.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),({x:c,y:d}=eA(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var kA="undefined"!=typeof document?e.useLayoutEffect:function(){};function OA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!OA(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||OA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function _A(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EA(e,t){const n=_A(e);return Math.round(t*n)/n}function CA(t){const n=e.useRef(t);return kA(()=>{n.current=t}),n}const IA=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=qT(n),s=QT(n),l="y"===$T(n),u=nA.has(a)?-1:1,c=i&&l?-1:1,d=BT(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},TA=(e,t)=>{const n=wA(e);return{name:n.name,fn:n.fn,options:[e,t]}},AA=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?SA({element:n.current,padding:r}).fn(t):{}:n?SA({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},PA={...t};let DA=!1,jA=0;const RA=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jA++,MA=PA.useId||function(){const[t,n]=e.useState(()=>DA?RA():void 0);return lT(()=>{null==t&&n(RA())},[]),e.useEffect(()=>{DA=!0},[]),t},LA=e.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...h}={},...v}=t,y=MA(),[g,b]=e.useState(!1);if(lT(()=>{o&&"rtl"===IT(o).direction&&b(!0)},[o]),!o)return null;const[w,S]=r.split("-"),x="top"===w||"bottom"===w;let k=d;(x&&null!=a&&a.x||!x&&null!=a&&a.y)&&(k=null);const O=2*c,_=O/2,E=s/2*(u/-8+1),C=l/2*u/4,I=!!f,T=k&&"end"===S?"bottom":"top";let A=k&&"end"===S?"right":"left";k&&g&&(A="end"===S?"left":"right");const P=null!=(null==i?void 0:i.x)?k||i.x:"",D=null!=(null==i?void 0:i.y)?k||i.y:"",j=f||"M0,0 H"+s+" L"+(s-E)+","+(l-C)+" Q"+s/2+","+l+" "+E+","+(l-C)+" Z",R={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,Iy.jsxs)("svg",{...v,"aria-hidden":!0,ref:n,width:I?s:s+O,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[A]:P,[T]:D,[w]:x||I?"100%":"calc(100% - "+O/2+"px)",transform:[R,m].filter(e=>!!e).join(" "),...h},children:[O>0&&(0,Iy.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:O+(f?0:1),d:j}),(0,Iy.jsx)("path",{stroke:O&&!f?v.fill:"none",d:j}),(0,Iy.jsx)("clipPath",{id:y,children:(0,Iy.jsx)("rect",{x:-_,y:_*(I?-1:1),width:s+O,height:s})})]})});const NA=e.createContext(null),FA=e.createContext(null);function VA(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=MA(),a=e.useRef({}),[s]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}()),l=null!=((null==(u=e.useContext(NA))?void 0:u.id)||null);var u;const[c,d]=e.useState(o.reference),p=function(t){const n=e.useRef(()=>{});return uT(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}((e,t,n)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)}),f=e.useMemo(()=>({setPositionReference:d}),[]),m=e.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return e.useMemo(()=>({dataRef:a,open:n,onOpenChange:p,elements:m,events:s,floatingId:i,refs:f}),[n,p,m,s,i,f])}function BA(t){void 0===t&&(t={});const{nodeId:n}=t,r=VA({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[a,s]=e.useState(null),[l,u]=e.useState(null),c=(null==i?void 0:i.domReference)||a,d=e.useRef(null),p=e.useContext(FA);lT(()=>{c&&(d.current=c)},[c]);const f=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(o);OA(f,o)||m(o);const[h,v]=e.useState(null),[y,g]=e.useState(null),b=e.useCallback(e=>{e!==k.current&&(k.current=e,v(e))},[]),w=e.useCallback(e=>{e!==O.current&&(O.current=e,g(e))},[]),S=a||h,x=s||y,k=e.useRef(null),O=e.useRef(null),_=e.useRef(d),E=null!=u,C=CA(u),I=CA(i),T=CA(c),A=e.useCallback(()=>{if(!k.current||!O.current)return;const e={placement:n,strategy:r,middleware:f};I.current&&(e.platform=I.current),xA(k.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};P.current&&!OA(_.current,t)&&(_.current=t,Hb.flushSync(()=>{p(t)}))})},[f,n,r,I,T]);kA(()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[c]);const P=e.useRef(!1);kA(()=>(P.current=!0,()=>{P.current=!1}),[]),kA(()=>{if(S&&(k.current=S),x&&(O.current=x),S&&x){if(C.current)return C.current(S,x,A);A()}},[S,x,A,C,E]);const D=e.useMemo(()=>({reference:k,floating:O,setReference:b,setFloating:w}),[b,w]),j=e.useMemo(()=>({reference:S,floating:x}),[S,x]),R=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!j.floating)return e;const t=EA(j.floating,d.x),n=EA(j.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",..._A(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,j.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:A,refs:D,elements:j,floatingStyles:R}),[d,A,D,j,R])}({...t,elements:{...i,...l&&{reference:l}}}),m=e.useCallback(e=>{const t=hT(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),f.refs.setReference(t)},[f.refs]),h=e.useCallback(e=>{(hT(e)||null===e)&&(d.current=e,s(e)),(hT(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!hT(e))&&f.refs.setReference(e)},[f.refs]),v=e.useMemo(()=>({...f.refs,setReference:h,setPositionReference:m,domReference:d}),[f.refs,h,m]),y=e.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),g=e.useMemo(()=>({...f,...o,refs:v,elements:y,nodeId:n}),[f,v,y,n,o]);return lT(()=>{o.dataRef.current.floatingContext=g;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=g)}),e.useMemo(()=>({...f,context:g,refs:v,elements:y}),[f,v,y,g])}var qA=function(e,t){return qA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},qA(e,t)};function QA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}qA(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var zA=function(){return zA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zA.apply(this,arguments)};function $A(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var UA,WA=function(e){var t=e.showTimeSelectOnly,r=void 0!==t&&t,o=e.showTime,i=void 0!==o&&o,a=e.className,s=e.children,l=e.inline,u=r?"Choose Time":"Choose Date".concat(i?" and Time":"");return n().createElement("div",{className:a,"aria-label":u,role:l?void 0:"dialog","aria-modal":l?void 0:"true"},s)},HA=function(t){var r=t.children,o=t.onClickOutside,i=t.className,a=t.containerRef,s=t.style,l=function(t,n){var r=(0,e.useRef)(null),o=(0,e.useRef)(t);(0,e.useEffect)(function(){o.current=t},[t]);var i=(0,e.useCallback)(function(e){var t,i=e.composed&&e.composedPath&&e.composedPath().find(function(e){return e instanceof Node})||e.target;r.current&&!r.current.contains(i)&&(n&&i instanceof HTMLElement&&i.classList.contains(n)||null===(t=o.current)||void 0===t||t.call(o,e))},[n]);return(0,e.useEffect)(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),r}(o,t.ignoreClass);return n().createElement("div",{className:i,style:s,ref:function(e){l.current=e,a&&(a.current=e)}},r)};function GA(){return"undefined"!=typeof window?window:globalThis}function YA(e){if(null==e)return new Date;var t="string"==typeof e?function(e,t){const n=()=>Ko(t?.in,NaN),r=t?.additionalDigits??2,o=function(e){const t={},n=e.split(mI.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],mI.timeZoneDelimiter.test(t.date)&&(t.date=e.split(mI.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const e=mI.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let i;if(o.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(o.date,r);i=function(e,t){if(null===t)return new Date(NaN);const n=e.match(hI);if(!n)return new Date(NaN);const r=!!n[4],o=gI(n[1]),i=gI(n[2])-1,a=gI(n[3]),s=gI(n[4]),l=gI(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}(t,s,l):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(wI[t]||(SI(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(SI(e)?366:365)}(t,o)?(e.setUTCFullYear(t,i,Math.max(o,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!i||isNaN(+i))return n();const a=+i;let s,l=0;if(o.time&&(l=function(e){const t=e.match(vI);if(!t)return NaN;const n=bI(t[1]),r=bI(t[2]),o=bI(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*Go+r*Ho+1e3*o:NaN}(o.time),isNaN(l)))return n();if(!o.timezone){const e=new Date(a+l),n=Xo(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=function(e){if("Z"===e)return 0;const t=e.match(yI);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*Go+o*Ho):NaN}(o.timezone),isNaN(s)?n():Xo(a+l+s,t?.in)}(e):Xo(e);return XA(t)?t:new Date}function KA(e,t,n,r,o){void 0===o&&(o=YA());for(var i=hP(n)||hP(mP()),a=0,s=Array.isArray(t)?t:[t];a<s.length;a++){var l=s[a],u=xa(e,l,o,{locale:i,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});if(XA(u)&&(!r||e===ZA(u,l,n)))return u}return null}function XA(e,t){return Zo(e)&&!xI(e,new Date("1/1/1800"))}function ZA(e,t,n){if("en"===n)return Va(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?hP(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),Va(e,t,{locale:r=r||hP(mP()),useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function JA(e,t){var n=t.dateFormat,r=t.locale,o=Array.isArray(n)&&n.length>0?n[0]:n;return e&&ZA(e,o,r)||""}function eP(e,t){var n=t.hour,r=void 0===n?0:n,o=t.minute,i=void 0===o?0:o,a=t.second;return kI(OI(_I(e,void 0===a?0:a),i),r)}function tP(e){return _a(e)}function nP(e,t,n){return ra(e,{locale:hP(t||mP()),weekStartsOn:n})}function rP(e){return EI(e)}function oP(e){return Ca(e)}function iP(e){return CI(e)}function aP(){return _a(YA())}function sP(e){return II(e)}function lP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t):!e&&!t}function uP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t):!e&&!t}function cP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return+CI(r)===+CI(o)}(e,t):!e&&!t}function dP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return+_a(r)===+_a(o)}(e,t):!e&&!t}function pP(e,t){return e&&t?(n=t,+Xo(e)===+Xo(n)):!e&&!t;var n}function fP(e,t,n){var r,o=_a(t),i=II(n);try{r=AI(e,{start:o,end:i})}catch(e){r=!1}return r}function mP(){return GA().__localeId__}function hP(e){if("string"==typeof e){var t=GA();return t.__localeData__?t.__localeData__[e]:void 0}return e}function vP(e,t){return ZA(PI(YA(),e),"LLLL",t)}function yP(e,t){return ZA(PI(YA(),e),"LLL",t)}function gP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,u=n.filterDate;return!!n.disabled||CP(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return t instanceof Date?dP(e,t):dP(e,t.date)})||a&&a.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})})||s&&!s.some(function(t){return dP(e,t)})||l&&!l.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})})||u&&!u(YA(e))||!1}function bP(e,t){var n=void 0===t?{}:t,r=n.excludeDates,o=n.excludeDateIntervals;return o&&o.length>0?o.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})}):r&&r.some(function(t){var n;return t instanceof Date?dP(e,t):dP(e,null!==(n=t.date)&&void 0!==n?n:new Date)})||!1}function wP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return CP(e,{minDate:r?EI(r):void 0,maxDate:o?TI(o):void 0})||(null==i?void 0:i.some(function(t){return uP(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return uP(e,t)})||s&&!s(YA(e))||!1}function SP(e,t,n,r){var o=jI(e),i=RI(e),a=jI(t),s=RI(t),l=jI(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function xP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates;return CP(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return uP(t instanceof Date?t:t.date,e)})||a&&!a.some(function(t){return uP(t,e)})||!1}function kP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return!!n.disabled||CP(e,{minDate:r,maxDate:o})||(null==i?void 0:i.some(function(t){return cP(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return cP(e,t)})||s&&!s(YA(e))||!1}function OP(e,t,n){if(!t||!n)return!1;if(!Zo(t)||!Zo(n))return!1;var r=jI(t),o=jI(n);return r<=e&&o>=e}function _P(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;if(n.disabled)return!0;var l=new Date(e,0,1);return CP(l,{minDate:r?Ca(r):void 0,maxDate:o?MI(o):void 0})||(null==i?void 0:i.some(function(e){return lP(l,e instanceof Date?e:e.date)}))||a&&!a.some(function(e){return lP(l,e)})||s&&!s(YA(l))||!1}function EP(e,t,n,r){var o=jI(e),i=LI(e),a=jI(t),s=LI(t),l=jI(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function CP(e,t){var n,r=void 0===t?{}:t,o=r.minDate,i=r.maxDate;return null!==(n=o&&Ea(e,o)<0||i&&Ea(e,i)>0)&&void 0!==n&&n}function IP(e,t){return t.some(function(t){return NI(t)===NI(e)&&FI(t)===FI(e)&&VI(t)===VI(e)})}function TP(e,t){var n=void 0===t?{}:t,r=n.excludeTimes,o=n.includeTimes,i=n.filterTime;return r&&IP(e,r)||o&&!IP(e,o)||i&&!i(e)||!1}function AP(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var o=YA();o=_I(o=OI(o=kI(o,NI(e)),FI(e)),VI(e));var i=YA();i=_I(i=OI(i=kI(i,NI(n)),FI(n)),VI(n));var a,s=YA();s=_I(s=OI(s=kI(s,NI(r)),FI(r)),VI(r));try{a=!AI(o,{start:i,end:s})}catch(e){a=!1}return a}function PP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=qI(e,1);return r&&QI(r,i)>0||o&&o.every(function(e){return QI(e,i)>0})||!1}function DP(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=BI(e,1);return r&&QI(i,r)>0||o&&o.every(function(e){return QI(i,e)>0})||!1}function jP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=HI(e,1);return r&&GI(r,i)>0||o&&o.every(function(e){return GI(e,i)>0})||!1}function RP(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=WI(e,1);return r&&GI(i,r)>0||o&&o.every(function(e){return GI(i,e)>0})||!1}function MP(e){var t=e.minDate,n=e.includeDates;return n&&t?YI(n.filter(function(e){return Ea(e,t)>=0})):n?YI(n):t}function LP(e){var t=e.maxDate,n=e.includeDates;return n&&t?KI(n.filter(function(e){return Ea(e,t)<=0})):n?KI(n):t}function NP(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--highlighted");for(var r=new Map,o=0,i=e.length;o<i;o++){var a=e[o];if(Uo(a)){var s=ZA(a,"MM.dd.yyyy");(p=r.get(s)||[]).includes(t)||(p.push(t),r.set(s,p))}else if("object"==typeof a){var l=null!==(n=Object.keys(a)[0])&&void 0!==n?n:"",u=a[l];if("string"==typeof l&&Array.isArray(u))for(var c=0,d=u.length;c<d;c++){var p,f=u[c];if(f)s=ZA(f,"MM.dd.yyyy"),(p=r.get(s)||[]).includes(l)||(p.push(l),r.set(s,p))}}}return r}function FP(e,t){void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(e){var r=e.date,o=e.holidayName;if(Uo(r)){var i=ZA(r,"MM.dd.yyyy"),a=n.get(i)||{className:"",holidayNames:[]};if(!("className"in a)||a.className!==t||(s=a.holidayNames,l=[o],s.length!==l.length||!s.every(function(e,t){return e===l[t]}))){var s,l;a.className=t;var u=a.holidayNames;a.holidayNames=u?$A($A([],u,!0),[o],!1):[o],n.set(i,a)}}}),n}function VP(e,t,n,r,o){for(var i=o.length,a=[],s=0;s<i;s++){var l=e,u=o[s];u&&(l=eT(l=JI(l=ZI(l,NI(u)),FI(u)),VI(u)));var c=JI(e,(n+1)*r);tT(l,t)&&xI(l,c)&&null!=u&&a.push(u)}return a}function BP(e){return e<10?"0".concat(e):"".concat(e)}function qP(e,t){void 0===t&&(t=12);var n=Math.ceil(jI(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function QP(e){var t=e.getSeconds(),n=e.getMilliseconds();return Xo(e.getTime()-1e3*t-n)}function zP(e,t){return QP(e).getTime()===QP(t).getTime()}function $P(e){if(!Uo(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function UP(e,t){if(!Uo(e)||!Uo(t))throw new Error("Invalid date received");return xI($P(e),$P(t))}function WP(e){return e.key===UA.Space}!function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"}(UA||(UA={}));var HP,GP=function(t){function r(r){var o=t.call(this,r)||this;return o.inputRef=n().createRef(),o.onTimeChange=function(e){var t,n;o.setState({time:e});var r=o.props.date,i=r instanceof Date&&!isNaN(+r)?r:new Date;if(null==e?void 0:e.includes(":")){var a=e.split(":"),s=a[0],l=a[1];i.setHours(Number(s)),i.setMinutes(Number(l))}null===(n=(t=o.props).onChange)||void 0===n||n.call(t,i)},o.renderTimeInput=function(){var t=o.state.time,r=o.props,i=r.date,a=r.timeString,s=r.customTimeInput;return s?(0,e.cloneElement)(s,{date:i,value:t,onChange:o.onTimeChange}):n().createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:o.inputRef,onClick:function(){var e;null===(e=o.inputRef.current)||void 0===e||e.focus()},required:!0,value:t,onChange:function(e){o.onTimeChange(e.target.value||a)}})},o.state={time:o.props.timeString},o}return QA(r,t),r.getDerivedStateFromProps=function(e,t){return e.timeString!==t.time?{time:e.timeString}:null},r.prototype.render=function(){return n().createElement("div",{className:"react-datepicker__input-time-container"},n().createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),n().createElement("div",{className:"react-datepicker-time__input-container"},n().createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},r}(e.Component),YP=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.dayEl=(0,e.createRef)(),r.handleClick=function(e){!r.isDisabled()&&r.props.onClick&&r.props.onClick(e)},r.handleMouseEnter=function(e){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(e)},r.handleOnKeyDown=function(e){var t,n;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),null===(n=(t=r.props).handleOnKeyDown)||void 0===n||n.call(t,e)},r.isSameDay=function(e){return dP(r.props.day,e)},r.isKeyboardSelected=function(){var e;if(r.props.disabledKeyboardNavigation)return!1;var t=r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected),n=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!t&&r.isSameDayOrWeek(r.props.preSelection)&&!n},r.isDisabled=function(e){return void 0===e&&(e=r.props.day),gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate,disabled:r.props.disabled})},r.isExcluded=function(){return bP(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return dP(r.props.day,nP(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(e){return r.props.showWeekPicker&&dP(e,nP(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(e){return r.isSameDay(e)||r.isSameWeek(e)},r.getHighLightedClass=function(){var e=r.props,t=e.day,n=e.highlightDates;if(!n)return!1;var o=ZA(t,"MM.dd.yyyy");return n.get(o)},r.getHolidaysClass=function(){var e,t=r.props,n=t.day,o=t.holidays;if(!o)return[void 0];var i=ZA(n,"MM.dd.yyyy");return o.has(i)?[null===(e=o.get(i))||void 0===e?void 0:e.className]:[void 0]},r.isInRange=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&fP(t,n,o)},r.isInSelectingRange=function(){var e,t=r.props,n=t.day,o=t.selectsStart,i=t.selectsEnd,a=t.selectsRange,s=t.selectsDisabledDaysInRange,l=t.startDate,u=t.swapRange,c=t.endDate,d=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;if(!(o||i||a)||!d||!s&&r.isDisabled())return!1;if(o&&c&&(xI(d,c)||pP(d,c)))return fP(n,d,c);if(i&&l&&(tT(d,l)||pP(d,l)))return fP(n,l,d);if(a&&l&&!c){if(pP(d,l))return fP(n,l,d);if(tT(d,l))return fP(n,l,d);if(u&&xI(d,l))return fP(n,d,l)}return!1},r.isSelectingRangeStart=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.startDate,i=t.selectsStart,a=t.swapRange,s=t.selectsRange,l=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return dP(n,i||s&&a&&o&&l&&xI(l,o)?l:o)},r.isSelectingRangeEnd=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.endDate,i=t.selectsEnd,a=t.selectsRange,s=t.swapRange,l=t.startDate,u=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return dP(n,i?u:a&&s&&l&&u?xI(u,l)?l:u:a?u:o)},r.isRangeStart=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&dP(n,t)},r.isRangeEnd=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&dP(o,t)},r.isWeekend=function(){var e,t=Xo(r.props.day,e?.in).getDay();return 0===t||6===t},r.isAfterMonth=function(){return void 0!==r.props.month&&(r.props.month+1)%12===RI(r.props.day)},r.isBeforeMonth=function(){return void 0!==r.props.month&&(RI(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(YA())},r.isSelected=function(){var e;return r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(e){return Mp("react-datepicker__day",r.props.dayClassName?r.props.dayClassName(e):void 0,"react-datepicker__day--"+ZA(r.props.day,"ddd",void 0),{"react-datepicker__day--disabled":r.isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var e=r.props,t=e.day,n=e.ariaLabelPrefixWhenEnabled,o=void 0===n?"Choose":n,i=e.ariaLabelPrefixWhenDisabled,a=void 0===i?"Not available":i,s=r.isDisabled()||r.isExcluded()?a:o;return"".concat(s," ").concat(ZA(t,"PPPP",r.props.locale))},r.getTitle=function(){var e=r.props,t=e.day,n=e.holidays,o=void 0===n?new Map:n,i=e.excludeDates,a=ZA(t,"MM.dd.yyyy"),s=[];return o.has(a)&&s.push.apply(s,o.get(a).holidayNames),r.isExcluded()&&s.push(null==i?void 0:i.filter(function(e){return e instanceof Date?dP(e,t):dP(null==e?void 0:e.date,t)}).map(function(e){if(!(e instanceof Date))return null==e?void 0:e.message})),s.join(", ")},r.getTabIndex=function(){var e=r.props.selected,t=r.props.preSelection;return(!r.props.showWeekPicker||!r.props.showWeekNumber&&r.isStartOfWeek())&&(r.isKeyboardSelected()||r.isSameDay(e)&&dP(t,e))?0:-1},r.handleFocusDay=function(){var e;r.shouldFocusDay()&&(null===(e=r.dayEl.current)||void 0===e||e.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(nT(r.props.day),r.props.day):nT(r.props.day)},r.render=function(){return n().createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"gridcell",title:r.getTitle(),"aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),""!==r.getTitle()&&n().createElement("span",{className:"overlay"},r.getTitle()))},r}return QA(r,t),r.prototype.componentDidMount=function(){this.handleFocusDay()},r.prototype.componentDidUpdate=function(){this.handleFocusDay()},r.prototype.shouldFocusDay=function(){var e=!1;return 0===this.getTabIndex()&&this.isSameDay(this.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(e=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(e=!1),this.isDayActiveElement()&&(e=!0),this.isDuplicateDay()&&(e=!1)),e},r.prototype.isDayActiveElement=function(){var e,t,n;return(null===(t=null===(e=this.props.containerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.contains(document.activeElement))&&(null===(n=document.activeElement)||void 0===n?void 0:n.classList.contains("react-datepicker__day"))},r.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},r}(e.Component),KP=function(t){function r(){var n=null!==t&&t.apply(this,arguments)||this;return n.weekNumberEl=(0,e.createRef)(),n.handleClick=function(e){n.props.onClick&&n.props.onClick(e)},n.handleOnKeyDown=function(e){var t,r;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),null===(r=(t=n.props).handleOnKeyDown)||void 0===r||r.call(t,e)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!dP(n.props.date,n.props.selected)&&dP(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||dP(n.props.date,n.props.selected)&&dP(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(e){var t=!1;0===n.getTabIndex()&&!(null==e?void 0:e.isInputFocused)&&dP(n.props.date,n.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(t=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(t=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(t=!0)),t&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},r.prototype.componentDidUpdate=function(e){this.handleFocusWeekNumber(e)},r.prototype.render=function(){var e=this.props,t=e.weekNumber,o=e.isWeekDisabled,i=e.ariaLabelPrefix,a=void 0===i?r.defaultProps.ariaLabelPrefix:i,s=e.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!o,"react-datepicker__week-number--selected":!!s&&dP(this.props.date,this.props.selected)};return n().createElement("div",{ref:this.weekNumberEl,className:Mp(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},t)},r}(e.Component),XP=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleDayMouseEnter=function(e){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(e)},r.handleWeekClick=function(e,n,o){for(var i,a,s,l=new Date(e),u=0;u<7;u++){var c=new Date(e);if(c.setDate(c.getDate()+u),!r.isDisabled(c)){l=c;break}}"function"==typeof r.props.onWeekSelect&&r.props.onWeekSelect(l,n,o),r.props.showWeekPicker&&r.handleDayClick(l,o),(null!==(i=r.props.shouldCloseOnSelect)&&void 0!==i?i:t.defaultProps.shouldCloseOnSelect)&&(null===(s=(a=r.props).setOpen)||void 0===s||s.call(a,!1))},r.formatWeekNumber=function(e){return r.props.formatWeekNumber?r.props.formatWeekNumber(e):function(e){return la(e)}(e)},r.isWeekDisabled=function(){for(var e=r.startOfWeek(),t=da(e,6),n=new Date(e);n<=t;){if(!r.isDisabled(n))return!1;n=da(n,1)}return!0},r.renderDays=function(){var e=r.startOfWeek(),o=[],i=r.formatWeekNumber(e);if(r.props.showWeekNumber){var a=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,e,i):void 0;o.push(n().createElement(KP,zA({key:"W"},t.defaultProps,r.props,{weekNumber:i,isWeekDisabled:r.isWeekDisabled(),date:e,onClick:a})))}return o.concat([0,1,2,3,4,5,6].map(function(o){var i=da(e,o);return n().createElement(YP,zA({},t.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:i.valueOf(),day:i,onClick:r.handleDayClick.bind(r,i),onMouseEnter:r.handleDayMouseEnter.bind(r,i)}))}))},r.startOfWeek=function(){return nP(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!dP(r.startOfWeek(),r.props.selected)&&dP(r.startOfWeek(),r.props.preSelection)},r}return QA(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e={"react-datepicker__week":!0,"react-datepicker__week--selected":dP(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},t=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return n().createElement("div",{className:Mp(e,t),role:"row"},this.renderDays())},t}(e.Component),ZP="two_columns",JP="three_columns",eD="four_columns",tD=((HP={})[ZP]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},HP[JP]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},HP[eD]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},HP);function nD(e,t){return e?eD:t?ZP:JP}var rD=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.MONTH_REFS=$A([],Array(12),!0).map(function(){return(0,e.createRef)()}),r.QUARTER_REFS=$A([],Array(4),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate,disabled:r.props.disabled})},r.isExcluded=function(e){return bP(e,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(e,t){var n,o;null===(o=(n=r.props).onDayClick)||void 0===o||o.call(n,e,t,r.props.orderInDisplay)},r.handleDayMouseEnter=function(e){var t,n;null===(n=(t=r.props).onDayMouseEnter)||void 0===n||n.call(t,e)},r.handleMouseLeave=function(){var e,t;null===(t=(e=r.props).onMouseLeave)||void 0===t||t.call(e)},r.isRangeStartMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&uP(PI(n,e),o)},r.isRangeStartQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&cP(DI(n,e),o)},r.isRangeEndMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&uP(PI(n,e),i)},r.isRangeEndQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&cP(DI(n,e),i)},r.isInSelectingRangeMonth=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?SP(c,u,e,o):(a&&l||!(!s||!l||u))&&SP(l,c,e,o))},r.isSelectingMonthRangeStart=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.startDate,a=n.selectsStart,s=PI(o,e),l=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return uP(s,a?l:i)},r.isSelectingMonthRangeEnd=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.endDate,a=n.selectsEnd,s=n.selectsRange,l=PI(o,e),u=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return uP(l,a||s?u:i)},r.isInSelectingRangeQuarter=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?EP(c,u,e,o):(a&&l||!(!s||!l||u))&&EP(l,c,e,o))},r.isWeekInMonth=function(e){var t=r.props.day,n=da(e,6);return uP(e,t)||uP(n,t)},r.isCurrentMonth=function(e,t){return jI(e)===jI(YA())&&t===RI(YA())},r.isCurrentQuarter=function(e,t){return jI(e)===jI(YA())&&t===LI(YA())},r.isSelectedMonth=function(e,t,n){return RI(n)===t&&jI(e)===jI(n)},r.isSelectMonthInList=function(e,t,n){return n.some(function(n){return r.isSelectedMonth(e,t,n)})},r.isSelectedQuarter=function(e,t,n){return LI(n)===t&&jI(e)===jI(n)},r.isSelectQuarterInList=function(e,t,n){return n.some(function(n){return r.isSelectedQuarter(e,t,n)})},r.isMonthSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=RI(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedMonth(t,a,e)}):!!n&&r.isSelectedMonth(t,a,n)},r.isQuarterSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=LI(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedQuarter(t,a,e)}):!!n&&r.isSelectedQuarter(t,a,n)},r.renderWeeks=function(){if(!XA(r.props.day))return[];for(var e=[],t=r.props.fixedHeight,o=0,i=!1,a=nP(rP(r.props.day),r.props.locale,r.props.calendarStartDay),s=r.props.selected?function(e){return r.props.showWeekPicker?nP(e,r.props.locale,r.props.calendarStartDay):r.props.selected}(r.props.selected):void 0,l=r.props.preSelection?function(e){return r.props.showWeekPicker?nP(e,r.props.locale,r.props.calendarStartDay):r.props.preSelection}(r.props.preSelection):void 0;e.push(n().createElement(XP,zA({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:o,day:a,month:RI(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:s,preSelection:l,showWeekNumber:r.props.showWeekNumbers}))),!i;){o++,a=rT(a,1);var u=t&&o>=6,c=!t&&!r.isWeekInMonth(a);if(u||c){if(!r.props.peekNextMonth)break;i=!0}}return e},r.onMonthClick=function(e,t){var n=r.isMonthDisabledForLabelDate(t),o=n.isDisabled,i=n.labelDate;o||r.handleDayClick(rP(i),e)},r.onMonthMouseEnter=function(e){var t=r.isMonthDisabledForLabelDate(e),n=t.isDisabled,o=t.labelDate;n||r.handleDayMouseEnter(rP(o))},r.handleMonthNavigation=function(e,t){var n,o,i,a;null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.MONTH_REFS[e])||void 0===i?void 0:i.current)||void 0===a||a.focus()},r.handleKeyboardNavigation=function(e,t,n){var o,i=r.props,a=i.selected,s=i.preSelection,l=i.setPreSelection,u=i.minDate,c=i.maxDate,d=i.showFourColumnMonthYearPicker,p=i.showTwoColumnMonthYearPicker;if(s){var f=nD(d,p),m=r.getVerticalOffset(f),h=null===(o=tD[f])||void 0===o?void 0:o.grid,v=function(e,t,n){var r,o,i=t,a=n;switch(e){case UA.ArrowRight:i=BI(t,1),a=11===n?0:n+1;break;case UA.ArrowLeft:i=qI(t,1),a=0===n?11:n-1;break;case UA.ArrowUp:i=qI(t,m),a=(null===(r=null==h?void 0:h[0])||void 0===r?void 0:r.includes(n))?n+12-m:n-m;break;case UA.ArrowDown:i=BI(t,m),a=(null===(o=null==h?void 0:h[h.length-1])||void 0===o?void 0:o.includes(n))?n-12+m:n+m}return{newCalculatedDate:i,newCalculatedMonth:a}};if(t!==UA.Enter){var y=function(e,t,n){for(var o=e,i=!1,a=0,s=v(o,t,n),l=s.newCalculatedDate,d=s.newCalculatedMonth;!i;){if(a>=40){l=t,d=n;break}var p;u&&l<u&&(o=UA.ArrowRight,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),c&&l>c&&(o=UA.ArrowLeft,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),xP(l,r.props)?(l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth):i=!0,a++}return{newCalculatedDate:l,newCalculatedMonth:d}}(t,s,n),g=y.newCalculatedDate,b=y.newCalculatedMonth;switch(t){case UA.ArrowRight:case UA.ArrowLeft:case UA.ArrowUp:case UA.ArrowDown:r.handleMonthNavigation(b,g)}}else r.isMonthDisabled(n)||(r.onMonthClick(e,n),null==l||l(a))}},r.getVerticalOffset=function(e){var t,n;return null!==(n=null===(t=tD[e])||void 0===t?void 0:t.verticalNavigationOffset)&&void 0!==n?n:0},r.onMonthKeyDown=function(e,t){var n=r.props,o=n.disabledKeyboardNavigation,i=n.handleOnMonthKeyDown,a=e.key;a!==UA.Tab&&e.preventDefault(),o||r.handleKeyboardNavigation(e,a,t),i&&i(e)},r.onQuarterClick=function(e,t){var n=DI(r.props.day,t);kP(n,r.props)||r.handleDayClick(iP(n),e)},r.onQuarterMouseEnter=function(e){var t=DI(r.props.day,e);kP(t,r.props)||r.handleDayMouseEnter(iP(t))},r.handleQuarterNavigation=function(e,t){var n,o,i,a;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.QUARTER_REFS[e-1])||void 0===i?void 0:i.current)||void 0===a||a.focus())},r.onQuarterKeyDown=function(e,t){var n,o,i=e.key;if(!r.props.disabledKeyboardNavigation)switch(i){case UA.Enter:r.onQuarterClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case UA.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(4===t?1:t+1,zI(r.props.preSelection,1));break;case UA.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(1===t?4:t-1,$I(r.props.preSelection,1))}},r.isMonthDisabledForLabelDate=function(e){var t,n=r.props,o=n.day,i=n.disabled,a=n.minDate,s=n.maxDate,l=n.excludeDates,u=n.includeDates,c=PI(o,e);return i?{isDisabled:!0,labelDate:PI(o,e)}:{isDisabled:null!==(t=(a||s||l||u)&&wP(c,r.props))&&void 0!==t&&t,labelDate:c}},r.isMonthDisabled=function(e){return r.isMonthDisabledForLabelDate(e).isDisabled},r.getMonthClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.preSelection,s=t.monthClassName,l=s?s(PI(n,e)):void 0,u=r.getSelection();return Mp("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":r.isMonthDisabled(e),"react-datepicker__month-text--selected":u?r.isSelectMonthInList(n,e,u):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&a&&r.isSelectedMonth(n,e,a)&&!r.isMonthSelected()&&!r.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?SP(o,i,e,n):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(e),"react-datepicker__month-text--range-end":r.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":r.isCurrentMonth(n,e)})},r.getTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=RI(r.props.preSelection),n=r.isMonthDisabledForLabelDate(t).isDisabled;return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getQuarterTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=LI(r.props.preSelection),n=kP(r.props.day,r.props);return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getAriaLabel=function(e){var t=r.props,n=t.chooseDayAriaLabelPrefix,o=void 0===n?"Choose":n,i=t.disabledDayAriaLabelPrefix,a=void 0===i?"Not available":i,s=t.day,l=t.locale,u=PI(s,e),c=r.isDisabled(u)||r.isExcluded(u)?a:o;return"".concat(c," ").concat(ZA(u,"MMMM yyyy",l))},r.getQuarterClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.minDate,s=t.maxDate,l=t.excludeDates,u=t.includeDates,c=t.filterDate,d=t.preSelection,p=t.disabledKeyboardNavigation,f=t.disabled,m=(a||s||l||u||c||f)&&kP(DI(n,e),r.props),h=r.getSelection();return Mp("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":m,"react-datepicker__quarter-text--selected":h?r.isSelectQuarterInList(n,e,h):void 0,"react-datepicker__quarter-text--keyboard-selected":!p&&d&&r.isSelectedQuarter(n,e,d)&&!r.isQuarterSelected()&&!m,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?EP(o,i,e,n):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(e),"react-datepicker__quarter-text--today":r.isCurrentQuarter(n,e)})},r.getMonthContent=function(e){var t=r.props,n=t.showFullMonthYearPicker,o=t.renderMonthContent,i=t.locale,a=t.day,s=yP(e,i),l=vP(e,i);return o?o(e,s,l,a):n?l:s},r.getQuarterContent=function(e){var t,n,o,i=r.props,a=i.renderQuarterContent,s=(n=e,o=i.locale,ZA(DI(YA(),n),"QQQ",o));return null!==(t=null==a?void 0:a(e,s))&&void 0!==t?t:s},r.renderMonths=function(){var e,t=r.props,o=t.showTwoColumnMonthYearPicker,i=t.showFourColumnMonthYearPicker,a=t.day,s=t.selected,l=null===(e=tD[nD(i,o)])||void 0===e?void 0:e.grid;return null==l?void 0:l.map(function(e,t){return n().createElement("div",{className:"react-datepicker__month-wrapper",key:t},e.map(function(e,t){return n().createElement("div",{ref:r.MONTH_REFS[e],key:t,onClick:function(t){r.onMonthClick(t,e)},onKeyDown:function(t){WP(t)&&(t.preventDefault(),t.key=UA.Enter),r.onMonthKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(e)}:void 0,tabIndex:Number(r.getTabIndex(e)),className:r.getMonthClassNames(e),"aria-disabled":r.isMonthDisabled(e),role:"option","aria-label":r.getAriaLabel(e),"aria-current":r.isCurrentMonth(a,e)?"date":void 0,"aria-selected":s?r.isSelectedMonth(a,e,s):void 0},r.getMonthContent(e))}))})},r.renderQuarters=function(){var e=r.props,t=e.day,o=e.selected;return n().createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(e,i){return n().createElement("div",{key:i,ref:r.QUARTER_REFS[i],role:"option",onClick:function(t){r.onQuarterClick(t,e)},onKeyDown:function(t){r.onQuarterKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(e)}:void 0,className:r.getQuarterClassNames(e),"aria-selected":o?r.isSelectedQuarter(t,e,o):void 0,tabIndex:Number(r.getQuarterTabIndex(e)),"aria-current":r.isCurrentQuarter(t,e)?"date":void 0},r.getQuarterContent(e))}))},r.getClassNames=function(){var e=r.props,t=e.selectingDate,n=e.selectsStart,o=e.selectsEnd;return Mp("react-datepicker__month",{"react-datepicker__month--selecting-range":t&&(n||o)},{"react-datepicker__monthPicker":e.showMonthYearPicker},{"react-datepicker__quarterPicker":e.showQuarterYearPicker},{"react-datepicker__weekPicker":e.showWeekPicker})},r}return QA(r,t),r.prototype.getSelection=function(){var e=this.props,t=e.selected,n=e.selectedDates;return e.selectsMultiple?n:t?[t]:void 0},r.prototype.render=function(){var e=this.props,t=e.showMonthYearPicker,r=e.showQuarterYearPicker,o=e.day,i=e.ariaLabelPrefix,a=void 0===i?"Month ":i,s=a?a.trim()+" ":"",l=XA(o)?"".concat(s).concat(ZA(o,"MMMM, yyyy",this.props.locale)):"";return t||r?n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":l,role:"listbox"},t?this.renderMonths():this.renderQuarters()):n().createElement("div",{role:"table"},this.props.dayNamesHeader&&n().createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":l,role:"rowgroup"},this.renderWeeks()))},r}(e.Component),oD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.monthOptionButtonsRef={},t.isSelectedMonth=function(e){return t.props.month===e},t.handleOptionKeyDown=function(e,n){var r;switch(n.key){case"Enter":n.preventDefault(),t.onChange(e);break;case"Escape":n.preventDefault(),t.props.onCancel();break;case"ArrowUp":case"ArrowDown":n.preventDefault();var o=(e+("ArrowUp"===n.key?-1:1)+t.props.monthNames.length)%t.props.monthNames.length;null===(r=t.monthOptionButtonsRef[o])||void 0===r||r.focus()}},t.renderOptions=function(){return t.monthOptionButtonsRef={},t.props.monthNames.map(function(e,r){return n().createElement("div",{ref:function(e){t.monthOptionButtonsRef[r]=e,t.isSelectedMonth(r)&&(null==e||e.focus())},role:"button",tabIndex:0,className:t.isSelectedMonth(r)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,r),onKeyDown:t.handleOptionKeyDown.bind(t,r),"aria-selected":t.isSelectedMonth(r)?"true":void 0},t.isSelectedMonth(r)?n().createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return QA(t,e),t.prototype.render=function(){return n().createElement(HA,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),iD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(e,t){return n().createElement("option",{key:e,value:t},e)})},t.renderSelectMode=function(e){return n().createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(e){return t.onChange(parseInt(e.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,r){return n().createElement("button",{key:"read",type:"button",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return n().createElement(oD,zA({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,r=[t.renderReadView(!n,e)];return n&&r.unshift(t.renderDropdown(e)),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return QA(t,e),t.prototype.render=function(){var e,t=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(e){return yP(e,t.props.locale)}:function(e){return vP(e,t.props.locale)});switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode(r);break;case"select":e=this.renderSelectMode(r)}return n().createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component);function aD(e,t){for(var n=[],r=rP(e),o=rP(t);!tT(r,o);)n.push(YA(r)),r=BI(r,1);return n}var sD=function(e){function t(t){var r=e.call(this,t)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(e){var t=oT(e),o=lP(r.props.date,e)&&uP(r.props.date,e);return n().createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:t,onClick:r.onChange.bind(r,t),"aria-selected":o?"true":void 0},o?n().createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",ZA(e,r.props.dateFormat,r.props.locale))})},r.onChange=function(e){return r.props.onChange(e)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:aD(r.props.minDate,r.props.maxDate)},r}return QA(t,e),t.prototype.render=function(){var e=Mp({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return n().createElement(HA,{className:e,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),lD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=rP(t.props.minDate),r=rP(t.props.maxDate),o=[];!tT(e,r);){var i=oT(e);o.push(n().createElement("option",{key:i,value:i},ZA(e,t.props.dateFormat,t.props.locale))),e=BI(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:oT(rP(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var r=ZA(t.props.date,t.props.dateFormat,t.props.locale);return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return n().createElement(sD,zA({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=YA(e);lP(t.props.date,n)&&uP(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return QA(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),uD=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,o;r.list&&(r.list.scrollTop=null!==(o=r.centerLi&&t.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-(null!==(n=null===(e=r.header)||void 0===e?void 0:e.clientHeight)&&void 0!==n?n:0):r.list.clientHeight,r.centerLi))&&void 0!==o?o:0)})},r.handleClick=function(e){var t,n;(r.props.minTime||r.props.maxTime)&&AP(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&TP(e,r.props)||null===(n=(t=r.props).onChange)||void 0===n||n.call(t,e)},r.isSelectedTime=function(e){return r.props.selected&&zP(r.props.selected,e)},r.isDisabledTime=function(e){return(r.props.minTime||r.props.maxTime)&&AP(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&TP(e,r.props)},r.liClasses=function(e){var n,o=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(e):void 0];return r.isSelectedTime(e)&&o.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(e)&&o.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(3600*NI(e)+60*FI(e)+VI(e))%(60*(null!==(n=r.props.intervals)&&void 0!==n?n:t.defaultProps.intervals))!=0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},r.handleOnKeyDown=function(e,t){var n,o;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),(e.key===UA.ArrowUp||e.key===UA.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===UA.ArrowDown||e.key===UA.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===UA.Enter&&r.handleClick(t),null===(o=(n=r.props).handleOnKeyDown)||void 0===o||o.call(n,e)},r.renderTimes=function(){for(var e,o=[],i="string"==typeof r.props.format?r.props.format:"p",a=null!==(e=r.props.intervals)&&void 0!==e?e:t.defaultProps.intervals,s=r.props.selected||r.props.openToDate||YA(),l=tP(s),u=r.props.injectTimes&&r.props.injectTimes.sort(function(e,t){return e.getTime()-t.getTime()}),c=60*function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}(s),d=c/a,p=0;p<d;p++){var f=JI(l,p*a);if(o.push(f),u){var m=VP(l,f,p,a,u);o=o.concat(m)}}var h=o.reduce(function(e,t){return t.getTime()<=s.getTime()?t:e},o[0]);return o.map(function(e){return n().createElement("li",{key:e.valueOf(),onClick:r.handleClick.bind(r,e),className:r.liClasses(e),ref:function(t){e===h&&(r.centerLi=t)},onKeyDown:function(t){r.handleOnKeyDown(t,e)},tabIndex:e===h?0:-1,role:"option","aria-selected":r.isSelectedTime(e)?"true":void 0,"aria-disabled":r.isDisabledTime(e)?"true":void 0},ZA(e,i,r.props.locale))})},r.renderTimeCaption=function(){return!1===r.props.showTimeCaption?n().createElement(n().Fragment,null):n().createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(e){r.header=e}},n().createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return QA(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var e=this,t=this.props.monthRef;this.updateContainerHeight(),t&&(this.resizeObserver=new ResizeObserver(function(){e.updateContainerHeight()}),this.resizeObserver.observe(t))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var e,r=this,o=this.state.height;return n().createElement("div",{className:"react-datepicker__time-container ".concat((null!==(e=this.props.todayButton)&&void 0!==e?e:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),n().createElement("div",{className:"react-datepicker__time"},n().createElement("div",{className:"react-datepicker__time-box"},n().createElement("ul",{className:"react-datepicker__time-list",ref:function(e){r.list=e},style:o?{height:o}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(e,t){return t.offsetTop-(e/2-t.clientHeight/2)},t}(e.Component),cD=function(t){function r(n){var r=t.call(this,n)||this;return r.YEAR_REFS=$A([],Array(r.props.yearItemNumber),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return bP(e,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var e;return null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection},r.updateFocusOnPaginate=function(e){window.requestAnimationFrame(function(){var t,n;null===(n=null===(t=r.YEAR_REFS[e])||void 0===t?void 0:t.current)||void 0===n||n.focus()})},r.handleYearClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleYearNavigation=function(e,t){var n,o,i,a,s=r.props,l=s.date,u=s.yearItemNumber;if(void 0!==l&&void 0!==u){var c=qP(l,u).startPeriod;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),e-c<0?r.updateFocusOnPaginate(u-(c-e)):e-c>=u?r.updateFocusOnPaginate(Math.abs(u-(e-c))):null===(a=null===(i=r.YEAR_REFS[e-c])||void 0===i?void 0:i.current)||void 0===a||a.focus())}},r.isSameDay=function(e,t){return dP(e,t)},r.isCurrentYear=function(e){return e===jI(YA())},r.isRangeStart=function(e){return r.props.startDate&&r.props.endDate&&lP(iT(YA(),e),r.props.startDate)},r.isRangeEnd=function(e){return r.props.startDate&&r.props.endDate&&lP(iT(YA(),e),r.props.endDate)},r.isInRange=function(e){return OP(e,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(e){var t=r.props,n=t.selectsStart,o=t.selectsEnd,i=t.selectsRange,a=t.startDate,s=t.endDate;return!(!(n||o||i)||!r.selectingDate())&&(n&&s?OP(e,r.selectingDate(),s):(o&&a||!(!i||!a||s))&&OP(e,a,r.selectingDate()))},r.isSelectingRangeStart=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.startDate,i=n.selectsStart;return lP(iT(YA(),e),i?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isSelectingRangeEnd=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.endDate,i=n.selectsEnd,a=n.selectsRange;return lP(iT(YA(),e),i||a?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isKeyboardSelected=function(e){if(!r.props.disabledKeyboardNavigation&&void 0!==r.props.date&&null!=r.props.preSelection){var t=r.props,n=t.minDate,o=t.maxDate,i=t.excludeDates,a=t.includeDates,s=t.filterDate,l=t.selected,u=oP(iT(r.props.date,e)),c=(n||o||i||a||s)&&_P(e,r.props),d=!!l&&dP(u,oP(l)),p=dP(u,oP(r.props.preSelection));return!r.props.inline&&!d&&p&&!c}},r.isSelectedYear=function(e){var t=r.props,n=t.selectsMultiple,o=t.selected,i=t.selectedDates;return n?null==i?void 0:i.some(function(t){return e===jI(t)}):!!o&&e===jI(o)},r.onYearClick=function(e,t){var n=r.props.date;void 0!==n&&r.handleYearClick(oP(iT(n,t)),e)},r.onYearKeyDown=function(e,t){var n,o,i=e.key,a=r.props,s=a.date,l=a.yearItemNumber,u=a.handleOnKeyDown;if(i!==UA.Tab&&e.preventDefault(),!r.props.disabledKeyboardNavigation)switch(i){case UA.Enter:if(null==r.props.selected)break;r.onYearClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case UA.ArrowRight:if(null==r.props.preSelection)break;r.handleYearNavigation(t+1,WI(r.props.preSelection,1));break;case UA.ArrowLeft:if(null==r.props.preSelection)break;r.handleYearNavigation(t-1,HI(r.props.preSelection,1));break;case UA.ArrowUp:if(void 0===s||void 0===l||null==r.props.preSelection)break;var c=qP(s,l).startPeriod;if((f=t-(p=3))<c){var d=l%p;t>=c&&t<c+d?p=d:p+=d,f=t-p}r.handleYearNavigation(f,HI(r.props.preSelection,p));break;case UA.ArrowDown:if(void 0===s||void 0===l||null==r.props.preSelection)break;var p,f,m=qP(s,l).endPeriod;(f=t+(p=3))>m&&(d=l%p,t<=m&&t>m-d?p=d:p+=d,f=t+p),r.handleYearNavigation(f,WI(r.props.preSelection,p))}u&&u(e)},r.getYearClassNames=function(e){var t=r.props,n=t.date,o=t.disabled,i=t.minDate,a=t.maxDate,s=t.excludeDates,l=t.includeDates,u=t.filterDate,c=t.yearClassName;return Mp("react-datepicker__year-text","react-datepicker__year-".concat(e),n?null==c?void 0:c(iT(n,e)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(e),"react-datepicker__year-text--disabled":(i||a||s||l||u||o)&&_P(e,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(e),"react-datepicker__year-text--range-start":r.isRangeStart(e),"react-datepicker__year-text--range-end":r.isRangeEnd(e),"react-datepicker__year-text--in-range":r.isInRange(e),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(e),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(e),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(e),"react-datepicker__year-text--today":r.isCurrentYear(e)})},r.getYearTabIndex=function(e){if(r.props.disabledKeyboardNavigation||null==r.props.preSelection)return"-1";var t=jI(r.props.preSelection),n=_P(e,r.props);return e!==t||n?"-1":"0"},r.getYearContent=function(e){return r.props.renderYearContent?r.props.renderYearContent(e):e},r}return QA(r,t),r.prototype.render=function(){var e=this,t=[],r=this.props,o=r.date,i=r.yearItemNumber,a=r.onYearMouseEnter,s=r.onYearMouseLeave;if(void 0===o)return null;for(var l=qP(o,i),u=l.startPeriod,c=l.endPeriod,d=function(r){t.push(n().createElement("div",{ref:p.YEAR_REFS[r-u],onClick:function(t){e.onYearClick(t,r)},onKeyDown:function(t){WP(t)&&(t.preventDefault(),t.key=UA.Enter),e.onYearKeyDown(t,r)},tabIndex:Number(p.getYearTabIndex(r)),className:p.getYearClassNames(r),onMouseEnter:p.props.usePointerEvent?void 0:function(e){return a(e,r)},onPointerEnter:p.props.usePointerEvent?function(e){return a(e,r)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(e){return s(e,r)},onPointerLeave:p.props.usePointerEvent?function(e){return s(e,r)}:void 0,key:r,"aria-current":p.isCurrentYear(r)?"date":void 0},p.getYearContent(r)))},p=this,f=u;f<=c;f++)d(f);return n().createElement("div",{className:"react-datepicker__year"},n().createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},t))},r}(e.Component);function dD(e,t,n,r){for(var o=[],i=0;i<2*t+1;i++){var a=e+t-i,s=!0;n&&(s=jI(n)<=a),r&&s&&(s=jI(r)>=a),s&&o.push(a)}return o}var pD=function(t){function r(r){var o=t.call(this,r)||this;o.yearOptionButtonsRef={},o.handleOptionKeyDown=function(e,t){var n;switch(t.key){case"Enter":t.preventDefault(),o.onChange(e);break;case"Escape":t.preventDefault(),o.props.onCancel();break;case"ArrowUp":case"ArrowDown":t.preventDefault();var r=e+("ArrowUp"===t.key?1:-1);o.yearOptionButtonsRef[r]&&(null===(n=o.yearOptionButtonsRef[r])||void 0===n||n.focus())}},o.renderOptions=function(){o.yearOptionButtonsRef={};var e=o.props.year,t=o.state.yearsList.map(function(t){return n().createElement("div",{ref:function(n){o.yearOptionButtonsRef[t]=n,t===e&&(null==n||n.focus())},role:"button",tabIndex:0,className:e===t?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:t,onClick:o.onChange.bind(o,t),onKeyDown:o.handleOptionKeyDown.bind(o,t),"aria-selected":e===t?"true":void 0},e===t?n().createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",t)}),r=o.props.minDate?jI(o.props.minDate):null,i=o.props.maxDate?jI(o.props.maxDate):null;return i&&o.state.yearsList.find(function(e){return e===i})||t.unshift(n().createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:o.incrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),r&&o.state.yearsList.find(function(e){return e===r})||t.push(n().createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:o.decrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),t},o.onChange=function(e){o.props.onChange(e)},o.handleClickOutside=function(){o.props.onCancel()},o.shiftYears=function(e){var t=o.state.yearsList.map(function(t){return t+e});o.setState({yearsList:t})},o.incrementYears=function(){return o.shiftYears(1)},o.decrementYears=function(){return o.shiftYears(-1)};var i=r.yearDropdownItemNumber,a=r.scrollableYearDropdown,s=i||(a?10:5);return o.state={yearsList:dD(o.props.year,s,o.props.minDate,o.props.maxDate)},o.dropdownRef=(0,e.createRef)(),o}return QA(r,t),r.prototype.componentDidMount=function(){var e=this.dropdownRef.current;if(e){var t=e.children?Array.from(e.children):null,n=t?t.find(function(e){return e.ariaSelected}):null;e.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-e.clientHeight)/2:(e.scrollHeight-e.clientHeight)/2}},r.prototype.render=function(){var e=Mp({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return n().createElement(HA,{className:e,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(e.Component),fD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?jI(t.props.minDate):1900,r=t.props.maxDate?jI(t.props.maxDate):2100,o=[],i=e;i<=r;i++)o.push(n().createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return n().createElement("button",{key:"read",type:"button",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return n().createElement(pD,zA({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var r;null===(r=t.onSelect)||void 0===r||r.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var r,o;null===(o=(r=t.props).onSelect)||void 0===o||o.call(r,e,n)},t.setOpen=function(){var e,n;null===(n=(e=t.props).setOpen)||void 0===n||n.call(e,!0)},t}return QA(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),mD=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],hD="react-datepicker-ignore-onclickoutside",vD=function(t){function r(o){var i=t.call(this,o)||this;return i.monthContainer=void 0,i.handleClickOutside=function(e){i.props.onClickOutside(e)},i.setClickOutsideRef=function(){return i.containerRef.current},i.handleDropdownFocus=function(e){var t,n,r,o;r=e.target,o=(r.className||"").split(/\s+/),mD.some(function(e){return o.indexOf(e)>=0})&&(null===(n=(t=i.props).onDropdownFocus)||void 0===n||n.call(t,e))},i.getDateInView=function(){var e=i.props,t=e.preSelection,n=e.selected,r=e.openToDate,o=MP(i.props),a=LP(i.props),s=YA();return r||n||t||(o&&xI(s,o)?o:a&&tT(s,a)?a:s)},i.increaseMonth=function(){i.setState(function(e){return{date:BI(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.decreaseMonth=function(){i.setState(function(e){return{date:qI(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.handleDayClick=function(e,t,n){i.props.onSelect(e,t,n),i.props.setPreSelection&&i.props.setPreSelection(e)},i.handleDayMouseEnter=function(e){i.setState({selectingDate:e}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(e)},i.handleMonthMouseLeave=function(){i.setState({selectingDate:void 0}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()},i.handleYearMouseEnter=function(e,t){i.setState({selectingDate:iT(YA(),t)}),i.props.onYearMouseEnter&&i.props.onYearMouseEnter(e,t)},i.handleYearMouseLeave=function(e,t){i.props.onYearMouseLeave&&i.props.onYearMouseLeave(e,t)},i.handleYearChange=function(e){var t,n,r,o;null===(n=(t=i.props).onYearChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0}),i.props.adjustDateOnChange&&(i.props.onSelect(e),null===(o=(r=i.props).setOpen)||void 0===o||o.call(r,!0)),i.props.setPreSelection&&i.props.setPreSelection(e)},i.getEnabledPreSelectionDateForMonth=function(e){if(!gP(e,i.props))return e;for(var t=rP(e),n=function(e,t,n){const[r,o]=Oa(n?.in,e,t),i=aT(r,o),a=Math.abs(Ea(r,o));r.setDate(r.getDate()-i*a);const s=i*(a-Number(aT(r,o)===-i));return 0===s?0:s}(function(e){return TI(e)}(e),t),r=null,o=0;o<=n;o++){var a=da(t,o);if(!gP(a,i.props)){r=a;break}}return r},i.handleMonthChange=function(e){var t,n,r,o=null!==(t=i.getEnabledPreSelectionDateForMonth(e))&&void 0!==t?t:e;i.handleCustomMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect(o),null===(r=(n=i.props).setOpen)||void 0===r||r.call(n,!0)),i.props.setPreSelection&&i.props.setPreSelection(o)},i.handleCustomMonthChange=function(e){var t,n;null===(n=(t=i.props).onMonthChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0})},i.handleMonthYearChange=function(e){i.handleYearChange(e),i.handleMonthChange(e)},i.changeYear=function(e){i.setState(function(t){return{date:iT(t.date,Number(e))}},function(){return i.handleYearChange(i.state.date)})},i.changeMonth=function(e){i.setState(function(t){return{date:PI(t.date,Number(e))}},function(){return i.handleMonthChange(i.state.date)})},i.changeMonthYear=function(e){i.setState(function(t){return{date:iT(PI(t.date,RI(e)),jI(e))}},function(){return i.handleMonthYearChange(i.state.date)})},i.header=function(e){if(void 0===e&&(e=i.state.date),!XA(e))return[];var t=i.props.disabled,r=nP(e,i.props.locale,i.props.calendarStartDay),o=[];return i.props.showWeekNumbers&&o.push(n().createElement("div",{key:"W",className:"react-datepicker__day-name ".concat(t?"react-datepicker__day-name--disabled":""),role:"columnheader"},n().createElement("span",{className:"react-datepicker__sr-only"},"Week number"),n().createElement("span",{"aria-hidden":"true"},i.props.weekLabel||"#"))),o.concat([0,1,2,3,4,5,6].map(function(e){var o=da(r,e),a=i.formatWeekday(o,i.props.locale),s=i.props.weekDayClassName?i.props.weekDayClassName(o):void 0;return n().createElement("div",{key:e,role:"columnheader",className:Mp("react-datepicker__day-name",s,t?"react-datepicker__day-name--disabled":"")},n().createElement("span",{className:"react-datepicker__sr-only"},ZA(o,"EEEE",i.props.locale)),n().createElement("span",{"aria-hidden":"true"},a))}))},i.formatWeekday=function(e,t){return i.props.formatWeekDay?function(e,t,n){return t(ZA(e,"EEEE",n))}(e,i.props.formatWeekDay,t):i.props.useWeekdaysShort?function(e,t){return ZA(e,"EEE",t)}(e,t):function(e,t){return ZA(e,"EEEEEE",t)}(e,t)},i.decreaseYear=function(){i.setState(function(e){var t;return{date:HI(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.clearSelectingDate=function(){i.setState({selectingDate:void 0})},i.renderPreviousButton=function(){var e,t,o;if(!i.props.renderCustomHeader){var a,s=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,l=i.props.showPreviousMonths?s-1:0,u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:l,c=qI(i.state.date,u);switch(!0){case i.props.disabled:a=!0;break;case i.props.showMonthYearPicker:a=jP(i.state.date,i.props);break;case i.props.showYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.yearItemNumber,i=void 0===o?12:o,a=qP(oP(HI(e,i)),i).endPeriod,s=r&&jI(r);return s&&s>a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=$I(Ca(e),1);return r&&UI(r,i)>0||o&&o.every(function(e){return UI(e,i)>0})||!1}(i.state.date,i.props);break;default:a=PP(c,i.props)}if(((null!==(o=i.props.forceShowMonthNavigation)&&void 0!==o?o:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!a)&&!i.props.showTimeSelectOnly){var d=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(p=i.decreaseYear),a&&i.props.showDisabledMonthNavigation&&(d.push("react-datepicker__navigation--previous--disabled"),p=void 0);var f=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,m=i.props,h=m.previousMonthButtonLabel,v=void 0===h?r.defaultProps.previousMonthButtonLabel:h,y=m.previousYearButtonLabel,g=void 0===y?r.defaultProps.previousYearButtonLabel:y,b=i.props,w=b.previousMonthAriaLabel,S=void 0===w?"string"==typeof v?v:"Previous Month":w,x=b.previousYearAriaLabel,k=void 0===x?"string"==typeof g?g:"Previous Year":x;return n().createElement("button",{type:"button",className:d.join(" "),onClick:p,onKeyDown:i.props.handleOnKeyDown,"aria-label":f?k:S},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},f?g:v))}}},i.increaseYear=function(){i.setState(function(e){var t;return{date:WI(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.renderNextButton=function(){var e;if(!i.props.renderCustomHeader){var t;switch(!0){case i.props.disabled:t=!0;break;case i.props.showMonthYearPicker:t=RP(i.state.date,i.props);break;case i.props.showYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.yearItemNumber,i=void 0===o?12:o,a=qP(WI(e,i),i).startPeriod,s=r&&jI(r);return s&&s<a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=zI(MI(e),1);return r&&UI(i,r)>0||o&&o.every(function(e){return UI(i,e)>0})||!1}(i.state.date,i.props);break;default:t=DP(i.state.date,i.props)}if(((null!==(e=i.props.forceShowMonthNavigation)&&void 0!==e?e:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!t)&&!i.props.showTimeSelectOnly){var o=["react-datepicker__navigation","react-datepicker__navigation--next"];i.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),i.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var a=i.increaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.increaseYear),t&&i.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),a=void 0);var s=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,l=i.props,u=l.nextMonthButtonLabel,c=void 0===u?r.defaultProps.nextMonthButtonLabel:u,d=l.nextYearButtonLabel,p=void 0===d?r.defaultProps.nextYearButtonLabel:d,f=i.props,m=f.nextMonthAriaLabel,h=void 0===m?"string"==typeof c?c:"Next Month":m,v=f.nextYearAriaLabel,y=void 0===v?"string"==typeof p?p:"Next Year":v;return n().createElement("button",{type:"button",className:o.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":s?y:h},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"].join(" ")},s?p:c))}}},i.renderCurrentMonth=function(e){void 0===e&&(e=i.state.date);var t=["react-datepicker__current-month"];return i.props.showYearDropdown&&t.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&t.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&t.push("react-datepicker__current-month--hasMonthYearDropdown"),n().createElement("h2",{className:t.join(" ")},XA(e)?ZA(e,i.props.dateFormat,i.props.locale):"")},i.renderYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showYearDropdown&&!e)return n().createElement(fD,zA({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeYear,year:jI(i.state.date)}))},i.renderMonthDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthDropdown&&!e)return n().createElement(iD,zA({},r.defaultProps,i.props,{month:RI(i.state.date),onChange:i.changeMonth}))},i.renderMonthYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthYearDropdown&&!e)return n().createElement(lD,zA({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeMonthYear}))},i.handleTodayButtonClick=function(e){i.props.onSelect(aP(),e),i.props.setPreSelection&&i.props.setPreSelection(aP())},i.renderTodayButton=function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return n().createElement("div",{className:"react-datepicker__today-button",onClick:i.handleTodayButtonClick},i.props.todayButton)},i.renderDayNamesHeader=function(e){return n().createElement("div",{className:"react-datepicker__day-names",role:"row"},i.header(e))},i.renderDefaultHeader=function(e){var t=e.monthDate,r=e.i;return n().createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(t),n().createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(0!==r),i.renderMonthYearDropdown(0!==r),i.renderYearDropdown(0!==r)))},i.renderCustomHeader=function(e){var t,r,o=e.monthDate,a=e.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var s,l=i.props,u=l.showYearPicker,c=l.yearItemNumber;if(u){var d=qP(o,c);s={startYear:d.startPeriod,endYear:d.endPeriod}}var p=PP(i.state.date,i.props),f=DP(i.state.date,i.props),m=jP(i.state.date,i.props),h=RP(i.state.date,i.props);return n().createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},null===(r=(t=i.props).renderCustomHeader)||void 0===r?void 0:r.call(t,zA(zA(zA({},i.state),u&&{visibleYearsRange:s}),{customHeaderCount:a,monthDate:o,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:p,nextMonthButtonDisabled:f,prevYearButtonDisabled:m,nextYearButtonDisabled:h})))},i.renderYearHeader=function(e){var t=e.monthDate,o=i.props,a=o.showYearPicker,s=o.yearItemNumber,l=qP(t,void 0===s?r.defaultProps.yearItemNumber:s),u=l.startPeriod,c=l.endPeriod;return n().createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(u," - ").concat(c):jI(t))},i.renderHeader=function(e){var t=e.monthDate,n=e.i,r={monthDate:t,i:void 0===n?0:n};switch(!0){case void 0!==i.props.renderCustomHeader:return i.renderCustomHeader(r);case i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker:return i.renderYearHeader(r);default:return i.renderDefaultHeader(r)}},i.renderMonths=function(){var e,t;if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],a=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,s=i.props.showPreviousMonths?a-1:0,l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?WI(i.state.date,s):qI(i.state.date,s),u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:s,c=0;c<a;++c){var d=c-u+s,p=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?WI(l,d):BI(l,d),f="month-".concat(c),m=c<a-1,h=c>0;o.push(n().createElement("div",{key:f,ref:function(e){i.monthContainer=null!=e?e:void 0},className:"react-datepicker__month-container"},i.renderHeader({monthDate:p,i:c}),n().createElement(rD,zA({},r.defaultProps,i.props,{containerRef:i.containerRef,ariaLabelPrefix:i.props.monthAriaLabelPrefix,day:p,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,handleOnMonthKeyDown:i.props.handleOnKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,orderInDisplay:c,selectingDate:i.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:h,dayNamesHeader:i.renderDayNamesHeader(p)}))))}return o}},i.renderYears=function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?n().createElement("div",{className:"react-datepicker__year--container"},i.renderHeader({monthDate:i.state.date}),n().createElement(cD,zA({},r.defaultProps,i.props,{selectingDate:i.state.selectingDate,date:i.state.date,onDayClick:i.handleDayClick,clearSelectingDate:i.clearSelectingDate,onYearMouseEnter:i.handleYearMouseEnter,onYearMouseLeave:i.handleYearMouseLeave}))):void 0},i.renderTimeSection=function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return n().createElement(uD,zA({},r.defaultProps,i.props,{onChange:i.props.onTimeChange,format:i.props.timeFormat,intervals:i.props.timeIntervals,monthRef:i.state.monthContainer}))},i.renderInputTimeSection=function(){var e=i.props.selected?new Date(i.props.selected):void 0,t=e&&XA(e)&&Boolean(i.props.selected)?"".concat(BP(e.getHours()),":").concat(BP(e.getMinutes())):"";if(i.props.showTimeInput)return n().createElement(GP,zA({},r.defaultProps,i.props,{date:e,timeString:t,onChange:i.props.onTimeChange}))},i.renderAriaLiveRegion=function(){var e;if(!XA(i.state.date))return n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"});var t,o=qP(i.state.date,null!==(e=i.props.yearItemNumber)&&void 0!==e?e:r.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod;return t=i.props.showYearPicker?"".concat(a," - ").concat(s):i.props.showMonthYearPicker||i.props.showQuarterYearPicker?jI(i.state.date):"".concat(vP(RI(i.state.date),i.props.locale)," ").concat(jI(i.state.date)),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},i.state.isRenderAriaLiveMessage&&t)},i.renderChildren=function(){if(i.props.children)return n().createElement("div",{className:"react-datepicker__children-container"},i.props.children)},i.containerRef=(0,e.createRef)(),i.state={date:i.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},i}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:hD,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:12}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.props.showTimeSelect&&(this.assignMonthContainer=void this.setState({monthContainer:this.monthContainer}))},r.prototype.componentDidUpdate=function(e){var t=this;if(!this.props.preSelection||!XA(this.props.preSelection)||dP(this.props.preSelection,e.preSelection)&&this.props.monthSelectedIn===e.monthSelectedIn)this.props.openToDate&&!dP(this.props.openToDate,e.openToDate)&&this.setState({date:this.props.openToDate});else{var n=!uP(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&t.handleCustomMonthChange(t.state.date)})}},r.prototype.render=function(){var e=this.props.container||WA;return n().createElement(HA,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},n().createElement("div",{style:{display:"contents"},ref:this.containerRef},n().createElement(e,{className:Mp("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},r}(e.Component),yD=function(e){var t=e.icon,r=e.className,o=void 0===r?"":r,i=e.onClick,a="react-datepicker__calendar-icon";if("string"==typeof t)return n().createElement("i",{className:"".concat(a," ").concat(t," ").concat(o),"aria-hidden":"true",onClick:i});if(n().isValidElement(t)){var s=t;return n().cloneElement(s,{className:"".concat(s.props.className||""," ").concat(a," ").concat(o),onClick:function(e){"function"==typeof s.props.onClick&&s.props.onClick(e),"function"==typeof i&&i(e)}})}return n().createElement("svg",{className:"".concat(a," ").concat(o),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},n().createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},gD=function(e){function t(t){var n=e.call(this,t)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return QA(t,e),t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Gb().createPortal(this.props.children,this.el)},t}(e.Component),bD=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&-1!==e.tabIndex},wD=function(t){function r(n){var r=t.call(this,n)||this;return r.getTabChildren=function(){var e;return Array.prototype.slice.call(null===(e=r.tabLoopRef.current)||void 0===e?void 0:e.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(bD)},r.handleFocusStart=function(){var e=r.getTabChildren();e&&e.length>1&&e[e.length-1].focus()},r.handleFocusEnd=function(){var e=r.getTabChildren();e&&e.length>1&&e[0].focus()},r.tabLoopRef=(0,e.createRef)(),r}return QA(r,t),r.prototype.render=function(){var e;return(null!==(e=this.props.enableTabLoop)&&void 0!==e?e:r.defaultProps.enableTabLoop)?n().createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},n().createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,n().createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(e.Component),SD=function(t){function r(r){var o,i="boolean"!=typeof r.hidePopper||r.hidePopper,a=(0,e.useRef)(null),s=BA(zA({open:!i,whileElementsMounted:bA,placement:r.popperPlacement,middleware:$A([TA({padding:15}),IA(10),AA({element:a})],null!==(o=r.popperModifiers)&&void 0!==o?o:[],!0)},r.popperProps)),l=zA(zA({},r),{hidePopper:i,popperProps:zA(zA({},s),{arrowRef:a})});return n().createElement(t,zA({},l))}return r.displayName="withFloating(".concat(t.displayName||t.name||"Component",")"),r}(function(t){var r=t.className,o=t.wrapperClassName,i=t.hidePopper,a=void 0===i||i,s=t.popperComponent,l=t.targetComponent,u=t.enableTabLoop,c=t.popperOnKeyDown,d=t.portalId,p=t.portalHost,f=t.popperProps,m=t.showArrow,h=void 0;if(!a){var v=Mp("react-datepicker-popper",r);h=n().createElement(wD,{enableTabLoop:u},n().createElement("div",{ref:f.refs.setFloating,style:f.floatingStyles,className:v,"data-placement":f.placement,onKeyDown:c},s,m&&n().createElement(LA,{ref:f.arrowRef,context:f.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}t.popperContainer&&(h=(0,e.createElement)(t.popperContainer,{},h)),d&&!a&&(h=n().createElement(gD,{portalId:d,portalHost:p},h));var y=Mp("react-datepicker-wrapper",o);return n().createElement(n().Fragment,null,n().createElement("div",{ref:f.refs.setReference,className:y},l),h)}),xD="Date input not valid.",kD=function(t){function r(o){var i=t.call(this,o)||this;return i.calendar=null,i.input=null,i.getPreSelection=function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:YA()},i.modifyHolidays=function(){var e;return null===(e=i.props.holidays)||void 0===e?void 0:e.reduce(function(e,t){var n=new Date(t.date);return XA(n)?$A($A([],e,!0),[zA(zA({},t),{date:n})],!1):e},[])},i.calcInitialState=function(){var e,t=i.getPreSelection(),n=MP(i.props),r=LP(i.props),o=n&&xI(t,tP(n))?n:r&&tT(t,sP(r))?r:t;return{open:i.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:null!==(e=i.props.selectsRange?i.props.startDate:i.props.selected)&&void 0!==e?e:o,highlightDates:NP(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},i.getInputValue=function(){var e,t=i.props,n=t.locale,o=t.startDate,a=t.endDate,s=t.rangeSeparator,l=t.selected,u=t.selectedDates,c=t.selectsMultiple,d=t.selectsRange,p=t.value,f=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,m=i.state.inputValue;return"string"==typeof p?p:"string"==typeof m?m:d?function(e,t,n){if(!e&&!t)return"";var r=e?JA(e,n):"",o=t?JA(t,n):"",i=n.rangeSeparator||" - ";return"".concat(r).concat(i).concat(o)}(o,a,{dateFormat:f,locale:n,rangeSeparator:s}):c?function(e,t){if(!(null==e?void 0:e.length))return"";var n=e[0]?JA(e[0],t):"";if(1===e.length)return n;if(2===e.length&&e[1]){var r=JA(e[1],t);return"".concat(n,", ").concat(r)}var o=e.length-1;return"".concat(n," (+").concat(o,")")}(null!=u?u:[],{dateFormat:f,locale:n}):JA(l,{dateFormat:f,locale:n})},i.resetHiddenStatus=function(){i.setState(zA(zA({},i.state),{wasHidden:!1}))},i.setHiddenStatus=function(){i.setState(zA(zA({},i.state),{wasHidden:!0}))},i.setHiddenStateOnVisibilityHidden=function(){"hidden"===document.visibilityState&&i.setHiddenStatus()},i.clearPreventFocusTimeout=function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)},i.setFocus=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.focus)||void 0===t||t.call(e,{preventScroll:!0})},i.setBlur=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.blur)||void 0===t||t.call(e),i.cancelFocusInput()},i.deferBlur=function(){requestAnimationFrame(function(){i.setBlur()})},i.setOpen=function(e,t){void 0===t&&(t=!1),i.setState({open:e,preSelection:e&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:_D},function(){e||i.setState(function(e){return{focused:!!t&&e.focused}},function(){!t&&i.deferBlur(),i.setState({inputValue:null})})})},i.inputOk=function(){return Uo(i.state.preSelection)},i.isCalendarOpen=function(){return void 0===i.props.open?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open},i.handleFocus=function(e){var t,n,r=i.state.wasHidden,o=!r||i.state.open;r&&i.resetHiddenStatus(),i.state.preventFocus||(null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e),!o||i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})},i.sendFocusBackToInput=function(){i.preventFocusTimeout&&i.clearPreventFocusTimeout(),i.setState({preventFocus:!0},function(){i.preventFocusTimeout=setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})})},i.cancelFocusInput=function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=void 0},i.deferFocusInput=function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)},i.handleDropdownFocus=function(){i.cancelFocusInput()},i.resetInputValue=function(){i.setState(zA(zA({},i.state),{inputValue:null}))},i.handleBlur=function(e){var t,n;(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&(null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)),i.resetInputValue(),i.state.open&&!1===i.props.open&&i.setOpen(!1),i.setState({focused:!1})},i.handleCalendarClickOutside=function(e){var t,n;i.props.inline||i.setOpen(!1),null===(n=(t=i.props).onClickOutside)||void 0===n||n.call(t,e),i.props.withPortal&&e.preventDefault()},i.handleChange=function(){for(var e,t,n,o,a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=s[0];if(!i.props.onChangeRaw||(i.props.onChangeRaw.apply(i,s),u&&"function"==typeof u.isDefaultPrevented&&!u.isDefaultPrevented())){i.setState({inputValue:(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:null,lastPreSelectChange:OD});var c=i.props,d=c.selectsRange,p=c.startDate,f=c.endDate,m=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,h=null!==(t=i.props.strictParsing)&&void 0!==t?t:r.defaultProps.strictParsing,v=(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:"";if(d){var y=i.props.rangeSeparator,g=y.trim(),b=v.split(m.includes(g)?y:g,2).map(function(e){return e.trim()}),w=b[0],S=b[1],x=KA(null!=w?w:"",m,i.props.locale,h),k=x?KA(null!=S?S:"",m,i.props.locale,h):null,O=(null==p?void 0:p.getTime())!==(null==x?void 0:x.getTime()),_=(null==f?void 0:f.getTime())!==(null==k?void 0:k.getTime());if(!O&&!_)return;if(x&&gP(x,i.props))return;if(k&&gP(k,i.props))return;null===(o=(n=i.props).onChange)||void 0===o||o.call(n,[x,k],u)}else{var E=KA(v,m,i.props.locale,h,null!==(a=i.props.selected)&&void 0!==a?a:void 0);!E&&v||i.setSelected(E,u,!0)}}},i.handleSelect=function(e,t,n){var o;if(!i.props.readOnly){var a=i.props,s=a.selectsRange,l=a.startDate,u=a.endDate,c=a.locale,d=a.swapRange,p=null!==(o=i.props.dateFormat)&&void 0!==o?o:r.defaultProps.dateFormat,f=!s||l&&!u&&(d||!UP(e,l));if(i.props.shouldCloseOnSelect&&!i.props.showTimeSelect&&f&&i.sendFocusBackToInput(),i.props.onChangeRaw){var m=JA(e,{dateFormat:p,locale:c});i.props.onChangeRaw(t,{date:e,formattedDate:m})}i.setSelected(e,t,!1,n),i.props.showDateSelect&&i.setState({isRenderAriaLiveMessage:!0}),!i.props.shouldCloseOnSelect||i.props.showTimeSelect?i.setPreSelection(e):f&&i.setOpen(!1)}},i.setSelected=function(e,t,n,r){var o,a,s=e;if(i.props.showYearPicker){if(null!==s&&_P(jI(s),i.props))return}else if(i.props.showMonthYearPicker){if(null!==s&&wP(s,i.props))return}else if(null!==s&&gP(s,i.props))return;var l=i.props,u=l.onChange,c=l.selectsRange,d=l.startDate,p=l.endDate,f=l.selectsMultiple,m=l.selectedDates,h=l.minTime,v=l.swapRange;if(!pP(i.props.selected,s)||i.props.allowSameDay||c||f)if(null!==s&&(!i.props.selected||n&&(i.props.showTimeSelect||i.props.showTimeSelectOnly||i.props.showTimeInput)||(s=eP(s,{hour:NI(i.props.selected),minute:FI(i.props.selected),second:VI(i.props.selected)})),n||!i.props.showTimeSelect&&!i.props.showTimeSelectOnly||h&&(s=eP(s,{hour:h.getHours(),minute:h.getMinutes(),second:h.getSeconds()})),i.props.inline||i.setState({preSelection:s}),i.props.focusSelectedMonth||i.setState({monthSelectedIn:r})),c){var y=!d&&!!p,g=d&&p;d||p?d&&!p?null===s?null==u||u([null,null],t):UP(s,d)?v?null==u||u([s,d],t):null==u||u([s,null],t):null==u||u([d,s],t):y&&(s&&UP(s,p)?null==u||u([s,p],t):null==u||u([s,null],t)):null==u||u([s,null],t),g&&(null==u||u([s,null],t))}else if(f){if(null!==s)if(null==m?void 0:m.length)if(m.some(function(e){return dP(e,s)})){var b=m.filter(function(e){return!dP(e,s)});null==u||u(b,t)}else null==u||u($A($A([],m,!0),[s],!1),t);else null==u||u([s],t)}else null==u||u(s,t);n||(null===(a=(o=i.props).onSelect)||void 0===a||a.call(o,s,t),i.setState({inputValue:null}))},i.setPreSelection=function(e){if(!i.props.readOnly){var t=Uo(i.props.minDate),n=Uo(i.props.maxDate),r=!0;if(e){var o=tP(e);if(t&&n)r=fP(e,i.props.minDate,i.props.maxDate);else if(t){var a=tP(i.props.minDate);r=tT(e,a)||pP(o,a)}else if(n){var s=sP(i.props.maxDate);r=xI(e,s)||pP(o,s)}}r&&i.setState({preSelection:e})}},i.toggleCalendar=function(){i.setOpen(!i.state.open)},i.handleTimeChange=function(e){var t,n;if(!i.props.selectsRange&&!i.props.selectsMultiple){var r=i.props.selected?i.props.selected:i.getPreSelection(),o=i.props.selected?e:eP(r,{hour:NI(e),minute:FI(e)});i.setState({preSelection:o}),null===(n=(t=i.props).onChange)||void 0===n||n.call(t,o),i.props.shouldCloseOnSelect&&!i.props.showTimeInput&&(i.sendFocusBackToInput(),i.setOpen(!1)),i.props.showTimeInput&&i.setOpen(!0),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),i.setState({inputValue:null})}},i.onInputClick=function(){var e,t;i.props.disabled||i.props.readOnly||i.setOpen(!0),null===(t=(e=i.props).onInputClick)||void 0===t||t.call(e)},i.handleTimeOnlyArrowKey=function(e){var t,n,o,a,s,l=i.props.selected||i.state.preSelection||YA(),u=null!==(t=i.props.timeIntervals)&&void 0!==t?t:30,c=null!==(n=i.props.dateFormat)&&void 0!==n?n:r.defaultProps.dateFormat,d=Array.isArray(c)?c[0]:c,p=tP(l),f=60*NI(l)+FI(l),m=1440-u;if(e===UA.ArrowUp){var h=Math.max(0,f-u);s=JI(p,h)}else h=Math.min(m,f+u),s=JI(p,h);var v=ZA(s,d||r.defaultProps.dateFormat,i.props.locale);if(i.setState({preSelection:s,inputValue:v}),!i.props.selectsRange&&!i.props.selectsMultiple){var y=i.props.selected?i.props.selected:i.getPreSelection(),g=i.props.selected?s:eP(y,{hour:NI(s),minute:FI(s)});null===(a=(o=i.props).onChange)||void 0===a||a.call(o,g),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){i.scrollToTimeOption(s)})}},i.handleTimeOnlyEnterKey=function(e){var t,n,o,a,s=e.target.value,l=null!==(t=i.props.dateFormat)&&void 0!==t?t:r.defaultProps.dateFormat,u=i.props.timeFormat||"p",c=i.state.preSelection||i.props.selected||YA(),d=KA(s,l,i.props.locale,null!==(n=i.props.strictParsing)&&void 0!==n&&n,c),p=c;if(d&&XA(d))p=d;else{var f=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");if(f instanceof HTMLElement){var m=null===(a=f.textContent)||void 0===a?void 0:a.trim();if(m){var h=KA(m,u,i.props.locale,!1,c);h&&XA(h)&&(p=h)}}}i.handleTimeChange(p),i.setOpen(!1),i.sendFocusBackToInput()},i.scrollToTimeOption=function(e){var t,n;if(null===(t=i.calendar)||void 0===t?void 0:t.containerRef.current){for(var r=i.calendar.containerRef.current,o=Array.from(r.querySelectorAll(".react-datepicker__time-list-item")),a=null,s=1/0,l=i.props.timeFormat||"p",u=0,c=o;u<c.length;u++){var d=c[u],p=null===(n=d.textContent)||void 0===n?void 0:n.trim();if(p){var f=KA(p,l,i.props.locale,!1,e);if(f&&XA(f)){if(zP(f,e)){a=d;break}var m=Math.abs(f.getTime()-e.getTime());m<s&&(s=m,a=d)}}}a&&(o.forEach(function(e){e.setAttribute("tabindex","-1")}),a.setAttribute("tabindex","0"),a.scrollIntoView({behavior:"smooth",block:"center"}))}},i.onInputKeyDown=function(e){var t,n,r,o,a,s;null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e);var l=e.key;if(i.state.open||i.props.inline||i.props.preventOpenOnFocus){if(i.state.open&&i.props.showTimeSelectOnly){if(l===UA.ArrowDown||l===UA.ArrowUp)return e.preventDefault(),void i.handleTimeOnlyArrowKey(l);if(l===UA.Enter)return e.preventDefault(),void i.handleTimeOnlyEnterKey(e)}if(i.state.open){if(l===UA.ArrowDown||l===UA.ArrowUp){e.preventDefault();var u=i.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":i.props.showWeekPicker&&i.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':i.props.showFullMonthYearPicker||i.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',c=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(u);return void(c instanceof HTMLElement&&c.focus({preventScroll:!0}))}var d=YA(i.state.preSelection);l===UA.Enter?(e.preventDefault(),e.target.blur(),i.inputOk()&&i.state.lastPreSelectChange===_D?(i.handleSelect(d,e),!i.props.shouldCloseOnSelect&&i.setPreSelection(d)):i.setOpen(!1)):l===UA.Escape?(e.preventDefault(),e.target.blur(),i.sendFocusBackToInput(),i.setOpen(!1)):l===UA.Tab&&i.setOpen(!1),i.inputOk()||null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:xD})}}else l!==UA.ArrowDown&&l!==UA.ArrowUp&&l!==UA.Enter||null===(r=i.onInputClick)||void 0===r||r.call(i)},i.onPortalKeyDown=function(e){e.key===UA.Escape&&(e.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))},i.onDayKeyDown=function(e){var t,n,r,o,a,s,l=i.props,u=l.minDate,c=l.maxDate,d=l.disabledKeyboardNavigation,p=l.showWeekPicker,f=l.shouldCloseOnSelect,m=l.locale,h=l.calendarStartDay,v=l.adjustDateOnChange,y=l.inline;if(null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e),!d){var g=e.key,b=e.shiftKey,w=YA(i.state.preSelection),S=function(e,t){var n=t;switch(e){case UA.ArrowRight:n=p?rT(t,1):da(t,1);break;case UA.ArrowLeft:n=p?sT(t,1):function(e,t,n){return da(e,-t,n)}(t,1);break;case UA.ArrowUp:n=sT(t,1);break;case UA.ArrowDown:n=rT(t,1);break;case UA.PageUp:n=b?HI(t,1):qI(t,1);break;case UA.PageDown:n=b?WI(t,1):BI(t,1);break;case UA.Home:n=nP(t,m,h);break;case UA.End:n=function(e){return function(e,t){const n=bi(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Xo(e,t?.in),i=o.getDay(),a=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}(e)}(t)}return n};if(g===UA.Enter)return e.preventDefault(),i.handleSelect(w,e),void(!f&&i.setPreSelection(w));if(g===UA.Escape)return e.preventDefault(),i.setOpen(!1),void(i.inputOk()||null===(o=(r=i.props).onInputError)||void 0===o||o.call(r,{code:1,msg:xD}));var x=null;switch(g){case UA.ArrowLeft:case UA.ArrowRight:case UA.ArrowUp:case UA.ArrowDown:case UA.PageUp:case UA.PageDown:case UA.Home:case UA.End:x=function(e,t){for(var n=e,r=!1,o=0,a=S(e,t);!r;){if(o>=40){a=t;break}u&&a<u&&(n=UA.ArrowRight,a=gP(u,i.props)?S(n,a):u),c&&a>c&&(n=UA.ArrowLeft,a=gP(c,i.props)?S(n,a):c),gP(a,i.props)?(n!==UA.PageUp&&n!==UA.Home||(n=UA.ArrowRight),n!==UA.PageDown&&n!==UA.End||(n=UA.ArrowLeft),a=S(n,a)):r=!0,o++}return a}(g,w)}x?(e.preventDefault(),i.setState({lastPreSelectChange:_D}),v&&i.setSelected(x),i.setPreSelection(x),y&&i.setState({shouldFocusDayInline:!0})):null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:xD})}},i.onPopperKeyDown=function(e){e.key===UA.Escape&&(e.preventDefault(),i.sendFocusBackToInput(),i.setOpen(!1))},i.onClearClick=function(e){e&&e.preventDefault&&e.preventDefault(),i.sendFocusBackToInput();var t=i.props,n=t.selectsRange,r=t.onChange;n?null==r||r([null,null],e):null==r||r(null,e),i.setState({inputValue:null})},i.clear=function(){i.onClearClick()},i.onScroll=function(e){"boolean"==typeof i.props.closeOnScroll&&i.props.closeOnScroll?e.target!==document&&e.target!==document.documentElement&&e.target!==document.body||i.setOpen(!1):"function"==typeof i.props.closeOnScroll&&i.props.closeOnScroll(e)&&i.setOpen(!1)},i.renderCalendar=function(){var e,t;return i.props.inline||i.isCalendarOpen()?n().createElement(vD,zA({showMonthYearDropdown:void 0,ref:function(e){i.calendar=e}},i.props,i.state,{setOpen:i.setOpen,dateFormat:null!==(e=i.props.dateFormatCalendar)&&void 0!==e?e:r.defaultProps.dateFormatCalendar,onSelect:i.handleSelect,onClickOutside:i.handleCalendarClickOutside,holidays:FP(i.modifyHolidays()),outsideClickIgnoreClass:i.props.outsideClickIgnoreClass,onDropdownFocus:i.handleDropdownFocus,onTimeChange:i.handleTimeChange,className:i.props.calendarClassName,container:i.props.calendarContainer,handleOnKeyDown:i.props.onKeyDown,handleOnDayKeyDown:i.onDayKeyDown,setPreSelection:i.setPreSelection,dropdownMode:null!==(t=i.props.dropdownMode)&&void 0!==t?t:r.defaultProps.dropdownMode}),i.props.children):null},i.renderAriaLiveRegion=function(){var e,t,o=i.props.locale,a=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,s=i.props.showTimeInput||i.props.showTimeSelect?"PPPPp":"PPPP";return t=i.props.selectsRange?"Selected start date: ".concat(JA(i.props.startDate,{dateFormat:s,locale:o}),". ").concat(i.props.endDate?"End date: "+JA(i.props.endDate,{dateFormat:s,locale:o}):""):i.props.showTimeSelectOnly?"Selected time: ".concat(JA(i.props.selected,{dateFormat:a,locale:o})):i.props.showYearPicker?"Selected year: ".concat(JA(i.props.selected,{dateFormat:"yyyy",locale:o})):i.props.showMonthYearPicker?"Selected month: ".concat(JA(i.props.selected,{dateFormat:"MMMM yyyy",locale:o})):i.props.showQuarterYearPicker?"Selected quarter: ".concat(JA(i.props.selected,{dateFormat:"yyyy, QQQ",locale:o})):"Selected date: ".concat(JA(i.props.selected,{dateFormat:s,locale:o})),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},t)},i.renderDateInput=function(){var t,o,a,s,l,u,c=Mp(i.props.className,((t={})[i.props.outsideClickIgnoreClass||r.defaultProps.outsideClickIgnoreClass]=i.state.open,t)),d=i.props.customInput||n().createElement("input",{type:"text"}),p=i.props.customInputRef||"ref",f={},m=null!==(a=i.props["aria-describedby"])&&void 0!==a?a:i.props.ariaDescribedBy,h=null!==(s=i.props["aria-invalid"])&&void 0!==s?s:i.props.ariaInvalid,v=null!==(l=i.props["aria-labelledby"])&&void 0!==l?l:i.props.ariaLabelledBy,y=null!==(u=i.props["aria-required"])&&void 0!==u?u:i.props.ariaRequired;return null!=m&&(f["aria-describedby"]=m),null!=h&&(f["aria-invalid"]=h),null!=v&&(f["aria-labelledby"]=v),null!=y&&(f["aria-required"]=y),(0,e.cloneElement)(d,zA(((o={})[p]=function(e){i.input=e},o.value=i.getInputValue(),o.onBlur=i.handleBlur,o.onChange=i.handleChange,o.onClick=i.onInputClick,o.onFocus=i.handleFocus,o.onKeyDown=i.onInputKeyDown,o.id=i.props.id,o.name=i.props.name,o.form=i.props.form,o.autoFocus=i.props.autoFocus,o.placeholder=i.props.placeholderText,o.disabled=i.props.disabled,o.autoComplete=i.props.autoComplete,o.className=Mp(d.props.className,c),o.title=i.props.title,o.readOnly=i.props.readOnly,o.required=i.props.required,o.tabIndex=i.props.tabIndex,o),f))},i.renderClearButton=function(){var e=i.props,t=e.isClearable,r=e.disabled,o=e.selected,a=e.startDate,s=e.endDate,l=e.clearButtonTitle,u=e.clearButtonClassName,c=void 0===u?"":u,d=e.ariaLabelClose,p=void 0===d?"Close":d,f=e.selectedDates,m=e.readOnly;return!t||m||null==o&&null==a&&null==s&&!(null==f?void 0:f.length)?null:n().createElement("button",{type:"button",className:Mp("react-datepicker__close-icon",c,{"react-datepicker__close-icon--disabled":r}),disabled:r,"aria-label":p,onClick:i.onClearClick,title:l,tabIndex:-1})},i.state=i.calcInitialState(),i.preventFocusTimeout=void 0,i}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:hD,readOnly:!1,rangeSeparator:" - ",withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:12,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(e,t){var n,r,o,i,a,s;e.inline&&(a=e.selected,s=this.props.selected,a&&s?RI(a)!==RI(s)||jI(a)!==jI(s):a!==s)&&this.setPreSelection(this.props.selected),void 0!==this.state.monthSelectedIn&&e.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&0!==this.state.monthSelectedIn&&this.setState({monthSelectedIn:0}),e.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:NP(this.props.highlightDates)}),t.focused||pP(e.selected,this.props.selected)||this.setState({inputValue:null}),t.open!==this.state.open&&(!1===t.open&&!0===this.state.open&&(null===(r=(n=this.props).onCalendarOpen)||void 0===r||r.call(n)),!0===t.open&&!1===this.state.open&&(null===(i=(o=this.props).onCalendarClose)||void 0===i||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var e=this.props,t=e.showIcon,r=e.icon,o=e.calendarIconClassname,i=e.calendarIconClassName,a=e.toggleCalendarOnIconClick,s=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),n().createElement("div",{className:"react-datepicker__input-container".concat(t?" react-datepicker__view-calendar-icon":"")},t&&n().createElement(yD,zA({icon:r,className:Mp(i,!i&&o,s&&"react-datepicker-ignore-onclickoutside")},a?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var e=this.renderCalendar();if(this.props.inline)return e;if(this.props.withPortal){var t=this.state.open?n().createElement(wD,{enableTabLoop:this.props.enableTabLoop},n().createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},e)):null;return this.state.open&&this.props.portalId&&(t=n().createElement(gD,zA({portalId:this.props.portalId},this.props),t)),n().createElement("div",null,this.renderInputContainer(),t)}return n().createElement(SD,zA({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:e,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(e.Component),OD="input",_D="navigate",ED=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/react-datepicker/dist/react-datepicker.css"),CD={};CD.styleTagTransform=kl(),CD.setAttributes=bl(),CD.insert=yl().bind(null,"head"),CD.domAPI=hl(),CD.insertStyleElement=Sl(),fl()(ED.A,CD),ED.A&&ED.A.locals&&ED.A.locals;var ID=["width","height","color"];function TD(){return TD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TD.apply(null,arguments)}var AD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ID);return n().createElement("svg",TD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:s}))};AD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const PD=AD;var DD=["width","height","color"];function jD(){return jD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jD.apply(null,arguments)}var RD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,DD);return n().createElement("svg",jD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03 .65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:s}))};RD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const MD=RD;var LD=["width","height","color"];function ND(){return ND=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ND.apply(null,arguments)}var FD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,LD);return n().createElement("svg",ND({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},"aria-hidden":"true"},l),n().createElement("path",{d:"M18 6L6 18M6 6l12 12",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))};FD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const VD=FD;var BD=["width","height","color"];function qD(){return qD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qD.apply(null,arguments)}var QD=function(e){var t=e.width,r=void 0===t?15:t,o=e.height,i=void 0===o?15:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,BD);return n().createElement("svg",qD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n().createElement("circle",{cx:"12",cy:"12",r:"3"}))};QD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const zD=QD;var $D=["width","height","color"];function UD(){return UD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UD.apply(null,arguments)}var WD=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,$D);return n().createElement("svg",UD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"3 6 5 6 21 6"}),n().createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"}))};WD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const HD=WD;var GD=["width","height","color"];function YD(){return YD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YD.apply(null,arguments)}var KD=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,GD);return n().createElement("svg",YD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"15 18 9 12 15 6"}))};KD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const XD=KD;var ZD=["width","height","color"];function JD(){return JD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JD.apply(null,arguments)}var ej=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ZD);return n().createElement("svg",JD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"9 18 15 12 9 6"}))};ej.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const tj=ej;var nj=function(e,t,n,r){return e.length===t.length&&n&&r?{original:e,masked:We(e,n,r,t)}:{original:e,masked:e}};function rj(e){return rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rj(e)}var oj=["selectedDate","onChange","label","required","placeholder","dateFormat","styleName","header","cardListContext","questionId","disabled","startDate","endDate","value","maskingType","maskingLength","inputProps","tooltip","showQuestionLabels","userModified","testId","testIdRoot","data-testid","customTheme"];function ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ij(Object(n),!0).forEach(function(t){sj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sj(e,t,n){return(t=function(e){var t=function(e){if("object"!=rj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uj(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cj(){return cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cj.apply(null,arguments)}var dj=n().forwardRef(function(e,t){return n().createElement("input",cj({type:"text"},e,{ref:t}))});dj.displayName="DatePickerInput";var pj=function(t){var r=t.selectedDate,o=t.onChange,i=t.label,a=t.required,s=t.placeholder,l=t.dateFormat,u=void 0===l?"MM/dd/yyyy":l,c=t.styleName,d=t.header,p=t.cardListContext,f=t.questionId,m=t.disabled,h=t.startDate,v=t.endDate,y=t.value,g=t.maskingType,b=t.maskingLength,w=t.inputProps,S=void 0===w?{}:w,x=t.tooltip,k=void 0===x?"":x,O=t.showQuestionLabels,_=void 0===O||O,E=t.userModified,C=void 0!==E&&E,I=t.testId,T=t.testIdRoot,A=(t["data-testid"],t.customTheme),P=void 0===A?{}:A,D=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,oj),j=sd(),R=(0,e.useMemo)(function(){var e=j.dateField||{};return YS(e,P)},[j,P]),M=(0,e.useRef)(""),L=(0,e.useRef)(y),N=(0,e.useRef)(""),F=S["data-item-index"],V=S["data-parent-id"],B=g&&b,q=lj((0,e.useState)(!1),2),Q=q[0],z=q[1],$=lj((0,e.useState)({original:"",masked:""}),2),U=$[0],W=$[1],H=(0,e.useMemo)(function(){return Boolean(B&&function(e,t,n,r,o){if(e)return!1;if(!r||!o||"string"!=typeof n||!n)return!1;var i=null!=t?String(t):"";if(!i.trim())return!1;if(i.includes("*"))return!0;var a=$e(i,n);if(a.length!==n.length)return!1;var s=nj(a,n,r,o).masked;return Boolean(s&&s.includes("*"))}(C,y,u,g,b))},[C,y,B,u,g,b]),G=Boolean(m),Y=G||H,K=(0,e.useMemo)(function(){var e=aj(aj({},R.container),{},{width:"100%"});return{container:KS(e,R.responsive),input:ZS(R.input,Y&&R.disabled)}},[R,Y]),X=(0,e.useMemo)(function(){if(void 0!==y&&""!==y){if(y.length===u.length)try{var e=xa(y,u,new Date);if(e&&!Number.isNaN(e.getTime()))return e}catch(e){return null}return null}return r instanceof Date&&!Number.isNaN(r.getTime())?r:null},[y,r,u]),Z=void 0!==y&&""!==y?$e(y,u):"",J=lj((0,e.useState)(X),2),ee=J[0],te=J[1],ne=lj((0,e.useState)(Z),2),re=ne[0],ie=ne[1],ae=lj((0,e.useState)(!1),2),se=ae[0],le=ae[1],ue=(0,e.useRef)(!1);(0,e.useEffect)(function(){!ue.current&&Z&&(W(nj(Z,u,B?g:void 0,B?b:void 0)),M.current=Z,N.current=Z,ue.current=!0)},[]);var ce=(0,e.useMemo)(function(){return B?Q?U.original:U.masked:U.original||re||(y?$e(y,u):"")},[U,Q,B,re,y,u]),de=function(e){if("string"!=typeof e||!e)return!1;var t=/M/.test(e),n=/y/.test(e),r=/[dD]/.test(e);return t&&n&&!r}(u),pe=function(e,t){ie(e),M.current=e,N.current=e,W(nj(e,u,B?g:void 0,B?b:void 0)),void 0!==t&&te(t)};(0,e.useEffect)(function(){var e=y!==L.current;L.current=y,function(e,t,n){if(void 0===e||""===e)return!1;var r=$e(e,u);return function(e,t){return se?N.current===e&&(le(!1),!0):!t}(r,t)||(t||N.current!==r?(le(!1),pe(r,n)):n&&te(n)),!0}(y,e,X)||function(e,t){if(e&&!t){if(se)return!0;var n=Va(e,u);return N.current===n?te(e):pe(n,e),!0}return!1}(X,y)||function(e,t){!e&&!t&&(se||""!==N.current&&(ie(""),N.current="",W({original:"",masked:""}),te(null)))}(y,X)},[y,X,u,se,B,g,b]);var fe=void 0===F?f:"".concat(f,"-").concat(F),me={position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},he=Boolean(B&&H&&!G),ve=Boolean(B&&C&&!H),ye=(0,e.useMemo)(function(){return n().createElement(dj,{"data-testid":I,style:K.input})},[I,K.input]);return n().createElement("div",{className:"form-field ".concat(c||""),style:K.container},d&&n().createElement("div",{className:"field-header",style:j.header},d),_&&i&&n().createElement("div",{className:"question_label",style:j.label},i,a&&n().createElement("span",{className:"required-mark",style:j.required},"*"),k&&n().createElement(hO,{tooltip:k})),n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(kD,cj({selected:ee,onChange:function(e){if(!H){le(!1);var t=e?Va(e,u):"";o&&t!==M.current&&o({target:{value:t,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}),te(e),ie(t),M.current=t,N.current=t,W(nj(t,u,B?g:void 0,B?b:void 0))}},onChangeRaw:function(e){var t;if(!H&&null!=(null===(t=e.target)||void 0===t?void 0:t.value)){le(!0);var n=e.target.value||"",r=B&&!Q&&(null==U?void 0:U.original)?function(e,t,n,r){return function(e,t,n,r,o){var i,a,s=(null==t||null===(i=t.nativeEvent)||void 0===i?void 0:i.inputType)||"",l=((null==t||null===(a=t.nativeEvent)||void 0===a?void 0:a.data)||"").replace(oe,""),u=n.replace(oe,"");if("insertText"===s&&l){var c="".concat(u).concat(l);return Ue(c,r,u)}if("deleteContentBackward"===s||"deleteContentForward"===s){var d=u.slice(0,Math.max(0,u.length-1));return Ue(d,r,u)}var p=e.replace(oe,"");return Ue(p,r,o)}(e,t,n.original,r,M.current)}(n,e,U,u):Ue(n,u,M.current);r!==M.current&&(e.target.value=r,ie(r),M.current=r,N.current=r,B?function(e,t,n,r){W(nj(e,t,n,r))}(r,u,g,b):W({original:r,masked:r}),null==o||o({target:{value:r,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}),function(e,t){e.length===t.length?te(function(e,t){if(e.length===t.length){try{var n=xa(e,t,new Date);if(n&&!Number.isNaN(n.getTime()))return n}catch(e){}return null}return e.length>0&&(e.length,t.length),null}(e,t)):(e.length>0&&e.length<t.length||""===e)&&te(null)}(r,u))}},onBlur:function(e){le(!1);var t=B?U.original:re;t&&t!==M.current&&o&&o({target:{value:t,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p})},onKeyDown:function(e){"Backspace"===e.key&&B&&z(!0)},dateFormat:u,placeholderText:s||"Enter date (".concat(u,")"),value:B?ce:re},D,{name:fe,customInput:ye,showMonthYearPicker:de,peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",dateFormatCalendar:"MMMM",autoComplete:"off",disabled:Y,minDate:h,maxDate:v,allowSameDay:!0,strictParsing:!1})),he&&n().createElement("button",{type:"button",name:"clearMaskedPrefill",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-clear-icon",onClick:function(){G||(z(!1),W({original:"",masked:""}),ie(""),te(null),le(!1),M.current="",N.current="",null==o||o({target:{value:"",name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}))},title:"Clear to enter a new value","aria-label":"Clear masked value to enter a new value",style:me,"data-testid":dd(T,"clear-privacy")},n().createElement(VD,{width:18,height:18})),ve&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return z(!Q)},title:Q?"Hide value":"Show value","aria-label":Q?"Hide sensitive information":"Show sensitive information",style:me,"data-testid":dd(T,"toggle-visibility")},Q?n().createElement(MD,null):n().createElement(PD,null))))};pj.propTypes={selectedDate:o().instanceOf(Date),onChange:o().func,label:o().string,required:o().bool,placeholder:o().string,dateFormat:o().string,styleName:o().string,header:o().string,cardListContext:o().object,questionId:o().string,disabled:o().bool,startDate:o().oneOfType([o().string,o().instanceOf(Date)]),endDate:o().oneOfType([o().string,o().instanceOf(Date)]),value:o().string,theme:o().object,customTheme:o().object,maskingType:o().oneOf(["prefix","suffix"]),maskingLength:o().number,inputProps:o().object,tooltip:o().string,showQuestionLabels:o().bool,userModified:o().bool,testId:o().string,testIdRoot:o().string,"data-testid":o().string};const fj=pj;function mj(e){return mj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mj(e)}function hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hj(Object(n),!0).forEach(function(t){yj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yj(e,t,n){return(t=function(e){var t=function(e){if("object"!=mj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gj={sanitizeValue:function(e){return IC.sanitize("string"==typeof e?e:String(null!=e?e:""),DC).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}},bj=function(e){return{__html:RC("string"==typeof e?e:String(null!=e?e:""))}},wj=function(t){var r,o=t.name,i=t.value,a=void 0===i?"":i,s=t.label,l=void 0===s?"":s,u=t.className,c=void 0===u?"":u,d=t.customTheme,p=void 0===d?{}:d,f=t.styleName,m=void 0===f?"":f,h=t.parentContext,v=void 0===h?{}:h,y=t.tooltip,g=void 0===y?"":y,b=t.showQuestionLabels,w=void 0===b||b,S=t.testId,x=Vc(),k=x.state,O=x.formSchema,_=k.values,E=void 0===_?{}:_,C=k.nestedStates,I=void 0===C?{}:C,T=sd(),A=null!==(r=null!=a?a:E[o])&&void 0!==r?r:"",P=(0,e.useMemo)(function(){return l?mr(l,E,I,v,O||[],gj):l},[l,E,I,v,O]),D=(0,e.useMemo)(function(){return mr(A,E,I,v,O||[],gj)},[A,E,I,v,O]),j=(0,e.useMemo)(function(){var e=T.displayTextField||T.textField||{};return YS(e,p)},[T,p]),R=(0,e.useMemo)(function(){var e=vj(vj({},j.container),{},{width:"100%"});return{container:KS(e,j.responsive),label:ZS(j.label),content:ZS(j.content)}},[j]),M=(0,e.useMemo)(function(){return P?bj(P):null},[P]),L=(0,e.useMemo)(function(){return D?bj(D):null},[D]);return n().createElement("div",{className:"display-text-field-container",style:R.container,"data-testid":S},w&&M&&n().createElement("div",{className:"question_label ".concat(c," ").concat(m||""),style:R.label},n().createElement("span",{dangerouslySetInnerHTML:M}),g&&n().createElement(hO,{tooltip:g})),L&&n().createElement("div",{className:"display-text-field__content ".concat(c," ").concat(m||""),style:R.content,dangerouslySetInnerHTML:L}))};wj.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,className:o().string,customTheme:o().object,styleName:o().string,parentContext:o().object,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string};const Sj=wj;function xj(e){return xj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xj(e)}function kj(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Oj(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Oj(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Oj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Oj(d,"constructor",u),Oj(u,"constructor",l),l.displayName="GeneratorFunction",Oj(u,o,"GeneratorFunction"),Oj(d),Oj(d,o,"Generator"),Oj(d,r,function(){return this}),Oj(d,"toString",function(){return"[object Generator]"}),(kj=function(){return{w:i,m:p}})()}function Oj(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Oj=function(e,t,n,r){function i(t,n){Oj(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Oj(e,t,n,r)}function _j(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Ej(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){_j(i,r,o,a,s,"next",e)}function s(e){_j(i,r,o,a,s,"throw",e)}a(void 0)})}}function Cj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ij(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cj(Object(n),!0).forEach(function(t){Tj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tj(e,t,n){return(t=function(e){var t=function(e){if("object"!=xj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pj(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Dj=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.disabled,u=t.className,c=t.loadOptions,d=t.apiUrl,p=t.apiBaseUrl,f=t.dependsOn,m=t.formData,h=t.customTheme,v=void 0===h?{}:h,y=t.inputProps,g=void 0===y?{}:y,b=t.styleName,w=t.onChange,S=t.testIdRoot,x=sd(),k=Aj((0,e.useState)([]),2),O=k[0],_=k[1],E=Aj((0,e.useState)(!1),2),C=E[0],I=E[1],T=Aj((0,e.useState)(""),2),A=T[0],P=T[1],D=g["data-item-index"],j=g["data-parent-id"],R=(0,e.useMemo)(function(){var e=x.dynamicDropdownField||x.selectField||{};return YS(e,v)},[x,v]),M=(0,e.useMemo)(function(){var e=Ij(Ij({},R.container),{},{width:"100%"}),t=ZS(R.select,l&&R.disabled,C&&R.loading,A&&R.error);return{container:KS(e,R.responsive),select:t,placeholder:R.placeholder,loadingIndicator:R.loadingIndicator,errorMessage:R.errorMessage}},[R,l,C,A]);(0,e.useEffect)(function(){var e=function(){var e=Ej(kj().m(function e(t,n){var r,o,i;return kj().w(function(e){for(;;)switch(e.n){case 0:return r=p?"".concat(p.replace(/\/$/,""),"/").concat(t.replace(/^\//,"")):t,e.n=1,fetch(r);case 1:if((o=e.v).ok){e.n=2;break}throw new Error("Failed to fetch options");case 2:return e.n=3,o.json();case 3:return i=e.v,e.a(2,i.users.map(function(e){return{value:e.value||e.id,label:e.label||e.name}}))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),t=function(){var t=Ej(kj().m(function t(){var n,r,o;return kj().w(function(t){for(;;)switch(t.p=t.n){case 0:if(c||d){t.n=1;break}return t.a(2);case 1:if(t.p=1,I(!0),P(""),n=null==f?void 0:f.reduce(function(e,t){return e[t]=m[t],e},{}),!c){t.n=3;break}return t.n=2,c(n);case 2:r=t.v,t.n=5;break;case 3:if(!d){t.n=5;break}return t.n=4,e(d,n);case 4:r=t.v;case 5:_(r||[]),t.n=7;break;case 6:t.p=6,o=t.v,P("Failed to load options"),console.error("Error loading options:",o);case 7:return t.p=7,I(!1),t.f(7);case 8:return t.a(2)}},t,null,[[1,6,7,8]])}));return function(){return t.apply(this,arguments)}}();(!f||f.every(function(e){return m[e]}))&&t()},[c,d,p,f,m]);var L=function(e){w&&(null==w||w(e))};return n().createElement(zO,{name:r,label:o,validation:a,className:"dynamic-dropdown-field ".concat(b||""," ").concat(u||""),customTheme:R,error:A,value:i,renderInput:function(e){var t=e.value,o=e.disabled;return C?n().createElement("div",{style:M.loadingIndicator},"Loading options..."):n().createElement("select",{name:void 0===D?r:"".concat(r,"-").concat(D),value:t||"",onChange:L,disabled:o||C,style:M.select,"data-item-index":D,"data-parent-id":j,"data-testid":dd(S,"trigger")},s&&n().createElement("option",{value:"",style:M.placeholder},s),O.map(function(e){return n().createElement("option",{key:e.value,value:e.value,"data-testid":dd(S,"option",e.value)},e.label)}))}},A&&n().createElement("div",{style:M.errorMessage},A))};function jj(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(Rj(e)+" is not iterable")}function Rj(e){return Rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rj(e)}function Mj(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Lj(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Lj(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Lj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Lj(d,"constructor",u),Lj(u,"constructor",l),l.displayName="GeneratorFunction",Lj(u,o,"GeneratorFunction"),Lj(d),Lj(d,o,"Generator"),Lj(d,r,function(){return this}),Lj(d,"toString",function(){return"[object Generator]"}),(Mj=function(){return{w:i,m:p}})()}function Lj(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Lj=function(e,t,n,r){function i(t,n){Lj(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Lj(e,t,n,r)}function Nj(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Fj(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Nj(i,r,o,a,s,"next",e)}function s(e){Nj(i,r,o,a,s,"throw",e)}a(void 0)})}}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(t){qj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qj(e,t,n){return(t=function(e){var t=function(e){if("object"!=Rj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Dj.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,placeholder:o().string,disabled:o().bool,className:o().string,loadOptions:o().func,apiUrl:o().string,apiBaseUrl:o().string,dependsOn:o().arrayOf(o().string),formData:o().object,customTheme:o().object,inputProps:o().object,styleName:o().string,onChange:o().func,testIdRoot:o().string};var Qj=["localhost","127.0.0.1"],zj=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(e=null==t?void 0:t.uploadRequestTimeoutMs)&&void 0!==e?e:null==t?void 0:t.UPLOAD_REQUEST_TIMEOUT_MS,r=Number(n);return Number.isFinite(r)&&r>0?r:6e5},$j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t){if(t.startsWith("http://")||t.startsWith("https://"))return t;var n=e||"",r=t.startsWith("/")?"":"/";return"".concat(n).concat(r).concat(t)}return e||""},Uj=function(e){var t,n={Accept:"application/json"},r=(null==e||null===(t=e.customApi)||void 0===t?void 0:t.headers)||{};r.Authorization&&(n.Authorization=r.Authorization);var o=r.carrierauthorization||r.Carrierauthorization||r.CarrierAuthorization||r["Carrier-Auth"]||r.CarrierAuth||r["carrier-authorization"]||null;return o&&(n.carrierauthorization=o),n},Wj=function(e,t){return e?t:Bj({"Content-Type":"application/json"},t)},Hj=function(e,t){return e?t:null!=t?JSON.stringify(t):void 0},Gj=function(){var e=Fj(Mj().m(function e(t){var n;return Mj().w(function(e){for(;;)switch(e.n){case 0:if(!(t.headers.get("Content-Type")||"").includes("application/json")){e.n=2;break}return e.n=1,t.json();case 1:n=e.v,e.n=4;break;case 2:return e.n=3,t.text();case 3:n=e.v;case 4:return e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),Yj=function(e){return"string"!=typeof e?null:e.trim()||null},Kj=function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Upload failed";if(null==e)return o;var i=Yj(e);if(i)return i;if("object"!==Rj(e))return o;var a=Yj(e.data);if(a)return a;for(var s=0,l=[null===(t=e.status)||void 0===t?void 0:t.message,null===(n=e.data)||void 0===n?void 0:n.message,e.message,null===(r=e.data)||void 0===r?void 0:r.data];s<l.length;s++){var u=Yj(l[s]);if(u)return u}return o},Xj=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Upload failed";if(function(e){var t,n;if(null==e||"object"!==Rj(e))return!0;var r=null!==(t=null===(n=e.status)||void 0===n?void 0:n.code)&&void 0!==t?t:e.statusCode;return null==r||""===r||200===Number(r)}(e))return e;var o=new Error(Kj(e,r));throw o.status=null!==(t=null==e||null===(n=e.status)||void 0===n?void 0:n.code)&&void 0!==t?t:null==e?void 0:e.statusCode,o.data=e,o},Zj=function(e,t){var n=new Error(Kj(e,t.statusText||"Request failed"));return n.status=t.status,n.data=e,n},Jj=function(e){var t=new Error(e);return t.code="REQUEST_URL_NOT_ALLOWED",t.data=null,t},eR=function(e,t){var n,r,o,i,a,s=String(null!=e?e:""),l=(null===(n=Ml.document)||void 0===n?void 0:n.baseURI)||(null===(r=Ml.location)||void 0===r?void 0:r.href);try{a=new URL(s,l)}catch(e){if(!l)return s;throw Jj("Request blocked: invalid URL")}var u=null===(o=Ml.location)||void 0===o?void 0:o.origin;if(u&&"null"!==u&&a.origin===u)return a.href;var c="http:"===a.protocol&&Qj.includes(a.hostname);if("https:"!==a.protocol&&!c)throw Jj("Request blocked: HTTPS is required");var d=null==t||null===(i=t.customApi)||void 0===i?void 0:i.allowedAbsoluteHosts;if(Array.isArray(d)&&d.length>0&&!d.map(function(e){return String(null!=e?e:"").trim().toLowerCase()}).includes(a.host))throw Jj("Request blocked: host is not allowed");return a.href},tR=function(e,t,n){if(t>=n)return!1;if("AbortError"===(null==e?void 0:e.name))return!1;var r=null==e?void 0:e.status;return!(null!=r&&r>=400&&r<500&&429!==r)&&(null==r||r>=500||429===r)},nR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S;return Mj().w(function(e){for(;;)switch(e.n){case 0:n=t.url,r=t.method,o=void 0===r?"GET":r,i=t.headers,a=void 0===i?{}:i,s=t.body,l=void 0===s?void 0:s,u=t.isFormData,c=void 0!==u&&u,d=t.timeoutMs,p=void 0===d?3e4:d,f=t.apiConfig,h=eR(n,m=void 0===f?{}:f),v=Number((null==m?void 0:m.MAX_API_ATTEMPTS)||3),y=Bj(Bj({},Uj(m)),a),b=Mj().m(function e(){var t,n,r,i,a,s,u,d,f,b;return Mj().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=new AbortController,n=setTimeout(function(){t.abort(new DOMException("Request timed out","TimeoutError"))},p),e.p=1,i=Wj(c,y),a=Hj(c,l),s=(null==m||null===(r=m.customApi)||void 0===r?void 0:r.credentials)||(null==m?void 0:m.credentials)||"omit",e.n=2,fetch(h,{method:o,headers:i,body:a,credentials:s,mode:"cors",signal:t.signal});case 2:return u=e.v,e.n=3,Gj(u);case 3:if(d=e.v,!u.ok){e.n=4;break}return e.a(2,{v:d});case 4:throw Zj(d,u);case 5:if(e.p=5,b=e.v,g=b,!tR(b,S,v)){e.n=7;break}return f=300*Math.pow(2,S-1),e.n=6,new Promise(function(e){return setTimeout(e,f)});case 6:e.n=8;break;case 7:return e.a(2,0);case 8:return e.p=8,clearTimeout(n),e.f(8);case 9:return e.a(2)}},e,null,[[1,5,8,9]])}),S=1;case 1:if(!(S<=v)){e.n=5;break}return e.d(jj(b()),2);case 2:if(0!==(w=e.v)){e.n=3;break}return e.a(3,5);case 3:if(!w){e.n=4;break}return e.a(2,w.v);case 4:S++,e.n=1;break;case 5:throw g||new Error("Request failed");case 6:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),rR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return o=u.length>1&&void 0!==u[1]?u[1]:{},(i=new FormData).append("file",t),a=(null==o||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",s=(null==o||null===(r=o.customApi)||void 0===r?void 0:r.convertToPdfUrl)||"",l=$j(a,s),e.a(2,nR({url:l,method:"POST",body:i,isFormData:!0,timeoutMs:zj(o),apiConfig:o}))},e)}));return function(t){return e.apply(this,arguments)}}(),oR=function(){var e=Fj(Mj().m(function e(t,n){var r,o,i,a,s,l,u=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return a=(null==(i=u.length>2&&void 0!==u[2]?u[2]:{})||null===(r=i.customApi)||void 0===r?void 0:r.baseUrl)||"",s=(null==i||null===(o=i.customApi)||void 0===o?void 0:o.uploadUrl)||"",l="".concat($j(a,s),"?caseId=").concat(encodeURIComponent(n||""),"&user=agent"),e.a(2,nR({url:l,method:"POST",body:t,timeoutMs:zj(i),apiConfig:i}))},e)}));return function(t,n){return e.apply(this,arguments)}}(),iR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return i=f.length>1&&void 0!==f[1]?f[1]:{},(a=new FormData).append("files",t),s=(null==i||null===(n=i.customApi)||void 0===n?void 0:n.baseUrl)||"",l=(null==i||null===(r=i.customApi)||void 0===r?void 0:r.uploadUrl)||"",u=$j(s,l),c=(null==i||null===(o=i.customApi)||void 0===o||null===(o=o.headers)||void 0===o?void 0:o.Authorization)||"",d=c.replace(/^Bearer\s+/i,""),p=Bj({Accept:"application/json"},d?{adminToken:d}:{}),e.a(2,nR({url:u,method:"POST",headers:p,body:a,isFormData:!0,timeoutMs:zj(i),apiConfig:Bj(Bj({},i),{},{customApi:Bj(Bj({},i.customApi||{}),{},{headers:{}})})}))},e)}));return function(t){return e.apply(this,arguments)}}(),aR=function(){var e=Fj(Mj().m(function e(t,n,r){var o,i,a,s,l,u,c=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return s=(null==(a=c.length>3&&void 0!==c[3]?c[3]:{})||null===(o=a.customApi)||void 0===o?void 0:o.baseUrl)||"",l=(null==a||null===(i=a.customApi)||void 0===i?void 0:i.deleteUrl)||"",u="".concat($j(s,l),"?caseId=").concat(encodeURIComponent(n||""),"&documentId=").concat(encodeURIComponent(t||""),"&questionId=").concat(encodeURIComponent(r||"")),e.a(2,nR({url:u,method:"DELETE",apiConfig:a}))},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),sR=function(e){var t=null==e?void 0:e.data;return t&&"object"===Rj(t)&&!1===t.valid?(Array.isArray(t.errors)?t.errors:[]).map(function(e){return Yj(null==e?void 0:e.message)}).filter(Boolean):[]},lR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return i=(null==(o=s.length>1&&void 0!==s[1]?s[1]:{})||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",a=(null==o||null===(r=o.customApi)||void 0===r||null===(r=r.welisIllustration)||void 0===r?void 0:r.extractUrl)||"",e.a(2,nR({url:$j(i,a),method:"POST",body:t,timeoutMs:zj(o),apiConfig:Bj(Bj({},o),{},{MAX_API_ATTEMPTS:1})}))},e)}));return function(t){return e.apply(this,arguments)}}();function uR(e){return uR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uR(e)}var cR=function(e){var t,r,o,i,a,s=e.file,l=e.index,u=e.errorItemStyle,c=e.includeExtraDropDowns,d=e.uploadQuestionAdditionalDropDown,p=e.allowDelete,f=e.disabled,m=e.fieldError,h=e.onDocumentTypeChange,v=e.onView,y=e.onDelete,g=e.testIdRoot,b=dd(g,"item",l),w=s.fileName||s.name||"",S=(null==d||null===(t=d[0])||void 0===t?void 0:t.title)||(null==d||null===(r=d[0])||void 0===r?void 0:r.label)||"Attachment Type",x=null!==(o=null==d||null===(i=d[0])||void 0===i?void 0:i.options)&&void 0!==o?o:[],k=void 0===s.dropDownOptionSelection||null===s.dropDownOptionSelection||""===String(s.dropDownOptionSelection||"").trim();return n().createElement("tr",{"data-testid":b},n().createElement("td",{className:"ff-table__cell ff-table__cell--doc-name"},n().createElement("button",{type:"button",className:"ff-table__cell--link",onClick:function(){return v(s)},title:w,"aria-label":"Preview ".concat(w||"document")},w)),c&&(null==d?void 0:d.length)>0&&n().createElement("td",{className:"ff-table__cell ff-table__cell--doc-type"},n().createElement("select",{value:null!==(a=s.dropDownOptionSelection)&&void 0!==a?a:"",onChange:function(e){return h(l,e.target.value)},disabled:f,className:"ff-doc-type-select","aria-label":"Document type for ".concat(w||"file"),"data-testid":dd(b,"doc-type")},n().createElement("option",{value:"",disabled:!0},"Select Attachment"),x.map(function(e){var t="object"===uR(e)&&null!==e?e.value:e,r="object"===uR(e)&&null!==e?e.label:e;return n().createElement("option",{key:null!=t?t:r,value:null!=t?t:r},null!=r?r:t)})),k&&n().createElement("span",{style:u},m?Array.isArray(m)?m[0]:"string"==typeof m&&m.split(", ").filter(Boolean)[0]||m:"Provide ".concat(S.toLowerCase()))),n().createElement("td",{className:"ff-table__cell"},s.fileType||(s.fileName?s.fileName.split(".").pop().toUpperCase():"")),n().createElement("td",{className:"ff-table__cell"},null!=s.fileSize?$s(Qs(s.fileSize)):"0 Bytes"),n().createElement("td",{className:"ff-table__cell"},n().createElement("div",{className:"ff-action-group"},n().createElement("button",{type:"button",className:"ff-action-btn ff-action-btn--view",onClick:function(){return v(s)},"aria-label":"Preview ".concat(w||"document"),title:"View document","data-testid":dd(b,"view")},n().createElement(zD,{width:15,height:15})),p&&n().createElement("button",{type:"button",className:"ff-action-btn ff-action-btn--delete",onClick:function(){return y(l)},"aria-label":"Delete ".concat(w||"document"),title:"Delete document",disabled:f,"data-testid":dd(b,"delete")},n().createElement(HD,{width:14,height:14})))))};cR.propTypes={file:o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,name:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),dropDownOptionSelection:o().string}).isRequired,index:o().number.isRequired,errorItemStyle:o().object,includeExtraDropDowns:o().bool.isRequired,uploadQuestionAdditionalDropDown:o().array,allowDelete:o().bool.isRequired,disabled:o().bool.isRequired,fieldError:o().oneOfType([o().string,o().arrayOf(o().string),o().oneOf([null])]),onDocumentTypeChange:o().func.isRequired,onView:o().func.isRequired,onDelete:o().func.isRequired,testIdRoot:o().string};const dR=cR;function pR(e){return pR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pR(e)}function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(t){hR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hR(e,t,n){return(t=function(e){var t=function(e){if("object"!=pR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vR(e){return vR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vR(e)}function yR(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=SR(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function gR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return bR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(bR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,bR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,bR(d,"constructor",u),bR(u,"constructor",l),l.displayName="GeneratorFunction",bR(u,o,"GeneratorFunction"),bR(d),bR(d,o,"Generator"),bR(d,r,function(){return this}),bR(d,"toString",function(){return"[object Generator]"}),(gR=function(){return{w:i,m:p}})()}function bR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bR=function(e,t,n,r){function i(t,n){bR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},bR(e,t,n,r)}function wR(e){return function(e){if(Array.isArray(e))return xR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||SR(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SR(e,t){if(e){if("string"==typeof e)return xR(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xR(e,t):void 0}}function xR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(t){_R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _R(e,t,n){return(t=function(e){var t=function(e){if("object"!=vR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ER(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function CR(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ER(i,r,o,a,s,"next",e)}function s(e){ER(i,r,o,a,s,"throw",e)}a(void 0)})}}var IR=function(e){var t;return!0===(null==e||null===(t=e.customApi)||void 0===t?void 0:t.isThirdPartyUpload)};function TR(e){return((null==e?void 0:e.name)||"").toLowerCase().endsWith(".pdf")||"application/pdf"===((null==e?void 0:e.type)||"").toLowerCase()}function AR(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){var e=r.result||"",n=e.includes(",")?e.slice(e.indexOf(",")+1):e;t(n)},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)})}function PR(e,t){return DR.apply(this,arguments)}function DR(){return(DR=CR(gR().m(function e(t,n){var r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S,x,k,O,_,E,C,I,T,A,P,D,j,R,M,L,N,F,V,B,q,Q,z,$;return gR().w(function(e){for(;;)switch(e.n){case 0:if(s=n.questionId,l=n.apiConfig,u=n.uploadQuestionAdditionalDropDown,c=void 0===u?[]:u,d=n.currentFiles,p=void 0===d?[]:d,f=n.onUploaded,m={dropDownTitle:(null==c||null===(r=c[0])||void 0===r?void 0:r.label)||(null==c||null===(o=c[0])||void 0===o?void 0:o.title)||"Attachment Type",dropDownOptionSelection:""},!IR(l)){e.n=3;break}return e.n=1,AR(t);case 1:return g=e.v,b=t.type||"application/octet-stream",w="data:".concat(b,";base64,").concat(g),S=OR({id:void 0,value:void 0,fileName:t.name||"document",base64Response:w,fileType:(null===(h=(t.name||"").split(".").pop())||void 0===h?void 0:h.toLowerCase())||"",fileSize:t.size},m),x=[].concat(wR(p),[S]),e.n=2,iR(t,l);case 2:return k=e.v,Xj(k,"Upload failed"),O=(null==k?void 0:k.data)||k||{},_=wR(x),E=_.length-1,_[E]=OR(OR({},_[E]),{},{id:null!==(v=O.id)&&void 0!==v?v:void 0,value:O.value||O.fileUrl||O.url||void 0,fileName:O.actualFileName||O.fileName||_[E].fileName,fileType:O.fileType||_[E].fileType,fileSize:null!==(y=O.fileSize)&&void 0!==y?y:_[E].fileSize,base64Response:w,s3_key:O.s3_keys}),null==f||f({fileName:_[E].fileName,base64Response:w}),e.a(2,_);case 3:if(!TR(t)){e.n=5;break}return e.n=4,AR(t);case 4:T=e.v,C={questionId:s,fileUploads:OR({fileName:t.name||"document.pdf",base64Response:"data:application/pdf;base64,".concat(T),fileSize:t.size,fileType:"pdf"},m)},I=OR({id:void 0,value:void 0,fileName:t.name||"document.pdf",base64Response:C.fileUploads.base64Response,fileType:"pdf",fileSize:t.size},m),e.n=7;break;case 5:return e.n=6,rR(t,l);case 6:M=e.v,Xj(M,"Failed to convert file to PDF"),L=null==M||null===(A=M.data)||void 0===A?void 0:A.fileData,N=(null==M||null===(P=M.data)||void 0===P?void 0:P.fileName)||(null==t?void 0:t.name)||"document.pdf",F=null!==(D=null!==(j=null==M||null===(R=M.data)||void 0===R?void 0:R.fileSize)&&void 0!==j?j:null==t?void 0:t.size)&&void 0!==D?D:0,C={questionId:s,fileUploads:OR({fileName:N,base64Response:"data:application/pdf;base64,".concat(L),fileSize:F,fileType:"pdf"},m)},I=OR({id:void 0,value:void 0,fileName:C.fileUploads.fileName,base64Response:C.fileUploads.base64Response,fileType:"pdf",fileSize:F},m);case 7:return V=[].concat(wR(p),[I]),B=(null==l||null===(i=l.customApi)||void 0===i||null===(i=i.headers)||void 0===i?void 0:i.caseId)||(null==l?void 0:l.caseId),e.n=8,oR(C,B,l);case 8:return q=e.v,Xj(q,"Upload failed"),Q=(null==q?void 0:q.data)||{},z=wR(V),$=z.length-1,z[$]=OR(OR({},z[$]),{},{id:Q.id,value:Q.value,fileName:Q.actualFileName||z[$].fileName,fileType:Q.fileType||"pdf",fileSize:null!==(a=Q.fileSize)&&void 0!==a?a:z[$].fileSize,base64Response:null}),null==f||f({fileName:z[$].fileName,base64Response:C.fileUploads.base64Response}),e.a(2,z)}},e)}))).apply(this,arguments)}function jR(e){return RR.apply(this,arguments)}function RR(){return(RR=CR(gR().m(function e(t){var n,r,o,i,a;return gR().w(function(e){for(;;)if(0===e.n){n=[],r=yR(t);try{for(r.s();!(o=r.n()).done;){i=o.value;try{(i instanceof File?i.type:i.type||"").startsWith("image/")||(i.fileName||"").match(_e)?i instanceof File?(a=URL.createObjectURL(i),n.push(a)):i.base64Response?n.push(i.base64Response):n.push(null):n.push(null)}catch(e){console.error("Preview generation error:",e),n.push(null)}}}catch(e){r.e(e)}finally{r.f()}return e.a(2,n)}},e)}))).apply(this,arguments)}var MR=["application/pdf","image/png","image/jpeg","image/jpg","image/gif","image/webp"];var LR=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/styles/FileField.scss"),NR={};function FR(e){return FR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FR(e)}NR.styleTagTransform=kl(),NR.setAttributes=bl(),NR.insert=yl().bind(null,"head"),NR.domAPI=hl(),NR.insertStyleElement=Sl(),fl()(LR.A,NR),LR.A&&LR.A.locals&&LR.A.locals;var VR=["questionId","label","value","validation","multiple","disabled","className","maxFileSize","maxFiles","showPreview","allowDelete","onError","customTheme","styleName","includeExtraDropDowns","uploadQuestionAdditionalDropDown","allowedFileType","fileSizeLimit","numberOfFiles","errorMessage","apiConfig","fileUploads","testId","testIdRoot"];function BR(){return BR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BR.apply(null,arguments)}function qR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(t){zR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zR(e,t,n){return(t=function(e){var t=function(e){if("object"!=FR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $R(e){return function(e){if(Array.isArray(e))return XR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||KR(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return WR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(WR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,WR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,WR(d,"constructor",u),WR(u,"constructor",l),l.displayName="GeneratorFunction",WR(u,o,"GeneratorFunction"),WR(d),WR(d,o,"Generator"),WR(d,r,function(){return this}),WR(d,"toString",function(){return"[object Generator]"}),(UR=function(){return{w:i,m:p}})()}function WR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}WR=function(e,t,n,r){function i(t,n){WR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},WR(e,t,n,r)}function HR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function GR(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){HR(i,r,o,a,s,"next",e)}function s(e){HR(i,r,o,a,s,"throw",e)}a(void 0)})}}function YR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||KR(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KR(e,t){if(e){if("string"==typeof e)return XR(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XR(e,t):void 0}}function XR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ZR=function(e){var t,n;return{status:null==e?void 0:e.status,code:null!==(t=null==e?void 0:e.code)&&void 0!==t?t:null==e||null===(n=e.data)||void 0===n||null===(n=n.status)||void 0===n?void 0:n.code,message:null==e?void 0:e.message}},JR=function(t){var r,o,i=t.questionId,a=t.label,s=t.value,l=void 0===s?null:s,u=t.validation,c=void 0===u?{}:u,d=t.multiple,p=void 0!==d&&d,f=t.disabled,m=void 0!==f&&f,h=t.className,v=void 0===h?"":h,y=t.maxFileSize,g=void 0===y?5242880:y,b=t.maxFiles,w=void 0===b?5:b,S=t.showPreview,x=void 0===S||S,k=t.allowDelete,O=void 0===k||k,_=t.onError,E=t.customTheme,C=void 0===E?{}:E,I=t.styleName,T=t.includeExtraDropDowns,A=void 0!==T&&T,P=t.uploadQuestionAdditionalDropDown,D=void 0===P?[]:P,j=t.allowedFileType,R=t.fileSizeLimit,M=t.numberOfFiles,L=(t.errorMessage,t.apiConfig),N=t.fileUploads,F=t.testId,V=t.testIdRoot,B=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,VR),q=Vc(),Q=q.state,z=q.setValue,$=sd(),U="string"==typeof(o=B.addressGroup)&&"wellis_illustration_file"===o.trim().toLowerCase(),W=(0,e.useRef)(null),H=YR((0,e.useState)(N||[]),2),G=H[0],Y=H[1],K=YR((0,e.useState)([]),2),X=K[0],Z=K[1],J=YR((0,e.useState)([]),2),ee=J[0],te=J[1],ne=YR((0,e.useState)(!1),2),re=ne[0],oe=ne[1],ie=YR((0,e.useState)(!1),2),ae=ie[0],se=ie[1],le=YR((0,e.useState)(1),2),ue=le[0],ce=le[1],de=YR((0,e.useState)(function(){var e=N;return null!=e&&e.length?null==e?void 0:e.map(function(){var e;return(null===(e=D[0])||void 0===e||null===(e=e.options[0])||void 0===e?void 0:e.value)||""}):[]}),2),pe=de[0],fe=de[1],me=(null==Q||null===(r=Q.errors)||void 0===r?void 0:r[i])||null,he=(0,e.useMemo)(function(){var e=$.fileField||{};return YS(e,C)},[$,C]),ve=(0,e.useMemo)(function(){return function(e,t,n){var r=mR(mR({},e.container),{},{width:"100%"}),o=mR(mR({},ZS(e.dropzone,t&&e.dropzoneActive,n&&e.dropzoneDisabled)),{},{borderWidth:"1px",borderStyle:"dashed",borderColor:t?"#25A2CF":n?"#D1D5DB":"#25A2CF",backgroundColor:n?"#F5F5F5":t?"rgba(37, 162, 207, 0.1)":"rgba(37, 162, 207, 0.05)"});return{container:KS(r,e.responsive),dropzone:o,input:e.input,previewContainer:e.previewContainer,previewItem:e.previewItem,previewImage:e.previewImage,previewIcon:e.previewIcon,deleteBtn:e.deleteButton,error:e.error,errorList:e.errorList,errorItem:e.errorItem}}(he,re,m)},[he,re,m]);(0,e.useEffect)(function(){try{var e,t,n=(null==D||null===(e=D[0])||void 0===e?void 0:e.label)||(null==D||null===(t=D[0])||void 0===t?void 0:t.title)||"Attachment Type",r=qs({value:l,fileUploads:N,dropdownTitle:n});Array.isArray(r)&&r.length>0&&(Y(r),jR(r).then(Z))}catch(e){console.error("Error initializing file field:",e)}},[]);var ye=$S({questionId:i,defaultValue:l,defaultVisible:!0,defaultDisabled:m}).handleChange,ge=(0,e.useCallback)(function(e){e._contextValue;var t,r,o,a=e.onChange,s=e.disabled,l=function(){var e=GR(UR().m(function e(t){var n;return UR().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),t.stopPropagation(),!s){e.n=1;break}return e.a(2);case 1:return oe(!1),n=Array.from(t.dataTransfer.files),e.n=2,d(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),u=function(){var e=GR(UR().m(function e(t){var n,r;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!s){e.n=1;break}return e.a(2);case 1:return n=t.target,r=Array.from(n.files||[]),e.p=2,e.n=3,d(r);case 3:return e.p=3,n.value="",e.f(3);case 4:return e.a(2)}},e,null,[[2,,3,4]])}));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=GR(UR().m(function e(t){var n,r,o,l,u,c,d;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!s){e.n=1;break}return e.a(2);case 1:if(n=G[t],e.p=2,null==n||!n.id){e.n=3;break}return o=(null==L||null===(r=L.customApi)||void 0===r||null===(r=r.headers)||void 0===r?void 0:r.caseId)||(null==L?void 0:L.caseId),e.n=3,aR(n.id,o,i,L);case 3:e.n=5;break;case 4:e.p=4,d=e.v,console.warn("Failed to delete document from server, removing locally:",ZR(d));case 5:l=G.filter(function(e,n){return n!==t}),u=X.filter(function(e,n){return n!==t}),te([]),Y(l),Z(u),c=Math.max(1,Math.ceil(l.length/3)),ue>c&&ce(c),a({value:l,fileUploads:l}),z(i,l);case 6:return e.a(2)}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=GR(UR().m(function e(t){var n,r,o,s,l,u,c,d,p,f,m,h,v,y,g;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.length){e.n=1;break}return e.a(2);case 1:if(n=$R(G),r=t[0],o=zs([r],{allowedFileType:j,fileSizeLimit:R,numberOfFiles:M},n,null),!(s=o.error)){e.n=2;break}return te([]),El(s,"error"),null==_||_(s),e.a(2);case 2:return te([]),se(!0),e.p=3,u=null,e.n=4,PR(r,{questionId:i,apiConfig:L,uploadQuestionAdditionalDropDown:D,currentFiles:n,onUploaded:function(e){u=e}});case 4:if(c=e.v,Y(c),a({value:c,fileUploads:c}),z(i,c,null,null,{},"upload"),jR(c).then(Z),ce(Math.ceil(c.length/3)),!U||null===(l=u)||void 0===l||!l.base64Response){e.n=9;break}return e.p=5,e.n=6,lR({caseId:(null==L||null===(d=L.customApi)||void 0===d||null===(d=d.headers)||void 0===d?void 0:d.caseId)||(null==L?void 0:L.caseId)||"",fileName:u.fileName,base64:u.base64Response},L);case 6:if(p=e.v,!(sR(p).length>0)){e.n=7;break}throw(f=new Error("WELIS illustration validation failed")).data=p,f;case 7:Xj(p,"Illustration extraction failed"),e.n=9;break;case 8:e.p=8,y=e.v,console.error("WELIS illustration extraction error:",ZR(y)),m=sR(null==y?void 0:y.data),h=m.length>0?m:[Kj(null==y?void 0:y.data,(null==y?void 0:y.message)||"Illustration extraction failed")],te(h),null==_||_(h.join(" "));case 9:e.n=11;break;case 10:e.p=10,g=e.v,console.error("Upload error:",ZR(g)),v=Kj(null==g?void 0:g.data,(null==g?void 0:g.message)||"Upload failed"),El(v,"error"),null==_||_(v);case 11:return e.p=11,se(!1),e.f(11);case 12:return e.a(2)}},e,null,[[5,8],[3,10,11,12]])}));return function(t){return e.apply(this,arguments)}}(),p=function(e,t){var n=$R(G);n[e]=QR(QR({},n[e]),{},{dropDownOptionSelection:t}),a({value:n.map(function(e){return{fileName:e.fileName,base64Response:e.base64Response,fileSize:e.fileSize,fileType:e.fileType,dropDownTitle:e.dropDownTitle,dropDownOptionSelection:e.dropDownOptionSelection}}),fileUploads:n}),z(i,n),ye(n),Y(n)},f=function(e){!1===function(e,t){var n=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==t||null===(e=t.customApi)||void 0===e?void 0:e.s3BucketUrl)||""}(t);if(null!=e&&e.value&&n){try{var r,o=new URL(n.endsWith("/")?n:"".concat(n,"/")),i=String(e.value).trim().split("/").filter(Boolean).map(function(e){return encodeURIComponent(e)}).join("/"),a=new URL(i,o);null===(r=Ml.open)||void 0===r||r.call(Ml,a.toString(),"_blank","noopener")}catch(t){var s;null===(s=Ml.open)||void 0===s||s.call(Ml,"".concat(n,"/").concat(e.value),"_blank","noopener")}return!0}if(null!=e&&e.base64Response){var l=String(e.base64Response||"").trim();if(!Ee.test(l))return!1;var u=Ml.open?Ml.open():null;if(u){var c=function(e){if("string"!=typeof e)return null;var t=e.trim();if(!t.toLowerCase().startsWith("data:"))return null;var n=t.indexOf(",");if(-1===n)return null;var r=t.slice(5,n),o=t.slice(n+1),i=r.split(";").map(function(e){return e.trim()}).filter(Boolean),a=i[0]||"",s=i.some(function(e){return"base64"===e.toLowerCase()});return s&&a?{mimeType:a,base64:o}:null}(l);if(MR.includes(String((null==c?void 0:c.mimeType)||"").toLowerCase())){if(null!=c&&c.mimeType)try{var d,p=function(e){for(var t=Ml.atob?Ml.atob(e):atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r+=1)n[r]=t.charCodeAt(r);return n}(c.base64),f=new Blob([p],{type:c.mimeType}),m=URL.createObjectURL(f);return u.location.href=m,null===(d=u.addEventListener)||void 0===d||d.call(u,"beforeunload",function(){return URL.revokeObjectURL(m)}),!0}catch(e){}return u.location.href=l,!0}var h=u.document;h.open(),h.write("<!DOCTYPE html><html><head><title>Preview</title></head><body></body></html>"),h.close();var v=h.createElement("style");v.textContent="body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; } iframe { width: 100%; height: 100%; border: none; }",h.head.appendChild(v);var y=h.createElement("iframe");y.setAttribute("sandbox","allow-downloads"),y.referrerPolicy="no-referrer",y.src=l,h.body.appendChild(y),u.opener=null}return!0}return!1}(e,L)&&El("Preview is not available for this file.","error")},m=!M||!Array.isArray(G)||G.length<M,h=j?j.split(",").map(function(e){return e.trim().startsWith(".")?e.trim().toLowerCase():".".concat(e.trim().toLowerCase())}).join(","):void 0;return n().createElement("section",{onDragOver:function(e){e.preventDefault(),e.stopPropagation(),s||oe(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),oe(!1)},onDrop:l,style:ve.container,"aria-label":"File upload area"},m&&n().createElement("div",{className:"ff-dropzone-wrapper".concat(ae?" ff-dropzone-wrapper--uploading":"")},n().createElement("input",{ref:W,type:"file",accept:h,multiple:!1,onChange:u,disabled:s||ae,style:ve.input,"data-testid":F}),n().createElement("button",{type:"button",className:"ff-dropzone",style:QR(QR({},ve.dropzone),{},{cursor:s||ae?"not-allowed":"pointer",width:"100%",textAlign:"center"}),onClick:function(){W.current&&!s&&W.current.click()},"aria-label":"Click to upload or drag and drop a file",disabled:s||ae,"aria-disabled":s||ae,"data-testid":dd(V,"upload")},n().createElement("svg",{className:"ff-dropzone__icon",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},n().createElement("path",{d:"M12 16V4M12 4L7.5 8.5M12 4L16.5 8.5M5 14V19C5 19.5523 5.44772 20 6 20H18C18.5523 20 19 19.5523 19 19V14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})),n().createElement("span",{className:"ff-dropzone__title"},"Click to Upload or Drag and Drop"),j&&n().createElement("span",{className:"ff-dropzone__hint"},"Allowed file types: ",n().createElement("strong",null,j.toUpperCase()))),ae&&n().createElement("div",{className:"ff-upload-overlay",role:"status","aria-live":"polite"},n().createElement("div",{className:"ff-upload-spinner","aria-hidden":"true"}),n().createElement("span",{className:"ff-upload-label"},"Uploading..."))),G.length>0&&(t=Math.max(1,Math.ceil(G.length/3)),r=3*(ue-1),o=G.slice(r,r+3),n().createElement("div",{className:"ff-file-manager"},n().createElement("h3",{className:"ff-file-manager__title"},"File Manager"),n().createElement("table",{className:"ff-table"},n().createElement("thead",{className:I||""},n().createElement("tr",null,n().createElement("th",{className:"ff-table__header ff-table__header--doc-name"},"Document Name"),A&&D.length>0&&n().createElement("th",{className:"ff-table__header ff-table__header--doc-type"},"Document Type"),n().createElement("th",{className:"ff-table__header"},"File Type"),n().createElement("th",{className:"ff-table__header"},"Size"),n().createElement("th",{className:"ff-table__header"},"Action"))),n().createElement("tbody",null,o.map(function(e,t){var o,i,a=r+t;return n().createElement(dR,{key:null!==(o=null!==(i=e.id)&&void 0!==i?i:e.value)&&void 0!==o?o:"file-".concat(a),file:e,index:a,errorItemStyle:ve.errorItem,includeExtraDropDowns:A,uploadQuestionAdditionalDropDown:D,allowDelete:O,disabled:s,fieldError:me,onDocumentTypeChange:p,onView:f,onDelete:c,testIdRoot:V})}))),t>1&&n().createElement("div",{className:"ff-pagination",role:"navigation","aria-label":"File list pagination","data-testid":dd(V,"pagination")},n().createElement("span",{className:"ff-pagination__count"},"Showing"," ",n().createElement("strong",null,r+1,"–",Math.min(r+3,G.length))," ","of ",n().createElement("strong",null,G.length)," files"),n().createElement("div",{className:"ff-pagination__controls"},n().createElement("button",{type:"button",className:"ff-pagination__btn ff-pagination__btn--nav",onClick:function(){return ce(function(e){return Math.max(e-1,1)})},disabled:1===ue,"aria-label":"Previous page","data-testid":dd(V,"pagination","prev")},n().createElement(XD,null),"Prev"),Array.from({length:t},function(e,t){return t+1}).map(function(e){return n().createElement("button",{key:e,type:"button",className:"ff-pagination__btn ff-pagination__btn--page".concat(ue===e?" ff-pagination__btn--active":""),onClick:function(){return ce(e)},"aria-label":"Page ".concat(e),"aria-current":ue===e?"page":void 0,"data-testid":dd(V,"pagination","page",e)},e)}),n().createElement("button",{type:"button",className:"ff-pagination__btn ff-pagination__btn--nav",onClick:function(){return ce(function(e){return Math.min(e+1,t)})},disabled:ue===t,"aria-label":"Next page","data-testid":dd(V,"pagination","next")},"Next",n().createElement(tj,null)))))),ee.length>0&&n().createElement("ul",{className:"ff-error-list",style:ve.errorList,role:"alert","data-testid":dd(V,"errors")},ee.map(function(e,t){return n().createElement("li",{key:"error-".concat(e,"-").concat(t),className:"error-message",style:ve.errorItem},e)})))},[G,X,ee,re,ae,pe,fe,ue,ce,v,I,p,w,g,x,_,U]);return n().createElement($O,BR({label:a,value:l,validation:c,disabled:m,className:v,renderInput:ge,styleName:I,customTheme:C},B,{name:i}))},eM=n().memo(JR);JR.propTypes={testId:o().string,testIdRoot:o().string,questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().array,o().object,o().string,o().oneOf([null])]),validation:o().object,multiple:o().bool,disabled:o().bool,className:o().string,maxFileSize:o().number,maxFiles:o().number,showPreview:o().bool,allowDelete:o().bool,onError:o().func,customTheme:o().object,styleName:o().string,includeExtraDropDowns:o().bool,uploadQuestionAdditionalDropDown:o().arrayOf(o().shape({options:o().array})),allowedFileType:o().string,fileSizeLimit:o().number,numberOfFiles:o().number,errorMessage:o().string,addressGroup:o().string,apiConfig:o().shape({caseId:o().string,customApi:o().shape({headers:o().shape({caseId:o().string})})}),fileUploads:o().oneOfType([o().arrayOf(o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),base64Response:o().string,dropDownTitle:o().string,dropDownOptionSelection:o().string})),o().oneOf([null])])},eM.propTypes=JR.propTypes;const tM=eM;var nM=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/HyperlinkField.css"),rM={};rM.styleTagTransform=kl(),rM.setAttributes=bl(),rM.insert=yl().bind(null,"head"),rM.domAPI=hl(),rM.insertStyleElement=Sl(),fl()(nM.A,rM),nM.A&&nM.A.locals&&nM.A.locals;var oM=function(e){var t=e.name,r=e.label,o=e.value,i=e.validation,a=e.className,s=e.customTheme,l=void 0===s?{}:s,u=e.tooltip,c=void 0===u?"":u,d=e.testId,p=sd(),f=YS(p.hyperlinkField||{},l);return n().createElement(zO,{name:String(t),label:r,value:o,validation:i,className:"hyperlink-field ".concat(a||""),customTheme:f,renderLabel:function(e){var t=e.label,r=e.isRequired;return n().createElement("div",{style:f.container,"data-testid":d},n().createElement("div",{style:f.label,dangerouslySetInnerHTML:{__html:RC(t,{addAttr:PC})}}),r&&n().createElement("span",{style:f.required},"*"),c&&n().createElement(hO,{tooltip:c}))},renderInput:function(){return null}})};oM.displayName="HyperlinkField",oM.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,className:o().string,customTheme:o().object,tooltip:o().string,testId:o().string};var iM=n().memo(oM);function aM(e){return aM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aM(e)}function sM(){return sM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sM.apply(null,arguments)}function lM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(t){cM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cM(e,t,n){return(t=function(e){var t=function(e){if("object"!=aM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=aM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}iM.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,target:o().string,validation:o().object,disabled:o().bool,className:o().string,customTheme:o().object,tooltip:o().string,testId:o().string};var pM=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"SSN must be 9 digits":Ne.test(t)?"":"Invalid SSN format"}return""},fM=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"ITIN must be 9 digits":Fe.test(t)?"":"ITIN must start with 9"}return""},mM=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.type,l=void 0===s?"ssn":s,u=t.masked,c=void 0===u||u,d=t.disabled,p=t.className,f=t.customTheme,m=void 0===f?{}:f,h=t.testId,v=t.testIdRoot,y=sd(),g=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(c),2),b=g[0],w=g[1],S=YS(y.identificationField||{},m),x=function(){w(!b)},k=function(e){if(!e||!b)return e;var t=e.split("-");return 3===t.length?"XXX-XX-".concat(t[2]):"XXX-XX-"+e.slice(-4)};return n().createElement(zO,{name:r,label:o,value:i,validation:uM(uM({},a),{},{custom:"ssn"===l?pM:fM}),className:"identification-field ".concat(p||""),customTheme:S,renderInput:function(e){return n().createElement("div",{style:S.container},n().createElement("div",{style:S.fieldGroup},n().createElement("div",{style:S.row},n().createElement("div",{style:S.field},n().createElement("input",sM({},e,{type:"text",maxLength:11,disabled:d,autoComplete:"off",style:uM(uM({},S.input),d&&S.disabled),value:k(e.value),onChange:function(t){return function(e,t){t(function(e){if(e){var t=e.replace(oe,""),n=t.match(Le);return n?"".concat(n[1],"-").concat(n[2],"-").concat(n[3]):t}return""}(e.target.value))}(t,e.onChange)},"data-testid":h})),i&&n().createElement("button",{type:"button",onClick:x,style:uM(uM({},S.actionButton),{},{marginLeft:"8px"}),disabled:d,"data-testid":dd(v,"toggle-visibility")},b?"Show":"Hide"))),n().createElement("div",{style:S.hint},"ssn"===l?"Format: XXX-XX-XXXX":"Format: 9XX-XX-XXXX")))}})};mM.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,type:o().oneOf(["ssn","itin"]),masked:o().bool,disabled:o().bool,className:o().string,customTheme:o().object,testId:o().string,testIdRoot:o().string};var hM=function(e,t){if(t)return"text";switch(null==e?void 0:e.toLowerCase()){case"ssn":case"itin":case"tin":case"currency":case"percentage":default:return"text";case"phonenumber":case"phone":case"mobile":return"tel";case"number":return"number"}};function vM(e){return vM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vM(e)}var yM=["questionId","questionType","maskInput","maskingType","maskingLength","minLength","maxLength","value","onChange","type","userModified"];function gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(t){wM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wM(e,t,n){return(t=function(e){var t=function(e){if("object"!=vM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var kM=function(t){var r=t.questionId,o=t.questionType,i=void 0===o?"number":o,a=t.maskInput,s=t.maskingType,l=t.maskingLength,u=t.minLength,c=t.maxLength,d=t.value,p=t.onChange,f=t.type,m=t.userModified,h=void 0!==m&&m,v=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,yM),y=Vc().setValue,g=Boolean(v.disabled),b=(0,e.useMemo)(function(){var e=a?Ls(a):c||0;return{maskInput:a||null,maskingType:s||null,maskingLength:l||0,minLength:u||0,maxLength:e}},[a,s,l,u,c]),w=(0,e.useMemo)(function(){return"text"===f||"text"===(null==i?void 0:i.toLowerCase())},[f,i]),S=(0,e.useMemo)(function(){return function(e,t,n,r){return!n&&!e&&!t&&"number"===(null==r?void 0:r.toLowerCase())}(a,s,w,i)},[a,s,w,i]),x=SM((0,e.useState)(!1),2),k=x[0],O=x[1],_=SM((0,e.useState)({original:"",masked:""}),2),E=_[0],C=_[1],I=(0,e.useRef)(null),T=(0,e.useMemo)(function(){var e,t;if(h)return!1;var n=null!=d?String(d):"";return!(!n.trim()||!b.maskingType||!b.maskingLength||!n.includes("*")&&(k||null===(e=E.masked)||void 0===e||!e.includes("*"))&&(!k||null===(t=E.original)||void 0===t||!t.includes("*")))},[h,b.maskingType,b.maskingLength,d,E.masked,E.original,k]),A=(0,e.useMemo)(function(){return b.maskingType&&b.maskingLength?k?E.original:E.masked:E.original||d},[E,k,b,d]);(0,e.useEffect)(function(){if(d||E.original||E.masked){var e=d||"";if(b.maskingType&&b.maskingLength){var t=Fs(e,{maskInput:b.maskInput,maskingType:b.maskingType,maskingLength:b.maskingLength,questionType:i});C(t),nt(r,y,t.original,e,I,v)}else if(b.maskInput){var n=Ns(e,b.maskInput,i);C({original:n,masked:n}),nt(r,y,n,e,I,v)}else C({original:e,masked:e})}},[d,b,i]);var P=(0,e.useMemo)(function(){return w?"text":"numeric"},[w]),D=(0,e.useMemo)(function(){return function(e){return["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"].includes(null==e?void 0:e.toLowerCase())?"[0-9]*":void 0}(i)},[i]),j=bM(bM({questionId:r},v),{},{disabled:g||T,type:b.maskInput||S?"text":hM(f||i,b.maskingType),value:A,onChange:function(e){var t,n,r;if(!T){var o=(null===(t=e.target.value)||void 0===t?void 0:t.toString())||"",a=(null==e||null===(n=e.nativeEvent)||void 0===n?void 0:n.inputType)||"",s=(null==e||null===(r=e.nativeEvent)||void 0===r?void 0:r.data)||"",l=function(e,t,n,r,o,i,a,s){if(Boolean(r.maskInput)&&!o&&!s&&String(null!=d?d:"").includes("*"))return e?"insertText"===t&&n?w?n.replace(se,""):n.replace(oe,""):Is(e,a,r.maskInput):"";if(r.maskingType&&r.maskingLength&&!o){var l,u=Is((null==i?void 0:i.original)||"",a,r.maskInput)||"",c=null!==(l=null==i?void 0:i.masked)&&void 0!==l?l:"";if(!e)return"";if("insertText"===t&&n)return"".concat(u).concat(n);if("deleteContentBackward"===t||"deleteContentForward"===t||"deleteByCut"===t){var p=c.length-e.length;if(p>0){var f=Math.min(p,u.length);return u.slice(0,Math.max(0,u.length-f))}return Is(e,a,r.maskInput)}return Is(e,a,r.maskInput)}return Is(e,a,r.maskInput)}(o,a,w?s.replace(se,""):S?s.replace(ae,""):s.replace(oe,""),b,k,E,i,h);l=function(e,t){if("percentage"!==t)return e;var n=e.replace(ie,""),r=Number.parseFloat(n);return Number.isNaN(r)||r<=100?n:"100"}(l,i);var u=w?(l||"").replace(se,"").length:(l||"").replace(oe,"").length;b.maxLength&&u>b.maxLength||function(e,t,n,r){if(n.maskingType&&n.maskingLength){var o=Fs(t,{maskInput:n.maskInput,maskingType:n.maskingType,maskingLength:n.maskingLength,questionType:r});C(o),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:o.original})}))}else if(n.maskInput){var i=Ns(t,n.maskInput,r);C({original:i,masked:i}),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:i})}))}else C({original:t,masked:t}),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:t})}))}(e,l,b,i)}},maskInput:null,inputMode:P,inputProps:bM(bM({},v.inputProps),{},{maxLength:c,pattern:D,inputMode:P}),minLength:u,maxLength:a?a.length:c});b.maskingType&&(j._maskingType=b.maskingType),b.maskingLength&&(j._maskingLength=b.maskingLength);var R=Boolean(b.maskingType&&b.maskingLength&&T&&!g),M=Boolean(b.maskingType&&b.maskingLength&&h&&!T),L=k?"Hide":"Show",N=k?n().createElement(MD,null):n().createElement(PD,null),F={position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1};return n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(SO,j),R&&n().createElement("button",{type:"button",name:"clearMaskedPrefill",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-clear-icon",onClick:function(){if(!g){I.current=null,O(!1),C({original:"",masked:""});var e=v["data-parent-id"]?{cardListId:v["data-parent-id"],instanceIndex:v["data-item-index"]}:null;y(r,"",null,e,{markUserModified:!0})}},title:"Clear to enter a new value","aria-label":"Clear masked value to enter a new value",style:F},n().createElement(VD,{width:18,height:18})),M&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return O(function(e){return!e})},title:"".concat(L," value"),"aria-label":"".concat(L," sensitive information"),style:F},N))};kM.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,questionType:o().oneOf(["text","ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"]),value:o().oneOfType([o().string,o().number]),maskInput:o().string,maskingType:o().oneOfType([o().oneOf(["prefix","suffix"]),o().oneOf([null,void 0])]),maskingLength:o().oneOfType([o().number,o().oneOf([null])]),minLength:o().number,maxLength:o().number,onChange:o().func,type:o().string,validation:o().object,required:o().bool,placeholder:o().string,helperText:o().string,userModified:o().bool,disabled:o().bool,inputProps:o().object,tooltip:o().string};const OM=kM;var _M=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/styles/PasswordField.scss"),EM={};function CM(e){return CM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CM(e)}EM.styleTagTransform=kl(),EM.setAttributes=bl(),EM.insert=yl().bind(null,"head"),EM.domAPI=hl(),EM.insertStyleElement=Sl(),fl()(_M.A,EM),_M.A&&_M.A.locals&&_M.A.locals;var IM=["name","label","required","disabled","defaultValue","placeholder","showPasswordStrength","showPasswordRequirements","passwordRequirements","validationErrorMessages","onChange","error","type","customTheme","styleName","tooltip","testId","testIdRoot"];function TM(){return TM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TM.apply(null,arguments)}function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(t){DM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DM(e,t,n){return(t=function(e){var t=function(e){if("object"!=CM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=CM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return RM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var MM=function(t){var r=t.name,o=t.label,i=t.required,a=t.disabled,s=t.defaultValue,l=void 0===s?"":s,u=t.placeholder,c=t.showPasswordStrength,d=void 0!==c&&c,p=t.showPasswordRequirements,f=void 0!==p&&p,m=t.passwordRequirements,h=void 0===m?["At least 8 characters","At least one uppercase letter","At least one lowercase letter","At least one number","At least one special character"]:m,v=t.validationErrorMessages,y=t.onChange,g=t.error,b=t.type,w=void 0===b?"password":b,S=t.customTheme,x=void 0===S?{}:S,k=t.styleName,O=t.tooltip,_=void 0===O?"":O,E=t.testId,C=t.testIdRoot,I=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,IM),T=sd(),A=jM((0,e.useState)(!1),2),P=A[0],D=A[1],j=jM((0,e.useState)(l),2),R=j[0],M=j[1],L=jM((0,e.useState)(0),2),N=L[0],F=L[1],V=(0,e.useMemo)(function(){var e=T.passwordField||T.textField||{};return YS(e,x)},[T,x]),B=(0,e.useMemo)(function(){var e=PM(PM({},V.container),{},{width:"100%"});return{container:KS(e,V.responsive),input:ZS(V.input,g&&V.error,a&&V.disabled),strengthBar:V.strengthBar||{},strengthLabel:V.strengthLabel||{},requirements:V.requirements||{},requirementMet:V.requirementMet||{},toggleButton:V.toggleButton||{}}},[V,g,a]),q=function(e){var t,n,o=e.target.value;if(M(o),d){var i=(n=0,(t=o).length>=8&&(n+=20),t.length>=12&&(n+=10),/[A-Z]/.test(t)&&(n+=20),/[a-z]/.test(t)&&(n+=20),/\d/.test(t)&&(n+=20),/[^A-Za-z0-9]/.test(t)&&(n+=20),n);F(i)}y&&y({target:{name:r,value:o}})},Q=function(e){e.preventDefault(),D(!P)};return n().createElement($O,{name:String(r),label:o,value:R,required:i,validationErrorMessages:v,error:g,customTheme:V,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:V.label||{}},t,r&&n().createElement("span",{style:V.required||{}},"*"),_&&n().createElement(hO,{tooltip:_})):null},renderInput:function(){return n().createElement("div",{className:"password-field-container ".concat(k||""),style:B.container},n().createElement("div",{className:"password-input-wrapper"},n().createElement("input",TM({type:P?"text":w,id:String(r),name:String(r),value:R,onChange:q,disabled:a,placeholder:u,className:"password-input",style:B.input,autoComplete:"off"},I.inputProps,{"data-testid":E})),n().createElement("button",{type:"button",className:"toggle-password-button",onClick:Q,tabIndex:"-1","aria-label":P?"Hide password":"Show password",style:B.toggleButton,"data-testid":dd(C,"toggle")},P?"👁️":"🔒")),d&&R&&n().createElement("div",{className:"password-strength"},n().createElement("div",{className:"strength-bar-container"},n().createElement("div",{className:"strength-bar",style:PM(PM({},B.strengthBar),{},{width:"".concat(N,"%"),backgroundColor:LM(N)})})),n().createElement("span",{className:"strength-label",style:PM(PM({},B.strengthLabel),{},{color:LM(N)})},(e=N)>=90?"Very Strong":e>=70?"Strong":e>=40?"Medium":e>=20?"Weak":"Very Weak")),f&&n().createElement("ul",{className:"password-requirements",style:B.requirements},h.map(function(e,t){var r=function(e){switch(e){case"At least 8 characters":return R.length>=8;case"At least one uppercase letter":return/[A-Z]/.test(R);case"At least one lowercase letter":return/[a-z]/.test(R);case"At least one number":return/\d/.test(R);case"At least one special character":return/[^A-Za-z0-9]/.test(R);default:return!1}}(e);return n().createElement("li",{key:"requirement-".concat(e,"-").concat(t),className:"requirement ".concat(r?"met":""),style:r?B.requirementMet:{}},r?"✓":"○"," ",e)})));var e}})};MM.propTypes={testId:o().string,testIdRoot:o().string,name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,required:o().bool,disabled:o().bool,defaultValue:o().string,placeholder:o().string,showPasswordStrength:o().bool,showPasswordRequirements:o().bool,passwordRequirements:o().arrayOf(o().string),validationErrorMessages:o().object,onChange:o().func,error:o().string,type:o().string,customTheme:o().object,styleName:o().string,tooltip:o().string,inputProps:o().object};var LM=function(e){return e>=90?"#4caf50":e>=70?"#8bc34a":e>=40?"#ffc107":e>=20?"#ff9800":"#f44336"};const NM=MM;function FM(e){return FM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FM(e)}function VM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VM(Object(n),!0).forEach(function(t){qM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qM(e,t,n){return(t=function(e){var t=function(e){if("object"!=FM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QM=/^(https?:|blob:)/i,zM=function(t){var r=t.label,o=t.value,i=t.disabled,a=t.className,s=t.customTheme,l=void 0===s?{}:s,u=t.testId,c=sd(),d=YS(c.pdfField||{},l),p="string"==typeof o&&""!==o.trim(),f=r||"View PDF",m=(0,e.useCallback)(function(){try{(function(e){var t,n,r=String(e).trim();if(QM.test(r))return null===(n=Ml.open)||void 0===n||n.call(Ml,r,"_blank","noopener,noreferrer"),!0;var o=URL.createObjectURL(function(e){for(var t=e.startsWith("data:")?e.indexOf(","):-1,n=(t>=0?e.slice(t+1):e).replace(/\s/g,"").replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(n.length+(4-n.length%4)%4,"="),o=atob(r),i=new Uint8Array(o.length),a=0;a<o.length;a++)i[a]=o.charCodeAt(a);return new Blob([i],{type:"application/pdf"})}(r)),i=null===(t=Ml.open)||void 0===t?void 0:t.call(Ml,o,"_blank");return setTimeout(function(){return URL.revokeObjectURL(o)},6e4),Boolean(i)})(o)||console.warn("PDFField: the new tab was blocked by the browser popup blocker.")}catch(e){console.error("PDFField: unable to open PDF, value is not valid base64 or a URL.",e)}},[o]);return p?n().createElement("div",{style:d.container},n().createElement("button",{type:"button",style:BM(BM({},d.button),i&&d.disabled),onClick:m,disabled:i,className:"btn btn-primary btn-sm pdf-field-button ".concat(a||"").trim(),"data-testid":u,"aria-label":"".concat(f," (opens PDF in a new tab)")},f)):null};zM.propTypes={value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,disabled:o().bool,className:o().string,customTheme:o().object,testId:o().string};const $M=zM;function UM(e){return UM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UM(e)}function WM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return HM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(HM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,HM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,HM(d,"constructor",u),HM(u,"constructor",l),l.displayName="GeneratorFunction",HM(u,o,"GeneratorFunction"),HM(d),HM(d,o,"Generator"),HM(d,r,function(){return this}),HM(d,"toString",function(){return"[object Generator]"}),(WM=function(){return{w:i,m:p}})()}function HM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}HM=function(e,t,n,r){function i(t,n){HM(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},HM(e,t,n,r)}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GM(Object(n),!0).forEach(function(t){KM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KM(e,t,n){return(t=function(e){var t=function(e){if("object"!=UM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ZM(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){XM(i,r,o,a,s,"next",e)}function s(e){XM(i,r,o,a,s,"throw",e)}a(void 0)})}}function JM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||eL(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eL(e,t){if(e){if("string"==typeof e)return tL(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tL(e,t):void 0}}function tL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nL,rL=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.documents,c=t.onDownload,d=t.onPreview,p=t.customTheme,f=void 0===p?{}:p,m=t.testId,h=t.testIdRoot,v=sd(),y=YS(v.pdfPackageField||{},f),g=JM((0,e.useState)(i||[]),2),b=g[0],w=g[1],S=JM((0,e.useState)({}),2),x=S[0],k=S[1],O=function(){var e=ZM(WM().m(function e(t){return WM().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,k(function(e){return YM(YM({},e),{},KM({},t,!0))}),e.n=1,c(t);case 1:return e.p=1,k(function(e){return YM(YM({},e),{},KM({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=ZM(WM().m(function e(t){return WM().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,k(function(e){return YM(YM({},e),{},KM({},t,!0))}),e.n=1,d(t);case 1:return e.p=1,k(function(e){return YM(YM({},e),{},KM({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}();return n().createElement(zO,{name:r,label:o,value:b,validation:a,className:l,customTheme:y,renderInput:function(){return n().createElement("div",{style:y.container,"data-testid":m},u.map(function(e){return n().createElement("div",{key:e.id,style:y.item,"data-testid":dd(h,"doc",e.id)},n().createElement("div",{style:y.itemHeader},n().createElement("input",{type:"checkbox",id:"doc-".concat(e.id),checked:b.includes(e.id),onChange:function(){return t=e.id,void w(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(function(e){return function(e){if(Array.isArray(e))return tL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||eL(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[t])});var t},disabled:s,style:YM(YM({},y.checkbox),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"checkbox")}),n().createElement("label",{htmlFor:"doc-".concat(e.id),style:y.label},e.name)),n().createElement("div",{style:y.description},e.description),n().createElement("div",{style:y.actions},n().createElement("button",{type:"button",onClick:function(){return _(e.id)},disabled:s||x[e.id],style:YM(YM(YM({},y.button),y.previewButton),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"preview")},x[e.id]?"Loading...":"Preview"),n().createElement("button",{type:"button",onClick:function(){return O(e.id)},disabled:s||x[e.id],style:YM(YM(YM({},y.button),y.downloadButton),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"download")},x[e.id]?"Loading...":"Download")))}))}})};function oL(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function iL(){}function aL(e){return!!(e||"").match(/\d/)}function sL(e){return null==e}function lL(e){return sL(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function uL(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function cL(e,t){void 0===t&&(t=!0);var n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split(".");return{beforeDecimal:o[0],afterDecimal:o[1]||"",hasNegation:n,addNegation:r}}function dL(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function pL(e,t){return Array(t+1).join(e)}function fL(e){var t=e+"",n="-"===t[0]?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(!(i=Number(i)))return n+o;var a=1+i,s=(o=o.replace(".","")).length;return a<0?o="0."+pL("0",Math.abs(a))+o:a>=s?o+=pL("0",a-s):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function mL(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=(-1!==e.indexOf(".")||n)&&t,o=cL(e),i=o.beforeDecimal,a=o.afterDecimal,s=o.hasNegation,l=parseFloat("0."+(a||"0")),u=(a.length<=t?"0."+a:l.toFixed(t)).split("."),c=i;return i&&Number(u[0])&&(c=i.split("").reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0])),(s?"-":"")+c+(r?".":"")+dL(u[1]||"",t,n)}function hL(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}rL.propTypes={name:o().string.isRequired,label:o().string,value:o().arrayOf(o().string),validation:o().object,disabled:o().bool,className:o().string,documents:o().arrayOf(o().shape({id:o().string.isRequired,name:o().string.isRequired,description:o().string})).isRequired,onDownload:o().func.isRequired,onPreview:o().func.isRequired,customTheme:o().object,testId:o().string,testIdRoot:o().string},function(e){e.event="event",e.props="prop"}(nL||(nL={}));var vL,yL,gL,bL=(vL=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}},gL=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return yL&&e.length===yL.length&&e.every(function(e,t){return e===yL[t]})?gL:(yL=e,gL=vL.apply(void 0,e))});function wL(e){return Math.max(e.selectionStart,e.selectionEnd)}function SL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function xL(e,t,n,r){var o,i,a=e.length;if(o=t,i=a,t=Math.min(Math.max(o,0),i),"left"===r){for(;t>=0&&!n[t];)t--;-1===t&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return-1===t&&(t=a),t}function kL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=Boolean(aL(e[n])||aL(e[n-1]));return t}function OL(t,n,r,o,i,a){void 0===a&&(a=iL);var s=function(t){var n=(0,e.useRef)(t);n.current=t;var r=(0,e.useRef)(function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.current.apply(n,e)});return r.current}(function(e,t){var n,r;return lL(e)?(r="",n=""):"number"==typeof e||t?(r="number"==typeof e?fL(e):e,n=o(r)):(r=i(e,void 0),n=o(r)),{formattedValue:n,numAsString:r}}),l=(0,e.useState)(function(){return s(sL(t)?n:t,r)}),u=l[0],c=l[1],d=t,p=r;sL(t)&&(d=u.numAsString,p=!0);var f=s(d,p);return(0,e.useMemo)(function(){c(f)},[f.formattedValue]),[u,function(e,t){e.formattedValue!==u.formattedValue&&c({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}]}function _L(e){return e.replace(/[^0-9]/g,"")}function EL(e){return e}function CL(t){var r=t.type;void 0===r&&(r="text");var o=t.displayType;void 0===o&&(o="input");var i=t.customInput,a=t.renderText,s=t.getInputRef,l=t.format;void 0===l&&(l=EL);var u=t.removeFormatting;void 0===u&&(u=_L);var c=t.defaultValue,d=t.valueIsNumericString,p=t.onValueChange,f=t.isAllowed,m=t.onChange;void 0===m&&(m=iL);var h=t.onKeyDown;void 0===h&&(h=iL);var v=t.onMouseUp;void 0===v&&(v=iL);var y=t.onFocus;void 0===y&&(y=iL);var g=t.onBlur;void 0===g&&(g=iL);var b=t.value,w=t.getCaretBoundary;void 0===w&&(w=kL);var S=t.isValidInputCharacter;void 0===S&&(S=aL);var x=t.isCharacterSame,k=oL(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),O=OL(b,c,Boolean(d),l,u,p),_=O[0],E=_.formattedValue,C=_.numAsString,I=O[1],T=(0,e.useRef)(),A=(0,e.useRef)({formattedValue:E,numAsString:C}),P=function(e,t){A.current={formattedValue:e.formattedValue,numAsString:e.value},I(e,t)},D=(0,e.useState)(!1),j=D[0],R=D[1],M=(0,e.useRef)(null),L=(0,e.useRef)({setCaretTimeout:null,focusTimeout:null});(0,e.useEffect)(function(){return R(!0),function(){clearTimeout(L.current.setCaretTimeout),clearTimeout(L.current.focusTimeout)}},[]);var N=l,F=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},V=function(e,t,n){0===e.selectionStart&&e.selectionEnd===e.value.length||(hL(e,t),L.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&hL(e,t)},0))},B=function(e,t,n){return xL(e,t,w(e),n)},q=function(e,t,n){var r=w(t),o=function(e,t,n,r,o,i,a){void 0===a&&(a=SL);var s=o.findIndex(function(e){return e}),l=e.slice(0,s);t||n.startsWith(l)||(t=l,n=l+n,r+=l.length);for(var u=n.length,c=e.length,d={},p=new Array(u),f=0;f<u;f++){p[f]=-1;for(var m=0,h=c;m<h;m++)if(a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:m})&&!0!==d[m]){p[f]=m,d[m]=!0;break}}for(var v=r;v<u&&(-1===p[v]||!i(n[v]));)v++;var y=v===u||-1===p[v]?c:p[v];for(v=r-1;v>0&&-1===p[v];)v--;var g=-1===v||-1===p[v]?0:p[v]+1;return g>y?y:r-g<y-r?g:y}(t,E,e,n,r,S,x);return xL(t,o,r)};(0,e.useEffect)(function(){var e=A.current,t=e.formattedValue,n=e.numAsString;E===t&&C===n||P(F(E,C),{event:void 0,source:nL.props})},[E,C]);var Q=M.current?wL(M.current):void 0;("undefined"!=typeof window?e.useLayoutEffect:e.useEffect)(function(){var e=M.current;if(E!==A.current.formattedValue&&e){var t=q(A.current.formattedValue,E,Q);e.value=E,V(e,t,E)}},[E]);var z=function(e,t){void 0===t&&(t=0);var n=e.selectionStart,r=e.selectionEnd;T.current={selectionStart:n,selectionEnd:r+t}},$=!j||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",U=Object.assign({inputMode:$},k,{type:r,value:E,onChange:function(e){(function(e,t,n){var r=t.target,o=T.current?function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}(T.current,r.selectionEnd):bL(E,e),i=Object.assign(Object.assign({},o),{lastValue:E}),a=u(e,i),s=N(a);if(a=u(s,void 0),f&&!f(F(s,a))){var l=t.target,c=wL(l),d=q(e,E,c);return l.value=E,V(l,d,E),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var n,r=e.input,o=e.source,i=e.event,a=e.numAsString;if(r){var s=e.inputValue||r.value,l=wL(r);r.value=t,void 0!==(n=q(s,t,l))&&V(r,n,t)}t!==E&&P(F(t,a),{event:i,source:o})}({formattedValue:s,numAsString:a,inputValue:e,event:t,source:n,input:t.target}),!0})(e.target.value,e,nL.event)&&m(e),T.current=void 0},onKeyDown:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,a=n.value;void 0===a&&(a=""),"ArrowLeft"===r||"Backspace"===r?t=Math.max(o-1,0):"ArrowRight"===r?t=Math.min(o+1,a.length):"Delete"===r&&(t=o);var s=0;"Delete"===r&&o===i&&(s=1);var l="ArrowLeft"===r||"ArrowRight"===r;if(void 0===t||o!==i&&!l)return h(e),void z(n,s);var u=t;l?(u=B(a,t,"ArrowLeft"===r?"left":"right"))!==t&&e.preventDefault():"Delete"!==r||S(a[t])?"Backspace"!==r||S(a[t])||(u=B(a,t,"left")):u=B(a,t,"right"),u!==t&&V(n,u,a),h(e),z(n,s)},onMouseUp:function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(void 0===r&&(r=""),e===n){var o=B(r,e);o!==e&&V(t,o,r)}};n(),requestAnimationFrame(function(){n()}),v(e),z(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;M.current=t,L.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,o=t.selectionEnd,i=t.value;void 0===i&&(i="");var a=B(i,r);a===r||0===r&&o===i.length||V(t,a,i),y(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},onBlur:function(e){M.current=null,clearTimeout(L.current.focusTimeout),clearTimeout(L.current.setCaretTimeout),g(e)}});if("text"===o)return a?n().createElement(n().Fragment,null,a(E,k)||null):n().createElement("span",Object.assign({},k,{ref:s}),E);if(i){var W=i;return n().createElement(W,Object.assign({},U,{ref:s}))}return n().createElement("input",Object.assign({},U,{ref:s}))}function IL(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;void 0===o&&(o="");var i=t.suffix;void 0===i&&(i="");var a=t.allowNegative,s=t.thousandsGroupStyle;if(void 0===s&&(s="thousand"),""===e||"-"===e)return e;var l=TL(t),u=l.thousandSeparator,c=l.decimalSeparator,d=0!==n&&-1!==e.indexOf(".")||n&&r,p=cL(e,a),f=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=dL(m,n,!!r)),u&&(f=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(f,u,s)),o&&(f=o+f),i&&(m+=i),h&&(f="-"+f),f+(d&&c||"")+m}function TL(e){var t=e.decimalSeparator;void 0===t&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function AL(e){e=function(e){var t=TL(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;void 0===o&&(o="");var i=e.allowNegative;if(void 0===i&&(i=!0),n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+n+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");return o.startsWith("-")&&i&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+o+"\n allowNegative: "+i+"\n "),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;void 0===o&&(o=iL);var i=e.onBlur;void 0===i&&(i=iL);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;void 0===u&&(u="");var c=e.defaultValue,d=e.value,p=e.valueIsNumericString,f=e.onValueChange,m=oL(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=TL(e),v=h.decimalSeparator,y=h.allowedDecimalSeparators,g=function(t){return IL(t,e)},b=function(t,n){return function(e,t,n){var r;void 0===t&&(t=function(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}(e));var o=n.allowNegative,i=n.prefix;void 0===i&&(i="");var a=n.suffix;void 0===a&&(a="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,p=TL(n),f=p.allowedDecimalSeparators,m=p.decimalSeparator,h=e[d]===m;if(aL(e)&&(e===i||e===a)&&""===t.lastValue)return e;if(d-c===1&&-1!==f.indexOf(e[c])){var v=0===s?"":m;e=e.substring(0,c)+v+e.substring(c+1,e.length)}var y=function(e,t,n){var r=!1,o=!1;i.startsWith("-")?r=!1:e.startsWith("--")?(r=!1,o=!0):a.startsWith("-")&&e.length===a.length?r=!1:"-"===e[0]&&(r=!0);var s=r?1:0;return o&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},g=y(e,c,d),b=g.hasNegation;e=(r=g).value,c=r.start,d=r.end;var w=y(t.lastValue,l.start,l.end),S=w.start,x=w.end,k=w.value,O=e.substring(c,d);!(e.length&&k.length&&(S>k.length-a.length||x<i.length))||O&&a.startsWith(O)||(e=k);var _=0;e.startsWith(i)?_+=i.length:c<i.length&&(_=c),d-=_;var E=(e=e.substring(_)).length,C=e.length-a.length;e.endsWith(a)?E=C:(d>C||d>e.length-a.length)&&(E=d),e=e.substring(0,E),e=function(e,t){void 0===e&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}(b?"-"+e:e,o),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+uL(e),"g")}(m))||[]).join("");var I=e.indexOf(m);e=e.replace(new RegExp(uL(m),"g"),function(e,t){return t===I?".":""});var T=cL(e,o),A=T.beforeDecimal,P=T.afterDecimal,D=T.addNegation;return u.end-u.start<l.end-l.start&&""===A&&h&&!parseFloat(P)&&(e=D?"-":""),e}(t,n,e)},w=sL(d)?c:d,S=null!=p?p:function(e,t,n){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==n?void 0:n.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(w,u,t);sL(d)?sL(c)||(S=S||"number"==typeof c):S=S||"number"==typeof d;var x=function(e){return lL(e)?e:("number"==typeof e&&(e=fL(e)),S&&"number"==typeof s?mL(e,s,Boolean(l)):e)},k=OL(x(d),x(c),Boolean(S),g,b,f),O=k[0],_=O.numAsString,E=O.formattedValue,C=k[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===v||aL(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,o=e.currentValueIndex,i=e.formattedValueIndex,a=t[o],c=r[i],p=bL(n,t).to,f=function(e){return b(e).indexOf(".")+u.length};return!(0===d&&l&&s&&t[p.start]===v&&f(t)<o&&f(r)>i||!(o>=p.start&&o<p.end&&y&&y.includes(a)&&c===v)&&a!==c)},onValueChange:C,format:g,removeFormatting:b,getCaretBoundary:function(t){return function(e,t){var n=t.prefix;void 0===n&&(n="");var r=t.suffix;void 0===r&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i="-"===e[0];o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,i=t.selectionStart,c=t.selectionEnd,d=t.value;if(void 0===d&&(d=""),("Backspace"===r||"Delete"===r)&&c<u.length)e.preventDefault();else if(i===c){"Backspace"===r&&"-"===d[0]&&i===u.length+1&&n&&hL(t,1),s&&l&&("Backspace"===r&&d[i-1]===v?(hL(t,i-1),e.preventDefault()):"Delete"===r&&d[i]===v&&e.preventDefault()),(null==y?void 0:y.includes(r))&&d[i]===v&&hL(t,i+1);var p=!0===a?",":a;"Backspace"===r&&d[i-1]===p&&hL(t,i-1),"Delete"===r&&d[i]===p&&hL(t,i+1),o(e)}else o(e)},onBlur:function(t){var n=_;if(n.match(/\d/g)||(n=""),r||(n=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}(n)),l&&s&&(n=mL(n,s,l)),n!==_){var o=IL(n,e);C({formattedValue:o,value:n,floatValue:parseFloat(n)},{event:t,source:nL.event})}i(t)}})}function PL(e){var t=AL(e);return n().createElement(CL,Object.assign({},t))}function DL(e){return DL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DL(e)}var jL=["questionId","label","value","onChange","minValue","maxValue","decimalScale","required","disabled","placeholder","helperText","tooltip","error","validationErrorMessages","className","hideLabel","visible","defaultValue","inputProps","styleName","customTheme","header","onBlur","showQuestionLabels","testId"];function RL(){return RL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RL.apply(null,arguments)}function ML(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ML(Object(n),!0).forEach(function(t){NL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NL(e,t,n){return(t=function(e){var t=function(e){if("object"!=DL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=DL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FL=function(t){var r,o,i,a=t.questionId,s=t.label,l=t.value,u=t.onChange,c=t.minValue,d=t.maxValue,p=t.decimalScale,f=t.required,m=t.disabled,h=t.placeholder,v=t.helperText,y=(t.tooltip,t.error),g=(t.validationErrorMessages,t.className),b=(t.hideLabel,t.visible),w=void 0===b||b,S=t.defaultValue,x=t.inputProps,k=void 0===x?{}:x,O=t.styleName,_=t.customTheme,E=void 0===_?{}:_,C=t.header,I=t.onBlur,T=t.showQuestionLabels,A=void 0===T||T,P=t.testId,D=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,jL),j=Vc(),R=j.state,M=j.setValue,L=sd(),N=k["data-item-index"],F=k["data-parent-id"],V=$S({questionId:a,itemIndex:N,defaultValue:S,defaultVisible:!0,defaultDisabled:!1}),B=V.disabled,q=V.handleChange,Q=null!=l?l:R.values[a],z=null!=c?c:0,$=null!=d?d:100,U="number"==typeof z&&z<0||null!=Q&&String(Q).trim().startsWith("-"),W=y||(null==R||null===(r=R.ruleValidationErrors)||void 0===r?void 0:r[a])||(null==R||null===(o=R.apiErrors)||void 0===o?void 0:o[a])||(null==R||null===(i=R.errors)||void 0===i?void 0:i[a])||null,H=Boolean(W),G=(0,e.useMemo)(function(){var e=L.textField||L.percentageField||{};return YS(e,E)},[L,E]),Y=(0,e.useMemo)(function(){var e=LL(LL({},G.container),{},{width:"100%"}),t=ZS(G.input,H&&G.error,(B||m)&&G.disabled);return{container:KS(e,G.responsive),input:t,sx:XS(G.disabled)}},[G,H,B,m]);if(w){var K=h||"Enter percentage (".concat(z,"-").concat($,")"),X=N?"".concat(a,"-").concat(N):a,Z=null!=B&&""!==B?B:m;return n().createElement("div",{className:"form-field ".concat(O||""," ").concat(g||""),style:Y.container},C&&n().createElement("div",{className:"field-header",style:L.header},C),n().createElement(PL,RL({customInput:NS,sx:Y.sx,suffix:"%",disabled:Z},null!=p&&{decimalScale:p},{allowNegative:U,min:z,max:$,isAllowed:function(e){var t=e.floatValue;return void 0===t||t>=z&&t<=$},onValueChange:function(e){var t=e.value;q&&q(t,void 0!==N&&void 0!==F?{cardListId:F,instanceIndex:N}:{}),M&&M(a,t),u&&u({target:{name:a,value:t}})},value:Q||"",placeholder:K,autoComplete:"off",required:f,error:H,helperText:W||v||"",label:A?s:"",id:String(X),name:String(X),slotProps:{input:{inputProps:{"data-testid":P}},inputLabel:{style:L.label,required:A&&f},formHelperText:{style:H?L.error:L.helperText,sx:{marginLeft:0,marginRight:0}}},onBlur:I,fullWidth:!0,"data-item-index":N,"data-parent-id":F},D)))}return null};FL.propTypes={testId:o().string,questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),defaultValue:o().oneOfType([o().string,o().number]),onChange:o().func,minValue:o().number,maxValue:o().number,decimalScale:o().number,required:o().bool,disabled:o().bool,placeholder:o().string,helperText:o().string,tooltip:o().string,error:o().string,validationErrorMessages:o().object,className:o().string,hideLabel:o().bool,visible:o().bool,inputProps:o().object,styleName:o().string,customTheme:o().object,header:o().string,onBlur:o().func,showQuestionLabels:o().bool},FL.defaultProps={minValue:0,maxValue:100,decimalScale:null,required:!1,disabled:!1,visible:!0,hideLabel:!1,inputProps:{}};const VL=FL;function BL(e){return BL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BL(e)}function qL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qL(Object(n),!0).forEach(function(t){zL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zL(e,t,n){return(t=function(e){var t=function(e){if("object"!=BL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=BL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $L=function(t){var r=t.questionId,o=t.label,i=t.value,a=void 0===i?"":i,s=t.options,l=void 0===s?[]:s,u=t.disabled,c=void 0!==u&&u,d=t.required,p=void 0!==d&&d,f=t.onChange,m=t.inputProps,h=void 0===m?{}:m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.error,S=t.helperText,x=t.tooltip,k=void 0===x?"":x,O=t.showQuestionLabels,_=void 0===O||O,E=t.testIdRoot,C=sd(),I=Vc().state,T=h["data-parent-id"],A=h["data-item-index"],P=(0,e.useMemo)(function(){var e,t,n=null===(e=I.optionVisibility)||void 0===e?void 0:e[r];return null!=T&&void 0!==A&&null!==(t=I.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[T])&&void 0!==t&&null!==(t=t[Number(A)])&&void 0!==t&&t[r]&&(n=I.optionVisibilityByInstance[T][Number(A)][r]),n?l.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):l},[l,I.optionVisibility,I.optionVisibilityByInstance,r,T,A]),D=function(e){null==f||f(e)},j=(0,e.useMemo)(function(){var e=C.radioField||{};return YS(e,b)},[C,b]),R=(0,e.useMemo)(function(){var e=QL(QL({},j.container),{},{width:"100%"}),t=ZS(j.radioGroup,w&&j.error,c&&j.disabled),n=ZS(j.radioOption,c&&j.disabled);return{container:KS(e,j.responsive),radioGroup:t,radioOption:n,radio:j.radio,label:j.optionLabel}},[j,w,c]);return n().createElement("div",{className:"form-field ".concat(y||""),style:R.container},v&&n().createElement("div",{className:"field-header",style:C.header},v),_&&o&&n().createElement("div",{className:"question_label",style:C.label},o,p&&n().createElement("span",{className:"required-mark",style:C.requiredMark},"*"),k&&n().createElement(hO,{tooltip:k})),n().createElement("div",{className:"radio-group",style:R.radioGroup},P.map(function(e,t){var o,i,s,l,u=null!==(o=e.value)&&void 0!==o?o:e,d=null!==(i=e.label)&&void 0!==i?i:e,f=void 0===A?"":"-".concat(A),m="".concat(r,"-").concat(T||"","-").concat(t).concat(f),h=(null===(s=String(a))||void 0===s?void 0:s.trim())===(null===(l=String(u))||void 0===l?void 0:l.trim()),v=dd(E,"option",u),y=dd(E,"option",u,"input");return n().createElement("div",{key:m,className:"radio-option",style:R.radioOption,"data-testid":v},n().createElement("input",{type:"radio",id:m,name:void 0===A?r:"".concat(r,"-").concat(A),value:u,checked:h,onChange:D,disabled:c,required:p,"data-item-index":A,"data-parent-id":T,style:R.radio,"data-testid":y}),n().createElement("label",{htmlFor:m,style:R.label},d))})),S&&n().createElement("div",{className:"helper-text",style:C.helperText},S))};$L.propTypes={questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().number,o().bool]),options:o().arrayOf(o().oneOfType([o().string,o().number,o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number,o().bool]).isRequired})])),disabled:o().bool,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,tooltip:o().string,showQuestionLabels:o().bool,testIdRoot:o().string};const UL=$L;var WL=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/RadioTabButtonsField.css"),HL={};function GL(e){return GL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GL(e)}HL.styleTagTransform=kl(),HL.setAttributes=bl(),HL.insert=yl().bind(null,"head"),HL.domAPI=hl(),HL.insertStyleElement=Sl(),fl()(WL.A,HL),WL.A&&WL.A.locals&&WL.A.locals;var YL=["name","label","value","onChange","options","disabled","required","error","_validation","header","styleName","customTheme","_questionId","_encrypted","_maskingType","_maskingLength","tooltip","showQuestionLabels","testIdRoot"];function KL(){return KL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KL.apply(null,arguments)}function XL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XL(Object(n),!0).forEach(function(t){JL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JL(e,t,n){return(t=function(e){var t=function(e){if("object"!=GL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var eN=function(t){var r=t.name,o=t.label,i=t.value,a=void 0===i?"":i,s=t.onChange,l=t.options,u=void 0===l?[]:l,c=t.disabled,d=t.required,p=t.error,f=(t._validation,t.header),m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=(t._questionId,t._encrypted,t._maskingType,t._maskingLength,t.tooltip),g=void 0===y?"":y,b=t.showQuestionLabels,w=void 0===b||b,S=t.testIdRoot,x=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,YL),k=sd(),O=(0,e.useMemo)(function(){var e=k.radioTabButtonsField||k.radioField||{};return YS(e,v)},[k,v]),_=(0,e.useMemo)(function(){var e=ZL(ZL({},O.container),{},{width:"100%"}),t=ZS(O.tabGroup),n=ZS(O.tab,c&&O.disabled),r=ZS(O.selectedTab),o=ZS(O.disabledTab),i=ZS(O.label,d&&O.required,c&&O.disabled);return{container:KS(e,O.responsive),tabGroup:t,tab:n,selectedTab:r,disabledTab:o,label:i,header:ZS(O.header),error:ZS(O.error)}},[O,d,c]);return n().createElement("div",{className:"radio-tab-buttons-field ".concat(m||""),style:_.container},f&&n().createElement("div",{className:"field-header",style:_.header},f),w&&o&&n().createElement("div",{className:"question_label",style:_.label},o,d&&n().createElement("span",{style:O.required},"*"),g&&n().createElement(hO,{tooltip:g})),n().createElement("div",{className:"radio-tab-buttons-wrapper",style:_.tabGroup},u.map(function(e){var t=String(a).toLowerCase()===String(e.value).toLowerCase(),o=dd(S,"option",e.value);return n().createElement("button",KL({key:e.value,type:"button",onClick:function(){return t=e.value,void(c||!s||s({target:{name:r,value:t}}));var t},disabled:c,style:ZL(ZL(ZL({},_.tab),t?_.selectedTab:{}),c?_.disabledTab:{})},x,{"data-testid":o}),e.label)})),p&&n().createElement("div",{style:_.error},p))};eN.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,onChange:o().func,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().any.isRequired,name:o().string,text:o().string,selected:o().bool,optionId:o().number,sortOrder:o().number,uncheckOthers:o().bool})),disabled:o().bool,required:o().bool,error:o().string,_validation:o().object,header:o().node,styleName:o().string,customTheme:o().object,_questionId:o().oneOfType([o().string,o().number]),_encrypted:o().bool,_maskingType:o().string,_maskingLength:o().oneOfType([o().string,o().number]),tooltip:o().string,showQuestionLabels:o().bool,testIdRoot:o().string};function tN(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}const nN=function(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let u=a?s.trim():s;n&&(u=u.toLowerCase()),t&&(u=tN(u));const c=u?e.filter(e=>{let r=(i||l)(e);return n&&(r=r.toLowerCase()),t&&(r=tN(r)),"start"===o?r.startsWith(u):r.includes(u)}):e;return"number"==typeof r?c.slice(0,r):c}}(),rN=e=>null!==e.current&&e.current.parentElement?.contains(document.activeElement),oN=[];function iN(e,t,n){if(t||null==e)return"";const r=n(e);return"string"==typeof r?r:""}const aN=function(t){const{unstable_isActiveElementInListbox:n=rN,unstable_classNamePrefix:r="Mui",autoComplete:o=!1,autoHighlight:i=!1,autoSelect:a=!1,blurOnSelect:s=!1,clearOnBlur:l=!t.freeSolo,clearOnEscape:u=!1,componentName:c="useAutocomplete",defaultValue:d=(t.multiple?oN:null),disableClearable:p=!1,disableCloseOnSelect:f=!1,disabled:m,disabledItemsFocusable:h=!1,disableListWrap:v=!1,filterOptions:y=nN,filterSelectedOptions:g=!1,freeSolo:b=!1,getOptionDisabled:w,getOptionKey:S,getOptionLabel:x=e=>e.label??e,groupBy:k,handleHomeEndKeys:O=!t.freeSolo,id:_,includeInputInList:E=!1,inputValue:C,isOptionEqualToValue:I=(e,t)=>e===t,multiple:T=!1,onChange:A,onClose:P,onHighlightChange:D,onInputChange:j,onOpen:R,open:M,openOnFocus:L=!1,options:N,readOnly:F=!1,selectOnFocus:V=!t.freeSolo,value:B}=t,q=Bp(_);let Q=x;Q=e=>{const t=x(e);return"string"!=typeof t?String(t):t};const z=e.useRef(!1),$=e.useRef(!0),U=e.useRef(null),W=e.useRef(null),[H,G]=e.useState(null),[Y,K]=e.useState(-1),X=i?0:-1,Z=e.useRef(X),J=e.useRef(iN(d??B,T,Q)).current,[ee,te]=cS({controlled:B,default:d,name:c}),[ne,re]=cS({controlled:C,default:J,name:c,state:"inputValue"}),[oe,ie]=e.useState(!1),ae=e.useCallback((e,t,n)=>{if(!(T?ee.length<t.length:null!==t)&&!l)return;const r=iN(t,T,Q);ne!==r&&(re(r),j&&j(e,r,n))},[Q,ne,T,j,re,l,ee]),[se,le]=cS({controlled:M,default:!1,name:c,state:"open"}),[ue,ce]=e.useState(!0),de=!T&&null!=ee&&ne===Q(ee),pe=se&&!F,fe=pe?y(N.filter(e=>!g||!(T?ee:[ee]).some(t=>null!==t&&I(e,t))),{inputValue:de&&ue?"":ne,getOptionLabel:Q}):[],me=(t=>{const n=e.useRef({});return e.useEffect(()=>{n.current=t}),n.current})({filteredOptions:fe,value:ee,inputValue:ne});e.useEffect(()=>{const e=ee!==me.value;oe&&!e||b&&!e||ae(null,ee,"reset")},[ee,ae,oe,me.value,b]);const he=se&&fe.length>0&&!F,ve=My(e=>{-1===e?U.current.focus():H.querySelector(`[data-tag-index="${e}"]`).focus()});e.useEffect(()=>{T&&Y>ee.length-1&&(K(-1),ve(-1))},[ee,T,Y,ve]);const ye=My(({event:e,index:t,reason:n})=>{if(Z.current=t,-1===t?U.current.removeAttribute("aria-activedescendant"):U.current.setAttribute("aria-activedescendant",`${q}-option-${t}`),D&&["mouse","keyboard","touch"].includes(n)&&D(e,-1===t?null:fe[t],n),!W.current)return;const o=W.current.querySelector(`[role="option"].${r}-focused`);o&&(o.classList.remove(`${r}-focused`),o.classList.remove(`${r}-focusVisible`));let i=W.current;if("listbox"!==W.current.getAttribute("role")&&(i=W.current.parentElement.querySelector('[role="listbox"]')),!i)return;if(-1===t)return void(i.scrollTop=0);const a=W.current.querySelector(`[data-option-index="${t}"]`);if(a&&(a.classList.add(`${r}-focused`),"keyboard"===n&&a.classList.add(`${r}-focusVisible`),i.scrollHeight>i.clientHeight&&"mouse"!==n&&"touch"!==n)){const e=a,t=i.clientHeight+i.scrollTop,n=e.offsetTop+e.offsetHeight;n>t?i.scrollTop=n-i.clientHeight:e.offsetTop-e.offsetHeight*(k?1.3:0)<i.scrollTop&&(i.scrollTop=e.offsetTop-e.offsetHeight*(k?1.3:0))}}),ge=My(({event:e,diff:t,direction:n="next",reason:r})=>{if(!pe)return;const i=function(e,t){if(!W.current||e<0||e>=fe.length)return-1;let n=e;for(;;){const r=W.current.querySelector(`[data-option-index="${n}"]`),o=!h&&(!r||r.disabled||"true"===r.getAttribute("aria-disabled"));if(r&&r.hasAttribute("tabindex")&&!o)return n;if(n="next"===t?(n+1)%fe.length:(n-1+fe.length)%fe.length,n===e)return-1}}((()=>{const e=fe.length-1;if("reset"===t)return X;if("start"===t)return 0;if("end"===t)return e;const n=Z.current+t;return n<0?-1===n&&E?-1:v&&-1!==Z.current||Math.abs(t)>1?0:e:n>e?n===e+1&&E?-1:v||Math.abs(t)>1?e:0:n})(),n);if(ye({index:i,reason:r,event:e}),o&&"reset"!==t)if(-1===i)U.current.value=ne;else{const e=Q(fe[i]);U.current.value=e,0===e.toLowerCase().indexOf(ne.toLowerCase())&&ne.length>0&&U.current.setSelectionRange(ne.length,e.length)}}),be=e.useCallback(()=>{if(!pe)return;const e=(()=>{if(-1!==Z.current&&me.filteredOptions&&me.filteredOptions.length!==fe.length&&me.inputValue===ne&&(T?ee.length===me.value.length&&me.value.every((e,t)=>Q(ee[t])===Q(e)):(e=me.value,t=ee,(e?Q(e):"")===(t?Q(t):"")))){const e=me.filteredOptions[Z.current];if(e)return fe.findIndex(t=>Q(t)===Q(e))}var e,t;return-1})();if(-1!==e)return void(Z.current=e);const t=T?ee[0]:ee;if(0!==fe.length&&null!=t){if(W.current){if(null!=t){const e=fe[Z.current];if(T&&e&&-1!==ee.findIndex(t=>I(e,t)))return;const n=fe.findIndex(e=>I(e,t));return void(-1===n?ge({diff:"reset"}):ye({index:n}))}Z.current>=fe.length-1?ye({index:fe.length-1}):ye({index:Z.current})}}else ge({diff:"reset"})},[fe.length,!T&&ee,g,ge,ye,pe,ne,T]),we=My(e=>{vw(W,e),e&&be()});e.useEffect(()=>{be()},[be]);const Se=e=>{se||(le(!0),ce(!0),R&&R(e))},xe=(e,t)=>{se&&(le(!1),P&&P(e,t))},ke=(e,t,n,r)=>{if(T){if(ee.length===t.length&&ee.every((e,n)=>e===t[n]))return}else if(ee===t)return;A&&A(e,t,n,r),te(t)},Oe=e.useRef(!1),_e=(e,t,n="selectOption",r="options")=>{let o=n,i=t;if(T){i=Array.isArray(ee)?ee.slice():[];const e=i.findIndex(e=>I(t,e));-1===e?i.push(t):"freeSolo"!==r&&(i.splice(e,1),o="removeOption")}ae(e,i,o),ke(e,i,o,{option:t}),f||e&&(e.ctrlKey||e.metaKey)||xe(e,o),(!0===s||"touch"===s&&Oe.current||"mouse"===s&&!Oe.current)&&U.current.blur()},Ee=(e,t)=>{if(!T)return;""===ne&&xe(e,"toggleInput");let n=Y;-1===Y?""===ne&&"previous"===t&&(n=ee.length-1):(n+="next"===t?1:-1,n<0&&(n=0),n===ee.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;let n=e;for(;;){if("next"===t&&n===ee.length||"previous"===t&&-1===n)return-1;const e=H.querySelector(`[data-tag-index="${n}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),K(n),ve(n)},Ce=e=>{z.current=!0,re(""),j&&j(e,"","clear"),ke(e,T?[]:null,"clear")},Ie=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1===Y||["ArrowLeft","ArrowRight"].includes(t.key)||(K(-1),ve(-1)),229!==t.which))switch(t.key){case"Home":pe&&O&&(t.preventDefault(),ge({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":pe&&O&&(t.preventDefault(),ge({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),ge({diff:-5,direction:"previous",reason:"keyboard",event:t}),Se(t);break;case"PageDown":t.preventDefault(),ge({diff:5,direction:"next",reason:"keyboard",event:t}),Se(t);break;case"ArrowDown":t.preventDefault(),ge({diff:1,direction:"next",reason:"keyboard",event:t}),Se(t);break;case"ArrowUp":t.preventDefault(),ge({diff:-1,direction:"previous",reason:"keyboard",event:t}),Se(t);break;case"ArrowLeft":Ee(t,"previous");break;case"ArrowRight":Ee(t,"next");break;case"Enter":if(-1!==Z.current&&pe){const e=fe[Z.current],n=!!w&&w(e);if(t.preventDefault(),n)return;_e(t,e,"selectOption"),o&&U.current.setSelectionRange(U.current.value.length,U.current.value.length)}else b&&""!==ne&&!1===de&&(T&&t.preventDefault(),_e(t,ne,"createOption","freeSolo"));break;case"Escape":pe?(t.preventDefault(),t.stopPropagation(),xe(t,"escape")):u&&(""!==ne||T&&ee.length>0)&&(t.preventDefault(),t.stopPropagation(),Ce(t));break;case"Backspace":if(T&&!F&&""===ne&&ee.length>0){const e=-1===Y?ee.length-1:Y,n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})}break;case"Delete":if(T&&!F&&""===ne&&ee.length>0&&-1!==Y){const e=Y,n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})}}},Te=e=>{ie(!0),L&&!z.current&&Se(e)},Ae=e=>{n(W)?U.current.focus():(ie(!1),$.current=!0,z.current=!1,a&&-1!==Z.current&&pe?_e(e,fe[Z.current],"blur"):a&&b&&""!==ne?_e(e,ne,"blur","freeSolo"):l&&ae(e,ee,"blur"),xe(e,"blur"))},Pe=e=>{const t=e.target.value;ne!==t&&(re(t),ce(!1),j&&j(e,t,"input")),""===t?p||T||ke(e,null,"clear"):Se(e)},De=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));Z.current!==t&&ye({event:e,index:t,reason:"mouse"})},je=e=>{ye({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Oe.current=!0},Re=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));_e(e,fe[t],"selectOption"),Oe.current=!1},Me=e=>t=>{const n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})},Le=e=>{se?xe(e,"toggleInput"):Se(e)},Ne=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==q&&e.preventDefault()},Fe=e=>{e.currentTarget.contains(e.target)&&(U.current.focus(),V&&$.current&&U.current.selectionEnd-U.current.selectionStart===0&&U.current.select(),$.current=!1)},Ve=e=>{m||""!==ne&&se||Le(e)};let Be=b&&ne.length>0;Be=Be||(T?ee.length>0:null!==ee);let qe=fe;return k&&(new Map,qe=fe.reduce((e,t,n)=>{const r=k(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])),m&&oe&&Ae(),{getRootProps:(e={})=>({...e,onKeyDown:Ie(e),onMouseDown:Ne,onClick:Fe}),getInputLabelProps:()=>({id:`${q}-label`,htmlFor:q}),getInputProps:()=>({id:q,value:ne,onBlur:Ae,onFocus:Te,onChange:Pe,onMouseDown:Ve,"aria-activedescendant":pe?"":null,"aria-autocomplete":o?"both":"list","aria-controls":he?`${q}-listbox`:void 0,"aria-expanded":he,autoComplete:"off",ref:U,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:m}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Ce}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Le}),getTagProps:({index:e})=>({key:e,"data-tag-index":e,tabIndex:-1,...!F&&{onDelete:Me(e)}}),getListboxProps:()=>({role:"listbox",id:`${q}-listbox`,"aria-labelledby":`${q}-label`,ref:we,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{const n=(T?ee:[ee]).some(e=>null!=e&&I(t,e)),r=!!w&&w(t);return{key:S?.(t)??Q(t),tabIndex:-1,role:"option",id:`${q}-option-${e}`,onMouseMove:De,onClick:Re,onTouchStart:je,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:q,inputValue:ne,value:ee,dirty:Be,expanded:pe&&H,popupOpen:pe,focused:oe||-1!==Y,anchorEl:H,setAnchorEl:G,focusedTag:Y,groupedOptions:qe}};function sN(e){return mg("MuiListSubheader",e)}hg("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const lN=Ey("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${ag(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(ig(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),uN=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiListSubheader"}),{className:r,color:o="default",component:i="li",disableGutters:a=!1,disableSticky:s=!1,inset:l=!1,...u}=n,c={...n,color:o,component:i,disableGutters:a,disableSticky:s,inset:l},d=(e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e;return Np({root:["root","default"!==n&&`color${ag(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]},sN,t)})(c);return(0,Iy.jsx)(lN,{as:i,className:Lp(d.root,r),ref:t,ownerState:c,...u})});uN&&(uN.muiSkipListHighlight=!0);const cN=uN,dN=ES((0,Iy.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function pN(e){return mg("MuiChip",e)}const fN=hg("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),mN=Ey("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=n;return[{[`& .${fN.avatar}`]:t.avatar},{[`& .${fN.avatar}`]:t[`avatar${ag(s)}`]},{[`& .${fN.avatar}`]:t[`avatarColor${ag(r)}`]},{[`& .${fN.icon}`]:t.icon},{[`& .${fN.icon}`]:t[`icon${ag(s)}`]},{[`& .${fN.icon}`]:t[`iconColor${ag(o)}`]},{[`& .${fN.deleteIcon}`]:t.deleteIcon},{[`& .${fN.deleteIcon}`]:t[`deleteIcon${ag(s)}`]},{[`& .${fN.deleteIcon}`]:t[`deleteIconColor${ag(r)}`]},{[`& .${fN.deleteIcon}`]:t[`deleteIcon${ag(l)}Color${ag(r)}`]},t.root,t[`size${ag(s)}`],t[`color${ag(r)}`],i&&t.clickable,i&&"default"!==r&&t[`clickableColor${ag(r)})`],a&&t.deletable,a&&"default"!==r&&t[`deletableColor${ag(r)}`],t[l],t[`${l}${ag(r)}`]]}})(ig(({theme:e})=>{const t="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${fN.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${fN.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${fN.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${fN.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${fN.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${fN.icon}`]:{marginLeft:5,marginRight:-6},[`& .${fN.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Yh(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Yh(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${fN.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${fN.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Cg(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${fN.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].contrastTextChannel} / 0.7)`:Yh(e.palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${fN.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&"default"!==e.color,style:{[`& .${fN.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(Cg(["dark"])).map(([t])=>({props:{color:t,onDelete:!0},style:{[`&.${fN.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Cg(["dark"])).map(([t])=>({props:{color:t,clickable:!0},style:{[`&:hover, &.${fN.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${fN.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${fN.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${fN.avatar}`]:{marginLeft:4},[`& .${fN.avatarSmall}`]:{marginLeft:2},[`& .${fN.icon}`]:{marginLeft:4},[`& .${fN.iconSmall}`]:{marginLeft:2},[`& .${fN.deleteIcon}`]:{marginRight:5},[`& .${fN.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{variant:"outlined",color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:Yh(e.palette[t].main,.7)}`,[`&.${fN.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette[t].main,e.palette.action.hoverOpacity)},[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Yh(e.palette[t].main,e.palette.action.focusOpacity)},[`& .${fN.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:Yh(e.palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),hN=Ey("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ag(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function vN(e){return"Backspace"===e.key||"Delete"===e.key}const yN=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:a,color:s="default",component:l,deleteIcon:u,disabled:c=!1,icon:d,label:p,onClick:f,onDelete:m,onKeyDown:h,onKeyUp:v,size:y="medium",variant:g="filled",tabIndex:b,skipFocusWhenDisabled:w=!1,...S}=r,x=e.useRef(null),k=sg(x,n),O=e=>{e.stopPropagation(),m&&m(e)},_=!(!1===a||!f)||a,E=_||m?Yk:l||"div",C={...r,component:E,disabled:c,size:y,color:s,iconColor:e.isValidElement(d)&&d.props.color||s,onDelete:!!m,clickable:_,variant:g},I=(e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:a,clickable:s,variant:l}=e;return Np({root:["root",l,n&&"disabled",`size${ag(r)}`,`color${ag(o)}`,s&&"clickable",s&&`clickableColor${ag(o)}`,a&&"deletable",a&&`deletableColor${ag(o)}`,`${l}${ag(o)}`],label:["label",`label${ag(r)}`],avatar:["avatar",`avatar${ag(r)}`,`avatarColor${ag(o)}`],icon:["icon",`icon${ag(r)}`,`iconColor${ag(i)}`],deleteIcon:["deleteIcon",`deleteIcon${ag(r)}`,`deleteIconColor${ag(o)}`,`deleteIcon${ag(l)}Color${ag(o)}`]},pN,t)})(C),T=E===Yk?{component:l||"div",focusVisibleClassName:I.focusVisible,...m&&{disableRipple:!0}}:{};let A=null;m&&(A=u&&e.isValidElement(u)?e.cloneElement(u,{className:Lp(u.props.className,I.deleteIcon),onClick:O}):(0,Iy.jsx)(dN,{className:Lp(I.deleteIcon),onClick:O}));let P=null;o&&e.isValidElement(o)&&(P=e.cloneElement(o,{className:Lp(I.avatar,o.props.className)}));let D=null;return d&&e.isValidElement(d)&&(D=e.cloneElement(d,{className:Lp(I.icon,d.props.className)})),(0,Iy.jsxs)(mN,{as:E,className:Lp(I.root,i),disabled:!(!_||!c)||void 0,onClick:f,onKeyDown:e=>{e.currentTarget===e.target&&vN(e)&&e.preventDefault(),h&&h(e)},onKeyUp:e=>{e.currentTarget===e.target&&m&&vN(e)&&m(e),v&&v(e)},ref:k,tabIndex:w&&c?-1:b,ownerState:C,...T,...S,children:[P||D,(0,Iy.jsx)(hN,{className:Lp(I.label),ownerState:C,children:p}),A]})}),gN=ES((0,Iy.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function bN(e){return mg("MuiAutocomplete",e)}const wN=hg("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var SN,xN;const kN=Ey("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:a,size:s}=n;return[{[`& .${wN.tag}`]:t.tag},{[`& .${wN.tag}`]:t[`tagSize${ag(s)}`]},{[`& .${wN.inputRoot}`]:t.inputRoot},{[`& .${wN.input}`]:t.input},{[`& .${wN.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${wN.focused} .${wN.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${wN.clearIndicator}`]:{visibility:"visible"}},[`& .${wN.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${wN.inputRoot}`]:{[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:30},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:56},[`& .${wN.input}`]:{width:0,minWidth:30}},[`& .${Tg.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Tg.root}.${yg.sizeSmall}`]:{[`& .${Tg.input}`]:{padding:"2px 4px 3px 0"}},[`& .${$g.root}`]:{padding:9,[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:39},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:65},[`& .${wN.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${wN.endAdornment}`]:{right:9}},[`& .${$g.root}.${yg.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${wN.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Mg.root}`]:{paddingTop:19,paddingLeft:8,[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:39},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:65},[`& .${Mg.input}`]:{padding:"7px 4px"},[`& .${wN.endAdornment}`]:{right:9}},[`& .${Mg.root}.${yg.sizeSmall}`]:{paddingBottom:1,[`& .${Mg.input}`]:{padding:"2.5px 4px"}},[`& .${yg.hiddenLabel}`]:{paddingTop:8},[`& .${Mg.root}.${yg.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${wN.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Mg.root}.${yg.hiddenLabel}.${yg.sizeSmall}`]:{[`& .${wN.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${wN.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${wN.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${wN.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${wN.inputRoot}`]:{flexWrap:"wrap"}}}]}),ON=Ey("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),_N=Ey(uO,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),EN=Ey(uO,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),CN=Ey(yk,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${wN.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(ig(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),IN=Ey(Fw,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(ig(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),TN=Ey("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),AN=Ey("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),PN=Ey("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(ig(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${wN.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${wN.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${wN.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${wN.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${wN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),DN=Ey(cN,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(ig(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),jN=Ey("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${wN.option}`]:{paddingLeft:24}}),RN=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:a=!1,blurOnSelect:s=!1,ChipProps:l,className:u,clearIcon:c=SN||(SN=(0,Iy.jsx)(gN,{fontSize:"small"})),clearOnBlur:d=!r.freeSolo,clearOnEscape:p=!1,clearText:f="Clear",closeText:m="Close",componentsProps:h,defaultValue:v=(r.multiple?[]:null),disableClearable:y=!1,disableCloseOnSelect:g=!1,disabled:b=!1,disabledItemsFocusable:w=!1,disableListWrap:S=!1,disablePortal:x=!1,filterOptions:k,filterSelectedOptions:O=!1,forcePopupIcon:_="auto",freeSolo:E=!1,fullWidth:C=!1,getLimitTagsText:I=e=>`+${e}`,getOptionDisabled:T,getOptionKey:A,getOptionLabel:P,isOptionEqualToValue:D,groupBy:j,handleHomeEndKeys:R=!r.freeSolo,id:M,includeInputInList:L=!1,inputValue:N,limitTags:F=-1,ListboxComponent:V,ListboxProps:B,loading:q=!1,loadingText:Q="Loading…",multiple:z=!1,noOptionsText:$="No options",onChange:U,onClose:W,onHighlightChange:H,onInputChange:G,onOpen:Y,open:K,openOnFocus:X=!1,openText:Z="Open",options:J,PaperComponent:ee,PopperComponent:te,popupIcon:ne=xN||(xN=(0,Iy.jsx)(CS,{})),readOnly:re=!1,renderGroup:oe,renderInput:ie,renderOption:ae,renderTags:se,selectOnFocus:le=!r.freeSolo,size:ue="medium",slots:ce={},slotProps:de={},value:pe,...fe}=r,{getRootProps:me,getInputProps:he,getInputLabelProps:ve,getPopupIndicatorProps:ye,getClearProps:ge,getTagProps:be,getListboxProps:we,getOptionProps:Se,value:xe,dirty:ke,expanded:Oe,id:_e,popupOpen:Ee,focused:Ce,focusedTag:Ie,anchorEl:Te,setAnchorEl:Ae,inputValue:Pe,groupedOptions:De}=aN({...r,componentName:"Autocomplete"}),je=!y&&!b&&ke&&!re,Re=(!E||!0===_)&&!1!==_,{onMouseDown:Me}=he(),{ref:Le,...Ne}=we(),Fe=P||(e=>e.label??e),Ve={...r,disablePortal:x,expanded:Oe,focused:Ce,fullWidth:C,getOptionLabel:Fe,hasClearIcon:je,hasPopupIcon:Re,inputFocused:-1===Ie,popupOpen:Ee,size:ue},Be=(e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:u,size:c}=e;return Np({root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${ag(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]},bN,t)})(Ve),qe={slots:{paper:ee,popper:te,...ce},slotProps:{chip:l,listbox:B,...h,...de}},[Qe,ze]=Kg("listbox",{elementType:PN,externalForwardedProps:qe,ownerState:Ve,className:Be.listbox,additionalProps:Ne,ref:Le}),[$e,Ue]=Kg("paper",{elementType:Fw,externalForwardedProps:qe,ownerState:Ve,className:Be.paper}),[We,He]=Kg("popper",{elementType:yk,externalForwardedProps:qe,ownerState:Ve,className:Be.popper,additionalProps:{disablePortal:x,style:{width:Te?Te.clientWidth:null},role:"presentation",anchorEl:Te,open:Ee}});let Ge;if(z&&xe.length>0){const e=e=>({className:Be.tag,disabled:b,...be(e)});Ge=se?se(xe,e,Ve):xe.map((t,n)=>{const{key:r,...o}=e({index:n});return(0,Iy.jsx)(yN,{label:Fe(t),size:ue,...o,...qe.slotProps.chip},r)})}if(F>-1&&Array.isArray(Ge)){const e=Ge.length-F;!Ce&&e>0&&(Ge=Ge.splice(0,F),Ge.push((0,Iy.jsx)("span",{className:Be.tag,children:I(e)},Ge.length)))}const Ye=oe||(e=>(0,Iy.jsxs)("li",{children:[(0,Iy.jsx)(DN,{className:Be.groupLabel,ownerState:Ve,component:"div",children:e.group}),(0,Iy.jsx)(jN,{className:Be.groupUl,ownerState:Ve,children:e.children})]},e.key)),Ke=ae||((e,t)=>{const{key:n,...r}=e;return(0,Iy.jsx)("li",{...r,children:Fe(t)},n)}),Xe=(e,t)=>{const n=Se({option:e,index:t});return Ke({...n,className:Be.option},e,{selected:n["aria-selected"],index:t,inputValue:Pe},Ve)},Ze=qe.slotProps.clearIndicator,Je=qe.slotProps.popupIndicator;return(0,Iy.jsxs)(e.Fragment,{children:[(0,Iy.jsx)(kN,{ref:n,className:Lp(Be.root,u),ownerState:Ve,...me(fe),children:ie({id:_e,disabled:b,fullWidth:!0,size:"small"===ue?"small":void 0,InputLabelProps:ve(),InputProps:{ref:Ae,className:Be.inputRoot,startAdornment:Ge,onMouseDown:e=>{e.target===e.currentTarget&&Me(e)},...(je||Re)&&{endAdornment:(0,Iy.jsxs)(ON,{className:Be.endAdornment,ownerState:Ve,children:[je?(0,Iy.jsx)(_N,{...ge(),"aria-label":f,title:f,ownerState:Ve,...Ze,className:Lp(Be.clearIndicator,Ze?.className),children:c}):null,Re?(0,Iy.jsx)(EN,{...ye(),disabled:b,"aria-label":Ee?m:Z,title:Ee?m:Z,ownerState:Ve,...Je,className:Lp(Be.popupIndicator,Je?.className),children:ne}):null]})}},inputProps:{className:Be.input,disabled:b,readOnly:re,...he()}})}),Te?(0,Iy.jsx)(CN,{as:We,...He,children:(0,Iy.jsxs)(IN,{as:$e,...Ue,children:[q&&0===De.length?(0,Iy.jsx)(TN,{className:Be.loading,ownerState:Ve,children:Q}):null,0!==De.length||E||q?null:(0,Iy.jsx)(AN,{className:Be.noOptions,ownerState:Ve,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:$}),De.length>0?(0,Iy.jsx)(Qe,{as:V,...ze,children:De.map((e,t)=>j?Ye({key:e.key,group:e.group,children:e.options.map((t,n)=>Xe(t,e.index+n))}):Xe(e,t))}):null]})}):null]})}),MN=RN;var LN=["child_medical_history"];function NN(e){return NN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},NN(e)}var FN=["style"];function VN(){return VN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VN.apply(null,arguments)}function BN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BN(Object(n),!0).forEach(function(t){QN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QN(e,t,n){return(t=function(e){var t=function(e){if("object"!=NN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=NN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==NN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $N=function(t){var r,o,i=t.questionId,a=t.label,s=t.options,l=void 0===s?[]:s,u=t.defaultValue,c=void 0===u?"":u,d=t.helperText,p=t.required,f=void 0!==p&&p,m=t.onChange,h=t.inputProps,v=void 0===h?{}:h,y=t.header,g=t.styleName,b=t.customTheme,w=void 0===b?{}:b,S=t.tooltip,x=void 0===S?"":S,k=t.showQuestionLabels,O=void 0===k||k,_=t.addressGroup,E=void 0===_?"":_,C=t.isClearable,I=t.testIdRoot,T=sd(),A=Vc().state,P=v["data-item-index"],D=v["data-parent-id"],j=$S({questionId:i,itemIndex:P,defaultValue:c,defaultVisible:!0,defaultDisabled:!1}),R=j.visible,M=j.disabled,L=j.error,N=j.handleChange,F=j.value,V=(0,e.useMemo)(function(){var e,t,n,r=D,o=P,a=null===(e=A.optionVisibility)||void 0===e?void 0:e[i];null!=r&&void 0!==o&&null!==(t=A.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[r])&&void 0!==t&&null!==(t=t[Number(o)])&&void 0!==t&&t[i]&&(a=A.optionVisibilityByInstance[r][Number(o)][i]);var s=l;a&&(s=l.filter(function(e){var t=e.optionId||e.id;return!1!==a[t]}));var u=null!=r&&void 0!==o&&function(e){if(!e||"string"!=typeof e)return!1;var t=String(e).toLowerCase();return!!t.includes("owner_info_dropdown")||LN.some(function(e){return e.toLowerCase()===t})}(E);if(u&&Array.isArray(null===(n=A.values)||void 0===n?void 0:n[r])){var c=String(i),d=Number(o),p=(A.values[r]||[]).filter(function(e,t){return t!==d}).map(function(e){var t;return null==e||null===(t=e.properties)||void 0===t||null===(t=t.find(function(e){return String(null==e?void 0:e.editQuestionId)===c}))||void 0===t?void 0:t.value}).filter(function(e){if(null==e)return!1;var t=String(e).trim();return""!==t&&t.toLowerCase()!=="Enter My Own".toLowerCase()}),f=s.filter(function(e){return!p.includes(e.value)});if(F){var m=s.find(function(e){return e.value===F});m&&!f.some(function(e){return e.value===F})&&(f=[].concat(function(e){return function(e){if(Array.isArray(e))return zN(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return zN(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zN(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(f),[m]))}return f}return s},[l,A.optionVisibility,A.optionVisibilityByInstance,A.values,i,D,P,E,F]),B=(0,e.useMemo)(function(){return function(e,t){if(!e||null==t||!t.length)return e;if(t.find(function(t){return t.value===e}))return e;var n=t.find(function(t){return t.label===e});return n?n.value:e}(F,l)},[F,l]),q=(0,e.useMemo)(function(){var e;return V.find(function(e){return e.value===B})||(null!==(e=l.find(function(e){return e.value===B}))&&void 0!==e?e:null)},[V,l,B]),Q=(0,e.useMemo)(function(){var e=T.selectField||{};return YS(e,w)},[T,w]),z=(0,e.useMemo)(function(){var e=qN(qN({},Q.container),{},{width:"100%"});return{container:KS(e,Q.responsive),menu:Q.menu,menuItem:Q.menuItem,helperText:Q.helperText}},[Q]),$=(0,e.useMemo)(function(){var e,t,n,r,o,i,a,s,l,u,c=Q.outline||{},d=Q.outlineFocus||{},p=Q.outlineHover||{},f=Q.disabled||{},m=ZS(Q.input,Q.select),h=Q.errorFocus||{},v=c.border||"1px solid #D1D5DB",y=c.borderRadius||"0.375rem",g=L?h.borderColor||(null===(e=Q.error)||void 0===e?void 0:e.borderColor)||"#DC2626":d.borderColor||"#0A2647",b=L?h.boxShadow||"0 0 0 2px rgba(220, 38, 38, 0.25)":d.boxShadow||"0 0 0 2px rgba(10, 38, 71, 0.1)",w=m.paddingRight||"2.5rem",S=(null===(t=Q.inputWithClearIcon)||void 0===t?void 0:t.paddingRight)||"5.5rem";return{width:"100%","& .MuiOutlinedInput-root":{minHeight:m.minHeight||"2.5rem",padding:0,backgroundColor:m.backgroundColor||"#FFFFFF","& .MuiOutlinedInput-input":{padding:m.padding||"0.5rem 0.75rem",paddingRight:"".concat(w," !important"),fontSize:m.fontSize||"1rem",lineHeight:m.lineHeight||"1.5",color:m.color||"#1F2937"},"& fieldset":{border:L?"1px solid ".concat((null===(n=Q.error)||void 0===n?void 0:n.borderColor)||"#DC2626"):v,borderRadius:y},"&:hover fieldset":qN({border:L?"1px solid ".concat((null===(r=Q.error)||void 0===r?void 0:r.borderColor)||"#DC2626"):v},p.borderColor&&!L?{borderColor:p.borderColor}:{}),"&.Mui-focused fieldset":{border:"1px solid ".concat(g),borderWidth:"1px",boxShadow:b},"&.Mui-disabled":{backgroundColor:f.backgroundColor||"#f1f5f9",cursor:f.cursor||"not-allowed",opacity:1},"&.Mui-disabled .MuiOutlinedInput-input":{color:f.color||"#64748b",WebkitTextFillColor:f.WebkitTextFillColor||f.color||"#64748b",cursor:f.cursor||"not-allowed"},"&.Mui-disabled fieldset":{borderColor:f.borderColor||"#cbd5e1"},"&.Mui-disabled:hover fieldset":{borderColor:f.borderColor||"#cbd5e1"}},"&.MuiAutocomplete-hasClearIcon .MuiOutlinedInput-input":{paddingRight:"".concat(S," !important")},"& .MuiAutocomplete-popupIndicator":qN({},Q.popupIndicator||{color:"#0A2647"}),"& .MuiAutocomplete-clearIndicator":qN(qN({},Q.clearIndicator||{color:"#9CA3AF"}),{},{visibility:"visible",marginRight:null!==(o=null===(i=Q.indicatorSeparator)||void 0===i?void 0:i.margin)&&void 0!==o?o:"0.25rem",borderRadius:0,borderRight:(null===(a=Q.indicatorSeparator)||void 0===a?void 0:a.border)||"1px solid #E5E7EB",paddingRight:null!==(s=null===(l=Q.indicatorSeparator)||void 0===l?void 0:l.padding)&&void 0!==s?s:"0.25rem"}),"& .Mui-disabled .MuiAutocomplete-popupIndicator":{color:f.iconColor||"#94a3b8"},"& .Mui-disabled .MuiAutocomplete-clearIndicator":{color:f.iconColor||"#94a3b8",borderRightColor:(null===(u=Q.indicatorSeparator)||void 0===u?void 0:u.disabledBorderColor)||"#E2E8F0"},"& .MuiAutocomplete-endAdornment":qN({},Q.endAdornment||{right:"0.5rem"})}},[Q,L]),U=(0,e.useCallback)(function(e,t){return function(e,t){var n=String(null!=t?t:"").trim();if(!n)return e;var r=n.toLowerCase();return e.filter(function(e){var t;return String(null!==(t=null==e?void 0:e.label)&&void 0!==t?t:"").toLowerCase().startsWith(r)})}(e,t.inputValue)},[]);if(!R)return null;var W=void 0===P?i:"".concat(i,"-").concat(P),H=function(){if(O&&a)return n().createElement("span",null,a,x&&n().createElement(hO,{tooltip:x}))},G=Boolean(O&&a),Y="boolean"==typeof C?C:!f,K=Boolean(q)&&!M&&Y,X=(K?null===(r=Q.inlineTooltip)||void 0===r?void 0:r.rightWithClearIcon:null===(o=Q.inlineTooltip)||void 0===o?void 0:o.right)||(K?"5.5rem":"2.5rem");return n().createElement("div",{className:"form-field ".concat(g||""),style:z.container},y&&n().createElement("div",{className:"field-header",style:T.header},y),n().createElement("div",{style:{position:"relative",width:"100%"}},n().createElement(MN,{fullWidth:!0,openOnFocus:!0,disableClearable:!Y,options:V,value:q,onChange:function(e,t,n){var r,o="clear"!==n&&t&&null!==(r=t.value)&&void 0!==r?r:"";N(o,{cardListId:D,instanceIndex:P}),m&&m({target:{value:o,name:String(void 0===P?i:"".concat(i,"-").concat(P))}})},getOptionLabel:function(e){var t;return String(null!==(t=null==e?void 0:e.label)&&void 0!==t?t:"")},getOptionDisabled:function(e){return Boolean(e.disabled)},isOptionEqualToValue:function(e,t){return(null==e?void 0:e.value)===(null==t?void 0:t.value)},filterOptions:U,disabled:M,noOptionsText:"No options",sx:$,renderInput:function(e){return n().createElement(NS,VN({},e,{variant:"outlined",label:G?H():void 0,hiddenLabel:!G,required:G&&f,error:!!L,id:String(W),slotProps:{inputLabel:{style:T.label},htmlInput:qN(qN({},e.inputProps),{},{autoComplete:"off",name:String(W),"data-item-index":P,"data-parent-id":D,"data-testid":dd(I,"trigger")})}}))},renderOption:function(e,t){var r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,FN);return n().createElement("li",VN({},o,{style:qN(qN({},r),z.menuItem),"data-testid":dd(I,"option",t.value)}),t.label)},slotProps:{listbox:{style:z.menu,"data-testid":dd(I,"listbox")}}}),G&&x&&n().createElement("div",{style:{position:"absolute",top:"8px",right:X,zIndex:1}},n().createElement(hO,{tooltip:x}))),(L||d)&&n().createElement(bb,{component:"div",style:L?T.error:z.helperText||T.helperText},L||d))};function UN(e){return UN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UN(e)}function WN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WN(Object(n),!0).forEach(function(t){GN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GN(e,t,n){return(t=function(e){var t=function(e){if("object"!=UN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}$N.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().number,o().bool]).isRequired,label:o().string.isRequired,disabled:o().bool})).isRequired,defaultValue:o().string,helperText:o().string,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,addressGroup:o().string,isClearable:o().bool,testIdRoot:o().string};var YN=function(t){var r=t.name,o=t.label,i=t.value,a=t.onChange,s=t.disabled,l=t.required,u=t.error,c=t.validation,d=void 0===c?{}:c,p=t.header,f=t.styleName,m=t.customTheme,h=void 0===m?{}:m,v=t.tooltip,y=void 0===v?"":v,g=t.showQuestionLabels,b=void 0===g||g,w=t.testId,S=t.testIdRoot,x=sd(),k=d.min,O=d.max,_=d.step,E=void 0===_?1:_,C=(0,e.useMemo)(function(){var e=x.spinnerField||{};return YS(e,h)},[x,h]),I=(0,e.useMemo)(function(){var e=HN(HN({},C.container),{},{width:"100%"}),t=ZS(C.input,s&&C.disabled,u&&C.error),n=ZS(C.button,s&&C.disabled);return{container:KS(e,C.responsive),wrapper:C.wrapper,input:t,button:n,header:ZS(C.header),label:ZS(C.label,l&&C.required,s&&C.disabled),error:ZS(C.error)}},[C,s,u,l]);return n().createElement("div",{className:"spinner-field ".concat(f||""),style:I.container},p&&n().createElement("div",{className:"field-header",style:I.header},p),b&&o&&n().createElement("div",{className:"question_label",style:I.label},o,l&&n().createElement("span",{style:C.required},"*"),y&&n().createElement(hO,{tooltip:y})),n().createElement("div",{style:I.wrapper},n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)-E;(void 0===k||e>=k)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==k&&(Number(i)||0)<=k,style:I.button,"aria-label":"Decrease value","data-testid":dd(S,"decrement")},"-"),n().createElement("input",{type:"number",name:r,value:i||"",onChange:function(e){if(!s){var t=Number(e.target.value);Number.isNaN(t)||(void 0===k||t>=k)&&(void 0===O||t<=O)&&a({target:{name:r,value:t}})}},disabled:s,autoComplete:"off",style:I.input,min:k,max:O,step:E,"data-testid":w}),n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)+E;(void 0===O||e<=O)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==O&&(Number(i)||0)>=O,style:I.button,"aria-label":"Increase value","data-testid":dd(S,"increment")},"+")),u&&n().createElement("div",{style:I.error},u))};YN.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().number,o().string]),onChange:o().func.isRequired,disabled:o().bool,required:o().bool,error:o().string,validation:o().shape({min:o().number,max:o().number,step:o().number}),header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string,testIdRoot:o().string};var KN=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/TextAreaField.css"),XN={};XN.styleTagTransform=kl(),XN.setAttributes=bl(),XN.insert=yl().bind(null,"head"),XN.domAPI=hl(),XN.insertStyleElement=Sl(),fl()(KN.A,XN),KN.A&&KN.A.locals&&KN.A.locals;var ZN=["value","_onChange","disabled","_editable"];function JN(e){return JN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JN(e)}function eF(){return eF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eF.apply(null,arguments)}function tF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tF(Object(n),!0).forEach(function(t){rF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rF(e,t,n){return(t=function(e){var t=function(e){if("object"!=JN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=JN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oF=function(t){t._id;var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.rows,u=void 0===l?3:l,c=t.disabled,d=t.className,p=t.onChange,f=t.header,m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=t.error,g=t.helperText,b=t.maxLength,w=t.tooltip,S=void 0===w?"":w,x=t.showQuestionLabels,k=void 0===x||x,O=t.testId,_=sd(),E=(0,e.useMemo)(function(){var e=_.textAreaField||{};return YS(e,v)},[_,v]),C=(0,e.useMemo)(function(){var e=nF(nF({},E.container),{},{width:"100%"}),t=ZS(E.textarea,y&&E.error,c&&E.disabled);return{container:KS(e,E.responsive),textarea:t}},[E,y,c]),I=function(e){p&&p(e)};return n().createElement("div",{className:"form-field ".concat(m||""),style:C.container},f&&n().createElement("div",{className:"field-header",style:_.header},f),n().createElement(zO,{name:r,label:k?o:"",value:i,validation:a,className:d,customTheme:E,error:y,helperText:g,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:E.label||{}},t,r&&n().createElement("span",{style:E.required||{}},"*"),S&&n().createElement(hO,{tooltip:S})):null},renderInput:function(e){var t=e.value,r=(e._onChange,e.disabled),o=(e._editable,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ZN)),i=Boolean(r||c);return n().createElement("textarea",eF({},o,{value:t||"",onChange:I,rows:u,placeholder:s,disabled:i,className:"form-field__textarea",style:C.textarea,maxLength:b,"data-testid":O}))}}))};function iF(){return iF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iF.apply(null,arguments)}oF.propTypes={_id:o().oneOfType([o().string,o().number]),name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,placeholder:o().string,rows:o().number,disabled:o().bool,className:o().string,onChange:o().func,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,maxLength:o().number,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string};var aF=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(function(e){if("string"==typeof e)return{value:e,label:e};var t=e.optionId,n=e.text,r=e.name,o=e.value;return{value:o||r||t||"",label:n||r||o||"",id:t||o||r,selected:e.selected||!1,sortOrder:e.sortOrder||0}}).sort(function(e,t){return e.sortOrder-t.sortOrder}):(console.warn("Invalid options:",e),[])},sF={text:function(e){return n().createElement(OM,iF({},e,{type:"text"}))},textbox:SO,email:function(e){return n().createElement(SO,iF({},e,{type:"email"}))},password:NM,url:function(e){return n().createElement(SO,iF({},e,{type:"url"}))},number:function(e){return n().createElement(OM,iF({},e,{type:"number"}))},ssn:function(e){return n().createElement(OM,iF({},e,{type:"ssn"}))},itin:function(e){return n().createElement(OM,iF({},e,{type:"itin"}))},tin:function(e){return n().createElement(OM,iF({},e,{type:"tin"}))},tel:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},phone:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},phonenumber:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},mobile:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},percentage:function(e){var t,r,o,i,a;return n().createElement(VL,iF({},e,{minValue:null!==(t=null!==(r=e.minValue)&&void 0!==r?r:e.minvalue)&&void 0!==t?t:0,maxValue:null!==(o=null!==(i=e.maxValue)&&void 0!==i?i:e.maxvalue)&&void 0!==o?o:100,decimalScale:null!==(a=e.decimalScale)&&void 0!==a?a:2,placeholder:e.placeholder}))},currency:fI,textarea:oF,button:e_,radio:UL,radiobutton:UL,radiotabbuttons:eN,radioswitch:UL,select:$N,dropdown:$N,dynamicdropdown:Dj,checkbox:$C,checkboxgroup:oI,address:NO,identification:mM,grid:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},beneficiary:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},cardlist:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},spinner:YN,file:tM,upload:tM,pdf:$M,pdfpackage:rL,date:fj,datetime:fj,month:fj,time:fj,week:fj,displaytext:Sj,hyperlink:iM,link:iM,default:function(e){return console.warn("No component found for field type: ".concat(e.type,", falling back to text input")),n().createElement(SO,iF({},e,{type:"text"}))}},lF=function(e){return e?sF[e.toLowerCase()]||(console.warn("No component found for field type: ".concat(e,", using default text input")),sF.default):(console.warn("No field type provided, using default text input"),sF.default)};function uF(e){return uF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uF(e)}var cF=["showQuestionLabels","apiConfig"];function dF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return pF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(pF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,pF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,pF(d,"constructor",u),pF(u,"constructor",l),l.displayName="GeneratorFunction",pF(u,o,"GeneratorFunction"),pF(d),pF(d,o,"Generator"),pF(d,r,function(){return this}),pF(d,"toString",function(){return"[object Generator]"}),(dF=function(){return{w:i,m:p}})()}function pF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pF=function(e,t,n,r){function i(t,n){pF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},pF(e,t,n,r)}function fF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function mF(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){fF(i,r,o,a,s,"next",e)}function s(e){fF(i,r,o,a,s,"throw",e)}a(void 0)})}}function hF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hF(Object(n),!0).forEach(function(t){yF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yF(e,t,n){return(t=function(e){var t=function(e){if("object"!=uF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=uF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return bF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(bF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,bF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,bF(d,"constructor",u),bF(u,"constructor",l),l.displayName="GeneratorFunction",bF(u,o,"GeneratorFunction"),bF(d),bF(d,o,"Generator"),bF(d,r,function(){return this}),bF(d,"toString",function(){return"[object Generator]"}),(gF=function(){return{w:i,m:p}})()}function bF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bF=function(e,t,n,r){function i(t,n){bF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},bF(e,t,n,r)}function wF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function SF(e){return xF.apply(this,arguments)}function xF(){return e=gF().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return gF().w(function(e){for(;;)switch(e.n){case 0:i=null!==(n=(o=u.length>1&&void 0!==u[1]?u[1]:{}).pollIntervalMs)&&void 0!==n?n:100,a=null!==(r=o.timeoutMs)&&void 0!==r?r:8e3,s=Date.now();case 1:if(!(Date.now()-s<a)){e.n=5;break}if(l="function"==typeof t?t():{},!Object.values(l||{}).some(Boolean)){e.n=3;break}return e.n=2,new Promise(function(e){return setTimeout(e,i)});case 2:e.n=4;break;case 3:return e.a(2,!0);case 4:e.n=1;break;case 5:return e.a(2,!1)}},e)}),xF=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){wF(i,r,o,a,s,"next",e)}function s(e){wF(i,r,o,a,s,"throw",e)}a(void 0)})},xF.apply(this,arguments);var e}function kF(e){return kF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kF(e)}function OF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OF(Object(n),!0).forEach(function(t){EF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EF(e,t,n){return(t=function(e){var t=function(e){if("object"!=kF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=kF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return IF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(IF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,IF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,IF(d,"constructor",u),IF(u,"constructor",l),l.displayName="GeneratorFunction",IF(u,o,"GeneratorFunction"),IF(d),IF(d,o,"Generator"),IF(d,r,function(){return this}),IF(d,"toString",function(){return"[object Generator]"}),(CF=function(){return{w:i,m:p}})()}function IF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}IF=function(e,t,n,r){function i(t,n){IF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},IF(e,t,n,r)}function TF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function AF(e){return AF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AF(e)}function PF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PF(Object(n),!0).forEach(function(t){jF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jF(e,t,n){return(t=function(e){var t=function(e){if("object"!=AF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=AF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RF=function(e,t,n,r,o){return Bd(e,t,{values:n.values,visibility:n.visibility,disabled:n.disabled,required:n.required},o,{formSchema:r})};function MF(e){return MF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MF(e)}function LF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return NF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(NF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,NF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,NF(d,"constructor",u),NF(u,"constructor",l),l.displayName="GeneratorFunction",NF(u,o,"GeneratorFunction"),NF(d),NF(d,o,"Generator"),NF(d,r,function(){return this}),NF(d,"toString",function(){return"[object Generator]"}),(LF=function(){return{w:i,m:p}})()}function NF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}NF=function(e,t,n,r){function i(t,n){NF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},NF(e,t,n,r)}function FF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function VF(e,t,n){return(t=function(e){var t=function(e){if("object"!=MF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=MF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==MF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BF=function(t){var r=t.question,o=t.isVisible,i=t.isDisabled,a=t.isRequired,s=t.value,l=t.parentContext,u=t.apiConfig,c=t.showQuestionLabels,d=void 0===c||c,p=t.isCardlistModal,f=void 0!==p&&p,m=Vc(),h=m.state,v=m.setValue,y=m.setSubmitted,g=m.setDisabled,b=m.questionRuleDetails,w=m.formSchema,S=m.validateForm,x=m.setRequired,k=m.setNestedState,O=m.rulesEngine,_=vd().buildTestId,E=(0,e.useRef)(o),C=(0,e.useRef)(!1),I=(0,e.useRef)(!1),T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,e.useContext)(Ac),r=n.state,o=n.formState,i=n.onApiTrigger,a=n.handleApiTrigger,s=(0,e.useCallback)(function(){var e,n=(e=CF().m(function e(n){var s,l;return CF().w(function(e){for(;;)switch(e.n){case 0:if(!(s=a||(i&&"function"==typeof i?function(e){return i(e,r)}:null))){e.n=2;break}return l=_F(_F({},n),{},{toastConfigOverride:t,contextStateSnapshot:{values:(null==o?void 0:o.values)||{},visibility:(null==o?void 0:o.visibility)||{},disabled:(null==o?void 0:o.disabled)||{},required:(null==o?void 0:o.required)||{},errors:(null==o?void 0:o.errors)||{},apiErrors:(null==o?void 0:o.apiErrors)||{},isSubmitted:(null==o?void 0:o.isSubmitted)||!1}}),e.n=1,s(l);case 1:return e.a(2,e.v);case 2:return e.a(2,null)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){TF(i,r,o,a,s,"next",e)}function s(e){TF(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),[o,a,i,r,t]);return{triggerApi:s,formState:o}}(),A=T.triggerApi;if((0,e.useEffect)(function(){if(o&&!E.current&&!C.current&&(null==r?void 0:r.apiUrl)&&"function"==typeof A&&function(e){var t,n;return!(null==e||!e.apiUrl||"dropdown"!==(null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase())&&!0!==(null===(n=e.proxyConfig)||void 0===n?void 0:n.callOnMount))}(r)&&function(e,t){if(e){var n=Vd(e);return 0===n.length||n.every(function(e){var n=t[e];return null!=n&&""!==n})}return!1}(r,h.values)){C.current=!0;var e=RF(r,h.values[null==r?void 0:r.questionId],h,w,"pageLoad");A(e)}o||(C.current=!1),E.current=o},[o,r,A,h,w]),(0,e.useEffect)(function(){var e;if(null!=r&&r.questionId&&o){var t=r.questionId,n=r.apiUrl,i=r.questionType,a=r.addressGroup,s=null==h||null===(e=h.optionsByQuestionId)||void 0===e?void 0:e[t];if(n&&"text"===(null==i?void 0:i.toLowerCase())&&(null==a?void 0:a.toLowerCase().includes("owner_info_dropdown"))&&(null==s?void 0:s.length)>0){var u=te(t);if(void 0!==(null==l?void 0:l.itemIndex)&&(null==l?void 0:l.parentId)&&k){var c=te(l.parentId);k(c,l.itemIndex,{required:VF({},t,!0)}),null!=O&&O.requiredState&&O.requiredState.set(u,!0),null!=O&&O.updateAllInstanceStates&&O.updateAllInstanceStates(c,u,"required",!0)}else x&&x(u,!0)}}},[null==r?void 0:r.questionId,null==r?void 0:r.apiUrl,null==r?void 0:r.questionType,null==r?void 0:r.addressGroup,null==h?void 0:h.optionsByQuestionId,o,null==l?void 0:l.itemIndex,null==l?void 0:l.parentId,x,k,O]),null!=r&&r.questionId&&o){var P,D=r.questionId,j=r.name,R=r.label,M=r.questionType,L=r.options,N=void 0===L?[]:L,F=r.header,V=void 0===F?"":F,B=r.placeholder,q=void 0===B?"":B,Q=r.hintText,z=r.defaultValue,$=r.format,U=void 0===$?"":$,W=r.minLength,H=r.maxLength,G=r.min,Y=r.max,K=r.encrypted,X=void 0!==K&&K,Z=r.maskInput,J=r.maskingType,ee=void 0===J?"":J,ne=r.maskingLength,re=void 0===ne?"":ne,oe=r.target,ie=void 0===oe?"":oe,ae=r.validationErrorMessages,se=void 0===ae?{}:ae,le=r.showCheckBox,ue=void 0!==le&&le,ce=r.isEsignDoc,de=void 0!==ce&&ce,pe=r.isOpenInNewTab,fe=void 0!==pe&&pe,me=r.addAdditional,he=void 0!==me&&me,ve=r.addMedication,ye=void 0!==ve&&ve,ge=r.styleName,be=void 0===ge?"":ge,we=r.customQuestionValueList,Se=r.inputProps,xe=r.dependency,ke=r.fileUploads,Oe=r.allowedFileType,_e=r.fileSizeLimit,Ee=r.numberOfFiles,Ce=r.includeExtraDropDowns,Ie=r.additionalDropDowns,Te=r.uploadQuestionAdditionalDropDown,Ae=r.errorMessage,Pe=r.addressGroup,De=r.startDate,je=r.endDate,Re=r.dateFormat,Me=r.apiUrl,Le=r.tooltip,Ne=void 0===Le?"":Le,Fe=r.cardDeletionProperties,Ve=null==h||null===(P=h.optionsByQuestionId)||void 0===P?void 0:P[D];if(function(e,t,n,r){return e&&"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("owner_info_dropdown"))&&!(null!=r&&r.length)}(Me,M,Pe,Ve))return null;var Be=function(e,t){var n=null==e?void 0:e.toLowerCase();return"text"===n&&null!=t&&t.toLowerCase().includes("address")?"address":"text"===n&&null!=t&&t.toLowerCase().includes("owner_info_dropdown")?"dropdown":n}(M,Pe),qe=lF(Be);if(qe){var Qe,ze,$e,Ue,We=function(e,t,n,r,o){return"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("address"))&&r&&Object.keys(r).length>0?DF(DF({},e),{},{"data-parent-id":r.parentId||o,"data-item-index":void 0===r.itemIndex?-1:r.itemIndex}):e}(Se,M,Pe,l,D),He=aF(Ve||N),Ge=d&&function(e){return!["radio","radiobutton","checkbox","link","button","pdf","cardlist","beneficiary","grid","submit","reset","hidden","checkboxgroup","displaytext"].includes(null==e?void 0:e.toLowerCase())}(M),Ye=function(e,t,n){var r,o,i,a=(null==n||null===(r=n.ruleValidationErrors)||void 0===r?void 0:r[e])||(null==n||null===(o=n.apiErrors)||void 0===o?void 0:o[e])||(null==n||null===(i=n.errors)||void 0===i?void 0:i[e])||null,s=AF(a);if(null!=t&&t.isCardList&&void 0!==(null==t?void 0:t.itemIndex)){var l,u,c,d,p,f,m,h="".concat(t.parentId,"_").concat(t.itemIndex),v=null===(l=n.nestedStates)||void 0===l?void 0:l[h],y=te(e);s=AF(a=(null==v||null===(u=v.ruleValidationErrors)||void 0===u?void 0:u[e])||(null==v||null===(c=v.apiErrors)||void 0===c?void 0:c[e])||(null==v||null===(d=v.errors)||void 0===d?void 0:d[e])||(y&&y!==e?(null==v||null===(p=v.ruleValidationErrors)||void 0===p?void 0:p[y])||(null==v||null===(f=v.apiErrors)||void 0===f?void 0:f[y])||(null==v||null===(m=v.errors)||void 0===m?void 0:m[y]):null)||null)}return a&&"object"===AF(a)&&(a=Object.values(a).filter(Boolean).join(", ")),{fieldError:a,fieldErrorType:s}}(D,l,h),Ke=Ye.fieldError,Xe=Ye.fieldErrorType,Ze=function(){var e,t=(e=LF().m(function e(){var t,n,o,i,a,s,l;return LF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=null==M?void 0:M.toLowerCase(),n="button"===t,o=r.apiUrl,i=r.actionName&&"function"==typeof A,!n||!o&&!i){e.n=7;break}if("string"==typeof(null==r?void 0:r.apiUrl)&&0!==r.apiUrl.trim().length){e.n=3;break}return e.n=1,S();case 1:if(a=e.v,!(Object.keys(a).length>0)){e.n=2;break}return y(!0),e.a(2);case 2:if(!tt([".error_message_display_text",".error-message"])){e.n=3;break}return y(!0),e.a(2);case 3:if(s=RF(r,null,h,w,"buttonClick"),!I.current){e.n=4;break}return e.a(2);case 4:return l=Boolean(r.disabled),I.current=!0,"function"==typeof g&&g(D,!0),e.p=5,e.n=6,A(s);case 6:return e.p=6,I.current=!1,"function"==typeof g&&g(D,l),e.f(6);case 7:return e.a(2)}},e,null,[[5,,6,7]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){FF(i,r,o,a,s,"next",e)}function s(e){FF(i,r,o,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}(),Je=null!=q&&""!==String(q).trim()?q:Q||z||R||"",et=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null,nt=pt(D,et),rt=null!==(Qe=null!==(ze=null===($e=h.userModified)||void 0===$e?void 0:$e[nt])&&void 0!==ze?ze:r.userModified)&&void 0!==Qe&&Qe,ot=function(e){var t=e.question,n=e.questionId,r=e.name,o=e.label,i=e.shouldShowLabel,a=e.value,s=e.formattedOptions,l=e.handleChange,u=e.handleBlur,c=e.handleButtonClick,d=e.isDisabled,p=e.isRequired,f=e.computedPlaceholder,m=e.fieldError,h=e.minLength,v=e.maxLength,y=e.min,g=e.max,b=e.header,w=e.format,S=e.encrypted,x=e.maskInput,k=e.maskingType,O=e.maskingLength,_=e.target,E=e.validationErrorMessages,C=e.showCheckBox,I=e.isEsignDoc,T=e.isOpenInNewTab,A=e.addAdditional,P=e.addMedication,D=e.questionRuleDetails,j=e.fieldInputProps,R=e.isVisible,M=e.apiConfig,L=e.dependency,N=e.state,F=e.styleName,V=e.customQuestionValueList,B=e.fileUploads,q=e.allowedFileType,Q=e.fileSizeLimit,z=e.numberOfFiles,$=e.includeExtraDropDowns,U=e.additionalDropDowns,W=e.uploadQuestionAdditionalDropDown,H=e.errorMessage,G=e.addressGroup,Y=e.startDate,K=e.endDate,X=e.dateFormat,Z=e.questionType,J=e.parentContext,ee=e.showQuestionLabels,te=e.isCardlistModal,ne=e.userModified,re=void 0!==ne&&ne,oe=e.cardDeletionProperties,ie=DF(DF({id:String(n),questionId:String(n),name:r,label:i?"":o,value:void 0===a?"":a,options:s,onChange:l,onBlur:u,onClick:"button"===(null==Z?void 0:Z.toLowerCase())?c:void 0,disabled:d,required:p,placeholder:f,error:m,maxLength:v,minLength:h,min:y,max:g,header:b,format:w,encrypted:S,maskInput:x,maskingType:k,maskingLength:O,target:_,validationerrormessages:E,showcheckbox:C,isesigndoc:I,isopeninnewtab:T,addadditional:A,addmedication:P,questionRuleDetails:D,inputProps:j,visible:R,dependsOn:null==L?void 0:L.split(","),formData:N.values,styleName:F,customQuestionValueList:V,fileUploads:B,allowedFileType:q,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:$,additionalDropDowns:U,uploadQuestionAdditionalDropDown:W,errorMessage:H,addressGroup:G,tooltip:t.tooltip||"",showQuestionLabels:ee,userModified:re},j),{},{apiConfig:M});t.fieldProps&&Object.assign(ie,t.fieldProps),ie.apiConfig=M;var ae=S?{encrypted:!0}:{},se=DF(DF({},ie),ae);return G&&Object.assign(se,{addressGroup:G}),"upload"===(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{allowedFileType:q,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:$,additionalDropDowns:U,uploadQuestionAdditionalDropDown:W,errorMessage:H}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{maskInput:x,maskingType:k,maskingLength:O}),["cardlist","beneficiary","grid"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{customQuestionValueList:V,questionType:"cardlist",min:y,max:g,isCardlistModal:te,cardListPreviewPattern:t.cardListPreviewPattern,patternPreview:t.patternPreview,cardDeletionProperties:null!=oe?oe:null}),["date","datetime","month","time","week"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{startDate:Y,endDate:K,dateFormat:X}),"displaytext"===(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{value:t.value,parentContext:J}),se.apiConfig=M,se}({question:r,questionId:D,name:j,label:R,shouldShowLabel:Ge,value:s,formattedOptions:He,handleChange:function(e){var t=null==M?void 0:M.toLowerCase();("cardlist"===t||r.onChange)&&"function"==typeof r.onChange&&r.onChange(e);var n=function(e,t,n){var r,o;if("upload"===(null==t?void 0:t.toLowerCase())){var i=e.value,a=e.fileUploads;return n.fileUploads=a,i}return null!==(r=null==e||null===(o=e.target)||void 0===o?void 0:o.value)&&void 0!==r?r:e}(e,t,r);if(e&&"cardlist"!==t&&"button"!==t){var o=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null;v(D,n,null,o)}if(("dropdown"===t||"text"===t)&&r.apiUrl&&"function"==typeof A){var i=RF(r,n,h,w,"onChange");A(i)}},handleBlur:function(e){var t=null==M?void 0:M.toLowerCase();if(("text"===t||"currency"===t)&&r.apiUrl&&"function"==typeof A){var n,o=void 0===(null==e||null===(n=e.target)||void 0===n?void 0:n.value)?e:e.target.value,i=RF(r,o,h,w,"onBlur");A(i)}},handleButtonClick:Ze,isDisabled:i,isRequired:a,computedPlaceholder:Je,fieldError:Ke,minLength:W,maxLength:H,min:G,max:Y,header:V,format:U,encrypted:X,maskInput:Z,maskingType:ee,maskingLength:re,target:ie,validationErrorMessages:se,showCheckBox:ue,isEsignDoc:de,isOpenInNewTab:fe,addAdditional:he,addMedication:ye,questionRuleDetails:b,fieldInputProps:We,isVisible:o,apiConfig:u,dependency:xe,state:h,styleName:be,customQuestionValueList:we,fileUploads:ke,allowedFileType:Oe,fileSizeLimit:_e,numberOfFiles:Ee,includeExtraDropDowns:Ce,additionalDropDowns:Ie,uploadQuestionAdditionalDropDown:Te,errorMessage:Ae,addressGroup:Pe,startDate:De,endDate:je,dateFormat:Re,questionType:M,parentContext:l,showQuestionLabels:d,isCardlistModal:f,userModified:rt,cardDeletionProperties:Fe}),it=null!=(null==l?void 0:l.parentId)&&void 0!==(null==l?void 0:l.itemIndex),at=it?"".concat(D,"_").concat(l.itemIndex):D,st=null!==(Ue=r.testId)&&void 0!==Ue?Ue:D,lt=(r.questionType||"unknown").toString().toLowerCase(),ut=it?["field",l.parentId,"item",l.itemIndex,lt,st]:["field",lt,st],ct=_.apply(void 0,ut),dt=_.apply(void 0,ut.concat(["label"])),ft=_.apply(void 0,ut.concat(["error"])),mt=_.apply(void 0,ut.concat(["input"]));ot["data-testid"]=mt,ot.testId=mt,ot.testIdRoot=ct;var ht="button"!==(null==M?void 0:M.toLowerCase())?"col-md-12":"";return n().createElement("div",{id:"question_".concat(at),className:"form-field-container ".concat(Ke?"has-error":""," ").concat(be||ht),"data-testid":ct},Ge&&R&&n().createElement("div",{className:"field-label","data-testid":dt},n().createElement("div",{className:"question_label"},R,d&&a&&n().createElement("span",{className:"required-mark"},"*"),d&&Ne&&n().createElement(hO,{tooltip:Ne})),V&&n().createElement("div",{className:"field-header"},V)),n().createElement(qe,ot),Ke&&"string"===Xe&&"upload"!==(null==M?void 0:M.toLowerCase())&&"percentage"!==(null==M?void 0:M.toLowerCase())&&n().createElement("div",{className:"error-message","data-testid":ft},Ke))}}return null};BF.propTypes={question:Xd,isVisible:o().bool,isDisabled:o().bool,isRequired:o().bool,value:o().any,parentContext:o().object,apiConfig:o().object,showQuestionLabels:o().bool,isCardlistModal:o().bool};const qF=BF;function QF(e){return QF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QF(e)}function zF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zF(Object(n),!0).forEach(function(t){UF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UF(e,t,n){return(t=function(e){var t=function(e){if("object"!=QF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WF=function(e){return void 0!==(null==e?void 0:e.itemIndex)&&(null==e?void 0:e.parentId)},HF=function(e){return"".concat(e.parentId,"_").concat(e.itemIndex)},GF=function(e){var t=e.group,r=e.parentContext,o=void 0===r?null:r,i=e.apiConfig,a=e.defaultGroupClass,s=void 0===a?"":a,l=e.showQuestionLabels,u=void 0===l||l,c=e.isCardlistModal,d=void 0!==c&&c,p=Vc().state,f=vd().buildTestId;if(t&&Array.isArray(t.questions)){var m,h;if(!t.groupId||null===(m=null==p||null===(h=p.groupVisibility)||void 0===h?void 0:h[t.groupId])||void 0===m||m){var v=t.questions.some(function(e){var t,n,r,o=null==e?void 0:e.questionId;return!!o&&(null===(t=null!==(n=null==p||null===(r=p.visibility)||void 0===r?void 0:r[o])&&void 0!==n?n:e.visible)||void 0===t||t)}),y=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=te(null==e?void 0:e.questionId),o=null==e||null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase();return WF(n)?function(e,t,n,r){var o,i,a=null==r||null===(o=r.values)||void 0===o?void 0:o[n.parentId];if(Array.isArray(a)&&a[n.itemIndex]){var s=a[n.itemIndex];if(Array.isArray(null==s?void 0:s.properties)){var l,u,c=s.properties.find(function(e){return te(e.editQuestionId)===t});if(c)return null!==(l=null!==(u=c.value)&&void 0!==u?u:e.defaultValue)&&void 0!==l?l:""}if(void 0!==s[t])return s[t]}return null!==(i=e.defaultValue)&&void 0!==i?i:""}(e,r,n,p):"cardlist"===o?function(e,t){var n,r=null==t||null===(n=t.values)||void 0===n?void 0:n[e];return Array.isArray(r)?r.map(function(e){return e?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){return $F($F({},e),{},{editQuestionId:te(e.editQuestionId),property:e.property,renderMode:e.renderMode,value:e.value})}):[]}:{}}):[]}(r,p):function(e,t,n){var r,o,i,a;return null!==(r=null!==(o=null!==(i=null==n||null===(a=n.values)||void 0===a?void 0:a[t])&&void 0!==i?i:e.value)&&void 0!==o?o:e.defaultValue)&&void 0!==r?r:""}(e,r,p)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map(function(e,r){var o=te(null==e?void 0:e.questionId);if(o){var a=function(e,t,n){return WF(n)?"".concat(e,"-").concat(t,"-").concat(n.itemIndex):"".concat(e,"-").concat(t)}(o,r,t),s=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null===(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.visibility)||void 0===u?void 0:u[e])&&void 0!==l?l:r)||void 0===s||s}return null===(o=null!==(i=null==n||null===(a=n.visibility)||void 0===a?void 0:a[e])&&void 0!==i?i:r)||void 0===o||o}(o,t,p,e.visible),l=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.disabled)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.disabled)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.disabled),c=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.required)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.required)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.required);return n().createElement(qF,{key:a,question:e,isVisible:s,isDisabled:l,isRequired:c,value:y(e,t),parentContext:t,apiConfig:i,showQuestionLabels:u,isCardlistModal:d})}return null})},b="question-group ".concat(WF(o)?"card-list-question":""," ").concat(s||"").trim(),w=t.groupName&&!t.groupName.startsWith("--");if(v){var S,x,k=null!==(S=null!==(x=t.groupId)&&void 0!==x?x:t.groupName)&&void 0!==S?S:"unnamed";return n().createElement("div",{className:b,key:"question-group-".concat((null==o?void 0:o.itemIndex)||""),"data-testid":f("group",k)},w&&n().createElement("h3",{className:"group-name"},t.groupName),g(t.questions,o))}return g(t.questions,o)}return null}return null};GF.propTypes={group:Zd,parentContext:o().object,apiConfig:o().object,defaultGroupClass:o().string,showQuestionLabels:o().bool,isCardlistModal:o().bool};const YF=GF;function KF(e){return KF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KF(e)}function XF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return ZF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(ZF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ZF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,ZF(d,"constructor",u),ZF(u,"constructor",l),l.displayName="GeneratorFunction",ZF(u,o,"GeneratorFunction"),ZF(d),ZF(d,o,"Generator"),ZF(d,r,function(){return this}),ZF(d,"toString",function(){return"[object Generator]"}),(XF=function(){return{w:i,m:p}})()}function ZF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ZF=function(e,t,n,r){function i(t,n){ZF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ZF(e,t,n,r)}function JF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function eV(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){JF(i,r,o,a,s,"next",e)}function s(e){JF(i,r,o,a,s,"throw",e)}a(void 0)})}}function tV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tV(Object(n),!0).forEach(function(t){rV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rV(e,t,n){return(t=function(e){var t=function(e){if("object"!=KF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=KF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==KF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oV(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=aV(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function iV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||aV(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aV(e,t){if(e){if("string"==typeof e)return sV(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sV(e,t):void 0}}function sV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var lV=function(t){var r,o=t.schema,i=void 0===o?[]:o,a=t.actionSchema,s=void 0===a?[]:a,l=t.onSubmit,u=t.isNested,c=void 0!==u&&u,d=t.parentContext,p=void 0===d?{}:d,f=t.apiConfig,m=t.onApiTrigger,h=t.toastConfig,v=void 0===h?{}:h,y=t.defaultGroupClass,g=void 0===y?"":y,b=t.rerunPageRulesOnNext,w=void 0===b||b,S=t.pageRenderers,x=void 0===S?{}:S,k=t.pageType,O=t.showQuestionLabels,_=void 0===O||O,E=t.isCardlistModal,C=void 0!==E&&E,I=Vc(),T=vd().buildTestId,A=I.state,P=I.setSubmitted,D=I.validateForm,j=I.onApiTrigger,R=I.handleApiTrigger,M=I.batchUpdateFields,L=I.updateFieldOptions,N=I.processPageLoadRules,F=I.clearApiError,V=I.setApiError,B=I.setError,q=(0,e.useRef)(A),Q=(0,e.useRef)((null==A?void 0:A.required)||{});if((0,e.useEffect)(function(){q.current=A},[A]),(0,e.useEffect)(function(){if(null!=A&&A.required&&null!=A&&A.errors){for(var e=A.required,t=Q.current,n=[],r=0,o=Object.entries(A.errors);r<o.length;r++){var i=iV(o[r],2),a=i[0];if(i[1]){var s=!1!==t[a],l=!1===e[a];s&&l&&n.push(a)}}if(n.length>0&&B){var u,c=oV(n);try{for(c.s();!(u=c.n()).done;){var d=u.value;B(d,null)}}catch(e){c.e(e)}finally{c.f()}}Q.current=nV({},e)}else Q.current=(null==A?void 0:A.required)||{}},[null==A?void 0:A.required,null==A?void 0:A.errors,B]),!Array.isArray(i))throw new TypeError("Invalid form schema provided");var z=(0,e.useMemo)(function(){return function(e){if(Array.isArray(e)){var t,n=[],r=jd(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(Array.isArray(null==o?void 0:o.questions)){var i,a=jd(o.questions);try{for(a.s();!(i=a.n()).done;){var s=i.value;Md(s,n)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}return[]}(i)},[i]),$=function(){var e=eV(XF().m(function e(t,n,r){var o,a,s,l,u,c;return XF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=t.questionId,a=qd(A),s=Bd(t,n,a,r,{formSchema:i}),!R){e.n=1;break}return e.a(2,R(nV(nV({},s),{},{questionId:o,contextStateSnapshot:a})));case 1:if(!(l=m||j)){e.n=5;break}return e.p=2,e.n=3,l(s,A);case 3:return u=e.v,e.a(2,Rl(u,{questionId:o,applyUpdates:M,applyOptions:L,setApiError:V,clearApiError:F,showSuccessToast:function(e){return El(e,"success",v)},showErrorToast:function(e){return El(e,"error",v)}}));case 4:return e.p=4,c=e.v,El(c.message||"An error occurred during API operation","error",v),e.a(2,{errors:{error:c.message||"Unknown error occurred"}});case 5:return e.a(2,null)}},e,null,[[2,4]])}));return function(t,n,r){return e.apply(this,arguments)}}(),U=(0,e.useRef)(new Set);(0,e.useEffect)(function(){if(z.length&&A){var e,t=oV(z);try{for(t.s();!(e=t.n()).done;){var n,r,o=e.value,i=null===(n=null===(r=A.visibility)||void 0===r?void 0:r[o.questionId])||void 0===n||n,a="".concat(o.questionId,"_").concat(o.triggerType);if("pageLoad"===o.triggerType&&i&&!Cd(A,o.questionId)&&!U.current.has(a)){U.current.add(a);var s={questionId:o.questionId,questionType:o.questionType,addressGroup:o.addressGroup,apiUrl:o.apiUrl,proxyConfig:o.proxyConfig},l=A.values[o.questionId];$(s,l,"pageLoad")}}}catch(e){t.e(e)}finally{t.f()}}},[z,null==A?void 0:A.visibility,null==A?void 0:A.values]);var W=function(){var e=eV(XF().m(function e(t,n){var r,o,i,a,s,u,c;return XF().w(function(e){for(;;)switch(e.n){case 0:if(n.preventDefault(),"back"!==(null==t?void 0:t.toLowerCase())){e.n=1;break}return l&&l(q.current,t),e.a(2);case 1:if(s="save"===(null==t?void 0:t.toLowerCase())){e.n=3;break}return e.n=2,D();case 2:if(u=e.v,!(Object.keys(u).length>0)){e.n=3;break}return P(!0),Kd(),e.a(2);case 3:return e.n=4,SF(function(){var e;return null===(e=q.current)||void 0===e?void 0:e.apiLoading});case 4:if(!e.v){e.n=5;break}e.n=6;break;case 5:return El("Still waiting for the latest server response. Please try again in a moment.","warning",v),e.a(2);case 6:if("next"!==(null==t?void 0:t.toLowerCase())||!w||!N){e.n=7;break}return e.n=7,N();case 7:if(s||!Yd(null===(r=q.current)||void 0===r?void 0:r.errors,null===(o=q.current)||void 0===o?void 0:o.apiErrors,null===(i=q.current)||void 0===i?void 0:i.ruleValidationErrors,null===(a=q.current)||void 0===a?void 0:a.nestedStates)){e.n=8;break}return P(!0),Kd(),e.a(2);case 8:if(c=[".error_message_display_text",".error-message"],s||!tt(c)){e.n=9;break}return P(!0),Kd(),e.a(2);case 9:l&&l(q.current,t);case 10:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),H=c?"div":"form",G=k?String(k):null!==(r=i[0])&&void 0!==r&&r.groupId?String(i[0].groupId):null,Y=G&&x[G]?x[G]:null,K=function(e,t,r,o){var i=function(i){var a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S,x,k,O=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i||!i.questionId)return console.warn("createFieldRenderer: Invalid question provided"),null;var _=e.state,E=i.questionId,C=null===(a=i.questionType)||void 0===a?void 0:a.toLowerCase(),I=t(C);if(!I)return console.warn("createFieldRenderer: No component found for type: ".concat(C)),null;var T=void 0!==O.value?O.value:null!==(s=null!==(l=null!==(u=null==_||null===(c=_.values)||void 0===c?void 0:c[E])&&void 0!==u?u:i.value)&&void 0!==l?l:i.defaultValue)&&void 0!==s?s:"",A=null===(d=null!==(p=null==_||null===(f=_.visibility)||void 0===f?void 0:f[E])&&void 0!==p?p:i.visible)||void 0===d||d,P=null!==(m=null!==(h=null==_||null===(v=_.disabled)||void 0===v?void 0:v[E])&&void 0!==h?h:i.disabled)&&void 0!==m&&m,D=null!==(y=null!==(g=null==_||null===(b=_.required)||void 0===b?void 0:b[E])&&void 0!==g?g:i.required)&&void 0!==y&&y,j=(null==_||null===(w=_.errors)||void 0===w?void 0:w[E])||(null==_||null===(S=_.ruleValidationErrors)||void 0===S?void 0:S[E])||(null==_||null===(x=_.apiErrors)||void 0===x?void 0:x[E])||null,R=(null==_||null===(k=_.optionsByQuestionId)||void 0===k?void 0:k[E])||i.options||[],M=r(R),L=O.showQuestionLabels,N=O.apiConfig,F=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(O,cF),V=void 0===L||L,B=void 0!==N?N:o,q=vF(vF(vF({id:String(E),questionId:String(E),name:i.name||E,label:i.label||"",value:void 0===T?"":T,options:M,disabled:P||F.disabled,required:D,placeholder:i.placeholder||i.hintText||i.defaultValue||"",error:j,maxLength:i.maxLength,minLength:i.minLength,min:i.min,max:i.max,header:i.header,format:i.format,encrypted:i.encrypted,maskInput:i.maskInput,maskingType:i.maskingType,maskingLength:i.maskingLength,target:i.target,validationerrormessages:i.validationErrorMessages,showcheckbox:i.showCheckBox,isesigndoc:i.isEsignDoc,isopeninnewtab:i.isOpenInNewTab,addadditional:i.addAdditional,addmedication:i.addMedication,visible:A,styleName:i.styleName||"",tooltip:i.tooltip||"",showQuestionLabels:V},i.fieldProps),F),{},{apiConfig:B});return"upload"===C&&Object.assign(q,{allowedFileType:i.allowedFileType,fileSizeLimit:i.fileSizeLimit,numberOfFiles:i.numberOfFiles,includeExtraDropDowns:i.includeExtraDropDowns,additionalDropDowns:i.additionalDropDowns,uploadQuestionAdditionalDropDown:i.uploadQuestionAdditionalDropDown,errorMessage:i.errorMessage}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(C)&&Object.assign(q,{maskInput:i.maskInput,maskingType:i.maskingType,maskingLength:i.maskingLength}),["cardlist","beneficiary","grid"].includes(C)&&Object.assign(q,{customQuestionValueList:i.customQuestionValueList,questionType:"cardlist",min:i.min,max:i.max}),["date","datetime","month","time","week"].includes(C)&&Object.assign(q,{startDate:i.startDate,endDate:i.endDate,dateFormat:i.dateFormat}),!q.onChange&&e.setValue&&(q.onChange=function(t){var n,r,o,i="upload"===C?null!==(n=null==t?void 0:t.value)&&void 0!==n?n:t:null!==(r=null==t||null===(o=t.target)||void 0===o?void 0:o.value)&&void 0!==r?r:t;e.setValue(E,i),F.onChange&&F.onChange(t)}),!q.onBlur&&e.setValue&&(q.onBlur=function(e){F.onBlur&&F.onBlur(e)}),"button"!==C||q.onClick||(q.onClick=mF(dF().m(function t(){var n,r,o,a;return dF().w(function(t){for(;;)switch(t.n){case 0:if(n=!!i.apiUrl,r=!!i.actionName,!n&&!r){t.n=3;break}if(n||"function"!=typeof e.validateForm){t.n=2;break}return t.n=1,e.validateForm();case 1:if(o=t.v,!(Object.keys(o).length>0)){t.n=2;break}return null===(a=e.setSubmitted)||void 0===a||a.call(e,!0),t.a(2);case 2:"function"==typeof e.handleApiTrigger&&e.handleApiTrigger({questionId:E,triggerType:"buttonClick",apiUrl:i.apiUrl,actionName:i.actionName,proxyConfig:i.proxyConfig,values:(null==_?void 0:_.values)||{},questionType:null==i?void 0:i.questionType});case 3:return t.a(2)}},t)}))),q.apiConfig=B,n().createElement(I,q)};return i.displayName="FieldRenderer",i}(I,lF,aF,f),X=function(){return s&&0!==s.length?n().createElement("div",{className:"form-actions","data-testid":T("actions")},s.map(function(e,t){if(e&&"object"===KF(e)){var r,o=e.text,i=e.action,a=e.disabled,s=void 0!==a&&a,l=e.actionButtonId,u="action_".concat(i,"_").concat(t),c="btn ".concat(["validateinterview","next","save"].includes(i)?"btn-primary":"btn-secondary"),d=(null===(r=A.actionButtonDisabled)||void 0===r?void 0:r[l])||!1,p=s||d,f=p?{cursor:"not-allowed"}:{},m=l||"".concat(i||"button","-").concat(t);return n().createElement("button",{key:u,type:"button",disabled:p,className:c,style:f,onClick:function(e){return W(i,e)},"data-testid":T("action",m)},o)}return null})):null};return Y?n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form"),"data-testid":T("root")},n().createElement(Y,{pageType:G,schema:i,state:A,formContext:I,renderField:K,getFieldComponent:lF,formatOptions:aF,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:_}),X()):n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form"),"data-testid":T("root")},i.map(function(e,t){var r=null!=e&&e.groupId?String(e.groupId):"group_".concat(t),o=x[r];if(o)return n().createElement(o,{key:r,groupId:r,group:e,schema:i,state:A,formContext:I,renderField:K,getFieldComponent:lF,formatOptions:aF,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:_,isCardlistModal:C});var a=(null==e?void 0:e.groupId)||"group_".concat(t);return n().createElement(YF,{key:a,group:e,parentContext:p,apiConfig:f,defaultGroupClass:g,showQuestionLabels:_,isCardlistModal:C})}),X())};lV.propTypes={schema:Jd.questionGroups,actionSchema:o().array,onSubmit:o().func,isNested:o().bool,parentContext:o().object,apiConfig:o().object,onApiTrigger:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),defaultGroupClass:o().string,rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const uV=lV;function cV(e){return cV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cV(e)}function dV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dV(Object(n),!0).forEach(function(t){fV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fV(e,t,n){return(t=function(e){var t=function(e){if("object"!=cV(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cV(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mV=function(t){var r=t.questionGroups,o=t.actionButtons,i=t.questionRuleDetails,a=void 0===i?[]:i,s=t.questionRules,l=void 0===s?[]:s,u=t.groupRuleDetails,c=void 0===u?[]:u,d=t.groupRules,p=void 0===d?[]:d,f=t.optionRuleDetails,m=void 0===f?[]:f,h=t.optionRules,v=void 0===h?[]:h,y=t.buttonRules,g=void 0===y?[]:y,b=t.buttonRuleDetails,w=void 0===b?[]:b,S=t.theme,x=void 0===S?{}:S,k=t.debug,O=void 0!==k&&k,_=t.onSubmit,E=t.validationErrors,C=void 0===E?[]:E,T=t.isNested,A=void 0!==T&&T,P=t.parentContext,D=void 0===P?{}:P,j=t.skipFormProvider,R=void 0!==j&&j,M=t.apiConfig,L=t.onApiTrigger,N=t.formApiRef,F=t.handleIncompleteChange,V=t.toastConfig,q=void 0===V?{}:V,Q=t.performanceConfig,z=t.engineOptions,$=t.defaultGroupClass,U=void 0===$?"":$,W=t.rerunPageRulesOnNext,H=void 0===W||W,G=t.pageRenderers,Y=void 0===G?{}:G,K=t.pageType,X=t.showQuestionLabels,Z=void 0===X||X,J=t.isCardlistModal,ee=void 0!==J&&J,te=t.isSanitizeAddress,ne=t.testIdPrefix,re=void 0===ne?ld:ne,oe=t.testIdsEnabled,ie=void 0===oe||oe;console.log("Package Version:","1.4.8");var ae=(0,e.useMemo)(function(){return pV(pV({},ed),x)},[x]),se=n().createElement(ad,{theme:ae},n().createElement(uV,{schema:Array.isArray(r)?r.map(function(e){return e&&"object"===cV(e)&&!Array.isArray(e.questions)?pV(pV({},e),{},{questions:Array.isArray(e.questions)?e.questions:[]}):e}):[],actionSchema:o,onSubmit:_,isNested:A,parentContext:D,apiConfig:M,onApiTrigger:L,toastConfig:q,defaultGroupClass:U,rerunPageRulesOnNext:H,pageRenderers:Y,pageType:K,showQuestionLabels:Z,isCardlistModal:ee})),le=se;if(A||R||(le=n().createElement(Fc,{formSchema:r,questionRuleDetails:a,questionRules:l,groupRuleDetails:c,groupRules:p,optionRuleDetails:m,optionRules:v,buttonRules:g,buttonRuleDetails:w,validationSchema:C,debug:O,onApiTrigger:L,formApiRef:N,handleIncompleteChange:F,toastConfig:q,performanceConfig:Q,engineOptions:z,isCardlistModal:ee,isSanitizeAddress:te},se)),M){var ue,ce,de={baseURL:M.baseURL||(null===(ue=M.customApi)||void 0===ue?void 0:ue.baseUrl)||"",headers:(null===(ce=M.customApi)||void 0===ce?void 0:ce.headers)||{}};M.customApi&&Object.assign(de,M.customApi),le=n().createElement(B,{config:de},le)}return null!=q&&q.disableToasts||null!=q&&q.useHostToastify||(le=n().createElement(n().Fragment,null,le,n().createElement(I,{position:"top-right",autoClose:5e3}))),A?le:n().createElement(hd,{prefix:re,enabled:ie},le)};mV.propTypes={questionGroups:o().arrayOf(o().shape({groupName:o().string,questions:o().arrayOf(o().object)})),actionButtons:o().arrayOf(o().object),questionRuleDetails:o().arrayOf(o().object),questionRules:o().arrayOf(o().shape({targetQuestionId:o().oneOfType([o().string,o().number]).isRequired,expressionToEvaluateForTheAction:o().object.isRequired})),groupRuleDetails:o().arrayOf(o().object),groupRules:o().arrayOf(o().object),optionRuleDetails:o().arrayOf(o().object),optionRules:o().arrayOf(o().object),buttonRules:o().arrayOf(o().object),buttonRuleDetails:o().arrayOf(o().object),theme:o().object,debug:o().bool,onSubmit:o().func,validationErrors:o().arrayOf(o().shape({questionid:o().oneOfType([o().string,o().number]).isRequired,message:o().string.isRequired,groupId:o().oneOfType([o().string,o().number])})),isNested:o().bool,parentContext:o().object,skipFormProvider:o().bool,apiConfig:o().object,parentAddressGroup:o().string,onApiTrigger:o().func,formApiRef:o().shape({current:o().object}),handleIncompleteChange:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),performanceConfig:o().shape({debounceDelayMs:o().number}),engineOptions:o().shape({enablePerActionGating:o().bool,maxEvaluationDepth:o().number}),rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool,isSanitizeAddress:o().string,testIdPrefix:o().string,testIdsEnabled:o().bool,defaultGroupClass:o().string};const hV=((yV=function(e){return n().createElement(Od,{fallback:Ed},n().createElement(vV,e))}).displayName="WithErrorBoundary(".concat((vV=mV).displayName||vV.name||"Component",")"),yV);var vV,yV;function gV(){var t=Vc(),n=t.formData,r=t.errors,o=t.touched,i=t.isSubmitting,a=t.handleChange,s=t.handleSubmit,l=t.setFieldError,u=t.setFieldTouched,c=t.setIsSubmitting,d=t.resetForm,p=(0,e.useCallback)(function(e,t){var n=al(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]);return n&&l(e.questionId,n),n},[l]);return{formData:n,errors:r,touched:o,isSubmitting:i,handleChange:a,handleSubmit:s,validateField:p,setFieldTouched:u,setIsSubmitting:c,resetForm:d}}})(),s})());
102
+ `:null,tO=Ey("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ag(n.color)}`]]}})(ig(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Jk||{animation:`${Xk} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),nO=Ey("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),rO=Ey("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ag(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(ig(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:eO||{animation:`${Zk} 1.4s ease-in-out infinite`}}]}))),oO=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:i=!1,size:a=40,style:s,thickness:l=3.6,value:u=0,variant:c="indeterminate",...d}=n,p={...n,color:o,disableShrink:i,size:a,thickness:l,value:u,variant:c},f=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e;return Np({root:["root",n,`color${ag(r)}`],svg:["svg"],circle:["circle",`circle${ag(n)}`,o&&"circleDisableShrink"]},Kk,t)})(p),m={},h={},v={};if("determinate"===c){const e=2*Math.PI*((44-l)/2);m.strokeDasharray=e.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,h.transform="rotate(-90deg)"}return(0,Iy.jsx)(tO,{className:Lp(f.root,r),style:{width:a,height:a,...h,...s},ownerState:p,ref:t,role:"progressbar",...v,...d,children:(0,Iy.jsx)(nO,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,Iy.jsx)(rO,{className:f.circle,style:m,ownerState:p,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})})});function iO(e){return mg("MuiIconButton",e)}const aO=hg("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),sO=Ey(Yk,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,"default"!==n.color&&t[`color${ag(n.color)}`],n.edge&&t[`edge${ag(n.edge)}`],t[`size${ag(n.size)}`]]}})(ig(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),ig(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${aO.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${aO.loading}`]:{color:"transparent"}}))),lO=Ey("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),uO=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:i,color:a="default",disabled:s=!1,disableFocusRipple:l=!1,size:u="medium",id:c,loading:d=null,loadingIndicator:p,...f}=n,m=bk(c),h=p??(0,Iy.jsx)(oO,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:r,color:a,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:h,size:u},y=(e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:a}=e;return Np({root:["root",a&&"loading",n&&"disabled","default"!==r&&`color${ag(r)}`,o&&`edge${ag(o)}`,`size${ag(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},iO,t)})(v);return(0,Iy.jsxs)(sO,{id:d?m:c,className:Lp(y.root,i),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:v,children:["boolean"==typeof d&&(0,Iy.jsx)("span",{className:y.loadingWrapper,style:{display:"contents"},children:(0,Iy.jsx)(lO,{className:y.loadingIndicator,ownerState:v,children:d&&h})}),o]})});function cO(e){return cO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cO(e)}function dO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dO(Object(n),!0).forEach(function(t){fO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fO(e,t,n){return(t=function(e){var t=function(e){if("object"!=cO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mO=function(e){var t=e.tooltip,r=e.placement,o=void 0===r?"top":r,i=e.sx,a=void 0===i?{}:i;return t?n().createElement(Tk,{title:t,arrow:!0,placement:o},n().createElement(uO,{size:"small",sx:pO({padding:"2px",marginLeft:"4px",verticalAlign:"middle",minWidth:"auto",width:"18px",height:"18px","&:hover":{backgroundColor:"transparent"}},a),"aria-label":t},n().createElement("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"10px",fontWeight:"bold",lineHeight:1}},"i"))):null};mO.propTypes={tooltip:o().string,placement:o().oneOf(["top","bottom","left","right"]),sx:o().object};const hO=mO;function vO(e){return vO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vO(e)}function yO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yO(Object(n),!0).forEach(function(t){bO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bO(e,t,n){return(t=function(e){var t=function(e){if("object"!=vO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wO=function(t){var r=t.questionId,o=t.label,i=t.defaultValue,a=t.validation,s=t.value,l=t.required,u=t.disabled,c=void 0!==u&&u,d=t.placeholder,p=t.onChange,f=t.type,m=void 0===f?"text":f,h=t.maskInput,v=t.format,y=t.helperText,g=(t._encrypted,t._maskingType,t._maskingLength,t._validationErrorMessages,t._showCheckBox,t._isEsignDoc,t._isOpenInNewTab,t._addAdditional,t._addMedication,t.header),b=t.maxLength,w=t.minLength,S=t.visible,x=t.inputProps,k=void 0===x?{}:x,O=t.styleName,_=t.customTheme,E=void 0===_?{}:_,C=(t._props,t.onSearch),I=t.onBlur,T=t.tooltip,A=void 0===T?"":T,P=t.showQuestionLabels,D=void 0===P||P,j=t.testId,R=(0,e.useRef)(null),M=sd(),L=k["data-item-index"],N=k["data-parent-id"],F=$S({questionId:r,itemIndex:L,defaultValue:i,defaultVisible:!0,defaultDisabled:!1}),V=F.disabled,B=F.error,q=V||c,Q=(0,e.useMemo)(function(){var e=M.textField||{};return YS(e,E)},[M,E]),z=(0,e.useMemo)(function(){var e=gO(gO({},Q.container),{},{width:"100%"}),t=ZS(Q.input,B&&Q.error,q&&Q.disabled);return{container:KS(e,Q.responsive),input:t}},[Q,B,q]);(0,e.useEffect)(function(){if(h&&R.current){var e=function(e){var t={placeholder:"",insertMode:!0,rightAlign:!1,clearMaskOnLostFocus:!1,showMaskOnHover:!1,showMaskOnFocus:!1,jitMasking:!0,greedy:!1};if("string"==typeof e){var n=e;return"#####-####"===e.replaceAll("9","#")&&(n="#####[-####]"),new(Qa())(js(js({},t),{},{mask:n.replaceAll("#","9")}))}var r=e.alias,o=e.inputFormat,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ts);return new(Qa())(js(js({},t),{},{alias:r,inputFormat:o},i))}(h);return e.mask(R.current),function(){e.remove()}}},[h,m]);var $=(0,e.useMemo)(function(){return Ms(m)},[m]),U=(0,e.useMemo)(function(){return"number"!==m?{}:{onWheel:function(e){e.target.blur()},onKeyDown:function(e){var t=e.key;"ArrowUp"!==t&&"ArrowDown"!==t&&"PageUp"!==t&&"PageDown"!==t||e.preventDefault(),("e"===t||"E"===t||"+"===t||"="===t&&e.shiftKey)&&e.preventDefault()}}},[m]),W=(0,e.useMemo)(function(){if("number"===m)return{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}},[m]),H=(0,e.useMemo)(function(){return ZS(W,XS(Q.disabled))},[W,Q.disabled]);if(!S)return null;var G=m,Y=b,K=void 0===L?r:"".concat(r,"-").concat(L);return n().createElement("div",{className:"form-field ".concat(O||""),style:z.container},g&&n().createElement("div",{className:"field-header",style:M.header},g),n().createElement("div",{style:{position:"relative"}},n().createElement(NS,{inputRef:R,value:s,onChange:function(e){var t=Is(e.target.value,m,h);C&&C(t),al({name:r,validation:a,required:l,type:m,format:v,questionType:m},e.target.value),p&&p(gO(gO({},e),{},{target:{value:t,name:r,type:m}}))},onBlur:I,sx:H,disabled:q,required:l,autoComplete:"off",placeholder:d,type:G,inputMode:$,error:!!B,helperText:B||y,label:D?o:"",id:String(K),name:String(K),slotProps:{input:gO(gO({},k),{},{inputProps:gO(gO({maxLength:Y,minLength:w},U),{},{"data-testid":j}),inputMode:Ms(m)}),inputLabel:{style:M.label,required:D&&l},formHelperText:{style:B?M.error:M.helperText}},"data-item-index":L,"data-parent-id":N,fullWidth:!0}),D&&A&&o&&n().createElement("div",{style:{position:"absolute",top:"8px",right:"8px"}},n().createElement(hO,{tooltip:A}))))};wO.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,defaultValue:o().string,validation:o().object,value:o().oneOfType([o().string,o().number]),required:o().bool,disabled:o().bool,placeholder:o().string,onChange:o().func,type:o().oneOf(["text","email","tel","password","url","number"]),maskInput:o().oneOfType([o().string,o().object,o().func]),format:o().string,helperText:o().string,_encrypted:o().any,_maskingType:o().any,_maskingLength:o().oneOfType([o().string,o().number]),_validationErrorMessages:o().any,_showCheckBox:o().any,_isEsignDoc:o().any,_isOpenInNewTab:o().any,_addAdditional:o().any,_addMedication:o().any,header:o().string,maxLength:o().number,minLength:o().number,visible:o().bool,inputProps:o().object,styleName:o().string,tooltip:o().string,customTheme:o().object,_props:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),onSearch:o().func,onBlur:o().func,showQuestionLabels:o().bool,testId:o().string};const SO=wO;var xO=["name","addressGroup","label","required","disabled","className","apiConfig","inputProps","testId"],kO=["onChange"];function OO(){return OO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OO.apply(null,arguments)}function _O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=IO(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function EO(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function CO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||IO(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IO(e,t){if(e){if("string"==typeof e)return TO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TO(e,t):void 0}}function TO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var AO=function(t){function r(r){var o,i,a,s=r.apiConfig,l=r.onAddressSelect,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(r,kp),c=(Vc()||{}).isSanitizeAddress,d=null!==(o=u.isSanitizeAddress)&&void 0!==o?o:c,p=(null==s||null===(i=s.googlePlaces)||void 0===i||null===(i=i.options)||void 0===i?void 0:i.debounceTime)||ep.debounceTime,f=Dp((0,e.useState)(null),2),m=f[0],h=f[1],v=Dp((0,e.useState)([]),2),y=v[0],g=v[1],b=Dp((0,e.useState)(!1),2),w=b[0],S=b[1],x=Dp((0,e.useState)(null),2),k=x[0],O=x[1],_=Dp((0,e.useState)(!1),2),E=_[0],C=_[1],I=Dp((0,e.useState)(-1),2),T=I[0],A=I[1],P=(0,e.useRef)(null);(0,e.useEffect)(function(){function e(){return(e=Pp(_p().m(function e(){var t,n,r,o;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null==s||null===(t=s.googlePlaces)||void 0===t||!t.apiKey){e.n=4;break}return e.p=1,n=Sp.getInstance(s.googlePlaces.apiKey,Ip(Ip(Ip({},ep),s.googlePlaces.options),s.googlePlaces.nonce?{nonce:s.googlePlaces.nonce}:{})),e.n=2,n.initialize();case 2:h(n),e.n=4;break;case 3:e.p=3,o=e.v,r=up(o),O(r.message);case 4:return e.a(2)}},e,null,[[1,3]])}))).apply(this,arguments)}!function(){e.apply(this,arguments)}()},[s]);var D=(0,e.useCallback)(function(){var e=Pp(_p().m(function e(t){var n,r,o;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!m||!t){e.n=6;break}return e.p=1,S(!0),O(null),e.n=2,m.searchAddress(t);case 2:n=e.v,g(n),C(!0),e.n=4;break;case 3:e.p=3,o=e.v,r=up(o),O(r.message),g([]),C(!1);case 4:return e.p=4,S(!1),e.f(4);case 5:e.n=7;break;case 6:g([]),C(!1);case 7:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[m]),j=(0,e.useRef)();(0,e.useEffect)(function(){var e,t,n,r;return j.current=(e=D,t=p,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout(function(){clearTimeout(n),e.apply(void 0,o)},t)},r.cancel=function(){clearTimeout(n)},r),function(){var e;null!==(e=j.current)&&void 0!==e&&e.cancel&&j.current.cancel()}},[D,p]);var R=(0,e.useCallback)(function(e){j.current(e)},[j]),M=(0,e.useCallback)(function(){var e=Pp(_p().m(function e(t){var n,r,o,i,a,s,c,p,f;return _p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!m||!t){e.n=5;break}return e.p=1,S(!0),e.n=2,m.getPlaceDetails(t.place_id);case 2:o=e.v,i=null!==(n=null===(r=u.question)||void 0===r?void 0:r.format)&&void 0!==n?n:u.format,a=J(o,{allowedRegex:i},d),s=[a.street_number,a.street].filter(Boolean).join(" ").trim(),c={address:s,city:a.city,state:a.state_short||a.state,zipcode:a.zipcode},null==l||l(o,c),g([]),C(!1),e.n=4;break;case 3:e.p=3,f=e.v,p=up(f),O(p.message);case 4:return e.p=4,S(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[m,l,null===(a=u.question)||void 0===a?void 0:a.format,u.format,d]);return(0,e.useEffect)(function(){A(-1)},[y]),(0,e.useEffect)(function(){var e,t;if(!(T<0)){var n=null===(e=P.current)||void 0===e||null===(e=e.children)||void 0===e?void 0:e[T];null==n||null===(t=n.scrollIntoView)||void 0===t||t.call(n,{block:"nearest"})}},[T]),(0,e.useEffect)(function(){return function(){g([]),C(!1)}},[]),n().createElement("div",{className:"address-autocomplete-container",style:{position:"relative"},role:"presentation",onKeyDown:function(e){if(E&&y.length>0)switch(e.key){case"ArrowDown":e.preventDefault(),A(function(e){return(e+1)%y.length});break;case"ArrowUp":e.preventDefault(),A(function(e){return e<=0?y.length-1:e-1});break;case"Enter":T>=0&&(e.preventDefault(),M(y[T]));break;case"Escape":e.stopPropagation(),C(!1),A(-1)}}},n().createElement(t,Op({},u,{onSearch:R,loading:w,error:k})),E&&y.length>0&&n().createElement("div",{ref:P,role:"listbox",className:"address-predictions-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto"}},y.map(function(e,t){return n().createElement("button",{key:e.place_id,type:"button",role:"option",tabIndex:-1,"aria-selected":t===T,onClick:function(){return M(e)},onMouseDown:function(e){return e.preventDefault()},onMouseEnter:function(){return A(t)},style:{backgroundColor:t===T?"#e8f0fe":"transparent",padding:"8px 12px",cursor:"pointer",borderBottom:"1px solid #eee",width:"100%",textAlign:"left",border:"none"},"aria-label":"Select ".concat(e.description)},e.description)})))}return r.propTypes={apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,nonce:o().string,options:o().shape({region:o().string,language:o().string,debounceTime:o().number})})}).isRequired,onAddressSelect:o().func,question:o().shape({format:o().string}),format:o().string,isSanitizeAddress:o().string},r}(SO),PO=function(e){return e?e.split("_address")[0]:""},DO=function(e){return Boolean(e["data-parent-id"]&&void 0!==e["data-item-index"])},jO=["address","city","state","zipcode"],RO=function(e,t){for(var n={},r="".concat(e,"_"),o=function(){var o=a[i],s="".concat(e,"_").concat(o);if(s in t)n[o]=s;else{var l="_".concat(o),u=Object.keys(t).find(function(e){return e.startsWith(r)&&e.endsWith(l)});u&&(n[o]=u)}},i=0,a=jO;i<a.length;i++)o();return n},MO=["city","state","zipcode"],LO=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};e?r(t,n["data-parent-id"],n["data-item-index"],!0,o):r(t,null,-1,!0,o)},NO=function(t){var r=t.name,o=t.addressGroup,i=t.label,a=t.required,s=t.disabled,l=t.className,u=t.apiConfig,c=t.inputProps,d=void 0===c?{}:c,p=t.testId,f=EO(t,xO),m=f.onChange,h=EO(f,kO),v=Vc(),y=v.batchUpdate,g=v.validateAddressFields,b=v.formSchema,w=v.state,S=function(e,t,n){null!=e&&e.addressGroup&&!1!==n[e.questionId]&&(t[e.addressGroup]=e.questionId)},x=function(e,t,n){var r;if("cardlist"===e.questionType&&null!==(r=e.customQuestionValueList)&&void 0!==r&&r.editQuestions&&!1!==n[e.questionId]){var o,i=_O(e.customQuestionValueList.editQuestions);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.addressGroup&&(t[a.addressGroup]=a.questionId)}}catch(e){i.e(e)}finally{i.f()}}},k=(0,e.useMemo)(function(){return b&&Array.isArray(b)?function(e,t){var n={};try{var r,o=_O(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(null!=i&&i.questions){var a,s=_O(i.questions);try{for(s.s();!(a=s.n()).done;){var l=a.value;S(l,n,t),x(l,n,t)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){o.e(e)}finally{o.f()}}catch(e){console.error("Error creating addressGroup mapping:",e)}return n}(b,w.visibility):{}},[b,w.visibility]),O=(0,e.useCallback)(function(e,t){if(e&&o){var n=PO(o),r=function(e,t,n){for(var r={},o=0,i=Object.entries(e);o<i.length;o++){var a=CO(i[o],2),s=a[0],l=a[1];n[s]&&t[l]&&(r[t[l]]=n[s])}return r}(RO(n,k),k,t),i=DO(d);LO(i,r,d,y,{clearErrorsForKeys:Object.keys(r)}),g(o)}},[o,y,g,k,d]),_=(0,e.useCallback)(function(e){if(o){var t=PO(o),n=function(e,t){for(var n={},r=0,o=MO;r<o.length;r++){var i=e[o[r]],a=i&&t[i];a&&(n[a]="")}return n}(RO(t,k),k);if(Object.keys(n).length>0){var r=DO(d);LO(r,n,d,y,{clearErrorsForKeys:Object.keys(n)}),g(o)}}null==m||m(e)},[o,k,d,y,g,m]);return n().createElement(AO,OO({},h,{name:r,label:i,required:a,disabled:s,className:l,apiConfig:u,onChange:_,onAddressSelect:O,addressGroup:o,inputProps:d,testId:p}))};function FO(e){return FO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FO(e)}function VO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VO(Object(n),!0).forEach(function(t){qO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qO(e,t,n){return(t=function(e){var t=function(e){if("object"!=FO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}NO.propTypes={name:o().string.isRequired,addressGroup:o().string.isRequired,label:o().string,required:o().bool,disabled:o().bool,className:o().string,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})})}).isRequired,inputProps:o().object,onChange:o().func,testId:o().string};var zO=function(t){var r,o=t.name,i=t.label,a=t.value,s=t.validation,l=void 0===s?{}:s,u=t.className,c=void 0===u?"":u,d=t.renderInput,p=t.renderLabel,f=t.formState,m=t.skipValidation,h=void 0!==m&&m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.apiConfig,S=Vc(),x=sd(),k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return QO(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QO(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null),2),O=k[0],_=k[1],E=f||(null==S?void 0:S.state)||S,C=String(o);if((0,e.useEffect)(function(){if(E){var e=E.serverValidationErrors,t=void 0===e?{}:e,n=E.errors,r=void 0===n?{}:n,o=t[C]||r[C];_(o)}else console.warn("BaseField: formState is undefined. Make sure the component is wrapped in a FormProvider or receives formState as a prop.")},[E,C]),E){var I=E.disabled,T=void 0===I?{}:I,A=E.required,P=void 0===A?{}:A,D=E.editable,j=void 0===D?{}:D,R=E.onChange,M=T[C]||!1,L=P[C]||!1,N=!1!==j[C],F=BO(BO({},x),b);return r=d({name:C,value:a,onChange:function(e){var t,n=(t=e,h?null:l.required&&(!t||Array.isArray(t)&&0===t.length)?l.requiredMessage||"This field is required":l.custom?l.custom(t,h):null);_(n),R&&!M&&N&&R(C,e)},disabled:M,required:L,_editable:N,_error:O,_theme:F,_apiConfig:w}),n().createElement("div",{className:"form-field ".concat(c," ").concat(y||""),style:F.field},v&&n().createElement("div",{className:"field-header",style:F.header},v),null==p?void 0:p({label:i,isRequired:L,theme:F}),r)}return null};zO.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,validation:o().object,className:o().string,renderInput:o().func.isRequired,renderLabel:o().func,formState:o().object,skipValidation:o().bool,header:o().node,styleName:o().string,customTheme:o().object,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})})};const $O=zO;var UO=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/ButtonField.css"),WO={};function HO(e){return HO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HO(e)}function GO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return YO(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(YO(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,YO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,YO(d,"constructor",u),YO(u,"constructor",l),l.displayName="GeneratorFunction",YO(u,o,"GeneratorFunction"),YO(d),YO(d,o,"Generator"),YO(d,r,function(){return this}),YO(d,"toString",function(){return"[object Generator]"}),(GO=function(){return{w:i,m:p}})()}function YO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}YO=function(e,t,n,r){function i(t,n){YO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},YO(e,t,n,r)}function KO(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function XO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XO(Object(n),!0).forEach(function(t){JO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JO(e,t,n){return(t=function(e){var t=function(e){if("object"!=HO(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=HO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HO(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}WO.styleTagTransform=kl(),WO.setAttributes=bl(),WO.insert=yl().bind(null,"head"),WO.domAPI=hl(),WO.insertStyleElement=Sl(),fl()(UO.A,WO),UO.A&&UO.A.locals&&UO.A.locals;var e_=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.onChange,c=t.onClick,d=t.customTheme,p=void 0===d?{}:d,f=t.variant,m=void 0===f?"primary":f,h=t.size,v=void 0===h?"medium":h,y=t.icon,g=t.fullWidth,b=void 0!==g&&g,w=t.styleName,S=t.testId,x=Vc().setValue,k=sd(),O=(0,e.useMemo)(function(){var e=k.buttonField||{};return YS(e,p)},[k,p]),_=(0,e.useMemo)(function(){var e=ZO(ZO({},O.container),b&&{width:"100%"}),t=ZS(O.button,O[m],O[v],b&&O.fullWidth,s&&O.disabled);return{container:KS(e,O.responsive),button:t,icon:O.icon}},[O,m,v,b,s]),E=o,C=function(){var e,t=(e=GO().m(function e(t){return GO().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),x(r,E),!c){e.n=1;break}return e.n=1,c(t);case 1:null==u||u({target:{name:r,value:E}});case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){KO(i,r,o,a,s,"next",e)}function s(e){KO(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}();return n().createElement(zO,{name:r,label:"",value:i,validation:a,className:"button-field ".concat(w||""," ").concat(l||""),customTheme:O,renderInput:function(){return n().createElement("button",{type:"button",onClick:C,disabled:s,style:_.button,"data-testid":S},y&&n().createElement("span",{style:_.icon},y),E)}})};function t_(e){return t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t_(e)}function n_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r_(Object(n),!0).forEach(function(t){i_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i_(e,t,n){return(t=function(e){var t=function(e){if("object"!=t_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=t_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e_.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,disabled:o().bool,className:o().string,onChange:o().func,onClick:o().func,customTheme:o().object,variant:o().oneOf(["primary","secondary","success","danger","warning","outline","text"]),size:o().oneOf(["small","medium","large"]),icon:o().node,fullWidth:o().bool,styleName:o().string,testId:o().string};var a_=function(e){return e.map(function(e){return e?o_({name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return o_(o_({},e),{},{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null,disabled:Boolean(e.disabled),required:Boolean(e.required)})}):[]},void 0!==e.__isPending__&&{__isPending__:e.__isPending__}):null})},s_=function(e){return!!(Array.isArray(e)&&e.length>0)&&e.every(function(e){return!e||!Array.isArray(e.properties)||0===e.properties.length})},l_=function(e){return mt(null==e?void 0:e.customQuestionValuesList).map(function(t){return function(e,t){return null!=e&&e.properties?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){var t;return o_(o_({},e),{},{property:e.property,value:e.value,editQuestionId:e.editQuestionId,renderMode:null!==(t=e.renderMode)&&void 0!==t?t:null,disabled:Boolean(e.disabled),required:Boolean(e.required)})}):[]}:{name:"".concat(null==e?void 0:e.name," - 1"),properties:Object.entries(e||{}).map(function(e){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?n_(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=r[0],i=r[1];return{property:o,value:i,editQuestionId:null==t||null===(n=t.editQuestions)||void 0===n||null===(n=n.find(function(e){return e.name===o}))||void 0===n?void 0:n.questionId,renderMode:null,disabled:!1,required:!1}})}}(t,e)})},u_=function(e,t,n){if(null==n||!n.preventCardDeletion)return!1;var r=n.scope,o=n.n;return!(!Number.isInteger(o)||o<=0)&&("FIRST_N"===r?e<o:"LAST_N"===r&&e>=t-o)};function c_(e){return c_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c_(e)}var d_=["name","label","questionId","customQuestionValueList","onChange","validation","max","min","className","disabled","readOnly","questionRuleDetails","apiConfig","customTheme","visible","isCardlistModal","cardDeletionProperties"];function p_(e){return function(e){if(Array.isArray(e))return b_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f_(Object(n),!0).forEach(function(t){h_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h_(e,t,n){return(t=function(e){var t=function(e){if("object"!=c_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function y_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||g_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g_(e,t){if(e){if("string"==typeof e)return b_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b_(e,t):void 0}}function b_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var w_=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),S_=function(e){return"true"!==e.getAttribute("aria-hidden")&&!e.closest('[aria-hidden="true"]')&&(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0)},x_=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/common/Modal.css"),k_={};k_.styleTagTransform=kl(),k_.setAttributes=bl(),k_.insert=yl().bind(null,"head"),k_.domAPI=hl(),k_.insertStyleElement=Sl(),fl()(x_.A,k_),x_.A&&x_.A.locals&&x_.A.locals;var O_=0,__=function(t){var r=t.isOpen,o=t.onClose,i=t.title,a=t.children,s=t.size,l=void 0===s?"medium":s,u=t.showCloseButton,c=void 0===u||u,d=t.closeOnOverlayClick,p=void 0===d||d,f=t.className,m=void 0===f?"":f,h=t.testId,v=(0,e.useRef)(null);v.current||(O_+=1,v.current="modal-title-".concat(O_));var y=v.current,g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onKeyDown,r=(t._onFocus,t._onBlur,t.focusFirst),o=void 0!==r&&r,i=t.trapFocus,a=void 0!==i&&i,s=t.autoFocus,l=void 0!==s&&s,u=t.disabled,c=void 0!==u&&u,d=t.returnFocus,p=void 0===d||d,f=t.enabled,m=void 0===f||f,h=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(n);y.current=n;var g=(0,e.useCallback)(function(){return h.current?Array.from(h.current.querySelectorAll(w_)).filter(S_):[]},[]),b=(0,e.useCallback)(function(e){var t;if(null===(t=y.current)||void 0===t||t.call(y,e),a&&h.current){var n=g();if(0!==n.length){var r=n[0],o=n.at(-1);"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(o.focus(),e.preventDefault()):document.activeElement===o&&(r.focus(),e.preventDefault()))}}},[a,g]);return(0,e.useEffect)(function(){if(m&&!c){v.current=document.activeElement;var e=h.current,t=requestAnimationFrame(function(){if(l||o){var t=g();t.length>0?t[0].focus():e&&"function"==typeof e.focus&&e.focus()}});return function(){if(cancelAnimationFrame(t),p&&v.current){var e=v.current;"function"==typeof e.focus&&e.focus()}}}},[m,c,l,o,p,g]),(0,e.useEffect)(function(){if(m&&!c){var e=h.current;if(e){e.addEventListener("keydown",b);var t=function(t){if(a&&!e.contains(t.target)){var n=g();n.length>0?n[0].focus():"function"==typeof e.focus&&e.focus()}};return a&&document.addEventListener("focusin",t),function(){e.removeEventListener("keydown",b),a&&document.removeEventListener("focusin",t)}}}},[m,c,a,b,g]),{containerRef:h,getFocusableElements:g,focusFirst:function(){var e=g();e.length>0&&e[0].focus()},focusLast:function(){var e=g();e.length>0&&e.at(-1).focus()},focusNext:function(){var e=g(),t=e.indexOf(document.activeElement);t>-1&&t<e.length-1&&e[t+1].focus()},focusPrevious:function(){var e=g(),t=e.indexOf(document.activeElement);t>0&&e[t-1].focus()}}}({enabled:r,trapFocus:!0,focusFirst:!0,returnFocus:!0}),b=g.containerRef;if((0,e.useEffect)(function(){if(r){var e=function(e){"Escape"===e.key&&(e.stopPropagation(),o())};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[r,o]),(0,e.useEffect)(function(){if(r){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[r]),!r)return null;var w="modal-".concat(l);return n().createElement("div",{className:"modal-overlay",onClick:function(e){p&&e.target===e.currentTarget&&o()},"data-testid":h},n().createElement("div",{ref:b,className:"modal-container ".concat(w," ").concat(m),role:"dialog","aria-modal":"true","aria-labelledby":i?y:void 0,tabIndex:-1},n().createElement("div",{className:"modal-header"},i&&n().createElement("h2",{id:y,className:"modal-title"},i),c&&n().createElement("button",{type:"button",className:"modal-close-button",onClick:o,"aria-label":"Close modal"},"×")),n().createElement("div",{className:"modal-content"},a)))};__.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,title:o().string,children:o().node.isRequired,size:o().oneOf(["small","medium","large","fullscreen"]),showCloseButton:o().bool,closeOnOverlayClick:o().bool,className:o().string,testId:o().string};const E_=__;function C_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I_(e){return I_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I_(e)}var T_=function(e,t,n){if(e&&"object"===I_(e)){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(Object.prototype.hasOwnProperty.call(e,n))return e[n];var r=te(t);return Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0}},A_=function(e,t){if(null==e||!e.properties||!Array.isArray(e.properties))return null;var n=te(t);return e.properties.find(function(e){return te(e.editQuestionId)===n})||null};function P_(e){return P_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P_(e)}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(t){R_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R_(e,t,n){return(t=function(e){var t=function(e){if("object"!=P_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=P_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=N_(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function L_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||N_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N_(e,t){if(e){if("string"==typeof e)return F_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F_(e,t):void 0}}function F_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V_=function(t){var r,o=t.isOpen,i=t.onClose,a=t.onSave,s=t.cardItem,l=t.itemIndex,u=t.cardListId,c=t.cardListName,d=t.customQuestionValueList,p=t.questionRuleDetails,f=t.apiConfig,m=t.disabled,h=void 0!==m&&m,v=t.readOnly,y=void 0!==v&&v,g=Vc(),b=g.state,w=g.setValue,S=g.setNestedState,x=g.rulesEngine,k=g.updateCardList,O=(0,e.useRef)(null),_=(0,e.useRef)(!1),E=(0,e.useRef)(!1),C=(0,e.useRef)(null),I=(0,e.useRef)(null),T=(0,e.useRef)(!1),A=L_((0,e.useState)(new Map),2),P=A[0],D=A[1],j=(0,e.useCallback)(function(){if(x&&null!=d&&d.editQuestions&&!(l<0)){var e={cardListId:u,instanceIndex:l};D(function(t){var n,r,o=new Map(t),i=!1,a=null===(n=b.values)||void 0===n?void 0:n[u],s=Array.isArray(a)&&a[l]?a[l]:null,c=M_(d.editQuestions);try{var p=function(){var n,a=r.value,c=a.questionId||a.name,d=te(c),p=null==s||null===(n=s.properties)||void 0===n?void 0:n.find(function(e){return te(e.editQuestionId)===te(c)}),f=null==p?void 0:p.value,m=null!=f,h=x.getCardListInstanceState(u,l,d),v=x.getQuestionValueWithCardListContext(c,e),y="",g=void 0!==(null==h?void 0:h.value)&&null!==(null==h?void 0:h.value),b=null!=v;y=m?g&&h.value!==f?h.value:f:g?h.value:b?v:t.has(c)?t.get(c):a.value||a.defaultValue||"",h&&""===h.value&&t.has(c)&&""!==t.get(c)&&(y=""),t.get(c)!==y&&(o.set(c,y),i=!0)};for(c.s();!(r=c.n()).done;)p()}catch(e){c.e(e)}finally{c.f()}return i?o:t})}},[x,u,l,d,b.values]);(0,e.useEffect)(function(){if(o){var e=C.current!==l;if(!E.current||e){var t;E.current=!0,C.current=l,O.current=s?JSON.stringify(s):null,_.current=!1;var n=new Map;if(null!=d&&d.editQuestions){var r,i={cardListId:u,instanceIndex:l},a=M_(d.editQuestions);try{var p=function(){var e=r.value,t=e.questionId||e.name,o="",a=!1;if(null!=s&&s.properties){var c=s.properties.find(function(e){return te(e.editQuestionId)===te(t)});void 0!==(null==c?void 0:c.value)&&null!==(null==c?void 0:c.value)&&(o=c.value,a=!0)}if(!a&&x){var p=x.getQuestionValueWithCardListContext(t,i);null!=p&&""!==p&&(o=p)}if(a||""!==o&&null!=o||(o=e.value||e.defaultValue||""),n.set(t,o),x&&l>=0){var f=te(t),m=x.getCardListInstanceState(u,l,f);!m&&d.editQuestions&&(x.initializeCardListChildStates(u,l,d.editQuestions),m=x.getCardListInstanceState(u,l,f)),m&&(a||void 0===m.value||null===m.value||""===m.value?(m.value=o,x.setCardListInstanceState(u,l,f,m)):n.set(t,m.value))}};for(a.s();!(r=a.n()).done;)p()}catch(e){a.e(e)}finally{a.f()}}if(D(n),x&&l>=0){var f,m=(null==d?void 0:d.editQuestions)||[],h="".concat(u,"_").concat(l),v=null===(f=x.cardListInstanceStates)||void 0===f?void 0:f.has(h);if(!v&&m.length>0)x.executeRulesForNewCardListInstance(u,l,m),setTimeout(function(){j()},0);else if(v&&m.length>0)if(x.reExecutePageLoadRulesForInstance)x.reExecutePageLoadRulesForInstance(u,l,m),setTimeout(function(){j()},0);else{var y,g,w={cardListId:u,instanceIndex:l},I=new Set(m.map(function(e){return e.questionId||e.name})),A=(null===(y=x.questionRuleDetails)||void 0===y?void 0:y.filter(function(e){return("PAGE_LOAD"===e.ruleExecutionType||"REFLEXIVE_LOAD"===e.ruleExecutionType)&&(I.has(e.triggerQuestionId)||I.has(e.targetQuestionId))}))||[],P=M_(A);try{for(P.s();!(g=P.n()).done;){var R=g.value;try{var M,L,N,F="".concat(R.conditionId,"_").concat(R.triggerQuestionId,"_").concat(u,"_").concat(l);null!==(M=x.evaluationQueue)&&void 0!==M&&M.has(F)||(null===(L=x.evaluationQueue)||void 0===L||L.add(F),x.evaluateRule(R,R.triggerQuestionId,w,!1),null===(N=x.evaluationQueue)||void 0===N||N.delete(F))}catch(e){console.warn("Error re-evaluating rule for CardList instance:",e)}}}catch(e){P.e(e)}finally{P.f()}setTimeout(function(){j()},0)}}var V="".concat(u,"_").concat(l),B=null===(t=b.nestedStates)||void 0===t?void 0:t[V];if(S(u,l,B?{errors:{}}:{visibility:{},disabled:{},required:{},errors:{},ruleValidationErrors:{}}),!s&&null!=d&&d.editQuestions&&l>=0){var q,Q=null===(q=b.values)||void 0===q?void 0:q[u],z=Array.isArray(Q)?Q:[];if(z.length<=l){T.current=!0;for(var $=function(e,t,n){return Array.isArray(n)?{name:"".concat(e," - ").concat(t+1),properties:n.map(function(e){return{property:e.name||e.label,value:e.value||e.defaultValue||"",editQuestionId:te(e.questionId||e.name),renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}),__isPending__:!0}:{name:"".concat(e," - ").concat(t+1),properties:[],__isPending__:!0}}(c,l,d.editQuestions),U=function(e){return function(e){if(Array.isArray(e))return F_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||N_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(z);U.length<=l;)U.push({name:"",properties:[]});U[l]=$,k(u,U,"add","",l)}else T.current=!1,D(function(e){var t,n=new Map(e),r=M_(d.editQuestions);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.questionId||o.name;if(!n.has(i)){var a=o.value||o.defaultValue||"";if(n.set(i,a),x&&l>=0){var s=te(i),c=x.getCardListInstanceState(u,l,s);c||(x.initializeCardListChildStates(u,l,d.editQuestions),c=x.getCardListInstanceState(u,l,s)),c&&(c.value=a,x.setCardListInstanceState(u,l,s,c))}}}}catch(e){r.e(e)}finally{r.f()}return n})}else T.current=!1}}else o||(E.current=!1,C.current=null,T.current=!1,D(new Map),_.current=!1)},[o,l,u,j]),(0,e.useEffect)(function(){if(!o||!x||l<0||null==d||!d.editQuestions||!E.current)return function(){};var e=setTimeout(function(){E.current&&j()},100);return function(){clearTimeout(e)}},[o,x,l,u,d,j,b.values]);var R=(0,e.useCallback)(function(e,t){_.current=!0,D(function(n){var r=new Map(n);return r.set(e,t),r});var n={cardListId:u,instanceIndex:l};if(x){var r=te(e),o=x.getCardListInstanceState(u,l,r);if(!o&&null!=d&&d.editQuestions&&(x.initializeCardListChildStates(u,l,d.editQuestions),o=x.getCardListInstanceState(u,l,r)),o){o.value=t,x.setCardListInstanceState(u,l,r,o),x.processFieldChange(e,t,n,!0,!1,null);var i=x.getAllFieldStates(b.values).nestedStates,a="".concat(u,"_").concat(l),s=null==i?void 0:i[a];S(u,l,s?{visibility:s.visibility||{},disabled:s.disabled||{},required:s.required||{},ruleValidationErrors:s.ruleValidationErrors||{},errors:R_({},e,null)}:{errors:R_({},e,null)}),setTimeout(function(){j()},0)}}else S(u,l,{errors:R_({},e,null)})},[u,l,S,x,d,j,b.values]),M=n().useMemo(function(){var e,t;if(null==d||!d.editQuestions)return[];var n="".concat(u,"_").concat(l),r=null===(e=b.nestedStates)||void 0===e?void 0:e[n],o=null===(t=b.values)||void 0===t?void 0:t[u],i=Array.isArray(o)&&o[l]?o[l]:s;return[{groupName:"",questions:d.editQuestions.map(function(e){var t,n,o,a,s,c,d=e.questionId||e.name,p=te(d),f=A_(i,d),m=null==r||null===(t=r.disabled)||void 0===t?void 0:t[d],v=null==r||null===(n=r.disabled)||void 0===n?void 0:n[p],g=void 0!==m?m:v,b=null==r||null===(o=r.required)||void 0===o?void 0:o[d],w=null==r||null===(a=r.required)||void 0===a?void 0:a[p],S=void 0!==b?b:w,x=P.has(d)?P.get(d):void 0,k=Boolean(h||y||(void 0!==g?g:null!==(s=null==f?void 0:f.disabled)&&void 0!==s?s:e.disabled)),O=Boolean(void 0!==S?S:null!==(c=null==f?void 0:f.required)&&void 0!==c?c:e.required);return j_(j_({},e),{},{parentId:u,questionId:d,questionType:e.questionType||"text",value:x,disabled:k,required:O,readOnly:y,onChange:function(e){var t="object"===P_(e)&&null!=e&&e.target?e.target.value:e;R(d,t)},validation:j_(j_({},e.validation),{},{required:O}),inputProps:{"data-item-index":l,"data-parent-id":u}})})}]},[u,l,d,P,R,b.nestedStates,b.values,s,h,y]),L=(0,e.useCallback)(function(e){var t,n,r={cardListId:u,instanceIndex:l};if(P.has(e)){var o=P.get(e);return null!=o?o:""}if(x){var i=x.getCardListInstanceState(u,l,te(e));if(void 0!==(null==i?void 0:i.value)&&null!==(null==i?void 0:i.value)){var a=i.value;return P.has(e)&&P.get(e)===a||D(function(t){var n=new Map(t);return n.set(e,a),n}),a}var s=x.getQuestionValueWithCardListContext(e,r);if(null!=s&&""!==s)return P.has(e)&&P.get(e)===s||D(function(t){var n=new Map(t);return n.set(e,s),n}),s}var c=null===(t=b.values)||void 0===t?void 0:t[u];if(Array.isArray(c)&&c[l]){var d=c[l];if(Array.isArray(null==d?void 0:d.properties)){var p=d.properties.find(function(t){return te(t.editQuestionId)===te(e)});if(void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value))return p.value}}var f=null===(n=b.values)||void 0===n?void 0:n[e];return null!=f?f:""},[P,x,b.values,u,l]),N=(0,e.useCallback)(function(){var e={},t=M;if(t.length>0&&t[0].questions){var n,r=M_(t[0].questions);try{for(r.s();!(n=r.n()).done;){var o,i,a,s,c,d,p,f=n.value,m=f.questionId,h=te(m),v="".concat(u,"_").concat(l),y=null===(o=b.nestedStates)||void 0===o?void 0:o[v],g=null==y||null===(i=y.visibility)||void 0===i?void 0:i[m],w=null==y||null===(a=y.visibility)||void 0===a?void 0:a[h],S=void 0!==g?g:void 0!==w?w:!1!==f.visible;if(S&&!f.disabled&&!f.readOnly){var k=f.required||!1,O=null==y||null===(s=y.required)||void 0===s?void 0:s[m],_=null==y||null===(c=y.required)||void 0===c?void 0:c[h];if(void 0!==O)k=O;else if(void 0!==_)k=_;else if(x){var E=x.getFieldState(h,l);if(void 0!==(null==E?void 0:E.required))k=E.required;else if("function"==typeof x.getCardListInstanceState){var C=x.getCardListInstanceState(u,l,h);void 0!==(null==C?void 0:C.required)&&(k=C.required)}}var I=L(m);if(k&&(!I||"string"==typeof I&&""===I.trim())){var T="Please fill the required field";e[m]=T,h!==m&&(e[h]=T)}if(null!=I&&""!==I){var A,P,D=j_(j_({},f),{},{visible:S,required:k,disabled:null!==(A=f.disabled)&&void 0!==A&&A}),j=j_({},b.values),R=null!==(P=b.serverValidationErrors)&&void 0!==P&&P[m]?[{questionId:m,message:b.serverValidationErrors[m]}]:[],N=al(D,I,j,R,b.nestedStates);N&&"string"==typeof N&&""!==N.trim()&&(e[m]||(e[m]=N,h!==m&&(e[h]=N)))}var F=(null==y||null===(d=y.ruleValidationErrors)||void 0===d?void 0:d[m])||(null==y||null===(p=y.ruleValidationErrors)||void 0===p?void 0:p[h]);F&&"string"==typeof F&&""!==F.trim()&&(e[m]||(e[m]=F,h!==m&&(e[h]=F)))}}}catch(e){r.e(e)}finally{r.f()}}return e},[M,u,l,b.nestedStates,x,L]),F=(0,e.useCallback)(function(){var e,t,n,r;if(x&&null!=d&&d.editQuestions){var o={cardListId:u,instanceIndex:l};D(function(e){var t,n=new Map(e),r=!1,i=M_(d.editQuestions);try{for(i.s();!(t=i.n()).done;){var a=t.value,s=a.questionId||a.name,c=te(s),p=x.getCardListInstanceState(u,l,c),f=x.getQuestionValueWithCardListContext(s,o),m="";void 0!==(null==p?void 0:p.value)&&null!==(null==p?void 0:p.value)&&""!==(null==p?void 0:p.value)?m=p.value:null!=f&&""!==f?m=f:e.has(s)&&(m=e.get(s)),e.get(s)!==m&&(n.set(s,m),r=!0)}}catch(e){i.e(e)}finally{i.f()}return r?n:e})}var s=N();S(u,l,{errors:s});var p="".concat(u,"_").concat(l),f=null===(e=b.nestedStates)||void 0===e?void 0:e[p],m=(null==f?void 0:f.ruleValidationErrors)||{},h=Object.entries(m).some(function(e){var t=L_(e,2),n=t[0],r=t[1];return n.includes(u)&&r&&"string"==typeof r&&""!==r.trim()});if(!h&&x&&null!=d&&d.editQuestions){var v,y=M_(d.editQuestions);try{for(y.s();!(v=y.n()).done;){var g,k=v.value,E=k.questionId||k.name,C=te(E),A=null===(g=x.validationMessages)||void 0===g?void 0:g.get(C);if(A&&"string"==typeof A&&""!==A.trim()){h=!0;break}}}catch(e){y.e(e)}finally{y.f()}}var j=[".error_message_display_text",".error-message"],R=I.current,M=R?tt(j,R):tt(j);if(Object.keys(s).length>0||h||M)Kd(j,R?{root:R}:{});else{var L={cardListId:u,instanceIndex:l},F=null;try{F=O.current?JSON.parse(O.current):null}catch(e){F=null}var V=Array.isArray(null===(t=F)||void 0===t?void 0:t.properties)?F.properties:[],B=function(e){if(null==e)return!1;var t=String(e);return t.length>0&&t.includes("*")};null==x||x.endModalEdit(),P.forEach(function(e,t){var n=function(e,t){var n,r=V.find(function(t){return null!=t&&null!=t.editQuestionId&&te(t.editQuestionId)===te(e)}),o=String(null!=t?t:"");if(null==r)return""===o||B(t);var i=String(null!==(n=r.value)&&void 0!==n?n:"");return i===o||!(""!==i.trim()||!B(t))}(t,e);w(t,e,null,L,{markUserModified:!n})});var q="".concat(u,"_").concat(l),Q=null===(n=b.nestedStates)||void 0===n?void 0:n[q],z=Array.isArray(null===(r=b.values)||void 0===r?void 0:r[u])?b.values[u][l]:null,$=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i={name:"".concat(e," - ").concat(t+1),properties:[]};if(!Array.isArray(r))return i;var a,s=null==o?void 0:o.nestedState,l=null==o?void 0:o.existingRow,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(r);try{for(u.s();!(a=u.n()).done;){var c=a.value,d=c.questionId||c.name,p=te(d),f=n instanceof Map?n.get(d):n[d];null==f&&(f="");var m=A_(l,d),h=T_(null==s?void 0:s.disabled,d,p),v=T_(null==s?void 0:s.required,d,p),y=void 0!==h?Boolean(h):void 0!==(null==m?void 0:m.disabled)?Boolean(m.disabled):Boolean(c.disabled),g=void 0!==v?Boolean(v):void 0!==(null==m?void 0:m.required)?Boolean(m.required):Boolean(c.required);i.properties.push({property:c.name||c.label,value:f,editQuestionId:te(d),renderMode:null,disabled:y,required:g})}}catch(e){u.e(e)}finally{u.f()}return i}(c,l,P,null==d?void 0:d.editQuestions,{nestedState:Q,existingRow:z});a&&a($,l),T.current=!1,D(new Map),_.current=!1,i()}},[N,S,b.nestedStates,u,l,c,d,a,i,x,P,w]),V=(0,e.useCallback)(function(){if(T.current&&l>=0){var e,t=null===(e=b.values)||void 0===e?void 0:e[u],n=Array.isArray(t)?t:[];if(n.length>l){var r=n.filter(function(e,t){return t!==l}).map(function(e,t){return j_(j_({},e),{},{name:"".concat(c," - ").concat(t+1)})});k(u,r,"remove","",l)}T.current=!1}else{if(_.current&&O.current)try{var o=JSON.parse(O.current);if(null!=o&&o.properties){var a,s={cardListId:u,instanceIndex:l},p=M_(o.properties);try{for(p.s();!(a=p.n()).done;){var f=a.value;f.editQuestionId&&w(f.editQuestionId,f.value,null,s,{markUserModified:!1})}}catch(e){p.e(e)}finally{p.f()}}}catch(e){console.warn("Error restoring initial values:",e)}if(x&&l>=0&&O.current)try{var m=JSON.parse(O.current);if(null!=m&&m.properties&&null!=d&&d.editQuestions){var h,v=M_(d.editQuestions);try{var y=function(){var e=h.value,t=e.questionId||e.name,n=te(t),r="",o=m.properties.find(function(e){return te(e.editQuestionId)===te(t)});void 0!==(null==o?void 0:o.value)&&null!==(null==o?void 0:o.value)&&(r=o.value);var i=x.getCardListInstanceState(u,l,n);i&&(i.value=r,x.setCardListInstanceState(u,l,n,i))};for(v.s();!(h=v.n()).done;)y()}catch(e){v.e(e)}finally{v.f()}}}catch(e){console.warn("Error restoring initial values in rules engine:",e)}}D(new Map),S(u,l,{errors:{}}),_.current=!1,i()},[u,c,l,w,S,i,x,d,b.values,k]),B=n().useMemo(function(){return{isCardList:!0,itemIndex:l,parentId:u,parentValue:s}},[l,u,s]),q=null===(r=b.values)||void 0===r?void 0:r[u],Q=l>=0?l+1:(Array.isArray(q)?q.length:0)+1;return{modalContentRef:I,cardSchema:M,handleSave:F,handleCancel:V,parentContext:B,displayIndex:Q,modalTitle:s?"Edit Details":"Add New Details",disabled:h,readOnly:y,questionRuleDetails:p,apiConfig:f}},B_=function(e){var t=e.onCancel,r=e.onSave,o=e.disabled,i=e.readOnly,a=e.testIdRoot,s=o||i;return n().createElement("div",{className:"cardlist-modal-actions"},n().createElement("button",{type:"button",className:"btn btn-secondary",onClick:t,"aria-label":"Close","data-testid":dd(a,"cancel")},"Close"),n().createElement("button",{type:"button",className:"btn btn-primary",onClick:r,disabled:s,"aria-label":"Save","data-testid":dd(a,"save")},"Save"))};B_.propTypes={onCancel:o().func.isRequired,onSave:o().func.isRequired,disabled:o().bool,readOnly:o().bool,testIdRoot:o().string};const q_=B_;var Q_=function(e){var t=e.isOpen,r=e.onClose,o=e.onSave,i=e.cardItem,a=e.itemIndex,s=e.cardListId,l=e.cardListName,u=e.customQuestionValueList,c=e.questionRuleDetails,d=e.apiConfig,p=e.disabled,f=void 0!==p&&p,m=e.readOnly,h=void 0!==m&&m,v=e.testId,y=V_({isOpen:t,onClose:r,onSave:o,cardItem:i,itemIndex:a,cardListId:s,cardListName:l,customQuestionValueList:u,questionRuleDetails:c,apiConfig:d,disabled:f,readOnly:h}),g=y.modalContentRef,b=y.cardSchema,w=y.handleSave,S=y.handleCancel,x=y.parentContext,k=y.modalTitle,O=y.disabled,_=y.readOnly,E=y.questionRuleDetails,C=y.apiConfig;return t?n().createElement(E_,{isOpen:t,onClose:S,title:k,size:"large",className:"cardlist-modal",closeOnOverlayClick:!1,testId:v},n().createElement("div",{className:"cardlist-modal-wrapper"},n().createElement("div",{ref:g,className:"cardlist-modal-content"},n().createElement(mV,{questionGroups:b,disabled:O,readOnly:_,isNested:!0,questionRuleDetails:E,parentContext:x,apiConfig:C,skipFormProvider:!0})),n().createElement(q_,{onCancel:S,onSave:w,disabled:O,readOnly:_,testIdRoot:v}))):null};Q_.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onSave:o().func.isRequired,cardItem:o().object,itemIndex:o().number.isRequired,cardListId:o().oneOfType([o().string,o().number]).isRequired,cardListName:o().string.isRequired,customQuestionValueList:o().object,questionRuleDetails:o().array,apiConfig:o().object,disabled:o().bool,readOnly:o().bool,testId:o().string};const z_=Q_;var $_=function(e){var t=e.isOpen,r=e.onClose,o=e.onConfirm,i=e.testId;return n().createElement(E_,{isOpen:t,onClose:r,title:"Confirm Delete",size:"medium",closeOnOverlayClick:!0,className:"cardlist-delete-confirm-modal",testId:i},n().createElement("div",{className:"cardlist-delete-confirm-content"},n().createElement("p",{className:"cardlist-delete-confirm-message","data-testid":dd(i,"message")},"Are you sure you want to delete this entry? This action cannot be undone."),n().createElement("div",{className:"cardlist-delete-confirm-actions"},n().createElement("button",{type:"button",onClick:r,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-cancel","aria-label":"Cancel","data-testid":dd(i,"cancel")},"Cancel"),n().createElement("button",{type:"button",onClick:o,className:"cardlist-delete-confirm-btn cardlist-delete-confirm-btn-delete","aria-label":"Delete","data-testid":dd(i,"confirm")},"Delete"))))};$_.propTypes={isOpen:o().bool.isRequired,onClose:o().func.isRequired,onConfirm:o().func.isRequired,testId:o().string};const U_=$_;function W_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var H_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t||!Array.isArray(e)||0===e.length)return"";var n=t.split("||").map(function(e){return e.trim()}),r={};e.forEach(function(e){var t,n,o,i,a=String(null!==(t=e.questionId)&&void 0!==t?t:"").split("_")[0],s="string"==typeof(null==e?void 0:e.value)?(null!==(n=null==e?void 0:e.value)&&void 0!==n?n:"").trim():null!==(o=null==e?void 0:e.value)&&void 0!==o?o:"";"currency"===(null==e||null===(i=e.questionType)||void 0===i?void 0:i.toLowerCase())&&""!==s&&(s=function(e){if(null==e||""===e)return"";try{var t=parseFloat(String(e).replace(/[^0-9.-]+/g,""));return Number.isNaN(t)?String(e):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(t)}catch(t){return String(e)}}(s)),r[a]=s});var o,i=function(e){return e.replace(/\{(?:CQ-)?([^{}]+)\}/g,function(e,t){var n,o=null!==(n=r[t.trim()])&&void 0!==n?n:"";return String(o)})},a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return W_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(n);try{for(a.s();!(o=a.n()).done;){var s=i(o.value);if(s&&s.trim().length>0)return s}}catch(e){a.e(e)}finally{a.f()}return""},G_=function(e){var t=e.items,r=e.questionId,o=e.name,i=e.required,a=void 0!==i&&i,s=e.cardListPreviewPattern,l=e.patternPreview,u=e.editQuestions,c=e.onEdit,d=e.onDeleteClick,p=e.onAddMore,f=e.disabled,m=e.readOnly,h=e.maxItems,v=e.cardDeletionProperties,y=void 0===v?null:v,g=e.testIdRoot,b=dd(g,"add"),w=dd(g,"table"),S=function(e){return dd(g,"item",e)},x=function(e){return dd(g,"item",e,"edit")},k=function(e){return dd(g,"item",e,"remove")},O=s||l,_=!f&&!m&&(!h||t.length<h),E=!f&&!m;return 0===t.length?n().createElement("div",{className:"cardlist-view-card"},o&&n().createElement("h3",{className:"cardlist-view-title",id:"cardlist-title-".concat(r)},o,a&&n().createElement("span",{className:"cardlist-view-title-asterisk","aria-hidden":"true"},"*")),n().createElement("div",{className:"cardlist-empty-state"},n().createElement("p",null,"No items added yet."),_&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:p,disabled:f||m,"aria-label":"Add New","data-testid":b},"Add New"))):n().createElement("div",{className:"cardlist-view-card"},o&&n().createElement("h3",{className:"cardlist-view-title",id:"cardlist-title-".concat(r)},o,a&&n().createElement("span",{className:"cardlist-view-title-asterisk","aria-hidden":"true"},"*")),n().createElement("div",{className:"cardlist-table-container"},n().createElement("table",{className:"cardlist-table","data-testid":w},n().createElement("thead",null,n().createElement("tr",null,n().createElement("th",null,"S.No."),n().createElement("th",null,"Details"),n().createElement("th",null,"Actions"))),n().createElement("tbody",null,t.map(function(e,i){var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null!=e&&e.properties&&Array.isArray(t)?e.properties.map(function(e){var n=t.find(function(t){return String(null==t?void 0:t.questionId)===String(null==e?void 0:e.editQuestionId)});return n?{questionId:n.questionId,value:null==e?void 0:e.value,questionType:null==n?void 0:n.questionType}:null}).filter(Boolean):[]}(e,u),s=O&&a.length>0?H_(a,O):"",l=s&&s.trim()||"".concat(o," - ").concat(i+1),p=u_(i,t.length,y);return n().createElement("tr",{key:"".concat(r,"_").concat(i),"data-testid":S(i)},n().createElement("td",null,i+1),n().createElement("td",null,l),n().createElement("td",null,n().createElement("div",{className:"cardlist-table-actions"},n().createElement(n().Fragment,null,n().createElement("button",{type:"button",className:"btn-edit",onClick:function(){return c(e,i)},"aria-label":"Edit",title:"Edit","data-testid":x(i)},n().createElement("svg",{width:"20",height:"20",viewBox:"0 -960 960 960",fill:"currentColor","aria-hidden":"true",style:{display:"block"}},n().createElement("path",{d:"M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"}))),E&&!p&&n().createElement("button",{type:"button",className:"btn-delete",onClick:function(){return d(i)},disabled:f||m,"aria-label":"Delete",title:"Delete","data-testid":k(i)},n().createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{display:"block"}},n().createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})))))))}))),_&&n().createElement("button",{type:"button",className:"cardlist-add-button",onClick:p,disabled:f||m,"aria-label":"Add New","data-testid":b},"Add New")))};G_.propTypes={items:o().array.isRequired,questionId:o().oneOfType([o().string,o().number]).isRequired,name:o().string,required:o().bool,cardListPreviewPattern:o().string,patternPreview:o().string,editQuestions:o().arrayOf(o().shape({questionId:o().oneOfType([o().string,o().number]),questionType:o().string})),onEdit:o().func.isRequired,onDeleteClick:o().func.isRequired,onAddMore:o().func.isRequired,disabled:o().bool,readOnly:o().bool,maxItems:o().number,cardDeletionProperties:o().shape({scope:o().oneOf(["FIRST_N","LAST_N"]),n:o().number,preventCardDeletion:o().bool,childDefaults:o().array}),testIdRoot:o().string};const Y_=G_;var K_=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/CardListModal.css"),X_={};function Z_(e){return Z_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z_(e)}function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(t){tE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tE(e,t,n){return(t=function(e){var t=function(e){if("object"!=Z_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Z_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}X_.styleTagTransform=kl(),X_.setAttributes=bl(),X_.insert=yl().bind(null,"head"),X_.domAPI=hl(),X_.insertStyleElement=Sl(),fl()(K_.A,X_),K_.A&&K_.A.locals&&K_.A.locals;var nE=function(t){var r=t.name,o=t.label,i=void 0===o?"":o,a=t.questionId,s=t.customQuestionValueList,l=void 0===s?null:s,u=t.cardListPreviewPattern,c=t.patternPreview,d=t.validation,p=void 0===d?{}:d,f=t.max,m=void 0===f?null:f,h=t.min,v=void 0===h?0:h,y=t.className,g=void 0===y?"":y,b=t.disabled,w=void 0!==b&&b,S=t.readOnly,x=void 0!==S&&S,k=t.isCardlistModal,O=void 0!==k&&k,_=t.cardDeletionProperties,E=void 0===_?null:_,C=t.testIdRoot,I=dd(C,"add"),T=dd(C,"modal"),A=dd(C,"delete-confirm"),P=function(t){var r,o,i,a,s,l=t.name,u=t.label,c=void 0===u?"":u,d=t.questionId,p=t.customQuestionValueList,f=void 0===p?null:p,m=t.onChange,h=void 0===m?null:m,v=(t.validation,t.max),y=void 0===v?null:v,g=t.min,b=void 0===g?0:g,w=(t.className,t.disabled),S=void 0!==w&&w,x=t.readOnly,k=void 0!==x&&x,O=t.questionRuleDetails,_=void 0===O?[]:O,E=t.apiConfig,C=void 0===E?{}:E,I=t.customTheme,T=void 0===I?{}:I,A=t.visible,P=void 0===A||A,D=(t.isCardlistModal,t.cardDeletionProperties),j=void 0===D?null:D,R=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,d_),M=Vc(),L=M.state,N=M.updateCardList,F=M.clearError,V=M.rulesEngine,B=sd(),q=y_((0,e.useState)([]),2),Q=q[0],z=q[1],$=y_((0,e.useState)({}),2),U=$[0],W=$[1],H=y_((0,e.useState)(!0),2),G=H[0],Y=H[1],K=(0,e.useRef)(!1),X=(0,e.useRef)(new Map),Z=(0,e.useRef)(!1),J=y_((0,e.useState)(!1),2),ee=J[0],ne=J[1],re=y_((0,e.useState)(null),2),oe=re[0],ie=re[1],ae=y_((0,e.useState)(-1),2),se=ae[0],le=ae[1],ue=y_((0,e.useState)(!1),2),ce=(ue[0],ue[1]),de=y_((0,e.useState)(!1),2),pe=de[0],fe=de[1],me=y_((0,e.useState)(-1),2),he=me[0],ve=me[1],ye=YS(B.cardListField||{},T),ge=(null==L||null===(r=L.required)||void 0===r?void 0:r[d])||!1,be=(0,e.useCallback)(function(e){if(!Array.isArray(e))return!1;try{var t=e.filter(function(e){return!(null!=e&&e.__isPending__)}),n=a_(t);z(n),Z.current=!0;var r=e.length>0,o=s_(e),i=e.length,a=function(e,t,n){var r=new Set(Object.keys(n||{}).filter(function(t){return String(t||"").startsWith("".concat(e,"_"))}));return Array.from({length:t},function(t,n){return"".concat(e,"_").concat(n)}).filter(function(e){return!r.has(e)})}(d,i,null==L?void 0:L.nestedStates);return r?(o||a.length>0)&&(K.current=!0,N(d,e,"init",null,-1,!0)):K.current=!0,!0}catch(e){return console.error("CardListField: failed to seed from context",e),!1}},[d,null==L?void 0:L.nestedStates,N]);(0,e.useEffect)(function(){var e;if(!Z.current){var t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];be(t)||function(e){if(void 0===e&&null!=f&&f.customQuestionValuesList){var t=l_(f),n=JSON.stringify(Q);JSON.stringify(t)!==n&&(N(d,t,"init",null,-1,!0),z(t),Z.current=!0)}}(t)}},[d,null==L||null===(o=L.values)||void 0===o?void 0:o[d],null==f?void 0:f.customQuestionValuesList]);var we=(0,e.useCallback)(function(e,t){var n=X.current.get(e);return X.current.set(e,t),{isHiddenToVisible:!1===n&&!0===t,isFirstMountVisible:void 0===n&&!0===t}},[]),Se=(0,e.useCallback)(function(e){var t,n=null==L||null===(t=L.values)||void 0===t?void 0:t[d],r=Array.isArray(n),o=r&&n.length>0,i=s_(n);if(r&&o)(i||o)&&(K.current=!0,N(d,n,"init",null,-1,!0));else{var a=[];e&&(z(a),K.current=!0,N(d,a,"add","",-1))}},[d,null==L?void 0:L.values,N]);(0,e.useEffect)(function(){var e,t=void 0===(null==L||null===(e=L.visibility)||void 0===e?void 0:e[d])?P:L.visibility[d],n=we(d,t),r=n.isHiddenToVisible,o=n.isFirstMountVisible;if(r||o)try{Se(r)}catch(e){console.error("CardListField: failed to reinitialize nested states",e)}},[null==L||null===(i=L.visibility)||void 0===i?void 0:i[d]]),(0,e.useEffect)(function(){if(K.current){var e,t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];if(Array.isArray(t))try{var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=a_(n);z(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}finally{K.current=!1}else K.current=!1}},[null==L||null===(a=L.values)||void 0===a?void 0:a[d]]),(0,e.useEffect)(function(){if(!ee){var e,t=null==L||null===(e=L.values)||void 0===e?void 0:e[d];if(Array.isArray(t)){var n=t.filter(function(e){return!(null!=e&&e.__isPending__)}),r=a_(n);z(function(e){return JSON.stringify(e)!==JSON.stringify(r)?r:e})}else z(function(e){return e.length>0?[]:e})}},[ee,null==L?void 0:L.values,d,null==L||null===(s=L.values)||void 0===s?void 0:s[d]]);var xe=(0,e.useCallback)(function(e,t){W(function(n){var r=m_({},n);return t&&Object.keys(t).length>0?r[e]=t:delete r[e],r})},[]),ke=(0,e.useCallback)(function(){var e;if(!(y&&Q.length>=y)){"function"==typeof F&&F(d);var t={name:"".concat(l," - ").concat(Q.length+1),properties:(null==f||null===(e=f.editQuestions)||void 0===e?void 0:e.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}))||[]},n=[].concat(p_(Q),[t]);z(n),N(d,n,"add","",Q.length)}},[y,Q,null==f?void 0:f.editQuestions,d,l,N,F]),Oe=(0,e.useCallback)(function(e){var t=Q.filter(function(t,n){return n!==e}).map(function(e,t){return m_(m_({},e),{},{name:"".concat(l," - ").concat(t+1)})});W(function(t){var n=m_({},t);return delete n[e],n}),z(t),N(d,t,"remove","",e),null==h||h(null,!0)},[Q,d,l,N,h]),_e=(0,e.useCallback)(function(e){u_(e,Q.length,j)||(ve(e),fe(!0))},[Q.length,j]),Ee=(0,e.useCallback)(function(){he>=0&&(Oe(he),fe(!1),ve(-1))},[he,Oe]),Ce=(0,e.useCallback)(function(){fe(!1),ve(-1)},[]),Ie=(0,e.useCallback)(function(){var e;"function"==typeof F&&F(d),ie(null);var t=(null==L||null===(e=L.values)||void 0===e?void 0:e[d])||[],n=Array.isArray(t)?t.length:Q.length;le(n),ce(!1),ne(!0)},[Q.length,null==L?void 0:L.values,d,F]),Te=(0,e.useCallback)(function(e,t){null==V||V.beginModalEdit(d),ie(e),le(t),ce(!0),ne(!0)},[V,d]),Ae=(0,e.useCallback)(function(e,t){var n,r=m_({},e);delete r.__isPending__;var o=(null==L||null===(n=L.values)||void 0===n?void 0:n[d])||[],i=(Array.isArray(o)?p_(o):[]).map(function(e){if(null!=e&&e.__isPending__){var t=m_({},e);return delete t.__isPending__,t}return e}),a=t>=i.length||-1===t;a?i.push(r):i[t]=r;var s=i.filter(function(e){return!(null!=e&&e.__isPending__)});z(s),N(d,i,a?"add":"update","",a?i.length-1:t),null==h||h(null,!0)},[d,N,h,null==L?void 0:L.values]),Pe=(0,e.useCallback)(function(){null==V||V.endModalEdit(),ne(!1),ie(null),le(-1),ce(!1)},[V]),De=(0,e.useCallback)(function(){Y(function(e){return!e})},[]),je=(0,e.useCallback)(function(e,t){var n,r="".concat(e,"_").concat(t);return null==L||null===(n=L.nestedStates)||void 0===n||null===(n=n[r])||void 0===n||null===(n=n.visibility)||void 0===n?void 0:n[e]},[null==L?void 0:L.nestedStates]),Re=(0,e.useCallback)(function(e,t){var n,r=e.questionId||e.name,o=je(r,t);return void 0!==o?o:void 0!==(null==L||null===(n=L.visibility)||void 0===n?void 0:n[r])?L.visibility[r]:e.visible},[je,null==L?void 0:L.visibility]),Me=(0,e.useCallback)(function(e,t,n){if(Re(e,n)){var r=function(e,t){var n;return null===(n=e.properties)||void 0===n||null===(n=n.find(function(e){return e.property===t}))||void 0===n?void 0:n.value}(t,e.name),o=al(e,r);if(o)return{fieldName:e.name,message:o}}return null},[Re]),Le=(0,e.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.length-1;return null!=f&&f.editQuestions?f.editQuestions.reduce(function(n,r){var o=Me(r,e,t);return o&&(n[o.fieldName]=o.message),n},{}):{}},[null==f?void 0:f.editQuestions,Q.length,Me]),Ne=(0,e.useCallback)(function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=p_(Q),i=null===(n=L.values)||void 0===n||null===(n=n[d])||void 0===n?void 0:n[e],a=function(e,t,n,r){if(e)return e;var o,i=null,a=v_(r||[]);try{var s=function(){var e,r=o.value,a=null===(e=n.properties)||void 0===e||null===(e=e.find(function(e){return e.editQuestionId===r.questionId}))||void 0===e?void 0:e.value,s="__id__".concat(r.questionId);if(void 0!==t[s]&&t[s]!==a)return i=r.questionId,1;null===i&&t[r.name]!==a&&(i=r.questionId)};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return i}(r,t,i,null==f?void 0:f.editQuestions),s=function(e,t,n){return(null==e?void 0:e.map(function(e){var r,o,i=null===(r=t.properties)||void 0===r?void 0:r.find(function(t){return te(t.editQuestionId)===te(e.questionId)}),a=n[e.name],s=void 0!==a&&""!==(null==i?void 0:i.value)?a:null==i?void 0:i.value;return{property:e.name,value:s,editQuestionId:e.questionId,renderMode:null!==(o=null==i?void 0:i.renderMode)&&void 0!==o?o:null,disabled:void 0!==(null==i?void 0:i.disabled)?Boolean(i.disabled):Boolean(e.disabled),required:void 0!==(null==i?void 0:i.required)?Boolean(i.required):Boolean(e.required)}}))||[]}(null==f?void 0:f.editQuestions,i,t);o[e]=m_(m_({},i),{},{name:t.name||(null==i?void 0:i.name)||"".concat(l," - ").concat(e+1),properties:s});var u=Le(o[e],e);xe(e,u),z(o),N(d,o,"update",a,e)},[Q,L.values,d,l,null==f?void 0:f.editQuestions,Le,xe,N]),Fe=(0,e.useCallback)(function(e){var t=function(e,t){var n;return{name:"".concat(e," - 1"),properties:(null==t||null===(n=t.editQuestions)||void 0===n?void 0:n.map(function(e){return{property:e.name,value:e.value||"",editQuestionId:e.questionId,renderMode:null,disabled:Boolean(e.disabled),required:Boolean(e.required)}}))||[]}}(l,f);return m_(m_({},t),{},{name:"".concat(l," - ").concat(e+1),properties:t.properties.map(function(e){return m_(m_({},e),{},{value:""})})})},[l,f]),Ve=(0,e.useCallback)(function(e,t){return function(n){var r,o,i,a=null!==(r=null==n||null===(o=n.target)||void 0===o?void 0:o.value)&&void 0!==r?r:n,s=void 0===(null==n||null===(i=n.target)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.itemIndex)?t:Number.parseInt(n.target.dataset.itemIndex,10),l=m_(m_({},function(e){var t,n={},r=v_(e.properties);try{for(r.s();!(t=r.n()).done;){var o=t.value;n[o.property]=o.value,o.editQuestionId&&(n["__id__".concat(o.editQuestionId)]=o.value)}}catch(e){r.e(e)}finally{r.f()}return n}(Q[s]||Fe(s))),{},h_(h_({},e.name,a),"__id__".concat(e.questionId),a));Ne(s,l,e.questionId)}},[Q,Fe,Ne]),Be=(0,e.useCallback)(function(e,t){var n,r,o,i=e.questionId||e.name,a=(n=Q[t],r=e.questionId,null==n||null===(o=n.properties)||void 0===o||null===(o=o.find(function(e){return e.editQuestionId===r}))||void 0===o?void 0:o.value),s=Re(e,t);return m_(m_({},e),{},{parentId:R.id,questionId:i,questionType:e.questionType||"text",validation:m_(m_({},e.validation),{},{required:e.required}),visible:s,value:a,onChange:Ve(e,t),inputProps:{"data-item-index":t,"data-parent-id":R.id}})},[Q,Re,Ve,R.id]),qe=(0,e.useCallback)(function(e){return null!=f&&f.editQuestions?[m_(m_({},R),{},{groupName:"",questions:f.editQuestions.map(function(t){return Be(t,e)})})]:[]},[null==f?void 0:f.editQuestions,Be,R]),Qe=(0,e.useCallback)(function(){return Q.map(function(e,t){var r,o=(null===(r=e.properties)||void 0===r?void 0:r.length)>0?"".concat(d,"_").concat(t,"_").concat(e.properties[0].editQuestionId):"".concat(d,"_").concat(t),i=u_(t,Q.length,j);return n().createElement("div",{key:o,style:ye.cardListItem},n().createElement("div",{style:ye.cardListItemHeader},!S&&!k&&Q.length>b&&!i&&n().createElement("button",{type:"button",onClick:function(){return Oe(t)},style:ye.removeButton},"Remove")),n().createElement(mV,{questionGroups:qe(t),disabled:S,readOnly:k,isNested:!0,questionRuleDetails:_,parentContext:{isCardList:!0,itemIndex:t,parentId:d,parentValue:Q[t]},apiConfig:C}))})},[Q,d,ye,S,k,b,j,Oe,qe,_,C]),ze=c?"".concat(G?"Collapse":"Expand"," ").concat(c):void 0;return{items:Q,errors:U,isExpanded:G,showModal:ee,selectedCardItem:oe,selectedItemIndex:se,showDeleteConfirm:pe,itemToDeleteIndex:he,mergedTheme:ye,isRequired:ge,minItems:b,maxItems:y,cardDeletionProperties:j,handleAddItem:ke,handleRemoveItem:Oe,handleDeleteClick:_e,handleConfirmDelete:Ee,handleCancelDelete:Ce,handleAddMoreCardlist:Ie,handleEditCardList:Te,handleSaveCardList:Ae,handleModalClose:Pe,handleToggleExpand:De,generateCardSchemaForItem:qe,renderCardListItems:Qe,toggleButtonAriaLabel:ze}}(t),D=P.items,j=P.isExpanded,R=P.showModal,M=P.selectedCardItem,L=P.selectedItemIndex,N=P.showDeleteConfirm,F=P.mergedTheme,V=P.isRequired,B=P.maxItems,q=P.cardDeletionProperties,Q=P.handleAddItem,z=P.handleDeleteClick,$=P.handleConfirmDelete,U=P.handleCancelDelete,W=P.handleAddMoreCardlist,H=P.handleEditCardList,G=P.handleSaveCardList,Y=P.handleModalClose,K=P.handleToggleExpand,X=P.renderCardListItems,Z=P.toggleButtonAriaLabel,J=function(){return function(e,t){if(t)return null;var n=Array.isArray(e)?e:[];return v&&n.length<v?"Minimum ".concat(v," items required"):m&&n.length>m?"Maximum ".concat(m," items allowed"):null}};return O?n().createElement(n().Fragment,null,n().createElement(zO,{name:r,label:i,value:Array.isArray(D)?D:[],validation:eE(eE({},p),{},{custom:J()}),className:g,renderInput:function(){return n().createElement(Y_,{items:D,questionId:a,name:r||i,required:V,cardListPreviewPattern:u,patternPreview:c,editQuestions:null==l?void 0:l.editQuestions,onEdit:H,onDeleteClick:z,onAddMore:W,disabled:w,readOnly:x,maxItems:m,cardDeletionProperties:null!=q?q:E,testIdRoot:C})}}),n().createElement(z_,{isOpen:R,onClose:Y,onSave:G,cardItem:M,itemIndex:L,cardListId:a,cardListName:r||i,customQuestionValueList:l,questionRuleDetails:t.questionRuleDetails,apiConfig:t.apiConfig,disabled:w,readOnly:x,testId:T}),n().createElement(U_,{isOpen:N,onClose:U,onConfirm:$,testId:A})):n().createElement(zO,{name:r,label:i,value:Array.isArray(D)?D:[],validation:eE(eE({},p),{},{custom:J()}),className:g,renderInput:function(){return n().createElement("div",{style:F.container},n().createElement("button",{type:"button",style:eE(eE({},F.header),{},{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:"transparent",border:"none"}),onClick:K,"aria-expanded":j,"aria-label":Z},n().createElement("span",{style:F.title},i,V&&n().createElement("span",{className:"required-mark"},"*")),n().createElement("span",{style:eE(eE({},F.toggleButton),j&&F.toggleExpanded),"aria-hidden":"true"},"▼")),j&&n().createElement(n().Fragment,null,n().createElement("div",{style:F.itemsContainer},X()),!w&&!x&&(!B||D.length<B)&&n().createElement("button",{type:"button",onClick:Q,style:eE(eE(eE(eE({},F.actionButton),F.addButton),w&&F.disabled),B&&D.length>=B&&F.maxItemsReached),"aria-label":"Add New","data-testid":I},"Add New")))}})};function rE(e){return mg("MuiTypography",e)}nE.propTypes={id:o().oneOfType([o().string,o().number]),name:o().string.isRequired,label:o().string,questionId:o().oneOfType([o().string,o().number]),customQuestionValueList:o().oneOfType([o().array,o().object]),cardListPreviewPattern:o().string,patternPreview:o().string,onChange:o().func,validation:o().object,max:o().number,min:o().number,className:o().string,disabled:o().bool,readOnly:o().bool,questionRuleDetails:o().array,apiConfig:o().shape({googlePlaces:o().shape({apiKey:o().string.isRequired,options:o().shape({region:o().string,language:o().string,componentRestrictions:o().shape({country:o().string}),types:o().arrayOf(o().string),fields:o().arrayOf(o().string)})}),customApi:o().shape({baseUrl:o().string,headers:o().object})}),customTheme:o().object,visible:o().bool,isCardlistModal:o().bool,cardDeletionProperties:o().shape({scope:o().oneOf(["FIRST_N","LAST_N"]),n:o().number,preventCardDeletion:o().bool,childDefaults:o().array}),testIdRoot:o().string},hg("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const oE={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},iE=function(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=(e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Ah;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t})(n);let i;return i=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return _m(n)?{...r,...n}:r}:{...r,...t},{...o,sx:i}},aE=Ey("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${ag(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(ig(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([e,t])=>"inherit"!==e&&t&&"object"==typeof t).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>"string"==typeof e).map(([t])=>({props:{color:`text${ag(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>"inherit"!==e.align,style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),sE={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},lE=e.forwardRef(function(e,t){const{color:n,...r}=Ay({props:e,name:"MuiTypography"}),o=iE({...r,...!oE[n]&&{color:n}}),{align:i="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:u=!1,paragraph:c=!1,variant:d="body1",variantMapping:p=sE,...f}=o,m={...o,align:i,color:n,className:a,component:s,gutterBottom:l,noWrap:u,paragraph:c,variant:d,variantMapping:p},h=s||(c?"p":p[d]||sE[d])||"span",v=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e;return Np({root:["root",i,"inherit"!==e.align&&`align${ag(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]},rE,a)})(m);return(0,Iy.jsx)(aE,{as:h,ref:t,className:Lp(v.root,a),...f,ownerState:m,style:{..."inherit"!==i&&{"--Typography-textAlign":i},...f.style}})});function uE(e){return mg("MuiFormControlLabel",e)}const cE=hg("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),dE=Ey("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${cE.label}`]:t.label},t.root,t[`labelPlacement${ag(n.labelPlacement)}`]]}})(ig(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${cE.disabled}`]:{cursor:"default"},[`& .${cE.label}`]:{[`&.${cE.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>"start"===e||"top"===e||"bottom"===e,style:{marginLeft:16}}]}))),pE=Ey("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(ig(({theme:e})=>({[`&.${cE.error}`]:{color:(e.vars||e).palette.error.main}}))),fE=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:a={},control:s,disabled:l,disableTypography:u,inputRef:c,label:d,labelPlacement:p="end",name:f,onChange:m,required:h,slots:v={},slotProps:y={},value:g,...b}=r,w=Uy(),S=l??s.props.disabled??w?.disabled,x=h??s.props.required,k={disabled:S,required:x};["checked","name","onChange","value","inputRef"].forEach(e=>{void 0===s.props[e]&&void 0!==r[e]&&(k[e]=r[e])});const O=zy({props:r,muiFormControl:w,states:["error"]}),_={...r,disabled:S,labelPlacement:p,required:x,error:O.error},E=(e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e;return Np({root:["root",n&&"disabled",`labelPlacement${ag(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]},uE,t)})(_),C={slots:v,slotProps:{...a,...y}},[I,T]=Kg("typography",{elementType:lE,externalForwardedProps:C,ownerState:_});let A=d;return null==A||A.type===lE||u||(A=(0,Iy.jsx)(I,{component:"span",...T,className:Lp(E.label,T?.className),children:A})),(0,Iy.jsxs)(dE,{className:Lp(E.root,i),ownerState:_,ref:n,...b,children:[e.cloneElement(s,k),x?(0,Iy.jsxs)("div",{children:[A,(0,Iy.jsxs)(pE,{ownerState:_,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):A]})});function mE(e){return mg("PrivateSwitchBase",e)}hg("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const hE=Ey(Yk,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),vE=Ey("input",{name:"MuiSwitchBase",shouldForwardProp:Oy})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),yE=e.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:i,disabled:a,disableFocusRipple:s=!1,edge:l=!1,icon:u,id:c,inputProps:d,inputRef:p,name:f,onBlur:m,onChange:h,onFocus:v,readOnly:y,required:g=!1,tabIndex:b,type:w,value:S,slots:x={},slotProps:k={},...O}=e,[_,E]=dS({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),C=Uy();let I=a;C&&void 0===I&&(I=C.disabled);const T="checkbox"===w||"radio"===w,A={...e,checked:_,disabled:I,disableFocusRipple:s,edge:l},P=(e=>{const{classes:t,checked:n,disabled:r,edge:o}=e;return Np({root:["root",n&&"checked",r&&"disabled",o&&`edge${ag(o)}`],input:["input"]},mE,t)})(A),D={slots:x,slotProps:{input:d,...k}},[j,R]=Kg("root",{ref:t,elementType:hE,className:P.root,shouldForwardComponentProp:!0,externalForwardedProps:{...D,component:"span",...O},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{v&&v(e),C&&C.onFocus&&C.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),C&&C.onBlur&&C.onBlur(e)})(t)}}),ownerState:A,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:I,role:void 0,tabIndex:null}}),[M,L]=Kg("input",{ref:p,elementType:vE,className:P.input,externalForwardedProps:D,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;E(t),h&&h(e,t)})(t)}}),ownerState:A,additionalProps:{autoFocus:n,checked:r,defaultChecked:i,disabled:I,id:T?c:void 0,name:f,readOnly:y,required:g,tabIndex:b,type:w,..."checkbox"===w&&void 0===S?{}:{value:S}}});return(0,Iy.jsxs)(j,{...R,children:[(0,Iy.jsx)(M,{...L}),_?o:u]})}),gE=ES((0,Iy.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),bE=ES((0,Iy.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),wE=ES((0,Iy.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function SE(e){return mg("MuiCheckbox",e)}const xE=hg("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),kE=Ey(yE,{shouldForwardProp:e=>Oy(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${ag(n.size)}`],"default"!==n.color&&t[`color${ag(n.color)}`]]}})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{color:t},style:{[`&.${xE.checked}, &.${xE.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${xE.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),OE=(0,Iy.jsx)(bE,{}),_E=(0,Iy.jsx)(gE,{}),EE=(0,Iy.jsx)(wE,{}),CE=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiCheckbox"}),{checkedIcon:o=OE,color:i="primary",icon:a=_E,indeterminate:s=!1,indeterminateIcon:l=EE,inputProps:u,size:c="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:m={},...h}=r,v=s?l:a,y=s?l:o,g={...r,disableRipple:d,color:i,indeterminate:s,size:c},b=(e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i=Np({root:["root",n&&"indeterminate",`color${ag(r)}`,`size${ag(o)}`]},SE,t);return{...t,...i}})(g),w=m.input??u,[S,x]=Kg("root",{ref:n,elementType:kE,className:Lp(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:m,...h},ownerState:g,additionalProps:{type:"checkbox",icon:e.cloneElement(v,{fontSize:v.props.fontSize??c}),checkedIcon:e.cloneElement(y,{fontSize:y.props.fontSize??c}),disableRipple:d,slots:f,slotProps:{input:Bw("function"==typeof w?w(g):w,{"data-indeterminate":s})}}});return(0,Iy.jsx)(S,{...x,classes:b})}),{entries:IE,setPrototypeOf:TE,isFrozen:AE,getPrototypeOf:PE,getOwnPropertyDescriptor:DE}=Object;let{freeze:jE,seal:RE,create:ME}=Object,{apply:LE,construct:NE}="undefined"!=typeof Reflect&&Reflect;jE||(jE=function(e){return e}),RE||(RE=function(e){return e}),LE||(LE=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),NE||(NE=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const FE=JE(Array.prototype.forEach),VE=JE(Array.prototype.lastIndexOf),BE=JE(Array.prototype.pop),qE=JE(Array.prototype.push),QE=JE(Array.prototype.splice),zE=JE(String.prototype.toLowerCase),$E=JE(String.prototype.toString),UE=JE(String.prototype.match),WE=JE(String.prototype.replace),HE=JE(String.prototype.indexOf),GE=JE(String.prototype.trim),YE=JE(Object.prototype.hasOwnProperty),KE=JE(RegExp.prototype.test),XE=(ZE=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return NE(ZE,t)});var ZE;function JE(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return LE(e,t,r)}}function eC(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zE;TE&&TE(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(AE(t)||(t[r]=e),o=e)}e[o]=!0}return e}function tC(e){for(let t=0;t<e.length;t++)YE(e,t)||(e[t]=null);return e}function nC(e){const t=ME(null);for(const[n,r]of IE(e))YE(e,n)&&(Array.isArray(r)?t[n]=tC(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=nC(r):t[n]=r);return t}function rC(e,t){for(;null!==e;){const n=DE(e,t);if(n){if(n.get)return JE(n.get);if("function"==typeof n.value)return JE(n.value)}e=PE(e)}return function(){return null}}const oC=jE(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),iC=jE(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),aC=jE(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sC=jE(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),lC=jE(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),uC=jE(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cC=jE(["#text"]),dC=jE(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pC=jE(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fC=jE(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mC=jE(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hC=RE(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vC=RE(/<%[\w\W]*|[\w\W]*%>/gm),yC=RE(/\$\{[\w\W]*/gm),gC=RE(/^data-[\-\w.\u00B7-\uFFFF]+$/),bC=RE(/^aria-[\-\w]+$/),wC=RE(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),SC=RE(/^(?:\w+script|data):/i),xC=RE(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kC=RE(/^html$/i),OC=RE(/^[a-z][.\w]*(-[.\w]+)+$/i);var _C=Object.freeze({__proto__:null,ARIA_ATTR:bC,ATTR_WHITESPACE:xC,CUSTOM_ELEMENT:OC,DATA_ATTR:gC,DOCTYPE_NAME:kC,ERB_EXPR:vC,IS_ALLOWED_URI:wC,IS_SCRIPT_OR_DATA:SC,MUSTACHE_EXPR:hC,TMPLIT_EXPR:yC});const EC=function(){return"undefined"==typeof window?null:window};var CC,IC=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:EC();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,h=u.prototype,v=rC(h,"cloneNode"),y=rC(h,"remove"),g=rC(h,"nextSibling"),b=rC(h,"childNodes"),w=rC(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let S,x="";const{implementation:k,createNodeIterator:O,createDocumentFragment:_,getElementsByTagName:E}=r,{importNode:C}=o;let I={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof IE&&"function"==typeof w&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:A,TMPLIT_EXPR:P,DATA_ATTR:D,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:L}=_C;let{IS_ALLOWED_URI:N}=_C,F=null;const V=eC({},[...oC,...iC,...aC,...lC,...cC]);let B=null;const q=eC({},[...dC,...pC,...fC,...mC]);let Q=Object.seal(ME(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,$=null;const U=Object.seal(ME(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,H=!0,G=!1,Y=!0,K=!1,X=!0,Z=!1,J=!1,ee=!1,te=!1,ne=!1,re=!1,oe=!0,ie=!1,ae=!0,se=!1,le={},ue=null;const ce=eC({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const pe=eC({},["audio","video","img","source","image","track"]);let fe=null;const me=eC({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ge=ye,be=!1,we=null;const Se=eC({},[he,ve,ye],$E);let xe=eC({},["mi","mo","mn","ms","mtext"]),ke=eC({},["annotation-xml"]);const Oe=eC({},["title","style","font","a","script"]);let _e=null;const Ee=["application/xhtml+xml","text/html"];let Ce=null,Ie=null;const Te=r.createElement("form"),Ae=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ie||Ie!==e){if(e&&"object"==typeof e||(e={}),e=nC(e),_e=-1===Ee.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===_e?$E:zE,F=YE(e,"ALLOWED_TAGS")?eC({},e.ALLOWED_TAGS,Ce):V,B=YE(e,"ALLOWED_ATTR")?eC({},e.ALLOWED_ATTR,Ce):q,we=YE(e,"ALLOWED_NAMESPACES")?eC({},e.ALLOWED_NAMESPACES,$E):Se,fe=YE(e,"ADD_URI_SAFE_ATTR")?eC(nC(me),e.ADD_URI_SAFE_ATTR,Ce):me,de=YE(e,"ADD_DATA_URI_TAGS")?eC(nC(pe),e.ADD_DATA_URI_TAGS,Ce):pe,ue=YE(e,"FORBID_CONTENTS")?eC({},e.FORBID_CONTENTS,Ce):ce,z=YE(e,"FORBID_TAGS")?eC({},e.FORBID_TAGS,Ce):nC({}),$=YE(e,"FORBID_ATTR")?eC({},e.FORBID_ATTR,Ce):nC({}),le=!!YE(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,H=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,K=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Z=e.WHOLE_DOCUMENT||!1,te=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,re=e.RETURN_TRUSTED_TYPE||!1,ee=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,N=e.ALLOWED_URI_REGEXP||wC,ge=e.NAMESPACE||ye,xe=e.MATHML_TEXT_INTEGRATION_POINTS||xe,ke=e.HTML_INTEGRATION_POINTS||ke,Q=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Q.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(H=!1),ne&&(te=!0),le&&(F=eC({},cC),B=[],!0===le.html&&(eC(F,oC),eC(B,dC)),!0===le.svg&&(eC(F,iC),eC(B,pC),eC(B,mC)),!0===le.svgFilters&&(eC(F,aC),eC(B,pC),eC(B,mC)),!0===le.mathMl&&(eC(F,lC),eC(B,fC),eC(B,mC))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?U.tagCheck=e.ADD_TAGS:(F===V&&(F=nC(F)),eC(F,e.ADD_TAGS,Ce))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?U.attributeCheck=e.ADD_ATTR:(B===q&&(B=nC(B)),eC(B,e.ADD_ATTR,Ce))),e.ADD_URI_SAFE_ATTR&&eC(fe,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(ue===ce&&(ue=nC(ue)),eC(ue,e.FORBID_CONTENTS,Ce)),e.ADD_FORBID_CONTENTS&&(ue===ce&&(ue=nC(ue)),eC(ue,e.ADD_FORBID_CONTENTS,Ce)),ae&&(F["#text"]=!0),Z&&eC(F,["html","head","body"]),F.table&&(eC(F,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw XE('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw XE('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,x=S.createHTML("")}else void 0===S&&(S=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==S&&"string"==typeof x&&(x=S.createHTML(""));jE&&jE(e),Ie=e}},De=eC({},[...iC,...aC,...sC]),je=eC({},[...lC,...uC]),Re=function(e){qE(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},Me=function(e,t){try{qE(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){qE(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(te||ne)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){let t=null,n=null;if(ee)e="<remove></remove>"+e;else{const t=UE(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&ge===ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=S?S.createHTML(e):e;if(ge===ye)try{t=(new f).parseFromString(o,_e)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ge,"template",null);try{t.documentElement.innerHTML=be?x:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ge===ye?E.call(t,Z?"html":"body")[0]:Z?t.documentElement:i},Ne=function(e){return O.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fe=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ve=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,r){FE(e,e=>{e.call(n,t,r,Ie)})}const qe=function(e){let t=null;if(Be(I.beforeSanitizeElements,e,null),Fe(e))return Re(e),!0;const r=Ce(e.nodeName);if(Be(I.uponSanitizeElement,e,{tagName:r,allowedTags:F}),X&&e.hasChildNodes()&&!Ve(e.firstElementChild)&&KE(/<[/\w!]/g,e.innerHTML)&&KE(/<[/\w!]/g,e.textContent))return Re(e),!0;if(7===e.nodeType)return Re(e),!0;if(X&&8===e.nodeType&&KE(/<[/\w]/g,e.data))return Re(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(r))&&(!F[r]||z[r])){if(!z[r]&&ze(r)){if(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,r))return!1;if(Q.tagNameCheck instanceof Function&&Q.tagNameCheck(r))return!1}if(ae&&!ue[r]){const t=w(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=v(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,g(e))}}return Re(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});const n=zE(e.tagName),r=zE(t.tagName);return!!we[e.namespaceURI]&&(e.namespaceURI===ve?t.namespaceURI===ye?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||xe[r]):Boolean(De[n]):e.namespaceURI===he?t.namespaceURI===ye?"math"===n:t.namespaceURI===ve?"math"===n&&ke[r]:Boolean(je[n]):e.namespaceURI===ye?!(t.namespaceURI===ve&&!ke[r])&&!(t.namespaceURI===he&&!xe[r])&&!je[n]&&(Oe[n]||!De[n]):!("application/xhtml+xml"!==_e||!we[e.namespaceURI]))}(e)?(Re(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!KE(/<\/no(script|embed|frames)/i,e.innerHTML)?(K&&3===e.nodeType&&(t=e.textContent,FE([T,A,P],e=>{t=WE(t,e," ")}),e.textContent!==t&&(qE(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(I.afterSanitizeElements,e,null),!1):(Re(e),!0)},Qe=function(e,t,n){if(oe&&("id"===t||"name"===t)&&(n in r||n in Te))return!1;if(H&&!$[t]&&KE(D,t));else if(W&&KE(j,t));else if(U.attributeCheck instanceof Function&&U.attributeCheck(t,e));else if(!B[t]||$[t]){if(!(ze(e)&&(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,e)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(e))&&(Q.attributeNameCheck instanceof RegExp&&KE(Q.attributeNameCheck,t)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(t,e))||"is"===t&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&KE(Q.tagNameCheck,n)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(n))))return!1}else if(fe[t]);else if(KE(N,WE(n,M,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==HE(n,"data:")||!de[e])if(G&&!KE(R,WE(n,M,"")));else if(n)return!1;return!0},ze=function(e){return"annotation-xml"!==e&&UE(e,L)},$e=function(e){Be(I.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Fe(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=Ce(a),c=l;let d="value"===a?c:GE(c);if(r.attrName=u,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Be(I.uponSanitizeAttribute,e,r),d=r.attrValue,!ie||"id"!==u&&"name"!==u||(Me(a,e),d="user-content-"+d),X&&KE(/((--!?|])>)|<\/(style|title|textarea)/i,d)){Me(a,e);continue}if("attributename"===u&&UE(d,"href")){Me(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Me(a,e);continue}if(!Y&&KE(/\/>/i,d)){Me(a,e);continue}K&&FE([T,A,P],e=>{d=WE(d,e," ")});const p=Ce(e.nodeName);if(Qe(p,u,d)){if(S&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(s);else switch(m.getAttributeType(p,u)){case"TrustedHTML":d=S.createHTML(d);break;case"TrustedScriptURL":d=S.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Fe(e)?Re(e):BE(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(I.afterSanitizeAttributes,e,null)},Ue=function e(t){let n=null;const r=Ne(t);for(Be(I.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Be(I.uponSanitizeShadowNode,n,null),qe(n),$e(n),n.content instanceof a&&e(n.content);Be(I.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,u=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ve(e)){if("function"!=typeof e.toString)throw XE("toString is not a function");if("string"!=typeof(e=e.toString()))throw XE("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||Pe(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Ce(e.nodeName);if(!F[t]||z[t])throw XE("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Le("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!te&&!K&&!Z&&-1===e.indexOf("<"))return S&&re?S.createHTML(e):e;if(r=Le(e),!r)return te?null:re?x:""}r&&ee&&Re(r.firstChild);const c=Ne(se?e:r);for(;s=c.nextNode();)qe(s),$e(s),s.content instanceof a&&Ue(s.content);if(se)return e;if(te){if(ne)for(u=_.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(B.shadowroot||B.shadowrootmode)&&(u=C.call(o,u,!0)),u}let d=Z?r.outerHTML:r.innerHTML;return Z&&F["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&KE(kC,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),K&&FE([T,A,P],e=>{d=WE(d,e," ")}),S&&re?S.createHTML(d):d},n.setConfig=function(){Pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ie=null,J=!1},n.isValidAttribute=function(e,t,n){Ie||Pe({});const r=Ce(e),o=Ce(t);return Qe(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&qE(I[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=VE(I[e],t);return-1===n?void 0:QE(I[e],n,1)[0]}return BE(I[e])},n.removeHooks=function(e){I[e]=[]},n.removeAllHooks=function(){I={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),TC=["a","p","br","span","strong","em"],AC=["href","target","rel"],PC=["target","rel"],DC={ALLOWED_TAGS:[],ALLOWED_ATTR:[]},jC=!1,RC=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};jC||"function"!=typeof IC.addHook||(jC=!0,IC.addHook("afterSanitizeAttributes",function(e){"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute("rel","noopener noreferrer")}));var n={ALLOWED_TAGS:TC,ALLOWED_ATTR:AC};return Array.isArray(t.addAttr)&&(n.ADD_ATTR=t.addAttr),IC.sanitize(e,n)};function MC(e){return MC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MC(e)}var LC=["name","questionId","label","value","validation","disabled","required","className","options","header","styleName","customTheme","error","helperText","onChange","inputProps","tooltip","apiConfig","testId","testIdRoot"],NC=["apiConfig","questionId","maskInput","maskingType","maskingLength","questionRuleDetails","visible","dependsOn","formData","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup","isopeninnewtab"];function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(null,arguments)}function VC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BC(Object(n),!0).forEach(function(t){QC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QC(e,t,n){return(t=function(e){var t=function(e){if("object"!=MC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=MC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==MC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zC(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var $C=function(t){var r,o,i,a=t.name,s=t.questionId,l=t.label,u=t.value,c=t.validation,d=t.disabled,p=t.required,f=void 0!==p&&p,m=t.className,h=t.options,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.error,S=t.helperText,x=t.onChange,k=t.inputProps,O=void 0===k?{}:k,_=t.tooltip,E=void 0===_?"":_,C=(t.apiConfig,t.testId),I=(t.testIdRoot,zC(t,LC)),T=sd(),A=Vc(),P=A.setValue,D=A.state,j=O["data-item-index"],R=O["data-parent-id"],M=(0,e.useMemo)(function(){var e,t;if(!h||!Array.isArray(h))return h;var n=null===(e=D.optionVisibility)||void 0===e?void 0:e[s];return null!=R&&void 0!==j&&null!==(t=D.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[R])&&void 0!==t&&null!==(t=t[Number(j)])&&void 0!==t&&t[s]&&(n=D.optionVisibilityByInstance[R][Number(j)][s]),n?h.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):h},[h,D.optionVisibility,D.optionVisibilityByInstance,s,R,j]),L=null!==(r=null==l?void 0:l.replaceAll(String.raw(CC||(o=["\n"],i=["\\n"],i||(i=o.slice(0)),CC=Object.freeze(Object.defineProperties(o,{raw:{value:Object.freeze(i)}}))))," ").trim())&&void 0!==r?r:"",N=L?RC(L,{addAttr:PC}):"",F=void 0===j?String(a):"".concat(String(a),"-").concat(j),V=null!=R&&""!==R&&null!=j,B=!0===u||"string"==typeof u&&"false"!==u.trim().toLowerCase()&&""!==u.trim(),q=(0,e.useMemo)(function(){return!(h&&Array.isArray(h)&&h.length>0)||M&&M.length>0},[h,M]),Q=(0,e.useMemo)(function(){var e=T.checkboxField||{};return YS(e,b)},[T,b]),z=(0,e.useMemo)(function(){var e=qC(qC({},Q.container),{},{width:"100%"}),t=ZS(Q.checkbox,w&&Q.error,d&&Q.disabled,B&&Q.checked);return{container:KS(e,Q.responsive),checkbox:t,label:Q.label,control:Q.control}},[Q,w,d,B]);return q?n().createElement("div",{className:"form-field ".concat(y||""),"data-theme":Q.name,"data-field-type":"checkbox",style:z.container},v&&n().createElement("div",{className:"field-header",style:T.header},v),n().createElement(zO,{name:F,label:N,value:u,validation:c,className:"checkbox-field ".concat(m||""),customTheme:Q,error:w,helperText:S,renderInput:function(){var e=Object.entries(I).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return VC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VC(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return"boolean"==typeof o?!0===o&&(e[r]="true"):null!=o&&(e[r]=o),e},{}),t=(e.apiConfig,e.questionId,e.maskInput,e.maskingType,e.maskingLength,e.questionRuleDetails,e.visible,e.dependsOn,e.formData,e.customQuestionValueList,e.fileUploads,e.allowedFileType,e.fileSizeLimit,e.numberOfFiles,e.includeExtraDropDowns,e.additionalDropDowns,e.errorMessage,e.addressGroup,e.isopeninnewtab,zC(e,NC));return n().createElement("div",{className:"checkbox-wrapper"},n().createElement(fE,{className:"checkbox-field__control",name:F,disabled:d,"data-item-index":j,"data-parent-id":R,control:n().createElement(CE,FC({className:"checkbox-field__checkbox",checked:B,disabled:d,onChange:function(e){var t,n=e.target.checked?(null==M||null===(t=M[0])||void 0===t?void 0:t.value)||"true":"";null==x||x(qC(qC({},e),{},{target:qC(qC({},e.target),{},{value:n})})),V||P(F,n)},style:z.checkbox,inputProps:{"data-testid":C}},t)),label:N?n().createElement("span",{className:"checkbox-field__label"},n().createElement("span",{dangerouslySetInnerHTML:{__html:N}}),f&&n().createElement("span",{className:"required-mark",style:Q.required},"*"),E&&n().createElement(hO,{tooltip:E})):null,style:qC(qC(qC({},z.control),z.label),{},{width:"fit-content",maxWidth:"100%",alignSelf:"flex-start"})}))}}),S&&n().createElement("div",{className:"helper-text",style:T.helperText},S)):null};function UC(e){return mg("MuiFormGroup",e)}$C.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().bool]),validation:o().object,disabled:o().bool,required:o().bool,className:o().string,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().bool]).isRequired,label:o().string.isRequired})),header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,onChange:o().func,inputProps:o().object,tooltip:o().string,apiConfig:o().object,testId:o().string,testIdRoot:o().string},hg("MuiFormGroup",["root","row","error"]);const WC=Ey("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),HC=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiFormGroup"}),{className:r,row:o=!1,...i}=n,a=zy({props:n,muiFormControl:Uy(),states:["error"]}),s={...n,row:o,error:a.error},l=(e=>{const{classes:t,row:n,error:r}=e;return Np({root:["root",n&&"row",r&&"error"]},UC,t)})(s);return(0,Iy.jsx)(WC,{className:Lp(l.root,r),ownerState:s,ref:t,...i})});function GC(e){return GC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GC(e)}var YC=["questionId","label","options","defaultValue","helperText","required","onChange","_showcheckbox","_isesigndoc","_isopeninnewtab","_addadditional","_addmedication","questionRuleDetails","formData","apiBaseUrl","dependsOn","error","customTheme","inputProps","styleName","tooltip","showQuestionLabels","testIdRoot"],KC=["apiConfig","maskInput","maskingType","maskingLength","customQuestionValueList","fileUploads","allowedFileType","fileSizeLimit","numberOfFiles","includeExtraDropDowns","additionalDropDowns","errorMessage","addressGroup"];function XC(){return XC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XC.apply(null,arguments)}function ZC(e,t){if(e){if("string"==typeof e)return JC(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JC(e,t):void 0}}function JC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(t){nI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nI(e,t,n){return(t=function(e){var t=function(e){if("object"!=GC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GC(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rI(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var oI=function(t){var r=t.questionId,o=t.label,i=t.options,a=void 0===i?[]:i,s=t.defaultValue,l=void 0===s?[]:s,u=t.helperText,c=t.required,d=void 0!==c&&c,p=t.onChange,f=(t._showcheckbox,t._isesigndoc,t._isopeninnewtab,t._addadditional,t._addmedication,t.questionRuleDetails,t.formData,t.apiBaseUrl,t.dependsOn,t.error),m=t.customTheme,h=void 0===m?{}:m,v=t.inputProps,y=void 0===v?{}:v,g=t.styleName,b=t.tooltip,w=void 0===b?"":b,S=t.showQuestionLabels,x=void 0===S||S,k=t.testIdRoot,O=rI(t,YC),_=y["data-item-index"],E=y["data-parent-id"],C=sd(),I=Vc(),T=I.setValue,A=I.state,P=$S({questionId:r,itemIndex:_,defaultValue:l,defaultVisible:!0,defaultDisabled:!1}),D=P.value,j=P.visible,R=P.disabled,M=P.handleChange,L=(0,e.useMemo)(function(){var e,t,n=null===(e=A.optionVisibility)||void 0===e?void 0:e[r];return null!=E&&void 0!==_&&null!==(t=A.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[E])&&void 0!==t&&null!==(t=t[Number(_)])&&void 0!==t&&t[r]&&(n=A.optionVisibilityByInstance[E][Number(_)][r]),n?a.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):a},[a,A.optionVisibility,A.optionVisibilityByInstance,r,E,_]),N=void 0===_?String(r):"".concat(String(r),"-").concat(_),F=(0,e.useMemo)(function(){var e=C.checkboxGroupField||C.checkboxField||{};return YS(e,h)},[C,h]),V=(0,e.useMemo)(function(){var e=tI(tI({},F.container),{},{width:"100%"}),t=ZS(F.label,d&&F.required,R&&F.disabled),n=ZS(F.checkbox,f&&F.error,R&&F.disabled);return{container:KS(e,F.responsive),label:t,checkbox:n,group:F.group||{},helperText:ZS(F.helperText,f&&F.error)}},[F,d,R,f]),B=Array.isArray(D)?D:Array.isArray(l)?l:[],q=function(e,t){var n=e.target.checked?[].concat(function(e){return function(e){if(Array.isArray(e))return JC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ZC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(B||[]),[t]):(B||[]).filter(function(e){return e!==t});T(r,n),M(n),p&&p(tI(tI({},e),{},{target:tI(tI({},e.target),{},{name:N,value:n})}))};if(!j)return null;var Q=Object.entries(O).reduce(function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||ZC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=n[0],o=n[1];return e[r]="boolean"==typeof o?o?o.toString():void 0:o,e},{}),z=(Q.apiConfig,Q.maskInput,Q.maskingType,Q.maskingLength,Q.customQuestionValueList,Q.fileUploads,Q.allowedFileType,Q.fileSizeLimit,Q.numberOfFiles,Q.includeExtraDropDowns,Q.additionalDropDowns,Q.errorMessage,Q.addressGroup,rI(Q,KC));return n().createElement("div",{className:"checkbox-group-field ".concat(g||""),"data-theme":F.name,"data-field-type":"checkbox-group",style:V.container},n().createElement(HC,{style:V.group},x&&o&&n().createElement("div",{className:"question_label",style:V.label},o,d&&n().createElement("span",{className:"required-mark",style:F.requiredMark},"*"),w&&n().createElement(hO,{tooltip:w})),n().createElement("div",{className:"checkbox-group-wrapper",style:V.group},L.map(function(e){var t=Array.isArray(B)?B.includes(e.value):!0===e.selected,r=dd(k,"option",e.value),o=dd(k,"option",e.value,"input");return n().createElement(fE,{key:e.value,className:"checkbox-group-field__control",name:N,"data-item-index":_,"data-parent-id":E,"data-testid":r,control:n().createElement(CE,XC({className:"checkbox-group-field__checkbox",checked:t,onChange:function(t){return q(t,e.value)},disabled:R,required:e.required||!1,style:V.checkbox,inputProps:{"data-testid":o}},z)),label:e.label,style:tI(tI(tI({},F.control||{gap:"0.25rem",margin:0,alignItems:"center"}),V.label),{},{width:"fit-content",maxWidth:"100%",alignSelf:"flex-start"})})}),u&&n().createElement("div",{style:V.helperText},u))))};oI.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number]).isRequired})),defaultValue:o().array,helperText:o().string,required:o().bool,onChange:o().func,_showcheckbox:o().bool,_isesigndoc:o().bool,_isopeninnewtab:o().bool,_addadditional:o().bool,_addmedication:o().bool,_questionRuleDetails:o().array,questionRuleDetails:o().array,formData:o().object,apiBaseUrl:o().string,dependsOn:o().oneOfType([o().string,o().array]),error:o().string,customTheme:o().object,tooltip:o().string,styleName:o().string,inputProps:o().object,showQuestionLabels:o().bool,testIdRoot:o().string};var iI=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/CurrencyField.css"),aI={};function sI(e){return sI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sI(e)}function lI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lI(Object(n),!0).forEach(function(t){cI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cI(e,t,n){return(t=function(e){var t=function(e){if("object"!=sI(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=sI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sI(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}aI.styleTagTransform=kl(),aI.setAttributes=bl(),aI.insert=yl().bind(null,"head"),aI.domAPI=hl(),aI.insertStyleElement=Sl(),fl()(iI.A,aI),iI.A&&iI.A.locals&&iI.A.locals;var pI=function(e){var t=function(e){return null==e?"":String(e).replace(ie,"")}(e);if(!t)return"";var n=t.indexOf("."),r=-1!==n,o=r?t.slice(0,n):t,i=r?t.slice(n+1).replace(/\./g,""):"",a=r&&n===t.length-1,s=o.replace(/\./g,""),l=s?Number.parseInt(s,10):0;if(Number.isNaN(l))return"";var u=new Intl.NumberFormat("en-US",{style:"decimal",maximumFractionDigits:0}).format(l);return r?a?"".concat(u,"."):"".concat(u,".").concat(i):u},fI=n().memo(function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.currency,c=void 0===u?"$":u,d=t.onChange,p=t.formState,f=t.error,m=t.customTheme,h=void 0===m?{}:m,v=t.styleName,y=t.maxLength,g=t.placeholder,b=t.onBlur,w=t.tooltip,S=void 0===w?"":w,x=t.showQuestionLabels,k=void 0===x||x,O=t.testId,_=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dI(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dI(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(null==i?"":pI(i)),2),E=_[0],C=_[1],I=sd(),T=(0,e.useMemo)(function(){var e=I.currencyField||I.textField||{};return YS(e,h)},[I,h]),A=(0,e.useMemo)(function(){var e=uI(uI({},T.container),{},{width:"100%"}),t=ZS(T.input,f&&T.error,s&&T.disabled,{borderTopLeftRadius:"0",borderBottomLeftRadius:"0",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderLeftWidth:"0"});return{container:KS(e,T.responsive),input:t,currencySymbol:uI(uI({},T.currencySymbol),{},{padding:"0.5rem 1rem",backgroundColor:"#fff",borderWidth:"1px",borderStyle:"solid",borderColor:"#e2e8f0",borderRightWidth:"0",borderTopLeftRadius:"0.375rem",borderBottomLeftRadius:"0.375rem",color:"#64748b",display:"flex",alignItems:"center",justifyContent:"center"}),wrapper:uI(uI({},T.wrapper),{},{position:"relative",display:"flex",alignItems:"stretch",width:"100%"})}},[T,f,s]),P=function(e){var t=e.target.value.replace(/[^0-9.]/g,""),n=t.indexOf(".");-1!==n&&(t=t.slice(0,n+1)+t.slice(n+1).replace(/\./g,"")),y&&t.length>y&&(t=t.slice(0,y));var o=t?pI(t):"";C(o),d&&d({target:{name:r,value:t}})};(0,e.useEffect)(function(){void 0!==i&&C(null===i?"":pI(i))},[i]);var D=String(r);return n().createElement(zO,{name:D,label:k?o:"",value:i,validation:a,className:"currency-field ".concat(l||""," ").concat(v||""),customTheme:T,error:f,formState:p,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:T.label||{}},t,r&&n().createElement("span",{style:T.required||{}},"*"),S&&n().createElement(hO,{tooltip:S})):null},renderInput:function(){return n().createElement("div",{style:A.wrapper},n().createElement("span",{className:"currency-symbol",style:A.currencySymbol},c),n().createElement("input",{type:"text",name:D,value:E,onChange:P,autoComplete:"off",disabled:s,className:"currency-input",style:A.input,placeholder:g||"Enter amount","aria-label":"Currency input in ".concat(c),onBlur:b,"data-testid":O}))}})});fI.displayName="CurrencyField",fI.propTypes={testId:o().string,name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,disabled:o().bool,className:o().string,currency:o().string,onChange:o().func,formState:o().object,error:o().string,customTheme:o().object,styleName:o().string,placeholder:o().string,maxLength:o().number,onBlur:o().func,tooltip:o().string,showQuestionLabels:o().bool};const mI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hI=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vI=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,yI=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gI(e){return e?parseInt(e):1}function bI(e){return e&&parseFloat(e.replace(",","."))||0}const wI=[31,null,31,30,31,30,31,31,30,31,30,31];function SI(e){return e%400==0||e%4==0&&e%100!=0}function xI(e,t){return+Xo(e)<+Xo(t)}function kI(e,t,n){const r=Xo(e,n?.in);return r.setHours(t),r}function OI(e,t,n){const r=Xo(e,n?.in);return r.setMinutes(t),r}function _I(e,t,n){const r=Xo(e,n?.in);return r.setSeconds(t),r}function EI(e,t){const n=Xo(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function CI(e,t){const n=Xo(e,t?.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function II(e,t){const n=Xo(e,t?.in);return n.setHours(23,59,59,999),n}function TI(e,t){const n=Xo(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function AI(e,t,n){const r=+Xo(e,n?.in),[o,i]=[+Xo(t.start,n?.in),+Xo(t.end,n?.in)].sort((e,t)=>e-t);return r>=o&&r<=i}function PI(e,t,n){const r=Xo(e,n?.in),o=r.getFullYear(),i=r.getDate(),a=Ko(n?.in||e,0);a.setFullYear(o,t,15),a.setHours(0,0,0,0);const s=function(e,t){const n=Xo(e,t?.in),r=n.getFullYear(),o=n.getMonth(),i=Ko(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}(a);return r.setMonth(t,Math.min(i,s)),r}function DI(e,t,n){const r=Xo(e,n?.in),o=t-(Math.trunc(r.getMonth()/3)+1);return PI(r,r.getMonth()+3*o)}function jI(e,t){return Xo(e,t?.in).getFullYear()}function RI(e,t){return Xo(e,t?.in).getMonth()}function MI(e,t){const n=Xo(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function LI(e,t){const n=Xo(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function NI(e,t){return Xo(e,t?.in).getHours()}function FI(e,t){return Xo(e,t?.in).getMinutes()}function VI(e){return Xo(e).getSeconds()}function BI(e,t,n){const r=Xo(e,n?.in);if(isNaN(t))return Ko(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),i=Ko(n?.in||e,r.getTime());return i.setMonth(r.getMonth()+t+1,0),o>=i.getDate()?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function qI(e,t,n){return BI(e,-t,n)}function QI(e,t,n){const[r,o]=Oa(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function zI(e,t,n){return BI(e,3*t,n)}function $I(e,t,n){return zI(e,-t,n)}function UI(e,t,n){const[r,o]=Oa(n?.in,e,t);return 4*(r.getFullYear()-o.getFullYear())+(LI(r)-LI(o))}function WI(e,t,n){return BI(e,12*t,n)}function HI(e,t,n){return WI(e,-t,n)}function GI(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()-o.getFullYear()}function YI(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Ko.bind(null,e));const t=Xo(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Ko(r,n||NaN)}function KI(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Ko.bind(null,e));const t=Xo(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Ko(r,n||NaN)}function XI(e,t,n){return Ko(n?.in||e,+Xo(e)+t)}function ZI(e,t,n){return XI(e,t*Go,n)}function JI(e,t,n){const r=Xo(e,n?.in);return r.setTime(r.getTime()+t*Ho),r}function eT(e,t,n){return XI(e,1e3*t,n)}function tT(e,t){return+Xo(e)>+Xo(t)}function nT(e,t){return Xo(e,t?.in).getDate()}function rT(e,t,n){return da(e,7*t,n)}function oT(e){return+Xo(e)}function iT(e,t,n){const r=Xo(e,n?.in);return isNaN(+r)?Ko(n?.in||e,NaN):(r.setFullYear(t),r)}function aT(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function sT(e,t,n){return rT(e,-t,n)}var lT="undefined"!=typeof document?e.useLayoutEffect:function(){};const uT={...t}.useInsertionEffect||(e=>e());function cT(){return"undefined"!=typeof window}function dT(e){return mT(e)?(e.nodeName||"").toLowerCase():"#document"}function pT(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fT(e){var t;return null==(t=(mT(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function mT(e){return!!cT()&&(e instanceof Node||e instanceof pT(e).Node)}function hT(e){return!!cT()&&(e instanceof Element||e instanceof pT(e).Element)}function vT(e){return!!cT()&&(e instanceof HTMLElement||e instanceof pT(e).HTMLElement)}function yT(e){return!(!cT()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof pT(e).ShadowRoot)}function gT(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=IT(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function bT(e){return/^(table|td|th)$/.test(dT(e))}function wT(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const ST=/transform|translate|scale|rotate|perspective|filter/,xT=/paint|layout|strict|content/,kT=e=>!!e&&"none"!==e;let OT;function _T(e){const t=hT(e)?IT(e):e;return kT(t.transform)||kT(t.translate)||kT(t.scale)||kT(t.rotate)||kT(t.perspective)||!ET()&&(kT(t.backdropFilter)||kT(t.filter))||ST.test(t.willChange||"")||xT.test(t.contain||"")}function ET(){return null==OT&&(OT="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),OT}function CT(e){return/^(html|body|#document)$/.test(dT(e))}function IT(e){return pT(e).getComputedStyle(e)}function TT(e){return hT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function AT(e){if("html"===dT(e))return e;const t=e.assignedSlot||e.parentNode||yT(e)&&e.host||fT(e);return yT(t)?t.host:t}function PT(e){const t=AT(e);return CT(t)?e.ownerDocument?e.ownerDocument.body:e.body:vT(t)&&gT(t)?t:PT(t)}function DT(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=PT(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=pT(o);if(i){const e=jT(a);return t.concat(a,a.visualViewport||[],gT(o)?o:[],e&&n?DT(e):[])}return t.concat(o,DT(o,[],n))}function jT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const RT=Math.min,MT=Math.max,LT=Math.round,NT=Math.floor,FT=e=>({x:e,y:e}),VT={left:"right",right:"left",bottom:"top",top:"bottom"};function BT(e,t){return"function"==typeof e?e(t):e}function qT(e){return e.split("-")[0]}function QT(e){return e.split("-")[1]}function zT(e){return"y"===e?"height":"width"}function $T(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function UT(e){return"x"===$T(e)?"y":"x"}function WT(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const HT=["left","right"],GT=["right","left"],YT=["top","bottom"],KT=["bottom","top"];function XT(e){const t=qT(e);return VT[t]+e.slice(t.length)}function ZT(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function JT(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function eA(e,t,n){let{reference:r,floating:o}=e;const i=$T(t),a=UT(t),s=zT(a),l=qT(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(QT(t)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1)}return f}async function tA(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=BT(t,e),m=ZT(f),h=s[p?"floating"===d?"reference":"floating":d],v=JT(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=JT(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-w.top+m.top)/b.y,bottom:(w.bottom-v.bottom+m.bottom)/b.y,left:(v.left-w.left+m.left)/b.x,right:(w.right-v.right+m.right)/b.x}}const nA=new Set(["left","top"]);function rA(e){const t=IT(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vT(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=LT(n)!==i||LT(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function oA(e){return hT(e)?e:e.contextElement}function iA(e){const t=oA(e);if(!vT(t))return FT(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=rA(t);let a=(i?LT(n.width):n.width)/r,s=(i?LT(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const aA=FT(0);function sA(e){const t=pT(e);return ET()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:aA}function lA(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=oA(e);let a=FT(1);t&&(r?hT(r)&&(a=iA(r)):a=iA(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==pT(e))&&t}(i,n,r)?sA(i):FT(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=pT(i),t=r&&hT(r)?pT(r):r;let n=e,o=jT(n);for(;o&&r&&t!==n;){const e=iA(o),t=o.getBoundingClientRect(),r=IT(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=pT(o),o=jT(n)}}return JT({width:c,height:d,x:l,y:u})}function uA(e,t){const n=TT(e).scrollLeft;return t?t.left+n:lA(fT(e)).left+n}function cA(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-uA(e,n),y:n.top+t.scrollTop}}function dA(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=pT(e),r=fT(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=ET();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const u=uA(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else u<=25&&(i+=u);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=fT(e),n=TT(e),r=e.ownerDocument.body,o=MT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=MT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+uA(e);const s=-n.scrollTop;return"rtl"===IT(r).direction&&(a+=MT(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(fT(e));else if(hT(t))r=function(e,t){const n=lA(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vT(e)?iA(e):FT(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=sA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return JT(r)}function pA(e,t){const n=AT(e);return!(n===t||!hT(n)||CT(n))&&("fixed"===IT(n).position||pA(n,t))}function fA(e,t,n){const r=vT(t),o=fT(t),i="fixed"===n,a=lA(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=FT(0);function u(){l.x=uA(o)}if(r||!r&&!i)if(("body"!==dT(t)||gT(o))&&(s=TT(t)),r){const e=lA(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?FT(0):cA(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function mA(e){return"static"===IT(e).position}function hA(e,t){if(!vT(e)||"fixed"===IT(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fT(e)===n&&(n=n.ownerDocument.body),n}function vA(e,t){const n=pT(e);if(wT(e))return n;if(!vT(e)){let t=AT(e);for(;t&&!CT(t);){if(hT(t)&&!mA(t))return t;t=AT(t)}return n}let r=hA(e,t);for(;r&&bT(r)&&mA(r);)r=hA(r,t);return r&&CT(r)&&mA(r)&&!_T(r)?n:r||function(e){let t=AT(e);for(;vT(t)&&!CT(t);){if(_T(t))return t;if(wT(t))return null;t=AT(t)}return null}(e)||n}const yA={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=fT(r),s=!!t&&wT(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=FT(1);const c=FT(0),d=vT(r);if((d||!d&&!i)&&(("body"!==dT(r)||gT(a))&&(l=TT(r)),d)){const e=lA(r);u=iA(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const p=!a||d||i?FT(0):cA(a,l);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}},getDocumentElement:fT,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?wT(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=DT(e,[],!1).filter(e=>hT(e)&&"body"!==dT(e)),o=null;const i="fixed"===IT(e).position;let a=i?AT(e):e;for(;hT(a)&&!CT(a);){const t=IT(a),n=_T(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||gT(a)&&!n&&pA(e,a))?r=r.filter(e=>e!==a):o=t,a=AT(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=dA(t,i[0],o);let s=a.top,l=a.right,u=a.bottom,c=a.left;for(let e=1;e<i.length;e++){const n=dA(t,i[e],o);s=MT(n.top,s),l=RT(n.right,l),u=RT(n.bottom,u),c=MT(n.left,c)}return{width:l-c,height:u-s,x:c,y:s}},getOffsetParent:vA,getElementRects:async function(e){const t=this.getOffsetParent||vA,n=this.getDimensions,r=await n(e.floating);return{reference:fA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=rA(e);return{width:t,height:n}},getScale:iA,isElement:hT,isRTL:function(e){return"rtl"===IT(e).direction}};function gA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bA(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=oA(e),c=o||i?[...u?DT(u):[],...t?DT(t):[]]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=fT(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(s||t(),!p||!f)return;const m={rootMargin:-NT(d)+"px "+-NT(o.clientWidth-(c+p))+"px "+-NT(o.clientHeight-(d+f))+"px "+-NT(c)+"px",threshold:MT(0,RT(1,l))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||gA(u,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let h=l?lA(e):null;return l&&function t(){const r=lA(e);h&&!gA(h,r)&&n(),h=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const wA=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=BT(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=qT(o),g=$T(s),b=qT(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),S=p||(b||!h?[XT(s)]:function(e){const t=XT(e);return[WT(e),t,WT(t)]}(s)),x="none"!==m;!p&&x&&S.push(...function(e,t,n,r){const o=QT(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?GT:HT:t?HT:GT;case"left":case"right":return t?YT:KT;default:return[]}}(qT(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(WT)))),i}(s,h,m,w));const k=[s,...S],O=await l.detectOverflow(t,v),_=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&_.push(O[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=QT(e),o=UT(e),i=zT(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=XT(a)),[a,XT(a)]}(o,a,w);_.push(O[e[0]],O[e[1]])}if(E=[...E,{placement:o,overflows:_}],!_.every(e=>e<=0)){var C,I;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=k[e];if(t&&("alignment"!==d||g===$T(t)||E.every(e=>$T(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(I=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=E.filter(e=>{if(x){const t=$T(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},SA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=BT(e,t)||{};if(null==u)return{};const d=ZT(c),p={x:n,y:r},f=UT(o),m=zT(f),h=await a.getDimensions(u),v="y"===f,y=v?"top":"left",g=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[f]-p[f]-i.floating[m],S=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let k=x?x[b]:0;k&&await(null==a.isElement?void 0:a.isElement(x))||(k=s.floating[b]||i.floating[m]);const O=w/2-S/2,_=k/2-h[m]/2-1,E=RT(d[y],_),C=RT(d[g],_),I=E,T=k-h[m]-C,A=k/2-h[m]/2+O,P=function(e,t,n){return MT(e,RT(t,n))}(I,A,T),D=!l.arrow&&null!=QT(o)&&A!==P&&i.reference[m]/2-(A<I?E:C)-h[m]/2<0,j=D?A<I?A-I:A-T:0;return{[f]:p[f]+j,data:{[f]:P,centerOffset:A-P-j,...D&&{alignmentOffset:j}},reset:D}}}),xA=(e,t,n)=>{const r=new Map,o={platform:yA,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:tA},l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=eA(u,r,l),p=r,f=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:v,fn:y}=h,{x:g,y:b,data:w,reset:S}=await y({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});c=null!=g?g:c,d=null!=b?b:d,m[v]={...m[v],...w},S&&f<50&&(f++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(u=!0===S.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),({x:c,y:d}=eA(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var kA="undefined"!=typeof document?e.useLayoutEffect:function(){};function OA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!OA(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||OA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function _A(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EA(e,t){const n=_A(e);return Math.round(t*n)/n}function CA(t){const n=e.useRef(t);return kA(()=>{n.current=t}),n}const IA=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=qT(n),s=QT(n),l="y"===$T(n),u=nA.has(a)?-1:1,c=i&&l?-1:1,d=BT(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(f="end"===s?-1*m:m),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},TA=(e,t)=>{const n=wA(e);return{name:n.name,fn:n.fn,options:[e,t]}},AA=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?SA({element:n.current,padding:r}).fn(t):{}:n?SA({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},PA={...t};let DA=!1,jA=0;const RA=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jA++,MA=PA.useId||function(){const[t,n]=e.useState(()=>DA?RA():void 0);return lT(()=>{null==t&&n(RA())},[]),e.useEffect(()=>{DA=!0},[]),t},LA=e.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:a}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:d,stroke:p,d:f,style:{transform:m,...h}={},...v}=t,y=MA(),[g,b]=e.useState(!1);if(lT(()=>{o&&"rtl"===IT(o).direction&&b(!0)},[o]),!o)return null;const[w,S]=r.split("-"),x="top"===w||"bottom"===w;let k=d;(x&&null!=a&&a.x||!x&&null!=a&&a.y)&&(k=null);const O=2*c,_=O/2,E=s/2*(u/-8+1),C=l/2*u/4,I=!!f,T=k&&"end"===S?"bottom":"top";let A=k&&"end"===S?"right":"left";k&&g&&(A="end"===S?"left":"right");const P=null!=(null==i?void 0:i.x)?k||i.x:"",D=null!=(null==i?void 0:i.y)?k||i.y:"",j=f||"M0,0 H"+s+" L"+(s-E)+","+(l-C)+" Q"+s/2+","+l+" "+E+","+(l-C)+" Z",R={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,Iy.jsxs)("svg",{...v,"aria-hidden":!0,ref:n,width:I?s:s+O,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[A]:P,[T]:D,[w]:x||I?"100%":"calc(100% - "+O/2+"px)",transform:[R,m].filter(e=>!!e).join(" "),...h},children:[O>0&&(0,Iy.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:O+(f?0:1),d:j}),(0,Iy.jsx)("path",{stroke:O&&!f?v.fill:"none",d:j}),(0,Iy.jsx)("clipPath",{id:y,children:(0,Iy.jsx)("rect",{x:-_,y:_*(I?-1:1),width:s+O,height:s})})]})});const NA=e.createContext(null),FA=e.createContext(null);function VA(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=MA(),a=e.useRef({}),[s]=e.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}()),l=null!=((null==(u=e.useContext(NA))?void 0:u.id)||null);var u;const[c,d]=e.useState(o.reference),p=function(t){const n=e.useRef(()=>{});return uT(()=>{n.current=t}),e.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)},[])}((e,t,n)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:n,nested:l}),null==r||r(e,t,n)}),f=e.useMemo(()=>({setPositionReference:d}),[]),m=e.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return e.useMemo(()=>({dataRef:a,open:n,onOpenChange:p,elements:m,events:s,floatingId:i,refs:f}),[n,p,m,s,i,f])}function BA(t){void 0===t&&(t={});const{nodeId:n}=t,r=VA({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[a,s]=e.useState(null),[l,u]=e.useState(null),c=(null==i?void 0:i.domReference)||a,d=e.useRef(null),p=e.useContext(FA);lT(()=>{c&&(d.current=c)},[c]);const f=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,m]=e.useState(o);OA(f,o)||m(o);const[h,v]=e.useState(null),[y,g]=e.useState(null),b=e.useCallback(e=>{e!==k.current&&(k.current=e,v(e))},[]),w=e.useCallback(e=>{e!==O.current&&(O.current=e,g(e))},[]),S=a||h,x=s||y,k=e.useRef(null),O=e.useRef(null),_=e.useRef(d),E=null!=u,C=CA(u),I=CA(i),T=CA(c),A=e.useCallback(()=>{if(!k.current||!O.current)return;const e={placement:n,strategy:r,middleware:f};I.current&&(e.platform=I.current),xA(k.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};P.current&&!OA(_.current,t)&&(_.current=t,Hb.flushSync(()=>{p(t)}))})},[f,n,r,I,T]);kA(()=>{!1===c&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[c]);const P=e.useRef(!1);kA(()=>(P.current=!0,()=>{P.current=!1}),[]),kA(()=>{if(S&&(k.current=S),x&&(O.current=x),S&&x){if(C.current)return C.current(S,x,A);A()}},[S,x,A,C,E]);const D=e.useMemo(()=>({reference:k,floating:O,setReference:b,setFloating:w}),[b,w]),j=e.useMemo(()=>({reference:S,floating:x}),[S,x]),R=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!j.floating)return e;const t=EA(j.floating,d.x),n=EA(j.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",..._A(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,j.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:A,refs:D,elements:j,floatingStyles:R}),[d,A,D,j,R])}({...t,elements:{...i,...l&&{reference:l}}}),m=e.useCallback(e=>{const t=hT(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),f.refs.setReference(t)},[f.refs]),h=e.useCallback(e=>{(hT(e)||null===e)&&(d.current=e,s(e)),(hT(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!hT(e))&&f.refs.setReference(e)},[f.refs]),v=e.useMemo(()=>({...f.refs,setReference:h,setPositionReference:m,domReference:d}),[f.refs,h,m]),y=e.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),g=e.useMemo(()=>({...f,...o,refs:v,elements:y,nodeId:n}),[f,v,y,n,o]);return lT(()=>{o.dataRef.current.floatingContext=g;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===n);e&&(e.context=g)}),e.useMemo(()=>({...f,context:g,refs:v,elements:y}),[f,v,y,g])}var qA=function(e,t){return qA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},qA(e,t)};function QA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}qA(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var zA=function(){return zA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zA.apply(this,arguments)};function $A(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var UA,WA=function(e){var t=e.showTimeSelectOnly,r=void 0!==t&&t,o=e.showTime,i=void 0!==o&&o,a=e.className,s=e.children,l=e.inline,u=r?"Choose Time":"Choose Date".concat(i?" and Time":"");return n().createElement("div",{className:a,"aria-label":u,role:l?void 0:"dialog","aria-modal":l?void 0:"true"},s)},HA=function(t){var r=t.children,o=t.onClickOutside,i=t.className,a=t.containerRef,s=t.style,l=function(t,n){var r=(0,e.useRef)(null),o=(0,e.useRef)(t);(0,e.useEffect)(function(){o.current=t},[t]);var i=(0,e.useCallback)(function(e){var t,i=e.composed&&e.composedPath&&e.composedPath().find(function(e){return e instanceof Node})||e.target;r.current&&!r.current.contains(i)&&(n&&i instanceof HTMLElement&&i.classList.contains(n)||null===(t=o.current)||void 0===t||t.call(o,e))},[n]);return(0,e.useEffect)(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),r}(o,t.ignoreClass);return n().createElement("div",{className:i,style:s,ref:function(e){l.current=e,a&&(a.current=e)}},r)};function GA(){return"undefined"!=typeof window?window:globalThis}function YA(e){if(null==e)return new Date;var t="string"==typeof e?function(e,t){const n=()=>Ko(t?.in,NaN),r=t?.additionalDigits??2,o=function(e){const t={},n=e.split(mI.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],mI.timeZoneDelimiter.test(t.date)&&(t.date=e.split(mI.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const e=mI.timezone.exec(r);e?(t.time=r.replace(e[1],""),t.timezone=e[1]):t.time=r}return t}(e);let i;if(o.date){const e=function(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(o.date,r);i=function(e,t){if(null===t)return new Date(NaN);const n=e.match(hI);if(!n)return new Date(NaN);const r=!!n[4],o=gI(n[1]),i=gI(n[2])-1,a=gI(n[3]),s=gI(n[4]),l=gI(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}(t,s,l):new Date(NaN);{const e=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(wI[t]||(SI(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(SI(e)?366:365)}(t,o)?(e.setUTCFullYear(t,i,Math.max(o,a)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!i||isNaN(+i))return n();const a=+i;let s,l=0;if(o.time&&(l=function(e){const t=e.match(vI);if(!t)return NaN;const n=bI(t[1]),r=bI(t[2]),o=bI(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*Go+r*Ho+1e3*o:NaN}(o.time),isNaN(l)))return n();if(!o.timezone){const e=new Date(a+l),n=Xo(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return s=function(e){if("Z"===e)return 0;const t=e.match(yI);if(!t)return 0;const n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*Go+o*Ho):NaN}(o.timezone),isNaN(s)?n():Xo(a+l+s,t?.in)}(e):Xo(e);return XA(t)?t:new Date}function KA(e,t,n,r,o){void 0===o&&(o=YA());for(var i=hP(n)||hP(mP()),a=0,s=Array.isArray(t)?t:[t];a<s.length;a++){var l=s[a],u=xa(e,l,o,{locale:i,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});if(XA(u)&&(!r||e===ZA(u,l,n)))return u}return null}function XA(e,t){return Zo(e)&&!xI(e,new Date("1/1/1800"))}function ZA(e,t,n){if("en"===n)return Va(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?hP(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),Va(e,t,{locale:r=r||hP(mP()),useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function JA(e,t){var n=t.dateFormat,r=t.locale,o=Array.isArray(n)&&n.length>0?n[0]:n;return e&&ZA(e,o,r)||""}function eP(e,t){var n=t.hour,r=void 0===n?0:n,o=t.minute,i=void 0===o?0:o,a=t.second;return kI(OI(_I(e,void 0===a?0:a),i),r)}function tP(e){return _a(e)}function nP(e,t,n){return ra(e,{locale:hP(t||mP()),weekStartsOn:n})}function rP(e){return EI(e)}function oP(e){return Ca(e)}function iP(e){return CI(e)}function aP(){return _a(YA())}function sP(e){return II(e)}function lP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t):!e&&!t}function uP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t):!e&&!t}function cP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return+CI(r)===+CI(o)}(e,t):!e&&!t}function dP(e,t){return e&&t?function(e,t,n){const[r,o]=Oa(n?.in,e,t);return+_a(r)===+_a(o)}(e,t):!e&&!t}function pP(e,t){return e&&t?(n=t,+Xo(e)===+Xo(n)):!e&&!t;var n}function fP(e,t,n){var r,o=_a(t),i=II(n);try{r=AI(e,{start:o,end:i})}catch(e){r=!1}return r}function mP(){return GA().__localeId__}function hP(e){if("string"==typeof e){var t=GA();return t.__localeData__?t.__localeData__[e]:void 0}return e}function vP(e,t){return ZA(PI(YA(),e),"LLLL",t)}function yP(e,t){return ZA(PI(YA(),e),"LLL",t)}function gP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,u=n.filterDate;return!!n.disabled||CP(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return t instanceof Date?dP(e,t):dP(e,t.date)})||a&&a.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})})||s&&!s.some(function(t){return dP(e,t)})||l&&!l.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})})||u&&!u(YA(e))||!1}function bP(e,t){var n=void 0===t?{}:t,r=n.excludeDates,o=n.excludeDateIntervals;return o&&o.length>0?o.some(function(t){var n=t.start,r=t.end;return AI(e,{start:n,end:r})}):r&&r.some(function(t){var n;return t instanceof Date?dP(e,t):dP(e,null!==(n=t.date)&&void 0!==n?n:new Date)})||!1}function wP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return CP(e,{minDate:r?EI(r):void 0,maxDate:o?TI(o):void 0})||(null==i?void 0:i.some(function(t){return uP(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return uP(e,t)})||s&&!s(YA(e))||!1}function SP(e,t,n,r){var o=jI(e),i=RI(e),a=jI(t),s=RI(t),l=jI(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function xP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates;return CP(e,{minDate:r,maxDate:o})||i&&i.some(function(t){return uP(t instanceof Date?t:t.date,e)})||a&&!a.some(function(t){return uP(t,e)})||!1}function kP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;return!!n.disabled||CP(e,{minDate:r,maxDate:o})||(null==i?void 0:i.some(function(t){return cP(e,t instanceof Date?t:t.date)}))||a&&!a.some(function(t){return cP(e,t)})||s&&!s(YA(e))||!1}function OP(e,t,n){if(!t||!n)return!1;if(!Zo(t)||!Zo(n))return!1;var r=jI(t),o=jI(n);return r<=e&&o>=e}function _P(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.maxDate,i=n.excludeDates,a=n.includeDates,s=n.filterDate;if(n.disabled)return!0;var l=new Date(e,0,1);return CP(l,{minDate:r?Ca(r):void 0,maxDate:o?MI(o):void 0})||(null==i?void 0:i.some(function(e){return lP(l,e instanceof Date?e:e.date)}))||a&&!a.some(function(e){return lP(l,e)})||s&&!s(YA(l))||!1}function EP(e,t,n,r){var o=jI(e),i=LI(e),a=jI(t),s=LI(t),l=jI(r);return o===a&&o===l?i<=n&&n<=s:o<a&&(l===o&&i<=n||l===a&&s>=n||l<a&&l>o)}function CP(e,t){var n,r=void 0===t?{}:t,o=r.minDate,i=r.maxDate;return null!==(n=o&&Ea(e,o)<0||i&&Ea(e,i)>0)&&void 0!==n&&n}function IP(e,t){return t.some(function(t){return NI(t)===NI(e)&&FI(t)===FI(e)&&VI(t)===VI(e)})}function TP(e,t){var n=void 0===t?{}:t,r=n.excludeTimes,o=n.includeTimes,i=n.filterTime;return r&&IP(e,r)||o&&!IP(e,o)||i&&!i(e)||!1}function AP(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var o=YA();o=_I(o=OI(o=kI(o,NI(e)),FI(e)),VI(e));var i=YA();i=_I(i=OI(i=kI(i,NI(n)),FI(n)),VI(n));var a,s=YA();s=_I(s=OI(s=kI(s,NI(r)),FI(r)),VI(r));try{a=!AI(o,{start:i,end:s})}catch(e){a=!1}return a}function PP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=qI(e,1);return r&&QI(r,i)>0||o&&o.every(function(e){return QI(e,i)>0})||!1}function DP(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=BI(e,1);return r&&QI(i,r)>0||o&&o.every(function(e){return QI(i,e)>0})||!1}function jP(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=HI(e,1);return r&&GI(r,i)>0||o&&o.every(function(e){return GI(e,i)>0})||!1}function RP(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=WI(e,1);return r&&GI(i,r)>0||o&&o.every(function(e){return GI(i,e)>0})||!1}function MP(e){var t=e.minDate,n=e.includeDates;return n&&t?YI(n.filter(function(e){return Ea(e,t)>=0})):n?YI(n):t}function LP(e){var t=e.maxDate,n=e.includeDates;return n&&t?KI(n.filter(function(e){return Ea(e,t)<=0})):n?KI(n):t}function NP(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--highlighted");for(var r=new Map,o=0,i=e.length;o<i;o++){var a=e[o];if(Uo(a)){var s=ZA(a,"MM.dd.yyyy");(p=r.get(s)||[]).includes(t)||(p.push(t),r.set(s,p))}else if("object"==typeof a){var l=null!==(n=Object.keys(a)[0])&&void 0!==n?n:"",u=a[l];if("string"==typeof l&&Array.isArray(u))for(var c=0,d=u.length;c<d;c++){var p,f=u[c];if(f)s=ZA(f,"MM.dd.yyyy"),(p=r.get(s)||[]).includes(l)||(p.push(l),r.set(s,p))}}}return r}function FP(e,t){void 0===e&&(e=[]),void 0===t&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(e){var r=e.date,o=e.holidayName;if(Uo(r)){var i=ZA(r,"MM.dd.yyyy"),a=n.get(i)||{className:"",holidayNames:[]};if(!("className"in a)||a.className!==t||(s=a.holidayNames,l=[o],s.length!==l.length||!s.every(function(e,t){return e===l[t]}))){var s,l;a.className=t;var u=a.holidayNames;a.holidayNames=u?$A($A([],u,!0),[o],!1):[o],n.set(i,a)}}}),n}function VP(e,t,n,r,o){for(var i=o.length,a=[],s=0;s<i;s++){var l=e,u=o[s];u&&(l=eT(l=JI(l=ZI(l,NI(u)),FI(u)),VI(u)));var c=JI(e,(n+1)*r);tT(l,t)&&xI(l,c)&&null!=u&&a.push(u)}return a}function BP(e){return e<10?"0".concat(e):"".concat(e)}function qP(e,t){void 0===t&&(t=12);var n=Math.ceil(jI(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function QP(e){var t=e.getSeconds(),n=e.getMilliseconds();return Xo(e.getTime()-1e3*t-n)}function zP(e,t){return QP(e).getTime()===QP(t).getTime()}function $P(e){if(!Uo(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function UP(e,t){if(!Uo(e)||!Uo(t))throw new Error("Invalid date received");return xI($P(e),$P(t))}function WP(e){return e.key===UA.Space}!function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"}(UA||(UA={}));var HP,GP=function(t){function r(r){var o=t.call(this,r)||this;return o.inputRef=n().createRef(),o.onTimeChange=function(e){var t,n;o.setState({time:e});var r=o.props.date,i=r instanceof Date&&!isNaN(+r)?r:new Date;if(null==e?void 0:e.includes(":")){var a=e.split(":"),s=a[0],l=a[1];i.setHours(Number(s)),i.setMinutes(Number(l))}null===(n=(t=o.props).onChange)||void 0===n||n.call(t,i)},o.renderTimeInput=function(){var t=o.state.time,r=o.props,i=r.date,a=r.timeString,s=r.customTimeInput;return s?(0,e.cloneElement)(s,{date:i,value:t,onChange:o.onTimeChange}):n().createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:o.inputRef,onClick:function(){var e;null===(e=o.inputRef.current)||void 0===e||e.focus()},required:!0,value:t,onChange:function(e){o.onTimeChange(e.target.value||a)}})},o.state={time:o.props.timeString},o}return QA(r,t),r.getDerivedStateFromProps=function(e,t){return e.timeString!==t.time?{time:e.timeString}:null},r.prototype.render=function(){return n().createElement("div",{className:"react-datepicker__input-time-container"},n().createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),n().createElement("div",{className:"react-datepicker-time__input-container"},n().createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},r}(e.Component),YP=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.dayEl=(0,e.createRef)(),r.handleClick=function(e){!r.isDisabled()&&r.props.onClick&&r.props.onClick(e)},r.handleMouseEnter=function(e){!r.isDisabled()&&r.props.onMouseEnter&&r.props.onMouseEnter(e)},r.handleOnKeyDown=function(e){var t,n;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),null===(n=(t=r.props).handleOnKeyDown)||void 0===n||n.call(t,e)},r.isSameDay=function(e){return dP(r.props.day,e)},r.isKeyboardSelected=function(){var e;if(r.props.disabledKeyboardNavigation)return!1;var t=r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected),n=r.props.preSelection&&r.isDisabled(r.props.preSelection);return!t&&r.isSameDayOrWeek(r.props.preSelection)&&!n},r.isDisabled=function(e){return void 0===e&&(e=r.props.day),gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate,disabled:r.props.disabled})},r.isExcluded=function(){return bP(r.props.day,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.isStartOfWeek=function(){return dP(r.props.day,nP(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameWeek=function(e){return r.props.showWeekPicker&&dP(e,nP(r.props.day,r.props.locale,r.props.calendarStartDay))},r.isSameDayOrWeek=function(e){return r.isSameDay(e)||r.isSameWeek(e)},r.getHighLightedClass=function(){var e=r.props,t=e.day,n=e.highlightDates;if(!n)return!1;var o=ZA(t,"MM.dd.yyyy");return n.get(o)},r.getHolidaysClass=function(){var e,t=r.props,n=t.day,o=t.holidays;if(!o)return[void 0];var i=ZA(n,"MM.dd.yyyy");return o.has(i)?[null===(e=o.get(i))||void 0===e?void 0:e.className]:[void 0]},r.isInRange=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&fP(t,n,o)},r.isInSelectingRange=function(){var e,t=r.props,n=t.day,o=t.selectsStart,i=t.selectsEnd,a=t.selectsRange,s=t.selectsDisabledDaysInRange,l=t.startDate,u=t.swapRange,c=t.endDate,d=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;if(!(o||i||a)||!d||!s&&r.isDisabled())return!1;if(o&&c&&(xI(d,c)||pP(d,c)))return fP(n,d,c);if(i&&l&&(tT(d,l)||pP(d,l)))return fP(n,l,d);if(a&&l&&!c){if(pP(d,l))return fP(n,l,d);if(tT(d,l))return fP(n,l,d);if(u&&xI(d,l))return fP(n,d,l)}return!1},r.isSelectingRangeStart=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.startDate,i=t.selectsStart,a=t.swapRange,s=t.selectsRange,l=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return dP(n,i||s&&a&&o&&l&&xI(l,o)?l:o)},r.isSelectingRangeEnd=function(){var e;if(!r.isInSelectingRange())return!1;var t=r.props,n=t.day,o=t.endDate,i=t.selectsEnd,a=t.selectsRange,s=t.swapRange,l=t.startDate,u=null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection;return dP(n,i?u:a&&s&&l&&u?xI(u,l)?l:u:a?u:o)},r.isRangeStart=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&dP(n,t)},r.isRangeEnd=function(){var e=r.props,t=e.day,n=e.startDate,o=e.endDate;return!(!n||!o)&&dP(o,t)},r.isWeekend=function(){var e,t=Xo(r.props.day,e?.in).getDay();return 0===t||6===t},r.isAfterMonth=function(){return void 0!==r.props.month&&(r.props.month+1)%12===RI(r.props.day)},r.isBeforeMonth=function(){return void 0!==r.props.month&&(RI(r.props.day)+1)%12===r.props.month},r.isCurrentDay=function(){return r.isSameDay(YA())},r.isSelected=function(){var e;return r.props.selectsMultiple?null===(e=r.props.selectedDates)||void 0===e?void 0:e.some(function(e){return r.isSameDayOrWeek(e)}):r.isSameDayOrWeek(r.props.selected)},r.getClassNames=function(e){return Mp("react-datepicker__day",r.props.dayClassName?r.props.dayClassName(e):void 0,"react-datepicker__day--"+ZA(r.props.day,"ddd",void 0),{"react-datepicker__day--disabled":r.isDisabled(),"react-datepicker__day--excluded":r.isExcluded(),"react-datepicker__day--selected":r.isSelected(),"react-datepicker__day--keyboard-selected":r.isKeyboardSelected(),"react-datepicker__day--range-start":r.isRangeStart(),"react-datepicker__day--range-end":r.isRangeEnd(),"react-datepicker__day--in-range":r.isInRange(),"react-datepicker__day--in-selecting-range":r.isInSelectingRange(),"react-datepicker__day--selecting-range-start":r.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":r.isSelectingRangeEnd(),"react-datepicker__day--today":r.isCurrentDay(),"react-datepicker__day--weekend":r.isWeekend(),"react-datepicker__day--outside-month":r.isAfterMonth()||r.isBeforeMonth()},r.getHighLightedClass(),r.getHolidaysClass())},r.getAriaLabel=function(){var e=r.props,t=e.day,n=e.ariaLabelPrefixWhenEnabled,o=void 0===n?"Choose":n,i=e.ariaLabelPrefixWhenDisabled,a=void 0===i?"Not available":i,s=r.isDisabled()||r.isExcluded()?a:o;return"".concat(s," ").concat(ZA(t,"PPPP",r.props.locale))},r.getTitle=function(){var e=r.props,t=e.day,n=e.holidays,o=void 0===n?new Map:n,i=e.excludeDates,a=ZA(t,"MM.dd.yyyy"),s=[];return o.has(a)&&s.push.apply(s,o.get(a).holidayNames),r.isExcluded()&&s.push(null==i?void 0:i.filter(function(e){return e instanceof Date?dP(e,t):dP(null==e?void 0:e.date,t)}).map(function(e){if(!(e instanceof Date))return null==e?void 0:e.message})),s.join(", ")},r.getTabIndex=function(){var e=r.props.selected,t=r.props.preSelection;return(!r.props.showWeekPicker||!r.props.showWeekNumber&&r.isStartOfWeek())&&(r.isKeyboardSelected()||r.isSameDay(e)&&dP(t,e))?0:-1},r.handleFocusDay=function(){var e;r.shouldFocusDay()&&(null===(e=r.dayEl.current)||void 0===e||e.focus({preventScroll:!0}))},r.renderDayContents=function(){return r.props.monthShowsDuplicateDaysEnd&&r.isAfterMonth()||r.props.monthShowsDuplicateDaysStart&&r.isBeforeMonth()?null:r.props.renderDayContents?r.props.renderDayContents(nT(r.props.day),r.props.day):nT(r.props.day)},r.render=function(){return n().createElement("div",{ref:r.dayEl,className:r.getClassNames(r.props.day),onKeyDown:r.handleOnKeyDown,onClick:r.handleClick,onMouseEnter:r.props.usePointerEvent?void 0:r.handleMouseEnter,onPointerEnter:r.props.usePointerEvent?r.handleMouseEnter:void 0,tabIndex:r.getTabIndex(),"aria-label":r.getAriaLabel(),role:"gridcell",title:r.getTitle(),"aria-disabled":r.isDisabled(),"aria-current":r.isCurrentDay()?"date":void 0,"aria-selected":r.isSelected()||r.isInRange()},r.renderDayContents(),""!==r.getTitle()&&n().createElement("span",{className:"overlay"},r.getTitle()))},r}return QA(r,t),r.prototype.componentDidMount=function(){this.handleFocusDay()},r.prototype.componentDidUpdate=function(){this.handleFocusDay()},r.prototype.shouldFocusDay=function(){var e=!1;return 0===this.getTabIndex()&&this.isSameDay(this.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(e=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(e=!1),this.isDayActiveElement()&&(e=!0),this.isDuplicateDay()&&(e=!1)),e},r.prototype.isDayActiveElement=function(){var e,t,n;return(null===(t=null===(e=this.props.containerRef)||void 0===e?void 0:e.current)||void 0===t?void 0:t.contains(document.activeElement))&&(null===(n=document.activeElement)||void 0===n?void 0:n.classList.contains("react-datepicker__day"))},r.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},r}(e.Component),KP=function(t){function r(){var n=null!==t&&t.apply(this,arguments)||this;return n.weekNumberEl=(0,e.createRef)(),n.handleClick=function(e){n.props.onClick&&n.props.onClick(e)},n.handleOnKeyDown=function(e){var t,r;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),null===(r=(t=n.props).handleOnKeyDown)||void 0===r||r.call(t,e)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!dP(n.props.date,n.props.selected)&&dP(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||dP(n.props.date,n.props.selected)&&dP(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(e){var t=!1;0===n.getTabIndex()&&!(null==e?void 0:e.isInputFocused)&&dP(n.props.date,n.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(t=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(t=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(t=!0)),t&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},r.prototype.componentDidUpdate=function(e){this.handleFocusWeekNumber(e)},r.prototype.render=function(){var e=this.props,t=e.weekNumber,o=e.isWeekDisabled,i=e.ariaLabelPrefix,a=void 0===i?r.defaultProps.ariaLabelPrefix:i,s=e.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!o,"react-datepicker__week-number--selected":!!s&&dP(this.props.date,this.props.selected)};return n().createElement("div",{ref:this.weekNumberEl,className:Mp(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},t)},r}(e.Component),XP=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.handleDayClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleDayMouseEnter=function(e){r.props.onDayMouseEnter&&r.props.onDayMouseEnter(e)},r.handleWeekClick=function(e,n,o){for(var i,a,s,l=new Date(e),u=0;u<7;u++){var c=new Date(e);if(c.setDate(c.getDate()+u),!r.isDisabled(c)){l=c;break}}"function"==typeof r.props.onWeekSelect&&r.props.onWeekSelect(l,n,o),r.props.showWeekPicker&&r.handleDayClick(l,o),(null!==(i=r.props.shouldCloseOnSelect)&&void 0!==i?i:t.defaultProps.shouldCloseOnSelect)&&(null===(s=(a=r.props).setOpen)||void 0===s||s.call(a,!1))},r.formatWeekNumber=function(e){return r.props.formatWeekNumber?r.props.formatWeekNumber(e):function(e){return la(e)}(e)},r.isWeekDisabled=function(){for(var e=r.startOfWeek(),t=da(e,6),n=new Date(e);n<=t;){if(!r.isDisabled(n))return!1;n=da(n,1)}return!0},r.renderDays=function(){var e=r.startOfWeek(),o=[],i=r.formatWeekNumber(e);if(r.props.showWeekNumber){var a=r.props.onWeekSelect||r.props.showWeekPicker?r.handleWeekClick.bind(r,e,i):void 0;o.push(n().createElement(KP,zA({key:"W"},t.defaultProps,r.props,{weekNumber:i,isWeekDisabled:r.isWeekDisabled(),date:e,onClick:a})))}return o.concat([0,1,2,3,4,5,6].map(function(o){var i=da(e,o);return n().createElement(YP,zA({},t.defaultProps,r.props,{ariaLabelPrefixWhenEnabled:r.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:r.props.disabledDayAriaLabelPrefix,key:i.valueOf(),day:i,onClick:r.handleDayClick.bind(r,i),onMouseEnter:r.handleDayMouseEnter.bind(r,i)}))}))},r.startOfWeek=function(){return nP(r.props.day,r.props.locale,r.props.calendarStartDay)},r.isKeyboardSelected=function(){return!r.props.disabledKeyboardNavigation&&!dP(r.startOfWeek(),r.props.selected)&&dP(r.startOfWeek(),r.props.preSelection)},r}return QA(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e={"react-datepicker__week":!0,"react-datepicker__week--selected":dP(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},t=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return n().createElement("div",{className:Mp(e,t),role:"row"},this.renderDays())},t}(e.Component),ZP="two_columns",JP="three_columns",eD="four_columns",tD=((HP={})[ZP]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},HP[JP]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},HP[eD]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},HP);function nD(e,t){return e?eD:t?ZP:JP}var rD=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.MONTH_REFS=$A([],Array(12),!0).map(function(){return(0,e.createRef)()}),r.QUARTER_REFS=$A([],Array(4),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals,includeDateIntervals:r.props.includeDateIntervals,includeDates:r.props.includeDates,filterDate:r.props.filterDate,disabled:r.props.disabled})},r.isExcluded=function(e){return bP(e,{excludeDates:r.props.excludeDates,excludeDateIntervals:r.props.excludeDateIntervals})},r.handleDayClick=function(e,t){var n,o;null===(o=(n=r.props).onDayClick)||void 0===o||o.call(n,e,t,r.props.orderInDisplay)},r.handleDayMouseEnter=function(e){var t,n;null===(n=(t=r.props).onDayMouseEnter)||void 0===n||n.call(t,e)},r.handleMouseLeave=function(){var e,t;null===(t=(e=r.props).onMouseLeave)||void 0===t||t.call(e)},r.isRangeStartMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&uP(PI(n,e),o)},r.isRangeStartQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&cP(DI(n,e),o)},r.isRangeEndMonth=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&uP(PI(n,e),i)},r.isRangeEndQuarter=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate;return!(!o||!i)&&cP(DI(n,e),i)},r.isInSelectingRangeMonth=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?SP(c,u,e,o):(a&&l||!(!s||!l||u))&&SP(l,c,e,o))},r.isSelectingMonthRangeStart=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.startDate,a=n.selectsStart,s=PI(o,e),l=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return uP(s,a?l:i)},r.isSelectingMonthRangeEnd=function(e){var t;if(!r.isInSelectingRangeMonth(e))return!1;var n=r.props,o=n.day,i=n.endDate,a=n.selectsEnd,s=n.selectsRange,l=PI(o,e),u=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return uP(l,a||s?u:i)},r.isInSelectingRangeQuarter=function(e){var t,n=r.props,o=n.day,i=n.selectsStart,a=n.selectsEnd,s=n.selectsRange,l=n.startDate,u=n.endDate,c=null!==(t=r.props.selectingDate)&&void 0!==t?t:r.props.preSelection;return!(!(i||a||s)||!c)&&(i&&u?EP(c,u,e,o):(a&&l||!(!s||!l||u))&&EP(l,c,e,o))},r.isWeekInMonth=function(e){var t=r.props.day,n=da(e,6);return uP(e,t)||uP(n,t)},r.isCurrentMonth=function(e,t){return jI(e)===jI(YA())&&t===RI(YA())},r.isCurrentQuarter=function(e,t){return jI(e)===jI(YA())&&t===LI(YA())},r.isSelectedMonth=function(e,t,n){return RI(n)===t&&jI(e)===jI(n)},r.isSelectMonthInList=function(e,t,n){return n.some(function(n){return r.isSelectedMonth(e,t,n)})},r.isSelectedQuarter=function(e,t,n){return LI(n)===t&&jI(e)===jI(n)},r.isSelectQuarterInList=function(e,t,n){return n.some(function(n){return r.isSelectedQuarter(e,t,n)})},r.isMonthSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=RI(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedMonth(t,a,e)}):!!n&&r.isSelectedMonth(t,a,n)},r.isQuarterSelected=function(){var e=r.props,t=e.day,n=e.selected,o=e.selectedDates,i=e.selectsMultiple,a=LI(t);return i?null==o?void 0:o.some(function(e){return r.isSelectedQuarter(t,a,e)}):!!n&&r.isSelectedQuarter(t,a,n)},r.renderWeeks=function(){if(!XA(r.props.day))return[];for(var e=[],t=r.props.fixedHeight,o=0,i=!1,a=nP(rP(r.props.day),r.props.locale,r.props.calendarStartDay),s=r.props.selected?function(e){return r.props.showWeekPicker?nP(e,r.props.locale,r.props.calendarStartDay):r.props.selected}(r.props.selected):void 0,l=r.props.preSelection?function(e){return r.props.showWeekPicker?nP(e,r.props.locale,r.props.calendarStartDay):r.props.preSelection}(r.props.preSelection):void 0;e.push(n().createElement(XP,zA({},r.props,{ariaLabelPrefix:r.props.weekAriaLabelPrefix,key:o,day:a,month:RI(r.props.day),onDayClick:r.handleDayClick,onDayMouseEnter:r.handleDayMouseEnter,selected:s,preSelection:l,showWeekNumber:r.props.showWeekNumbers}))),!i;){o++,a=rT(a,1);var u=t&&o>=6,c=!t&&!r.isWeekInMonth(a);if(u||c){if(!r.props.peekNextMonth)break;i=!0}}return e},r.onMonthClick=function(e,t){var n=r.isMonthDisabledForLabelDate(t),o=n.isDisabled,i=n.labelDate;o||r.handleDayClick(rP(i),e)},r.onMonthMouseEnter=function(e){var t=r.isMonthDisabledForLabelDate(e),n=t.isDisabled,o=t.labelDate;n||r.handleDayMouseEnter(rP(o))},r.handleMonthNavigation=function(e,t){var n,o,i,a;null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.MONTH_REFS[e])||void 0===i?void 0:i.current)||void 0===a||a.focus()},r.handleKeyboardNavigation=function(e,t,n){var o,i=r.props,a=i.selected,s=i.preSelection,l=i.setPreSelection,u=i.minDate,c=i.maxDate,d=i.showFourColumnMonthYearPicker,p=i.showTwoColumnMonthYearPicker;if(s){var f=nD(d,p),m=r.getVerticalOffset(f),h=null===(o=tD[f])||void 0===o?void 0:o.grid,v=function(e,t,n){var r,o,i=t,a=n;switch(e){case UA.ArrowRight:i=BI(t,1),a=11===n?0:n+1;break;case UA.ArrowLeft:i=qI(t,1),a=0===n?11:n-1;break;case UA.ArrowUp:i=qI(t,m),a=(null===(r=null==h?void 0:h[0])||void 0===r?void 0:r.includes(n))?n+12-m:n-m;break;case UA.ArrowDown:i=BI(t,m),a=(null===(o=null==h?void 0:h[h.length-1])||void 0===o?void 0:o.includes(n))?n-12+m:n+m}return{newCalculatedDate:i,newCalculatedMonth:a}};if(t!==UA.Enter){var y=function(e,t,n){for(var o=e,i=!1,a=0,s=v(o,t,n),l=s.newCalculatedDate,d=s.newCalculatedMonth;!i;){if(a>=40){l=t,d=n;break}var p;u&&l<u&&(o=UA.ArrowRight,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),c&&l>c&&(o=UA.ArrowLeft,l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth),xP(l,r.props)?(l=(p=v(o,l,d)).newCalculatedDate,d=p.newCalculatedMonth):i=!0,a++}return{newCalculatedDate:l,newCalculatedMonth:d}}(t,s,n),g=y.newCalculatedDate,b=y.newCalculatedMonth;switch(t){case UA.ArrowRight:case UA.ArrowLeft:case UA.ArrowUp:case UA.ArrowDown:r.handleMonthNavigation(b,g)}}else r.isMonthDisabled(n)||(r.onMonthClick(e,n),null==l||l(a))}},r.getVerticalOffset=function(e){var t,n;return null!==(n=null===(t=tD[e])||void 0===t?void 0:t.verticalNavigationOffset)&&void 0!==n?n:0},r.onMonthKeyDown=function(e,t){var n=r.props,o=n.disabledKeyboardNavigation,i=n.handleOnMonthKeyDown,a=e.key;a!==UA.Tab&&e.preventDefault(),o||r.handleKeyboardNavigation(e,a,t),i&&i(e)},r.onQuarterClick=function(e,t){var n=DI(r.props.day,t);kP(n,r.props)||r.handleDayClick(iP(n),e)},r.onQuarterMouseEnter=function(e){var t=DI(r.props.day,e);kP(t,r.props)||r.handleDayMouseEnter(iP(t))},r.handleQuarterNavigation=function(e,t){var n,o,i,a;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),null===(a=null===(i=r.QUARTER_REFS[e-1])||void 0===i?void 0:i.current)||void 0===a||a.focus())},r.onQuarterKeyDown=function(e,t){var n,o,i=e.key;if(!r.props.disabledKeyboardNavigation)switch(i){case UA.Enter:r.onQuarterClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case UA.ArrowRight:if(!r.props.preSelection)break;r.handleQuarterNavigation(4===t?1:t+1,zI(r.props.preSelection,1));break;case UA.ArrowLeft:if(!r.props.preSelection)break;r.handleQuarterNavigation(1===t?4:t-1,$I(r.props.preSelection,1))}},r.isMonthDisabledForLabelDate=function(e){var t,n=r.props,o=n.day,i=n.disabled,a=n.minDate,s=n.maxDate,l=n.excludeDates,u=n.includeDates,c=PI(o,e);return i?{isDisabled:!0,labelDate:PI(o,e)}:{isDisabled:null!==(t=(a||s||l||u)&&wP(c,r.props))&&void 0!==t&&t,labelDate:c}},r.isMonthDisabled=function(e){return r.isMonthDisabledForLabelDate(e).isDisabled},r.getMonthClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.preSelection,s=t.monthClassName,l=s?s(PI(n,e)):void 0,u=r.getSelection();return Mp("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":r.isMonthDisabled(e),"react-datepicker__month-text--selected":u?r.isSelectMonthInList(n,e,u):void 0,"react-datepicker__month-text--keyboard-selected":!r.props.disabledKeyboardNavigation&&a&&r.isSelectedMonth(n,e,a)&&!r.isMonthSelected()&&!r.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":r.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?SP(o,i,e,n):void 0,"react-datepicker__month-text--range-start":r.isRangeStartMonth(e),"react-datepicker__month-text--range-end":r.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":r.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":r.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":r.isCurrentMonth(n,e)})},r.getTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=RI(r.props.preSelection),n=r.isMonthDisabledForLabelDate(t).isDisabled;return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getQuarterTabIndex=function(e){if(null==r.props.preSelection)return"-1";var t=LI(r.props.preSelection),n=kP(r.props.day,r.props);return e!==t||n||r.props.disabledKeyboardNavigation?"-1":"0"},r.getAriaLabel=function(e){var t=r.props,n=t.chooseDayAriaLabelPrefix,o=void 0===n?"Choose":n,i=t.disabledDayAriaLabelPrefix,a=void 0===i?"Not available":i,s=t.day,l=t.locale,u=PI(s,e),c=r.isDisabled(u)||r.isExcluded(u)?a:o;return"".concat(c," ").concat(ZA(u,"MMMM yyyy",l))},r.getQuarterClassNames=function(e){var t=r.props,n=t.day,o=t.startDate,i=t.endDate,a=t.minDate,s=t.maxDate,l=t.excludeDates,u=t.includeDates,c=t.filterDate,d=t.preSelection,p=t.disabledKeyboardNavigation,f=t.disabled,m=(a||s||l||u||c||f)&&kP(DI(n,e),r.props),h=r.getSelection();return Mp("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":m,"react-datepicker__quarter-text--selected":h?r.isSelectQuarterInList(n,e,h):void 0,"react-datepicker__quarter-text--keyboard-selected":!p&&d&&r.isSelectedQuarter(n,e,d)&&!r.isQuarterSelected()&&!m,"react-datepicker__quarter-text--in-selecting-range":r.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?EP(o,i,e,n):void 0,"react-datepicker__quarter-text--range-start":r.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":r.isRangeEndQuarter(e),"react-datepicker__quarter-text--today":r.isCurrentQuarter(n,e)})},r.getMonthContent=function(e){var t=r.props,n=t.showFullMonthYearPicker,o=t.renderMonthContent,i=t.locale,a=t.day,s=yP(e,i),l=vP(e,i);return o?o(e,s,l,a):n?l:s},r.getQuarterContent=function(e){var t,n,o,i=r.props,a=i.renderQuarterContent,s=(n=e,o=i.locale,ZA(DI(YA(),n),"QQQ",o));return null!==(t=null==a?void 0:a(e,s))&&void 0!==t?t:s},r.renderMonths=function(){var e,t=r.props,o=t.showTwoColumnMonthYearPicker,i=t.showFourColumnMonthYearPicker,a=t.day,s=t.selected,l=null===(e=tD[nD(i,o)])||void 0===e?void 0:e.grid;return null==l?void 0:l.map(function(e,t){return n().createElement("div",{className:"react-datepicker__month-wrapper",key:t},e.map(function(e,t){return n().createElement("div",{ref:r.MONTH_REFS[e],key:t,onClick:function(t){r.onMonthClick(t,e)},onKeyDown:function(t){WP(t)&&(t.preventDefault(),t.key=UA.Enter),r.onMonthKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onMonthMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onMonthMouseEnter(e)}:void 0,tabIndex:Number(r.getTabIndex(e)),className:r.getMonthClassNames(e),"aria-disabled":r.isMonthDisabled(e),role:"option","aria-label":r.getAriaLabel(e),"aria-current":r.isCurrentMonth(a,e)?"date":void 0,"aria-selected":s?r.isSelectedMonth(a,e,s):void 0},r.getMonthContent(e))}))})},r.renderQuarters=function(){var e=r.props,t=e.day,o=e.selected;return n().createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(e,i){return n().createElement("div",{key:i,ref:r.QUARTER_REFS[i],role:"option",onClick:function(t){r.onQuarterClick(t,e)},onKeyDown:function(t){r.onQuarterKeyDown(t,e)},onMouseEnter:r.props.usePointerEvent?void 0:function(){return r.onQuarterMouseEnter(e)},onPointerEnter:r.props.usePointerEvent?function(){return r.onQuarterMouseEnter(e)}:void 0,className:r.getQuarterClassNames(e),"aria-selected":o?r.isSelectedQuarter(t,e,o):void 0,tabIndex:Number(r.getQuarterTabIndex(e)),"aria-current":r.isCurrentQuarter(t,e)?"date":void 0},r.getQuarterContent(e))}))},r.getClassNames=function(){var e=r.props,t=e.selectingDate,n=e.selectsStart,o=e.selectsEnd;return Mp("react-datepicker__month",{"react-datepicker__month--selecting-range":t&&(n||o)},{"react-datepicker__monthPicker":e.showMonthYearPicker},{"react-datepicker__quarterPicker":e.showQuarterYearPicker},{"react-datepicker__weekPicker":e.showWeekPicker})},r}return QA(r,t),r.prototype.getSelection=function(){var e=this.props,t=e.selected,n=e.selectedDates;return e.selectsMultiple?n:t?[t]:void 0},r.prototype.render=function(){var e=this.props,t=e.showMonthYearPicker,r=e.showQuarterYearPicker,o=e.day,i=e.ariaLabelPrefix,a=void 0===i?"Month ":i,s=a?a.trim()+" ":"",l=XA(o)?"".concat(s).concat(ZA(o,"MMMM, yyyy",this.props.locale)):"";return t||r?n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":l,role:"listbox"},t?this.renderMonths():this.renderQuarters()):n().createElement("div",{role:"table"},this.props.dayNamesHeader&&n().createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),n().createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":l,role:"rowgroup"},this.renderWeeks()))},r}(e.Component),oD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.monthOptionButtonsRef={},t.isSelectedMonth=function(e){return t.props.month===e},t.handleOptionKeyDown=function(e,n){var r;switch(n.key){case"Enter":n.preventDefault(),t.onChange(e);break;case"Escape":n.preventDefault(),t.props.onCancel();break;case"ArrowUp":case"ArrowDown":n.preventDefault();var o=(e+("ArrowUp"===n.key?-1:1)+t.props.monthNames.length)%t.props.monthNames.length;null===(r=t.monthOptionButtonsRef[o])||void 0===r||r.focus()}},t.renderOptions=function(){return t.monthOptionButtonsRef={},t.props.monthNames.map(function(e,r){return n().createElement("div",{ref:function(e){t.monthOptionButtonsRef[r]=e,t.isSelectedMonth(r)&&(null==e||e.focus())},role:"button",tabIndex:0,className:t.isSelectedMonth(r)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:e,onClick:t.onChange.bind(t,r),onKeyDown:t.handleOptionKeyDown.bind(t,r),"aria-selected":t.isSelectedMonth(r)?"true":void 0},t.isSelectedMonth(r)?n().createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return QA(t,e),t.prototype.render=function(){return n().createElement(HA,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),iD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(e,t){return n().createElement("option",{key:e,value:t},e)})},t.renderSelectMode=function(e){return n().createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(e){return t.onChange(parseInt(e.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,r){return n().createElement("button",{key:"read",type:"button",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-read-view--selected-month"},r[t.props.month]))},t.renderDropdown=function(e){return n().createElement(oD,zA({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,r=[t.renderReadView(!n,e)];return n&&r.unshift(t.renderDropdown(e)),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return QA(t,e),t.prototype.render=function(){var e,t=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(e){return yP(e,t.props.locale)}:function(e){return vP(e,t.props.locale)});switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode(r);break;case"select":e=this.renderSelectMode(r)}return n().createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component);function aD(e,t){for(var n=[],r=rP(e),o=rP(t);!tT(r,o);)n.push(YA(r)),r=BI(r,1);return n}var sD=function(e){function t(t){var r=e.call(this,t)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(e){var t=oT(e),o=lP(r.props.date,e)&&uP(r.props.date,e);return n().createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:t,onClick:r.onChange.bind(r,t),"aria-selected":o?"true":void 0},o?n().createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",ZA(e,r.props.dateFormat,r.props.locale))})},r.onChange=function(e){return r.props.onChange(e)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:aD(r.props.minDate,r.props.maxDate)},r}return QA(t,e),t.prototype.render=function(){var e=Mp({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return n().createElement(HA,{className:e,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(e.Component),lD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=rP(t.props.minDate),r=rP(t.props.maxDate),o=[];!tT(e,r);){var i=oT(e);o.push(n().createElement("option",{key:i,value:i},ZA(e,t.props.dateFormat,t.props.locale))),e=BI(e,1)}return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:oT(rP(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var r=ZA(t.props.date,t.props.dateFormat,t.props.locale);return n().createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},r))},t.renderDropdown=function(){return n().createElement(sD,zA({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=YA(e);lP(t.props.date,n)&&uP(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return QA(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),uD=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.state={height:null},r.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,o;r.list&&(r.list.scrollTop=null!==(o=r.centerLi&&t.calcCenterPosition(r.props.monthRef?r.props.monthRef.clientHeight-(null!==(n=null===(e=r.header)||void 0===e?void 0:e.clientHeight)&&void 0!==n?n:0):r.list.clientHeight,r.centerLi))&&void 0!==o?o:0)})},r.handleClick=function(e){var t,n;(r.props.minTime||r.props.maxTime)&&AP(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&TP(e,r.props)||null===(n=(t=r.props).onChange)||void 0===n||n.call(t,e)},r.isSelectedTime=function(e){return r.props.selected&&zP(r.props.selected,e)},r.isDisabledTime=function(e){return(r.props.minTime||r.props.maxTime)&&AP(e,r.props)||(r.props.excludeTimes||r.props.includeTimes||r.props.filterTime)&&TP(e,r.props)},r.liClasses=function(e){var n,o=["react-datepicker__time-list-item",r.props.timeClassName?r.props.timeClassName(e):void 0];return r.isSelectedTime(e)&&o.push("react-datepicker__time-list-item--selected"),r.isDisabledTime(e)&&o.push("react-datepicker__time-list-item--disabled"),r.props.injectTimes&&(3600*NI(e)+60*FI(e)+VI(e))%(60*(null!==(n=r.props.intervals)&&void 0!==n?n:t.defaultProps.intervals))!=0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},r.handleOnKeyDown=function(e,t){var n,o;e.key===UA.Space&&(e.preventDefault(),e.key=UA.Enter),(e.key===UA.ArrowUp||e.key===UA.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===UA.ArrowDown||e.key===UA.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===UA.Enter&&r.handleClick(t),null===(o=(n=r.props).handleOnKeyDown)||void 0===o||o.call(n,e)},r.renderTimes=function(){for(var e,o=[],i="string"==typeof r.props.format?r.props.format:"p",a=null!==(e=r.props.intervals)&&void 0!==e?e:t.defaultProps.intervals,s=r.props.selected||r.props.openToDate||YA(),l=tP(s),u=r.props.injectTimes&&r.props.injectTimes.sort(function(e,t){return e.getTime()-t.getTime()}),c=60*function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}(s),d=c/a,p=0;p<d;p++){var f=JI(l,p*a);if(o.push(f),u){var m=VP(l,f,p,a,u);o=o.concat(m)}}var h=o.reduce(function(e,t){return t.getTime()<=s.getTime()?t:e},o[0]);return o.map(function(e){return n().createElement("li",{key:e.valueOf(),onClick:r.handleClick.bind(r,e),className:r.liClasses(e),ref:function(t){e===h&&(r.centerLi=t)},onKeyDown:function(t){r.handleOnKeyDown(t,e)},tabIndex:e===h?0:-1,role:"option","aria-selected":r.isSelectedTime(e)?"true":void 0,"aria-disabled":r.isDisabledTime(e)?"true":void 0},ZA(e,i,r.props.locale))})},r.renderTimeCaption=function(){return!1===r.props.showTimeCaption?n().createElement(n().Fragment,null):n().createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(r.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(e){r.header=e}},n().createElement("div",{className:"react-datepicker-time__header"},r.props.timeCaption))},r}return QA(t,e),Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var e=this,t=this.props.monthRef;this.updateContainerHeight(),t&&(this.resizeObserver=new ResizeObserver(function(){e.updateContainerHeight()}),this.resizeObserver.observe(t))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var e,r=this,o=this.state.height;return n().createElement("div",{className:"react-datepicker__time-container ".concat((null!==(e=this.props.todayButton)&&void 0!==e?e:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),n().createElement("div",{className:"react-datepicker__time"},n().createElement("div",{className:"react-datepicker__time-box"},n().createElement("ul",{className:"react-datepicker__time-list",ref:function(e){r.list=e},style:o?{height:o}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(e,t){return t.offsetTop-(e/2-t.clientHeight/2)},t}(e.Component),cD=function(t){function r(n){var r=t.call(this,n)||this;return r.YEAR_REFS=$A([],Array(r.props.yearItemNumber),!0).map(function(){return(0,e.createRef)()}),r.isDisabled=function(e){return gP(e,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(e){return bP(e,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var e;return null!==(e=r.props.selectingDate)&&void 0!==e?e:r.props.preSelection},r.updateFocusOnPaginate=function(e){window.requestAnimationFrame(function(){var t,n;null===(n=null===(t=r.YEAR_REFS[e])||void 0===t?void 0:t.current)||void 0===n||n.focus()})},r.handleYearClick=function(e,t){r.props.onDayClick&&r.props.onDayClick(e,t)},r.handleYearNavigation=function(e,t){var n,o,i,a,s=r.props,l=s.date,u=s.yearItemNumber;if(void 0!==l&&void 0!==u){var c=qP(l,u).startPeriod;r.isDisabled(t)||r.isExcluded(t)||(null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,t),e-c<0?r.updateFocusOnPaginate(u-(c-e)):e-c>=u?r.updateFocusOnPaginate(Math.abs(u-(e-c))):null===(a=null===(i=r.YEAR_REFS[e-c])||void 0===i?void 0:i.current)||void 0===a||a.focus())}},r.isSameDay=function(e,t){return dP(e,t)},r.isCurrentYear=function(e){return e===jI(YA())},r.isRangeStart=function(e){return r.props.startDate&&r.props.endDate&&lP(iT(YA(),e),r.props.startDate)},r.isRangeEnd=function(e){return r.props.startDate&&r.props.endDate&&lP(iT(YA(),e),r.props.endDate)},r.isInRange=function(e){return OP(e,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(e){var t=r.props,n=t.selectsStart,o=t.selectsEnd,i=t.selectsRange,a=t.startDate,s=t.endDate;return!(!(n||o||i)||!r.selectingDate())&&(n&&s?OP(e,r.selectingDate(),s):(o&&a||!(!i||!a||s))&&OP(e,a,r.selectingDate()))},r.isSelectingRangeStart=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.startDate,i=n.selectsStart;return lP(iT(YA(),e),i?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isSelectingRangeEnd=function(e){var t;if(!r.isInSelectingRange(e))return!1;var n=r.props,o=n.endDate,i=n.selectsEnd,a=n.selectsRange;return lP(iT(YA(),e),i||a?null!==(t=r.selectingDate())&&void 0!==t?t:null:null!=o?o:null)},r.isKeyboardSelected=function(e){if(!r.props.disabledKeyboardNavigation&&void 0!==r.props.date&&null!=r.props.preSelection){var t=r.props,n=t.minDate,o=t.maxDate,i=t.excludeDates,a=t.includeDates,s=t.filterDate,l=t.selected,u=oP(iT(r.props.date,e)),c=(n||o||i||a||s)&&_P(e,r.props),d=!!l&&dP(u,oP(l)),p=dP(u,oP(r.props.preSelection));return!r.props.inline&&!d&&p&&!c}},r.isSelectedYear=function(e){var t=r.props,n=t.selectsMultiple,o=t.selected,i=t.selectedDates;return n?null==i?void 0:i.some(function(t){return e===jI(t)}):!!o&&e===jI(o)},r.onYearClick=function(e,t){var n=r.props.date;void 0!==n&&r.handleYearClick(oP(iT(n,t)),e)},r.onYearKeyDown=function(e,t){var n,o,i=e.key,a=r.props,s=a.date,l=a.yearItemNumber,u=a.handleOnKeyDown;if(i!==UA.Tab&&e.preventDefault(),!r.props.disabledKeyboardNavigation)switch(i){case UA.Enter:if(null==r.props.selected)break;r.onYearClick(e,t),null===(o=(n=r.props).setPreSelection)||void 0===o||o.call(n,r.props.selected);break;case UA.ArrowRight:if(null==r.props.preSelection)break;r.handleYearNavigation(t+1,WI(r.props.preSelection,1));break;case UA.ArrowLeft:if(null==r.props.preSelection)break;r.handleYearNavigation(t-1,HI(r.props.preSelection,1));break;case UA.ArrowUp:if(void 0===s||void 0===l||null==r.props.preSelection)break;var c=qP(s,l).startPeriod;if((f=t-(p=3))<c){var d=l%p;t>=c&&t<c+d?p=d:p+=d,f=t-p}r.handleYearNavigation(f,HI(r.props.preSelection,p));break;case UA.ArrowDown:if(void 0===s||void 0===l||null==r.props.preSelection)break;var p,f,m=qP(s,l).endPeriod;(f=t+(p=3))>m&&(d=l%p,t<=m&&t>m-d?p=d:p+=d,f=t+p),r.handleYearNavigation(f,WI(r.props.preSelection,p))}u&&u(e)},r.getYearClassNames=function(e){var t=r.props,n=t.date,o=t.disabled,i=t.minDate,a=t.maxDate,s=t.excludeDates,l=t.includeDates,u=t.filterDate,c=t.yearClassName;return Mp("react-datepicker__year-text","react-datepicker__year-".concat(e),n?null==c?void 0:c(iT(n,e)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(e),"react-datepicker__year-text--disabled":(i||a||s||l||u||o)&&_P(e,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(e),"react-datepicker__year-text--range-start":r.isRangeStart(e),"react-datepicker__year-text--range-end":r.isRangeEnd(e),"react-datepicker__year-text--in-range":r.isInRange(e),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(e),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(e),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(e),"react-datepicker__year-text--today":r.isCurrentYear(e)})},r.getYearTabIndex=function(e){if(r.props.disabledKeyboardNavigation||null==r.props.preSelection)return"-1";var t=jI(r.props.preSelection),n=_P(e,r.props);return e!==t||n?"-1":"0"},r.getYearContent=function(e){return r.props.renderYearContent?r.props.renderYearContent(e):e},r}return QA(r,t),r.prototype.render=function(){var e=this,t=[],r=this.props,o=r.date,i=r.yearItemNumber,a=r.onYearMouseEnter,s=r.onYearMouseLeave;if(void 0===o)return null;for(var l=qP(o,i),u=l.startPeriod,c=l.endPeriod,d=function(r){t.push(n().createElement("div",{ref:p.YEAR_REFS[r-u],onClick:function(t){e.onYearClick(t,r)},onKeyDown:function(t){WP(t)&&(t.preventDefault(),t.key=UA.Enter),e.onYearKeyDown(t,r)},tabIndex:Number(p.getYearTabIndex(r)),className:p.getYearClassNames(r),onMouseEnter:p.props.usePointerEvent?void 0:function(e){return a(e,r)},onPointerEnter:p.props.usePointerEvent?function(e){return a(e,r)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(e){return s(e,r)},onPointerLeave:p.props.usePointerEvent?function(e){return s(e,r)}:void 0,key:r,"aria-current":p.isCurrentYear(r)?"date":void 0},p.getYearContent(r)))},p=this,f=u;f<=c;f++)d(f);return n().createElement("div",{className:"react-datepicker__year"},n().createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},t))},r}(e.Component);function dD(e,t,n,r){for(var o=[],i=0;i<2*t+1;i++){var a=e+t-i,s=!0;n&&(s=jI(n)<=a),r&&s&&(s=jI(r)>=a),s&&o.push(a)}return o}var pD=function(t){function r(r){var o=t.call(this,r)||this;o.yearOptionButtonsRef={},o.handleOptionKeyDown=function(e,t){var n;switch(t.key){case"Enter":t.preventDefault(),o.onChange(e);break;case"Escape":t.preventDefault(),o.props.onCancel();break;case"ArrowUp":case"ArrowDown":t.preventDefault();var r=e+("ArrowUp"===t.key?1:-1);o.yearOptionButtonsRef[r]&&(null===(n=o.yearOptionButtonsRef[r])||void 0===n||n.focus())}},o.renderOptions=function(){o.yearOptionButtonsRef={};var e=o.props.year,t=o.state.yearsList.map(function(t){return n().createElement("div",{ref:function(n){o.yearOptionButtonsRef[t]=n,t===e&&(null==n||n.focus())},role:"button",tabIndex:0,className:e===t?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:t,onClick:o.onChange.bind(o,t),onKeyDown:o.handleOptionKeyDown.bind(o,t),"aria-selected":e===t?"true":void 0},e===t?n().createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",t)}),r=o.props.minDate?jI(o.props.minDate):null,i=o.props.maxDate?jI(o.props.maxDate):null;return i&&o.state.yearsList.find(function(e){return e===i})||t.unshift(n().createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:o.incrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),r&&o.state.yearsList.find(function(e){return e===r})||t.push(n().createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:o.decrementYears},n().createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),t},o.onChange=function(e){o.props.onChange(e)},o.handleClickOutside=function(){o.props.onCancel()},o.shiftYears=function(e){var t=o.state.yearsList.map(function(t){return t+e});o.setState({yearsList:t})},o.incrementYears=function(){return o.shiftYears(1)},o.decrementYears=function(){return o.shiftYears(-1)};var i=r.yearDropdownItemNumber,a=r.scrollableYearDropdown,s=i||(a?10:5);return o.state={yearsList:dD(o.props.year,s,o.props.minDate,o.props.maxDate)},o.dropdownRef=(0,e.createRef)(),o}return QA(r,t),r.prototype.componentDidMount=function(){var e=this.dropdownRef.current;if(e){var t=e.children?Array.from(e.children):null,n=t?t.find(function(e){return e.ariaSelected}):null;e.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-e.clientHeight)/2:(e.scrollHeight-e.clientHeight)/2}},r.prototype.render=function(){var e=Mp({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return n().createElement(HA,{className:e,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(e.Component),fD=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?jI(t.props.minDate):1900,r=t.props.maxDate?jI(t.props.maxDate):2100,o=[],i=e;i<=r;i++)o.push(n().createElement("option",{key:i,value:i},i));return o},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return n().createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return n().createElement("button",{key:"read",type:"button",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:t.toggleDropdown},n().createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),n().createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return n().createElement(pD,zA({key:"dropdown"},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var r;null===(r=t.onSelect)||void 0===r||r.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var r,o;null===(o=(r=t.props).onSelect)||void 0===o||o.call(r,e,n)},t.setOpen=function(){var e,n;null===(n=(e=t.props).setOpen)||void 0===n||n.call(e,!0)},t}return QA(t,e),t.prototype.render=function(){var e;switch(this.props.dropdownMode){case"scroll":e=this.renderScrollMode();break;case"select":e=this.renderSelectMode()}return n().createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},e)},t}(e.Component),mD=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],hD="react-datepicker-ignore-onclickoutside",vD=function(t){function r(o){var i=t.call(this,o)||this;return i.monthContainer=void 0,i.handleClickOutside=function(e){i.props.onClickOutside(e)},i.setClickOutsideRef=function(){return i.containerRef.current},i.handleDropdownFocus=function(e){var t,n,r,o;r=e.target,o=(r.className||"").split(/\s+/),mD.some(function(e){return o.indexOf(e)>=0})&&(null===(n=(t=i.props).onDropdownFocus)||void 0===n||n.call(t,e))},i.getDateInView=function(){var e=i.props,t=e.preSelection,n=e.selected,r=e.openToDate,o=MP(i.props),a=LP(i.props),s=YA();return r||n||t||(o&&xI(s,o)?o:a&&tT(s,a)?a:s)},i.increaseMonth=function(){i.setState(function(e){return{date:BI(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.decreaseMonth=function(){i.setState(function(e){return{date:qI(e.date,1)}},function(){return i.handleMonthChange(i.state.date)})},i.handleDayClick=function(e,t,n){i.props.onSelect(e,t,n),i.props.setPreSelection&&i.props.setPreSelection(e)},i.handleDayMouseEnter=function(e){i.setState({selectingDate:e}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(e)},i.handleMonthMouseLeave=function(){i.setState({selectingDate:void 0}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()},i.handleYearMouseEnter=function(e,t){i.setState({selectingDate:iT(YA(),t)}),i.props.onYearMouseEnter&&i.props.onYearMouseEnter(e,t)},i.handleYearMouseLeave=function(e,t){i.props.onYearMouseLeave&&i.props.onYearMouseLeave(e,t)},i.handleYearChange=function(e){var t,n,r,o;null===(n=(t=i.props).onYearChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0}),i.props.adjustDateOnChange&&(i.props.onSelect(e),null===(o=(r=i.props).setOpen)||void 0===o||o.call(r,!0)),i.props.setPreSelection&&i.props.setPreSelection(e)},i.getEnabledPreSelectionDateForMonth=function(e){if(!gP(e,i.props))return e;for(var t=rP(e),n=function(e,t,n){const[r,o]=Oa(n?.in,e,t),i=aT(r,o),a=Math.abs(Ea(r,o));r.setDate(r.getDate()-i*a);const s=i*(a-Number(aT(r,o)===-i));return 0===s?0:s}(function(e){return TI(e)}(e),t),r=null,o=0;o<=n;o++){var a=da(t,o);if(!gP(a,i.props)){r=a;break}}return r},i.handleMonthChange=function(e){var t,n,r,o=null!==(t=i.getEnabledPreSelectionDateForMonth(e))&&void 0!==t?t:e;i.handleCustomMonthChange(o),i.props.adjustDateOnChange&&(i.props.onSelect(o),null===(r=(n=i.props).setOpen)||void 0===r||r.call(n,!0)),i.props.setPreSelection&&i.props.setPreSelection(o)},i.handleCustomMonthChange=function(e){var t,n;null===(n=(t=i.props).onMonthChange)||void 0===n||n.call(t,e),i.setState({isRenderAriaLiveMessage:!0})},i.handleMonthYearChange=function(e){i.handleYearChange(e),i.handleMonthChange(e)},i.changeYear=function(e){i.setState(function(t){return{date:iT(t.date,Number(e))}},function(){return i.handleYearChange(i.state.date)})},i.changeMonth=function(e){i.setState(function(t){return{date:PI(t.date,Number(e))}},function(){return i.handleMonthChange(i.state.date)})},i.changeMonthYear=function(e){i.setState(function(t){return{date:iT(PI(t.date,RI(e)),jI(e))}},function(){return i.handleMonthYearChange(i.state.date)})},i.header=function(e){if(void 0===e&&(e=i.state.date),!XA(e))return[];var t=i.props.disabled,r=nP(e,i.props.locale,i.props.calendarStartDay),o=[];return i.props.showWeekNumbers&&o.push(n().createElement("div",{key:"W",className:"react-datepicker__day-name ".concat(t?"react-datepicker__day-name--disabled":""),role:"columnheader"},n().createElement("span",{className:"react-datepicker__sr-only"},"Week number"),n().createElement("span",{"aria-hidden":"true"},i.props.weekLabel||"#"))),o.concat([0,1,2,3,4,5,6].map(function(e){var o=da(r,e),a=i.formatWeekday(o,i.props.locale),s=i.props.weekDayClassName?i.props.weekDayClassName(o):void 0;return n().createElement("div",{key:e,role:"columnheader",className:Mp("react-datepicker__day-name",s,t?"react-datepicker__day-name--disabled":"")},n().createElement("span",{className:"react-datepicker__sr-only"},ZA(o,"EEEE",i.props.locale)),n().createElement("span",{"aria-hidden":"true"},a))}))},i.formatWeekday=function(e,t){return i.props.formatWeekDay?function(e,t,n){return t(ZA(e,"EEEE",n))}(e,i.props.formatWeekDay,t):i.props.useWeekdaysShort?function(e,t){return ZA(e,"EEE",t)}(e,t):function(e,t){return ZA(e,"EEEEEE",t)}(e,t)},i.decreaseYear=function(){i.setState(function(e){var t;return{date:HI(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.clearSelectingDate=function(){i.setState({selectingDate:void 0})},i.renderPreviousButton=function(){var e,t,o;if(!i.props.renderCustomHeader){var a,s=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,l=i.props.showPreviousMonths?s-1:0,u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:l,c=qI(i.state.date,u);switch(!0){case i.props.disabled:a=!0;break;case i.props.showMonthYearPicker:a=jP(i.state.date,i.props);break;case i.props.showYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.yearItemNumber,i=void 0===o?12:o,a=qP(oP(HI(e,i)),i).endPeriod,s=r&&jI(r);return s&&s>a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:a=function(e,t){var n=void 0===t?{}:t,r=n.minDate,o=n.includeDates,i=$I(Ca(e),1);return r&&UI(r,i)>0||o&&o.every(function(e){return UI(e,i)>0})||!1}(i.state.date,i.props);break;default:a=PP(c,i.props)}if(((null!==(o=i.props.forceShowMonthNavigation)&&void 0!==o?o:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!a)&&!i.props.showTimeSelectOnly){var d=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(p=i.decreaseYear),a&&i.props.showDisabledMonthNavigation&&(d.push("react-datepicker__navigation--previous--disabled"),p=void 0);var f=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,m=i.props,h=m.previousMonthButtonLabel,v=void 0===h?r.defaultProps.previousMonthButtonLabel:h,y=m.previousYearButtonLabel,g=void 0===y?r.defaultProps.previousYearButtonLabel:y,b=i.props,w=b.previousMonthAriaLabel,S=void 0===w?"string"==typeof v?v:"Previous Month":w,x=b.previousYearAriaLabel,k=void 0===x?"string"==typeof g?g:"Previous Year":x;return n().createElement("button",{type:"button",className:d.join(" "),onClick:p,onKeyDown:i.props.handleOnKeyDown,"aria-label":f?k:S},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},f?g:v))}}},i.increaseYear=function(){i.setState(function(e){var t;return{date:WI(e.date,i.props.showYearPicker?null!==(t=i.props.yearItemNumber)&&void 0!==t?t:r.defaultProps.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})},i.renderNextButton=function(){var e;if(!i.props.renderCustomHeader){var t;switch(!0){case i.props.disabled:t=!0;break;case i.props.showMonthYearPicker:t=RP(i.state.date,i.props);break;case i.props.showYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.yearItemNumber,i=void 0===o?12:o,a=qP(WI(e,i),i).startPeriod,s=r&&jI(r);return s&&s<a||!1}(i.state.date,i.props);break;case i.props.showQuarterYearPicker:t=function(e,t){var n=void 0===t?{}:t,r=n.maxDate,o=n.includeDates,i=zI(MI(e),1);return r&&UI(i,r)>0||o&&o.every(function(e){return UI(i,e)>0})||!1}(i.state.date,i.props);break;default:t=DP(i.state.date,i.props)}if(((null!==(e=i.props.forceShowMonthNavigation)&&void 0!==e?e:r.defaultProps.forceShowMonthNavigation)||i.props.showDisabledMonthNavigation||!t)&&!i.props.showTimeSelectOnly){var o=["react-datepicker__navigation","react-datepicker__navigation--next"];i.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),i.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var a=i.increaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(a=i.increaseYear),t&&i.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),a=void 0);var s=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,l=i.props,u=l.nextMonthButtonLabel,c=void 0===u?r.defaultProps.nextMonthButtonLabel:u,d=l.nextYearButtonLabel,p=void 0===d?r.defaultProps.nextYearButtonLabel:d,f=i.props,m=f.nextMonthAriaLabel,h=void 0===m?"string"==typeof c?c:"Next Month":m,v=f.nextYearAriaLabel,y=void 0===v?"string"==typeof p?p:"Next Year":v;return n().createElement("button",{type:"button",className:o.join(" "),onClick:a,onKeyDown:i.props.handleOnKeyDown,"aria-label":s?y:h},n().createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"].join(" ")},s?p:c))}}},i.renderCurrentMonth=function(e){void 0===e&&(e=i.state.date);var t=["react-datepicker__current-month"];return i.props.showYearDropdown&&t.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&t.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&t.push("react-datepicker__current-month--hasMonthYearDropdown"),n().createElement("h2",{className:t.join(" ")},XA(e)?ZA(e,i.props.dateFormat,i.props.locale):"")},i.renderYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showYearDropdown&&!e)return n().createElement(fD,zA({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeYear,year:jI(i.state.date)}))},i.renderMonthDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthDropdown&&!e)return n().createElement(iD,zA({},r.defaultProps,i.props,{month:RI(i.state.date),onChange:i.changeMonth}))},i.renderMonthYearDropdown=function(e){if(void 0===e&&(e=!1),i.props.showMonthYearDropdown&&!e)return n().createElement(lD,zA({},r.defaultProps,i.props,{date:i.state.date,onChange:i.changeMonthYear}))},i.handleTodayButtonClick=function(e){i.props.onSelect(aP(),e),i.props.setPreSelection&&i.props.setPreSelection(aP())},i.renderTodayButton=function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return n().createElement("div",{className:"react-datepicker__today-button",onClick:i.handleTodayButtonClick},i.props.todayButton)},i.renderDayNamesHeader=function(e){return n().createElement("div",{className:"react-datepicker__day-names",role:"row"},i.header(e))},i.renderDefaultHeader=function(e){var t=e.monthDate,r=e.i;return n().createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(t),n().createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(0!==r),i.renderMonthYearDropdown(0!==r),i.renderYearDropdown(0!==r)))},i.renderCustomHeader=function(e){var t,r,o=e.monthDate,a=e.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var s,l=i.props,u=l.showYearPicker,c=l.yearItemNumber;if(u){var d=qP(o,c);s={startYear:d.startPeriod,endYear:d.endPeriod}}var p=PP(i.state.date,i.props),f=DP(i.state.date,i.props),m=jP(i.state.date,i.props),h=RP(i.state.date,i.props);return n().createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},null===(r=(t=i.props).renderCustomHeader)||void 0===r?void 0:r.call(t,zA(zA(zA({},i.state),u&&{visibleYearsRange:s}),{customHeaderCount:a,monthDate:o,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:p,nextMonthButtonDisabled:f,prevYearButtonDisabled:m,nextYearButtonDisabled:h})))},i.renderYearHeader=function(e){var t=e.monthDate,o=i.props,a=o.showYearPicker,s=o.yearItemNumber,l=qP(t,void 0===s?r.defaultProps.yearItemNumber:s),u=l.startPeriod,c=l.endPeriod;return n().createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},a?"".concat(u," - ").concat(c):jI(t))},i.renderHeader=function(e){var t=e.monthDate,n=e.i,r={monthDate:t,i:void 0===n?0:n};switch(!0){case void 0!==i.props.renderCustomHeader:return i.renderCustomHeader(r);case i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker:return i.renderYearHeader(r);default:return i.renderDefaultHeader(r)}},i.renderMonths=function(){var e,t;if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var o=[],a=null!==(e=i.props.monthsShown)&&void 0!==e?e:r.defaultProps.monthsShown,s=i.props.showPreviousMonths?a-1:0,l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?WI(i.state.date,s):qI(i.state.date,s),u=null!==(t=i.props.monthSelectedIn)&&void 0!==t?t:s,c=0;c<a;++c){var d=c-u+s,p=i.props.showMonthYearPicker||i.props.showQuarterYearPicker?WI(l,d):BI(l,d),f="month-".concat(c),m=c<a-1,h=c>0;o.push(n().createElement("div",{key:f,ref:function(e){i.monthContainer=null!=e?e:void 0},className:"react-datepicker__month-container"},i.renderHeader({monthDate:p,i:c}),n().createElement(rD,zA({},r.defaultProps,i.props,{containerRef:i.containerRef,ariaLabelPrefix:i.props.monthAriaLabelPrefix,day:p,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnDayKeyDown,handleOnMonthKeyDown:i.props.handleOnKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,orderInDisplay:c,selectingDate:i.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:h,dayNamesHeader:i.renderDayNamesHeader(p)}))))}return o}},i.renderYears=function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?n().createElement("div",{className:"react-datepicker__year--container"},i.renderHeader({monthDate:i.state.date}),n().createElement(cD,zA({},r.defaultProps,i.props,{selectingDate:i.state.selectingDate,date:i.state.date,onDayClick:i.handleDayClick,clearSelectingDate:i.clearSelectingDate,onYearMouseEnter:i.handleYearMouseEnter,onYearMouseLeave:i.handleYearMouseLeave}))):void 0},i.renderTimeSection=function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return n().createElement(uD,zA({},r.defaultProps,i.props,{onChange:i.props.onTimeChange,format:i.props.timeFormat,intervals:i.props.timeIntervals,monthRef:i.state.monthContainer}))},i.renderInputTimeSection=function(){var e=i.props.selected?new Date(i.props.selected):void 0,t=e&&XA(e)&&Boolean(i.props.selected)?"".concat(BP(e.getHours()),":").concat(BP(e.getMinutes())):"";if(i.props.showTimeInput)return n().createElement(GP,zA({},r.defaultProps,i.props,{date:e,timeString:t,onChange:i.props.onTimeChange}))},i.renderAriaLiveRegion=function(){var e;if(!XA(i.state.date))return n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"});var t,o=qP(i.state.date,null!==(e=i.props.yearItemNumber)&&void 0!==e?e:r.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod;return t=i.props.showYearPicker?"".concat(a," - ").concat(s):i.props.showMonthYearPicker||i.props.showQuarterYearPicker?jI(i.state.date):"".concat(vP(RI(i.state.date),i.props.locale)," ").concat(jI(i.state.date)),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},i.state.isRenderAriaLiveMessage&&t)},i.renderChildren=function(){if(i.props.children)return n().createElement("div",{className:"react-datepicker__children-container"},i.props.children)},i.containerRef=(0,e.createRef)(),i.state={date:i.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},i}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:hD,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:12}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){this.props.showTimeSelect&&(this.assignMonthContainer=void this.setState({monthContainer:this.monthContainer}))},r.prototype.componentDidUpdate=function(e){var t=this;if(!this.props.preSelection||!XA(this.props.preSelection)||dP(this.props.preSelection,e.preSelection)&&this.props.monthSelectedIn===e.monthSelectedIn)this.props.openToDate&&!dP(this.props.openToDate,e.openToDate)&&this.setState({date:this.props.openToDate});else{var n=!uP(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&t.handleCustomMonthChange(t.state.date)})}},r.prototype.render=function(){var e=this.props.container||WA;return n().createElement(HA,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},n().createElement("div",{style:{display:"contents"},ref:this.containerRef},n().createElement(e,{className:Mp("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},r}(e.Component),yD=function(e){var t=e.icon,r=e.className,o=void 0===r?"":r,i=e.onClick,a="react-datepicker__calendar-icon";if("string"==typeof t)return n().createElement("i",{className:"".concat(a," ").concat(t," ").concat(o),"aria-hidden":"true",onClick:i});if(n().isValidElement(t)){var s=t;return n().cloneElement(s,{className:"".concat(s.props.className||""," ").concat(a," ").concat(o),onClick:function(e){"function"==typeof s.props.onClick&&s.props.onClick(e),"function"==typeof i&&i(e)}})}return n().createElement("svg",{className:"".concat(a," ").concat(o),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},n().createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},gD=function(e){function t(t){var n=e.call(this,t)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return QA(t,e),t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Gb().createPortal(this.props.children,this.el)},t}(e.Component),bD=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&-1!==e.tabIndex},wD=function(t){function r(n){var r=t.call(this,n)||this;return r.getTabChildren=function(){var e;return Array.prototype.slice.call(null===(e=r.tabLoopRef.current)||void 0===e?void 0:e.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(bD)},r.handleFocusStart=function(){var e=r.getTabChildren();e&&e.length>1&&e[e.length-1].focus()},r.handleFocusEnd=function(){var e=r.getTabChildren();e&&e.length>1&&e[0].focus()},r.tabLoopRef=(0,e.createRef)(),r}return QA(r,t),r.prototype.render=function(){var e;return(null!==(e=this.props.enableTabLoop)&&void 0!==e?e:r.defaultProps.enableTabLoop)?n().createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},n().createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,n().createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(e.Component),SD=function(t){function r(r){var o,i="boolean"!=typeof r.hidePopper||r.hidePopper,a=(0,e.useRef)(null),s=BA(zA({open:!i,whileElementsMounted:bA,placement:r.popperPlacement,middleware:$A([TA({padding:15}),IA(10),AA({element:a})],null!==(o=r.popperModifiers)&&void 0!==o?o:[],!0)},r.popperProps)),l=zA(zA({},r),{hidePopper:i,popperProps:zA(zA({},s),{arrowRef:a})});return n().createElement(t,zA({},l))}return r.displayName="withFloating(".concat(t.displayName||t.name||"Component",")"),r}(function(t){var r=t.className,o=t.wrapperClassName,i=t.hidePopper,a=void 0===i||i,s=t.popperComponent,l=t.targetComponent,u=t.enableTabLoop,c=t.popperOnKeyDown,d=t.portalId,p=t.portalHost,f=t.popperProps,m=t.showArrow,h=void 0;if(!a){var v=Mp("react-datepicker-popper",r);h=n().createElement(wD,{enableTabLoop:u},n().createElement("div",{ref:f.refs.setFloating,style:f.floatingStyles,className:v,"data-placement":f.placement,onKeyDown:c},s,m&&n().createElement(LA,{ref:f.arrowRef,context:f.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}t.popperContainer&&(h=(0,e.createElement)(t.popperContainer,{},h)),d&&!a&&(h=n().createElement(gD,{portalId:d,portalHost:p},h));var y=Mp("react-datepicker-wrapper",o);return n().createElement(n().Fragment,null,n().createElement("div",{ref:f.refs.setReference,className:y},l),h)}),xD="Date input not valid.",kD=function(t){function r(o){var i=t.call(this,o)||this;return i.calendar=null,i.input=null,i.getPreSelection=function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:YA()},i.modifyHolidays=function(){var e;return null===(e=i.props.holidays)||void 0===e?void 0:e.reduce(function(e,t){var n=new Date(t.date);return XA(n)?$A($A([],e,!0),[zA(zA({},t),{date:n})],!1):e},[])},i.calcInitialState=function(){var e,t=i.getPreSelection(),n=MP(i.props),r=LP(i.props),o=n&&xI(t,tP(n))?n:r&&tT(t,sP(r))?r:t;return{open:i.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:null!==(e=i.props.selectsRange?i.props.startDate:i.props.selected)&&void 0!==e?e:o,highlightDates:NP(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},i.getInputValue=function(){var e,t=i.props,n=t.locale,o=t.startDate,a=t.endDate,s=t.rangeSeparator,l=t.selected,u=t.selectedDates,c=t.selectsMultiple,d=t.selectsRange,p=t.value,f=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,m=i.state.inputValue;return"string"==typeof p?p:"string"==typeof m?m:d?function(e,t,n){if(!e&&!t)return"";var r=e?JA(e,n):"",o=t?JA(t,n):"",i=n.rangeSeparator||" - ";return"".concat(r).concat(i).concat(o)}(o,a,{dateFormat:f,locale:n,rangeSeparator:s}):c?function(e,t){if(!(null==e?void 0:e.length))return"";var n=e[0]?JA(e[0],t):"";if(1===e.length)return n;if(2===e.length&&e[1]){var r=JA(e[1],t);return"".concat(n,", ").concat(r)}var o=e.length-1;return"".concat(n," (+").concat(o,")")}(null!=u?u:[],{dateFormat:f,locale:n}):JA(l,{dateFormat:f,locale:n})},i.resetHiddenStatus=function(){i.setState(zA(zA({},i.state),{wasHidden:!1}))},i.setHiddenStatus=function(){i.setState(zA(zA({},i.state),{wasHidden:!0}))},i.setHiddenStateOnVisibilityHidden=function(){"hidden"===document.visibilityState&&i.setHiddenStatus()},i.clearPreventFocusTimeout=function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)},i.setFocus=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.focus)||void 0===t||t.call(e,{preventScroll:!0})},i.setBlur=function(){var e,t;null===(t=null===(e=i.input)||void 0===e?void 0:e.blur)||void 0===t||t.call(e),i.cancelFocusInput()},i.deferBlur=function(){requestAnimationFrame(function(){i.setBlur()})},i.setOpen=function(e,t){void 0===t&&(t=!1),i.setState({open:e,preSelection:e&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:_D},function(){e||i.setState(function(e){return{focused:!!t&&e.focused}},function(){!t&&i.deferBlur(),i.setState({inputValue:null})})})},i.inputOk=function(){return Uo(i.state.preSelection)},i.isCalendarOpen=function(){return void 0===i.props.open?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open},i.handleFocus=function(e){var t,n,r=i.state.wasHidden,o=!r||i.state.open;r&&i.resetHiddenStatus(),i.state.preventFocus||(null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e),!o||i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})},i.sendFocusBackToInput=function(){i.preventFocusTimeout&&i.clearPreventFocusTimeout(),i.setState({preventFocus:!0},function(){i.preventFocusTimeout=setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})})},i.cancelFocusInput=function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=void 0},i.deferFocusInput=function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)},i.handleDropdownFocus=function(){i.cancelFocusInput()},i.resetInputValue=function(){i.setState(zA(zA({},i.state),{inputValue:null}))},i.handleBlur=function(e){var t,n;(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&(null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)),i.resetInputValue(),i.state.open&&!1===i.props.open&&i.setOpen(!1),i.setState({focused:!1})},i.handleCalendarClickOutside=function(e){var t,n;i.props.inline||i.setOpen(!1),null===(n=(t=i.props).onClickOutside)||void 0===n||n.call(t,e),i.props.withPortal&&e.preventDefault()},i.handleChange=function(){for(var e,t,n,o,a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=s[0];if(!i.props.onChangeRaw||(i.props.onChangeRaw.apply(i,s),u&&"function"==typeof u.isDefaultPrevented&&!u.isDefaultPrevented())){i.setState({inputValue:(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:null,lastPreSelectChange:OD});var c=i.props,d=c.selectsRange,p=c.startDate,f=c.endDate,m=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,h=null!==(t=i.props.strictParsing)&&void 0!==t?t:r.defaultProps.strictParsing,v=(null==u?void 0:u.target)instanceof HTMLInputElement?u.target.value:"";if(d){var y=i.props.rangeSeparator,g=y.trim(),b=v.split(m.includes(g)?y:g,2).map(function(e){return e.trim()}),w=b[0],S=b[1],x=KA(null!=w?w:"",m,i.props.locale,h),k=x?KA(null!=S?S:"",m,i.props.locale,h):null,O=(null==p?void 0:p.getTime())!==(null==x?void 0:x.getTime()),_=(null==f?void 0:f.getTime())!==(null==k?void 0:k.getTime());if(!O&&!_)return;if(x&&gP(x,i.props))return;if(k&&gP(k,i.props))return;null===(o=(n=i.props).onChange)||void 0===o||o.call(n,[x,k],u)}else{var E=KA(v,m,i.props.locale,h,null!==(a=i.props.selected)&&void 0!==a?a:void 0);!E&&v||i.setSelected(E,u,!0)}}},i.handleSelect=function(e,t,n){var o;if(!i.props.readOnly){var a=i.props,s=a.selectsRange,l=a.startDate,u=a.endDate,c=a.locale,d=a.swapRange,p=null!==(o=i.props.dateFormat)&&void 0!==o?o:r.defaultProps.dateFormat,f=!s||l&&!u&&(d||!UP(e,l));if(i.props.shouldCloseOnSelect&&!i.props.showTimeSelect&&f&&i.sendFocusBackToInput(),i.props.onChangeRaw){var m=JA(e,{dateFormat:p,locale:c});i.props.onChangeRaw(t,{date:e,formattedDate:m})}i.setSelected(e,t,!1,n),i.props.showDateSelect&&i.setState({isRenderAriaLiveMessage:!0}),!i.props.shouldCloseOnSelect||i.props.showTimeSelect?i.setPreSelection(e):f&&i.setOpen(!1)}},i.setSelected=function(e,t,n,r){var o,a,s=e;if(i.props.showYearPicker){if(null!==s&&_P(jI(s),i.props))return}else if(i.props.showMonthYearPicker){if(null!==s&&wP(s,i.props))return}else if(null!==s&&gP(s,i.props))return;var l=i.props,u=l.onChange,c=l.selectsRange,d=l.startDate,p=l.endDate,f=l.selectsMultiple,m=l.selectedDates,h=l.minTime,v=l.swapRange;if(!pP(i.props.selected,s)||i.props.allowSameDay||c||f)if(null!==s&&(!i.props.selected||n&&(i.props.showTimeSelect||i.props.showTimeSelectOnly||i.props.showTimeInput)||(s=eP(s,{hour:NI(i.props.selected),minute:FI(i.props.selected),second:VI(i.props.selected)})),n||!i.props.showTimeSelect&&!i.props.showTimeSelectOnly||h&&(s=eP(s,{hour:h.getHours(),minute:h.getMinutes(),second:h.getSeconds()})),i.props.inline||i.setState({preSelection:s}),i.props.focusSelectedMonth||i.setState({monthSelectedIn:r})),c){var y=!d&&!!p,g=d&&p;d||p?d&&!p?null===s?null==u||u([null,null],t):UP(s,d)?v?null==u||u([s,d],t):null==u||u([s,null],t):null==u||u([d,s],t):y&&(s&&UP(s,p)?null==u||u([s,p],t):null==u||u([s,null],t)):null==u||u([s,null],t),g&&(null==u||u([s,null],t))}else if(f){if(null!==s)if(null==m?void 0:m.length)if(m.some(function(e){return dP(e,s)})){var b=m.filter(function(e){return!dP(e,s)});null==u||u(b,t)}else null==u||u($A($A([],m,!0),[s],!1),t);else null==u||u([s],t)}else null==u||u(s,t);n||(null===(a=(o=i.props).onSelect)||void 0===a||a.call(o,s,t),i.setState({inputValue:null}))},i.setPreSelection=function(e){if(!i.props.readOnly){var t=Uo(i.props.minDate),n=Uo(i.props.maxDate),r=!0;if(e){var o=tP(e);if(t&&n)r=fP(e,i.props.minDate,i.props.maxDate);else if(t){var a=tP(i.props.minDate);r=tT(e,a)||pP(o,a)}else if(n){var s=sP(i.props.maxDate);r=xI(e,s)||pP(o,s)}}r&&i.setState({preSelection:e})}},i.toggleCalendar=function(){i.setOpen(!i.state.open)},i.handleTimeChange=function(e){var t,n;if(!i.props.selectsRange&&!i.props.selectsMultiple){var r=i.props.selected?i.props.selected:i.getPreSelection(),o=i.props.selected?e:eP(r,{hour:NI(e),minute:FI(e)});i.setState({preSelection:o}),null===(n=(t=i.props).onChange)||void 0===n||n.call(t,o),i.props.shouldCloseOnSelect&&!i.props.showTimeInput&&(i.sendFocusBackToInput(),i.setOpen(!1)),i.props.showTimeInput&&i.setOpen(!0),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),i.setState({inputValue:null})}},i.onInputClick=function(){var e,t;i.props.disabled||i.props.readOnly||i.setOpen(!0),null===(t=(e=i.props).onInputClick)||void 0===t||t.call(e)},i.handleTimeOnlyArrowKey=function(e){var t,n,o,a,s,l=i.props.selected||i.state.preSelection||YA(),u=null!==(t=i.props.timeIntervals)&&void 0!==t?t:30,c=null!==(n=i.props.dateFormat)&&void 0!==n?n:r.defaultProps.dateFormat,d=Array.isArray(c)?c[0]:c,p=tP(l),f=60*NI(l)+FI(l),m=1440-u;if(e===UA.ArrowUp){var h=Math.max(0,f-u);s=JI(p,h)}else h=Math.min(m,f+u),s=JI(p,h);var v=ZA(s,d||r.defaultProps.dateFormat,i.props.locale);if(i.setState({preSelection:s,inputValue:v}),!i.props.selectsRange&&!i.props.selectsMultiple){var y=i.props.selected?i.props.selected:i.getPreSelection(),g=i.props.selected?s:eP(y,{hour:NI(s),minute:FI(s)});null===(a=(o=i.props).onChange)||void 0===a||a.call(o,g),(i.props.showTimeSelectOnly||i.props.showTimeSelect)&&i.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){i.scrollToTimeOption(s)})}},i.handleTimeOnlyEnterKey=function(e){var t,n,o,a,s=e.target.value,l=null!==(t=i.props.dateFormat)&&void 0!==t?t:r.defaultProps.dateFormat,u=i.props.timeFormat||"p",c=i.state.preSelection||i.props.selected||YA(),d=KA(s,l,i.props.locale,null!==(n=i.props.strictParsing)&&void 0!==n&&n,c),p=c;if(d&&XA(d))p=d;else{var f=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");if(f instanceof HTMLElement){var m=null===(a=f.textContent)||void 0===a?void 0:a.trim();if(m){var h=KA(m,u,i.props.locale,!1,c);h&&XA(h)&&(p=h)}}}i.handleTimeChange(p),i.setOpen(!1),i.sendFocusBackToInput()},i.scrollToTimeOption=function(e){var t,n;if(null===(t=i.calendar)||void 0===t?void 0:t.containerRef.current){for(var r=i.calendar.containerRef.current,o=Array.from(r.querySelectorAll(".react-datepicker__time-list-item")),a=null,s=1/0,l=i.props.timeFormat||"p",u=0,c=o;u<c.length;u++){var d=c[u],p=null===(n=d.textContent)||void 0===n?void 0:n.trim();if(p){var f=KA(p,l,i.props.locale,!1,e);if(f&&XA(f)){if(zP(f,e)){a=d;break}var m=Math.abs(f.getTime()-e.getTime());m<s&&(s=m,a=d)}}}a&&(o.forEach(function(e){e.setAttribute("tabindex","-1")}),a.setAttribute("tabindex","0"),a.scrollIntoView({behavior:"smooth",block:"center"}))}},i.onInputKeyDown=function(e){var t,n,r,o,a,s;null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e);var l=e.key;if(i.state.open||i.props.inline||i.props.preventOpenOnFocus){if(i.state.open&&i.props.showTimeSelectOnly){if(l===UA.ArrowDown||l===UA.ArrowUp)return e.preventDefault(),void i.handleTimeOnlyArrowKey(l);if(l===UA.Enter)return e.preventDefault(),void i.handleTimeOnlyEnterKey(e)}if(i.state.open){if(l===UA.ArrowDown||l===UA.ArrowUp){e.preventDefault();var u=i.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":i.props.showWeekPicker&&i.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':i.props.showFullMonthYearPicker||i.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',c=(null===(o=i.calendar)||void 0===o?void 0:o.containerRef.current)instanceof Element&&i.calendar.containerRef.current.querySelector(u);return void(c instanceof HTMLElement&&c.focus({preventScroll:!0}))}var d=YA(i.state.preSelection);l===UA.Enter?(e.preventDefault(),e.target.blur(),i.inputOk()&&i.state.lastPreSelectChange===_D?(i.handleSelect(d,e),!i.props.shouldCloseOnSelect&&i.setPreSelection(d)):i.setOpen(!1)):l===UA.Escape?(e.preventDefault(),e.target.blur(),i.sendFocusBackToInput(),i.setOpen(!1)):l===UA.Tab&&i.setOpen(!1),i.inputOk()||null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:xD})}}else l!==UA.ArrowDown&&l!==UA.ArrowUp&&l!==UA.Enter||null===(r=i.onInputClick)||void 0===r||r.call(i)},i.onPortalKeyDown=function(e){e.key===UA.Escape&&(e.preventDefault(),i.setState({preventFocus:!0},function(){i.setOpen(!1),setTimeout(function(){i.setFocus(),i.setState({preventFocus:!1})})}))},i.onDayKeyDown=function(e){var t,n,r,o,a,s,l=i.props,u=l.minDate,c=l.maxDate,d=l.disabledKeyboardNavigation,p=l.showWeekPicker,f=l.shouldCloseOnSelect,m=l.locale,h=l.calendarStartDay,v=l.adjustDateOnChange,y=l.inline;if(null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e),!d){var g=e.key,b=e.shiftKey,w=YA(i.state.preSelection),S=function(e,t){var n=t;switch(e){case UA.ArrowRight:n=p?rT(t,1):da(t,1);break;case UA.ArrowLeft:n=p?sT(t,1):function(e,t,n){return da(e,-t,n)}(t,1);break;case UA.ArrowUp:n=sT(t,1);break;case UA.ArrowDown:n=rT(t,1);break;case UA.PageUp:n=b?HI(t,1):qI(t,1);break;case UA.PageDown:n=b?WI(t,1):BI(t,1);break;case UA.Home:n=nP(t,m,h);break;case UA.End:n=function(e){return function(e,t){const n=bi(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Xo(e,t?.in),i=o.getDay(),a=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+a),o.setHours(23,59,59,999),o}(e)}(t)}return n};if(g===UA.Enter)return e.preventDefault(),i.handleSelect(w,e),void(!f&&i.setPreSelection(w));if(g===UA.Escape)return e.preventDefault(),i.setOpen(!1),void(i.inputOk()||null===(o=(r=i.props).onInputError)||void 0===o||o.call(r,{code:1,msg:xD}));var x=null;switch(g){case UA.ArrowLeft:case UA.ArrowRight:case UA.ArrowUp:case UA.ArrowDown:case UA.PageUp:case UA.PageDown:case UA.Home:case UA.End:x=function(e,t){for(var n=e,r=!1,o=0,a=S(e,t);!r;){if(o>=40){a=t;break}u&&a<u&&(n=UA.ArrowRight,a=gP(u,i.props)?S(n,a):u),c&&a>c&&(n=UA.ArrowLeft,a=gP(c,i.props)?S(n,a):c),gP(a,i.props)?(n!==UA.PageUp&&n!==UA.Home||(n=UA.ArrowRight),n!==UA.PageDown&&n!==UA.End||(n=UA.ArrowLeft),a=S(n,a)):r=!0,o++}return a}(g,w)}x?(e.preventDefault(),i.setState({lastPreSelectChange:_D}),v&&i.setSelected(x),i.setPreSelection(x),y&&i.setState({shouldFocusDayInline:!0})):null===(s=(a=i.props).onInputError)||void 0===s||s.call(a,{code:1,msg:xD})}},i.onPopperKeyDown=function(e){e.key===UA.Escape&&(e.preventDefault(),i.sendFocusBackToInput(),i.setOpen(!1))},i.onClearClick=function(e){e&&e.preventDefault&&e.preventDefault(),i.sendFocusBackToInput();var t=i.props,n=t.selectsRange,r=t.onChange;n?null==r||r([null,null],e):null==r||r(null,e),i.setState({inputValue:null})},i.clear=function(){i.onClearClick()},i.onScroll=function(e){"boolean"==typeof i.props.closeOnScroll&&i.props.closeOnScroll?e.target!==document&&e.target!==document.documentElement&&e.target!==document.body||i.setOpen(!1):"function"==typeof i.props.closeOnScroll&&i.props.closeOnScroll(e)&&i.setOpen(!1)},i.renderCalendar=function(){var e,t;return i.props.inline||i.isCalendarOpen()?n().createElement(vD,zA({showMonthYearDropdown:void 0,ref:function(e){i.calendar=e}},i.props,i.state,{setOpen:i.setOpen,dateFormat:null!==(e=i.props.dateFormatCalendar)&&void 0!==e?e:r.defaultProps.dateFormatCalendar,onSelect:i.handleSelect,onClickOutside:i.handleCalendarClickOutside,holidays:FP(i.modifyHolidays()),outsideClickIgnoreClass:i.props.outsideClickIgnoreClass,onDropdownFocus:i.handleDropdownFocus,onTimeChange:i.handleTimeChange,className:i.props.calendarClassName,container:i.props.calendarContainer,handleOnKeyDown:i.props.onKeyDown,handleOnDayKeyDown:i.onDayKeyDown,setPreSelection:i.setPreSelection,dropdownMode:null!==(t=i.props.dropdownMode)&&void 0!==t?t:r.defaultProps.dropdownMode}),i.props.children):null},i.renderAriaLiveRegion=function(){var e,t,o=i.props.locale,a=null!==(e=i.props.dateFormat)&&void 0!==e?e:r.defaultProps.dateFormat,s=i.props.showTimeInput||i.props.showTimeSelect?"PPPPp":"PPPP";return t=i.props.selectsRange?"Selected start date: ".concat(JA(i.props.startDate,{dateFormat:s,locale:o}),". ").concat(i.props.endDate?"End date: "+JA(i.props.endDate,{dateFormat:s,locale:o}):""):i.props.showTimeSelectOnly?"Selected time: ".concat(JA(i.props.selected,{dateFormat:a,locale:o})):i.props.showYearPicker?"Selected year: ".concat(JA(i.props.selected,{dateFormat:"yyyy",locale:o})):i.props.showMonthYearPicker?"Selected month: ".concat(JA(i.props.selected,{dateFormat:"MMMM yyyy",locale:o})):i.props.showQuarterYearPicker?"Selected quarter: ".concat(JA(i.props.selected,{dateFormat:"yyyy, QQQ",locale:o})):"Selected date: ".concat(JA(i.props.selected,{dateFormat:s,locale:o})),n().createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},t)},i.renderDateInput=function(){var t,o,a,s,l,u,c=Mp(i.props.className,((t={})[i.props.outsideClickIgnoreClass||r.defaultProps.outsideClickIgnoreClass]=i.state.open,t)),d=i.props.customInput||n().createElement("input",{type:"text"}),p=i.props.customInputRef||"ref",f={},m=null!==(a=i.props["aria-describedby"])&&void 0!==a?a:i.props.ariaDescribedBy,h=null!==(s=i.props["aria-invalid"])&&void 0!==s?s:i.props.ariaInvalid,v=null!==(l=i.props["aria-labelledby"])&&void 0!==l?l:i.props.ariaLabelledBy,y=null!==(u=i.props["aria-required"])&&void 0!==u?u:i.props.ariaRequired;return null!=m&&(f["aria-describedby"]=m),null!=h&&(f["aria-invalid"]=h),null!=v&&(f["aria-labelledby"]=v),null!=y&&(f["aria-required"]=y),(0,e.cloneElement)(d,zA(((o={})[p]=function(e){i.input=e},o.value=i.getInputValue(),o.onBlur=i.handleBlur,o.onChange=i.handleChange,o.onClick=i.onInputClick,o.onFocus=i.handleFocus,o.onKeyDown=i.onInputKeyDown,o.id=i.props.id,o.name=i.props.name,o.form=i.props.form,o.autoFocus=i.props.autoFocus,o.placeholder=i.props.placeholderText,o.disabled=i.props.disabled,o.autoComplete=i.props.autoComplete,o.className=Mp(d.props.className,c),o.title=i.props.title,o.readOnly=i.props.readOnly,o.required=i.props.required,o.tabIndex=i.props.tabIndex,o),f))},i.renderClearButton=function(){var e=i.props,t=e.isClearable,r=e.disabled,o=e.selected,a=e.startDate,s=e.endDate,l=e.clearButtonTitle,u=e.clearButtonClassName,c=void 0===u?"":u,d=e.ariaLabelClose,p=void 0===d?"Close":d,f=e.selectedDates,m=e.readOnly;return!t||m||null==o&&null==a&&null==s&&!(null==f?void 0:f.length)?null:n().createElement("button",{type:"button",className:Mp("react-datepicker__close-icon",c,{"react-datepicker__close-icon--disabled":r}),disabled:r,"aria-label":p,onClick:i.onClearClick,title:l,tabIndex:-1})},i.state=i.calcInitialState(),i.preventFocusTimeout=void 0,i}return QA(r,t),Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:hD,readOnly:!1,rangeSeparator:" - ",withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:12,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(e,t){var n,r,o,i,a,s;e.inline&&(a=e.selected,s=this.props.selected,a&&s?RI(a)!==RI(s)||jI(a)!==jI(s):a!==s)&&this.setPreSelection(this.props.selected),void 0!==this.state.monthSelectedIn&&e.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&0!==this.state.monthSelectedIn&&this.setState({monthSelectedIn:0}),e.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:NP(this.props.highlightDates)}),t.focused||pP(e.selected,this.props.selected)||this.setState({inputValue:null}),t.open!==this.state.open&&(!1===t.open&&!0===this.state.open&&(null===(r=(n=this.props).onCalendarOpen)||void 0===r||r.call(n)),!0===t.open&&!1===this.state.open&&(null===(i=(o=this.props).onCalendarClose)||void 0===i||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var e=this.props,t=e.showIcon,r=e.icon,o=e.calendarIconClassname,i=e.calendarIconClassName,a=e.toggleCalendarOnIconClick,s=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),n().createElement("div",{className:"react-datepicker__input-container".concat(t?" react-datepicker__view-calendar-icon":"")},t&&n().createElement(yD,zA({icon:r,className:Mp(i,!i&&o,s&&"react-datepicker-ignore-onclickoutside")},a?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var e=this.renderCalendar();if(this.props.inline)return e;if(this.props.withPortal){var t=this.state.open?n().createElement(wD,{enableTabLoop:this.props.enableTabLoop},n().createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},e)):null;return this.state.open&&this.props.portalId&&(t=n().createElement(gD,zA({portalId:this.props.portalId},this.props),t)),n().createElement("div",null,this.renderInputContainer(),t)}return n().createElement(SD,zA({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:e,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(e.Component),OD="input",_D="navigate",ED=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/react-datepicker/dist/react-datepicker.css"),CD={};CD.styleTagTransform=kl(),CD.setAttributes=bl(),CD.insert=yl().bind(null,"head"),CD.domAPI=hl(),CD.insertStyleElement=Sl(),fl()(ED.A,CD),ED.A&&ED.A.locals&&ED.A.locals;var ID=["width","height","color"];function TD(){return TD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TD.apply(null,arguments)}var AD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ID);return n().createElement("svg",TD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",fill:s}))};AD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const PD=AD;var DD=["width","height","color"];function jD(){return jD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jD.apply(null,arguments)}var RD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,DD);return n().createElement("svg",jD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},l),n().createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03 .65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",fill:s}))};RD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const MD=RD;var LD=["width","height","color"];function ND(){return ND=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ND.apply(null,arguments)}var FD=function(e){var t=e.width,r=void 0===t?20:t,o=e.height,i=void 0===o?20:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,LD);return n().createElement("svg",ND({width:r,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},"aria-hidden":"true"},l),n().createElement("path",{d:"M18 6L6 18M6 6l12 12",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))};FD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const VD=FD;var BD=["width","height","color"];function qD(){return qD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qD.apply(null,arguments)}var QD=function(e){var t=e.width,r=void 0===t?15:t,o=e.height,i=void 0===o?15:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,BD);return n().createElement("svg",qD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n().createElement("circle",{cx:"12",cy:"12",r:"3"}))};QD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const zD=QD;var $D=["width","height","color"];function UD(){return UD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UD.apply(null,arguments)}var WD=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,$D);return n().createElement("svg",UD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"3 6 5 6 21 6"}),n().createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"}))};WD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const HD=WD;var GD=["width","height","color"];function YD(){return YD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YD.apply(null,arguments)}var KD=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,GD);return n().createElement("svg",YD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"15 18 9 12 15 6"}))};KD.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const XD=KD;var ZD=["width","height","color"];function JD(){return JD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JD.apply(null,arguments)}var ej=function(e){var t=e.width,r=void 0===t?14:t,o=e.height,i=void 0===o?14:o,a=e.color,s=void 0===a?"currentColor":a,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ZD);return n().createElement("svg",JD({width:r,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"}},l),n().createElement("polyline",{points:"9 18 15 12 9 6"}))};ej.propTypes={width:o().oneOfType([o().number,o().string]),height:o().oneOfType([o().number,o().string]),color:o().string};const tj=ej;var nj=function(e,t,n,r){return e.length===t.length&&n&&r?{original:e,masked:We(e,n,r,t)}:{original:e,masked:e}};function rj(e){return rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rj(e)}var oj=["selectedDate","onChange","label","required","placeholder","dateFormat","styleName","header","cardListContext","questionId","disabled","startDate","endDate","value","maskingType","maskingLength","inputProps","tooltip","showQuestionLabels","userModified","testId","testIdRoot","data-testid","customTheme"];function ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ij(Object(n),!0).forEach(function(t){sj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sj(e,t,n){return(t=function(e){var t=function(e){if("object"!=rj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uj(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cj(){return cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cj.apply(null,arguments)}var dj=n().forwardRef(function(e,t){return n().createElement("input",cj({type:"text"},e,{ref:t}))});dj.displayName="DatePickerInput";var pj=function(t){var r=t.selectedDate,o=t.onChange,i=t.label,a=t.required,s=t.placeholder,l=t.dateFormat,u=void 0===l?"MM/dd/yyyy":l,c=t.styleName,d=t.header,p=t.cardListContext,f=t.questionId,m=t.disabled,h=t.startDate,v=t.endDate,y=t.value,g=t.maskingType,b=t.maskingLength,w=t.inputProps,S=void 0===w?{}:w,x=t.tooltip,k=void 0===x?"":x,O=t.showQuestionLabels,_=void 0===O||O,E=t.userModified,C=void 0!==E&&E,I=t.testId,T=t.testIdRoot,A=(t["data-testid"],t.customTheme),P=void 0===A?{}:A,D=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,oj),j=sd(),R=(0,e.useMemo)(function(){var e=j.dateField||{};return YS(e,P)},[j,P]),M=(0,e.useRef)(""),L=(0,e.useRef)(y),N=(0,e.useRef)(""),F=S["data-item-index"],V=S["data-parent-id"],B=g&&b,q=lj((0,e.useState)(!1),2),Q=q[0],z=q[1],$=lj((0,e.useState)({original:"",masked:""}),2),U=$[0],W=$[1],H=(0,e.useMemo)(function(){return Boolean(B&&function(e,t,n,r,o){if(e)return!1;if(!r||!o||"string"!=typeof n||!n)return!1;var i=null!=t?String(t):"";if(!i.trim())return!1;if(i.includes("*"))return!0;var a=$e(i,n);if(a.length!==n.length)return!1;var s=nj(a,n,r,o).masked;return Boolean(s&&s.includes("*"))}(C,y,u,g,b))},[C,y,B,u,g,b]),G=Boolean(m),Y=G||H,K=(0,e.useMemo)(function(){var e=aj(aj({},R.container),{},{width:"100%"});return{container:KS(e,R.responsive),input:ZS(R.input,Y&&R.disabled)}},[R,Y]),X=(0,e.useMemo)(function(){if(void 0!==y&&""!==y){if(y.length===u.length)try{var e=xa(y,u,new Date);if(e&&!Number.isNaN(e.getTime()))return e}catch(e){return null}return null}return r instanceof Date&&!Number.isNaN(r.getTime())?r:null},[y,r,u]),Z=void 0!==y&&""!==y?$e(y,u):"",J=lj((0,e.useState)(X),2),ee=J[0],te=J[1],ne=lj((0,e.useState)(Z),2),re=ne[0],ie=ne[1],ae=lj((0,e.useState)(!1),2),se=ae[0],le=ae[1],ue=(0,e.useRef)(!1);(0,e.useEffect)(function(){!ue.current&&Z&&(W(nj(Z,u,B?g:void 0,B?b:void 0)),M.current=Z,N.current=Z,ue.current=!0)},[]);var ce=(0,e.useMemo)(function(){return B?Q?U.original:U.masked:U.original||re||(y?$e(y,u):"")},[U,Q,B,re,y,u]),de=function(e){if("string"!=typeof e||!e)return!1;var t=/M/.test(e),n=/y/.test(e),r=/[dD]/.test(e);return t&&n&&!r}(u),pe=function(e,t){ie(e),M.current=e,N.current=e,W(nj(e,u,B?g:void 0,B?b:void 0)),void 0!==t&&te(t)};(0,e.useEffect)(function(){var e=y!==L.current;L.current=y,function(e,t,n){if(void 0===e||""===e)return!1;var r=$e(e,u);return function(e,t){return se?N.current===e&&(le(!1),!0):!t}(r,t)||(t||N.current!==r?(le(!1),pe(r,n)):n&&te(n)),!0}(y,e,X)||function(e,t){if(e&&!t){if(se)return!0;var n=Va(e,u);return N.current===n?te(e):pe(n,e),!0}return!1}(X,y)||function(e,t){!e&&!t&&(se||""!==N.current&&(ie(""),N.current="",W({original:"",masked:""}),te(null)))}(y,X)},[y,X,u,se,B,g,b]);var fe=void 0===F?f:"".concat(f,"-").concat(F),me={position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},he=Boolean(B&&H&&!G),ve=Boolean(B&&C&&!H),ye=(0,e.useMemo)(function(){return n().createElement(dj,{"data-testid":I,style:K.input})},[I,K.input]);return n().createElement("div",{className:"form-field ".concat(c||""),style:K.container},d&&n().createElement("div",{className:"field-header",style:j.header},d),_&&i&&n().createElement("div",{className:"question_label",style:j.label},i,a&&n().createElement("span",{className:"required-mark",style:j.required},"*"),k&&n().createElement(hO,{tooltip:k})),n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(kD,cj({selected:ee,onChange:function(e){if(!H){le(!1);var t=e?Va(e,u):"";o&&t!==M.current&&o({target:{value:t,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}),te(e),ie(t),M.current=t,N.current=t,W(nj(t,u,B?g:void 0,B?b:void 0))}},onChangeRaw:function(e){var t;if(!H&&null!=(null===(t=e.target)||void 0===t?void 0:t.value)){le(!0);var n=e.target.value||"",r=B&&!Q&&(null==U?void 0:U.original)?function(e,t,n,r){return function(e,t,n,r,o){var i,a,s=(null==t||null===(i=t.nativeEvent)||void 0===i?void 0:i.inputType)||"",l=((null==t||null===(a=t.nativeEvent)||void 0===a?void 0:a.data)||"").replace(oe,""),u=n.replace(oe,"");if("insertText"===s&&l){var c="".concat(u).concat(l);return Ue(c,r,u)}if("deleteContentBackward"===s||"deleteContentForward"===s){var d=u.slice(0,Math.max(0,u.length-1));return Ue(d,r,u)}var p=e.replace(oe,"");return Ue(p,r,o)}(e,t,n.original,r,M.current)}(n,e,U,u):Ue(n,u,M.current);r!==M.current&&(e.target.value=r,ie(r),M.current=r,N.current=r,B?function(e,t,n,r){W(nj(e,t,n,r))}(r,u,g,b):W({original:r,masked:r}),null==o||o({target:{value:r,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}),function(e,t){e.length===t.length?te(function(e,t){if(e.length===t.length){try{var n=xa(e,t,new Date);if(n&&!Number.isNaN(n.getTime()))return n}catch(e){}return null}return e.length>0&&(e.length,t.length),null}(e,t)):(e.length>0&&e.length<t.length||""===e)&&te(null)}(r,u))}},onBlur:function(e){le(!1);var t=B?U.original:re;t&&t!==M.current&&o&&o({target:{value:t,name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p})},onKeyDown:function(e){"Backspace"===e.key&&B&&z(!0)},dateFormat:u,placeholderText:s||"Enter date (".concat(u,")"),value:B?ce:re},D,{name:fe,customInput:ye,showMonthYearPicker:de,peekNextMonth:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",dateFormatCalendar:"MMMM",autoComplete:"off",disabled:Y,minDate:h,maxDate:v,allowSameDay:!0,strictParsing:!1})),he&&n().createElement("button",{type:"button",name:"clearMaskedPrefill",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-clear-icon",onClick:function(){G||(z(!1),W({original:"",masked:""}),ie(""),te(null),le(!1),M.current="",N.current="",null==o||o({target:{value:"",name:f,type:"date","data-item-index":F,"data-parent-id":V},cardListContext:p}))},title:"Clear to enter a new value","aria-label":"Clear masked value to enter a new value",style:me,"data-testid":dd(T,"clear-privacy")},n().createElement(VD,{width:18,height:18})),ve&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return z(!Q)},title:Q?"Hide value":"Show value","aria-label":Q?"Hide sensitive information":"Show sensitive information",style:me,"data-testid":dd(T,"toggle-visibility")},Q?n().createElement(MD,null):n().createElement(PD,null))))};pj.propTypes={selectedDate:o().instanceOf(Date),onChange:o().func,label:o().string,required:o().bool,placeholder:o().string,dateFormat:o().string,styleName:o().string,header:o().string,cardListContext:o().object,questionId:o().string,disabled:o().bool,startDate:o().oneOfType([o().string,o().instanceOf(Date)]),endDate:o().oneOfType([o().string,o().instanceOf(Date)]),value:o().string,theme:o().object,customTheme:o().object,maskingType:o().oneOf(["prefix","suffix"]),maskingLength:o().number,inputProps:o().object,tooltip:o().string,showQuestionLabels:o().bool,userModified:o().bool,testId:o().string,testIdRoot:o().string,"data-testid":o().string};const fj=pj;function mj(e){return mj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mj(e)}function hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hj(Object(n),!0).forEach(function(t){yj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yj(e,t,n){return(t=function(e){var t=function(e){if("object"!=mj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gj={sanitizeValue:function(e){return IC.sanitize("string"==typeof e?e:String(null!=e?e:""),DC).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}},bj=function(e){return{__html:RC("string"==typeof e?e:String(null!=e?e:""))}},wj=function(t){var r,o=t.name,i=t.value,a=void 0===i?"":i,s=t.label,l=void 0===s?"":s,u=t.className,c=void 0===u?"":u,d=t.customTheme,p=void 0===d?{}:d,f=t.styleName,m=void 0===f?"":f,h=t.parentContext,v=void 0===h?{}:h,y=t.tooltip,g=void 0===y?"":y,b=t.showQuestionLabels,w=void 0===b||b,S=t.testId,x=Vc(),k=x.state,O=x.formSchema,_=k.values,E=void 0===_?{}:_,C=k.nestedStates,I=void 0===C?{}:C,T=sd(),A=null!==(r=null!=a?a:E[o])&&void 0!==r?r:"",P=(0,e.useMemo)(function(){return l?mr(l,E,I,v,O||[],gj):l},[l,E,I,v,O]),D=(0,e.useMemo)(function(){return mr(A,E,I,v,O||[],gj)},[A,E,I,v,O]),j=(0,e.useMemo)(function(){var e=T.displayTextField||T.textField||{};return YS(e,p)},[T,p]),R=(0,e.useMemo)(function(){var e=vj(vj({},j.container),{},{width:"100%"});return{container:KS(e,j.responsive),label:ZS(j.label),content:ZS(j.content)}},[j]),M=(0,e.useMemo)(function(){return P?bj(P):null},[P]),L=(0,e.useMemo)(function(){return D?bj(D):null},[D]);return n().createElement("div",{className:"display-text-field-container",style:R.container,"data-testid":S},w&&M&&n().createElement("div",{className:"question_label ".concat(c," ").concat(m||""),style:R.label},n().createElement("span",{dangerouslySetInnerHTML:M}),g&&n().createElement(hO,{tooltip:g})),L&&n().createElement("div",{className:"display-text-field__content ".concat(c," ").concat(m||""),style:R.content,dangerouslySetInnerHTML:L}))};wj.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,className:o().string,customTheme:o().object,styleName:o().string,parentContext:o().object,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string};const Sj=wj;function xj(e){return xj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xj(e)}function kj(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Oj(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Oj(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Oj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Oj(d,"constructor",u),Oj(u,"constructor",l),l.displayName="GeneratorFunction",Oj(u,o,"GeneratorFunction"),Oj(d),Oj(d,o,"Generator"),Oj(d,r,function(){return this}),Oj(d,"toString",function(){return"[object Generator]"}),(kj=function(){return{w:i,m:p}})()}function Oj(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Oj=function(e,t,n,r){function i(t,n){Oj(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Oj(e,t,n,r)}function _j(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Ej(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){_j(i,r,o,a,s,"next",e)}function s(e){_j(i,r,o,a,s,"throw",e)}a(void 0)})}}function Cj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ij(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cj(Object(n),!0).forEach(function(t){Tj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tj(e,t,n){return(t=function(e){var t=function(e){if("object"!=xj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pj(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pj(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Dj=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.disabled,u=t.className,c=t.loadOptions,d=t.apiUrl,p=t.apiBaseUrl,f=t.dependsOn,m=t.formData,h=t.customTheme,v=void 0===h?{}:h,y=t.inputProps,g=void 0===y?{}:y,b=t.styleName,w=t.onChange,S=t.testIdRoot,x=sd(),k=Aj((0,e.useState)([]),2),O=k[0],_=k[1],E=Aj((0,e.useState)(!1),2),C=E[0],I=E[1],T=Aj((0,e.useState)(""),2),A=T[0],P=T[1],D=g["data-item-index"],j=g["data-parent-id"],R=(0,e.useMemo)(function(){var e=x.dynamicDropdownField||x.selectField||{};return YS(e,v)},[x,v]),M=(0,e.useMemo)(function(){var e=Ij(Ij({},R.container),{},{width:"100%"}),t=ZS(R.select,l&&R.disabled,C&&R.loading,A&&R.error);return{container:KS(e,R.responsive),select:t,placeholder:R.placeholder,loadingIndicator:R.loadingIndicator,errorMessage:R.errorMessage}},[R,l,C,A]);(0,e.useEffect)(function(){var e=function(){var e=Ej(kj().m(function e(t,n){var r,o,i;return kj().w(function(e){for(;;)switch(e.n){case 0:return r=p?"".concat(p.replace(/\/$/,""),"/").concat(t.replace(/^\//,"")):t,e.n=1,fetch(r);case 1:if((o=e.v).ok){e.n=2;break}throw new Error("Failed to fetch options");case 2:return e.n=3,o.json();case 3:return i=e.v,e.a(2,i.users.map(function(e){return{value:e.value||e.id,label:e.label||e.name}}))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),t=function(){var t=Ej(kj().m(function t(){var n,r,o;return kj().w(function(t){for(;;)switch(t.p=t.n){case 0:if(c||d){t.n=1;break}return t.a(2);case 1:if(t.p=1,I(!0),P(""),n=null==f?void 0:f.reduce(function(e,t){return e[t]=m[t],e},{}),!c){t.n=3;break}return t.n=2,c(n);case 2:r=t.v,t.n=5;break;case 3:if(!d){t.n=5;break}return t.n=4,e(d,n);case 4:r=t.v;case 5:_(r||[]),t.n=7;break;case 6:t.p=6,o=t.v,P("Failed to load options"),console.error("Error loading options:",o);case 7:return t.p=7,I(!1),t.f(7);case 8:return t.a(2)}},t,null,[[1,6,7,8]])}));return function(){return t.apply(this,arguments)}}();(!f||f.every(function(e){return m[e]}))&&t()},[c,d,p,f,m]);var L=function(e){w&&(null==w||w(e))};return n().createElement(zO,{name:r,label:o,validation:a,className:"dynamic-dropdown-field ".concat(b||""," ").concat(u||""),customTheme:R,error:A,value:i,renderInput:function(e){var t=e.value,o=e.disabled;return C?n().createElement("div",{style:M.loadingIndicator},"Loading options..."):n().createElement("select",{name:void 0===D?r:"".concat(r,"-").concat(D),value:t||"",onChange:L,disabled:o||C,style:M.select,"data-item-index":D,"data-parent-id":j,"data-testid":dd(S,"trigger")},s&&n().createElement("option",{value:"",style:M.placeholder},s),O.map(function(e){return n().createElement("option",{key:e.value,value:e.value,"data-testid":dd(S,"option",e.value)},e.label)}))}},A&&n().createElement("div",{style:M.errorMessage},A))};function jj(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(Rj(e)+" is not iterable")}function Rj(e){return Rj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rj(e)}function Mj(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return Lj(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Lj(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Lj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Lj(d,"constructor",u),Lj(u,"constructor",l),l.displayName="GeneratorFunction",Lj(u,o,"GeneratorFunction"),Lj(d),Lj(d,o,"Generator"),Lj(d,r,function(){return this}),Lj(d,"toString",function(){return"[object Generator]"}),(Mj=function(){return{w:i,m:p}})()}function Lj(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Lj=function(e,t,n,r){function i(t,n){Lj(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Lj(e,t,n,r)}function Nj(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Fj(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Nj(i,r,o,a,s,"next",e)}function s(e){Nj(i,r,o,a,s,"throw",e)}a(void 0)})}}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(t){qj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qj(e,t,n){return(t=function(e){var t=function(e){if("object"!=Rj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rj(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Dj.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),validation:o().object,placeholder:o().string,disabled:o().bool,className:o().string,loadOptions:o().func,apiUrl:o().string,apiBaseUrl:o().string,dependsOn:o().arrayOf(o().string),formData:o().object,customTheme:o().object,inputProps:o().object,styleName:o().string,onChange:o().func,testIdRoot:o().string};var Qj=["localhost","127.0.0.1"],zj=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(e=null==t?void 0:t.uploadRequestTimeoutMs)&&void 0!==e?e:null==t?void 0:t.UPLOAD_REQUEST_TIMEOUT_MS,r=Number(n);return Number.isFinite(r)&&r>0?r:6e5},$j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t){if(t.startsWith("http://")||t.startsWith("https://"))return t;var n=e||"",r=t.startsWith("/")?"":"/";return"".concat(n).concat(r).concat(t)}return e||""},Uj=function(e){var t,n={Accept:"application/json"},r=(null==e||null===(t=e.customApi)||void 0===t?void 0:t.headers)||{};r.Authorization&&(n.Authorization=r.Authorization);var o=r.carrierauthorization||r.Carrierauthorization||r.CarrierAuthorization||r["Carrier-Auth"]||r.CarrierAuth||r["carrier-authorization"]||null;return o&&(n.carrierauthorization=o),n},Wj=function(e,t){return e?t:Bj({"Content-Type":"application/json"},t)},Hj=function(e,t){return e?t:null!=t?JSON.stringify(t):void 0},Gj=function(){var e=Fj(Mj().m(function e(t){var n;return Mj().w(function(e){for(;;)switch(e.n){case 0:if(!(t.headers.get("Content-Type")||"").includes("application/json")){e.n=2;break}return e.n=1,t.json();case 1:n=e.v,e.n=4;break;case 2:return e.n=3,t.text();case 3:n=e.v;case 4:return e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),Yj=function(e){return"string"!=typeof e?null:e.trim()||null},Kj=function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Upload failed";if(null==e)return o;var i=Yj(e);if(i)return i;if("object"!==Rj(e))return o;var a=Yj(e.data);if(a)return a;for(var s=0,l=[null===(t=e.status)||void 0===t?void 0:t.message,null===(n=e.data)||void 0===n?void 0:n.message,e.message,null===(r=e.data)||void 0===r?void 0:r.data];s<l.length;s++){var u=Yj(l[s]);if(u)return u}return o},Xj=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Upload failed";if(function(e){var t,n;if(null==e||"object"!==Rj(e))return!0;var r=null!==(t=null===(n=e.status)||void 0===n?void 0:n.code)&&void 0!==t?t:e.statusCode;return null==r||""===r||200===Number(r)}(e))return e;var o=new Error(Kj(e,r));throw o.status=null!==(t=null==e||null===(n=e.status)||void 0===n?void 0:n.code)&&void 0!==t?t:null==e?void 0:e.statusCode,o.data=e,o},Zj=function(e,t){var n=new Error(Kj(e,t.statusText||"Request failed"));return n.status=t.status,n.data=e,n},Jj=function(e){var t=new Error(e);return t.code="REQUEST_URL_NOT_ALLOWED",t.data=null,t},eR=function(e,t){var n,r,o,i,a,s=String(null!=e?e:""),l=(null===(n=Ml.document)||void 0===n?void 0:n.baseURI)||(null===(r=Ml.location)||void 0===r?void 0:r.href);try{a=new URL(s,l)}catch(e){if(!l)return s;throw Jj("Request blocked: invalid URL")}var u=null===(o=Ml.location)||void 0===o?void 0:o.origin;if(u&&"null"!==u&&a.origin===u)return a.href;var c="http:"===a.protocol&&Qj.includes(a.hostname);if("https:"!==a.protocol&&!c)throw Jj("Request blocked: HTTPS is required");var d=null==t||null===(i=t.customApi)||void 0===i?void 0:i.allowedAbsoluteHosts;if(Array.isArray(d)&&d.length>0&&!d.map(function(e){return String(null!=e?e:"").trim().toLowerCase()}).includes(a.host))throw Jj("Request blocked: host is not allowed");return a.href},tR=function(e,t,n){if(t>=n)return!1;if("AbortError"===(null==e?void 0:e.name))return!1;var r=null==e?void 0:e.status;return!(null!=r&&r>=400&&r<500&&429!==r)&&(null==r||r>=500||429===r)},nR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S;return Mj().w(function(e){for(;;)switch(e.n){case 0:n=t.url,r=t.method,o=void 0===r?"GET":r,i=t.headers,a=void 0===i?{}:i,s=t.body,l=void 0===s?void 0:s,u=t.isFormData,c=void 0!==u&&u,d=t.timeoutMs,p=void 0===d?3e4:d,f=t.apiConfig,h=eR(n,m=void 0===f?{}:f),v=Number((null==m?void 0:m.MAX_API_ATTEMPTS)||3),y=Bj(Bj({},Uj(m)),a),b=Mj().m(function e(){var t,n,r,i,a,s,u,d,f,b;return Mj().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=new AbortController,n=setTimeout(function(){t.abort(new DOMException("Request timed out","TimeoutError"))},p),e.p=1,i=Wj(c,y),a=Hj(c,l),s=(null==m||null===(r=m.customApi)||void 0===r?void 0:r.credentials)||(null==m?void 0:m.credentials)||"omit",e.n=2,fetch(h,{method:o,headers:i,body:a,credentials:s,mode:"cors",signal:t.signal});case 2:return u=e.v,e.n=3,Gj(u);case 3:if(d=e.v,!u.ok){e.n=4;break}return e.a(2,{v:d});case 4:throw Zj(d,u);case 5:if(e.p=5,b=e.v,g=b,!tR(b,S,v)){e.n=7;break}return f=300*Math.pow(2,S-1),e.n=6,new Promise(function(e){return setTimeout(e,f)});case 6:e.n=8;break;case 7:return e.a(2,0);case 8:return e.p=8,clearTimeout(n),e.f(8);case 9:return e.a(2)}},e,null,[[1,5,8,9]])}),S=1;case 1:if(!(S<=v)){e.n=5;break}return e.d(jj(b()),2);case 2:if(0!==(w=e.v)){e.n=3;break}return e.a(3,5);case 3:if(!w){e.n=4;break}return e.a(2,w.v);case 4:S++,e.n=1;break;case 5:throw g||new Error("Request failed");case 6:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),rR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return o=u.length>1&&void 0!==u[1]?u[1]:{},(i=new FormData).append("file",t),a=(null==o||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",s=(null==o||null===(r=o.customApi)||void 0===r?void 0:r.convertToPdfUrl)||"",l=$j(a,s),e.a(2,nR({url:l,method:"POST",body:i,isFormData:!0,timeoutMs:zj(o),apiConfig:o}))},e)}));return function(t){return e.apply(this,arguments)}}(),oR=function(){var e=Fj(Mj().m(function e(t,n){var r,o,i,a,s,l,u=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return a=(null==(i=u.length>2&&void 0!==u[2]?u[2]:{})||null===(r=i.customApi)||void 0===r?void 0:r.baseUrl)||"",s=(null==i||null===(o=i.customApi)||void 0===o?void 0:o.uploadUrl)||"",l="".concat($j(a,s),"?caseId=").concat(encodeURIComponent(n||""),"&user=agent"),e.a(2,nR({url:l,method:"POST",body:t,timeoutMs:zj(i),apiConfig:i}))},e)}));return function(t,n){return e.apply(this,arguments)}}(),iR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s,l,u,c,d,p,f=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return i=f.length>1&&void 0!==f[1]?f[1]:{},(a=new FormData).append("files",t),s=(null==i||null===(n=i.customApi)||void 0===n?void 0:n.baseUrl)||"",l=(null==i||null===(r=i.customApi)||void 0===r?void 0:r.uploadUrl)||"",u=$j(s,l),c=(null==i||null===(o=i.customApi)||void 0===o||null===(o=o.headers)||void 0===o?void 0:o.Authorization)||"",d=c.replace(/^Bearer\s+/i,""),p=Bj({Accept:"application/json"},d?{adminToken:d}:{}),e.a(2,nR({url:u,method:"POST",headers:p,body:a,isFormData:!0,timeoutMs:zj(i),apiConfig:Bj(Bj({},i),{},{customApi:Bj(Bj({},i.customApi||{}),{},{headers:{}})})}))},e)}));return function(t){return e.apply(this,arguments)}}(),aR=function(){var e=Fj(Mj().m(function e(t,n,r){var o,i,a,s,l,u,c=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return s=(null==(a=c.length>3&&void 0!==c[3]?c[3]:{})||null===(o=a.customApi)||void 0===o?void 0:o.baseUrl)||"",l=(null==a||null===(i=a.customApi)||void 0===i?void 0:i.deleteUrl)||"",u="".concat($j(s,l),"?caseId=").concat(encodeURIComponent(n||""),"&documentId=").concat(encodeURIComponent(t||""),"&questionId=").concat(encodeURIComponent(r||"")),e.a(2,nR({url:u,method:"DELETE",apiConfig:a}))},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),sR=function(e){var t=null==e?void 0:e.data;return t&&"object"===Rj(t)&&!1===t.valid?(Array.isArray(t.errors)?t.errors:[]).map(function(e){return Yj(null==e?void 0:e.message)}).filter(Boolean):[]},lR=function(){var e=Fj(Mj().m(function e(t){var n,r,o,i,a,s=arguments;return Mj().w(function(e){for(;;)if(0===e.n)return i=(null==(o=s.length>1&&void 0!==s[1]?s[1]:{})||null===(n=o.customApi)||void 0===n?void 0:n.baseUrl)||"",a=(null==o||null===(r=o.customApi)||void 0===r||null===(r=r.welisIllustration)||void 0===r?void 0:r.extractUrl)||"",e.a(2,nR({url:$j(i,a),method:"POST",body:t,timeoutMs:zj(o),apiConfig:Bj(Bj({},o),{},{MAX_API_ATTEMPTS:1})}))},e)}));return function(t){return e.apply(this,arguments)}}();function uR(e){return uR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uR(e)}var cR=function(e){var t,r,o,i,a,s=e.file,l=e.index,u=e.errorItemStyle,c=e.includeExtraDropDowns,d=e.uploadQuestionAdditionalDropDown,p=e.allowDelete,f=e.disabled,m=e.fieldError,h=e.onDocumentTypeChange,v=e.onView,y=e.onDelete,g=e.testIdRoot,b=dd(g,"item",l),w=s.fileName||s.name||"",S=(null==d||null===(t=d[0])||void 0===t?void 0:t.title)||(null==d||null===(r=d[0])||void 0===r?void 0:r.label)||"Attachment Type",x=null!==(o=null==d||null===(i=d[0])||void 0===i?void 0:i.options)&&void 0!==o?o:[],k=void 0===s.dropDownOptionSelection||null===s.dropDownOptionSelection||""===String(s.dropDownOptionSelection||"").trim();return n().createElement("tr",{"data-testid":b},n().createElement("td",{className:"ff-table__cell ff-table__cell--doc-name"},n().createElement("button",{type:"button",className:"ff-table__cell--link",onClick:function(){return v(s)},title:w,"aria-label":"Preview ".concat(w||"document")},w)),c&&(null==d?void 0:d.length)>0&&n().createElement("td",{className:"ff-table__cell ff-table__cell--doc-type"},n().createElement("select",{value:null!==(a=s.dropDownOptionSelection)&&void 0!==a?a:"",onChange:function(e){return h(l,e.target.value)},disabled:f,className:"ff-doc-type-select","aria-label":"Document type for ".concat(w||"file"),"data-testid":dd(b,"doc-type")},n().createElement("option",{value:"",disabled:!0},"Select Attachment"),x.map(function(e){var t="object"===uR(e)&&null!==e?e.value:e,r="object"===uR(e)&&null!==e?e.label:e;return n().createElement("option",{key:null!=t?t:r,value:null!=t?t:r},null!=r?r:t)})),k&&n().createElement("span",{style:u},m?Array.isArray(m)?m[0]:"string"==typeof m&&m.split(", ").filter(Boolean)[0]||m:"Provide ".concat(S.toLowerCase()))),n().createElement("td",{className:"ff-table__cell"},s.fileType||(s.fileName?s.fileName.split(".").pop().toUpperCase():"")),n().createElement("td",{className:"ff-table__cell"},null!=s.fileSize?$s(Qs(s.fileSize)):"0 Bytes"),n().createElement("td",{className:"ff-table__cell"},n().createElement("div",{className:"ff-action-group"},n().createElement("button",{type:"button",className:"ff-action-btn ff-action-btn--view",onClick:function(){return v(s)},"aria-label":"Preview ".concat(w||"document"),title:"View document","data-testid":dd(b,"view")},n().createElement(zD,{width:15,height:15})),p&&n().createElement("button",{type:"button",className:"ff-action-btn ff-action-btn--delete",onClick:function(){return y(l)},"aria-label":"Delete ".concat(w||"document"),title:"Delete document",disabled:f,"data-testid":dd(b,"delete")},n().createElement(HD,{width:14,height:14})))))};cR.propTypes={file:o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,name:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),dropDownOptionSelection:o().string}).isRequired,index:o().number.isRequired,errorItemStyle:o().object,includeExtraDropDowns:o().bool.isRequired,uploadQuestionAdditionalDropDown:o().array,allowDelete:o().bool.isRequired,disabled:o().bool.isRequired,fieldError:o().oneOfType([o().string,o().arrayOf(o().string),o().oneOf([null])]),onDocumentTypeChange:o().func.isRequired,onView:o().func.isRequired,onDelete:o().func.isRequired,testIdRoot:o().string};const dR=cR;function pR(e){return pR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pR(e)}function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(t){hR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hR(e,t,n){return(t=function(e){var t=function(e){if("object"!=pR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vR(e){return vR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vR(e)}function yR(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=SR(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function gR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return bR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(bR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,bR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,bR(d,"constructor",u),bR(u,"constructor",l),l.displayName="GeneratorFunction",bR(u,o,"GeneratorFunction"),bR(d),bR(d,o,"Generator"),bR(d,r,function(){return this}),bR(d,"toString",function(){return"[object Generator]"}),(gR=function(){return{w:i,m:p}})()}function bR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bR=function(e,t,n,r){function i(t,n){bR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},bR(e,t,n,r)}function wR(e){return function(e){if(Array.isArray(e))return xR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||SR(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SR(e,t){if(e){if("string"==typeof e)return xR(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xR(e,t):void 0}}function xR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(t){_R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _R(e,t,n){return(t=function(e){var t=function(e){if("object"!=vR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ER(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function CR(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ER(i,r,o,a,s,"next",e)}function s(e){ER(i,r,o,a,s,"throw",e)}a(void 0)})}}var IR=function(e){var t;return!0===(null==e||null===(t=e.customApi)||void 0===t?void 0:t.isThirdPartyUpload)};function TR(e){return((null==e?void 0:e.name)||"").toLowerCase().endsWith(".pdf")||"application/pdf"===((null==e?void 0:e.type)||"").toLowerCase()}function AR(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){var e=r.result||"",n=e.includes(",")?e.slice(e.indexOf(",")+1):e;t(n)},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)})}function PR(e,t){return DR.apply(this,arguments)}function DR(){return(DR=CR(gR().m(function e(t,n){var r,o,i,a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S,x,k,O,_,E,C,I,T,A,P,D,j,R,M,L,N,F,V,B,q,Q,z,$;return gR().w(function(e){for(;;)switch(e.n){case 0:if(s=n.questionId,l=n.apiConfig,u=n.uploadQuestionAdditionalDropDown,c=void 0===u?[]:u,d=n.currentFiles,p=void 0===d?[]:d,f=n.onUploaded,m={dropDownTitle:(null==c||null===(r=c[0])||void 0===r?void 0:r.label)||(null==c||null===(o=c[0])||void 0===o?void 0:o.title)||"Attachment Type",dropDownOptionSelection:""},!IR(l)){e.n=3;break}return e.n=1,AR(t);case 1:return g=e.v,b=t.type||"application/octet-stream",w="data:".concat(b,";base64,").concat(g),S=OR({id:void 0,value:void 0,fileName:t.name||"document",base64Response:w,fileType:(null===(h=(t.name||"").split(".").pop())||void 0===h?void 0:h.toLowerCase())||"",fileSize:t.size},m),x=[].concat(wR(p),[S]),e.n=2,iR(t,l);case 2:return k=e.v,Xj(k,"Upload failed"),O=(null==k?void 0:k.data)||k||{},_=wR(x),E=_.length-1,_[E]=OR(OR({},_[E]),{},{id:null!==(v=O.id)&&void 0!==v?v:void 0,value:O.value||O.fileUrl||O.url||void 0,fileName:O.actualFileName||O.fileName||_[E].fileName,fileType:O.fileType||_[E].fileType,fileSize:null!==(y=O.fileSize)&&void 0!==y?y:_[E].fileSize,base64Response:w,s3_key:O.s3_keys}),null==f||f({fileName:_[E].fileName,base64Response:w}),e.a(2,_);case 3:if(!TR(t)){e.n=5;break}return e.n=4,AR(t);case 4:T=e.v,C={questionId:s,fileUploads:OR({fileName:t.name||"document.pdf",base64Response:"data:application/pdf;base64,".concat(T),fileSize:t.size,fileType:"pdf"},m)},I=OR({id:void 0,value:void 0,fileName:t.name||"document.pdf",base64Response:C.fileUploads.base64Response,fileType:"pdf",fileSize:t.size},m),e.n=7;break;case 5:return e.n=6,rR(t,l);case 6:M=e.v,Xj(M,"Failed to convert file to PDF"),L=null==M||null===(A=M.data)||void 0===A?void 0:A.fileData,N=(null==M||null===(P=M.data)||void 0===P?void 0:P.fileName)||(null==t?void 0:t.name)||"document.pdf",F=null!==(D=null!==(j=null==M||null===(R=M.data)||void 0===R?void 0:R.fileSize)&&void 0!==j?j:null==t?void 0:t.size)&&void 0!==D?D:0,C={questionId:s,fileUploads:OR({fileName:N,base64Response:"data:application/pdf;base64,".concat(L),fileSize:F,fileType:"pdf"},m)},I=OR({id:void 0,value:void 0,fileName:C.fileUploads.fileName,base64Response:C.fileUploads.base64Response,fileType:"pdf",fileSize:F},m);case 7:return V=[].concat(wR(p),[I]),B=(null==l||null===(i=l.customApi)||void 0===i||null===(i=i.headers)||void 0===i?void 0:i.caseId)||(null==l?void 0:l.caseId),e.n=8,oR(C,B,l);case 8:return q=e.v,Xj(q,"Upload failed"),Q=(null==q?void 0:q.data)||{},z=wR(V),$=z.length-1,z[$]=OR(OR({},z[$]),{},{id:Q.id,value:Q.value,fileName:Q.actualFileName||z[$].fileName,fileType:Q.fileType||"pdf",fileSize:null!==(a=Q.fileSize)&&void 0!==a?a:z[$].fileSize,base64Response:null}),null==f||f({fileName:z[$].fileName,base64Response:C.fileUploads.base64Response}),e.a(2,z)}},e)}))).apply(this,arguments)}function jR(e){return RR.apply(this,arguments)}function RR(){return(RR=CR(gR().m(function e(t){var n,r,o,i,a;return gR().w(function(e){for(;;)if(0===e.n){n=[],r=yR(t);try{for(r.s();!(o=r.n()).done;){i=o.value;try{(i instanceof File?i.type:i.type||"").startsWith("image/")||(i.fileName||"").match(_e)?i instanceof File?(a=URL.createObjectURL(i),n.push(a)):i.base64Response?n.push(i.base64Response):n.push(null):n.push(null)}catch(e){console.error("Preview generation error:",e),n.push(null)}}}catch(e){r.e(e)}finally{r.f()}return e.a(2,n)}},e)}))).apply(this,arguments)}var MR=["application/pdf","image/png","image/jpeg","image/jpg","image/gif","image/webp"];var LR=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/styles/FileField.scss"),NR={};function FR(e){return FR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FR(e)}NR.styleTagTransform=kl(),NR.setAttributes=bl(),NR.insert=yl().bind(null,"head"),NR.domAPI=hl(),NR.insertStyleElement=Sl(),fl()(LR.A,NR),LR.A&&LR.A.locals&&LR.A.locals;var VR=["questionId","label","value","validation","multiple","disabled","className","maxFileSize","maxFiles","showPreview","allowDelete","onError","customTheme","styleName","includeExtraDropDowns","uploadQuestionAdditionalDropDown","allowedFileType","fileSizeLimit","numberOfFiles","errorMessage","apiConfig","fileUploads","testId","testIdRoot"];function BR(){return BR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BR.apply(null,arguments)}function qR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(t){zR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zR(e,t,n){return(t=function(e){var t=function(e){if("object"!=FR(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FR(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $R(e){return function(e){if(Array.isArray(e))return XR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||KR(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return WR(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(WR(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,WR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,WR(d,"constructor",u),WR(u,"constructor",l),l.displayName="GeneratorFunction",WR(u,o,"GeneratorFunction"),WR(d),WR(d,o,"Generator"),WR(d,r,function(){return this}),WR(d,"toString",function(){return"[object Generator]"}),(UR=function(){return{w:i,m:p}})()}function WR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}WR=function(e,t,n,r){function i(t,n){WR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},WR(e,t,n,r)}function HR(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function GR(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){HR(i,r,o,a,s,"next",e)}function s(e){HR(i,r,o,a,s,"throw",e)}a(void 0)})}}function YR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||KR(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KR(e,t){if(e){if("string"==typeof e)return XR(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XR(e,t):void 0}}function XR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ZR=function(e){var t,n;return{status:null==e?void 0:e.status,code:null!==(t=null==e?void 0:e.code)&&void 0!==t?t:null==e||null===(n=e.data)||void 0===n||null===(n=n.status)||void 0===n?void 0:n.code,message:null==e?void 0:e.message}},JR=function(t){var r,o,i=t.questionId,a=t.label,s=t.value,l=void 0===s?null:s,u=t.validation,c=void 0===u?{}:u,d=t.multiple,p=void 0!==d&&d,f=t.disabled,m=void 0!==f&&f,h=t.className,v=void 0===h?"":h,y=t.maxFileSize,g=void 0===y?5242880:y,b=t.maxFiles,w=void 0===b?5:b,S=t.showPreview,x=void 0===S||S,k=t.allowDelete,O=void 0===k||k,_=t.onError,E=t.customTheme,C=void 0===E?{}:E,I=t.styleName,T=t.includeExtraDropDowns,A=void 0!==T&&T,P=t.uploadQuestionAdditionalDropDown,D=void 0===P?[]:P,j=t.allowedFileType,R=t.fileSizeLimit,M=t.numberOfFiles,L=(t.errorMessage,t.apiConfig),N=t.fileUploads,F=t.testId,V=t.testIdRoot,B=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,VR),q=Vc(),Q=q.state,z=q.setValue,$=sd(),U="string"==typeof(o=B.addressGroup)&&"wellis_illustration_file"===o.trim().toLowerCase(),W=(0,e.useRef)(null),H=YR((0,e.useState)(N||[]),2),G=H[0],Y=H[1],K=YR((0,e.useState)([]),2),X=K[0],Z=K[1],J=YR((0,e.useState)([]),2),ee=J[0],te=J[1],ne=YR((0,e.useState)(!1),2),re=ne[0],oe=ne[1],ie=YR((0,e.useState)(!1),2),ae=ie[0],se=ie[1],le=YR((0,e.useState)(1),2),ue=le[0],ce=le[1],de=YR((0,e.useState)(function(){var e=N;return null!=e&&e.length?null==e?void 0:e.map(function(){var e;return(null===(e=D[0])||void 0===e||null===(e=e.options[0])||void 0===e?void 0:e.value)||""}):[]}),2),pe=de[0],fe=de[1],me=(null==Q||null===(r=Q.errors)||void 0===r?void 0:r[i])||null,he=(0,e.useMemo)(function(){var e=$.fileField||{};return YS(e,C)},[$,C]),ve=(0,e.useMemo)(function(){return function(e,t,n){var r=mR(mR({},e.container),{},{width:"100%"}),o=mR(mR({},ZS(e.dropzone,t&&e.dropzoneActive,n&&e.dropzoneDisabled)),{},{borderWidth:"1px",borderStyle:"dashed",borderColor:t?"#25A2CF":n?"#D1D5DB":"#25A2CF",backgroundColor:n?"#F5F5F5":t?"rgba(37, 162, 207, 0.1)":"rgba(37, 162, 207, 0.05)"});return{container:KS(r,e.responsive),dropzone:o,input:e.input,previewContainer:e.previewContainer,previewItem:e.previewItem,previewImage:e.previewImage,previewIcon:e.previewIcon,deleteBtn:e.deleteButton,error:e.error,errorList:e.errorList,errorItem:e.errorItem}}(he,re,m)},[he,re,m]);(0,e.useEffect)(function(){try{var e,t,n=(null==D||null===(e=D[0])||void 0===e?void 0:e.label)||(null==D||null===(t=D[0])||void 0===t?void 0:t.title)||"Attachment Type",r=qs({value:l,fileUploads:N,dropdownTitle:n});Array.isArray(r)&&r.length>0&&(Y(r),jR(r).then(Z))}catch(e){console.error("Error initializing file field:",e)}},[]);var ye=$S({questionId:i,defaultValue:l,defaultVisible:!0,defaultDisabled:m}).handleChange,ge=(0,e.useCallback)(function(e){e._contextValue;var t,r,o,a=e.onChange,s=e.disabled,l=function(){var e=GR(UR().m(function e(t){var n;return UR().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),t.stopPropagation(),!s){e.n=1;break}return e.a(2);case 1:return oe(!1),n=Array.from(t.dataTransfer.files),e.n=2,d(n);case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),u=function(){var e=GR(UR().m(function e(t){var n,r;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!s){e.n=1;break}return e.a(2);case 1:return n=t.target,r=Array.from(n.files||[]),e.p=2,e.n=3,d(r);case 3:return e.p=3,n.value="",e.f(3);case 4:return e.a(2)}},e,null,[[2,,3,4]])}));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=GR(UR().m(function e(t){var n,r,o,l,u,c,d;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!s){e.n=1;break}return e.a(2);case 1:if(n=G[t],e.p=2,null==n||!n.id){e.n=3;break}return o=(null==L||null===(r=L.customApi)||void 0===r||null===(r=r.headers)||void 0===r?void 0:r.caseId)||(null==L?void 0:L.caseId),e.n=3,aR(n.id,o,i,L);case 3:e.n=5;break;case 4:e.p=4,d=e.v,console.warn("Failed to delete document from server, removing locally:",ZR(d));case 5:l=G.filter(function(e,n){return n!==t}),u=X.filter(function(e,n){return n!==t}),te([]),Y(l),Z(u),c=Math.max(1,Math.ceil(l.length/3)),ue>c&&ce(c),a({value:l,fileUploads:l}),z(i,l);case 6:return e.a(2)}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=GR(UR().m(function e(t){var n,r,o,s,l,u,c,d,p,f,m,h,v,y,g;return UR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.length){e.n=1;break}return e.a(2);case 1:if(n=$R(G),r=t[0],o=zs([r],{allowedFileType:j,fileSizeLimit:R,numberOfFiles:M},n,null),!(s=o.error)){e.n=2;break}return te([]),El(s,"error"),null==_||_(s),e.a(2);case 2:return te([]),se(!0),e.p=3,u=null,e.n=4,PR(r,{questionId:i,apiConfig:L,uploadQuestionAdditionalDropDown:D,currentFiles:n,onUploaded:function(e){u=e}});case 4:if(c=e.v,Y(c),a({value:c,fileUploads:c}),z(i,c,null,null,{},"upload"),jR(c).then(Z),ce(Math.ceil(c.length/3)),!U||null===(l=u)||void 0===l||!l.base64Response){e.n=9;break}return e.p=5,e.n=6,lR({caseId:(null==L||null===(d=L.customApi)||void 0===d||null===(d=d.headers)||void 0===d?void 0:d.caseId)||(null==L?void 0:L.caseId)||"",fileName:u.fileName,base64:u.base64Response},L);case 6:if(p=e.v,!(sR(p).length>0)){e.n=7;break}throw(f=new Error("WELIS illustration validation failed")).data=p,f;case 7:Xj(p,"Illustration extraction failed"),e.n=9;break;case 8:e.p=8,y=e.v,console.error("WELIS illustration extraction error:",ZR(y)),m=sR(null==y?void 0:y.data),h=m.length>0?m:[Kj(null==y?void 0:y.data,(null==y?void 0:y.message)||"Illustration extraction failed")],te(h),null==_||_(h.join(" "));case 9:e.n=11;break;case 10:e.p=10,g=e.v,console.error("Upload error:",ZR(g)),v=Kj(null==g?void 0:g.data,(null==g?void 0:g.message)||"Upload failed"),El(v,"error"),null==_||_(v);case 11:return e.p=11,se(!1),e.f(11);case 12:return e.a(2)}},e,null,[[5,8],[3,10,11,12]])}));return function(t){return e.apply(this,arguments)}}(),p=function(e,t){var n=$R(G);n[e]=QR(QR({},n[e]),{},{dropDownOptionSelection:t}),a({value:n.map(function(e){return{fileName:e.fileName,base64Response:e.base64Response,fileSize:e.fileSize,fileType:e.fileType,dropDownTitle:e.dropDownTitle,dropDownOptionSelection:e.dropDownOptionSelection}}),fileUploads:n}),z(i,n),ye(n),Y(n)},f=function(e){!1===function(e,t){var n=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==t||null===(e=t.customApi)||void 0===e?void 0:e.s3BucketUrl)||""}(t);if(null!=e&&e.value&&n){try{var r,o=new URL(n.endsWith("/")?n:"".concat(n,"/")),i=String(e.value).trim().split("/").filter(Boolean).map(function(e){return encodeURIComponent(e)}).join("/"),a=new URL(i,o);null===(r=Ml.open)||void 0===r||r.call(Ml,a.toString(),"_blank","noopener")}catch(t){var s;null===(s=Ml.open)||void 0===s||s.call(Ml,"".concat(n,"/").concat(e.value),"_blank","noopener")}return!0}if(null!=e&&e.base64Response){var l=String(e.base64Response||"").trim();if(!Ee.test(l))return!1;var u=Ml.open?Ml.open():null;if(u){var c=function(e){if("string"!=typeof e)return null;var t=e.trim();if(!t.toLowerCase().startsWith("data:"))return null;var n=t.indexOf(",");if(-1===n)return null;var r=t.slice(5,n),o=t.slice(n+1),i=r.split(";").map(function(e){return e.trim()}).filter(Boolean),a=i[0]||"",s=i.some(function(e){return"base64"===e.toLowerCase()});return s&&a?{mimeType:a,base64:o}:null}(l);if(MR.includes(String((null==c?void 0:c.mimeType)||"").toLowerCase())){if(null!=c&&c.mimeType)try{var d,p=function(e){for(var t=Ml.atob?Ml.atob(e):atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r+=1)n[r]=t.charCodeAt(r);return n}(c.base64),f=new Blob([p],{type:c.mimeType}),m=URL.createObjectURL(f);return u.location.href=m,null===(d=u.addEventListener)||void 0===d||d.call(u,"beforeunload",function(){return URL.revokeObjectURL(m)}),!0}catch(e){}return u.location.href=l,!0}var h=u.document;h.open(),h.write("<!DOCTYPE html><html><head><title>Preview</title></head><body></body></html>"),h.close();var v=h.createElement("style");v.textContent="body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; } iframe { width: 100%; height: 100%; border: none; }",h.head.appendChild(v);var y=h.createElement("iframe");y.setAttribute("sandbox","allow-downloads"),y.referrerPolicy="no-referrer",y.src=l,h.body.appendChild(y),u.opener=null}return!0}return!1}(e,L)&&El("Preview is not available for this file.","error")},m=!M||!Array.isArray(G)||G.length<M,h=j?j.split(",").map(function(e){return e.trim().startsWith(".")?e.trim().toLowerCase():".".concat(e.trim().toLowerCase())}).join(","):void 0;return n().createElement("section",{onDragOver:function(e){e.preventDefault(),e.stopPropagation(),s||oe(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),oe(!1)},onDrop:l,style:ve.container,"aria-label":"File upload area"},m&&n().createElement("div",{className:"ff-dropzone-wrapper".concat(ae?" ff-dropzone-wrapper--uploading":"")},n().createElement("input",{ref:W,type:"file",accept:h,multiple:!1,onChange:u,disabled:s||ae,style:ve.input,"data-testid":F}),n().createElement("button",{type:"button",className:"ff-dropzone",style:QR(QR({},ve.dropzone),{},{cursor:s||ae?"not-allowed":"pointer",width:"100%",textAlign:"center"}),onClick:function(){W.current&&!s&&W.current.click()},"aria-label":"Click to upload or drag and drop a file",disabled:s||ae,"aria-disabled":s||ae,"data-testid":dd(V,"upload")},n().createElement("svg",{className:"ff-dropzone__icon",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},n().createElement("path",{d:"M12 16V4M12 4L7.5 8.5M12 4L16.5 8.5M5 14V19C5 19.5523 5.44772 20 6 20H18C18.5523 20 19 19.5523 19 19V14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})),n().createElement("span",{className:"ff-dropzone__title"},"Click to Upload or Drag and Drop"),j&&n().createElement("span",{className:"ff-dropzone__hint"},"Allowed file types: ",n().createElement("strong",null,j.toUpperCase()))),ae&&n().createElement("div",{className:"ff-upload-overlay",role:"status","aria-live":"polite"},n().createElement("div",{className:"ff-upload-spinner","aria-hidden":"true"}),n().createElement("span",{className:"ff-upload-label"},"Uploading..."))),G.length>0&&(t=Math.max(1,Math.ceil(G.length/3)),r=3*(ue-1),o=G.slice(r,r+3),n().createElement("div",{className:"ff-file-manager"},n().createElement("h3",{className:"ff-file-manager__title"},"File Manager"),n().createElement("table",{className:"ff-table"},n().createElement("thead",{className:I||""},n().createElement("tr",null,n().createElement("th",{className:"ff-table__header ff-table__header--doc-name"},"Document Name"),A&&D.length>0&&n().createElement("th",{className:"ff-table__header ff-table__header--doc-type"},"Document Type"),n().createElement("th",{className:"ff-table__header"},"File Type"),n().createElement("th",{className:"ff-table__header"},"Size"),n().createElement("th",{className:"ff-table__header"},"Action"))),n().createElement("tbody",null,o.map(function(e,t){var o,i,a=r+t;return n().createElement(dR,{key:null!==(o=null!==(i=e.id)&&void 0!==i?i:e.value)&&void 0!==o?o:"file-".concat(a),file:e,index:a,errorItemStyle:ve.errorItem,includeExtraDropDowns:A,uploadQuestionAdditionalDropDown:D,allowDelete:O,disabled:s,fieldError:me,onDocumentTypeChange:p,onView:f,onDelete:c,testIdRoot:V})}))),t>1&&n().createElement("div",{className:"ff-pagination",role:"navigation","aria-label":"File list pagination","data-testid":dd(V,"pagination")},n().createElement("span",{className:"ff-pagination__count"},"Showing"," ",n().createElement("strong",null,r+1,"–",Math.min(r+3,G.length))," ","of ",n().createElement("strong",null,G.length)," files"),n().createElement("div",{className:"ff-pagination__controls"},n().createElement("button",{type:"button",className:"ff-pagination__btn ff-pagination__btn--nav",onClick:function(){return ce(function(e){return Math.max(e-1,1)})},disabled:1===ue,"aria-label":"Previous page","data-testid":dd(V,"pagination","prev")},n().createElement(XD,null),"Prev"),Array.from({length:t},function(e,t){return t+1}).map(function(e){return n().createElement("button",{key:e,type:"button",className:"ff-pagination__btn ff-pagination__btn--page".concat(ue===e?" ff-pagination__btn--active":""),onClick:function(){return ce(e)},"aria-label":"Page ".concat(e),"aria-current":ue===e?"page":void 0,"data-testid":dd(V,"pagination","page",e)},e)}),n().createElement("button",{type:"button",className:"ff-pagination__btn ff-pagination__btn--nav",onClick:function(){return ce(function(e){return Math.min(e+1,t)})},disabled:ue===t,"aria-label":"Next page","data-testid":dd(V,"pagination","next")},"Next",n().createElement(tj,null)))))),ee.length>0&&n().createElement("ul",{className:"ff-error-list",style:ve.errorList,role:"alert","data-testid":dd(V,"errors")},ee.map(function(e,t){return n().createElement("li",{key:"error-".concat(e,"-").concat(t),className:"error-message",style:ve.errorItem},e)})))},[G,X,ee,re,ae,pe,fe,ue,ce,v,I,p,w,g,x,_,U]);return n().createElement($O,BR({label:a,value:l,validation:c,disabled:m,className:v,renderInput:ge,styleName:I,customTheme:C},B,{name:i}))},eM=n().memo(JR);JR.propTypes={testId:o().string,testIdRoot:o().string,questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().array,o().object,o().string,o().oneOf([null])]),validation:o().object,multiple:o().bool,disabled:o().bool,className:o().string,maxFileSize:o().number,maxFiles:o().number,showPreview:o().bool,allowDelete:o().bool,onError:o().func,customTheme:o().object,styleName:o().string,includeExtraDropDowns:o().bool,uploadQuestionAdditionalDropDown:o().arrayOf(o().shape({options:o().array})),allowedFileType:o().string,fileSizeLimit:o().number,numberOfFiles:o().number,errorMessage:o().string,addressGroup:o().string,apiConfig:o().shape({caseId:o().string,customApi:o().shape({headers:o().shape({caseId:o().string})})}),fileUploads:o().oneOfType([o().arrayOf(o().shape({id:o().oneOfType([o().string,o().number]),value:o().string,fileName:o().string,fileType:o().string,fileSize:o().oneOfType([o().number,o().string]),base64Response:o().string,dropDownTitle:o().string,dropDownOptionSelection:o().string})),o().oneOf([null])])},eM.propTypes=JR.propTypes;const tM=eM;var nM=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/HyperlinkField.css"),rM={};rM.styleTagTransform=kl(),rM.setAttributes=bl(),rM.insert=yl().bind(null,"head"),rM.domAPI=hl(),rM.insertStyleElement=Sl(),fl()(nM.A,rM),nM.A&&nM.A.locals&&nM.A.locals;var oM=function(e){var t=e.name,r=e.label,o=e.value,i=e.validation,a=e.className,s=e.customTheme,l=void 0===s?{}:s,u=e.tooltip,c=void 0===u?"":u,d=e.testId,p=sd(),f=YS(p.hyperlinkField||{},l);return n().createElement(zO,{name:String(t),label:r,value:o,validation:i,className:"hyperlink-field ".concat(a||""),customTheme:f,renderLabel:function(e){var t=e.label,r=e.isRequired;return n().createElement("div",{style:f.container,"data-testid":d},n().createElement("div",{style:f.label,dangerouslySetInnerHTML:{__html:RC(t,{addAttr:PC})}}),r&&n().createElement("span",{style:f.required},"*"),c&&n().createElement(hO,{tooltip:c}))},renderInput:function(){return null}})};oM.displayName="HyperlinkField",oM.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,className:o().string,customTheme:o().object,tooltip:o().string,testId:o().string};var iM=n().memo(oM);function aM(e){return aM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aM(e)}function sM(){return sM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sM.apply(null,arguments)}function lM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(t){cM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cM(e,t,n){return(t=function(e){var t=function(e){if("object"!=aM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=aM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}iM.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,target:o().string,validation:o().object,disabled:o().bool,className:o().string,customTheme:o().object,tooltip:o().string,testId:o().string};var pM=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"SSN must be 9 digits":Ne.test(t)?"":"Invalid SSN format"}return""},fM=function(e){if(e){var t=e.replace(/\D/g,"");return 9!==t.length?"ITIN must be 9 digits":Fe.test(t)?"":"ITIN must start with 9"}return""},mM=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.type,l=void 0===s?"ssn":s,u=t.masked,c=void 0===u||u,d=t.disabled,p=t.className,f=t.customTheme,m=void 0===f?{}:f,h=t.testId,v=t.testIdRoot,y=sd(),g=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(c),2),b=g[0],w=g[1],S=YS(y.identificationField||{},m),x=function(){w(!b)},k=function(e){if(!e||!b)return e;var t=e.split("-");return 3===t.length?"XXX-XX-".concat(t[2]):"XXX-XX-"+e.slice(-4)};return n().createElement(zO,{name:r,label:o,value:i,validation:uM(uM({},a),{},{custom:"ssn"===l?pM:fM}),className:"identification-field ".concat(p||""),customTheme:S,renderInput:function(e){return n().createElement("div",{style:S.container},n().createElement("div",{style:S.fieldGroup},n().createElement("div",{style:S.row},n().createElement("div",{style:S.field},n().createElement("input",sM({},e,{type:"text",maxLength:11,disabled:d,autoComplete:"off",style:uM(uM({},S.input),d&&S.disabled),value:k(e.value),onChange:function(t){return function(e,t){t(function(e){if(e){var t=e.replace(oe,""),n=t.match(Le);return n?"".concat(n[1],"-").concat(n[2],"-").concat(n[3]):t}return""}(e.target.value))}(t,e.onChange)},"data-testid":h})),i&&n().createElement("button",{type:"button",onClick:x,style:uM(uM({},S.actionButton),{},{marginLeft:"8px"}),disabled:d,"data-testid":dd(v,"toggle-visibility")},b?"Show":"Hide"))),n().createElement("div",{style:S.hint},"ssn"===l?"Format: XXX-XX-XXXX":"Format: 9XX-XX-XXXX")))}})};mM.propTypes={name:o().string.isRequired,label:o().string,value:o().string,validation:o().object,type:o().oneOf(["ssn","itin"]),masked:o().bool,disabled:o().bool,className:o().string,customTheme:o().object,testId:o().string,testIdRoot:o().string};var hM=function(e,t){if(t)return"text";switch(null==e?void 0:e.toLowerCase()){case"ssn":case"itin":case"tin":case"currency":case"percentage":default:return"text";case"phonenumber":case"phone":case"mobile":return"tel";case"number":return"number"}};function vM(e){return vM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vM(e)}var yM=["questionId","questionType","maskInput","maskingType","maskingLength","minLength","maxLength","value","onChange","type","userModified"];function gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(t){wM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wM(e,t,n){return(t=function(e){var t=function(e){if("object"!=vM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var kM=function(t){var r=t.questionId,o=t.questionType,i=void 0===o?"number":o,a=t.maskInput,s=t.maskingType,l=t.maskingLength,u=t.minLength,c=t.maxLength,d=t.value,p=t.onChange,f=t.type,m=t.userModified,h=void 0!==m&&m,v=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,yM),y=Vc().setValue,g=Boolean(v.disabled),b=(0,e.useMemo)(function(){var e=a?Ls(a):c||0;return{maskInput:a||null,maskingType:s||null,maskingLength:l||0,minLength:u||0,maxLength:e}},[a,s,l,u,c]),w=(0,e.useMemo)(function(){return"text"===f||"text"===(null==i?void 0:i.toLowerCase())},[f,i]),S=(0,e.useMemo)(function(){return function(e,t,n,r){return!n&&!e&&!t&&"number"===(null==r?void 0:r.toLowerCase())}(a,s,w,i)},[a,s,w,i]),x=SM((0,e.useState)(!1),2),k=x[0],O=x[1],_=SM((0,e.useState)({original:"",masked:""}),2),E=_[0],C=_[1],I=(0,e.useRef)(null),T=(0,e.useMemo)(function(){var e,t;if(h)return!1;var n=null!=d?String(d):"";return!(!n.trim()||!b.maskingType||!b.maskingLength||!n.includes("*")&&(k||null===(e=E.masked)||void 0===e||!e.includes("*"))&&(!k||null===(t=E.original)||void 0===t||!t.includes("*")))},[h,b.maskingType,b.maskingLength,d,E.masked,E.original,k]),A=(0,e.useMemo)(function(){return b.maskingType&&b.maskingLength?k?E.original:E.masked:E.original||d},[E,k,b,d]);(0,e.useEffect)(function(){if(d||E.original||E.masked){var e=d||"";if(b.maskingType&&b.maskingLength){var t=Fs(e,{maskInput:b.maskInput,maskingType:b.maskingType,maskingLength:b.maskingLength,questionType:i});C(t),nt(r,y,t.original,e,I,v)}else if(b.maskInput){var n=Ns(e,b.maskInput,i);C({original:n,masked:n}),nt(r,y,n,e,I,v)}else C({original:e,masked:e})}},[d,b,i]);var P=(0,e.useMemo)(function(){return w?"text":"numeric"},[w]),D=(0,e.useMemo)(function(){return function(e){return["ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"].includes(null==e?void 0:e.toLowerCase())?"[0-9]*":void 0}(i)},[i]),j=bM(bM({questionId:r},v),{},{disabled:g||T,type:b.maskInput||S?"text":hM(f||i,b.maskingType),value:A,onChange:function(e){var t,n,r;if(!T){var o=(null===(t=e.target.value)||void 0===t?void 0:t.toString())||"",a=(null==e||null===(n=e.nativeEvent)||void 0===n?void 0:n.inputType)||"",s=(null==e||null===(r=e.nativeEvent)||void 0===r?void 0:r.data)||"",l=function(e,t,n,r,o,i,a,s){if(Boolean(r.maskInput)&&!o&&!s&&String(null!=d?d:"").includes("*"))return e?"insertText"===t&&n?w?n.replace(se,""):n.replace(oe,""):Is(e,a,r.maskInput):"";if(r.maskingType&&r.maskingLength&&!o){var l,u=Is((null==i?void 0:i.original)||"",a,r.maskInput)||"",c=null!==(l=null==i?void 0:i.masked)&&void 0!==l?l:"";if(!e)return"";if("insertText"===t&&n)return"".concat(u).concat(n);if("deleteContentBackward"===t||"deleteContentForward"===t||"deleteByCut"===t){var p=c.length-e.length;if(p>0){var f=Math.min(p,u.length);return u.slice(0,Math.max(0,u.length-f))}return Is(e,a,r.maskInput)}return Is(e,a,r.maskInput)}return Is(e,a,r.maskInput)}(o,a,w?s.replace(se,""):S?s.replace(ae,""):s.replace(oe,""),b,k,E,i,h);l=function(e,t){if("percentage"!==t)return e;var n=e.replace(ie,""),r=Number.parseFloat(n);return Number.isNaN(r)||r<=100?n:"100"}(l,i);var u=w?(l||"").replace(se,"").length:(l||"").replace(oe,"").length;b.maxLength&&u>b.maxLength||function(e,t,n,r){if(n.maskingType&&n.maskingLength){var o=Fs(t,{maskInput:n.maskInput,maskingType:n.maskingType,maskingLength:n.maskingLength,questionType:r});C(o),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:o.original})}))}else if(n.maskInput){var i=Ns(t,n.maskInput,r);C({original:i,masked:i}),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:i})}))}else C({original:t,masked:t}),p&&p(bM(bM({},e),{},{target:bM(bM({},e.target),{},{value:t})}))}(e,l,b,i)}},maskInput:null,inputMode:P,inputProps:bM(bM({},v.inputProps),{},{maxLength:c,pattern:D,inputMode:P}),minLength:u,maxLength:a?a.length:c});b.maskingType&&(j._maskingType=b.maskingType),b.maskingLength&&(j._maskingLength=b.maskingLength);var R=Boolean(b.maskingType&&b.maskingLength&&T&&!g),M=Boolean(b.maskingType&&b.maskingLength&&h&&!T),L=k?"Hide":"Show",N=k?n().createElement(MD,null):n().createElement(PD,null),F={position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#666",fontSize:"18px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1};return n().createElement("div",{style:{position:"relative",display:"inline-block",width:"100%"}},n().createElement(SO,j),R&&n().createElement("button",{type:"button",name:"clearMaskedPrefill",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-clear-icon",onClick:function(){if(!g){I.current=null,O(!1),C({original:"",masked:""});var e=v["data-parent-id"]?{cardListId:v["data-parent-id"],instanceIndex:v["data-item-index"]}:null;y(r,"",null,e,{markUserModified:!0})}},title:"Clear to enter a new value","aria-label":"Clear masked value to enter a new value",style:F},n().createElement(VD,{width:18,height:18})),M&&n().createElement("button",{type:"button",name:"passwordEye",className:"font-16 material-icons-outlined cursor-pointer text-primary password-icon mask-eye-icon",onClick:function(){return O(function(e){return!e})},title:"".concat(L," value"),"aria-label":"".concat(L," sensitive information"),style:F},N))};kM.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,questionType:o().oneOf(["text","ssn","itin","phonenumber","currency","number","percentage","phone","tel","mobile","tin"]),value:o().oneOfType([o().string,o().number]),maskInput:o().string,maskingType:o().oneOfType([o().oneOf(["prefix","suffix"]),o().oneOf([null,void 0])]),maskingLength:o().oneOfType([o().number,o().oneOf([null])]),minLength:o().number,maxLength:o().number,onChange:o().func,type:o().string,validation:o().object,required:o().bool,placeholder:o().string,helperText:o().string,userModified:o().bool,disabled:o().bool,inputProps:o().object,tooltip:o().string};const OM=kM;var _M=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./src/styles/PasswordField.scss"),EM={};function CM(e){return CM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CM(e)}EM.styleTagTransform=kl(),EM.setAttributes=bl(),EM.insert=yl().bind(null,"head"),EM.domAPI=hl(),EM.insertStyleElement=Sl(),fl()(_M.A,EM),_M.A&&_M.A.locals&&_M.A.locals;var IM=["name","label","required","disabled","defaultValue","placeholder","showPasswordStrength","showPasswordRequirements","passwordRequirements","validationErrorMessages","onChange","error","type","customTheme","styleName","tooltip","testId","testIdRoot"];function TM(){return TM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TM.apply(null,arguments)}function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(t){DM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DM(e,t,n){return(t=function(e){var t=function(e){if("object"!=CM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=CM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return RM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RM(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var MM=function(t){var r=t.name,o=t.label,i=t.required,a=t.disabled,s=t.defaultValue,l=void 0===s?"":s,u=t.placeholder,c=t.showPasswordStrength,d=void 0!==c&&c,p=t.showPasswordRequirements,f=void 0!==p&&p,m=t.passwordRequirements,h=void 0===m?["At least 8 characters","At least one uppercase letter","At least one lowercase letter","At least one number","At least one special character"]:m,v=t.validationErrorMessages,y=t.onChange,g=t.error,b=t.type,w=void 0===b?"password":b,S=t.customTheme,x=void 0===S?{}:S,k=t.styleName,O=t.tooltip,_=void 0===O?"":O,E=t.testId,C=t.testIdRoot,I=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,IM),T=sd(),A=jM((0,e.useState)(!1),2),P=A[0],D=A[1],j=jM((0,e.useState)(l),2),R=j[0],M=j[1],L=jM((0,e.useState)(0),2),N=L[0],F=L[1],V=(0,e.useMemo)(function(){var e=T.passwordField||T.textField||{};return YS(e,x)},[T,x]),B=(0,e.useMemo)(function(){var e=PM(PM({},V.container),{},{width:"100%"});return{container:KS(e,V.responsive),input:ZS(V.input,g&&V.error,a&&V.disabled),strengthBar:V.strengthBar||{},strengthLabel:V.strengthLabel||{},requirements:V.requirements||{},requirementMet:V.requirementMet||{},toggleButton:V.toggleButton||{}}},[V,g,a]),q=function(e){var t,n,o=e.target.value;if(M(o),d){var i=(n=0,(t=o).length>=8&&(n+=20),t.length>=12&&(n+=10),/[A-Z]/.test(t)&&(n+=20),/[a-z]/.test(t)&&(n+=20),/\d/.test(t)&&(n+=20),/[^A-Za-z0-9]/.test(t)&&(n+=20),n);F(i)}y&&y({target:{name:r,value:o}})},Q=function(e){e.preventDefault(),D(!P)};return n().createElement($O,{name:String(r),label:o,value:R,required:i,validationErrorMessages:v,error:g,customTheme:V,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:V.label||{}},t,r&&n().createElement("span",{style:V.required||{}},"*"),_&&n().createElement(hO,{tooltip:_})):null},renderInput:function(){return n().createElement("div",{className:"password-field-container ".concat(k||""),style:B.container},n().createElement("div",{className:"password-input-wrapper"},n().createElement("input",TM({type:P?"text":w,id:String(r),name:String(r),value:R,onChange:q,disabled:a,placeholder:u,className:"password-input",style:B.input,autoComplete:"off"},I.inputProps,{"data-testid":E})),n().createElement("button",{type:"button",className:"toggle-password-button",onClick:Q,tabIndex:"-1","aria-label":P?"Hide password":"Show password",style:B.toggleButton,"data-testid":dd(C,"toggle")},P?"👁️":"🔒")),d&&R&&n().createElement("div",{className:"password-strength"},n().createElement("div",{className:"strength-bar-container"},n().createElement("div",{className:"strength-bar",style:PM(PM({},B.strengthBar),{},{width:"".concat(N,"%"),backgroundColor:LM(N)})})),n().createElement("span",{className:"strength-label",style:PM(PM({},B.strengthLabel),{},{color:LM(N)})},(e=N)>=90?"Very Strong":e>=70?"Strong":e>=40?"Medium":e>=20?"Weak":"Very Weak")),f&&n().createElement("ul",{className:"password-requirements",style:B.requirements},h.map(function(e,t){var r=function(e){switch(e){case"At least 8 characters":return R.length>=8;case"At least one uppercase letter":return/[A-Z]/.test(R);case"At least one lowercase letter":return/[a-z]/.test(R);case"At least one number":return/\d/.test(R);case"At least one special character":return/[^A-Za-z0-9]/.test(R);default:return!1}}(e);return n().createElement("li",{key:"requirement-".concat(e,"-").concat(t),className:"requirement ".concat(r?"met":""),style:r?B.requirementMet:{}},r?"✓":"○"," ",e)})));var e}})};MM.propTypes={testId:o().string,testIdRoot:o().string,name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,required:o().bool,disabled:o().bool,defaultValue:o().string,placeholder:o().string,showPasswordStrength:o().bool,showPasswordRequirements:o().bool,passwordRequirements:o().arrayOf(o().string),validationErrorMessages:o().object,onChange:o().func,error:o().string,type:o().string,customTheme:o().object,styleName:o().string,tooltip:o().string,inputProps:o().object};var LM=function(e){return e>=90?"#4caf50":e>=70?"#8bc34a":e>=40?"#ffc107":e>=20?"#ff9800":"#f44336"};const NM=MM;function FM(e){return FM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},FM(e)}function VM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VM(Object(n),!0).forEach(function(t){qM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qM(e,t,n){return(t=function(e){var t=function(e){if("object"!=FM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=FM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==FM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QM=/^(https?:|blob:)/i,zM=function(t){var r=t.label,o=t.value,i=t.disabled,a=t.className,s=t.customTheme,l=void 0===s?{}:s,u=t.testId,c=sd(),d=YS(c.pdfField||{},l),p="string"==typeof o&&""!==o.trim(),f=r||"View PDF",m=(0,e.useCallback)(function(){try{(function(e){var t,n,r=String(e).trim();if(QM.test(r))return null===(n=Ml.open)||void 0===n||n.call(Ml,r,"_blank","noopener,noreferrer"),!0;var o=URL.createObjectURL(function(e){for(var t=e.startsWith("data:")?e.indexOf(","):-1,n=(t>=0?e.slice(t+1):e).replace(/\s/g,"").replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(n.length+(4-n.length%4)%4,"="),o=atob(r),i=new Uint8Array(o.length),a=0;a<o.length;a++)i[a]=o.charCodeAt(a);return new Blob([i],{type:"application/pdf"})}(r)),i=null===(t=Ml.open)||void 0===t?void 0:t.call(Ml,o,"_blank");return setTimeout(function(){return URL.revokeObjectURL(o)},6e4),Boolean(i)})(o)||console.warn("PDFField: the new tab was blocked by the browser popup blocker.")}catch(e){console.error("PDFField: unable to open PDF, value is not valid base64 or a URL.",e)}},[o]);return p?n().createElement("div",{style:d.container},n().createElement("button",{type:"button",style:BM(BM({},d.button),i&&d.disabled),onClick:m,disabled:i,className:"btn btn-primary btn-sm pdf-field-button ".concat(a||"").trim(),"data-testid":u,"aria-label":"".concat(f," (opens PDF in a new tab)")},f)):null};zM.propTypes={value:o().oneOfType([o().string,o().number,o().bool]),label:o().string,disabled:o().bool,className:o().string,customTheme:o().object,testId:o().string};const $M=zM;function UM(e){return UM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UM(e)}function WM(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return HM(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(HM(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,HM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,HM(d,"constructor",u),HM(u,"constructor",l),l.displayName="GeneratorFunction",HM(u,o,"GeneratorFunction"),HM(d),HM(d,o,"Generator"),HM(d,r,function(){return this}),HM(d,"toString",function(){return"[object Generator]"}),(WM=function(){return{w:i,m:p}})()}function HM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}HM=function(e,t,n,r){function i(t,n){HM(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},HM(e,t,n,r)}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GM(Object(n),!0).forEach(function(t){KM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KM(e,t,n){return(t=function(e){var t=function(e){if("object"!=UM(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UM(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UM(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XM(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ZM(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){XM(i,r,o,a,s,"next",e)}function s(e){XM(i,r,o,a,s,"throw",e)}a(void 0)})}}function JM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||eL(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eL(e,t){if(e){if("string"==typeof e)return tL(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tL(e,t):void 0}}function tL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nL,rL=function(t){var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.disabled,l=t.className,u=t.documents,c=t.onDownload,d=t.onPreview,p=t.customTheme,f=void 0===p?{}:p,m=t.testId,h=t.testIdRoot,v=sd(),y=YS(v.pdfPackageField||{},f),g=JM((0,e.useState)(i||[]),2),b=g[0],w=g[1],S=JM((0,e.useState)({}),2),x=S[0],k=S[1],O=function(){var e=ZM(WM().m(function e(t){return WM().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,k(function(e){return YM(YM({},e),{},KM({},t,!0))}),e.n=1,c(t);case 1:return e.p=1,k(function(e){return YM(YM({},e),{},KM({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}(),_=function(){var e=ZM(WM().m(function e(t){return WM().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,k(function(e){return YM(YM({},e),{},KM({},t,!0))}),e.n=1,d(t);case 1:return e.p=1,k(function(e){return YM(YM({},e),{},KM({},t,!1))}),e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}));return function(t){return e.apply(this,arguments)}}();return n().createElement(zO,{name:r,label:o,value:b,validation:a,className:l,customTheme:y,renderInput:function(){return n().createElement("div",{style:y.container,"data-testid":m},u.map(function(e){return n().createElement("div",{key:e.id,style:y.item,"data-testid":dd(h,"doc",e.id)},n().createElement("div",{style:y.itemHeader},n().createElement("input",{type:"checkbox",id:"doc-".concat(e.id),checked:b.includes(e.id),onChange:function(){return t=e.id,void w(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(function(e){return function(e){if(Array.isArray(e))return tL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||eL(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[t])});var t},disabled:s,style:YM(YM({},y.checkbox),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"checkbox")}),n().createElement("label",{htmlFor:"doc-".concat(e.id),style:y.label},e.name)),n().createElement("div",{style:y.description},e.description),n().createElement("div",{style:y.actions},n().createElement("button",{type:"button",onClick:function(){return _(e.id)},disabled:s||x[e.id],style:YM(YM(YM({},y.button),y.previewButton),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"preview")},x[e.id]?"Loading...":"Preview"),n().createElement("button",{type:"button",onClick:function(){return O(e.id)},disabled:s||x[e.id],style:YM(YM(YM({},y.button),y.downloadButton),s&&y.disabled),"data-testid":dd(h,"doc",e.id,"download")},x[e.id]?"Loading...":"Download")))}))}})};function oL(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function iL(){}function aL(e){return!!(e||"").match(/\d/)}function sL(e){return null==e}function lL(e){return sL(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function uL(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function cL(e,t){void 0===t&&(t=!0);var n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split(".");return{beforeDecimal:o[0],afterDecimal:o[1]||"",hasNegation:n,addNegation:r}}function dL(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function pL(e,t){return Array(t+1).join(e)}function fL(e){var t=e+"",n="-"===t[0]?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(!(i=Number(i)))return n+o;var a=1+i,s=(o=o.replace(".","")).length;return a<0?o="0."+pL("0",Math.abs(a))+o:a>=s?o+=pL("0",a-s):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function mL(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=(-1!==e.indexOf(".")||n)&&t,o=cL(e),i=o.beforeDecimal,a=o.afterDecimal,s=o.hasNegation,l=parseFloat("0."+(a||"0")),u=(a.length<=t?"0."+a:l.toFixed(t)).split("."),c=i;return i&&Number(u[0])&&(c=i.split("").reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},u[0])),(s?"-":"")+c+(r?".":"")+dL(u[1]||"",t,n)}function hL(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}rL.propTypes={name:o().string.isRequired,label:o().string,value:o().arrayOf(o().string),validation:o().object,disabled:o().bool,className:o().string,documents:o().arrayOf(o().shape({id:o().string.isRequired,name:o().string.isRequired,description:o().string})).isRequired,onDownload:o().func.isRequired,onPreview:o().func.isRequired,customTheme:o().object,testId:o().string,testIdRoot:o().string},function(e){e.event="event",e.props="prop"}(nL||(nL={}));var vL,yL,gL,bL=(vL=function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}},gL=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return yL&&e.length===yL.length&&e.every(function(e,t){return e===yL[t]})?gL:(yL=e,gL=vL.apply(void 0,e))});function wL(e){return Math.max(e.selectionStart,e.selectionEnd)}function SL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function xL(e,t,n,r){var o,i,a=e.length;if(o=t,i=a,t=Math.min(Math.max(o,0),i),"left"===r){for(;t>=0&&!n[t];)t--;-1===t&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return-1===t&&(t=a),t}function kL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=Boolean(aL(e[n])||aL(e[n-1]));return t}function OL(t,n,r,o,i,a){void 0===a&&(a=iL);var s=function(t){var n=(0,e.useRef)(t);n.current=t;var r=(0,e.useRef)(function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.current.apply(n,e)});return r.current}(function(e,t){var n,r;return lL(e)?(r="",n=""):"number"==typeof e||t?(r="number"==typeof e?fL(e):e,n=o(r)):(r=i(e,void 0),n=o(r)),{formattedValue:n,numAsString:r}}),l=(0,e.useState)(function(){return s(sL(t)?n:t,r)}),u=l[0],c=l[1],d=t,p=r;sL(t)&&(d=u.numAsString,p=!0);var f=s(d,p);return(0,e.useMemo)(function(){c(f)},[f.formattedValue]),[u,function(e,t){e.formattedValue!==u.formattedValue&&c({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}]}function _L(e){return e.replace(/[^0-9]/g,"")}function EL(e){return e}function CL(t){var r=t.type;void 0===r&&(r="text");var o=t.displayType;void 0===o&&(o="input");var i=t.customInput,a=t.renderText,s=t.getInputRef,l=t.format;void 0===l&&(l=EL);var u=t.removeFormatting;void 0===u&&(u=_L);var c=t.defaultValue,d=t.valueIsNumericString,p=t.onValueChange,f=t.isAllowed,m=t.onChange;void 0===m&&(m=iL);var h=t.onKeyDown;void 0===h&&(h=iL);var v=t.onMouseUp;void 0===v&&(v=iL);var y=t.onFocus;void 0===y&&(y=iL);var g=t.onBlur;void 0===g&&(g=iL);var b=t.value,w=t.getCaretBoundary;void 0===w&&(w=kL);var S=t.isValidInputCharacter;void 0===S&&(S=aL);var x=t.isCharacterSame,k=oL(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),O=OL(b,c,Boolean(d),l,u,p),_=O[0],E=_.formattedValue,C=_.numAsString,I=O[1],T=(0,e.useRef)(),A=(0,e.useRef)({formattedValue:E,numAsString:C}),P=function(e,t){A.current={formattedValue:e.formattedValue,numAsString:e.value},I(e,t)},D=(0,e.useState)(!1),j=D[0],R=D[1],M=(0,e.useRef)(null),L=(0,e.useRef)({setCaretTimeout:null,focusTimeout:null});(0,e.useEffect)(function(){return R(!0),function(){clearTimeout(L.current.setCaretTimeout),clearTimeout(L.current.focusTimeout)}},[]);var N=l,F=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},V=function(e,t,n){0===e.selectionStart&&e.selectionEnd===e.value.length||(hL(e,t),L.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&hL(e,t)},0))},B=function(e,t,n){return xL(e,t,w(e),n)},q=function(e,t,n){var r=w(t),o=function(e,t,n,r,o,i,a){void 0===a&&(a=SL);var s=o.findIndex(function(e){return e}),l=e.slice(0,s);t||n.startsWith(l)||(t=l,n=l+n,r+=l.length);for(var u=n.length,c=e.length,d={},p=new Array(u),f=0;f<u;f++){p[f]=-1;for(var m=0,h=c;m<h;m++)if(a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:m})&&!0!==d[m]){p[f]=m,d[m]=!0;break}}for(var v=r;v<u&&(-1===p[v]||!i(n[v]));)v++;var y=v===u||-1===p[v]?c:p[v];for(v=r-1;v>0&&-1===p[v];)v--;var g=-1===v||-1===p[v]?0:p[v]+1;return g>y?y:r-g<y-r?g:y}(t,E,e,n,r,S,x);return xL(t,o,r)};(0,e.useEffect)(function(){var e=A.current,t=e.formattedValue,n=e.numAsString;E===t&&C===n||P(F(E,C),{event:void 0,source:nL.props})},[E,C]);var Q=M.current?wL(M.current):void 0;("undefined"!=typeof window?e.useLayoutEffect:e.useEffect)(function(){var e=M.current;if(E!==A.current.formattedValue&&e){var t=q(A.current.formattedValue,E,Q);e.value=E,V(e,t,E)}},[E]);var z=function(e,t){void 0===t&&(t=0);var n=e.selectionStart,r=e.selectionEnd;T.current={selectionStart:n,selectionEnd:r+t}},$=!j||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",U=Object.assign({inputMode:$},k,{type:r,value:E,onChange:function(e){(function(e,t,n){var r=t.target,o=T.current?function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}}(T.current,r.selectionEnd):bL(E,e),i=Object.assign(Object.assign({},o),{lastValue:E}),a=u(e,i),s=N(a);if(a=u(s,void 0),f&&!f(F(s,a))){var l=t.target,c=wL(l),d=q(e,E,c);return l.value=E,V(l,d,E),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var n,r=e.input,o=e.source,i=e.event,a=e.numAsString;if(r){var s=e.inputValue||r.value,l=wL(r);r.value=t,void 0!==(n=q(s,t,l))&&V(r,n,t)}t!==E&&P(F(t,a),{event:i,source:o})}({formattedValue:s,numAsString:a,inputValue:e,event:t,source:n,input:t.target}),!0})(e.target.value,e,nL.event)&&m(e),T.current=void 0},onKeyDown:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,i=n.selectionEnd,a=n.value;void 0===a&&(a=""),"ArrowLeft"===r||"Backspace"===r?t=Math.max(o-1,0):"ArrowRight"===r?t=Math.min(o+1,a.length):"Delete"===r&&(t=o);var s=0;"Delete"===r&&o===i&&(s=1);var l="ArrowLeft"===r||"ArrowRight"===r;if(void 0===t||o!==i&&!l)return h(e),void z(n,s);var u=t;l?(u=B(a,t,"ArrowLeft"===r?"left":"right"))!==t&&e.preventDefault():"Delete"!==r||S(a[t])?"Backspace"!==r||S(a[t])||(u=B(a,t,"left")):u=B(a,t,"right"),u!==t&&V(n,u,a),h(e),z(n,s)},onMouseUp:function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(void 0===r&&(r=""),e===n){var o=B(r,e);o!==e&&V(t,o,r)}};n(),requestAnimationFrame(function(){n()}),v(e),z(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;M.current=t,L.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,o=t.selectionEnd,i=t.value;void 0===i&&(i="");var a=B(i,r);a===r||0===r&&o===i.length||V(t,a,i),y(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},onBlur:function(e){M.current=null,clearTimeout(L.current.focusTimeout),clearTimeout(L.current.setCaretTimeout),g(e)}});if("text"===o)return a?n().createElement(n().Fragment,null,a(E,k)||null):n().createElement("span",Object.assign({},k,{ref:s}),E);if(i){var W=i;return n().createElement(W,Object.assign({},U,{ref:s}))}return n().createElement("input",Object.assign({},U,{ref:s}))}function IL(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;void 0===o&&(o="");var i=t.suffix;void 0===i&&(i="");var a=t.allowNegative,s=t.thousandsGroupStyle;if(void 0===s&&(s="thousand"),""===e||"-"===e)return e;var l=TL(t),u=l.thousandSeparator,c=l.decimalSeparator,d=0!==n&&-1!==e.indexOf(".")||n&&r,p=cL(e,a),f=p.beforeDecimal,m=p.afterDecimal,h=p.addNegation;return void 0!==n&&(m=dL(m,n,!!r)),u&&(f=function(e,t,n){var r=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(n),o=e.search(/[1-9]/);return o=-1===o?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}(f,u,s)),o&&(f=o+f),i&&(m+=i),h&&(f="-"+f),f+(d&&c||"")+m}function TL(e){var t=e.decimalSeparator;void 0===t&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function AL(e){e=function(e){var t=TL(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;void 0===o&&(o="");var i=e.allowNegative;if(void 0===i&&(i=!0),n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+n+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+r+" (default value for decimalSeparator is .)\n ");return o.startsWith("-")&&i&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+o+"\n allowNegative: "+i+"\n "),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;void 0===o&&(o=iL);var i=e.onBlur;void 0===i&&(i=iL);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;void 0===u&&(u="");var c=e.defaultValue,d=e.value,p=e.valueIsNumericString,f=e.onValueChange,m=oL(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),h=TL(e),v=h.decimalSeparator,y=h.allowedDecimalSeparators,g=function(t){return IL(t,e)},b=function(t,n){return function(e,t,n){var r;void 0===t&&(t=function(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}(e));var o=n.allowNegative,i=n.prefix;void 0===i&&(i="");var a=n.suffix;void 0===a&&(a="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,d=u.end,p=TL(n),f=p.allowedDecimalSeparators,m=p.decimalSeparator,h=e[d]===m;if(aL(e)&&(e===i||e===a)&&""===t.lastValue)return e;if(d-c===1&&-1!==f.indexOf(e[c])){var v=0===s?"":m;e=e.substring(0,c)+v+e.substring(c+1,e.length)}var y=function(e,t,n){var r=!1,o=!1;i.startsWith("-")?r=!1:e.startsWith("--")?(r=!1,o=!0):a.startsWith("-")&&e.length===a.length?r=!1:"-"===e[0]&&(r=!0);var s=r?1:0;return o&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},g=y(e,c,d),b=g.hasNegation;e=(r=g).value,c=r.start,d=r.end;var w=y(t.lastValue,l.start,l.end),S=w.start,x=w.end,k=w.value,O=e.substring(c,d);!(e.length&&k.length&&(S>k.length-a.length||x<i.length))||O&&a.startsWith(O)||(e=k);var _=0;e.startsWith(i)?_+=i.length:c<i.length&&(_=c),d-=_;var E=(e=e.substring(_)).length,C=e.length-a.length;e.endsWith(a)?E=C:(d>C||d>e.length-a.length)&&(E=d),e=e.substring(0,E),e=function(e,t){void 0===e&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}(b?"-"+e:e,o),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+uL(e),"g")}(m))||[]).join("");var I=e.indexOf(m);e=e.replace(new RegExp(uL(m),"g"),function(e,t){return t===I?".":""});var T=cL(e,o),A=T.beforeDecimal,P=T.afterDecimal,D=T.addNegation;return u.end-u.start<l.end-l.start&&""===A&&h&&!parseFloat(P)&&(e=D?"-":""),e}(t,n,e)},w=sL(d)?c:d,S=null!=p?p:function(e,t,n){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==n?void 0:n.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(w,u,t);sL(d)?sL(c)||(S=S||"number"==typeof c):S=S||"number"==typeof d;var x=function(e){return lL(e)?e:("number"==typeof e&&(e=fL(e)),S&&"number"==typeof s?mL(e,s,Boolean(l)):e)},k=OL(x(d),x(c),Boolean(S),g,b,f),O=k[0],_=O.numAsString,E=O.formattedValue,C=k[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===v||aL(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,o=e.currentValueIndex,i=e.formattedValueIndex,a=t[o],c=r[i],p=bL(n,t).to,f=function(e){return b(e).indexOf(".")+u.length};return!(0===d&&l&&s&&t[p.start]===v&&f(t)<o&&f(r)>i||!(o>=p.start&&o<p.end&&y&&y.includes(a)&&c===v)&&a!==c)},onValueChange:C,format:g,removeFormatting:b,getCaretBoundary:function(t){return function(e,t){var n=t.prefix;void 0===n&&(n="");var r=t.suffix;void 0===r&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i="-"===e[0];o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,i=t.selectionStart,c=t.selectionEnd,d=t.value;if(void 0===d&&(d=""),("Backspace"===r||"Delete"===r)&&c<u.length)e.preventDefault();else if(i===c){"Backspace"===r&&"-"===d[0]&&i===u.length+1&&n&&hL(t,1),s&&l&&("Backspace"===r&&d[i-1]===v?(hL(t,i-1),e.preventDefault()):"Delete"===r&&d[i]===v&&e.preventDefault()),(null==y?void 0:y.includes(r))&&d[i]===v&&hL(t,i+1);var p=!0===a?",":a;"Backspace"===r&&d[i-1]===p&&hL(t,i-1),"Delete"===r&&d[i]===p&&hL(t,i+1),o(e)}else o(e)},onBlur:function(t){var n=_;if(n.match(/\d/g)||(n=""),r||(n=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}(n)),l&&s&&(n=mL(n,s,l)),n!==_){var o=IL(n,e);C({formattedValue:o,value:n,floatValue:parseFloat(n)},{event:t,source:nL.event})}i(t)}})}function PL(e){var t=AL(e);return n().createElement(CL,Object.assign({},t))}function DL(e){return DL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DL(e)}var jL=["questionId","label","value","onChange","minValue","maxValue","decimalScale","required","disabled","placeholder","helperText","tooltip","error","validationErrorMessages","className","hideLabel","visible","defaultValue","inputProps","styleName","customTheme","header","onBlur","showQuestionLabels","testId"];function RL(){return RL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RL.apply(null,arguments)}function ML(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ML(Object(n),!0).forEach(function(t){NL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NL(e,t,n){return(t=function(e){var t=function(e){if("object"!=DL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=DL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FL=function(t){var r,o,i,a=t.questionId,s=t.label,l=t.value,u=t.onChange,c=t.minValue,d=t.maxValue,p=t.decimalScale,f=t.required,m=t.disabled,h=t.placeholder,v=t.helperText,y=(t.tooltip,t.error),g=(t.validationErrorMessages,t.className),b=(t.hideLabel,t.visible),w=void 0===b||b,S=t.defaultValue,x=t.inputProps,k=void 0===x?{}:x,O=t.styleName,_=t.customTheme,E=void 0===_?{}:_,C=t.header,I=t.onBlur,T=t.showQuestionLabels,A=void 0===T||T,P=t.testId,D=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,jL),j=Vc(),R=j.state,M=j.setValue,L=sd(),N=k["data-item-index"],F=k["data-parent-id"],V=$S({questionId:a,itemIndex:N,defaultValue:S,defaultVisible:!0,defaultDisabled:!1}),B=V.disabled,q=V.handleChange,Q=null!=l?l:R.values[a],z=null!=c?c:0,$=null!=d?d:100,U="number"==typeof z&&z<0||null!=Q&&String(Q).trim().startsWith("-"),W=y||(null==R||null===(r=R.ruleValidationErrors)||void 0===r?void 0:r[a])||(null==R||null===(o=R.apiErrors)||void 0===o?void 0:o[a])||(null==R||null===(i=R.errors)||void 0===i?void 0:i[a])||null,H=Boolean(W),G=(0,e.useMemo)(function(){var e=L.textField||L.percentageField||{};return YS(e,E)},[L,E]),Y=(0,e.useMemo)(function(){var e=LL(LL({},G.container),{},{width:"100%"}),t=ZS(G.input,H&&G.error,(B||m)&&G.disabled);return{container:KS(e,G.responsive),input:t,sx:XS(G.disabled)}},[G,H,B,m]);if(w){var K=h||"Enter percentage (".concat(z,"-").concat($,")"),X=N?"".concat(a,"-").concat(N):a,Z=null!=B&&""!==B?B:m;return n().createElement("div",{className:"form-field ".concat(O||""," ").concat(g||""),style:Y.container},C&&n().createElement("div",{className:"field-header",style:L.header},C),n().createElement(PL,RL({customInput:NS,sx:Y.sx,suffix:"%",disabled:Z},null!=p&&{decimalScale:p},{allowNegative:U,min:z,max:$,isAllowed:function(e){var t=e.floatValue;return void 0===t||t>=z&&t<=$},onValueChange:function(e){var t=e.value;q&&q(t,void 0!==N&&void 0!==F?{cardListId:F,instanceIndex:N}:{}),M&&M(a,t),u&&u({target:{name:a,value:t}})},value:Q||"",placeholder:K,autoComplete:"off",required:f,error:H,helperText:W||v||"",label:A?s:"",id:String(X),name:String(X),slotProps:{input:{inputProps:{"data-testid":P}},inputLabel:{style:L.label,required:A&&f},formHelperText:{style:H?L.error:L.helperText,sx:{marginLeft:0,marginRight:0}}},onBlur:I,fullWidth:!0,"data-item-index":N,"data-parent-id":F},D)))}return null};FL.propTypes={testId:o().string,questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().oneOfType([o().string,o().number]),defaultValue:o().oneOfType([o().string,o().number]),onChange:o().func,minValue:o().number,maxValue:o().number,decimalScale:o().number,required:o().bool,disabled:o().bool,placeholder:o().string,helperText:o().string,tooltip:o().string,error:o().string,validationErrorMessages:o().object,className:o().string,hideLabel:o().bool,visible:o().bool,inputProps:o().object,styleName:o().string,customTheme:o().object,header:o().string,onBlur:o().func,showQuestionLabels:o().bool},FL.defaultProps={minValue:0,maxValue:100,decimalScale:null,required:!1,disabled:!1,visible:!0,hideLabel:!1,inputProps:{}};const VL=FL;function BL(e){return BL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BL(e)}function qL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qL(Object(n),!0).forEach(function(t){zL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zL(e,t,n){return(t=function(e){var t=function(e){if("object"!=BL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=BL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $L=function(t){var r=t.questionId,o=t.label,i=t.value,a=void 0===i?"":i,s=t.options,l=void 0===s?[]:s,u=t.disabled,c=void 0!==u&&u,d=t.required,p=void 0!==d&&d,f=t.onChange,m=t.inputProps,h=void 0===m?{}:m,v=t.header,y=t.styleName,g=t.customTheme,b=void 0===g?{}:g,w=t.error,S=t.helperText,x=t.tooltip,k=void 0===x?"":x,O=t.showQuestionLabels,_=void 0===O||O,E=t.testIdRoot,C=sd(),I=Vc().state,T=h["data-parent-id"],A=h["data-item-index"],P=(0,e.useMemo)(function(){var e,t,n=null===(e=I.optionVisibility)||void 0===e?void 0:e[r];return null!=T&&void 0!==A&&null!==(t=I.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[T])&&void 0!==t&&null!==(t=t[Number(A)])&&void 0!==t&&t[r]&&(n=I.optionVisibilityByInstance[T][Number(A)][r]),n?l.filter(function(e){var t=e.optionId||e.id;return!1!==n[t]}):l},[l,I.optionVisibility,I.optionVisibilityByInstance,r,T,A]),D=function(e){null==f||f(e)},j=(0,e.useMemo)(function(){var e=C.radioField||{};return YS(e,b)},[C,b]),R=(0,e.useMemo)(function(){var e=QL(QL({},j.container),{},{width:"100%"}),t=ZS(j.radioGroup,w&&j.error,c&&j.disabled),n=ZS(j.radioOption,c&&j.disabled);return{container:KS(e,j.responsive),radioGroup:t,radioOption:n,radio:j.radio,label:j.optionLabel}},[j,w,c]);return n().createElement("div",{className:"form-field ".concat(y||""),style:R.container},v&&n().createElement("div",{className:"field-header",style:C.header},v),_&&o&&n().createElement("div",{className:"question_label",style:C.label},o,p&&n().createElement("span",{className:"required-mark",style:C.requiredMark},"*"),k&&n().createElement(hO,{tooltip:k})),n().createElement("div",{className:"radio-group",style:R.radioGroup},P.map(function(e,t){var o,i,s,l,u=null!==(o=e.value)&&void 0!==o?o:e,d=null!==(i=e.label)&&void 0!==i?i:e,f=void 0===A?"":"-".concat(A),m="".concat(r,"-").concat(T||"","-").concat(t).concat(f),h=(null===(s=String(a))||void 0===s?void 0:s.trim())===(null===(l=String(u))||void 0===l?void 0:l.trim()),v=dd(E,"option",u),y=dd(E,"option",u,"input");return n().createElement("div",{key:m,className:"radio-option",style:R.radioOption,"data-testid":v},n().createElement("input",{type:"radio",id:m,name:void 0===A?r:"".concat(r,"-").concat(A),value:u,checked:h,onChange:D,disabled:c,required:p,"data-item-index":A,"data-parent-id":T,style:R.radio,"data-testid":y}),n().createElement("label",{htmlFor:m,style:R.label},d))})),S&&n().createElement("div",{className:"helper-text",style:C.helperText},S))};$L.propTypes={questionId:o().string,label:o().string,value:o().oneOfType([o().string,o().number,o().bool]),options:o().arrayOf(o().oneOfType([o().string,o().number,o().shape({label:o().string.isRequired,value:o().oneOfType([o().string,o().number,o().bool]).isRequired})])),disabled:o().bool,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,tooltip:o().string,showQuestionLabels:o().bool,testIdRoot:o().string};const UL=$L;var WL=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/RadioTabButtonsField.css"),HL={};function GL(e){return GL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GL(e)}HL.styleTagTransform=kl(),HL.setAttributes=bl(),HL.insert=yl().bind(null,"head"),HL.domAPI=hl(),HL.insertStyleElement=Sl(),fl()(WL.A,HL),WL.A&&WL.A.locals&&WL.A.locals;var YL=["name","label","value","onChange","options","disabled","required","error","_validation","header","styleName","customTheme","_questionId","_encrypted","_maskingType","_maskingLength","tooltip","showQuestionLabels","testIdRoot"];function KL(){return KL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KL.apply(null,arguments)}function XL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XL(Object(n),!0).forEach(function(t){JL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JL(e,t,n){return(t=function(e){var t=function(e){if("object"!=GL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=GL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==GL(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var eN=function(t){var r=t.name,o=t.label,i=t.value,a=void 0===i?"":i,s=t.onChange,l=t.options,u=void 0===l?[]:l,c=t.disabled,d=t.required,p=t.error,f=(t._validation,t.header),m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=(t._questionId,t._encrypted,t._maskingType,t._maskingLength,t.tooltip),g=void 0===y?"":y,b=t.showQuestionLabels,w=void 0===b||b,S=t.testIdRoot,x=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,YL),k=sd(),O=(0,e.useMemo)(function(){var e=k.radioTabButtonsField||k.radioField||{};return YS(e,v)},[k,v]),_=(0,e.useMemo)(function(){var e=ZL(ZL({},O.container),{},{width:"100%"}),t=ZS(O.tabGroup),n=ZS(O.tab,c&&O.disabled),r=ZS(O.selectedTab),o=ZS(O.disabledTab),i=ZS(O.label,d&&O.required,c&&O.disabled);return{container:KS(e,O.responsive),tabGroup:t,tab:n,selectedTab:r,disabledTab:o,label:i,header:ZS(O.header),error:ZS(O.error)}},[O,d,c]);return n().createElement("div",{className:"radio-tab-buttons-field ".concat(m||""),style:_.container},f&&n().createElement("div",{className:"field-header",style:_.header},f),w&&o&&n().createElement("div",{className:"question_label",style:_.label},o,d&&n().createElement("span",{style:O.required},"*"),g&&n().createElement(hO,{tooltip:g})),n().createElement("div",{className:"radio-tab-buttons-wrapper",style:_.tabGroup},u.map(function(e){var t=String(a).toLowerCase()===String(e.value).toLowerCase(),o=dd(S,"option",e.value);return n().createElement("button",KL({key:e.value,type:"button",onClick:function(){return t=e.value,void(c||!s||s({target:{name:r,value:t}}));var t},disabled:c,style:ZL(ZL(ZL({},_.tab),t?_.selectedTab:{}),c?_.disabledTab:{})},x,{"data-testid":o}),e.label)})),p&&n().createElement("div",{style:_.error},p))};eN.propTypes={name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().any,onChange:o().func,options:o().arrayOf(o().shape({label:o().string.isRequired,value:o().any.isRequired,name:o().string,text:o().string,selected:o().bool,optionId:o().number,sortOrder:o().number,uncheckOthers:o().bool})),disabled:o().bool,required:o().bool,error:o().string,_validation:o().object,header:o().node,styleName:o().string,customTheme:o().object,_questionId:o().oneOfType([o().string,o().number]),_encrypted:o().bool,_maskingType:o().string,_maskingLength:o().oneOfType([o().string,o().number]),tooltip:o().string,showQuestionLabels:o().bool,testIdRoot:o().string};function tN(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}const nN=function(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let u=a?s.trim():s;n&&(u=u.toLowerCase()),t&&(u=tN(u));const c=u?e.filter(e=>{let r=(i||l)(e);return n&&(r=r.toLowerCase()),t&&(r=tN(r)),"start"===o?r.startsWith(u):r.includes(u)}):e;return"number"==typeof r?c.slice(0,r):c}}(),rN=e=>null!==e.current&&e.current.parentElement?.contains(document.activeElement),oN=[];function iN(e,t,n){if(t||null==e)return"";const r=n(e);return"string"==typeof r?r:""}const aN=function(t){const{unstable_isActiveElementInListbox:n=rN,unstable_classNamePrefix:r="Mui",autoComplete:o=!1,autoHighlight:i=!1,autoSelect:a=!1,blurOnSelect:s=!1,clearOnBlur:l=!t.freeSolo,clearOnEscape:u=!1,componentName:c="useAutocomplete",defaultValue:d=(t.multiple?oN:null),disableClearable:p=!1,disableCloseOnSelect:f=!1,disabled:m,disabledItemsFocusable:h=!1,disableListWrap:v=!1,filterOptions:y=nN,filterSelectedOptions:g=!1,freeSolo:b=!1,getOptionDisabled:w,getOptionKey:S,getOptionLabel:x=e=>e.label??e,groupBy:k,handleHomeEndKeys:O=!t.freeSolo,id:_,includeInputInList:E=!1,inputValue:C,isOptionEqualToValue:I=(e,t)=>e===t,multiple:T=!1,onChange:A,onClose:P,onHighlightChange:D,onInputChange:j,onOpen:R,open:M,openOnFocus:L=!1,options:N,readOnly:F=!1,selectOnFocus:V=!t.freeSolo,value:B}=t,q=Bp(_);let Q=x;Q=e=>{const t=x(e);return"string"!=typeof t?String(t):t};const z=e.useRef(!1),$=e.useRef(!0),U=e.useRef(null),W=e.useRef(null),[H,G]=e.useState(null),[Y,K]=e.useState(-1),X=i?0:-1,Z=e.useRef(X),J=e.useRef(iN(d??B,T,Q)).current,[ee,te]=cS({controlled:B,default:d,name:c}),[ne,re]=cS({controlled:C,default:J,name:c,state:"inputValue"}),[oe,ie]=e.useState(!1),ae=e.useCallback((e,t,n)=>{if(!(T?ee.length<t.length:null!==t)&&!l)return;const r=iN(t,T,Q);ne!==r&&(re(r),j&&j(e,r,n))},[Q,ne,T,j,re,l,ee]),[se,le]=cS({controlled:M,default:!1,name:c,state:"open"}),[ue,ce]=e.useState(!0),de=!T&&null!=ee&&ne===Q(ee),pe=se&&!F,fe=pe?y(N.filter(e=>!g||!(T?ee:[ee]).some(t=>null!==t&&I(e,t))),{inputValue:de&&ue?"":ne,getOptionLabel:Q}):[],me=(t=>{const n=e.useRef({});return e.useEffect(()=>{n.current=t}),n.current})({filteredOptions:fe,value:ee,inputValue:ne});e.useEffect(()=>{const e=ee!==me.value;oe&&!e||b&&!e||ae(null,ee,"reset")},[ee,ae,oe,me.value,b]);const he=se&&fe.length>0&&!F,ve=My(e=>{-1===e?U.current.focus():H.querySelector(`[data-tag-index="${e}"]`).focus()});e.useEffect(()=>{T&&Y>ee.length-1&&(K(-1),ve(-1))},[ee,T,Y,ve]);const ye=My(({event:e,index:t,reason:n})=>{if(Z.current=t,-1===t?U.current.removeAttribute("aria-activedescendant"):U.current.setAttribute("aria-activedescendant",`${q}-option-${t}`),D&&["mouse","keyboard","touch"].includes(n)&&D(e,-1===t?null:fe[t],n),!W.current)return;const o=W.current.querySelector(`[role="option"].${r}-focused`);o&&(o.classList.remove(`${r}-focused`),o.classList.remove(`${r}-focusVisible`));let i=W.current;if("listbox"!==W.current.getAttribute("role")&&(i=W.current.parentElement.querySelector('[role="listbox"]')),!i)return;if(-1===t)return void(i.scrollTop=0);const a=W.current.querySelector(`[data-option-index="${t}"]`);if(a&&(a.classList.add(`${r}-focused`),"keyboard"===n&&a.classList.add(`${r}-focusVisible`),i.scrollHeight>i.clientHeight&&"mouse"!==n&&"touch"!==n)){const e=a,t=i.clientHeight+i.scrollTop,n=e.offsetTop+e.offsetHeight;n>t?i.scrollTop=n-i.clientHeight:e.offsetTop-e.offsetHeight*(k?1.3:0)<i.scrollTop&&(i.scrollTop=e.offsetTop-e.offsetHeight*(k?1.3:0))}}),ge=My(({event:e,diff:t,direction:n="next",reason:r})=>{if(!pe)return;const i=function(e,t){if(!W.current||e<0||e>=fe.length)return-1;let n=e;for(;;){const r=W.current.querySelector(`[data-option-index="${n}"]`),o=!h&&(!r||r.disabled||"true"===r.getAttribute("aria-disabled"));if(r&&r.hasAttribute("tabindex")&&!o)return n;if(n="next"===t?(n+1)%fe.length:(n-1+fe.length)%fe.length,n===e)return-1}}((()=>{const e=fe.length-1;if("reset"===t)return X;if("start"===t)return 0;if("end"===t)return e;const n=Z.current+t;return n<0?-1===n&&E?-1:v&&-1!==Z.current||Math.abs(t)>1?0:e:n>e?n===e+1&&E?-1:v||Math.abs(t)>1?e:0:n})(),n);if(ye({index:i,reason:r,event:e}),o&&"reset"!==t)if(-1===i)U.current.value=ne;else{const e=Q(fe[i]);U.current.value=e,0===e.toLowerCase().indexOf(ne.toLowerCase())&&ne.length>0&&U.current.setSelectionRange(ne.length,e.length)}}),be=e.useCallback(()=>{if(!pe)return;const e=(()=>{if(-1!==Z.current&&me.filteredOptions&&me.filteredOptions.length!==fe.length&&me.inputValue===ne&&(T?ee.length===me.value.length&&me.value.every((e,t)=>Q(ee[t])===Q(e)):(e=me.value,t=ee,(e?Q(e):"")===(t?Q(t):"")))){const e=me.filteredOptions[Z.current];if(e)return fe.findIndex(t=>Q(t)===Q(e))}var e,t;return-1})();if(-1!==e)return void(Z.current=e);const t=T?ee[0]:ee;if(0!==fe.length&&null!=t){if(W.current){if(null!=t){const e=fe[Z.current];if(T&&e&&-1!==ee.findIndex(t=>I(e,t)))return;const n=fe.findIndex(e=>I(e,t));return void(-1===n?ge({diff:"reset"}):ye({index:n}))}Z.current>=fe.length-1?ye({index:fe.length-1}):ye({index:Z.current})}}else ge({diff:"reset"})},[fe.length,!T&&ee,g,ge,ye,pe,ne,T]),we=My(e=>{vw(W,e),e&&be()});e.useEffect(()=>{be()},[be]);const Se=e=>{se||(le(!0),ce(!0),R&&R(e))},xe=(e,t)=>{se&&(le(!1),P&&P(e,t))},ke=(e,t,n,r)=>{if(T){if(ee.length===t.length&&ee.every((e,n)=>e===t[n]))return}else if(ee===t)return;A&&A(e,t,n,r),te(t)},Oe=e.useRef(!1),_e=(e,t,n="selectOption",r="options")=>{let o=n,i=t;if(T){i=Array.isArray(ee)?ee.slice():[];const e=i.findIndex(e=>I(t,e));-1===e?i.push(t):"freeSolo"!==r&&(i.splice(e,1),o="removeOption")}ae(e,i,o),ke(e,i,o,{option:t}),f||e&&(e.ctrlKey||e.metaKey)||xe(e,o),(!0===s||"touch"===s&&Oe.current||"mouse"===s&&!Oe.current)&&U.current.blur()},Ee=(e,t)=>{if(!T)return;""===ne&&xe(e,"toggleInput");let n=Y;-1===Y?""===ne&&"previous"===t&&(n=ee.length-1):(n+="next"===t?1:-1,n<0&&(n=0),n===ee.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;let n=e;for(;;){if("next"===t&&n===ee.length||"previous"===t&&-1===n)return-1;const e=H.querySelector(`[data-tag-index="${n}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),K(n),ve(n)},Ce=e=>{z.current=!0,re(""),j&&j(e,"","clear"),ke(e,T?[]:null,"clear")},Ie=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1===Y||["ArrowLeft","ArrowRight"].includes(t.key)||(K(-1),ve(-1)),229!==t.which))switch(t.key){case"Home":pe&&O&&(t.preventDefault(),ge({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":pe&&O&&(t.preventDefault(),ge({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),ge({diff:-5,direction:"previous",reason:"keyboard",event:t}),Se(t);break;case"PageDown":t.preventDefault(),ge({diff:5,direction:"next",reason:"keyboard",event:t}),Se(t);break;case"ArrowDown":t.preventDefault(),ge({diff:1,direction:"next",reason:"keyboard",event:t}),Se(t);break;case"ArrowUp":t.preventDefault(),ge({diff:-1,direction:"previous",reason:"keyboard",event:t}),Se(t);break;case"ArrowLeft":Ee(t,"previous");break;case"ArrowRight":Ee(t,"next");break;case"Enter":if(-1!==Z.current&&pe){const e=fe[Z.current],n=!!w&&w(e);if(t.preventDefault(),n)return;_e(t,e,"selectOption"),o&&U.current.setSelectionRange(U.current.value.length,U.current.value.length)}else b&&""!==ne&&!1===de&&(T&&t.preventDefault(),_e(t,ne,"createOption","freeSolo"));break;case"Escape":pe?(t.preventDefault(),t.stopPropagation(),xe(t,"escape")):u&&(""!==ne||T&&ee.length>0)&&(t.preventDefault(),t.stopPropagation(),Ce(t));break;case"Backspace":if(T&&!F&&""===ne&&ee.length>0){const e=-1===Y?ee.length-1:Y,n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})}break;case"Delete":if(T&&!F&&""===ne&&ee.length>0&&-1!==Y){const e=Y,n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})}}},Te=e=>{ie(!0),L&&!z.current&&Se(e)},Ae=e=>{n(W)?U.current.focus():(ie(!1),$.current=!0,z.current=!1,a&&-1!==Z.current&&pe?_e(e,fe[Z.current],"blur"):a&&b&&""!==ne?_e(e,ne,"blur","freeSolo"):l&&ae(e,ee,"blur"),xe(e,"blur"))},Pe=e=>{const t=e.target.value;ne!==t&&(re(t),ce(!1),j&&j(e,t,"input")),""===t?p||T||ke(e,null,"clear"):Se(e)},De=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));Z.current!==t&&ye({event:e,index:t,reason:"mouse"})},je=e=>{ye({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Oe.current=!0},Re=e=>{const t=Number(e.currentTarget.getAttribute("data-option-index"));_e(e,fe[t],"selectOption"),Oe.current=!1},Me=e=>t=>{const n=ee.slice();n.splice(e,1),ke(t,n,"removeOption",{option:ee[e]})},Le=e=>{se?xe(e,"toggleInput"):Se(e)},Ne=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==q&&e.preventDefault()},Fe=e=>{e.currentTarget.contains(e.target)&&(U.current.focus(),V&&$.current&&U.current.selectionEnd-U.current.selectionStart===0&&U.current.select(),$.current=!1)},Ve=e=>{m||""!==ne&&se||Le(e)};let Be=b&&ne.length>0;Be=Be||(T?ee.length>0:null!==ee);let qe=fe;return k&&(new Map,qe=fe.reduce((e,t,n)=>{const r=k(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])),m&&oe&&Ae(),{getRootProps:(e={})=>({...e,onKeyDown:Ie(e),onMouseDown:Ne,onClick:Fe}),getInputLabelProps:()=>({id:`${q}-label`,htmlFor:q}),getInputProps:()=>({id:q,value:ne,onBlur:Ae,onFocus:Te,onChange:Pe,onMouseDown:Ve,"aria-activedescendant":pe?"":null,"aria-autocomplete":o?"both":"list","aria-controls":he?`${q}-listbox`:void 0,"aria-expanded":he,autoComplete:"off",ref:U,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:m}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Ce}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Le}),getTagProps:({index:e})=>({key:e,"data-tag-index":e,tabIndex:-1,...!F&&{onDelete:Me(e)}}),getListboxProps:()=>({role:"listbox",id:`${q}-listbox`,"aria-labelledby":`${q}-label`,ref:we,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{const n=(T?ee:[ee]).some(e=>null!=e&&I(t,e)),r=!!w&&w(t);return{key:S?.(t)??Q(t),tabIndex:-1,role:"option",id:`${q}-option-${e}`,onMouseMove:De,onClick:Re,onTouchStart:je,"data-option-index":e,"aria-disabled":r,"aria-selected":n}},id:q,inputValue:ne,value:ee,dirty:Be,expanded:pe&&H,popupOpen:pe,focused:oe||-1!==Y,anchorEl:H,setAnchorEl:G,focusedTag:Y,groupedOptions:qe}};function sN(e){return mg("MuiListSubheader",e)}hg("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const lN=Ey("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${ag(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(ig(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),uN=e.forwardRef(function(e,t){const n=Ay({props:e,name:"MuiListSubheader"}),{className:r,color:o="default",component:i="li",disableGutters:a=!1,disableSticky:s=!1,inset:l=!1,...u}=n,c={...n,color:o,component:i,disableGutters:a,disableSticky:s,inset:l},d=(e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e;return Np({root:["root","default"!==n&&`color${ag(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]},sN,t)})(c);return(0,Iy.jsx)(lN,{as:i,className:Lp(d.root,r),ref:t,ownerState:c,...u})});uN&&(uN.muiSkipListHighlight=!0);const cN=uN,dN=ES((0,Iy.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function pN(e){return mg("MuiChip",e)}const fN=hg("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),mN=Ey("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=n;return[{[`& .${fN.avatar}`]:t.avatar},{[`& .${fN.avatar}`]:t[`avatar${ag(s)}`]},{[`& .${fN.avatar}`]:t[`avatarColor${ag(r)}`]},{[`& .${fN.icon}`]:t.icon},{[`& .${fN.icon}`]:t[`icon${ag(s)}`]},{[`& .${fN.icon}`]:t[`iconColor${ag(o)}`]},{[`& .${fN.deleteIcon}`]:t.deleteIcon},{[`& .${fN.deleteIcon}`]:t[`deleteIcon${ag(s)}`]},{[`& .${fN.deleteIcon}`]:t[`deleteIconColor${ag(r)}`]},{[`& .${fN.deleteIcon}`]:t[`deleteIcon${ag(l)}Color${ag(r)}`]},t.root,t[`size${ag(s)}`],t[`color${ag(r)}`],i&&t.clickable,i&&"default"!==r&&t[`clickableColor${ag(r)})`],a&&t.deletable,a&&"default"!==r&&t[`deletableColor${ag(r)}`],t[l],t[`${l}${ag(r)}`]]}})(ig(({theme:e})=>{const t="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${fN.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${fN.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${fN.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${fN.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${fN.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${fN.icon}`]:{marginLeft:5,marginRight:-6},[`& .${fN.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Yh(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Yh(e.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${fN.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${fN.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Cg(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${fN.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].contrastTextChannel} / 0.7)`:Yh(e.palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${fN.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&"default"!==e.color,style:{[`& .${fN.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}},...Object.entries(e.palette).filter(Cg(["dark"])).map(([t])=>({props:{color:t,onDelete:!0},style:{[`&.${fN.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Cg(["dark"])).map(([t])=>({props:{color:t,clickable:!0},style:{[`&:hover, &.${fN.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${fN.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${fN.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${fN.avatar}`]:{marginLeft:4},[`& .${fN.avatarSmall}`]:{marginLeft:2},[`& .${fN.icon}`]:{marginLeft:4},[`& .${fN.iconSmall}`]:{marginLeft:2},[`& .${fN.deleteIcon}`]:{marginRight:5},[`& .${fN.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Cg()).map(([t])=>({props:{variant:"outlined",color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:Yh(e.palette[t].main,.7)}`,[`&.${fN.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Yh(e.palette[t].main,e.palette.action.hoverOpacity)},[`&.${fN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Yh(e.palette[t].main,e.palette.action.focusOpacity)},[`& .${fN.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.7)`:Yh(e.palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),hN=Ey("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ag(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function vN(e){return"Backspace"===e.key||"Delete"===e.key}const yN=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:a,color:s="default",component:l,deleteIcon:u,disabled:c=!1,icon:d,label:p,onClick:f,onDelete:m,onKeyDown:h,onKeyUp:v,size:y="medium",variant:g="filled",tabIndex:b,skipFocusWhenDisabled:w=!1,...S}=r,x=e.useRef(null),k=sg(x,n),O=e=>{e.stopPropagation(),m&&m(e)},_=!(!1===a||!f)||a,E=_||m?Yk:l||"div",C={...r,component:E,disabled:c,size:y,color:s,iconColor:e.isValidElement(d)&&d.props.color||s,onDelete:!!m,clickable:_,variant:g},I=(e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:a,clickable:s,variant:l}=e;return Np({root:["root",l,n&&"disabled",`size${ag(r)}`,`color${ag(o)}`,s&&"clickable",s&&`clickableColor${ag(o)}`,a&&"deletable",a&&`deletableColor${ag(o)}`,`${l}${ag(o)}`],label:["label",`label${ag(r)}`],avatar:["avatar",`avatar${ag(r)}`,`avatarColor${ag(o)}`],icon:["icon",`icon${ag(r)}`,`iconColor${ag(i)}`],deleteIcon:["deleteIcon",`deleteIcon${ag(r)}`,`deleteIconColor${ag(o)}`,`deleteIcon${ag(l)}Color${ag(o)}`]},pN,t)})(C),T=E===Yk?{component:l||"div",focusVisibleClassName:I.focusVisible,...m&&{disableRipple:!0}}:{};let A=null;m&&(A=u&&e.isValidElement(u)?e.cloneElement(u,{className:Lp(u.props.className,I.deleteIcon),onClick:O}):(0,Iy.jsx)(dN,{className:Lp(I.deleteIcon),onClick:O}));let P=null;o&&e.isValidElement(o)&&(P=e.cloneElement(o,{className:Lp(I.avatar,o.props.className)}));let D=null;return d&&e.isValidElement(d)&&(D=e.cloneElement(d,{className:Lp(I.icon,d.props.className)})),(0,Iy.jsxs)(mN,{as:E,className:Lp(I.root,i),disabled:!(!_||!c)||void 0,onClick:f,onKeyDown:e=>{e.currentTarget===e.target&&vN(e)&&e.preventDefault(),h&&h(e)},onKeyUp:e=>{e.currentTarget===e.target&&m&&vN(e)&&m(e),v&&v(e)},ref:k,tabIndex:w&&c?-1:b,ownerState:C,...T,...S,children:[P||D,(0,Iy.jsx)(hN,{className:Lp(I.label),ownerState:C,children:p}),A]})}),gN=ES((0,Iy.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function bN(e){return mg("MuiAutocomplete",e)}const wN=hg("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var SN,xN;const kN=Ey("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:a,size:s}=n;return[{[`& .${wN.tag}`]:t.tag},{[`& .${wN.tag}`]:t[`tagSize${ag(s)}`]},{[`& .${wN.inputRoot}`]:t.inputRoot},{[`& .${wN.input}`]:t.input},{[`& .${wN.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${wN.focused} .${wN.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${wN.clearIndicator}`]:{visibility:"visible"}},[`& .${wN.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${wN.inputRoot}`]:{[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:30},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:56},[`& .${wN.input}`]:{width:0,minWidth:30}},[`& .${Tg.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Tg.root}.${yg.sizeSmall}`]:{[`& .${Tg.input}`]:{padding:"2px 4px 3px 0"}},[`& .${$g.root}`]:{padding:9,[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:39},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:65},[`& .${wN.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${wN.endAdornment}`]:{right:9}},[`& .${$g.root}.${yg.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${wN.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Mg.root}`]:{paddingTop:19,paddingLeft:8,[`.${wN.hasPopupIcon}&, .${wN.hasClearIcon}&`]:{paddingRight:39},[`.${wN.hasPopupIcon}.${wN.hasClearIcon}&`]:{paddingRight:65},[`& .${Mg.input}`]:{padding:"7px 4px"},[`& .${wN.endAdornment}`]:{right:9}},[`& .${Mg.root}.${yg.sizeSmall}`]:{paddingBottom:1,[`& .${Mg.input}`]:{padding:"2.5px 4px"}},[`& .${yg.hiddenLabel}`]:{paddingTop:8},[`& .${Mg.root}.${yg.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${wN.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Mg.root}.${yg.hiddenLabel}.${yg.sizeSmall}`]:{[`& .${wN.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${wN.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${wN.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${wN.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${wN.inputRoot}`]:{flexWrap:"wrap"}}}]}),ON=Ey("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),_N=Ey(uO,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),EN=Ey(uO,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),CN=Ey(yk,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${wN.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(ig(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),IN=Ey(Fw,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(ig(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),TN=Ey("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),AN=Ey("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(ig(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),PN=Ey("ul",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(ig(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${wN.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${wN.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${wN.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${wN.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${wN.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Yh(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}}))),DN=Ey(cN,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(ig(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),jN=Ey("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${wN.option}`]:{paddingLeft:24}}),RN=e.forwardRef(function(t,n){const r=Ay({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:a=!1,blurOnSelect:s=!1,ChipProps:l,className:u,clearIcon:c=SN||(SN=(0,Iy.jsx)(gN,{fontSize:"small"})),clearOnBlur:d=!r.freeSolo,clearOnEscape:p=!1,clearText:f="Clear",closeText:m="Close",componentsProps:h,defaultValue:v=(r.multiple?[]:null),disableClearable:y=!1,disableCloseOnSelect:g=!1,disabled:b=!1,disabledItemsFocusable:w=!1,disableListWrap:S=!1,disablePortal:x=!1,filterOptions:k,filterSelectedOptions:O=!1,forcePopupIcon:_="auto",freeSolo:E=!1,fullWidth:C=!1,getLimitTagsText:I=e=>`+${e}`,getOptionDisabled:T,getOptionKey:A,getOptionLabel:P,isOptionEqualToValue:D,groupBy:j,handleHomeEndKeys:R=!r.freeSolo,id:M,includeInputInList:L=!1,inputValue:N,limitTags:F=-1,ListboxComponent:V,ListboxProps:B,loading:q=!1,loadingText:Q="Loading…",multiple:z=!1,noOptionsText:$="No options",onChange:U,onClose:W,onHighlightChange:H,onInputChange:G,onOpen:Y,open:K,openOnFocus:X=!1,openText:Z="Open",options:J,PaperComponent:ee,PopperComponent:te,popupIcon:ne=xN||(xN=(0,Iy.jsx)(CS,{})),readOnly:re=!1,renderGroup:oe,renderInput:ie,renderOption:ae,renderTags:se,selectOnFocus:le=!r.freeSolo,size:ue="medium",slots:ce={},slotProps:de={},value:pe,...fe}=r,{getRootProps:me,getInputProps:he,getInputLabelProps:ve,getPopupIndicatorProps:ye,getClearProps:ge,getTagProps:be,getListboxProps:we,getOptionProps:Se,value:xe,dirty:ke,expanded:Oe,id:_e,popupOpen:Ee,focused:Ce,focusedTag:Ie,anchorEl:Te,setAnchorEl:Ae,inputValue:Pe,groupedOptions:De}=aN({...r,componentName:"Autocomplete"}),je=!y&&!b&&ke&&!re,Re=(!E||!0===_)&&!1!==_,{onMouseDown:Me}=he(),{ref:Le,...Ne}=we(),Fe=P||(e=>e.label??e),Ve={...r,disablePortal:x,expanded:Oe,focused:Ce,fullWidth:C,getOptionLabel:Fe,hasClearIcon:je,hasPopupIcon:Re,inputFocused:-1===Ie,popupOpen:Ee,size:ue},Be=(e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:u,size:c}=e;return Np({root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${ag(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]},bN,t)})(Ve),qe={slots:{paper:ee,popper:te,...ce},slotProps:{chip:l,listbox:B,...h,...de}},[Qe,ze]=Kg("listbox",{elementType:PN,externalForwardedProps:qe,ownerState:Ve,className:Be.listbox,additionalProps:Ne,ref:Le}),[$e,Ue]=Kg("paper",{elementType:Fw,externalForwardedProps:qe,ownerState:Ve,className:Be.paper}),[We,He]=Kg("popper",{elementType:yk,externalForwardedProps:qe,ownerState:Ve,className:Be.popper,additionalProps:{disablePortal:x,style:{width:Te?Te.clientWidth:null},role:"presentation",anchorEl:Te,open:Ee}});let Ge;if(z&&xe.length>0){const e=e=>({className:Be.tag,disabled:b,...be(e)});Ge=se?se(xe,e,Ve):xe.map((t,n)=>{const{key:r,...o}=e({index:n});return(0,Iy.jsx)(yN,{label:Fe(t),size:ue,...o,...qe.slotProps.chip},r)})}if(F>-1&&Array.isArray(Ge)){const e=Ge.length-F;!Ce&&e>0&&(Ge=Ge.splice(0,F),Ge.push((0,Iy.jsx)("span",{className:Be.tag,children:I(e)},Ge.length)))}const Ye=oe||(e=>(0,Iy.jsxs)("li",{children:[(0,Iy.jsx)(DN,{className:Be.groupLabel,ownerState:Ve,component:"div",children:e.group}),(0,Iy.jsx)(jN,{className:Be.groupUl,ownerState:Ve,children:e.children})]},e.key)),Ke=ae||((e,t)=>{const{key:n,...r}=e;return(0,Iy.jsx)("li",{...r,children:Fe(t)},n)}),Xe=(e,t)=>{const n=Se({option:e,index:t});return Ke({...n,className:Be.option},e,{selected:n["aria-selected"],index:t,inputValue:Pe},Ve)},Ze=qe.slotProps.clearIndicator,Je=qe.slotProps.popupIndicator;return(0,Iy.jsxs)(e.Fragment,{children:[(0,Iy.jsx)(kN,{ref:n,className:Lp(Be.root,u),ownerState:Ve,...me(fe),children:ie({id:_e,disabled:b,fullWidth:!0,size:"small"===ue?"small":void 0,InputLabelProps:ve(),InputProps:{ref:Ae,className:Be.inputRoot,startAdornment:Ge,onMouseDown:e=>{e.target===e.currentTarget&&Me(e)},...(je||Re)&&{endAdornment:(0,Iy.jsxs)(ON,{className:Be.endAdornment,ownerState:Ve,children:[je?(0,Iy.jsx)(_N,{...ge(),"aria-label":f,title:f,ownerState:Ve,...Ze,className:Lp(Be.clearIndicator,Ze?.className),children:c}):null,Re?(0,Iy.jsx)(EN,{...ye(),disabled:b,"aria-label":Ee?m:Z,title:Ee?m:Z,ownerState:Ve,...Je,className:Lp(Be.popupIndicator,Je?.className),children:ne}):null]})}},inputProps:{className:Be.input,disabled:b,readOnly:re,...he()}})}),Te?(0,Iy.jsx)(CN,{as:We,...He,children:(0,Iy.jsxs)(IN,{as:$e,...Ue,children:[q&&0===De.length?(0,Iy.jsx)(TN,{className:Be.loading,ownerState:Ve,children:Q}):null,0!==De.length||E||q?null:(0,Iy.jsx)(AN,{className:Be.noOptions,ownerState:Ve,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:$}),De.length>0?(0,Iy.jsx)(Qe,{as:V,...ze,children:De.map((e,t)=>j?Ye({key:e.key,group:e.group,children:e.options.map((t,n)=>Xe(t,e.index+n))}):Xe(e,t))}):null]})}):null]})}),MN=RN;var LN=["child_medical_history"];function NN(e){return NN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},NN(e)}var FN=["style"];function VN(){return VN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VN.apply(null,arguments)}function BN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BN(Object(n),!0).forEach(function(t){QN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QN(e,t,n){return(t=function(e){var t=function(e){if("object"!=NN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=NN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==NN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $N=function(t){var r,o,i=t.questionId,a=t.label,s=t.options,l=void 0===s?[]:s,u=t.defaultValue,c=void 0===u?"":u,d=t.helperText,p=t.required,f=void 0!==p&&p,m=t.onChange,h=t.inputProps,v=void 0===h?{}:h,y=t.header,g=t.styleName,b=t.customTheme,w=void 0===b?{}:b,S=t.tooltip,x=void 0===S?"":S,k=t.showQuestionLabels,O=void 0===k||k,_=t.addressGroup,E=void 0===_?"":_,C=t.isClearable,I=t.testIdRoot,T=sd(),A=Vc().state,P=v["data-item-index"],D=v["data-parent-id"],j=$S({questionId:i,itemIndex:P,defaultValue:c,defaultVisible:!0,defaultDisabled:!1}),R=j.visible,M=j.disabled,L=j.error,N=j.handleChange,F=j.value,V=(0,e.useMemo)(function(){var e,t,n,r=D,o=P,a=null===(e=A.optionVisibility)||void 0===e?void 0:e[i];null!=r&&void 0!==o&&null!==(t=A.optionVisibilityByInstance)&&void 0!==t&&null!==(t=t[r])&&void 0!==t&&null!==(t=t[Number(o)])&&void 0!==t&&t[i]&&(a=A.optionVisibilityByInstance[r][Number(o)][i]);var s=l;a&&(s=l.filter(function(e){var t=e.optionId||e.id;return!1!==a[t]}));var u=null!=r&&void 0!==o&&function(e){if(!e||"string"!=typeof e)return!1;var t=String(e).toLowerCase();return!!t.includes("owner_info_dropdown")||LN.some(function(e){return e.toLowerCase()===t})}(E);if(u&&Array.isArray(null===(n=A.values)||void 0===n?void 0:n[r])){var c=String(i),d=Number(o),p=(A.values[r]||[]).filter(function(e,t){return t!==d}).map(function(e){var t;return null==e||null===(t=e.properties)||void 0===t||null===(t=t.find(function(e){return String(null==e?void 0:e.editQuestionId)===c}))||void 0===t?void 0:t.value}).filter(function(e){if(null==e)return!1;var t=String(e).trim();return""!==t&&t.toLowerCase()!=="Enter My Own".toLowerCase()}),f=s.filter(function(e){return!p.includes(e.value)});if(F){var m=s.find(function(e){return e.value===F});m&&!f.some(function(e){return e.value===F})&&(f=[].concat(function(e){return function(e){if(Array.isArray(e))return zN(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return zN(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zN(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(f),[m]))}return f}return s},[l,A.optionVisibility,A.optionVisibilityByInstance,A.values,i,D,P,E,F]),B=(0,e.useMemo)(function(){return function(e,t){if(!e||null==t||!t.length)return e;if(t.find(function(t){return t.value===e}))return e;var n=t.find(function(t){return t.label===e});return n?n.value:e}(F,l)},[F,l]),q=(0,e.useMemo)(function(){var e;return V.find(function(e){return e.value===B})||(null!==(e=l.find(function(e){return e.value===B}))&&void 0!==e?e:null)},[V,l,B]),Q=(0,e.useMemo)(function(){var e=T.selectField||{};return YS(e,w)},[T,w]),z=(0,e.useMemo)(function(){var e=qN(qN({},Q.container),{},{width:"100%"});return{container:KS(e,Q.responsive),menu:Q.menu,menuItem:Q.menuItem,helperText:Q.helperText}},[Q]),$=(0,e.useMemo)(function(){var e,t,n,r,o,i,a,s,l,u,c=Q.outline||{},d=Q.outlineFocus||{},p=Q.outlineHover||{},f=Q.disabled||{},m=ZS(Q.input,Q.select),h=Q.errorFocus||{},v=c.border||"1px solid #D1D5DB",y=c.borderRadius||"0.375rem",g=L?h.borderColor||(null===(e=Q.error)||void 0===e?void 0:e.borderColor)||"#DC2626":d.borderColor||"#0A2647",b=L?h.boxShadow||"0 0 0 2px rgba(220, 38, 38, 0.25)":d.boxShadow||"0 0 0 2px rgba(10, 38, 71, 0.1)",w=m.paddingRight||"2.5rem",S=(null===(t=Q.inputWithClearIcon)||void 0===t?void 0:t.paddingRight)||"5.5rem";return{width:"100%","& .MuiOutlinedInput-root":{minHeight:m.minHeight||"2.5rem",padding:0,backgroundColor:m.backgroundColor||"#FFFFFF","& .MuiOutlinedInput-input":{padding:m.padding||"0.5rem 0.75rem",paddingRight:"".concat(w," !important"),fontSize:m.fontSize||"1rem",lineHeight:m.lineHeight||"1.5",color:m.color||"#1F2937"},"& fieldset":{border:L?"1px solid ".concat((null===(n=Q.error)||void 0===n?void 0:n.borderColor)||"#DC2626"):v,borderRadius:y},"&:hover fieldset":qN({border:L?"1px solid ".concat((null===(r=Q.error)||void 0===r?void 0:r.borderColor)||"#DC2626"):v},p.borderColor&&!L?{borderColor:p.borderColor}:{}),"&.Mui-focused fieldset":{border:"1px solid ".concat(g),borderWidth:"1px",boxShadow:b},"&.Mui-disabled":{backgroundColor:f.backgroundColor||"#f1f5f9",cursor:f.cursor||"not-allowed",opacity:1},"&.Mui-disabled .MuiOutlinedInput-input":{color:f.color||"#64748b",WebkitTextFillColor:f.WebkitTextFillColor||f.color||"#64748b",cursor:f.cursor||"not-allowed"},"&.Mui-disabled fieldset":{borderColor:f.borderColor||"#cbd5e1"},"&.Mui-disabled:hover fieldset":{borderColor:f.borderColor||"#cbd5e1"}},"&.MuiAutocomplete-hasClearIcon .MuiOutlinedInput-input":{paddingRight:"".concat(S," !important")},"& .MuiAutocomplete-popupIndicator":qN({},Q.popupIndicator||{color:"#0A2647"}),"& .MuiAutocomplete-clearIndicator":qN(qN({},Q.clearIndicator||{color:"#9CA3AF"}),{},{visibility:"visible",marginRight:null!==(o=null===(i=Q.indicatorSeparator)||void 0===i?void 0:i.margin)&&void 0!==o?o:"0.25rem",borderRadius:0,borderRight:(null===(a=Q.indicatorSeparator)||void 0===a?void 0:a.border)||"1px solid #E5E7EB",paddingRight:null!==(s=null===(l=Q.indicatorSeparator)||void 0===l?void 0:l.padding)&&void 0!==s?s:"0.25rem"}),"& .Mui-disabled .MuiAutocomplete-popupIndicator":{color:f.iconColor||"#94a3b8"},"& .Mui-disabled .MuiAutocomplete-clearIndicator":{color:f.iconColor||"#94a3b8",borderRightColor:(null===(u=Q.indicatorSeparator)||void 0===u?void 0:u.disabledBorderColor)||"#E2E8F0"},"& .MuiAutocomplete-endAdornment":qN({},Q.endAdornment||{right:"0.5rem"})}},[Q,L]),U=(0,e.useCallback)(function(e,t){return function(e,t){var n=String(null!=t?t:"").trim();if(!n)return e;var r=n.toLowerCase();return e.filter(function(e){var t;return String(null!==(t=null==e?void 0:e.label)&&void 0!==t?t:"").toLowerCase().startsWith(r)})}(e,t.inputValue)},[]);if(!R)return null;var W=void 0===P?i:"".concat(i,"-").concat(P),H=function(){if(O&&a)return n().createElement("span",null,a,x&&n().createElement(hO,{tooltip:x}))},G=Boolean(O&&a),Y="boolean"==typeof C?C:!f,K=Boolean(q)&&!M&&Y,X=(K?null===(r=Q.inlineTooltip)||void 0===r?void 0:r.rightWithClearIcon:null===(o=Q.inlineTooltip)||void 0===o?void 0:o.right)||(K?"5.5rem":"2.5rem");return n().createElement("div",{className:"form-field ".concat(g||""),style:z.container},y&&n().createElement("div",{className:"field-header",style:T.header},y),n().createElement("div",{style:{position:"relative",width:"100%"}},n().createElement(MN,{fullWidth:!0,openOnFocus:!0,disableClearable:!Y,options:V,value:q,onChange:function(e,t,n){var r,o="clear"!==n&&t&&null!==(r=t.value)&&void 0!==r?r:"";N(o,{cardListId:D,instanceIndex:P}),m&&m({target:{value:o,name:String(void 0===P?i:"".concat(i,"-").concat(P))}})},getOptionLabel:function(e){var t;return String(null!==(t=null==e?void 0:e.label)&&void 0!==t?t:"")},getOptionDisabled:function(e){return Boolean(e.disabled)},isOptionEqualToValue:function(e,t){return(null==e?void 0:e.value)===(null==t?void 0:t.value)},filterOptions:U,disabled:M,noOptionsText:"No options",sx:$,renderInput:function(e){return n().createElement(NS,VN({},e,{variant:"outlined",label:G?H():void 0,hiddenLabel:!G,required:G&&f,error:!!L,id:String(W),slotProps:{inputLabel:{style:T.label},htmlInput:qN(qN({},e.inputProps),{},{autoComplete:"off",name:String(W),"data-item-index":P,"data-parent-id":D,"data-testid":dd(I,"trigger")})}}))},renderOption:function(e,t){var r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,FN);return n().createElement("li",VN({},o,{style:qN(qN({},r),z.menuItem),"data-testid":dd(I,"option",t.value)}),t.label)},slotProps:{listbox:{style:z.menu,"data-testid":dd(I,"listbox")}}}),G&&x&&n().createElement("div",{style:{position:"absolute",top:"8px",right:X,zIndex:1}},n().createElement(hO,{tooltip:x}))),(L||d)&&n().createElement(bb,{component:"div",style:L?T.error:z.helperText||T.helperText},L||d))};function UN(e){return UN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UN(e)}function WN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WN(Object(n),!0).forEach(function(t){GN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GN(e,t,n){return(t=function(e){var t=function(e){if("object"!=UN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}$N.propTypes={questionId:o().oneOfType([o().string,o().number]).isRequired,label:o().string.isRequired,options:o().arrayOf(o().shape({value:o().oneOfType([o().string,o().number,o().bool]).isRequired,label:o().string.isRequired,disabled:o().bool})).isRequired,defaultValue:o().string,helperText:o().string,required:o().bool,onChange:o().func,inputProps:o().object,header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,addressGroup:o().string,isClearable:o().bool,testIdRoot:o().string};var YN=function(t){var r=t.name,o=t.label,i=t.value,a=t.onChange,s=t.disabled,l=t.required,u=t.error,c=t.validation,d=void 0===c?{}:c,p=t.header,f=t.styleName,m=t.customTheme,h=void 0===m?{}:m,v=t.tooltip,y=void 0===v?"":v,g=t.showQuestionLabels,b=void 0===g||g,w=t.testId,S=t.testIdRoot,x=sd(),k=d.min,O=d.max,_=d.step,E=void 0===_?1:_,C=(0,e.useMemo)(function(){var e=x.spinnerField||{};return YS(e,h)},[x,h]),I=(0,e.useMemo)(function(){var e=HN(HN({},C.container),{},{width:"100%"}),t=ZS(C.input,s&&C.disabled,u&&C.error),n=ZS(C.button,s&&C.disabled);return{container:KS(e,C.responsive),wrapper:C.wrapper,input:t,button:n,header:ZS(C.header),label:ZS(C.label,l&&C.required,s&&C.disabled),error:ZS(C.error)}},[C,s,u,l]);return n().createElement("div",{className:"spinner-field ".concat(f||""),style:I.container},p&&n().createElement("div",{className:"field-header",style:I.header},p),b&&o&&n().createElement("div",{className:"question_label",style:I.label},o,l&&n().createElement("span",{style:C.required},"*"),y&&n().createElement(hO,{tooltip:y})),n().createElement("div",{style:I.wrapper},n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)-E;(void 0===k||e>=k)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==k&&(Number(i)||0)<=k,style:I.button,"aria-label":"Decrease value","data-testid":dd(S,"decrement")},"-"),n().createElement("input",{type:"number",name:r,value:i||"",onChange:function(e){if(!s){var t=Number(e.target.value);Number.isNaN(t)||(void 0===k||t>=k)&&(void 0===O||t<=O)&&a({target:{name:r,value:t}})}},disabled:s,autoComplete:"off",style:I.input,min:k,max:O,step:E,"data-testid":w}),n().createElement("button",{type:"button",onClick:function(){if(!s){var e=(Number(i)||0)+E;(void 0===O||e<=O)&&a({target:{name:r,value:e}})}},disabled:s||void 0!==O&&(Number(i)||0)>=O,style:I.button,"aria-label":"Increase value","data-testid":dd(S,"increment")},"+")),u&&n().createElement("div",{style:I.error},u))};YN.propTypes={name:o().string.isRequired,label:o().string,value:o().oneOfType([o().number,o().string]),onChange:o().func.isRequired,disabled:o().bool,required:o().bool,error:o().string,validation:o().shape({min:o().number,max:o().number,step:o().number}),header:o().node,styleName:o().string,customTheme:o().object,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string,testIdRoot:o().string};var KN=a("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./src/components/fields/styles/TextAreaField.css"),XN={};XN.styleTagTransform=kl(),XN.setAttributes=bl(),XN.insert=yl().bind(null,"head"),XN.domAPI=hl(),XN.insertStyleElement=Sl(),fl()(KN.A,XN),KN.A&&KN.A.locals&&KN.A.locals;var ZN=["value","_onChange","disabled","_editable"];function JN(e){return JN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JN(e)}function eF(){return eF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eF.apply(null,arguments)}function tF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tF(Object(n),!0).forEach(function(t){rF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rF(e,t,n){return(t=function(e){var t=function(e){if("object"!=JN(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=JN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JN(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oF=function(t){t._id;var r=t.name,o=t.label,i=t.value,a=t.validation,s=t.placeholder,l=t.rows,u=void 0===l?3:l,c=t.disabled,d=t.className,p=t.onChange,f=t.header,m=t.styleName,h=t.customTheme,v=void 0===h?{}:h,y=t.error,g=t.helperText,b=t.maxLength,w=t.tooltip,S=void 0===w?"":w,x=t.showQuestionLabels,k=void 0===x||x,O=t.testId,_=sd(),E=(0,e.useMemo)(function(){var e=_.textAreaField||{};return YS(e,v)},[_,v]),C=(0,e.useMemo)(function(){var e=nF(nF({},E.container),{},{width:"100%"}),t=ZS(E.textarea,y&&E.error,c&&E.disabled);return{container:KS(e,E.responsive),textarea:t}},[E,y,c]),I=function(e){p&&p(e)};return n().createElement("div",{className:"form-field ".concat(m||""),style:C.container},f&&n().createElement("div",{className:"field-header",style:_.header},f),n().createElement(zO,{name:r,label:k?o:"",value:i,validation:a,className:d,customTheme:E,error:y,helperText:g,renderLabel:function(e){var t=e.label,r=e.isRequired;return t?n().createElement("div",{style:E.label||{}},t,r&&n().createElement("span",{style:E.required||{}},"*"),S&&n().createElement(hO,{tooltip:S})):null},renderInput:function(e){var t=e.value,r=(e._onChange,e.disabled),o=(e._editable,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ZN)),i=Boolean(r||c);return n().createElement("textarea",eF({},o,{value:t||"",onChange:I,rows:u,placeholder:s,disabled:i,className:"form-field__textarea",style:C.textarea,maxLength:b,"data-testid":O}))}}))};function iF(){return iF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iF.apply(null,arguments)}oF.propTypes={_id:o().oneOfType([o().string,o().number]),name:o().oneOfType([o().string,o().number]).isRequired,label:o().string,value:o().string,validation:o().object,placeholder:o().string,rows:o().number,disabled:o().bool,className:o().string,onChange:o().func,header:o().node,styleName:o().string,customTheme:o().object,error:o().string,helperText:o().string,maxLength:o().number,tooltip:o().string,showQuestionLabels:o().bool,testId:o().string};var aF=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(function(e){if("string"==typeof e)return{value:e,label:e};var t=e.optionId,n=e.text,r=e.name,o=e.value;return{value:o||r||t||"",label:n||r||o||"",id:t||o||r,selected:e.selected||!1,sortOrder:e.sortOrder||0}}).sort(function(e,t){return e.sortOrder-t.sortOrder}):(console.warn("Invalid options:",e),[])},sF={text:function(e){return n().createElement(OM,iF({},e,{type:"text"}))},textbox:SO,email:function(e){return n().createElement(SO,iF({},e,{type:"email"}))},password:NM,url:function(e){return n().createElement(SO,iF({},e,{type:"url"}))},number:function(e){return n().createElement(OM,iF({},e,{type:"number"}))},ssn:function(e){return n().createElement(OM,iF({},e,{type:"ssn"}))},itin:function(e){return n().createElement(OM,iF({},e,{type:"itin"}))},tin:function(e){return n().createElement(OM,iF({},e,{type:"tin"}))},tel:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},phone:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},phonenumber:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},mobile:function(e){return n().createElement(OM,iF({},e,{type:"phone"}))},percentage:function(e){var t,r,o,i,a;return n().createElement(VL,iF({},e,{minValue:null!==(t=null!==(r=e.minValue)&&void 0!==r?r:e.minvalue)&&void 0!==t?t:0,maxValue:null!==(o=null!==(i=e.maxValue)&&void 0!==i?i:e.maxvalue)&&void 0!==o?o:100,decimalScale:null!==(a=e.decimalScale)&&void 0!==a?a:2,placeholder:e.placeholder}))},currency:fI,textarea:oF,button:e_,radio:UL,radiobutton:UL,radiotabbuttons:eN,radioswitch:UL,select:$N,dropdown:$N,dynamicdropdown:Dj,checkbox:$C,checkboxgroup:oI,address:NO,identification:mM,grid:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},beneficiary:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},cardlist:function(e){return n().createElement(nE,iF({},e,{customQuestionValueList:e.customQuestionValueList,maxItems:e.maxItems,minItems:e.minItems}))},spinner:YN,file:tM,upload:tM,pdf:$M,pdfpackage:rL,date:fj,datetime:fj,month:fj,time:fj,week:fj,displaytext:Sj,hyperlink:iM,link:iM,default:function(e){return console.warn("No component found for field type: ".concat(e.type,", falling back to text input")),n().createElement(SO,iF({},e,{type:"text"}))}},lF=function(e){return e?sF[e.toLowerCase()]||(console.warn("No component found for field type: ".concat(e,", using default text input")),sF.default):(console.warn("No field type provided, using default text input"),sF.default)};function uF(e){return uF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uF(e)}var cF=["showQuestionLabels","apiConfig"];function dF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return pF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(pF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,pF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,pF(d,"constructor",u),pF(u,"constructor",l),l.displayName="GeneratorFunction",pF(u,o,"GeneratorFunction"),pF(d),pF(d,o,"Generator"),pF(d,r,function(){return this}),pF(d,"toString",function(){return"[object Generator]"}),(dF=function(){return{w:i,m:p}})()}function pF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pF=function(e,t,n,r){function i(t,n){pF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},pF(e,t,n,r)}function fF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function mF(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){fF(i,r,o,a,s,"next",e)}function s(e){fF(i,r,o,a,s,"throw",e)}a(void 0)})}}function hF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hF(Object(n),!0).forEach(function(t){yF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yF(e,t,n){return(t=function(e){var t=function(e){if("object"!=uF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=uF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return bF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(bF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,bF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,bF(d,"constructor",u),bF(u,"constructor",l),l.displayName="GeneratorFunction",bF(u,o,"GeneratorFunction"),bF(d),bF(d,o,"Generator"),bF(d,r,function(){return this}),bF(d,"toString",function(){return"[object Generator]"}),(gF=function(){return{w:i,m:p}})()}function bF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bF=function(e,t,n,r){function i(t,n){bF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},bF(e,t,n,r)}function wF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function SF(e){return xF.apply(this,arguments)}function xF(){return e=gF().m(function e(t){var n,r,o,i,a,s,l,u=arguments;return gF().w(function(e){for(;;)switch(e.n){case 0:i=null!==(n=(o=u.length>1&&void 0!==u[1]?u[1]:{}).pollIntervalMs)&&void 0!==n?n:100,a=null!==(r=o.timeoutMs)&&void 0!==r?r:8e3,s=Date.now();case 1:if(!(Date.now()-s<a)){e.n=5;break}if(l="function"==typeof t?t():{},!Object.values(l||{}).some(Boolean)){e.n=3;break}return e.n=2,new Promise(function(e){return setTimeout(e,i)});case 2:e.n=4;break;case 3:return e.a(2,!0);case 4:e.n=1;break;case 5:return e.a(2,!1)}},e)}),xF=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){wF(i,r,o,a,s,"next",e)}function s(e){wF(i,r,o,a,s,"throw",e)}a(void 0)})},xF.apply(this,arguments);var e}function kF(e){return kF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kF(e)}function OF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OF(Object(n),!0).forEach(function(t){EF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EF(e,t,n){return(t=function(e){var t=function(e){if("object"!=kF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=kF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return IF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(IF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,IF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,IF(d,"constructor",u),IF(u,"constructor",l),l.displayName="GeneratorFunction",IF(u,o,"GeneratorFunction"),IF(d),IF(d,o,"Generator"),IF(d,r,function(){return this}),IF(d,"toString",function(){return"[object Generator]"}),(CF=function(){return{w:i,m:p}})()}function IF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}IF=function(e,t,n,r){function i(t,n){IF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},IF(e,t,n,r)}function TF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function AF(e){return AF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AF(e)}function PF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PF(Object(n),!0).forEach(function(t){jF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jF(e,t,n){return(t=function(e){var t=function(e){if("object"!=AF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=AF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RF=function(e,t,n,r,o){return Bd(e,t,{values:n.values,visibility:n.visibility,disabled:n.disabled,required:n.required},o,{formSchema:r})};function MF(e){return MF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MF(e)}function LF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return NF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(NF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,NF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,NF(d,"constructor",u),NF(u,"constructor",l),l.displayName="GeneratorFunction",NF(u,o,"GeneratorFunction"),NF(d),NF(d,o,"Generator"),NF(d,r,function(){return this}),NF(d,"toString",function(){return"[object Generator]"}),(LF=function(){return{w:i,m:p}})()}function NF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}NF=function(e,t,n,r){function i(t,n){NF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},NF(e,t,n,r)}function FF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function VF(e,t,n){return(t=function(e){var t=function(e){if("object"!=MF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=MF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==MF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BF=function(t){var r=t.question,o=t.isVisible,i=t.isDisabled,a=t.isRequired,s=t.value,l=t.parentContext,u=t.apiConfig,c=t.showQuestionLabels,d=void 0===c||c,p=t.isCardlistModal,f=void 0!==p&&p,m=Vc(),h=m.state,v=m.setValue,y=m.setSubmitted,g=m.setDisabled,b=m.questionRuleDetails,w=m.formSchema,S=m.validateForm,x=m.setRequired,k=m.setNestedState,O=m.rulesEngine,_=vd().buildTestId,E=(0,e.useRef)(o),C=(0,e.useRef)(!1),I=(0,e.useRef)(!1),T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,e.useContext)(Ac),r=n.state,o=n.formState,i=n.onApiTrigger,a=n.handleApiTrigger,s=(0,e.useCallback)(function(){var e,n=(e=CF().m(function e(n){var s,l;return CF().w(function(e){for(;;)switch(e.n){case 0:if(!(s=a||(i&&"function"==typeof i?function(e){return i(e,r)}:null))){e.n=2;break}return l=_F(_F({},n),{},{toastConfigOverride:t,contextStateSnapshot:{values:(null==o?void 0:o.values)||{},visibility:(null==o?void 0:o.visibility)||{},disabled:(null==o?void 0:o.disabled)||{},required:(null==o?void 0:o.required)||{},errors:(null==o?void 0:o.errors)||{},apiErrors:(null==o?void 0:o.apiErrors)||{},isSubmitted:(null==o?void 0:o.isSubmitted)||!1}}),e.n=1,s(l);case 1:return e.a(2,e.v);case 2:return e.a(2,null)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){TF(i,r,o,a,s,"next",e)}function s(e){TF(i,r,o,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),[o,a,i,r,t]);return{triggerApi:s,formState:o}}(),A=T.triggerApi;if((0,e.useEffect)(function(){if(o&&!E.current&&!C.current&&(null==r?void 0:r.apiUrl)&&"function"==typeof A&&function(e){var t,n;return!(null==e||!e.apiUrl||"dropdown"!==(null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase())&&!0!==(null===(n=e.proxyConfig)||void 0===n?void 0:n.callOnMount))}(r)&&function(e,t){if(e){var n=Vd(e);return 0===n.length||n.every(function(e){var n=t[e];return null!=n&&""!==n})}return!1}(r,h.values)){C.current=!0;var e=RF(r,h.values[null==r?void 0:r.questionId],h,w,"pageLoad");A(e)}o||(C.current=!1),E.current=o},[o,r,A,h,w]),(0,e.useEffect)(function(){var e;if(null!=r&&r.questionId&&o){var t=r.questionId,n=r.apiUrl,i=r.questionType,a=r.addressGroup,s=null==h||null===(e=h.optionsByQuestionId)||void 0===e?void 0:e[t];if(n&&"text"===(null==i?void 0:i.toLowerCase())&&(null==a?void 0:a.toLowerCase().includes("owner_info_dropdown"))&&(null==s?void 0:s.length)>0){var u=te(t);if(void 0!==(null==l?void 0:l.itemIndex)&&(null==l?void 0:l.parentId)&&k){var c=te(l.parentId);k(c,l.itemIndex,{required:VF({},t,!0)}),null!=O&&O.requiredState&&O.requiredState.set(u,!0),null!=O&&O.updateAllInstanceStates&&O.updateAllInstanceStates(c,u,"required",!0)}else x&&x(u,!0)}}},[null==r?void 0:r.questionId,null==r?void 0:r.apiUrl,null==r?void 0:r.questionType,null==r?void 0:r.addressGroup,null==h?void 0:h.optionsByQuestionId,o,null==l?void 0:l.itemIndex,null==l?void 0:l.parentId,x,k,O]),null!=r&&r.questionId&&o){var P,D=r.questionId,j=r.name,R=r.label,M=r.questionType,L=r.options,N=void 0===L?[]:L,F=r.header,V=void 0===F?"":F,B=r.placeholder,q=void 0===B?"":B,Q=r.hintText,z=r.defaultValue,$=r.format,U=void 0===$?"":$,W=r.minLength,H=r.maxLength,G=r.min,Y=r.max,K=r.encrypted,X=void 0!==K&&K,Z=r.maskInput,J=r.maskingType,ee=void 0===J?"":J,ne=r.maskingLength,re=void 0===ne?"":ne,oe=r.target,ie=void 0===oe?"":oe,ae=r.validationErrorMessages,se=void 0===ae?{}:ae,le=r.showCheckBox,ue=void 0!==le&&le,ce=r.isEsignDoc,de=void 0!==ce&&ce,pe=r.isOpenInNewTab,fe=void 0!==pe&&pe,me=r.addAdditional,he=void 0!==me&&me,ve=r.addMedication,ye=void 0!==ve&&ve,ge=r.styleName,be=void 0===ge?"":ge,we=r.customQuestionValueList,Se=r.inputProps,xe=r.dependency,ke=r.fileUploads,Oe=r.allowedFileType,_e=r.fileSizeLimit,Ee=r.numberOfFiles,Ce=r.includeExtraDropDowns,Ie=r.additionalDropDowns,Te=r.uploadQuestionAdditionalDropDown,Ae=r.errorMessage,Pe=r.addressGroup,De=r.startDate,je=r.endDate,Re=r.dateFormat,Me=r.apiUrl,Le=r.tooltip,Ne=void 0===Le?"":Le,Fe=r.cardDeletionProperties,Ve=null==h||null===(P=h.optionsByQuestionId)||void 0===P?void 0:P[D];if(function(e,t,n,r){return e&&"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("owner_info_dropdown"))&&!(null!=r&&r.length)}(Me,M,Pe,Ve))return null;var Be=function(e,t){var n=null==e?void 0:e.toLowerCase();return"text"===n&&null!=t&&t.toLowerCase().includes("address")?"address":"text"===n&&null!=t&&t.toLowerCase().includes("owner_info_dropdown")?"dropdown":n}(M,Pe),qe=lF(Be);if(qe){var Qe,ze,$e,Ue,We=function(e,t,n,r,o){return"text"===(null==t?void 0:t.toLowerCase())&&(null==n?void 0:n.toLowerCase().includes("address"))&&r&&Object.keys(r).length>0?DF(DF({},e),{},{"data-parent-id":r.parentId||o,"data-item-index":void 0===r.itemIndex?-1:r.itemIndex}):e}(Se,M,Pe,l,D),He=aF(Ve||N),Ge=d&&function(e){return!["radio","radiobutton","checkbox","link","button","pdf","cardlist","beneficiary","grid","submit","reset","hidden","checkboxgroup","displaytext"].includes(null==e?void 0:e.toLowerCase())}(M),Ye=function(e,t,n){var r,o,i,a=(null==n||null===(r=n.ruleValidationErrors)||void 0===r?void 0:r[e])||(null==n||null===(o=n.apiErrors)||void 0===o?void 0:o[e])||(null==n||null===(i=n.errors)||void 0===i?void 0:i[e])||null,s=AF(a);if(null!=t&&t.isCardList&&void 0!==(null==t?void 0:t.itemIndex)){var l,u,c,d,p,f,m,h="".concat(t.parentId,"_").concat(t.itemIndex),v=null===(l=n.nestedStates)||void 0===l?void 0:l[h],y=te(e);s=AF(a=(null==v||null===(u=v.ruleValidationErrors)||void 0===u?void 0:u[e])||(null==v||null===(c=v.apiErrors)||void 0===c?void 0:c[e])||(null==v||null===(d=v.errors)||void 0===d?void 0:d[e])||(y&&y!==e?(null==v||null===(p=v.ruleValidationErrors)||void 0===p?void 0:p[y])||(null==v||null===(f=v.apiErrors)||void 0===f?void 0:f[y])||(null==v||null===(m=v.errors)||void 0===m?void 0:m[y]):null)||null)}return a&&"object"===AF(a)&&(a=Object.values(a).filter(Boolean).join(", ")),{fieldError:a,fieldErrorType:s}}(D,l,h),Ke=Ye.fieldError,Xe=Ye.fieldErrorType,Ze=function(){var e,t=(e=LF().m(function e(){var t,n,o,i,a,s,l;return LF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=null==M?void 0:M.toLowerCase(),n="button"===t,o=r.apiUrl,i=r.actionName&&"function"==typeof A,!n||!o&&!i){e.n=7;break}if("string"==typeof(null==r?void 0:r.apiUrl)&&0!==r.apiUrl.trim().length){e.n=3;break}return e.n=1,S();case 1:if(a=e.v,!(Object.keys(a).length>0)){e.n=2;break}return y(!0),e.a(2);case 2:if(!tt([".error_message_display_text",".error-message"])){e.n=3;break}return y(!0),e.a(2);case 3:if(s=RF(r,null,h,w,"buttonClick"),!I.current){e.n=4;break}return e.a(2);case 4:return l=Boolean(r.disabled),I.current=!0,"function"==typeof g&&g(D,!0),e.p=5,e.n=6,A(s);case 6:return e.p=6,I.current=!1,"function"==typeof g&&g(D,l),e.f(6);case 7:return e.a(2)}},e,null,[[5,,6,7]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){FF(i,r,o,a,s,"next",e)}function s(e){FF(i,r,o,a,s,"throw",e)}a(void 0)})});return function(){return t.apply(this,arguments)}}(),Je=null!=q&&""!==String(q).trim()?q:Q||z||R||"",et=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null,nt=pt(D,et),rt=null!==(Qe=null!==(ze=null===($e=h.userModified)||void 0===$e?void 0:$e[nt])&&void 0!==ze?ze:r.userModified)&&void 0!==Qe&&Qe,ot=function(e){var t=e.question,n=e.questionId,r=e.name,o=e.label,i=e.shouldShowLabel,a=e.value,s=e.formattedOptions,l=e.handleChange,u=e.handleBlur,c=e.handleButtonClick,d=e.isDisabled,p=e.isRequired,f=e.computedPlaceholder,m=e.fieldError,h=e.minLength,v=e.maxLength,y=e.min,g=e.max,b=e.header,w=e.format,S=e.encrypted,x=e.maskInput,k=e.maskingType,O=e.maskingLength,_=e.target,E=e.validationErrorMessages,C=e.showCheckBox,I=e.isEsignDoc,T=e.isOpenInNewTab,A=e.addAdditional,P=e.addMedication,D=e.questionRuleDetails,j=e.fieldInputProps,R=e.isVisible,M=e.apiConfig,L=e.dependency,N=e.state,F=e.styleName,V=e.customQuestionValueList,B=e.fileUploads,q=e.allowedFileType,Q=e.fileSizeLimit,z=e.numberOfFiles,$=e.includeExtraDropDowns,U=e.additionalDropDowns,W=e.uploadQuestionAdditionalDropDown,H=e.errorMessage,G=e.addressGroup,Y=e.startDate,K=e.endDate,X=e.dateFormat,Z=e.questionType,J=e.parentContext,ee=e.showQuestionLabels,te=e.isCardlistModal,ne=e.userModified,re=void 0!==ne&&ne,oe=e.cardDeletionProperties,ie=DF(DF({id:String(n),questionId:String(n),name:r,label:i?"":o,value:void 0===a?"":a,options:s,onChange:l,onBlur:u,onClick:"button"===(null==Z?void 0:Z.toLowerCase())?c:void 0,disabled:d,required:p,placeholder:f,error:m,maxLength:v,minLength:h,min:y,max:g,header:b,format:w,encrypted:S,maskInput:x,maskingType:k,maskingLength:O,target:_,validationerrormessages:E,showcheckbox:C,isesigndoc:I,isopeninnewtab:T,addadditional:A,addmedication:P,questionRuleDetails:D,inputProps:j,visible:R,dependsOn:null==L?void 0:L.split(","),formData:N.values,styleName:F,customQuestionValueList:V,fileUploads:B,allowedFileType:q,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:$,additionalDropDowns:U,uploadQuestionAdditionalDropDown:W,errorMessage:H,addressGroup:G,tooltip:t.tooltip||"",showQuestionLabels:ee,userModified:re},j),{},{apiConfig:M});t.fieldProps&&Object.assign(ie,t.fieldProps),ie.apiConfig=M;var ae=S?{encrypted:!0}:{},se=DF(DF({},ie),ae);return G&&Object.assign(se,{addressGroup:G}),"upload"===(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{allowedFileType:q,fileSizeLimit:Q,numberOfFiles:z,includeExtraDropDowns:$,additionalDropDowns:U,uploadQuestionAdditionalDropDown:W,errorMessage:H}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{maskInput:x,maskingType:k,maskingLength:O}),["cardlist","beneficiary","grid"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{customQuestionValueList:V,questionType:"cardlist",min:y,max:g,isCardlistModal:te,cardListPreviewPattern:t.cardListPreviewPattern,patternPreview:t.patternPreview,cardDeletionProperties:null!=oe?oe:null}),["date","datetime","month","time","week"].includes(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{startDate:Y,endDate:K,dateFormat:X}),"displaytext"===(null==Z?void 0:Z.toLowerCase())&&Object.assign(se,{value:t.value,parentContext:J}),se.apiConfig=M,se}({question:r,questionId:D,name:j,label:R,shouldShowLabel:Ge,value:s,formattedOptions:He,handleChange:function(e){var t=null==M?void 0:M.toLowerCase();("cardlist"===t||r.onChange)&&"function"==typeof r.onChange&&r.onChange(e);var n=function(e,t,n){var r,o;if("upload"===(null==t?void 0:t.toLowerCase())){var i=e.value,a=e.fileUploads;return n.fileUploads=a,i}return null!==(r=null==e||null===(o=e.target)||void 0===o?void 0:o.value)&&void 0!==r?r:e}(e,t,r);if(e&&"cardlist"!==t&&"button"!==t){var o=null!=l&&l.isCardList?{cardListId:l.parentId,instanceIndex:l.itemIndex}:null;v(D,n,null,o)}if(("dropdown"===t||"text"===t)&&r.apiUrl&&"function"==typeof A){var i=RF(r,n,h,w,"onChange");A(i)}},handleBlur:function(e){var t=null==M?void 0:M.toLowerCase();if(("text"===t||"currency"===t)&&r.apiUrl&&"function"==typeof A){var n,o=void 0===(null==e||null===(n=e.target)||void 0===n?void 0:n.value)?e:e.target.value,i=RF(r,o,h,w,"onBlur");A(i)}},handleButtonClick:Ze,isDisabled:i,isRequired:a,computedPlaceholder:Je,fieldError:Ke,minLength:W,maxLength:H,min:G,max:Y,header:V,format:U,encrypted:X,maskInput:Z,maskingType:ee,maskingLength:re,target:ie,validationErrorMessages:se,showCheckBox:ue,isEsignDoc:de,isOpenInNewTab:fe,addAdditional:he,addMedication:ye,questionRuleDetails:b,fieldInputProps:We,isVisible:o,apiConfig:u,dependency:xe,state:h,styleName:be,customQuestionValueList:we,fileUploads:ke,allowedFileType:Oe,fileSizeLimit:_e,numberOfFiles:Ee,includeExtraDropDowns:Ce,additionalDropDowns:Ie,uploadQuestionAdditionalDropDown:Te,errorMessage:Ae,addressGroup:Pe,startDate:De,endDate:je,dateFormat:Re,questionType:M,parentContext:l,showQuestionLabels:d,isCardlistModal:f,userModified:rt,cardDeletionProperties:Fe}),it=null!=(null==l?void 0:l.parentId)&&void 0!==(null==l?void 0:l.itemIndex),at=it?"".concat(D,"_").concat(l.itemIndex):D,st=null!==(Ue=r.testId)&&void 0!==Ue?Ue:D,lt=(r.questionType||"unknown").toString().toLowerCase(),ut=it?["field",l.parentId,"item",l.itemIndex,lt,st]:["field",lt,st],ct=_.apply(void 0,ut),dt=_.apply(void 0,ut.concat(["label"])),ft=_.apply(void 0,ut.concat(["error"])),mt=_.apply(void 0,ut.concat(["input"]));ot["data-testid"]=mt,ot.testId=mt,ot.testIdRoot=ct;var ht="button"!==(null==M?void 0:M.toLowerCase())?"col-md-12":"";return n().createElement("div",{id:"question_".concat(at),className:"form-field-container ".concat(Ke?"has-error":""," ").concat(be||ht),"data-testid":ct},Ge&&R&&n().createElement("div",{className:"field-label","data-testid":dt},n().createElement("div",{className:"question_label"},R,d&&a&&n().createElement("span",{className:"required-mark"},"*"),d&&Ne&&n().createElement(hO,{tooltip:Ne})),V&&n().createElement("div",{className:"field-header"},V)),n().createElement(qe,ot),Ke&&"string"===Xe&&"upload"!==(null==M?void 0:M.toLowerCase())&&"percentage"!==(null==M?void 0:M.toLowerCase())&&n().createElement("div",{className:"error-message","data-testid":ft},Ke))}}return null};BF.propTypes={question:Xd,isVisible:o().bool,isDisabled:o().bool,isRequired:o().bool,value:o().any,parentContext:o().object,apiConfig:o().object,showQuestionLabels:o().bool,isCardlistModal:o().bool};const qF=BF;function QF(e){return QF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},QF(e)}function zF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zF(Object(n),!0).forEach(function(t){UF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UF(e,t,n){return(t=function(e){var t=function(e){if("object"!=QF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=QF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==QF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WF=function(e){return void 0!==(null==e?void 0:e.itemIndex)&&(null==e?void 0:e.parentId)},HF=function(e){return"".concat(e.parentId,"_").concat(e.itemIndex)},GF=function(e){var t=e.group,r=e.parentContext,o=void 0===r?null:r,i=e.apiConfig,a=e.defaultGroupClass,s=void 0===a?"":a,l=e.showQuestionLabels,u=void 0===l||l,c=e.isCardlistModal,d=void 0!==c&&c,p=Vc().state,f=vd().buildTestId;if(t&&Array.isArray(t.questions)){var m,h;if(!t.groupId||null===(m=null==p||null===(h=p.groupVisibility)||void 0===h?void 0:h[t.groupId])||void 0===m||m){var v=t.questions.some(function(e){var t,n,r,o=null==e?void 0:e.questionId;return!!o&&(null===(t=null!==(n=null==p||null===(r=p.visibility)||void 0===r?void 0:r[o])&&void 0!==n?n:e.visible)||void 0===t||t)}),y=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=te(null==e?void 0:e.questionId),o=null==e||null===(t=e.questionType)||void 0===t?void 0:t.toLowerCase();return WF(n)?function(e,t,n,r){var o,i,a=null==r||null===(o=r.values)||void 0===o?void 0:o[n.parentId];if(Array.isArray(a)&&a[n.itemIndex]){var s=a[n.itemIndex];if(Array.isArray(null==s?void 0:s.properties)){var l,u,c=s.properties.find(function(e){return te(e.editQuestionId)===t});if(c)return null!==(l=null!==(u=c.value)&&void 0!==u?u:e.defaultValue)&&void 0!==l?l:""}if(void 0!==s[t])return s[t]}return null!==(i=e.defaultValue)&&void 0!==i?i:""}(e,r,n,p):"cardlist"===o?function(e,t){var n,r=null==t||null===(n=t.values)||void 0===n?void 0:n[e];return Array.isArray(r)?r.map(function(e){return e?{name:e.name,properties:Array.isArray(e.properties)?e.properties.map(function(e){return $F($F({},e),{},{editQuestionId:te(e.editQuestionId),property:e.property,renderMode:e.renderMode,value:e.value})}):[]}:{}}):[]}(r,p):function(e,t,n){var r,o,i,a;return null!==(r=null!==(o=null!==(i=null==n||null===(a=n.values)||void 0===a?void 0:a[t])&&void 0!==i?i:e.value)&&void 0!==o?o:e.defaultValue)&&void 0!==r?r:""}(e,r,p)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map(function(e,r){var o=te(null==e?void 0:e.questionId);if(o){var a=function(e,t,n){return WF(n)?"".concat(e,"-").concat(t,"-").concat(n.itemIndex):"".concat(e,"-").concat(t)}(o,r,t),s=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null===(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.visibility)||void 0===u?void 0:u[e])&&void 0!==l?l:r)||void 0===s||s}return null===(o=null!==(i=null==n||null===(a=n.visibility)||void 0===a?void 0:a[e])&&void 0!==i?i:r)||void 0===o||o}(o,t,p,e.visible),l=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.disabled)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.disabled)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.disabled),c=function(e,t,n,r){var o,i,a;if(WF(t)){var s,l,u,c=HF(t);return null!==(s=null!==(l=null==n||null===(u=n.nestedStates)||void 0===u||null===(u=u[c])||void 0===u||null===(u=u.required)||void 0===u?void 0:u[e])&&void 0!==l?l:r)&&void 0!==s&&s}return null!==(o=null!==(i=null==n||null===(a=n.required)||void 0===a?void 0:a[e])&&void 0!==i?i:r)&&void 0!==o&&o}(o,t,p,e.required);return n().createElement(qF,{key:a,question:e,isVisible:s,isDisabled:l,isRequired:c,value:y(e,t),parentContext:t,apiConfig:i,showQuestionLabels:u,isCardlistModal:d})}return null})},b="question-group ".concat(WF(o)?"card-list-question":""," ").concat(s||"").trim(),w=t.groupName&&!t.groupName.startsWith("--");if(v){var S,x,k=null!==(S=null!==(x=t.groupId)&&void 0!==x?x:t.groupName)&&void 0!==S?S:"unnamed";return n().createElement("div",{className:b,key:"question-group-".concat((null==o?void 0:o.itemIndex)||""),"data-testid":f("group",k)},w&&n().createElement("h3",{className:"group-name"},t.groupName),g(t.questions,o))}return g(t.questions,o)}return null}return null};GF.propTypes={group:Zd,parentContext:o().object,apiConfig:o().object,defaultGroupClass:o().string,showQuestionLabels:o().bool,isCardlistModal:o().bool};const YF=GF;function KF(e){return KF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KF(e)}function XF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return ZF(u,"_invoke",function(n,r,o){var i,s,l,u=0,c=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,l=e,p.n=n,a}};function f(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,i=c[t],f=p.p,m=i[2];n>3?(o=m===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(s=0,p.v=r,p.n=i[1]):f<m&&(o=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,c,m){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),s=c,l=m;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(p.n=-1),f(s,l)):p.n=l:p.v=l);try{if(u=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==a)break}catch(t){i=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,i),!0),u}var a={};function s(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(ZF(t={},r,function(){return this}),t),d=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ZF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,ZF(d,"constructor",u),ZF(u,"constructor",l),l.displayName="GeneratorFunction",ZF(u,o,"GeneratorFunction"),ZF(d),ZF(d,o,"Generator"),ZF(d,r,function(){return this}),ZF(d,"toString",function(){return"[object Generator]"}),(XF=function(){return{w:i,m:p}})()}function ZF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ZF=function(e,t,n,r){function i(t,n){ZF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ZF(e,t,n,r)}function JF(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function eV(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){JF(i,r,o,a,s,"next",e)}function s(e){JF(i,r,o,a,s,"throw",e)}a(void 0)})}}function tV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tV(Object(n),!0).forEach(function(t){rV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rV(e,t,n){return(t=function(e){var t=function(e){if("object"!=KF(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=KF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==KF(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oV(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=aV(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function iV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||aV(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aV(e,t){if(e){if("string"==typeof e)return sV(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sV(e,t):void 0}}function sV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var lV=function(t){var r,o=t.schema,i=void 0===o?[]:o,a=t.actionSchema,s=void 0===a?[]:a,l=t.onSubmit,u=t.isNested,c=void 0!==u&&u,d=t.parentContext,p=void 0===d?{}:d,f=t.apiConfig,m=t.onApiTrigger,h=t.toastConfig,v=void 0===h?{}:h,y=t.defaultGroupClass,g=void 0===y?"":y,b=t.rerunPageRulesOnNext,w=void 0===b||b,S=t.pageRenderers,x=void 0===S?{}:S,k=t.pageType,O=t.showQuestionLabels,_=void 0===O||O,E=t.isCardlistModal,C=void 0!==E&&E,I=Vc(),T=vd().buildTestId,A=I.state,P=I.setSubmitted,D=I.validateForm,j=I.onApiTrigger,R=I.handleApiTrigger,M=I.batchUpdateFields,L=I.updateFieldOptions,N=I.processPageLoadRules,F=I.clearApiError,V=I.setApiError,B=I.setError,q=(0,e.useRef)(A),Q=(0,e.useRef)((null==A?void 0:A.required)||{});if((0,e.useEffect)(function(){q.current=A},[A]),(0,e.useEffect)(function(){if(null!=A&&A.required&&null!=A&&A.errors){for(var e=A.required,t=Q.current,n=[],r=0,o=Object.entries(A.errors);r<o.length;r++){var i=iV(o[r],2),a=i[0];if(i[1]){var s=!1!==t[a],l=!1===e[a];s&&l&&n.push(a)}}if(n.length>0&&B){var u,c=oV(n);try{for(c.s();!(u=c.n()).done;){var d=u.value;B(d,null)}}catch(e){c.e(e)}finally{c.f()}}Q.current=nV({},e)}else Q.current=(null==A?void 0:A.required)||{}},[null==A?void 0:A.required,null==A?void 0:A.errors,B]),!Array.isArray(i))throw new TypeError("Invalid form schema provided");var z=(0,e.useMemo)(function(){return function(e){if(Array.isArray(e)){var t,n=[],r=jd(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(Array.isArray(null==o?void 0:o.questions)){var i,a=jd(o.questions);try{for(a.s();!(i=a.n()).done;){var s=i.value;Md(s,n)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}return n}return[]}(i)},[i]),$=function(){var e=eV(XF().m(function e(t,n,r){var o,a,s,l,u,c;return XF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=t.questionId,a=qd(A),s=Bd(t,n,a,r,{formSchema:i}),!R){e.n=1;break}return e.a(2,R(nV(nV({},s),{},{questionId:o,contextStateSnapshot:a})));case 1:if(!(l=m||j)){e.n=5;break}return e.p=2,e.n=3,l(s,A);case 3:return u=e.v,e.a(2,Rl(u,{questionId:o,applyUpdates:M,applyOptions:L,setApiError:V,clearApiError:F,showSuccessToast:function(e){return El(e,"success",v)},showErrorToast:function(e){return El(e,"error",v)}}));case 4:return e.p=4,c=e.v,El(c.message||"An error occurred during API operation","error",v),e.a(2,{errors:{error:c.message||"Unknown error occurred"}});case 5:return e.a(2,null)}},e,null,[[2,4]])}));return function(t,n,r){return e.apply(this,arguments)}}(),U=(0,e.useRef)(new Set);(0,e.useEffect)(function(){if(z.length&&A){var e,t=oV(z);try{for(t.s();!(e=t.n()).done;){var n,r,o=e.value,i=null===(n=null===(r=A.visibility)||void 0===r?void 0:r[o.questionId])||void 0===n||n,a="".concat(o.questionId,"_").concat(o.triggerType);if("pageLoad"===o.triggerType&&i&&!Cd(A,o.questionId)&&!U.current.has(a)){U.current.add(a);var s={questionId:o.questionId,questionType:o.questionType,addressGroup:o.addressGroup,apiUrl:o.apiUrl,proxyConfig:o.proxyConfig},l=A.values[o.questionId];$(s,l,"pageLoad")}}}catch(e){t.e(e)}finally{t.f()}}},[z,null==A?void 0:A.visibility,null==A?void 0:A.values]);var W=function(){var e=eV(XF().m(function e(t,n){var r,o,i,a,s,u,c;return XF().w(function(e){for(;;)switch(e.n){case 0:if(n.preventDefault(),"back"!==(null==t?void 0:t.toLowerCase())){e.n=1;break}return l&&l(q.current,t),e.a(2);case 1:if(s="save"===(null==t?void 0:t.toLowerCase())){e.n=3;break}return e.n=2,D();case 2:if(u=e.v,!(Object.keys(u).length>0)){e.n=3;break}return P(!0),Kd(),e.a(2);case 3:return e.n=4,SF(function(){var e;return null===(e=q.current)||void 0===e?void 0:e.apiLoading});case 4:if(!e.v){e.n=5;break}e.n=6;break;case 5:return El("Still waiting for the latest server response. Please try again in a moment.","warning",v),e.a(2);case 6:if("next"!==(null==t?void 0:t.toLowerCase())||!w||!N){e.n=7;break}return e.n=7,N();case 7:if(s||!Yd(null===(r=q.current)||void 0===r?void 0:r.errors,null===(o=q.current)||void 0===o?void 0:o.apiErrors,null===(i=q.current)||void 0===i?void 0:i.ruleValidationErrors,null===(a=q.current)||void 0===a?void 0:a.nestedStates)){e.n=8;break}return P(!0),Kd(),e.a(2);case 8:if(c=[".error_message_display_text",".error-message"],s||!tt(c)){e.n=9;break}return P(!0),Kd(),e.a(2);case 9:l&&l(q.current,t);case 10:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),H=c?"div":"form",G=k?String(k):null!==(r=i[0])&&void 0!==r&&r.groupId?String(i[0].groupId):null,Y=G&&x[G]?x[G]:null,K=function(e,t,r,o){var i=function(i){var a,s,l,u,c,d,p,f,m,h,v,y,g,b,w,S,x,k,O=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i||!i.questionId)return console.warn("createFieldRenderer: Invalid question provided"),null;var _=e.state,E=i.questionId,C=null===(a=i.questionType)||void 0===a?void 0:a.toLowerCase(),I=t(C);if(!I)return console.warn("createFieldRenderer: No component found for type: ".concat(C)),null;var T=void 0!==O.value?O.value:null!==(s=null!==(l=null!==(u=null==_||null===(c=_.values)||void 0===c?void 0:c[E])&&void 0!==u?u:i.value)&&void 0!==l?l:i.defaultValue)&&void 0!==s?s:"",A=null===(d=null!==(p=null==_||null===(f=_.visibility)||void 0===f?void 0:f[E])&&void 0!==p?p:i.visible)||void 0===d||d,P=null!==(m=null!==(h=null==_||null===(v=_.disabled)||void 0===v?void 0:v[E])&&void 0!==h?h:i.disabled)&&void 0!==m&&m,D=null!==(y=null!==(g=null==_||null===(b=_.required)||void 0===b?void 0:b[E])&&void 0!==g?g:i.required)&&void 0!==y&&y,j=(null==_||null===(w=_.errors)||void 0===w?void 0:w[E])||(null==_||null===(S=_.ruleValidationErrors)||void 0===S?void 0:S[E])||(null==_||null===(x=_.apiErrors)||void 0===x?void 0:x[E])||null,R=(null==_||null===(k=_.optionsByQuestionId)||void 0===k?void 0:k[E])||i.options||[],M=r(R),L=O.showQuestionLabels,N=O.apiConfig,F=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(O,cF),V=void 0===L||L,B=void 0!==N?N:o,q=vF(vF(vF({id:String(E),questionId:String(E),name:i.name||E,label:i.label||"",value:void 0===T?"":T,options:M,disabled:P||F.disabled,required:D,placeholder:i.placeholder||i.hintText||i.defaultValue||"",error:j,maxLength:i.maxLength,minLength:i.minLength,min:i.min,max:i.max,header:i.header,format:i.format,encrypted:i.encrypted,maskInput:i.maskInput,maskingType:i.maskingType,maskingLength:i.maskingLength,target:i.target,validationerrormessages:i.validationErrorMessages,showcheckbox:i.showCheckBox,isesigndoc:i.isEsignDoc,isopeninnewtab:i.isOpenInNewTab,addadditional:i.addAdditional,addmedication:i.addMedication,visible:A,styleName:i.styleName||"",tooltip:i.tooltip||"",showQuestionLabels:V},i.fieldProps),F),{},{apiConfig:B});return"upload"===C&&Object.assign(q,{allowedFileType:i.allowedFileType,fileSizeLimit:i.fileSizeLimit,numberOfFiles:i.numberOfFiles,includeExtraDropDowns:i.includeExtraDropDowns,additionalDropDowns:i.additionalDropDowns,uploadQuestionAdditionalDropDown:i.uploadQuestionAdditionalDropDown,errorMessage:i.errorMessage}),["text","tel","email","password","number","phonenumber","mobile","phone","ssn","tin"].includes(C)&&Object.assign(q,{maskInput:i.maskInput,maskingType:i.maskingType,maskingLength:i.maskingLength}),["cardlist","beneficiary","grid"].includes(C)&&Object.assign(q,{customQuestionValueList:i.customQuestionValueList,questionType:"cardlist",min:i.min,max:i.max}),["date","datetime","month","time","week"].includes(C)&&Object.assign(q,{startDate:i.startDate,endDate:i.endDate,dateFormat:i.dateFormat}),!q.onChange&&e.setValue&&(q.onChange=function(t){var n,r,o,i="upload"===C?null!==(n=null==t?void 0:t.value)&&void 0!==n?n:t:null!==(r=null==t||null===(o=t.target)||void 0===o?void 0:o.value)&&void 0!==r?r:t;e.setValue(E,i),F.onChange&&F.onChange(t)}),!q.onBlur&&e.setValue&&(q.onBlur=function(e){F.onBlur&&F.onBlur(e)}),"button"!==C||q.onClick||(q.onClick=mF(dF().m(function t(){var n,r,o,a;return dF().w(function(t){for(;;)switch(t.n){case 0:if(n=!!i.apiUrl,r=!!i.actionName,!n&&!r){t.n=3;break}if(n||"function"!=typeof e.validateForm){t.n=2;break}return t.n=1,e.validateForm();case 1:if(o=t.v,!(Object.keys(o).length>0)){t.n=2;break}return null===(a=e.setSubmitted)||void 0===a||a.call(e,!0),t.a(2);case 2:"function"==typeof e.handleApiTrigger&&e.handleApiTrigger({questionId:E,triggerType:"buttonClick",apiUrl:i.apiUrl,actionName:i.actionName,proxyConfig:i.proxyConfig,values:(null==_?void 0:_.values)||{},questionType:null==i?void 0:i.questionType});case 3:return t.a(2)}},t)}))),q.apiConfig=B,n().createElement(I,q)};return i.displayName="FieldRenderer",i}(I,lF,aF,f),X=function(){return s&&0!==s.length?n().createElement("div",{className:"form-actions","data-testid":T("actions")},s.map(function(e,t){if(e&&"object"===KF(e)){var r,o=e.text,i=e.action,a=e.disabled,s=void 0!==a&&a,l=e.actionButtonId,u="action_".concat(i,"_").concat(t),c="btn ".concat(["validateinterview","next","save"].includes(i)?"btn-primary":"btn-secondary"),d=(null===(r=A.actionButtonDisabled)||void 0===r?void 0:r[l])||!1,p=s||d,f=p?{cursor:"not-allowed"}:{},m=l||"".concat(i||"button","-").concat(t);return n().createElement("button",{key:u,type:"button",disabled:p,className:c,style:f,onClick:function(e){return W(i,e)},"data-testid":T("action",m)},o)}return null})):null};return Y?n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form"),"data-testid":T("root")},n().createElement(Y,{pageType:G,schema:i,state:A,formContext:I,renderField:K,getFieldComponent:lF,formatOptions:aF,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:_}),X()):n().createElement(H,{onSubmit:c?void 0:function(e){return e.preventDefault()},className:"dynamic-form ".concat(void 0===(null==p?void 0:p.itemIndex)?"":"card-list-form"),"data-testid":T("root")},i.map(function(e,t){var r=null!=e&&e.groupId?String(e.groupId):"group_".concat(t),o=x[r];if(o)return n().createElement(o,{key:r,groupId:r,group:e,schema:i,state:A,formContext:I,renderField:K,getFieldComponent:lF,formatOptions:aF,actionSchema:s,handleActionClick:W,parentContext:p,apiConfig:f,defaultGroupClass:g,isNested:c,showQuestionLabels:_,isCardlistModal:C});var a=(null==e?void 0:e.groupId)||"group_".concat(t);return n().createElement(YF,{key:a,group:e,parentContext:p,apiConfig:f,defaultGroupClass:g,showQuestionLabels:_,isCardlistModal:C})}),X())};lV.propTypes={schema:Jd.questionGroups,actionSchema:o().array,onSubmit:o().func,isNested:o().bool,parentContext:o().object,apiConfig:o().object,onApiTrigger:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),defaultGroupClass:o().string,rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool};const uV=lV;function cV(e){return cV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cV(e)}function dV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dV(Object(n),!0).forEach(function(t){fV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fV(e,t,n){return(t=function(e){var t=function(e){if("object"!=cV(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cV(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mV=function(t){var r=t.questionGroups,o=t.actionButtons,i=t.questionRuleDetails,a=void 0===i?[]:i,s=t.questionRules,l=void 0===s?[]:s,u=t.groupRuleDetails,c=void 0===u?[]:u,d=t.groupRules,p=void 0===d?[]:d,f=t.optionRuleDetails,m=void 0===f?[]:f,h=t.optionRules,v=void 0===h?[]:h,y=t.buttonRules,g=void 0===y?[]:y,b=t.buttonRuleDetails,w=void 0===b?[]:b,S=t.theme,x=void 0===S?{}:S,k=t.debug,O=void 0!==k&&k,_=t.onSubmit,E=t.validationErrors,C=void 0===E?[]:E,T=t.isNested,A=void 0!==T&&T,P=t.parentContext,D=void 0===P?{}:P,j=t.skipFormProvider,R=void 0!==j&&j,M=t.apiConfig,L=t.onApiTrigger,N=t.formApiRef,F=t.handleIncompleteChange,V=t.toastConfig,q=void 0===V?{}:V,Q=t.performanceConfig,z=t.engineOptions,$=t.defaultGroupClass,U=void 0===$?"":$,W=t.rerunPageRulesOnNext,H=void 0===W||W,G=t.pageRenderers,Y=void 0===G?{}:G,K=t.pageType,X=t.showQuestionLabels,Z=void 0===X||X,J=t.isCardlistModal,ee=void 0!==J&&J,te=t.isSanitizeAddress,ne=t.testIdPrefix,re=void 0===ne?ld:ne,oe=t.testIdsEnabled,ie=void 0===oe||oe;console.log("Package Version:","1.4.9");var ae=(0,e.useMemo)(function(){return pV(pV({},ed),x)},[x]),se=n().createElement(ad,{theme:ae},n().createElement(uV,{schema:Array.isArray(r)?r.map(function(e){return e&&"object"===cV(e)&&!Array.isArray(e.questions)?pV(pV({},e),{},{questions:Array.isArray(e.questions)?e.questions:[]}):e}):[],actionSchema:o,onSubmit:_,isNested:A,parentContext:D,apiConfig:M,onApiTrigger:L,toastConfig:q,defaultGroupClass:U,rerunPageRulesOnNext:H,pageRenderers:Y,pageType:K,showQuestionLabels:Z,isCardlistModal:ee})),le=se;if(A||R||(le=n().createElement(Fc,{formSchema:r,questionRuleDetails:a,questionRules:l,groupRuleDetails:c,groupRules:p,optionRuleDetails:m,optionRules:v,buttonRules:g,buttonRuleDetails:w,validationSchema:C,debug:O,onApiTrigger:L,formApiRef:N,handleIncompleteChange:F,toastConfig:q,performanceConfig:Q,engineOptions:z,isCardlistModal:ee,isSanitizeAddress:te},se)),M){var ue,ce,de={baseURL:M.baseURL||(null===(ue=M.customApi)||void 0===ue?void 0:ue.baseUrl)||"",headers:(null===(ce=M.customApi)||void 0===ce?void 0:ce.headers)||{}};M.customApi&&Object.assign(de,M.customApi),le=n().createElement(B,{config:de},le)}return null!=q&&q.disableToasts||null!=q&&q.useHostToastify||(le=n().createElement(n().Fragment,null,le,n().createElement(I,{position:"top-right",autoClose:5e3}))),A?le:n().createElement(hd,{prefix:re,enabled:ie},le)};mV.propTypes={questionGroups:o().arrayOf(o().shape({groupName:o().string,questions:o().arrayOf(o().object)})),actionButtons:o().arrayOf(o().object),questionRuleDetails:o().arrayOf(o().object),questionRules:o().arrayOf(o().shape({targetQuestionId:o().oneOfType([o().string,o().number]).isRequired,expressionToEvaluateForTheAction:o().object.isRequired})),groupRuleDetails:o().arrayOf(o().object),groupRules:o().arrayOf(o().object),optionRuleDetails:o().arrayOf(o().object),optionRules:o().arrayOf(o().object),buttonRules:o().arrayOf(o().object),buttonRuleDetails:o().arrayOf(o().object),theme:o().object,debug:o().bool,onSubmit:o().func,validationErrors:o().arrayOf(o().shape({questionid:o().oneOfType([o().string,o().number]).isRequired,message:o().string.isRequired,groupId:o().oneOfType([o().string,o().number])})),isNested:o().bool,parentContext:o().object,skipFormProvider:o().bool,apiConfig:o().object,parentAddressGroup:o().string,onApiTrigger:o().func,formApiRef:o().shape({current:o().object}),handleIncompleteChange:o().func,toastConfig:o().shape({disableToasts:o().bool,useHostToastify:o().bool}),performanceConfig:o().shape({debounceDelayMs:o().number}),engineOptions:o().shape({enablePerActionGating:o().bool,maxEvaluationDepth:o().number}),rerunPageRulesOnNext:o().bool,pageRenderers:o().objectOf(o().elementType),pageType:o().oneOfType([o().string,o().number]),showQuestionLabels:o().bool,isCardlistModal:o().bool,isSanitizeAddress:o().string,testIdPrefix:o().string,testIdsEnabled:o().bool,defaultGroupClass:o().string};const hV=((yV=function(e){return n().createElement(Od,{fallback:Ed},n().createElement(vV,e))}).displayName="WithErrorBoundary(".concat((vV=mV).displayName||vV.name||"Component",")"),yV);var vV,yV;function gV(){var t=Vc(),n=t.formData,r=t.errors,o=t.touched,i=t.isSubmitting,a=t.handleChange,s=t.handleSubmit,l=t.setFieldError,u=t.setFieldTouched,c=t.setIsSubmitting,d=t.resetForm,p=(0,e.useCallback)(function(e,t){var n=al(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[]);return n&&l(e.questionId,n),n},[l]);return{formData:n,errors:r,touched:o,isSubmitting:i,handleChange:a,handleSubmit:s,validateField:p,setFieldTouched:u,setIsSubmitting:c,resetForm:d}}})(),s})());