PageSourceSearch

https://www.dubaifirst.com/dist/DF/static/js/898.5a7e0ead.chunk.js

js dubaifirst.com collected 2026-10-02 15:17:39 UTC 114,031 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfab2=self.webpackChunkfab2||[]).push([[898],{56898:(e,l,i)=>{i.r(l),i.d(l,{default:()=>ol});var o=i(1413),n=i(88391),d=i(3705),t=i(57753),a=i(52691),u=i(67409),s=i(97745),r=i(67430);const v=(0,n.createContext)(null),c=e=>{var l,i;const o=null===e||void 0===e||null===(l=e.field)||void 0===l?void 0:l.model,{mobileField:d}=(0,n.useContext)(v);let t="+971 ";if(d){t+=d.substr(0,2);for(let e=0;e<(null===d||void 0===d?void 0:d.length)-5;e++)t+="*";t+=d.substr(d.length-3)}return o?n.createElement(o.htmlTag||"p",{className:(0,r.Z)("form-heading",o.cssClass)},null!==(i=o.text)&&void 0!==i&&i.includes("$mobileNumber")?[o.text.replace("$mobileNumber",""),n.createElement("span",{key:"mobileNumber",className:"adpay-heading-phone"},t)]:o.text):null};var m=i(23712);const f=e=>{let{active:l,setActive:i,typeSetter:o=()=>{}}=e;return l?(0,m.jsx)("svg",{width:"20",height:"17",viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:()=>{i(!1),o()},style:{cursor:"pointer"},children:(0,m.jsx)("path",{d:"M10.0026 0.997803C7.04363 0.997803 4.55063 2.45179 2.50263 4.84179C1.80163 5.65879 1.18863 6.5318 0.690634 7.4038C0.388634 7.9318 0.204625 8.33978 0.096625 8.59178C-0.011375 8.84278 -0.011375 9.15279 0.096625 9.40379C0.204625 9.65579 0.388634 10.0638 0.690634 10.5918C1.18863 11.4638 1.80163 12.3368 2.50263 13.1538C4.55063 15.5438 7.04363 16.9978 10.0026 16.9978C12.9616 16.9978 15.4546 15.5438 17.5026 13.1538C18.2036 12.3368 18.8166 11.4638 19.3146 10.5918C19.6166 10.0638 19.8006 9.65579 19.9086 9.40379C20.0166 9.15279 20.0166 8.84278 19.9086 8.59178C19.8006 8.33978 19.6166 7.9318 19.3146 7.4038C18.8166 6.5318 18.2036 5.65879 17.5026 4.84179C15.4546 2.45179 12.9616 0.997803 10.0026 0.997803ZM10.0026 4.9978C12.2116 4.9978 14.0026 6.78879 14.0026 8.99779C14.0026 11.2068 12.2116 12.9978 10.0026 12.9978C7.79363 12.9978 6.00263 11.2068 6.00263 8.99779C6.00263 6.78879 7.79363 4.9978 10.0026 4.9978ZM10.0026 6.99779C8.89763 6.99779 8.00263 7.89279 8.00263 8.99779C8.00263 10.1028 8.89763 10.9978 10.0026 10.9978C11.1076 10.9978 12.0026 10.1028 12.0026 8.99779C12.0026 7.89279 11.1076 6.99779 10.0026 6.99779Z",fill:"#2A5082"})}):(0,m.jsx)("svg",{width:"20",height:"17",viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:()=>{i(!0),o()},style:{cursor:"pointer"},children:(0,m.jsx)("path",{d:"M10.0012 0.997803C7.04217 0.997803 4.54917 2.45182 2.50117 4.84182C1.80117 5.65882 1.18716 6.5318 0.689155 7.4038C0.387155 7.9308 0.20316 8.33981 0.0951602 8.59181C-0.0128399 8.84281 -0.0128399 9.15279 0.0951602 9.40379C0.20316 9.65579 0.387155 10.0638 0.689155 10.5918C1.18716 11.4638 1.80117 12.3368 2.50117 13.1538C2.80217 13.5048 3.12916 13.8538 3.45216 14.1618L2.33115 15.2738C1.94115 15.6638 1.92016 16.3068 2.31016 16.6968C2.70116 17.0878 3.32916 17.1068 3.72016 16.7168L8.59517 11.8098L12.8452 7.59182L17.7202 2.71682C18.1102 2.32582 18.1102 1.66981 17.7202 1.27881C17.5252 1.08381 17.2572 0.997803 17.0012 0.997803C16.7452 0.997803 16.4792 1.12083 16.2832 1.31583L15.0302 2.58581C13.5372 1.59181 11.7992 0.997803 10.0012 0.997803ZM10.0012 2.9978C11.2502 2.9978 12.4842 3.37581 13.5692 4.02581L12.0562 5.56081C11.4582 5.21581 10.7132 4.9978 10.0012 4.9978C7.79217 4.9978 6.00117 6.78879 6.00117 8.99779C6.00117 9.71479 6.23616 10.4418 6.58216 11.0388L4.85316 12.7338C4.55816 12.4558 4.27017 12.1548 4.00117 11.8418C3.38917 11.1278 2.87816 10.3598 2.43916 9.59181C2.28416 9.32081 2.21717 9.18079 2.12617 8.99779C2.21717 8.81379 2.28416 8.67479 2.43916 8.4038C2.87816 7.6358 3.38917 6.8678 4.00117 6.1538C5.70317 4.1688 7.71017 2.9978 10.0012 2.9978ZM17.9392 5.84182C17.6872 5.79382 17.4172 5.84179 17.1892 5.99779C16.7322 6.30879 16.6272 6.91679 16.9392 7.37279C17.2782 7.87079 17.5722 8.38181 17.8142 8.84181C17.8522 8.91381 17.8452 8.93679 17.8762 8.99779C17.7852 9.18079 17.7182 9.32081 17.5642 9.59181C17.1242 10.3598 16.6132 11.1278 16.0012 11.8418C14.2992 13.8268 12.2922 14.9978 10.0012 14.9978C9.75317 14.9978 9.22717 14.9488 8.72017 14.8728C8.17417 14.7908 7.67717 15.1698 7.59517 15.7168C7.51317 16.2628 7.89216 16.7598 8.43916 16.8418C9.04516 16.9328 9.62017 16.9978 10.0012 16.9978C12.9602 16.9978 15.4532 15.5438 17.5012 13.1538C18.2022 12.3368 18.8152 11.4638 19.3142 10.5918C19.6152 10.0638 19.7992 9.65579 19.9072 9.40379C20.0152 9.15279 20.0152 8.84281 19.9072 8.59181C19.6772 8.05381 19.2552 7.21679 18.5952 6.24779C18.4392 6.01979 18.1902 5.88882 17.9392 5.84182ZM10.0012 6.99779C10.1552 6.99779 10.4022 7.03081 10.5472 7.06481L8.083
117 9.51579C8.00217 9.29379 8.00117 9.15079 8.00117 8.99779C8.00117 7.89279 8.89717 6.99779 10.0012 6.99779Z",fill:"#2A5082"})})};var p=i(14256),h=i(90410),g=i(40140),C=i(39632),x=i(40498),F=i(27866),y=i(83193);const b=e=>{let{data:l}=e;return(0,m.jsxs)("div",{className:"country-item",children:[(0,m.jsx)(x.Z,{src:null===l||void 0===l?void 0:l.flag,alt:"".concat(null===l||void 0===l?void 0:l.countryName,"-flag"),title:"".concat(l.countryName,"-flag"),className:"country-item-image"}),(0,m.jsxs)("div",{className:"country-item-code",children:["+",null===l||void 0===l?void 0:l.countryCode]}),(0,m.jsx)("div",{className:"country-item-label",children:null===l||void 0===l?void 0:l.countryName})]})},E=(0,a.Z)()((e=>{var l,i;let{defaultCountries:d,code:t,setCode:a,countries:u,setCountries:s,t:r}=e;const[v,c]=(0,n.useState)(""),f=(0,n.useRef)(),E=(0,y.z)(),w=null===E||void 0===E||null===(l=E.sitecoreContext)||void 0===l||null===(i=l.siteConfigurations)||void 0===i?void 0:i.cdnHost;return(0,m.jsx)(h.Z,{children:(0,m.jsxs)(g.Z,{onClose:()=>{c(""),s(d)},value:t,onChange:e=>a(e.target.value),autoWidth:!0,className:"country-code-selector",variant:"standard",IconComponent:e=>(0,m.jsx)(C.m,(0,o.Z)({},e)),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"country-code-selector-popover"},children:[(0,m.jsxs)(p.Z,{className:"input-item-wrapper",children:[(0,m.jsx)(x.Z,{src:(0,F.z)(w,"media/Project/FAB2/Fab2/data/media/svgs/icons/icon-gray-search.svg"),alt:r("icon.gray_search.alt"),title:r("icon.gray_search.title")}),(0,m.jsx)("input",{onBlur:()=>{var e;return null===f||void 0===f||null===(e=f.current)||void 0===e?void 0:e.focus()},ref:f,id:"select-search",value:v,onChange:e=>{var l;const i=null===f||void 0===f||null===(l=f.current)||void 0===l?void 0:l.value;c(i),s(""===i?d:e=>null===d||void 0===d?void 0:d.filter((e=>{var l,o;return null===e||void 0===e||null===(l=e.countryName)||void 0===l||null===(o=l.toLowerCase())||void 0===o?void 0:o.includes(null===i||void 0===i?void 0:i.toLowerCase())})))},placeholder:r("search"),onClick:e=>e.stopPropagation(),type:"text"})]}),null===u||void 0===u?void 0:u.map(((e,l)=>(0,m.jsx)(p.Z,{value:null===e||void 0===e?void 0:e.countryCode,children:(0,m.jsx)(b,{data:e})},l)))]})})})),w=e=>{var l,i,o;const d=null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.model)||void 0===i||null===(o=i.conditionSettings)||void 0===o?void 0:o.fieldKey,[t,a]=(0,n.useState)(!1),[u,s]=(0,n.useState)(!0),{actions:r,handleChangeCB:c,conditionSettings:m}=(0,n.useContext)(v);(0,n.useEffect)((()=>{r&&r.map((e=>{(null===e||void 0===e?void 0:e.fieldId)===d&&("show"===(null===e||void 0===e?void 0:e.operator)?s("d-flex"):"hide"===(null===e||void 0===e?void 0:e.operator)?s("d-none"):"disable"===(null===e||void 0===e?void 0:e.operator)?a(!0):"enable"===(null===e||void 0===e?void 0:e.operator)&&a(!1))}))}),[r]);return[t,u,c,m]};var S=i(45006),j=i(57344),N=i(92423),A=i(91378),k=i(37378),D=i(96385);const B=e=>{const l=(e=>{var l,i;if("undefined"===typeof document)return null;const o="; ".concat(document.cookie),n=null===o||void 0===o?void 0:o.split("; ".concat(e,"="));return 2===(null===n||void 0===n?void 0:n.length)?null===n||void 0===n||null===(l=n.pop())||void 0===l||null===(i=l.split(";"))||void 0===i?void 0:i.shift():null})(e);if(!l)return new Set;const i=null===l||void 0===l?void 0:l.split("|"),o=new Set;return i.forEach((e=>{null!==e&&void 0!==e&&e.endsWith("-true")||null===o||void 0===o||o.add(e)})),o},I=(e,l)=>{const[i,o]=(0,n.useState)(!1),[d,t]=(0,n.useState)(0),a=(0,n.useCallback)((()=>{const e=B("missingDocFields");if(!(e instanceof Set)||"string"!==typeof l)return void o(!1);const i=l.split(" ").filter(Boolean).some((l=>!!e.has(l)||!("authorization"!==l&&"authorization-to-sign"!==l||!e.has("authorization")&&!e.has("authorization-to-sign"))));o(i)}),[l]);return(0,n.useEffect)((()=>{a()}),[a,e,l]),(0,n.useEffect)((()=>{const e=()=>{t((e=>e+1))};return window.addEventListener("missingDocFieldsUpdated",e),()=>{window.removeEventListener("missingDocFieldsUpdated",e)}}),[]),(0,n.useEffect)((()=>{d>0&&a()}),[d,a]),(0,n.useEffect)((()=>{const e=setInterval((()=>{a()}),1e3);return()=>clearInterval(e)}),[a]),i},Z=(0,a.Z)()((e=>{var l,i,o,d,t,a;const{multi:u=!1,number:s=!1,email:c=!1,password:p=!1,phone:h=!1,singleInputWithCodes:g=!1,t:C}=e,{setMobileField:x,setValueKeyPair:F,getValueKeyPair:y,setCheckboxApiResult:b,checkboxApiResult:Z,shouldShowFieldsError:T,isSCAForm:_,isSubmitButtonDisabled:L,setIsSubmitButtonDisabled:P}=(0,n.useContext)(v),[V,O,z,q]=w(e),{field:M,value:R,onChange:U,errors:K,tracker:W}
1=e,[H,G]=(0,n.useState)(null===M||void 0===M||null===(l=M.model)||void 0===l?void 0:l.datasources),$=null===M||void 0===M?void 0:M.valueField,J=null===M||void 0===M?void 0:M.model,[Q,X]=(0,n.useState)(null===J||void 0===J?void 0:J.apiUrl),Y=I(B("missingDocFields"),null===J||void 0===J?void 0:J.cssClass),ee=h||(null===M||void 0===M?void 0:M.needToSave),le=null===J||void 0===J?void 0:J.validationDataModels,ie=null===J||void 0===J?void 0:J.readOnly,oe=null===J||void 0===J?void 0:J.helpText,ne=null!==(i=null===J||void 0===J?void 0:J.requiredFE)&&void 0!==i?i:null===J||void 0===J?void 0:J.required,[de,te]=(0,n.useState)(ne||_&&Y);(0,n.useEffect)((()=>{te(ne||_&&Y)}),[ne,Y]);const ae=!(null===T||void 0===T||!T.includes(null===J||void 0===J?void 0:J.itemId)||!de),[ue,se]=(0,n.useState)(!1);(0,n.useEffect)((()=>{""!==(null===J||void 0===J?void 0:J.apiUrl)&&X(null===J||void 0===J?void 0:J.apiUrl)}),[null===J||void 0===J?void 0:J.apiUrl]);const[re,ve]=(0,n.useState)(Array.isArray(H)&&(null===H||void 0===H?void 0:H.length)>0?null===H||void 0===H||null===(o=H[0])||void 0===o?void 0:o.countryCode:""),ce=null===e||void 0===e||null===(d=e.field)||void 0===d||null===(t=d.model)||void 0===t?void 0:t.itemId,me=_&&Y||!(null===K||void 0===K||!K.length);(0,n.useEffect)((()=>{const e=L.find((e=>void 0!==e[ce]));let l=!!_&&((null===R||void 0===R||!R.length)&&me);const i=null===e||void 0===e?void 0:e[ce];_&&Y&&!Ce&&(l=!0),i!==l&&P((e=>{const i=e.find((e=>void 0!==e[ce]));if((null===i||void 0===i?void 0:i[ce])===l)return e;return[...e.filter((e=>void 0===e[ce])),{[ce]:l}]}))}),[me,R]);const[fe,pe]=(0,n.useState)(h?"tel":s?"number":p?ue?"text":"password":c?"email":"text"),[he,ge]=(0,n.useState)(!1),[Ce,xe]=(0,n.useState)(!1),[Fe,ye]=(0,n.useState)(oe);(0,n.useEffect)((()=>{const e=y(null===$||void 0===$?void 0:$.id);null!==$&&void 0!==$&&$.id&&e&&(h?(ve(e.phoneCode),U(null===$||void 0===$?void 0:$.name,"+".concat(e.phoneCode).concat(e.value),!0,[])):U(null===$||void 0===$?void 0:$.name,e,!0,[]))}),[]);const be=(e,l)=>{if(ee){const i={phoneCode:e,value:l};F(null===$||void 0===$?void 0:$.id,i)}},Ee=(()=>{const e=y(null===$||void 0===$?void 0:$.id);if(null!==$&&void 0!==$&&$.id&&e&&e)return h?null===e||void 0===e?void 0:e.value:e;if(!h)return R;if((null===R||void 0===R?void 0:R.length)>0){const e=null===R||void 0===R?void 0:R.split("+".concat(re));return(null===e||void 0===e?void 0:e[1])||(null===e||void 0===e?void 0:e[0])}return R})(),we=!c&&((null===J||void 0===J?void 0:J.maxLength)||!1),Se=V||he||_&&!Y&&!!R&&!Ce,je=(null===R||void 0===R?void 0:R.length)>0?null===R||void 0===R?void 0:R[0]:null,Ne=_&&Y&&!!je&&0===(null===K||void 0===K?void 0:K.length)||!Y&&0===(null===K||void 0===K?void 0:K.length),Ae=g&&(0,m.jsx)(E,{defaultCountries:null===M||void 0===M||null===(a=M.model)||void 0===a?void 0:a.datasources,countries:H,setCountries:G,code:re,setCode:e=>{if(ve(e),h&&e!==re&&(null===R||void 0===R?void 0:R.length)>0){const l=null===R||void 0===R?void 0:R.split("+".concat(re)),i="+".concat(e).concat(null===l||void 0===l?void 0:l[1]);be(e,Ee),U(null===$||void 0===$?void 0:$.name,i,0===(null===K||void 0===K?void 0:K.length),K)}}}),ke=p&&(0,m.jsx)(f,{typeSetter:()=>{p&&pe(ue?"password":"text")},active:ue,setActive:se}),De=null===J||void 0===J?void 0:J.minLength,Be=null===J||void 0===J?void 0:J.maxLength,Ie=null===J||void 0===J?void 0:J.step,Ze=null===$||void 0===$?void 0:$.id,[Te,_e]=(0,n.use
1State)(!1),[Le,Pe]=(0,n.useState)({}),Ve=async()=>{try{var e;const l=await fetch(Q,{method:"GET",credentials:"include"}),i=await l.json();Pe(i);const o=null!==(e=null===i||void 0===i?void 0:i.value)&&void 0!==e?e:"";b(o),U(null===$||void 0===$?void 0:$.name,o,!0,[])}catch(l){console.error("Error fetching applicant name:",l),b(""),U(null===$||void 0===$?void 0:$.name,"",!0,[])}};return(0,n.useEffect)((()=>{let e=oe;if(Te&&null!==Le&&void 0!==Le&&Le.status&&"Failed"===(null===Le||void 0===Le?void 0:Le.status))e=C(null===Le||void 0===Le?void 0:Le.message);else if(_&&Y&&!Ce){var l,i;e=R?null===(i=C("text_rejected"))||void 0===i?void 0:i.replace("{0}",null===J||void 0===J?void 0:J.title):null===(l=C("text_required"))||void 0===l?void 0:l.replace("{0}",null===J||void 0===J?void 0:J.title)}else(null===K||void 0===K?void 0:K.length)>0?e=null===K||void 0===K?void 0:K[0]:(!R&&ae||!R&&_&&Y)&&(e=C("field_required"));ye(e)}),[Te,Le,Y,K,R,ae,oe,null===J||void 0===J?void 0:J.title,C]),(0,m.jsxs)(m.Fragment,{children:[!!Q&&(0,m.jsx)("div",{className:(0,r.Z)("form-checkbox form-element"),children:(0,m.jsx)(D.Z,{label:(null===J||void 0===J?void 0:J.description)||(null===J||void 0===J?void 0:J.title)||(null===J||void 0===J?void 0:J.placeholderText),checked:Te,onChange:e=>{_e(e),e?Ve():(b(""),U(null===$||void 0===$?void 0:$.name,"",!0,[]))},className:(0,r.Z)(O),valid:!0,value:Te,disabled:V||he})}),(0,m.jsx)(k.Z,{id:Ze,name:null===$||void 0===$?void 0:$.name,className:(0,r.Z)("form-element","normal-text-field",null===J||void 0===J?void 0:J.cssClass,O,g&&"new-singleInputWithCodes",Te&&"custom-disabled",Te&&!(null===Le||void 0===Le||!Le.status)&&"Failed"===(null===Le||void 0===Le?void 0:Le.status)&&"custom-api-error"),value:Q&&Z&&Te?Z:Ee,onChange:e=>{const l=e.target.value;if(we&&l.length>we)return;if(ie)return;xe(!0);const i={valid:!0,errors:[]},o=(null===l||void 0===l?void 0:l.length)>0?"+".concat(re).concat(l):l,n=h?o:l;if(null===le||void 0===le||le.map((o=>{try{if(null!==o&&void 0!==o&&o.parameters){let e=JSON.parse(null===o||void 0===o?void 0:o.parameters);if(null!==e&&void 0!==e&&e.regularExpression){var d,t;if(!(!(null===o||void 0===o||!o.parameters||null===e||void 0===e||!e.regularExpression)&&(null===n||void 0===n?void 0:n.match(null===e||void 0===e?void 0:e.regularExpression))))i.valid=!1,null===(d=i.errors)||void 0===d||d.push(null===o||void 0===o||null===(t=o.message)||void 0===t?void 0:t.replace("{0}",null===J||void 0===J?void 0:J.title))}}if(null!==J&&void 0!==J&&J.minLength&&null!==J&&void 0!==J&&J.maxLength){let e=((e,l,i)=>new RegExp("^.{".concat(l,",").concat(i,"}$")).test(e))(l,null===J||void 0===J?void 0:J.minLength,null===J||void 0===J?void 0:J.maxLength);var a,u,s,r;if(!e)i.valid=!1,null===(a=i.errors)||void 0===a||a.push(null===o||void 0===o||null===(u=o.message)||void 0===u||null===(s=u.replace("{0}",null===J||void 0===J?void 0:J.title))||void 0===s||null===(r=s.replace("{1}",null===J||void 0===J?void 0:J.minLength))||void 0===r?void 0:r.replace("{2}",null===J||void 0===J?void 0:J.maxLength))}}catch(e){console.error(null===e||void 0===e?void 0:e.message)}})),"MobilePhone"!==(null===J||void 0===J?void 0:J.mappingField)&&"eDirham_Contact_Phone"!==(null===J||void 0===J?void 0:J.mappingField)||x(l),h){var d;if(null!==l&&void 0!==l&&null!==(d=l.split(""))&&void 0!==d&&d.find((e=>isNaN(Number(e))||" "===e)))return;be(re,l),U(null===$||void 0===$?void 0:$.name,o,null===i||void 0===i?void 0:i.valid,null===i||void 0===i?void 0:i.errors)}else ee&&F(null===$||void 0===$?void 0:$.id,l),U(null===$||void 0===$?void 0:$.name,l,null===i||void 0===i?void 0:i.valid,null===i||void 0===i?void 0:i.errors);setTimeout((()=>{z(q)}),[50])},error:!R&&ae||!Ne||_&&Y&&!Ce,required:de,InputLabelProps:{className:"form-element-label"},helperText:(0,m.jsx)(A.Z,{text:Fe,value:R,disabled:Se,valid:!!Q&&!!Z||!R&&ae||Ne,limit:we,phoneCode:re}),disabled:Se,label:(0,m.jsx)(N.Z,{text:null===J||void 0===J?void 0:J.title,optional:!de}),placeholder:null===J||void 0===J?void 0:J.placeholderText,fullWidth:!0,type:fe,onFocus:()=>W.onFocusField(M,R),onBlur:()=>{W.onBlurField(M,R,K),(0,S.jN)("form_field_name",null===J||void 0===J?void 0:J.name),(0,S.PR)({event:"form_progress",form_field_name:null===J||void 0===J?void 0:J.name})},InputProps:{startAdornment:Ae?(0,m.jsx)(j.Z,{content:Ae}):void 0,endAdornment:ke?(0,m.jsx)(j.Z,{content:ke}):void 0,autoComplete:"off",readOnly:ie,inputProps:{min:De||"number"===fe?De:void 0,max:Be||"number"===fe?Be:void 0,id:Ze,step:Ie}},autoComplete:"off",multiline:u,rows:u?null===J||void 0===J?void 0:J.rows:void 0})]})}));var T=i(68732);const _=e=>{const l=((l,i)=>{const o=null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.model)||void 0===i?void 0:i.fieldTypeItemId;if(o){const e=Object.entries(u.U).find((e=>e[1]===o));if(e)return null===e||void 0===e?void 0:e[0]}return"certain form"})();return(0,m.jsxs)("div",{className:"form-element form-element-generic",children:["I am a placeholder for ",(0,m.jsx)("b",{children:l})," element"]})};var L=i(32616),P=i(96187);const V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"test2"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"NullValue"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"keyword"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"rootItem"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},defaultValue:{kind:"NullValue"},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"fieldsEqual"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"ItemSearchFieldQuery"}}},defaultValue:{kind:"NullValue"},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"keyword"},value:{kind:"Variable",name:{kind:"Name",value:"keyword"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"rootItem"},value:{kind:"Variable",name:{kind:"Name",value:"rootItem"}}},{kind:"Argument",name:{kind:"Name",value:"fieldsEqual"},value:{kind:"Variable",name:{kind:"Name",value:"fieldsEqual"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"results"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"item"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Value",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:384,source:{body:'query test2(\r\n  $first: Int = null\r\n  $keyword: String = null\r\n  $rootItem: String = null\r\n  $fieldsEqual: [ItemSearchFieldQuery] = null\r\n) {\r\n  search(keyword: $keyword, first: $first, rootItem: $rootItem, fieldsEqual: $fieldsEqual) {\r\n    results {\r\n      items {\r\n        item {\r\n          field(name: "Value") {\r\n            value\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n',name:"GraphQL request",locationOffset:{line:1,column:1}}}},O=(0,a.Z)()((e=>{var l,i,d,a,u,s,c,f,p,h,g,C;const[x,F]=(0,n.useState)([]),[b,E]=(0,n.useState)(!0),[j,N]=(0,n.useState)(null),A=(0,y.z)(),{t:k}=e,D=null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.model)||void 0===i?void 0:i.enableExternalDatasource,B=null===e||void 0===e||null===(d=e.field)||void 0===d||null===(a=d.model)||void 0===a?void 0:a.externalEmployerType,I=null===A||void 0===A||null===(u=A.sitecoreContext)||void 0===u||null===(s=u.siteConfigurations)||void 0===s?void 0:s.externalServicePath,Z=null===e||void 0===e?void 0:e.withGQL,O=null===e||void 0===e?void 0:e.tracker,z=null===e||void 0===e?void 0:e.field,q=null===e||void 0===e||null===(c=e.field)||void 0===c?void 0:c.model,M=null===z||void 0===z?void 0:z.valueField,R=null===z||void 0===z||null===(f=z.valueField)||void 0===f?void 0:f.name,U=null===z||void 0===z||null===(p=z.valueField)||void 0===p?void 0:p.id,K=null===e||void 0===e?void 0:e.errors,W=(null===q||void 0===q?void 0:q.items)||[],H=null===e||void 0===e?void 0:e.value,G=null===e||void 0===e?void 0:e.onChange,$=null===e||void 0===e?void 0:e.withSearch,J=null===z||void 0===z?void 0:z.needToSave,Q=null===q||void 0===q||null===(h=q.conditionSettings)||void 0===h?void 0:h.fieldKey,X=null===q||void 0===q?void 0:q.helpText,Y=null!==(g=null===q||void 0===q?void 0:q.requiredFE)&&void 0!==g?g:null===q||void 0===q?void 0:q.required,[ee,le]=(0,n.use
1State)([]),[ie,oe]=(0,n.useState)(""),[ne,{loading:de,error:te,data:ae}]=(0,L.t)(V,{fetchPolicy:"network-only",onCompleted:e=>{var l,i;le(null===e||void 0===e||null===(l=e.search)||void 0===l||null===(i=l.results)||void 0===i?void 0:i.items)}}),ue=(0,n.useCallback)((0,P.Z)(ne,500),[]),se=(0,n.useCallback)((0,P.Z)((e=>{(async e=>{try{var l;const i="".concat(t.sitecoreApiHost).concat(I,"?employerType=").concat(null===B||void 0===B?void 0:B.replace(/[{}]/g,""),"&query=").concat(e),o=await fetch(i,{method:"GET"});if(!o.ok)throw new Error("Network response was not ok");const n=await o.json(),d=(null===n||void 0===n||null===(l=n.EmployerList)||void 0===l?void 0:l.map((e=>({text:null===e||void 0===e?void 0:e.Name,value:null===e||void 0===e?void 0:e.Name}))))||[];(null===e||void 0===e?void 0:e.length)>=ge&&F(d)}catch(te){N(te)}finally{E(!1)}})(e)}),500),[]),[re,ve]=(0,n.useState)(!1),{setValueKeyPair:ce,getValueKeyPair:me,shouldShowFieldsError:fe,setDropdownProductValue:pe}=(0,n.useContext)(v),he=!(null===fe||void 0===fe||!fe.includes(null===q||void 0===q?void 0:q.itemId)||!Y),ge=null===q||void 0===q?void 0:q.minCharsToSearch;(0,n.useEffect)((()=>{const e=me(null===M||void 0===M?void 0:M.id);null!==M&&void 0!==M&&M.id&&e&&(ve(!0),G(R,e?[e]:[],!0,[]))}),[]);const[Ce,xe,Fe,ye]=w(e),be=(()=>{const e=me(null===M||void 0===M?void 0:M.id);if(null!==M&&void 0!==M&&M.id&&e)return{id:e,label:e};if(D){if(x.length>0){const e=null===x||void 0===x?void 0:x.find((e=>{if((null===e||void 0===e?void 0:e.value)===(null===H||void 0===H?void 0:H[0]))return e}));if(e)return{id:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.text}}}else if(Z){const e=null===ee||void 0===ee?void 0:ee.find((e=>{var l,i;return(null===e||void 0===e||null===(l=e.item)||void 0===l||null===(i=l.field)||void 0===i?void 0:i.value)===(null===H||void 0===H?void 0:H[0])}));var l,i,o,n;if(e)return{id:null===e||void 0===e||null===(l=e.item)||void 0===l||null===(i=l.field)||void 0===i?void 0:i.value,label:null===e||void 0===e||null===(o=e.item)||void 0===o||null===(n=o.field)||void 0===n?void 0:n.value};if(Array.isArray(H)&&(null===H||void 0===H?void 0:H.length)>0)return{id:null===H||void 0===H?void 0:H[0],label:null===H||void 0===H?void 0:H[0]}}else{const e=null===W||void 0===W?void 0:W.find((e=>(null===e||void 0===e?void 0:e.value)===(null===H||void 0===H?void 0:H[0])));if(e)return{id:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.text}}return null})();return null!==e&&void 0!==e&&null!==(C=e.field)&&void 0!==C&&C.model?(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(T.aX,{optional:!Y,className:(0,r.Z)("form-element drop-down",null===q||void 0===q?void 0:q.cssClass,xe),id:U,name:R,label:null===q||void 0===q?void 0:q.title,value:be,onFocus:()=>{O.onFocusField(z,H)},onBlur:()=>{O.onBlurField(z,H,K),(0,S.jN)("form_field_name",null===q||void 0===q?void 0:q.name),(0,S.PR)({event:"form_progress",form_field_name:null===q||void 0===q?void 0:q.name})},setValue:e=>{var l;let i=!0;const o=[];Y&&!e&&(i=!1,null===o||void 0===o||o.push("".concat(null===q||void 0===q?void 0:q.title," is required"))),J&&ce(null===M||void 0===M?void 0:M.id,[null===e||void 0===e?void 0:e.id]),G(R,null!==e&&void 0!==e&&e.id?[null===e||void 0===e?void 0:e.id]:[],i,o),Z||setTimeout((()=>{Fe(ye)})),null!==(l=q.cssClass)&&void 0!==l&&l.includes("product-dd")&&pe(null===e||void 0===e?void 0:e.id),oe(e)},labelClassname:"drop-down-label",withSearch:$,fieldKey:Q,disabled:Ce||re,getDropdownOptions:ue,datasource:null===q||void 0===q?void 0:q.datasource,withGQL:Z,loading:de,valid:!(!be&&he)&&0===(null===K||void 0===K?void 0:K.length),helperText:(null===K||void 0===K?void 0:K.length)>0||(null===H||void 0===H||!H.length)&&he?(null===K||void 0===K?void 0:K[0])||(null!==H&&void 0!==H&&H.length||!he?"":k("field_required")):X,setGQLItems:le,shrink:!0,minCharsToSearch:ge,isExternalApi:D,getDropdownOptionsFromApi:e=>se(e),externalApiQuery:ie,setFetchedData:F,children:D?null===x||void 0===x?void 0:x.map(((e,l)=>(0,m.jsx)(T.x_,{label:null===e||void 0===e?void 0:e.text,id:null===e||void 0===e?void 0:e.value},l))):Z?null===ee||void 0===ee?void 0:ee.map(((e,l)=>{var i,o,n,d;return(0,m.jsx)(T.x_,{label:null===e||void 0===e||null===(i=e.item)||void 0===i||null===(o=i.field)||void 0===o?void 0:o.value,id:null===e||void 0===e||null===(n=e.item)||void 0===n||null===(d=n.field)||void 0===d?void 0:d.value},l)})):null===W||void 0===W?void 0:W.map(((e,l)=>(0,m.jsx)(T.x_,{label:null===e||void 0===e?void 0:e.text,id:null===e||void 0===e?void 0:e.value},l)))})}):(0,m.jsx)(_,(0,o.Z)({},e))})),z=(0,a.Z)()((e=>{var l,i,d,t,a,u;const{tracker:s,field:c,errors:f,value:p,onChange:h,t:g}=e,{selectedIndex:C,setSelectedIndex:x,shouldShowFieldsError:F}=(0,n.useContext)(v),y=null===c||void 0===c||null===(l=c.valueField)||void 0===l?void 0:l.name,b=null===c||void 0===c||null===(i=c.valueField)||void 0===i?void 0:i.id,E=null===c||void 0===c?void 0:c.model,j=null===E||void 0===E?void 0:E.datasources,N=null===E||void 0===E?void 0:E.helpText,[A,k]=w(e),D=null!==(d=null===E||void 0===E?void 0:E.requiredFE)&&void 0!==d?d:null===E||void 0===E?void 0:E.required,B=!(null===F||void 0===F||!F.includes(null===E||void 0===E?void 0:E.itemId)||!D),I=(()=>{const e=null===j||void 0===j?void 0:j.find((e=>(null===e||void 0===e?void 0:e.value)===(null===p||void 0===p?void 0:p[0])));return e?{id:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.text}:null})(),Z=((e,l)=>{const i=null===j||void 0===j||null===(e=j[C])||void 0===e||null===(l=e.items)||void 0===l?void 0:l.find((e=>(null===e||void 0===e?void 0:e.value)===(null===p||void 0===p?void 0:p[1])));return i?{id:null===i||void 0===i?void 0:i.value,label:null===i||void 0===i?void 0:i.text}:null})();return null!==e&&void 0!==e&&null!==(t=e.field)&&void 0!==t&&t.model?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(T.aX,{optional:!(null!==E&&void 0!==E&&E.required),className:(0,r.Z)("form-element drop-down",null===E||void 0===E?void 0:E.
1cssClass,k),id:b,name:y,label:null===E||void 0===E?void 0:E.title,value:I,onFocus:()=>s.onFocusField(c,p),onBlur:()=>{s.onBlurField(c,p,f),(0,S.jN)("form_field_name",null===E||void 0===E?void 0:E.name),(0,S.PR)({event:"form_progress",form_field_name:null===E||void 0===E?void 0:E.name})},setValue:e=>{let l=!0;const i=[];null!==E&&void 0!==E&&E.required&&!e&&(l=!1,i.push("".concat(null===E||void 0===E?void 0:E.title," is required")));let o=-1;j.some(((l,i)=>{if((null===l||void 0===l?void 0:l.value)===(null===e||void 0===e?void 0:e.id))return o=i,!0})),x(o),h(y,null!==e&&void 0!==e&&e.id?[null===e||void 0===e?void 0:e.id]:[],l,i)},labelClassname:"drop-down-label",disabled:A,shrink:!0,valid:!(!I&&B)&&0===(null===f||void 0===f?void 0:f.length),helperText:null!==p&&void 0!==p&&p.length||!B?N:(null===f||void 0===f?void 0:f[0])||(null!==p&&void 0!==p&&p.length||!B?"":g("field_required")),children:null===j||void 0===j?void 0:j.map(((e,l)=>(0,m.jsx)(T.x_,{label:null===e||void 0===e?void 0:e.text,id:null===e||void 0===e?void 0:e.value},l)))}),-1!==C&&(0,m.jsx)(T.aX,{optional:!(null!==E&&void 0!==E&&E.required),className:(0,r.Z)("form-element drop-down",null===E||void 0===E?void 0:E.cssClass,k),label:null===E||void 0===E?void 0:E.label2,value:Z,setValue:e=>{let l=!0;const i=[];null!==E&&void 0!==E&&E.required&&!e&&(l=!1,i.push("".concat(null===E||void 0===E?void 0:E.label2," is required"))),h(y,null!==e&&void 0!==e&&e.id?[null===p||void 0===p?void 0:p[0],null===e||void 0===e?void 0:e.id]:[null===p||void 0===p?void 0:p[0]],l,i)},labelClassname:"drop-down-label",disabled:A,id:"cascading-dropdown-2",shrink:!0,valid:!(!I&&B)&&0===(null===f||void 0===f?void 0:f.length),helperText:!I&&B?g("field_required"):(null===f||void 0===f?void 0:f.length)>0?null===f||void 0===f?void 0:f[0]:N,children:null===j||void 0===j||null===(a=j[C])||void 0===a||null===(u=a.items)||void 0===u?void 0:u.map(((e,l)=>(0,m.jsx)(T.x_,{label:null===e||void 0===e?void 0:e.text,id:null===e||void 0===e?void 0:e.value},l)))})]}):(0,m.jsx)(_,(0,o.Z)({},e))}));var q=i(65430),M=i(92119),R=i(98097);const U=e=>{var l,i,o,d,t,a,u,s;const c=null===e||void 0===e||null===(l=e.field)||void 0===l?void 0:l.model,f=null===e||void 0===e||null===(i=e.field)||void 0===i?void 0:i.buttonField,p=null===e||void 0===e?void 0:e.onButtonClick,{touchPointIDMap:h,loading:g,setResetCountDown:C,setOTPValue:x,tokenLengths:F,setFormErrors:y,setValidationErrors:b,inputFilled:E,errorCode:S,setRemainingTimeInSeconds:j,startCountdown:N,secondsLeft:A,customDisabled:k,isSCAForm:D,isSubmitButtonDisabled:B,combinedSizeErrorMessage:I}=(0,n.useContext)(v),Z=null!==S&&void 0!==S&&S.includes("_")?null===S||void 0===S||null===(o=S.split("_"))||void 0===o?void 0:o[0]:"GenerateOTPExceededLimit"===S,T=null!==S&&void 0!==S&&S.includes("_")?null===S||void 0===S||null===(d=S.split("_"))||void 0===d?void 0:d[1]:0;(0,n.useEffect)((()=>{j(T)}),[]),(0,n.useEffect)((()=>{Z&&T>0&&N(T),Z&&0===T&&y([])}),[Z,T]);const _=(c.cssClass||"btn-primary").indexOf("default")>=0?"text":"contained",[L,P]=w(e),[V,O]=(0,n.useState)(!1);return c?((0,n.useEffect)((()=>{const e=B.some((e=>Object.values(e).some((e=>!0===e))));O(e)}),[B]),(0,m.jsxs)(m.Fragment,{children:[1===(null===c||void 0===c?void 0:c.navigationStep)&&1===(null===c||void 0===c||null===(t=c.cssClass)||void 0===t?void 0:t.includes("from-btn-submit"))&&(0,m.jsx)("span",{style:{display:"none"},"data-errorCode":S,"data-remainingTimeInSeconds":T,"data-seconds-left":A,"data-custom-disabled":k}),(0,m.jsx)(q.Z,{color:"primary",variant:_,arrow:"text"===_?"right":void 0,className:(0,r.Z)("form-element",P,null===c||void 0===c?void 0:c.cssClass),onClick:e=>{var l,i;if(null!==c&&void 0!==c&&null!==(l=c.cssClass)&&void 0!==l&&l.includes("btn-new-code")&&(b([]),x(new Array(F).fill("")),C((e=>!e))),null!==(i=window)&&void 0!==i&&i.dataLayer){var o,n,d;const e=M.Z.get("_utmz")||"na",l=h.get("IDIdentifier")||"na",i=h.get("WebsiteIdentifier")||"na";let t=e.substring(e.indexOf("utmcsr=")+7,e.indexOf("|")),a=e.substring(e.indexOf("utmcmd=")+7),u=null===e||void 0===e||null===(o=e.substring(e.indexOf("utmccn=")+7,e.lastIndexOf("|")))||void 0===o?void 0:o.split("-")[2];const s=h.get("ProductAcronym")||"na",r=h.get("LanguagePage")||"n
1a",v=h.get("FormID")||"na",c=M.Z.get("_ga")||"na",m=Math.round((new Date).getTime()/1e3),f="".concat(c,"_").concat(m),p="".concat(l,"-").concat(i,"-").concat(t,"-").concat(a,"-").concat(u,"-").concat(s,"-").concat(r,"-").concat(v,"-").concat(f);null===(n=window)||void 0===n||null===(d=n.dataLayer)||void 0===d||d.push({event:"form_success",TID:p})}p(null===f||void 0===f?void 0:f.name)},type:"submit",value:c.title,name:f.name,id:f.id,disabled:!((!D||!V||null!==c&&void 0!==c&&null!==(a=c.cssClass)&&void 0!==a&&a.includes("sca-form-id-step"))&&(!D||""===I||null!==c&&void 0!==c&&null!==(u=c.cssClass)&&void 0!==u&&u.includes("sca-form-id-step")))||(null!==c&&void 0!==c&&null!==(s=c.cssClass)&&void 0!==s&&s.includes("otpVerifyStep")?!E:L||g),children:g?(0,m.jsx)(R.Z,{style:{width:"20px",height:"20px"},className:"loading-progress",colorPrimary:"#fff"}):c.title})]})):(0,m.jsx)("div",{className:"form-element",children:e.children})},K=e=>{var l,i,d;const{field:t,fieldFactory:a}=e;(0,n.useEffect)((()=>{var e,l;null!==t&&void 0!==t&&null!==(e=t.model)&&void 0!==e&&e.restorable&&(null===t||void 0===t||null===(l=t.fields)||void 0===l||l.map((e=>{e.needToSave=!0})))}),[]);const[u,s,v]=w(e),c=document.querySelector(".adpay-phone-number");return null===c||void 0===c||null===(l=c.children[1])||void 0===l||l.children[0].setAttribute("lang","en"),(0,m.jsx)("fieldset",{className:(0,r.Z)(null===t||void 0===t||null===(i=t.model)||void 0===i?void 0:i.cssClass,"form-element-section",s),children:null===t||void 0===t||null===(d=t.fields)||void 0===d?void 0:d.map(((e,l)=>(0,o.Z)((0,o.Z)({},a((0,o.Z)((0,o.Z)({},e),{},{sectionFieldShow:s}))),{},{key:l})))})};var W=i(75404);const H=e=>{var l;const{field:i,value:o,onChange:d,tracker:t,errors:a}=e,u=i.valueField,s=i.model,c=null===i||void 0===i?void 0:i.needToSave,f=null===s||void 0===s||null===(l=s.conditionSettings)||void 0===l?void 0:l.fieldKey,{setValueKeyPair:p,getValueKeyPair:h}=(0,n.useContext)(v),[g,C,x,F]=w(e),[y,b]=(0,n.useState)(!1);(0,n.useEffect)((()=>{const e=h(null===u||void 0===u?void 0:u.id);null!==u&&void 0!==u&&u.id&&e&&function(e,l){return new Promise((i=>setTimeout(i,e,l)))}(100).then((()=>{d(u.name,e,!0,[]),b(!0),setTimeout((()=>{x(F)}),[50])}))}),[]);const E=0===(null===a||void 0===a?void 0:a.length);return(0,m.jsxs)("div",{className:(0,r.Z)("form-checkbox form-element",!E&&"form-check-error"),children:[(0,m.jsx)(D.Z,{id:u.id,name:u.name,label:s.title,checked:o,onChange:e=>{d(u.name,e,!0,[]),setTimeout((()=>{x(F)}),[50]),c&&p(null===u||void 0===u?void 0:u.id,e)},className:(0,r.Z)(C),onFocus:()=>t.onFocusField(i,o),onBlur:()=>{t.onBlurField(i,o,a),(0,S.jN)("form_field_name",null===s||void 0===s?void 0:s.name),(0,S.PR)({event:"form_progress",form_field_name:null===s||void 0===s?void 0:s.name})},valid:E,value:o,fieldKey:f,disabled:g||y,required:null===s||void 0===s?void 0:s.required}),!E&&(0,m.jsx)("div",{className:"check-error ctf-helper-text",children:(0,m.jsx)(W.H,{field:{value:(null===a||void 0===a?void 0:a[0])||null}})})]})},G=e=>{var l;const{field:i,value:o,onChange:n,errors:d,tracker:t}=e,a=i.model,u=a.items,s=i.valueField,v=null===a||void 0===a||null===(l=a.conditionSettings)||void 0===l?void 0:l.fieldKey,[c,f,p,h]=w(e),g=0===(null===d||void 0===d?void 0:d.length);return(0,m.jsxs)("div",{className:(0,r.Z)("form-element",f),children:[(0,m.jsx)("input",{type:"hidden",id:s.id,value:o,readOnly:!0}),a.title&&(0,m.jsx)("p",{className:(0,r.Z)("form-element-heading",!g&&"form-element-heading-error"),children:a.title}),null===u||void 0===u?void 0:u.map(((e,l)=>(0,m.jsx)(D.Z,{className:a.cssClass,id:s.id+l,name:s.name,label:e.text,value:e.value,checked:o.some((l=>l===e.value)),onChange:l=>((e,l)=>{let i=[...o];l?i.push(e.value):i=o.filter((l=>l!==e.value)),n(s.name,i,!0,[]),setTimeout((()=>{p(h)}),[50])})(e,l),onFocus:()=>t.onFocusField(i,o),valid:g,onBlur:()=>{t.onBlurField(i,o,d),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})},fieldKey:v,disabled:c},e.itemId))),!g&&(0,m.jsx)("div",{className:"radio-group-error ctf-helper-text",children:(0,m.jsx)("p",{children:(null===d||void 0===d?void 0:d[0])||null})})]})},$=e=>{const{field:l,value:i,onChange:o,tracker:n,errors:d}=e,t=l.valueField,a=l.model,u=null===a||void 0===a?void 0:a.items,s=null===a||void 0===a?void 0:a.multipleSelection,v=null===a||void 0===a?void 0:a.helpText,[c,f,p,h]=w(e),g=(()=>
1{if(s){const e=null===u||void 0===u?void 0:u.filter((e=>null===i||void 0===i?void 0:i.includes(null===e||void 0===e?void 0:e.value)));return null===e||void 0===e?void 0:e.map((e=>({id:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.text})))}{const e=null===u||void 0===u?void 0:u.find((e=>(null===e||void 0===e?void 0:e.value)===(null===i||void 0===i?void 0:i[0])));return e?{id:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.text}:null}})();return(0,m.jsx)(T.aX,{optional:!(null!==a&&void 0!==a&&a.required),className:(0,r.Z)("form-element",null===a||void 0===a?void 0:a.cssClass,f),id:null===t||void 0===t?void 0:t.id,name:null===t||void 0===t?void 0:t.name,label:null===a||void 0===a?void 0:a.title,multiple:!!s,radio:!s,value:g,onFocus:()=>n.onFocusField(l,i),onBlur:()=>{n.onBlurField(l,i,d),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})},setValue:e=>{const l=(e=>{let l=!0;const i=[],o=s?0===(null===e||void 0===e?void 0:e.length):!e;return null!==a&&void 0!==a&&a.required&&o&&(l=!1,i.push("".concat(null===a||void 0===a?void 0:a.title," is required"))),{valid:l,errors:i}})(e);if(s){const i=e.map((e=>e.id));p(h),o(null===t||void 0===t?void 0:t.name,i,null===l||void 0===l?void 0:l.valid,null===l||void 0===l?void 0:l.errors)}else p(h),o(null===t||void 0===t?void 0:t.name,null!==e&&void 0!==e&&e.id?[e.id]:[],null===l||void 0===l?void 0:l.valid,null===l||void 0===l?void 0:l.errors)},disabled:c,valid:0===(null===d||void 0===d?void 0:d.length),helperText:(null===d||void 0===d?void 0:d.length)>0?null===d||void 0===d?void 0:d[0]:v,shrink:!0,children:null===u||void 0===u?void 0:u.map(((e,l)=>(0,m.jsx)(T.x_,{label:null===e||void 0===e?void 0:e.text,id:null===e||void 0===e?void 0:e.value},l)))})};var J=i(73119),Q=i.n(J),X=i(11513);const Y=e=>{var l;let{children:i,value:o,setValue:d,disabled:t,valid:a}=e;const[u,s]=(0,n.useState)(o||null);(0,n.useEffect)((()=>{u!==o&&s(o)}),[o]);return null===(l=n.Children)||void 0===l?void 0:l.map(i,(e=>{if(n.isValidElement(e)){const{value:l,label:i,className:o,id:n,name:r,onFocus:v,onBlur:c}=null===e||void 0===e?void 0:e.props;return(0,m.jsx)(X.Z,{disabled:t,onClick:()=>{return e=l,void(d?d(e):s(e));var e},isSelected:u===l,value:l,label:i,className:o,id:n,name:r,onFocus:v,onBlur:c,valid:a})}}))},ee=()=>null;ee.propTypes={label:Q().string.isRequired,value:Q().string.isRequired,className:Q().string,id:Q().oneOfType([Q().string,Q().number]),name:Q().string,onFocus:Q().func,onBlur:Q().func};const le=e=>{const{field:l,value:i,onChange:o,tracker:n,errors:d}=e,t=null===l||void 0===l?void 0:l.valueField,a=null===l||void 0===l?void 0:l.model,u=null===a||void 0===a?void 0:a.items,[s,v,c,f]=w(e),p=0===(null===d||void 0===d?void 0:d.length);return(0,m.jsxs)("div",{className:(0,r.Z)("form-element",v),children:[(0,m.jsx)("h5",{className:(0,r.Z)("form-element-heading",!p&&"form-element-heading-error"),children:null===a||void 0===a?void 0:a.title}),(0,m.jsxs)("div",{className:"form-radio-group",children:[(0,m.jsx)(Y,{valid:p,disabled:s,value:null===i||void 0===i?void 0:i[0],setValue:e=>{o(null===t||void 0===t?void 0:t.name,[e],!0,[]),setTimeout((()=>{c(f)}),[50])},children:null===u||void 0===u?void 0:u.map(((e,o)=>(0,m.jsx)(ee,{label:e.text,value:e.value,className:null===a||void 0===a?void 0:a.cssClass,id:(null===t||void 0===t?void 0:t.id)+o,name:null===t||void 0===t?void 0:t.name,onFocus:()=>n.onFocusField(l,i),onBlur:()=>{n.onBlurField(l,i),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})}},o)))}),!p&&(0,m.jsx)("div",{className:"radio-group-error ctf-helper-text",children:(0,m.jsx)("p",{children:(null===d||void 0===d?void 0:d[0])||null})})]})]})};var ie=i(15588),oe=i(2587);const ne=e=>{let{color:l,className:i}=e;return(0,m.jsx)("svg",{width:"14",height:"8",viewBox:"0 0 14 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,children:(0,m.jsx)("path",{d:"M10.2 3H4.6C4.16 3 3.8 3.36 3.8 3.8V4.2C3.8 4.64 4.16 5 4.6 5H11C11.88 5 12.6 4.28 12.6 3.4V2.6C12.6 1.72 11.88 1 11 1H3.8C2.24 1 1 2.24 1 3.8V4.2C1 5.76 2.24 7 3.8 7H9.4",stroke:l,strokeWidth:"1.2",strokeMiterlimit:"10"})})},de=e=>{let{color:l="#2A5082",fileType:i=null}=e;return(0,m.jsxs)("div",{className:"file-type-icon-wrapper",children:[(0,m.jsx)("svg",{width:"14",height:"18",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.6 11V2.6C13.6 1.16407 12.4359 3.61123e-06 11 3.48886e-06L7.6 3.28063e-06L5.6 0H5.35501L5.18004 0.171473L0.180044 5.07147L4.0442e-07 5.24792L3.93396e-07 5.5L0 14.5C-6.2767e-08 15.9359 1.16406 17.1 2.6 17.1H4.99999L4.99999 15.9H2.6C1.8268 15.9 1.2 15.2732 1.2 14.5L1.2 6.6L5 6.6C5.88366 6.6 6.6 5.88366 6.6 5L6.6 1.2L7.6 1.2L11 1.2C11.7732 1.2 12.4 1.82681 12.4 2.6V11H13.6ZM5.4 1.63608L1.55927 5.4L5 5.4C5.22091 5.4 5.4 5.22092 5.4 5L5.4 1.63608Z",fill:l})}),i?(0,m.jsx)("div",{className:"file-type-icon-text",style:{color:l},children:i}
1):(0,m.jsx)(ne,{color:l,className:"file-type-icon-default"})]})};var te=i(51396),ae=i(66002);const ue=async e=>{try{const l={useWebWorker:!0,maxIteration:10,initialQuality:.7};if(!e)throw new Error("No file provided");const i=await(0,te.Z)(e,l);return new File([i],e.name,{type:i.type,lastModified:e.lastModified})}catch(l){return console.error("Image compression error:",l),e}},se=async function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{quality:o=.8,scale:n=1.5,autoDownload:d=!1}=l;let t;try{t=await(async e=>{const l=await fetch(e),i=await l.text(),o=new Blob([i],{type:"text/javascript"});return URL.createObjectURL(o)})("/dist/fab2/static/js/pdfworkermin.js")}catch(u){t="https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.mjs"}ae.Tu.workerSrc=t;const{PDFDocument:a}=await i.e(374).then(i.bind(i,11374));if(!a)return{success:!1,error:"PDF library not loaded."};try{const l=await e.arrayBuffer(),i=await ae.Me({data:l.slice(0)}).promise,d=await a.create(),t=async(e,l)=>{const i=document.createElement("canvas");i.width=Math.floor(l.width),i.height=Math.floor(l.height);const n=i.getContext("2d");return await e.render({canvasContext:n,viewport:l,intent:"print"}).promise,i.toDataURL("image/jpeg",o)};for(let e=0;e<i.numPages;e++){const l=await i.getPage(e+1),o=l.getViewport({scale:n}),a=await t(l,o),u=await d.embedJpg(a);d.addPage([o.width,o.height]).drawImage(u,{x:0,y:0,width:o.width,height:o.height})}const u=await d.save({useObjectStreams:!0,compress:!0});return{file:new File([u],e.name,{type:e.type,lastModified:Date.now()}),success:!0}}catch(u){return console.error("rasterizePDF ~ error:",u),{success:!1,error:u.message}}},re=async function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var n,d;const u=await async function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{autoDownload:o=!1}=l,{PDFDocument:n}=await i.e(374).then(i.bind(i,11374));if(!n)return{success:!1,error:"PDF library not loaded."};try{const l=await e.arrayBuffer(),i=await n.load(l),o=await n.create();for(let e=0;e<i.getPageCount();e++){const[l]=await o.copyPages(i,[e]);o.addPage(l)}const d=await o.save({useObjectStreams:!0,compress:!0});return{file:new File([d],e.name,{type:e.type,lastModified:Date.now()}),success:!0}}catch(d){return console.error("compressTextOnlyPDF ~ error:",d),{success:!1,error:d.message}}}(e,(0,o.Z)((0,o.Z)({},l),{},{autoDownload:!1})),s=await se(e,(0,o.Z)((0,o.Z)({},l),{},{autoDownload:!1}));let r=e,v=null===e||void 0===e?void 0:e.size;var t,a;if((null===u||void 0===u||null===(n=u.file)||void 0===n?void 0:n.size)<v)r=null===u||void 0===u?void 0:u.file,v=null===u||void 0===u||null===(t=u.file)||void 0===t?void 0:t.size;if((null===s||void 0===s||null===(d=s.file)||void 0===d?void 0:d.size)<v)r=null===s||void 0===s?void 0:s.file,v=null===s||void 0===s||null===(a=s.file)||void 0===a?void 0:a.size;return r}catch(u){return console.error("Compression error:",u),e}},ve={1:"Bytes",1024:"KB",1048576:"MB",1073741824:"GB"},ce=e=>{var l,i;return(null===e||void 0===e||null===(l=e.name)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i.pop())||""},me=e=>{let{file:l,valid:i}=e;return(0,m.jsx)(de,{fileType:l?ce(l):null,color:i?void 0:"#E1251B"})},fe=e=>{let{file:l,valid:i,model:o,sizeValidation:n=!1,maxFileSize:d,fileSizeUnit:t}=e;if(!n){if(!l)return null;const e=t||1048576;return(0,m.jsxs)("span",{children:[Number(l.size/e).toFixed(2),ve[e]]})}const a="Max. size ".concat(d).concat(ve[t]);if(!l)return(0,m.jsx)("span",{children:a});if(!i){if(l.size/t>d)return(0,m.jsx)("span",{className:"postfix-invalid",children:a})}return(0,m.jsxs)("span",{children:[Number(l.size/t).toFixed(2),ve[t]]})},pe=(0,a.Z)()((e=>{var l,i,d,t,a,u,s,c;const f=(0,y.z)(),p=null===f||void 0===f||null===(l=f.sitecoreContext)||void 0===l||null===(i=l.siteConfigurations)||void 0===i?void 0:i.cdnHost,h=(0,F.z)(p,"media/Project/FAB2/shared/images/icon_trash2-fill.svg"),{field:g,value:C,onChange:b,errors:E,tracker:j,t:N}=e,{sectionFieldShow:A}
1=g,k=g.model,{maxFileSize:D,fileSizeUnit:Z,maxFileSizeDecimal:T}=k,{setLoading:L,shouldAllowClearUploadField:P,setShouldAllowClearUploadField:V,setComputedFileSizes:O,allowedCombinedSize:z,setCombinedSizeErrorMessage:q,computedFileSizes:M,shouldShowFieldsError:U,setFieldValue:K,isSCAForm:W,isSubmitButtonDisabled:H,setIsSubmitButtonDisabled:G}=(0,n.useContext)(v),[$,J]=(0,n.useState)(!1),[Q,X]=(0,n.useState)(new Set),Y=T?+T:D,ee=0===Z?1048576:Z,le=g.valueField,ne=null===k||void 0===k?void 0:k.helpText,de=null===k||void 0===k?void 0:k.cssClass,te=null===k||void 0===k?void 0:k.labelCssClass,ae=null===k||void 0===k?void 0:k.enableCompression,se=e=>{var l;return null===k||void 0===k||null===(l=k.validationDataModels)||void 0===l?void 0:l.find((l=>(null===l||void 0===l?void 0:l.itemId)===e))},pe=null!==(d=null===k||void 0===k?void 0:k.requiredFE)&&void 0!==d?d:null===k||void 0===k?void 0:k.required,he=I(B("missingDocFields"),de),[ge,Ce]=(0,n.useState)(pe||W&&he),xe=!(null===U||void 0===U||!U.includes(null===k||void 0===k?void 0:k.itemId)||!pe),[Fe,ye,be,Ee]=w(e),we=se(ie.H.FileTypeValidator),Se=se(ie.H.FileSizeValidator),je=se(ie.H.FileCountValidator),Ne=(e=>{try{var l;return null===k||void 0===k||null===(l=k.validationDataModels)||void 0===l?void 0:l.find((l=>(null===l||void 0===l?void 0:l.modelType)===e))}catch(i){console.error("Error parsing fileNameValidator.parameters:",i)}})("Fab2.Feature.Forms.Validations.FileNameValidation,Fab2.Feature.Forms"),Ae=se("{6254315E-A662-4948-9685-1A68A5F8895D}"),ke=Se||Ae;let De=null;const Be=null===k||void 0===k||null===(t=k.name)||void 0===t?void 0:t.replaceAll("_","");if((0,n.useEffect)((()=>{var e,l;K(null===k||void 0===k?void 0:k.itemId);const i=P[null===k||void 0===k?void 0:k.itemId];!(null===k||void 0===k||null===(e=k.files)||void 0===e||!e.length)&&(null===k||void 0===k||null===(l=k.files)||void 0===l?void 0:l.some((e=>""===(null===e||void 0===e?void 0:e.inputStream))))&&null!==C&&void 0!==C&&C.length&&i&&(V((e=>(0,o.Z)((0,o.Z)({},e),{},{[null===k||void 0===k?void 0:k.itemId]:!1}))),Ge({stopPropagation:()=>{}}),b(null===le||void 0===le?void 0:le.name,"",!1,[]))}),[e]),Ne){const e=JSON.parse((null===Ne||void 0===Ne?void 0:Ne.parameters)||"{}"),l=null===e||void 0===e?void 0:e.regularExpression;if(l){var Ie,Ze;const e=null===l||void 0===l||null===(Ie=l.replace(/^@"/,""))||void 0===Ie||null===(Ze=Ie.replace(/"$/,""))||void 0===Ze?void 0:Ze.replace(/\\\\/g,"\\");De=new RegExp(e)}}const Te=(0,n.useRef)(null),_e=(0,n.useRef)(C),Le=(0,n.useRef)({}),Pe=(0,n.useRef)(ye),Ve=(0,n.useRef)(A),Oe=(0,n.useRef)(0);(0,n.useEffect)((()=>{_e.current&&!C&&null!==Te&&void 0!==Te&&Te.current&&(Te.current.value="")}
1),[C]),(0,n.useEffect)((()=>{if(("d-none"===Pe.current||"d-none"===Ve.current)&&("d-none"!==ye&&"d-none"!==A)&&(!C||0===C.length)){const e=document.querySelectorAll('input[type="file"][data-name="'.concat(Be,'"]')),l=Array.from(e).filter((e=>e.id!==(null===le||void 0===le?void 0:le.id)&&e!==Te.current));let i=null;for(let o of l)if(o.files&&o.files.length>0){i=o;break}if(i&&i.files.length>0){const e=Array.from(i.files),l={};e.forEach((e=>{if(null!==e&&void 0!==e&&e.name){if(i.dataset.originalFileSizes)try{const o=JSON.parse(i.dataset.originalFileSizes);if(void 0!==o[e.name])return void(l[e.name]=o[e.name])}catch(o){console.error("Error parsing originalFileSizes from source input:",o)}l[e.name]=e.size}})),Te.current&&(Te.current.dataset.skipCompression="true",Te.current.dataset.originalFileSizes=JSON.stringify(l)),b(null===le||void 0===le?void 0:le.name,[...e],!1,[])}}Pe.current=ye,Ve.current=A}),[ye,A,C,Be,null===le||void 0===le?void 0:le.id,b]);(0,n.useEffect)((()=>{try{const l=C||[],i=_e.current||[],o=!("d-none"===ye||"d-none"===A),n=(e=l)&&0!==e.length?e.reduce(((e,l)=>e+(Le.current[null===l||void 0===l?void 0:l.name]||(null===l||void 0===l?void 0:l.size)||0)),0)/1048576:0,d=o?n:0,t=d-Oe.current;if(Math.abs(t)>1e-4&&(O((e=>Math.max(0,(e||0)+t))),Oe.current=d),i.length>0){const e=new Set(l.map((e=>null===e||void 0===e?void 0:e.name)).filter(Boolean)),o=new Set(i.map((e=>null===e||void 0===e?void 0:e.name)).filter(Boolean)),n=Array.from(o).filter((l=>!e.has(l)));n.length>0&&n.forEach((e=>{delete Le.current[e]}))}_e.current=C,Pe.current=ye,Ve.current=A}catch(l){console.error("Error in file size calculation effect:",l)}var e}),[C,ye,A]),(0,n.useEffect)((()=>{if(W)try{if(void 0!==z&&null!==z){q((M||0)>z?N("allowedCombinedSize").replace("${0}",z):"")}}catch(e){console.error("Error updating combined size error message:",e)}}),[M,z]);const ze=["jpg","jpeg","png","webp","tiff","gif","bmp","svg","ico","heic","heif","avif"],qe=()=>Promise.resolve();async function Me(e,l,i){for(let o=0;o<e.length;o++)await i(e[o],o),(o+1)%l===0&&await qe()}const Re=e=>{X((l=>new Set(l).add(e)))},Ue=e=>{X((l=>{const i=new Set(l);return i.delete(e),i}))},Ke=(null===C||void 0===C?void 0:C.length)>0?null===C||void 0===C?void 0:C[0]:null,We=W&&he&&!!Ke&&0===(null===E||void 0===E?void 0:E.length)||!he&&0===(null===E||void 0===E?void 0:E.length),He=(null===C||void 0===C?void 0:C.length)>0,Ge=e=>{var l,i;null===e||void 0===e||null===(l=e.stopPropagation)||void 0===l||l.call(e),null===e||void 0===e||null===(i=e.preventDefault)||void 0===i||i.call(e);const o=C||[];if(o.length>0){o.map((e=>null===e||void 0===e?void 0:e.name)).filter(Boolean).forEach((e=>{delete Le.current[e]}))}Te.current&&(Te.current.dataset.isDeleteOperation="true",Te.current.value=null,delete Te.current.dataset.skipCompression),document.getElementById(null===le||void 0===le?void 0:le.id).value="",b(null===le||void 0===le?void 0:le.name,"",!1,[]),Be&&setTimeout((()=>{const e=document.querySelectorAll('input[type="file"][data-name="'.concat(Be,'"]'));Array.from(e).filter((e=>e.id!==(null===le||void 0===le?void 0:le.id)&&e!==Te.current)).forEach((e=>{if(e)try{e.dataset.isDeleteOperation="true",e.value="",delete e.dataset.skipCompression;const l=new DataTransfer;e.files=l.files;const i=new Event("change",{bubbles:!0,cancelable:!0});e.dispatchEvent(i)}catch(l){console.error("Error deleting file from other field:",l),e&&delete e.dataset.isDeleteOperation}}))}),50)};(0,n.useEffect)((()=>{0===Q.size?(J(!1),L(!1)):(J(!0),L(!0))}),[Q]);const $e=null===e||void 0===e||null===(a=e.field)||void 0===a||null===(u=a.model)||void 0===u?void 0:u.itemId,Je=W&&he||!(null===E||void 0===E||!E.length);return(0,n.useEffect)((()=>{const e=H.find((e=>void 0!==e[$e])),l=!!W&&((null===C||void 0===C||!C.length)&&Je);(null===e||void 0===e?void 0:e[$e])!==l&&G((e=>{const i=e.find((e=>void 0!==e[$e]));if((null===i||void 0===i?void 0:i[$e])===l)return e;return[...e.filter((e=>void 0===e[$e])),{[$e]:l}]}))}),[Je,C]),(0,n.useEffect)((()=>{Ce(pe||W&&he)}),[pe,he]),null!==e&&void 0!==e&&null!==(s=e.field)&&void 0!==s&&s.model?(0,m.jsxs)("div",{className:(0,r.Z)("form-element form-element-file-upload",ye,de),children:[(0,m.jsx)("input",{disabled:Fe,type:"file",multiple:null===k||void 0===k?void 0:k.isMultiple,ref:e=>Te.current=e,className:"form-element-fu-input",id:null===le||void 0===le?void 0:le.id,name:null===le||void 0===le?void 0:le.name,"data-name":Be,accept:we?null===k||void 0===k?void 0:k.allowedContentTypes:void 0,onChange:e=>(async e=>{var l,i,o,n;const d=[];let t=[...Array(null===e||void 0===e?void 0:e.length)].map(((l,i)=>null===e||void 0===e?void 0:e[i]))||[];t.forEach((e=>{null!==e&&void 0!==e&&e.name&&(Le.current[e.name]=e.size)}));const a="true"===(null===(l=Te.current)||void 0===l||null===(i=l.dataset)||void 0===i?void 0:i.isDeleteOperation);if(0===t.length&&(null===C||void 0===C?void 0:C.length)>0&&!a)return;a&&Te.current&&delete Te.current.dataset.isDeleteOperation,t.some((e=>{var l,i;const o=ce(e).toLowerCase();return!!ae&&(null===e||void 0===e?void 0:e.size)<=Y*ee&&(ze.includes(o)&&(null===k||void 0===k||null===(l=k.allowedContentTypes)||void 0===l?void 0:l.indexOf(o))>=0||"pdf"===o&&(null===k||void 0===k||null===(i=k.allowedContentTypes)||void 0===i?void 0:i.indexOf(o))>=0)}))&&(J(!0),L(!0),await qe());const u="true"===(null===(o=Te.current)||void 0===o||null===(n=o.dataset)||void 0===n?void 0:n.skipCompression),s=[];try{for(let e of t){var r,v,c;const l=ce(e).toLowerCase();if(ae&&!u&&(null===(r=e)||void 0===r?void 0:r.size)<=Y*ee&&(ze.includes(l)&&(null===k||void 0===k||null===(v=k.allowedContentTypes)||void 0===v?void 0:v.indexOf(l))>=0||"pdf"===l&&(null===k||void 0===k||null===(c=k.allowedContentTypes)||void 0===c?void 0:c.indexOf(l))>
1=0))try{if(Re(e.name),ze.includes(l))e=await ue(e);else if("pdf"===l){const l=await re(e);e=(null===l||void 0===l?void 0:l.file)||l}Ue(e.name)}catch(f){var m;Ue(e.name),console.error("Compression failed for file:",null===(m=e)||void 0===m?void 0:m.name,f)}s.push(e)}}finally{}if(u&&Te.current&&delete Te.current.dataset.skipCompression,b(null===le||void 0===le?void 0:le.name,[...s],(null===d||void 0===d?void 0:d.length)>0,d),await Me(s,10,(async e=>{var l,i;const o=(Le.current[null===e||void 0===e?void 0:e.name]||(null===e||void 0===e?void 0:e.size)||0)/ee,n=ce(e),t=null===e||void 0===e?void 0:e.name;ke&&o>Y&&d.push(ke.message.replace("{0}",Y.toString()).replace("{1}",ve[ee])),we&&(null===k||void 0===k||null===(l=k.allowedContentTypes)||void 0===l?void 0:l.indexOf(n))<0&&d.push(we.message.replace("{0}",null===k||void 0===k?void 0:k.allowedContentTypes.split(",").join(", "))),!Ne||!De||null!==(i=De)&&void 0!==i&&i.test(t)||d.push(Ne.message.replace("{0}",null===k||void 0===k?void 0:k.title))})),je&&(null===s||void 0===s?void 0:s.length)>(null===k||void 0===k?void 0:k.maxFileCount)&&d.push(je.message.replace("{0}",null===k||void 0===k?void 0:k.maxFileCount.toString()).replace("{1}",null===k||void 0===k?void 0:k.title)),(null===s||void 0===s?void 0:s.length)>0&&null!==le&&void 0!==le&&le.name&&!u){await qe();const e=document.querySelectorAll('input[type="file"][data-name="'.concat(Be,'"]')),l=Array.from(e).filter((e=>e.id!==(null===le||void 0===le?void 0:le.id)&&e!==Te.current));await Me(l,5,(async e=>{try{if(!e)return;const l=Array.from(e.files||[]);if(0===s.filter((e=>!l.some((l=>l.name===e.name&&l.size===e.size)))).length)return;e.dataset.skipCompression="true";const i={};s.forEach((e=>{const l=Le.current[e.name]||e.size;i[e.name]=l})),e.dataset.originalFileSizes=JSON.stringify(i);const o=new DataTransfer;s.forEach((e=>o.items.add(e))),e.files=o.files;const n=new Event("change",{bubbles:!0,cancelable:!0});e.dispatchEvent(n)}catch(f){console.error("Error copying file to other field:",f),e&&(delete e.dataset.skipCompression,delete e.dataset.originalFileSizes)}}))}await qe();try{be(Ee)}catch(f){console.error("handleChangeCB error:",f)}J(!1),await qe(),0===Q.size&&L(!1)})(e.target.files)}),(0,m.jsx)(oe.Z,{readOnly:!0,disabled:$||Fe,optional:!1,labelClassName:te,label:Ke?(null===k||void 0===k?void 0:k.title)+(ge?"*":""):"",prefix:(0,m.jsx)(me,{valid:!!$||!((null===C||void 0===C||!C.length)&&xe)&&We,file:Ke}),postfix:(0,m.jsx)(m.Fragment,{children:He?(0,m.jsxs)("div",{onClick:e=>Ge(e),role:"button",className:(0,r.Z)("delete-file",$?"disabled":""),children:[(0,m.jsx)("span",{children:null===e||void 0===e?void 0:e.t("Delete")}),(0,m.jsx)(x.Z,{src:h,alt:N("icon.trash2_fill.alt"),title:N("icon.trash2_fill.title")})]}):(0,m.jsx)(fe,{file:Ke,valid:!((null===C||void 0===C||!C.length)&&xe)&&We,model:k,sizeValidation:!!ke,maxFileSize:Y,fileSizeUnit:ee})}),onFocus:()=>j.onFocusField(g,C),onBlur:()=>{j.onBlurField(g,C,E),(0,S.jN)("form_field_name",Be)},error:!(null!==C&&void 0!==C&&C.length)&&xe,onClick:()=>{var e;return null===Te||void 0===Te||null===(e=Te.current)||void 0===e?void 0:e.click()},value:Ke?null===Ke||void 0===Ke?void 0:Ke.name:(null===k||void 0===k?void 0:k.title)+(ge?"*":""),fullWidth:!0,valid:!!$||!((null===C||void 0===C||!C.length)&&xe)&&We,helperText:$||We&&(null!==C&&void 0!==C&&C.length||!xe)?ne:W&&he?null===(c=N("field_uploader_required"))||void 0===c?void 0:c.replace("{0}",null===k||void 0===k?void 0:k.title):(null===E||void 0===E?void 0:E[0])||(null!==C&&void 0!==C&&C.length||!xe?"":N("field_required"))}),$&&(0,m.jsx)(R.Z,{style:{width:"45px",height:"45px",color:"#003da6"},className:"loading-progress"})]}):(0,m.jsx)(_,(0,o.Z)({},e))}));var he=i(86645),ge=i(82420),Ce=i(88764);const xe=(0,a.Z)()((e=>{let{value:l,setValue:i,label:d,helperText:t="",optional:a=!1,name:u,id:s=null,onFocus:v=()=>{},onBlur:c=()=>{},min:f=null,max:p=null,className:h="",disabled:g=!1,shrink:C,required:x=!1,valid:F=!0,t:y}=e;const[b,E]=(0,n.useState)(l||null);(0,n.useEffect)((()=>{E(l)}),[l]);return(0,m.jsx)(ge._,{dateAdapter:Ce.H,children:(0,m.jsx)(he.M,{className:(0,r.Z)(h),disabled:g,onChange:e=>{i?i(e):E(e)},value:b,inputFormat:"MM/dd/yyyy",minDate:f,maxDate:p,renderInput:e=>(0,m.jsx)(k.Z,(0,o.Z)((0,o.Z)({},e),{},{InputLabelProps:{shrink:C},label:(0,m.jsx)(N.Z,{text:d,optional:a}),inputProps:(0,o.Z)((0,o.Z)({},e.inputProps),{},{autoComplete:"off",placeholder:y("dateTimePlaceHolder")}),helperText:(0,m.jsx)(A.Z,{text:t}),name:u,id:s,onFocus:v,onBlur:c,required:x,error:!F})),showDaysOutsideCurrentMonth:!0,disableHighlightToday:!0})})})),Fe=(0,a.Z)()((e=>{var l,i;const{field:o,value:d,onChange:t,tracker:a,errors:u,t:s}=e,c=o.model,f=o.valueField,p=null===c||void 0===c||null===(l=c.conditionSettings)||void 0===l?void 0:l.fieldKey,h=null===c||void 0===c?void 0:c.helpText,{shouldShowFieldsError:g}=(0,n.useContext)(v),[C,x,F,y]=w(e),b=null!==(i=null===c||void 0===c?void 0:c.requiredFE)&&void 0!==i?i:null===c||void 0===c?void 0:c.required,E=!(null===g||void 0===g||!g.includes(null===c||void 0===c?void 0:c.itemId)||!b),j=e=>e?(null===e||void 0===e?void 0:e.length)>10?new Date(null===e||void 0===e?void 0:e.substring(0,10)):new Date(e):null,N=e=>e?"".concat(null===e||void 0===e?void 0:e.getFullYear(),"-").concat(A((null===e||void 0===e?void 0:e.getMonth())+1),"-").concat(A(null===e||void 0===e?void 0:e.getDate())):"",A=e=>e<10?"0".concat(e):"".concat(e),k=0===(null===u||void 0===u?void 0:u.length);return(0,m.jsx)("div",{className:(0,r.Z)("form-element date-picker-custom",x),children:(0,m.jsx)(xe,{optional:!b,id:null===f||void 0===f?void 0:f.id,name:null===f||void 0===f?void 0:f.name,value:j(d),setValue:e=>{const l=(e=>{if(b&&!e)return{valid:!1,message:"".concat(null===c||void 0===c?void 0:c.title," is required")};if(e){if(isNaN(e))return{valid:!1,message:"Invalid date format"};let l=!0;const i=j(N(e));if(null!==c&&void 0!==c&&c.min&&i<j(null===c||void 0===c?void 0:c.min)&&(l=!1),null!==c&&void 0!==c&&c.max&&i>j(null===c||void 0===c?void 0:c.max)&&(l=!1),!l)return{valid:!1,message:"".concat(null===c||void 0===c?void 0:c.title," is out of range")}}return{valid:!0,message:null}})(e);t(null===f||void 0===f?void 0:f.name,N(e),null===l||void 0===l?void 0:l.valid,null!==l&&void 0!==l&&l.valid?[]:[null===l||void 0===l?void 0:l.message]),setTimeout((()=>{F(y)}),[50])},onFocus:()=>a.onFocusField(o,d),onBlur:()=>{a.onBlurField(o,d,u),(0,S.jN)("form_field_name",null===c||void 0===c?void 0:c.name),(0,S.PR)({event:"form_progress",form_field_name:null===c||void 0===c?void 0:c.name})},label:(null===c||void 0===c?void 0:c.title)||"",min:j(null===c||void 0===c?void 0:c.min),max:j(null===c||void 0===c?void 0:c.max),helperText:k&&(null!==d&&void 0!==d&&d.length||!E)?h:(null===u||void 0===u?void 0:u[0])||(null!==d&&void 0!==d&&d.length||!E?"":s("field_required")),fieldKey:p,disabled:C,className:x,shrink:!0,required:b,valid:!(!d&&E)&&k})})}));var ye=i(66193);const be=e=>null!==e&&void 0!==e,Ee=e=>{const{value:l,defaultValue1:i,defaultValue2:o}=e;if(!(null===e||void 0===e||!e.multiRange)){let n=null===e||void 0===e?void 0:e.min,d=null===e||void 0===e?void 0:e.max;return be(i)&&(n=i),l&&be(null===l||void 0===l?void 0:l[0])&&(n=null===l||void 0===l?void 0:l[0]),be(o)&&(d=o),l&&be(null===l||void 0===l?void 0:l[1])&&(d=null===l||void 0===l?void 0:l[1]),[n,d]}var n;return be(l)?l:be(i)?i:null!==(n=null===e||void 0===e?void 0:e.min)&&void 0!==n?n:0},we=e=>{const{field:l,onChange:i,tracker:o,errors:d}=e,t=null===l||void 0===l?void 0:l.valueField,a=null===l||void 0===l?void 0:l.model,u=!(null===a||void 0===a||!a.multiRange),[s,v,c,f]=w(e),[p,h]=(0,n.use
1State)(Ee(a)),[g,C]=(0,n.useState)(!0),[x,F]=(0,n.useState)(!0);(0,n.useEffect)((()=>{const e=setTimeout((()=>{g&&x?i(null===t||void 0===t?void 0:t.name,p,!0,[]):i(null===t||void 0===t?void 0:t.name,p,!1,["".concat(null===a||void 0===a?void 0:a.title," value is out of range")]),setTimeout((()=>{c(f)}),[50])}),500);return()=>clearTimeout(e)}),[p,g,x]),(0,n.useEffect)((()=>{u?(C((null===p||void 0===p?void 0:p[0])>=(null===a||void 0===a?void 0:a.min)&&(null===p||void 0===p?void 0:p[0])<(null===p||void 0===p?void 0:p[1])&&(null===p||void 0===p?void 0:p[0])<(null===a||void 0===a?void 0:a.max)),F((null===p||void 0===p?void 0:p[1])<=(null===a||void 0===a?void 0:a.max)&&(null===p||void 0===p?void 0:p[1])>(null===p||void 0===p?void 0:p[0])&&(null===p||void 0===p?void 0:p[1])>(null===a||void 0===a?void 0:a.min))):C(p>=(null===a||void 0===a?void 0:a.min)&&p<=(null===a||void 0===a?void 0:a.max))}),[p]);const y=(e,l)=>{const i=+e;isNaN(i)||h(u?0===l?e=>[i,null===e||void 0===e?void 0:e[1]]:e=>[null===e||void 0===e?void 0:e[0],i]:i),setTimeout((()=>{c(f)}),[50])},b=(0,n.useMemo)((()=>{const{displayDivisions:e,divisions:l}=a;return e&&be(l)?Math.round(((null===a||void 0===a?void 0:a.max)-(null===a||void 0===a?void 0:a.min))/l):null}),[null===a||void 0===a?void 0:a.displayDivisions,null===a||void 0===a?void 0:a.divisions]);return(0,m.jsxs)("div",{className:(0,r.Z)("form-element form-slider",v),children:[(0,m.jsx)("h5",{className:"form-slider-title",children:null===a||void 0===a?void 0:a.title}),(0,m.jsx)(W.H,{field:{value:null===a||void 0===a?void 0:a.description},className:"global-rich-text form-slider-text"}),(0,m.jsx)(ye.Z,{disabled:s,value:p,setValue:h,minValue:null===a||void 0===a?void 0:a.min,maxValue:null===a||void 0===a?void 0:a.max,double:u,markPointsEvery:b,step:(null===a||void 0===a?void 0:a.step)||1,minDistance:1,className:"form-slider-slider",id:null===t||void 0===t?void 0:t.id,name:null===t||void 0===t?void 0:t.name}),(0,m.jsx)("div",{className:"form-slider-inputs",children:u?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(oe.Z,{disabled:s,value:null===p||void 0===p?void 0:p[0],setValue:e=>y(e,0),label:null===a||void 0===a?void 0:a.label1,placeholder:null===a||void 0===a?void 0:a.placeholder1,prefix:null===a||void 0===a?void 0:a.prefix1,valid:g,helperText:g?"":"Value is out of range",onFocus:()=>o.onFocusField(l,p),onBlur:()=>{o.onBlurField(l,p,d),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})}}),(0,m.jsx)(oe.Z,{disabled:s,value:null===p||void 0===p?void 0:p[1],setValue:e=>y(e,1),label:null===a||void 0===a?void 0:a.label2,placeholder:null===a||void 0===a?void 0:a.placeholder2,prefix:null===a||void 0===a?void 0:a.prefix2,valid:x,helperText:x?"":"Value is out of range",onFocus:()=>o.onFocusField(l,p),onBlur:()=>{o.onBlurField(l,p,d),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})}})]}):(0,m.jsx)(oe.Z,{disabled:s,value:p,setValue:e=>y(e,0),label:null===a||void 0===a?void 0:a.label1,placeholder:null===a||void 0===a?void 0:a.placeholder1,prefix:null===a||void 0===a?void 0:a.prefix1,valid:g,helperText:g?"":"Value is out of range",onFocus:()=>o.onFocusField(l,p),onBlur:()=>{o.onBlurField(l,p,d),(0,S.jN)("form_field_name",null===a||void 0===a?void 0:a.name),(0,S.PR)({event:"form_progress",form_field_name:null===a||void 0===a?void 0:a.name})}})})]})},Se=e=>(0,m.jsx)(m.Fragment,{}),je=e=>{var l,i;const{onChange:o,field:d}=e,{model:t,valueField:a}=d,{mappingField:u}=t,{hiddenFieldValue:s,hiddenFieldCB:r,stringOfMappingFields:c,formValues:f}=(0,n.useContext)(v),p=(null===s||void 0===s?void 0:s.length)&&(null===s||void 0===s?void 0:s.find((e=>{var l,i;return(null===(l=e.hiddenField)||void 0===l||null===(i=l.valueField)||void 0===i?void 0:i.name)===(null===a||void 0===a?void 0:a.name)}))),[h,g]=(0,n.useState)(null===p||void 0===p?void 0:p.value);return(0,n.useEffect)((()=>{var e;if(r.current=o,null!==c&&void 0!==c&&c.includes(null===u||void 0===u||null===(e=u.toLowerCase())||void 0===e?void 0:e.trim())){var l;const e=null===f||void 0===f||null===(l=f.value.find((e=>{var l,i,o,n,d,t,a,s,r;const v=null===u||void 0===u||null===(l=u.toLowerCase())||void 0===l?void 0:l.trim();return(null===e||void 0===e||null===(i=e.name)||void 0===i||null===(o=i.fields)||void 0===o||null===(n=o.Value)||void 0===n||null===(d=n.value)||void 0===d||null===(t=d.toLowerCase())||void 0===t?void 0:t.trim())===v||"{".concat(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(s=a.id)||void 0===s||null===(r=s.toLowerCase())||void 0===r?void 0:r.trim(),"}")===v})))||void 0===l?void 0:l.value;g(e),setTimeout((()=>{e&&o(null===a||void 0===a?void 0:a.name,e,!1,[])}),50)}}),[]),(0,m.jsx)("input",{name:null===a||void 0===a?void 0:a.name,type:"hidden",id:null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.valueField)||void 0===i?void 0:i.id,value:null!==h&&void 0!==h?h:"",readOnly:!0})};var Ne=i(62969);const Ae=e=>{var l,i,o,d;const[t,a,u]=w(e),s=document.querySelector(".appendAtEnd"),c=document.querySelector(".reloadPage"),{setFormErrors:f,setValidationErrors:p,combinedSizeErrorMessage:h,allowedCombinedSize:g,isSCAForm:C}=(0,n.useContext)(v),x=e=>{if("undefined"!==typeof window)if(null!==s){const e=s.getAttribute("href"),l=(0,Ne.l)(window.location.href),i=null===l||void 0===l?void 0:l.split("/");i[i.length-1]=e;const o=i.join("/");window.location.replace((0,Ne.l)(o))}else null!==c&&window.location.reload()},F=e=>{null!==c&&window.location.reload()};(0,n.useEffect)((()=>{f([]),p([])}),[]),(0,n.useEffect)((()=>{null!==s&&setTimeout((()=>{s.removeEventListener("click",x),s.addEventListener("click",x)}),500),null!==c&&setTimeout((()=>{c.removeEventListener("click",F),c.addEventListener("click",F)}),500)}),[s,c]);const y=null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.model)||void 0===i?void 0:i.html;return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(W.H,{className:(0,r.Z)("global-rich-text",null===e||void 0===e||null===(o=e.field)||void 0===o||null===(d=o.model)||void 0===d?void 0:d.cssClass,"form-element form-richtext form-status",a),field:{value:C&&h?y.replace("d-none","d-block").replace("{0}",g):y}})})},ke=e=>{var l,i,o,d,t;const{field:a,onChange:u,errors:s}=e,{formErrors:c,setInputFilled:f,OTPValue:p,setOTPValue:h,setTokenLengths:g,tokenLengths:C,disabled:x,isSendNewCodeButtonClicked:F,setFormErrors:y,setOtpModel:b,errorCode:E,setIsOtpRendered:w}=(0,n.useContext)(v);g((null===a||void 0===a||null===(l=a.model)||void 0===l?void 0:l.tokenLength)||6),(0,n.useEffect)((()=>(h(new Array(C).fill("")),b(null===a||void 0===a?void 0:a.model),w(!0),()=>{w(!1)})),[]);const j="OTPAttemptsFailed"===E,N=null!==E&&void 0!==E&&E.includes("_")?null===E||void 0===E||null===(i=E.split("_"))||void 0===i?void 0:i[0]:"GenerateOTPExceededLimit"===E,A=e=>{const l=e.key,i=e.keyCode||e.which,o=parseInt(e.target.getAttribute("dataorder"),10);if(8!==i||""!==e.target.value){if(!/^[0-9]$/.test(l)&&8!==i&&46!==i&&(i<35||i>40)&&9!==i)return e.preventDefault(),y([]),!1;if(/^[0-9]$/.test(l)){const e=document.querySelector('[dataorder="'.concat(o+1,'"]'));e&&setTimeout((()=>{e.focus(),y([])}),50)}}else{const e=document.querySelector('[dataorder="'.concat(o-1,'"]'));e&&setTimeout((()=>{e.focus(),y([])}),50)}};(0,n.useEffect)((()=>{const e=p.every((e=>""!==e));f(e)}),[p]);const k=e=>{e.target.select()};(0,n.useEffect)((()=>{F&&h((e=>{var l;let i=[...e];for(let o=0;o<=5;o++)i[o]="";return u(null===a||void 0===a||null===(l=a.valueField)||void 0===l?void 0:l.name,"",!0,[]),i}))}),[F]);const D=null===c||void 0===c?void 0:c.some((e=>""!==e)),B=(null===s||void 0===s?void 0:s.length)>0||D;return(0,m.jsxs)("div",{className:"form-otp-element",children:[(0,m.jsx)("div",{className:"otp-title",children:null===e||void 0===e||null===(o=e.field)||void 0===o||null===(d=o.model)||void 0===d?void 0:d.title}),(0,m.jsx)("div",{"data-errors":null===s||void 0===s?void 0:s.length,"data-formErrors":D,"data-formHasErrors":B,className:(0,r.Z)("otp-fields flex-it",B&&!j&&!N&&"otp-fields-error"),onBlur:()=>{var l,i;return(0,S.jN)("form_field_name",null===e||void 0===e||null===(l=e.field)||void 0===l||null===(i=l.model)||void 0===i?void 0:i.name)},children:null===(t=new Array(C).fill(!0))||void 0===t?void 0:t.map(((e,l)=>(0,m.jsx)("div",{className:"input-wrp",children:(0,m.jsx)("input",{onKeyDown:A,maxLength:1,onFocus:k,className:"otp-field",onChange:e=>(e=>{const l=e.target.value,i=e.target.getAttribute("dataorder");if(/^[0-9]?$/.test(l)&&(h((e=>{var o;let n=[...e];n[i]=l;let d=[...p];return d[i]=l,u(null===a||void 0===a||null===(o=a.valueField)||void 0===o?void 0:o.name,null===d||void 0===d?void 0:d.join(""),!0,[]),n})),""===l)){const e=document.querySelector('[dataorder="'.concat(+i-1,'"]'));e&&setTimeout((()=>{e.focus(),y([])}),50)}}
1)(e),type:"tel",dataorder:"".concat(l),value:p[l],disabled:x&&!j})},l)))}),!(null===s||void 0===s||!s[0])&&(0,m.jsx)("div",{className:"form-error",children:null===s||void 0===s?void 0:s[0]}),!!j&&!(null===c||void 0===c||!c[0])&&(0,m.jsx)("div",{className:(0,r.Z)("form-error"),children:null===c||void 0===c?void 0:c[0]})]})},De=e=>e.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),Be=e=>{var l,i,o,d;const t=null===e||void 0===e||null===(l=e.field)||void 0===l?void 0:l.model,a=null===e||void 0===e||null===(i=e.field)||void 0===i?void 0:i.buttonField,u=null===e||void 0===e?void 0:e.onButtonClick,{resetCountDown:s,setResetCountDown:c,setIsSendNewCodeButtonClicked:f,errorCode:p,setFormErrors:h,setRemainingTimeInSeconds:g,startCountdown:C,secondsLeft:x,customDisabled:F}=(0,n.useContext)(v),[y,b]=w(e),[E,S]=(0,n.useState)("00:00"),[j,N]=(0,n.useState)(!1),[A,k]=(0,n.useState)(!1),[D,B]=(0,n.useState)(!1),I=(0,n.useRef)(null);(0,n.useEffect)((()=>{null!==t&&void 0!==t&&t.timeout&&!j&&(Z(t.timeout),B(!0))}),[null===t||void 0===t?void 0:t.timeout]);const Z=e=>{I.current&&clearInterval(I.current),N(!0);let l=e;const i=Math.floor(l/60),o=l%60;S("".concat(De(i),":").concat(De(o))),I.current=setInterval((()=>{if(l--,l<0)return clearInterval(I.current),N(!1),B(!1),void S("00:00");const e=Math.floor(l/60),i=l%60;S("".concat(De(e),":").concat(De(i)))}),1e3)};(0,n.useEffect)((()=>{s&&null!==t&&void 0!==t&&t.timeout&&Z(t.timeout)}),[s,null===t||void 0===t?void 0:t.timeout]);const T=((null===t||void 0===t?void 0:t.cssClass)||"btn-primary").indexOf("default")>=0?"text":"contained",_=j&&"00:00"!==E,L=null!==p&&void 0!==p&&p.includes("_")?null===p||void 0===p||null===(o=p.split("_"))||void 0===o?void 0:o[0]:"GenerateOTPExceededLimit"===p,P=null!==p&&void 0!==p&&p.includes("_")?null===p||void 0===p||null===(d=p.split("_"))||void 0===d?void 0:d[1]:0;return(0,n.useEffect)((()=>{g(P)}),[P,g]),(0,n.useEffect)((()=>{L&&P>0&&C(P),L&&0===P&&h([])}),[L,P,C,h]),(0,n.useEffect)((()=>()=>{I.current&&clearInterval(I.current)}),[]),(0,m.jsxs)(m.Fragment,{children:[L&&F?(0,m.jsx)("div",{className:(0,r.Z)("form-countdown-timer",null===t||void 0===t?void 0:t.cssClass,b),children:"".concat(t.title," (00:00)")}):_||D?(0,m.jsx)("div",{className:(0,r.Z)("form-countdown-timer",null===t||void 0===t?void 0:t.cssClass,b),children:"".concat(t.title," (").concat(E,")")}):(0,m.jsx)(q.Z,{color:"secondary",variant:T,arrow:"text"===T?"right":void 0,className:(0,r.Z)("form-count-button",null===t||void 0===t?void 0:t.cssClass,b),onClick:e=>{B(!0),setTimeout((()=>{f(!0),u(null===a||void 0===a?void 0:a.name),null!==t&&void 0!==t&&t.timeout&&Z(t.timeout),c((e=>!e))}),0);const l=e.currentTarget.closest("form");if(l&&!A){e.preventDefault(),k(!0);const i=document.createElement("input");i.type="hidden",i.name=(null===a||void 0===a?void 0:a.name)||"",i.value=(null===t||void 0===t?void 0:t.title)||"",i.className="safari-button-data";const o=l.querySelector(".safari-button-data");o&&o.remove(),l.appendChild(i),setTimeout((()=>{l.requestSubmit?l.requestSubmit():l.submit(),setTimeout((()=>{k(!1),i.parentNode&&i.remove()}),100)}),50)}},type:"submit",value:null===t||void 0===t?void 0:t.title,name:null===a||void 0===a?void 0:a.name,id:null===a||void 0===a?void 0:a.id,disabled:y||D,children:t.title}),(0,m.jsx)("span",{style:{display:"none"},"data-errorCode":p,"data-remainingTimeInSeconds":P,"data-seconds-left":x,"data-custom-disabled":F})]})};var Ie=i(13761),Ze=i(83619);const Te=(0,a.Z)()((e=>{const{i18n:l,field:i}=e,o=null===i||void 0===i?void 0:i.model,n=null===o||void 0===o?void 0:o.cssClass,d=(null===o||void 0===o?void 0:o.steps)||[],t=(null===o||void 0===o?void 0:o.pageName)||"",a=function(e,l){return{id:e,name:l,titleTag:arguments.length>2&&void 0!==arguments[2]?arguments[2]:null}};let u=-1,s={};null===d||void 0===d||d.map(((e,l)=>{var i;Array.isArray(null===e||void 0===e?void 0:e.pageName)&&null!==e&&void 0!==e&&null!==(i=e.pageName)&&void 0!==i&&i.includes(t)&&(u=l,s=a(u,null===e||void 0===e?void 0:e.stepName))}));const v=null===d||void 0===d?void 0:d.map(((e,l)=>a(l,null===e||void 0===e?void 0:e.stepName)));return(0,m.jsx)("div",{className:(0,r.Z)("tabs-component form-stepper",n),children:(0,m.jsxs)("div",{className:"group-tabs group-tab-vertical",role:"tablist",children:[(0,m.jsx)(Ie.Z,{onTabClick:()=>{},initialTabName:s,tabNames:v,className:"search-categories tabs-component-pc",lang:null===l||void 0===l?void 0:l.language,disableClick:!0}),(0,m.jsx)(Ze.Z,{onTabClick:()=>{},activeTabName:s,tabNames:v,className:"tabs-component-mobile",disableClick:!0})]})})})),_e=e=>{const{value:l}=e,{errorCode:i,setErrorCode:o}=(0,n.useContext)(v);return(0,n.useEffect)((()=>{o(l)}),[]),(0,m.jsx)(m.Fragment,{})},Le=(0,o.Z)((0,o.Z)({}
1,u.U),{},{Slider:"{EE8388FF-4120-4822-8020-61212F5913DC}",customListWithCodes:"{E79C139D-CCD0-4C0A-9C5D-D2DD3221C204}",singleInputWithCodes:"{9AB7810D-1C6D-4184-9A02-80CC899469C9}",invisibleRecaptcha:"{AF2DA405-4C38-4273-8CA0-175AF351AE44}",hiddenField:"{DFE86276-1F00-481C-BAB2-5DC6100C7037}",singleLineText:"{0362EECC-0035-460E-85FA-C1B16CBD1349}",date:"{F8A9E0E7-6987-473D-98A8-64080FF49B27}",checkbox:"{3B797A07-B2DD-4E87-BD7B-B1C1C6AE8F34}",telephone:"{6635CD9F-9130-4743-AB47-FAEF16C9A668}",email:"{CEAFD857-EAC5-4C14-94BF-59DC28B8B53C}",number:"{078D76C1-22EA-41D3-A4E3-C8591612152F}",multiLineText:"{331032AC-23FD-44E0-9D98-4561B831E9A9}",radioButtonList:"{91FC0462-BCB0-4AF5-B9F6-1B03F826088B}",checkboxButtonList:"{68011906-BF21-4FB6-A597-F26494A92554}",listBox:"{367303AE-79C1-4834-A21D-F6A1D71860F4}",autoCompleteGQL:"{5B1EBA92-CD70-4883-BA53-62AAF38E8AEC}",cascadingDropdown:"{B9C89E0F-525F-4B6D-B77F-B552156E4336}",HTMLField:"{401E13DC-C2F5-4455-B7F1-2D69437DE04A}",otpField:"{B415E867-A278-4FE5-A6E2-5AF7F74DB841}",countdownButton:"{7B563F7F-199C-47CF-99D4-2467A4E44C0F}",stepper:"{FC183BFA-C445-479D-9E39-65A2E682F756}",formAdditionlData:"{4F39903B-496D-4097-9E8E-E919AABF0E04}",fabFileUpload:"{E88551D6-2B83-41D5-89AE-EC15A5AFDF04}",FormErrorCode:"{D7374846-47C4-492B-87B7-DB5E2C867861}",singleLineTextWithcheckboxApi:"{C3E1CF6C-A9F0-42EF-9CD1-75583C24CF00}"}),Pe=()=>{const e=(0,s.a)();return e.setComponent(Le.stepper,(e=>(0,m.jsx)(Te,(0,o.Z)({},e)))),e.setComponent(Le.Section,(e=>(0,m.jsx)(K,(0,o.Z)({},e)))),e.setComponent(Le.TextField,(e=>(0,m.jsx)(c,(0,o.Z)({},e)))),e.setComponent(Le.Checkbox,(e=>(0,m.jsx)(H,(0,o.Z)({},e)))),e.setComponent(Le.checkbox,(e=>(0,m.jsx)(H,(0,o.Z)({},e)))),e.setComponent(Le.CheckboxList,(e=>(0,m.jsx)(G,(0,o.Z)({},e)))),e.setComponent(Le.checkboxButtonList,(e=>(0,m.jsx)(G,(0,o.Z)({},e)))),e.setComponent(Le.singleLineTextWithcheckboxApi,(e=>(0,m.jsx)(Z,(0,o.Z)({},e)))),e.setComponent(Le.DateField,(e=>(0,m.jsx)(Fe,(0,o.Z)({},e)))),e.setComponent(Le.date,(e=>(0,m.jsx)(Fe,(0,o.Z)({},e)))),e.setComponent(Le.DropdownList,(e=>(0,m.jsx)(O,(0,o.Z)({},e)))),e.setComponent(Le.autoCompleteGQL,(e=>(0,m.jsx)(O,(0,o.Z)({withGQL:!0},e)))),e.setComponent(Le.cascadingDropdown,(e=>(0,m.jsx)(z,(0,o.Z)({},e)))),e.setComponent(Le.ListBox,(e=>(0,m.jsx)($,(0,o.Z)({},e)))),e.setComponent(Le.listBox,(e=>(0,m.jsx)($,(0,o.Z)({},e)))),e.setComponent(Le.FileUpload,(e=>(0,m.jsx)(pe,(0,o.Z)({},e)))),e.setComponent(Le.fabFileUpload,(e=>(0,m.jsx)(pe,(0,o.Z)({},e)))),e.setComponent(Le.RadioButtonList,(e=>(0,m.jsx)(le,(0,o.Z)({},e)))),e.setComponent(Le.radioButtonList,(e=>(0,m.jsx)(le,(0,o.Z)({},e)))),e.setComponent(Le.Button,(e=>(0,m.jsx)(U,(0,o.Z)({},e)))),e.setComponent(Le.Slider,(e=>(0,m.jsx)(we,(0,o.Z)({},e)))),e.setComponent(Le.SingleLineText,(e=>(0,m.jsx)(Z,(0,o.Z)({},e)))),e.setComponent(Le.singleLineText,(e=>(0,m.jsx)(Z,(0,o.Z)({},e)))),e.setComponent(Le.MultipleLineText,(e=>(0,m.jsx)(Z,(0,o.Z)({multi:!0},e)))),e.setComponent(Le.multiLineText,(e=>(0,m.jsx)(Z,(0,o.Z)({multi:!0},e)))),e.setComponent(Le.NumberField,(e=>(0,m.jsx)(Z,(0,o.Z)({number:!0},e)))),e.setComponent(Le.number,(e=>(0,m.jsx)(Z,(0,o.Z)({number:!0},e)))),e.setComponent(Le.Password,(e=>(0,m.jsx)(Z,(0,o.Z)({password:!0},e)))),e.setComponent(Le.Email,(e=>(0,m.jsx)(Z,(0,o.Z)({email:!0},e)))),e.setComponent(Le.email,(e=>(0,m.jsx)(Z,(0,o.Z)({email:!0},e)))),e.setComponent(Le.Telephone,(e=>(0,m.jsx)(Z,(0,o.Z)({},e)))),e.setComponent(Le.telephone,(e=>(0,m.jsx)(Z,(0,o.Z)({},e)))),e.setComponent(Le.customPhone,(e=>(0,m.jsx)(Z,(0,o.Z)({phone:!0},e)))),e.setComponent(Le.customListWithCodes,(e=>(0,m.jsx)(O,(0,o.Z)({withSearch:!0},e)))),e.setComponent(Le.singleInputWithCodes,(e=>(0,m.jsx)(Z,(0,o.Z)({phone:!0,singleInputWithCodes:!0},e)))),e.setComponent(Le.invisibleRecaptcha,(e=>(0,m.jsx)(Se,(0,o.Z)({},e)))),e.setComponent(Le.hiddenField,(e=>(0,m.jsx)(je,(0,o.Z)({},e)))),e.setComponent(Le.HTMLField,(e=>(0,m.jsx)(Ae,(0,o.Z)({},e)))),e.setComponent(Le.otpField,(e=>(0,m.jsx)(ke,(0,o.Z)({},e)))),e.setComponent(Le.countdownButton,(e=>(0,m.jsx)(Be,(0,o.Z)({},e)))),e.setComponent(Le.formAdditionlData,(e=>(0,m.jsx)(m.Fragment,{}
1))),e.setComponent(Le.FormErrorCode,(e=>(0,m.jsx)(_e,(0,o.Z)({},e)))),e},Ve=new Map;Ve.set("show","{AAE07A52-46A4-49EF-98B0-C2595BAC2382}"),Ve.set("hide","{7F58C8DD-D7C0-4FB7-BB44-8EC6B5E1C3D9}"),Ve.set("enable","{5744A87E-E32C-42CC-862F-96842A0202BB}"),Ve.set("disable","{C698C993-549E-486A-A09C-BB8D830DA958}"),Ve.set("goToPage","{4E448D57-BA06-42DC-9519-6BCD102CB332}");const Oe=new Map;Oe.set("any","{365C94DA-C1CD-4783-A91D-0D17A16C7117}"),Oe.set("all","{4E50C172-7EA6-4989-82C3-75F24F80EF72}");const ze=new Map;ze.set("isEqualTo","{1D38B217-A2EE-4E7B-B6ED-13E751462FEB}"),ze.set("isNotEqualTo","{49F47E77-E8C5-46F9-BF39-78D6B0D40B48}"),ze.set("contains","{BF8935A6-1976-43A0-ABA5-D0BC128A76EA}"),ze.set("doesntContains","{45AAB0FB-775B-40F5-B3B8-7CAE3ABBF643}"),ze.set("startsWith","{FD10F291-3C2E-4AE7-8A67-2F8271CB3DF2}"),ze.set("doesntStartsWith","{6B92597D-F2E0-47D3-A40D-59AFB37EEDE5}"),ze.set("endsWith","{D375ED5B-E156-4A2B-9F91-DFD5B03F0D78}"),ze.set("doesntEndsWith","{F3AC7A1A-3458-4385-BB65-860315313DB3}"),ze.set("greaterThan","{61FF63A0-375C-47BD-9986-1F81BD12BBBB}"),ze.set("greaterThanOrEqual","{062C6ED9-EA6E-4A88-AE54-C88E2147971D}"),ze.set("lessThan","{8FE41E53-AD87-4D24-B50F-EA0F6BDF739F}"),ze.set("lessThanOrEqual","{88AC1C6B-BAFE-40A7-BB75-E304C8EC29DD}");const qe=new Map;for(const[dl,tl]of Ve.entries())qe.set(tl,dl);const Me=qe,Re=new Map;for(const[dl,tl]of Oe.entries())Re.set(tl,dl);const Ue=Re,Ke=new Map;for(const[dl,tl]of ze.entries())Ke.set(tl,dl);const We=Ke,He=(e,l)=>{switch(e){case"any":return l.some((e=>e));case"all":return!(null===l||void 0===l||!l.length)&&l.every((e=>e));default:return null}},Ge=(e,l,i)=>{switch(e){case"isEqualTo":return l===i;case"isNotEqualTo":return l!==i;case"contains":return null===l||void 0===l?void 0:l.includes(i);case"doesntContains":return!(null!==l&&void 0!==l&&l.includes(i));case"startsWith":return null===l||void 0===l?void 0:l.startsWith(i);case"doesntStartsWith":return!(null!==l&&void 0!==l&&l.startsWith(i));case"endsWith":return null===l||void 0===l?void 0:l.endsWith(i);case"doesntEndsWith":return!(null!==l&&void 0!==l&&l.endsWith(i));case"greaterThan":return parseInt(l)>parseInt(i);case"greaterThanOrEqual":return parseInt(l)>=parseInt(i);case"lessThan":return parseInt(l)<parseInt(i);case"lessThanOrEqual":return parseInt(l)<=parseInt(i);default:return null}},$e=(e,l)=>{const i=new Map;return i.set("hide","show"),i.set("show","hide"),i.set("enable","disable"),i.set("disable","enable"),l?e:i.get(e)};var Je=i(81734),Qe=i(88045),Xe=i(88773),Ye=i(95299);const el=(0,a.Z)()((e=>{var l,i;const{t:o,setShowGenericErrorPopUp:d,showGenericErrorPopUp:t,handlePopUpClose:a}=e,u=(0,y.z)(),{popupId:s,setPopupId:v}=(0,Ye.b)(),c=(0,n.useRef)(null),f=null===u||void 0===u||null===(l=u.sitecoreContext)||void 0===l||null===(i=l.siteConfigurations)||void 0===i?void 0:i.cdnHost,p=()=>{d(!1),v(null)};return(0,n.useEffect)((()=>{c.current&&c.current.focus({preventScroll:!0})}),[t]),(0,m.jsx)(Qe.Z,{size:"lg","aria-labelledby":s,centered:!0,show:t,onHide:a,className:(0,r.Z)("modal--theme1","error-theme","hidden"),"aria-hidden":"true",tabIndex:-1,children:(0,m.jsxs)(Qe.Z.Body,{className:"modal--theme1",children:[(0,m.jsx)("div",{className:"motalTop flex-it flex-justify-end",children:(0,m.jsx)("div",{className:"modalClose",onClick:p,onKeyDown:e=>{"Enter"===e.key&&p()},tabIndex:"0",role:"button",children:(0,m.jsx)(x.Z,{lazy:!1,src:(0,F.z)(f,"jssmedia/Project/FAB2/shared/images/icon_close-blue.svg"),alt:o("txtCloseModalButton")})})}),(0,m.jsxs)("div",{className:"modalWrap flex-it ",children:[(0,m.jsx)("div",{className:"modalArrowRightUp flex-it flex-align-item-center",children:(0,m.jsx)(x.Z,{lazy:!1,src:(0,F.z)(f,"jssmedia/Project/FAB2/shared/images/popup-alert-icon.svg"),alt:!!o&&o("icon.popup-alert-icon.alt")})}),(0,m.jsxs)("div",{className:"text",children:[(0,m.jsx)("h4",{children:o("GenericErrorTitle")}),(0,m.jsx)("br",{}),(0,m.jsx)("div",{className:"global-rich-text sharing-description",children:o("GenericErrorDesc")}),(0,m.jsx)("br",{}),(0,m.jsx)("div",{className:"modalButtons flex-it flex-justify-end",children:(0,m.jsx)(q.Z,{link:{value:{text:o("GenericErrorClose")}},onClick:p,removeHref:!0,className:"button-outline-primary"})})]})]})]})})}));
1const ll=function(e){const[l,i]=(0,n.useState)(0),o=(0,n.useRef)(null);return(0,n.useEffect)((()=>(l>0&&(o.current=setTimeout((()=>{i((e=>e-1))}),1e3)),()=>clearTimeout(o.current))),[l]),{customDisabled:l>0,secondsLeft:l,startCountdown:function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;l>0&&i(l)}}},il=(e,l)=>{let i;for(const a of null!==e&&void 0!==e?e:[]){var o,n,d;if((null===a||void 0===a||null===(o=a.model)||void 0===o?void 0:o.name)===l){var t;const e=a.model.value;if(null!==e&&void 0!==e&&""!==e)return a;i=null!==(t=i)&&void 0!==t?t:a}const e=il(null===a||void 0===a?void 0:a.fields,l);if(null!==e&&void 0!==e&&null!==(n=e.model)&&void 0!==n&&n.value)return e;i=null!==(d=i)&&void 0!==d?d:e}return i},ol=(nl=(0,a.Z)()((e=>{var l,i,a,u,s,c,f,p,h,g,C,b,E,w,j,N,A,k,D,I,Z;const{t:T,sitecoreContext:_,fields:L}=e,{route:{fields:P}}=_,[V,O]=(0,n.useState)([]),[z,M]=(0,n.useState)(null),[R,U]=(0,n.useState)(""),{formValues:K}=P,W=(0,n.useMemo)(Pe,[]),{popupId:H,setPopupId:G}=(0,Ye.b)(),$=null===K||void 0===K||null===(l=K.value)||void 0===l?void 0:l.map((e=>{var l,i,o,n,d,t;return"".concat(null===(l=e.name)||void 0===l||null===(i=l.fields)||void 0===i||null===(o=i.Value)||void 0===o||null===(n=o.value)||void 0===n||null===(d=n.toLowerCase())||void 0===d?void 0:d.trim(),",{").concat(null===(t=e.name)||void 0===t?void 0:t.id,"}")})).join(","),J=(0,n.useRef)(),Q=(0,n.useRef)(),[X,Y]=(0,n.useState)({recaptcha:!1,hidden:!1,recaptchaName:"",hiddenName:[]}
1),[ee,le]=(0,n.useState)({}),[ie,oe]=(0,n.useState)(""),[ne,de]=(0,n.useState)(new Map),[te,ae]=(0,n.useState)(""),[ue,se]=(0,n.useState)(""),[re,ve]=(0,n.useState)(null),[ce,me]=(0,n.useState)(!1),[fe,pe]=(0,n.useState)(!1),[he,ge]=(0,n.useState)(!1),[Ce,xe]=(0,n.useState)([]),[Fe,ye]=(0,n.useState)([]),[be,Ee]=(0,n.useState)([]),[we,Se]=(0,n.useState)([]),[je,Ne]=(0,n.useState)(!0),[Ae,ke]=(0,n.useState)(!1),[De,Be]=(0,n.useState)({}),[Ie,Ze]=(0,n.useState)(6),[Te,_e]=(0,n.useState)(new Array(Ie).fill("")),[Ve,Oe]=(0,n.useState)(!1),[ze,qe]=(0,n.useState)(!1),Re=(0,n.useRef)(null),[Ke,Xe]=(0,n.useState)([]),[ol,nl]=(0,n.useState)([]),[dl,tl]=(0,n.useState)([]),[al,ul]=(0,n.useState)({}),[sl,rl]=(0,n.useState)(-1),[vl,cl]=(0,n.useState)(0),[ml,fl]=(0,n.useState)(0),[pl,hl]=(0,n.useState)(""),[gl,Cl]=(0,n.useState)([]),[xl,Fl]=(0,n.useState)(z?T("allowedCombinedSize").replace("${0}",z):""),[yl,bl]=(0,n.useState)(""),{customDisabled:El,secondsLeft:wl,startCountdown:Sl}=ll(vl),jl=e=>{const l=[];e.map((e=>{var i;const o=null===(i=Object.keys(e))||void 0===i?void 0:i[0],n=null===e||void 0===e?void 0:e[o];null===n||void 0===n||n.map((e=>{let i=[];const o=null===e||void 0===e?void 0:e.matchType,n=null===e||void 0===e?void 0:e.conditions,d=null===e||void 0===e?void 0:e.actions;null===n||void 0===n||n.map((e=>{var l,o,n,d;const t=null===Ke||void 0===Ke?void 0:Ke.find((l=>{var i;return(null===l||void 0===l||null===(i=l.valueField)||void 0===i?void 0:i.id)===(null===e||void 0===e?void 0:e.id)})),a=t&&(null===Re||void 0===Re||null===(l=Re.current)||void 0===l?void 0:l.getCurrentFieldState(t));let u=[];const s=(null===t||void 0===t||null===(o=t.model)||void 0===o?void 0:o.fieldTypeItemId)===Le.date,r="boolean"===typeof(null===a||void 0===a?void 0:a.value)||"number"===typeof(null===a||void 0===a?void 0:a.value)?null===a||void 0===a||null===(n=a.value)||void 0===n?void 0:n.toString():null===a||void 0===a?void 0:a.value,v=Array.isArray(r)?r:[r];null!==r&&void 0!==r&&r.length?u=v:null===i||void 0===i||i.push(!1),null===(d=u)||void 0===d||d.map((l=>{const o=null===e||void 0===e?void 0:e.operator,n=s?new Date(null===e||void 0===e?void 0:e.value).getTime():null===e||void 0===e?void 0:e.value,d=s?new Date(l).getTime():l;null===i||void 0===i||i.push(Ge(o,d,n))}))}));const t=[];null===d||void 0===d||d.map((e=>{null===t||void 0===t||t.push({fieldId:null===e||void 0===e?void 0:e.fieldId,operator:$e(null===e||void 0===e?void 0:e.operator,He(o,i))})})),(null===t||void 0===t?void 0:t.length)>0&&(null===l||void 0===l||l.push(...t))}))})),JSON.stringify(Fe)!==JSON.stringify(l)&&Fe.forEach(((e,i)=>{const o=l.find((l=>l.fieldId===e.fieldId));o&&o.operator!==e.operator&&al.filter((l=>{var i,o;let n;return n=(null===l||void 0===l||null===(i=l.model)||void 0===i||null===(o=i.conditionSettings)||void 0===o?void 0:o.fieldKey)===e.fieldId?l.children:l.children.find((l=>l.fieldKey===e.fieldId)),n})).forEach((e=>{e.children.forEach((e=>{null!==e&&void 0!==e&&e.required&&Cl((l=>[...l,e.itemId]))}))}))})),JSON.stringify(Fe)!==JSON.stringify(l)&&ye(l)};(0,n.useEffect)((()=>{let e=[],l=[];null===Fe||void 0===Fe||Fe.forEach(((i,o)=>{if("hide"===(null===i||void 0===i?void 0:i.operator)){var n;const o=null===Ke||void 0===Ke?void 0:Ke.find(((e,l)=>{var o,n;return(null===i||void 0===i?void 0:i.fieldId)===(null===e||void 0===e||null===(o=e.model)||void 0===o||null===(n=o.conditionSettings)||void 0===n?void 0:n.fieldKey)}));null===o||void 0===o||null===(n=o.children)||void 0===n||n.forEach(((i,o)=>{var n;null!==i&&void 0!==i&&i.valueField&&(null===i||void 0===i?void 0:i.fieldTypeItemId)!==Le.fabFileUpload&&(null===Re||void 0===Re||null===(n=Re.current)||void 0===n||n.onFieldChange(null===i||void 0===i?void 0:i.valueField,null===i||void 0===i?void 0:i.defaultValue,!0,[]),(null===i||void 0===i?void 0:i.fieldTypeItemId)===Le.fabFileUpload&&(document.getElementById(null===i||void 0===i?void 0:i.valueFieldID).value="")),null===l||void 0===l||l.push(i),null!==i&&void 0!==i&&i.required&&(null===e||void 0===e||e.push(i))}))}if("disable"===(null===i||void 0===i?void 0:i.operator)){var d,t,a,u;const o=null===Ke||void 0===Ke?void 0:Ke.find(((e,l)=>{var o,n;return(null===i||void 0===i?void 0:i.fieldId)===(null===e||void 0===e||null===(o=e.model)||void 0===o||null===(n=o.conditionSettings)||void 0===n?void 0:n.fieldKey)})),n=null===o||void 0===o||null===(d=o.valueField)||void 0===d?void 0:d.name,B=null!==(t=null===o||void 0===o||null===(a=o.model)||void 0===a?void 0:a.value)&&void 0!==t?t:void 0;var s;if(n&&(null===Re||void 0===Re||null===(s=Re.current)||void 0===s||s.onFieldChange(n,B,!0,[])),null!==o&&void 0!==o&&null!==(u=o.model)&&void 0!==u&&u.required){var r,v,c,m,f,p,h,g,C,x,F,y,b,E,w,S,j,N,A,k,D;const i=null===o||void 0===o||null===(r=o.model)||void 0===r||null===(v=r.validationDataModels)||void 0===v?void 0:v.find((e=>"{563540F2-C8A3-470C-B5B3-FE2945DB2FD3}"===(null===e||void 0===e?void 0:e.itemId)));null===e||void 0===e||e.push({itemId:null===o||void 0===o||null===(c=o.model)||void 0===c?void 0:c.itemId,fieldKey:null===o||void 0===o||null===(m=o.model)||void 0===m||null===(f=m.conditionSettings)||void 0===f?void 0:f.fieldKey,valueField:null===o||void 0===o||null===(p=o.valueField)||void 0===p?void 0:p.name,fieldTypeItemId:null===o||void 0===o||null===(h=o.model)||void 0===h?void 0:h.fieldTypeItemId,defaultValue:null!==(g=null===o||void 0===o||null===(C=o.model)||void 0===C?void 0:C.value)&&void 0!==g?g:void 0,required:!!i||(null!==(x=null===o||void 0===o||null===(F=o.model)||void 0===F?void 0:F.requiredFE)&&void 0!==x?x:null===o||void 0===o||null===(y=o.model)||void 0===y?void 0:y.required),valueFieldID:null===o||void 0===o||null===(b=o.valueField)||void 0===b?void 0:b.id}),null===l||void 0===l||l.push({itemId:null===o||void 0===o||null===(E=o.model)||void 0===E?void 0:E.itemId,fieldKey:null===o||void 0===o||null===(w=o.model)||void 0===w||null===(S=w.conditionSettings)||void 0===S?void 0:S.fieldKey,valueField:null===o||void 0===o||null===(j=o.valueField)||void 0===j?void 0:j.name,fieldTypeItemId:null===o||void 0===o||null===(N=o.model)||void 0===N?void 0:N.fieldTypeItemId,defaultValue:null!==(A=null===o||void 0===o||null===(k=o.model)||void 0===k?void 0:k.value)&&void 0!==A?A:void 0,valueFieldID:null===o||void 0===o||null===(D=o.valueField)||void 0===D?void 0:D.id})}}})),nl(e),tl(l),setTimeout((()=>{jl(Ce)}),[50])}),[Fe]);
1const[Nl,Al]=(0,n.useState)(""),[kl,Dl]=(0,n.useState)({}),Bl=(0,r.Z)(null===e||void 0===e||null===(i=e.params)||void 0===i?void 0:i.Styles,null===e||void 0===e||null===(a=e.rendering)||void 0===a||null===(u=a.params)||void 0===u?void 0:u.Styles,null===e||void 0===e||null===(s=e.form)||void 0===s||null===(c=s.metadata)||void 0===c||null===(f=c.cssClassSettings)||void 0===f?void 0:f.cssClass),Il=String(Bl).includes("allowConditionalMandatoryError"),Zl={formInfo:X,setFormInfo:Y,recaptchaRef:J,hiddenFieldValue:te,setHiddenFieldValue:ae,hiddenFieldCB:Q,conditionSettings:Ce,actions:Fe,setActions:ye,selectedIndex:sl,setSelectedIndex:rl,touchPointIDMap:ne,formErrors:be,setFormErrors:Ee,handleChangeCB:jl,loading:he,setLoading:ge,resetCountDown:je,setResetCountDown:Ne,inputFilled:Ae,setInputFilled:ke,OTPValue:Te,setOTPValue:_e,tokenLengths:Ie,setTokenLengths:Ze,disabled:ze,setDisabled:qe,validationErrors:we,setValidationErrors:Se,mobileField:Nl,setMobileField:Al,setValueKeyPair:(e,l)=>{Dl((i=>(0,o.Z)((0,o.Z)({},i),{},{[e]:l})))},getValueKeyPair:e=>kl[e],isSendNewCodeButtonClicked:Ve,setIsSendNewCodeButtonClicked:Oe,setOtpModel:Be,errorCode:ie,setErrorCode:oe,customDisabled:El,secondsLeft:wl,startCountdown:Sl,remainingTimeInSeconds:vl,setRemainingTimeInSeconds:cl,checkboxApiResult:pl,setCheckboxApiResult:hl,stringOfMappingFields:$,formValues:K,shouldAllowClearUploadField:ee,setShouldAllowClearUploadField:le,computedFileSizes:ml,setComputedFileSizes:fl,allowedCombinedSize:z,combinedSizeErrorMessage:xl,setCombinedSizeErrorMessage:Fl,conditionalFieldsByParent:al,shouldShowFieldsError:gl,setShouldShowFieldsError:Cl,readMisingFieldsFromCookie:R,fieldValue:yl,setFieldValue:bl,isSubmitButtonDisabled:V,setIsSubmitButtonDisabled:O,isSCAForm:ce,setIsSCAForm:me,isOtpRendered:fe,setIsOtpRendered:pe,dropdownProductValue:ue,setDropdownProductValue:se};(0,n.useEffect)((()=>{if(z)try{if((ml||0)>z){const e=T("allowedCombinedSize").replace("${0}",z);qe(!0),Fl(e)}else qe(!1),Fl("")}catch(e){console.error("Error checking combined file sizes:",e)}}),[ml,z]);const Tl=["IDIdentifier","WebsiteIdentifier","ProductAcronym","LanguagePage","FormID"],_l=e=>{let l=[];return null===e||void 0===e||e.map(((e,i)=>{const{model:n,fields:d}=e;if("FormAdditionalData"!==(null===n||void 0===n?void 0:n.name)&&"FormErrorCode"!==(null===n||void 0===n?void 0:n.name))if(null!==d&&void 0!==d&&d.length){let e=[];const i=_l(d).flat();i.forEach((l=>{var i,o,n,d,t,a,u,s,r,v,c,m,f;const p=null===l||void 0===l||null===(i=l.model)||void 0===i||null===(o=i.validationDataModels)||void 0===o?void 0:o.find((e=>"{563540F2-C8A3-470C-B5B3-FE2945DB2FD3}"===(null===e||void 0===e?void 0:e.itemId)));e.push({itemId:null===l||void 0===l||null===(n=l.model)||void 0===n?void 0:n.itemId,fieldKey:null===l||void 0===l||null===(d=l.model)||void 0===d||null===(t=d.conditionSettings)||void 0===t?void 0:t.fieldKey,valueField:null===l||void 0===l||null===(a=l.valueField)||void 0===a?void 0:a.name,fieldTypeItemId:null===l||void 0===l||null===(u=l.model)||void 0===u?void 0:u.fieldTypeItemId,defaultValue:null!==(s=null===l||void 0===l||null===(r=l.model)||void 0===r?void 0:r.value)&&void 0!==s?s:void 0,required:!!p||(null!==(v=null===l||void 0===l||null===(c=l.model)||void 0===c?void 0:c.requiredFE)&&void 0!==v?v:null===l||void 0===l||null===(m=l.model)||void 0===m?void 0:m.required),valueFieldID:null===l||void 0===l||null===(f=l.valueField)||void 0===f?void 0:f.id})})),l.push((0,o.Z)({model:n},(null===e||void 0===e?void 0:e.length)&&{children:e})),l.push(...i)}else n&&l.push(e)})),l.flat()};(0,n.useEffect)((()=>{Ll()}),[]);const Ll=l=>{var i;const n=l||(null===e||void 0===e||null===(i=e.fields)||void 0===i?void 0:i.fields),d=[],t=new Map,a=_l(n);Xe(a),null===a||void 0===a||a.map((e=>{var l,i,n,u,s,r,v,c,m,f,p,h,g,C;if(null!==Tl&&void 0!==Tl&&Tl.includes(null===e||void 0===e||null===(l=e.model)||void 0===l?void 0:l.mappingField)&&(null===t||void 0===t||t.set(null===e||void 0===e||null===(h=e.model)||void 0===h?void 0:h.mappingField,null===e||void 0===e||null===(g=e.model)||void 0===g?void 0:g.value)),"redirectUrl"===(null===e||void 0===e||null===(i=e.model)||void 0===i?void 0:i.name))try{var x,F,y,b,E,w;const l=null!==(x=null===e||void 0===e||null===(F=e.model)||void 0===F?void 0:F.value)&&void 0!==x?x:"",i=(null===(y=l.split("||"))||void 0===y||null===(b=y[0])||void 0===b?void 0:b.replace("redirectUrl:","").trim())||"",o=(null===(E=l.split("||"))||void 0===E||null===(w=E[1])||void 0===w?void 0:w.replace("cookieName:","").trim())||"",n=o?(e=>{if("undefined"===typeof document)return null;const l=document.cookie.split(";");for(let i=0;i<l.length;i++){const o=l[i].trim();if(o.startsWith("".concat(e,"=")))return o.substring(e.length+1)}return null})(o):null;if(i&&!n)return void window.location.replace(i);window.location.pathname.includes("apply-form")&&(C=o,"undefined"!==typeof document&&document.cookie.split(";").forEach((e=>{const l=e.trim();l.startsWith("".concat(C,"="))&&(document.cookie=l.replace(/=.*/,"=;expires=".concat((new Date).toUTCString(),";path=/")))})))}catch(T){console.error("Error redirectUrl from Sitecore field:",T)}if(null!==e&&void 0!==e&&null!==(n=e.model)&&void 0!==n&&null!==(u=n.name)&&void 0!==u&&null!==(s=u.toLowerCase())&&void 0!==s&&s.includes("allowedcombinedsize"))try{var S,j,N,A,k;const l=null!==(S=null===e||void 0===e||null===(j=e.model)||void 0===j||null===(N=j.value)||void 0===N||null===(A=N.split(":"))||void 0===A?void 0:A[1])&&void 0!==S?S:null===e||void 0===e||null===(k=e.model)||void 0===k?void 0:k.value;let i=null;if(void 0!==l&&null!==l){const e=String(l).match(/([0-9]+(?:\.[0-9]+)?)/);e&&(i=parseFloat(e[0]))}if(null===i||isNaN(i)){const e=Number(l);isNaN(e)||M(e)}else M(i)}catch(T){console.error("Error parsing allowed combined size from sitecore field:",T)}if("{AF2DA405-4C38-4273-8CA0-175AF351AE44}"===(null===e||void 0===e||null===(r=e.model)||void 0===r?void 0:r.fieldTypeItemId)&&Y((l=>{var i;return(0,o.Z)((0,o.Z)({},l),{},{recaptcha:!0,recaptchaName:null===e||void 0===e||null===(i=e.valueField)||void 0===i?void 0:i.name})})),((null===e||void 0===e||null===(v=e.model)||void 0===v?void 0:v.fieldTypeItemId)===Le.FileUpload||Le.fabFileUpload)&&le((l=>{var i;return(0,o.Z)((0,o.Z)({},l),{},{[null===e||void 0===e||null===(i=e.model)||void 0===i?void 0:i.itemId]:!1})})),"{DFE86276-1F00-481C-BAB2-5DC6100C7037}"===(null===e||void 0===e||null===(c=e.model)||void 0===c?void 0:c.fieldTypeItemId)){var D,B;ve(e);const l=!(null===e||void 0===e||null===(D=e.model)||void 0===D||null===(B=D.formula)||void 0===B||!B.includes("||"));ae((i=>{var o,n;return[...i,{hiddenField:e,value:l?null===e||void 0===e||null===(o=e.model)||void 0===o?void 0:o.formula:null===e||void 0===e||null===(n=e.model)||void 0===n?void 0:n.value}]})),Y((i=>
1{var n;return(0,o.Z)((0,o.Z)({},i),{},{hidden:!0,hiddenName:[...null===i||void 0===i?void 0:i.hiddenName,{name:null===e||void 0===e||null===(n=e.valueField)||void 0===n?void 0:n.name,field:e,isFormula:l}]})}))}const I=[];var Z;null===e||void 0===e||null===(m=e.model)||void 0===m||null===(f=m.conditionSettings)||void 0===f||null===(p=f.fieldConditions)||void 0===p||p.map((e=>{var l,i;const o=[],n=[];null===e||void 0===e||null===(l=e.conditions)||void 0===l||l.map((e=>{let l="";null===a||void 0===a||a.map((i=>{var o,n,d;(null===i||void 0===i||null===(o=i.model)||void 0===o||null===(n=o.conditionSettings)||void 0===n?void 0:n.fieldKey)===(null===e||void 0===e?void 0:e.fieldId)&&(l=null===i||void 0===i||null===(d=i.valueField)||void 0===d?void 0:d.id)})),null===n||void 0===n||n.push({value:null===e||void 0===e?void 0:e.value,fieldId:null===e||void 0===e?void 0:e.fieldId,operator:null===We||void 0===We?void 0:We.get(null===e||void 0===e?void 0:e.operatorId),id:l})})),null===e||void 0===e||null===(i=e.actions)||void 0===i||i.map((e=>{let l="";null===a||void 0===a||a.map((i=>{var o,n,d;(null===i||void 0===i||null===(o=i.model)||void 0===o||null===(n=o.conditionSettings)||void 0===n?void 0:n.fieldKey)===(null===e||void 0===e?void 0:e.fieldId)&&(l=null===i||void 0===i||null===(d=i.valueField)||void 0===d?void 0:d.id)})),null===o||void 0===o||o.push({value:null===e||void 0===e?void 0:e.value,fieldId:null===e||void 0===e?void 0:e.fieldId,operator:null===Me||void 0===Me?void 0:Me.get(null===e||void 0===e?void 0:e.actionTypeId),id:l})})),null===I||void 0===I||I.push({matchType:null===Ue||void 0===Ue?void 0:Ue.get(null===e||void 0===e?void 0:e.matchTypeId),conditions:n,actions:o})})),(null===I||void 0===I?void 0:I.length)>0&&(null===d||void 0===d||d.push({[null===e||void 0===e||null===(Z=e.valueField)||void 0===Z?void 0:Z.id]:I}))})),JSON.stringify(Ce)!==JSON.stringify(d)&&(jl(d),xe(d),de(t));const u=[];null===a||void 0===a||a.forEach((e=>{var l,i;null!==e&&void 0!==e&&null!==(l=e.model)&&void 0!==l&&null!==(i=l.cssClass)&&void 0!==i&&i.includes("conditional-hidden")&&u.push(e)})),JSON.stringify(Ce)!==JSON.stringify(d)&&ul(u)};function Pl(){var e=document.querySelector(".campaignName input");if(e){var l=l||{};l.Form={getCampaignName:function(l){var i="";if(l)i=l;else if(""!==e.value){var o,n=e.value;i=(null===n||void 0===n?void 0:n.indexOf("Name:"))>-1?null===n||void 0===n||null===(o=n.split(",")[0])||void 0===o?void 0:o.split(":")[1]:n}return i},getTrafficSource:function(){var e=this.getCookie("_ga"),l=[];try{var i,o,n,d,t,a,u=null===(i=window)||void 0===i||null===(o=i.trafficSrcCookie)||void 0===o?void 0:o.getCookie();l.push("Name:"+this.getCampaignName(u.ga_campaign)),l.push("Source:"+(null===u||void 0===u||null===(n=u.ga_source)||void 0===n?void 0:n.replace(/[^0-9a-zA-Z \.\-_+'|]/g,""))),l.push("Medium:"+(null===u||void 0===u||null===(d=u.ga_medium)||void 0===d?void 0:d.replace(/[^0-9a-zA-Z \.\-_+'|]/g,""))),l.push("Term:"+(null===u||void 0===u||null===(t=u.ga_keyword)||void 0===t?void 0:t.replace(/[^0-9a-zA-Z \.\-_+'|]/g,""))),l.push("Content:"+(null===u||void 0===u||null===(a=u.ga_content)||void 0===a?void 0:a.replace(/[^0-9a-zA-Z \.\-_+'|]/g,""))),l.push("taggingId: "+e)}catch(s){}return l.join(", ")},getCookie:function(e){var l=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return l?decodeURIComponent(l[1]):"undefined"},setNativeValue:function(e,l){let i=e.value;e.value=l;let o=new Event("input",{target:e,bubbles:!0});o.simulated=!0;let n=e._valueTracker;n&&n.setValue(i),e.dispatchEvent(o)}};var i=l.Form.getTrafficSource();"undefined"!==typeof i&&""!==i&&l.Form.setNativeValue(e,i)}}(0,n.useEffect)((()=>{}),[Fe,Il]),(0,n.useEffect)((()=>{if(Pl(),Pl(),"undefined"!==typeof document)for(var e=document.querySelectorAll("form")||[],l=0;l<(null===e||void 0===e?void 0:e.length);l++)null===e||void 0===e||e[l].setAttribute("novalidate",!0)}),[]);
1const[Vl,Ol]=(0,n.useState)(!1),[zl,ql]=(0,n.useState)(""),[Ml,Rl]=(0,n.useState)(!1),[Ul,Kl]=(0,n.useState)(!1),Wl=()=>{Ol(!1)},Hl=(0,y.z)(),Gl=null===Hl||void 0===Hl||null===(p=Hl.sitecoreContext)||void 0===p||null===(h=p.siteConfigurations)||void 0===h?void 0:h.cdnHost,$l=e=>{"Enter"===e.key&&Wl()},Jl=(0,n.useRef)(null);(0,n.useEffect)((()=>{const e=Jl.current;return e&&e.addEventListener("keydown",$l),()=>{e&&e.removeEventListener("keydown",$l)}}),[Vl]),(0,n.useEffect)((()=>{const e=Jl.current;e&&e.focus()}),[Vl]);let Ql=null!==ie&&void 0!==ie&&ie.includes("_")?null===ie||void 0===ie||null===(g=ie.split("_"))||void 0===g?void 0:g[0]:"GenerateOTPExceededLimit"===ie,Xl=null!==ie&&void 0!==ie&&ie.includes("_")?null===ie||void 0===ie||null===(C=ie.split("_"))||void 0===C?void 0:C[1]:0;return(0,n.useEffect)((()=>{0===wl&&Ee([])}),[wl,El]),(0,n.useEffect)((()=>{var e,l;Ql=null!==ie&&void 0!==ie&&ie.includes("_")?null===ie||void 0===ie||null===(e=ie.split("_"))||void 0===e?void 0:e[0]:"GenerateOTPExceededLimit"===ie,Xl=null!==ie&&void 0!==ie&&ie.includes("_")?null===ie||void 0===ie||null===(l=ie.split("_"))||void 0===l?void 0:l[1]:0,Ql&&cl(Xl)}),[ie,vl]),(0,n.useEffect)((()=>{var l,i,o,n;null!==e&&void 0!==e&&null!==(l=e.form)&&void 0!==l&&null!==(i=l.metadata)&&void 0!==i&&null!==(o=i.cssClassSettings)&&void 0!==o&&null!==(n=o.cssClass)&&void 0!==n&&n.includes("sca-form-id")&&me(!0)}),[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(v.Provider,{value:Zl,children:[(0,m.jsx)(d.l,(0,o.Z)({ref:Re,className:(0,r.Z)("content","sitecore-form-wrapper",null===e||void 0===e||null===(b=e.form)||void 0===b||null===(E=b.formItemId)||void 0===E?void 0:E.id,"add-margins",null===e||void 0===e||null===(w=e.params)||void 0===w?void 0:w.Styles,null===e||void 0===e||null===(j=e.rendering)||void 0===j||null===(N=j.params)||void 0===N?void 0:N.Styles,null===e||void 0===e||null===(A=e.form)||void 0===A||null===(k=A.metadata)||void 0===k||null===(D=k.cssClassSettings)||void 0===D?void 0:D.cssClass,fe&&"otp-form-rendered"),sitecoreApiHost:t.sitecoreApiHost,sitecoreApiKey:t.sitecoreApiKey,fieldFactory:W,formFetcher:async(l,i)=>{try{var n,d,t,a,u,s,r,v;if(ce&&z&&ml>z)return Fl(T("allowedCombinedSize").replace("${0}",z)),Ee([""]),{success:!1,blockedByCustomValidation:!0};ge(!0);let N=ol.map((e=>e.itemId)).join(", ");if(Ve&&(N=N?"".concat(N,",").concat(De.itemId):"".concat(De.itemId)),(null===dl||void 0===dl?void 0:dl.length)>0&&null!==l&&void 0!==l&&l.data&&dl.forEach((e=>{null!==e&&void 0!==e&&e.valueField&&l.data.forEach(((i,o)=>{i.key===e.valueField&&(l.data[o]={key:e.valueField,value:""})}))})),null===l||void 0===l||null===(n=l.data)||void 0===n||n.push({key:"hiddenRequiredFields",value:N}),null!==X&&void 0!==X&&X.recaptcha){var c,m;const e=await(null===J||void 0===J||null===(c=J.current)||void 0===c?void 0:c.executeAsync());null===l||void 0===l||null===(m=l.data)||void 0===m||m.find(((i,o)=>{if(i.key===(null===X||void 0===X?void 0:X.recaptchaName))return l.data[o]={key:null===X||void 0===X?void 0:X.recaptchaName,value:e},!0}))}var f;null!==X&&void 0!==X&&X.hidden&&(null===l||void 0===l||null===(f=l.data)||void 0===f||f.find(((e,i)=>{var o;const n=null===X||void 0===X||null===(o=X.hiddenName)||void 0===o?void 0:o.find((l=>(null===l||void 0===l?void 0:l.isFormula)&&(null===l||void 0===l?void 0:l.name)===(null===e||void 0===e?void 0:e.key)));if(n){const o=(e=>{var l,i,o,n,d,t,a,u;let s=null===e||void 0===e||null===(l=e.model)||void 0===l?void 0:l.formula;const r=null===e||void 0===e||null===(i=e.model)||void 0===i||null===(o=i.formula)||void 0===o||null===(n=o.split("||"))||void 0===n?void 0:n.pop(),v=null===r||void 0===r||null===(d=r.toLowerCase())||void 0===d?void 0:d.split(",");return null===Ke||void 0===Ke||Ke.map((e=>{var l,i,o;const n=null===v||void 0===v?void 0:v.indexOf(null===e||void 0===e||null===(l=e.model)||void 0===l||null===(i=l.name)||void 0===i?void 0:i.toLowerCase());let d;var t,a,u;if(null!==e&&void 0!==e&&null!==(o=e.model)&&void 0!==o&&o.fieldName2&&(d=null===v||void 0===v?void 0:v.indexOf(null===e||void 0===e||null===(t=e.model)||void 0===t||null===(a=t.fieldName2)||void 0===a?void 0:a.toLowerCase())),-1!==n)if("{EE8388FF-4120-4822-8020-61212F5913DC}"===(null===e||void 0===e||null===(u=e.model)||void 0===u?void 0:u.fieldTypeItemId)){var r,c;const l=document.querySelector("#".concat(null===e||void 0===e||null===(r=e.valueField)||void 0===r?void 0:r.id," input"));s=null===(c=s)||void 0===c?void 0:c.replace("{".concat(n,"}"),null===l||void 0===l?void 0:l.value)}else{var m,f;const l=document.getElementById(null===e||void 0===e||null===(m=e.valueField)||void 0===m?void 0:m.id);s=null===(f=s)||void 0===f?void 0:f.replace("{".concat(n,"}"),null===l||void 0===l?void 0:l.value)}if(d&&-1!==d){var p;const e=document.getElementById("cascading-dropdown-2");s=null===(p=s)||void 0===p?void 0:p.replace("{".concat(d,"}"),null===e||void 0===e?void 0:e.value)}})),s=null===(t=s)||void 0===t?void 0:t.substring(0,null===(a=s)||void 0===a?void 0:a.indexOf("||")),ae((l=>[...l,{hiddenField:e,value:s}])),null===Q||void 0===Q||Q.current(null===e||void 0===e||null===(u=e.valueField)||void 0===u?void 0:u.name,s,!0,[]),s})(null===n||void 0===n?void 0:n.field);l.data[i]={key:e.key,value:o}}}))),ge(!0);const A=await fetch(i,(0,o.Z)({body:l.toMultipartFormData(),method:"post",credentials:"include"},Yl)),k=await A.json(),D=(0,o.Z)({},k);if("REQUEST_THROTTLED"===(null===D||void 0===D?void 0:D.message))return ql(D.message),Ol(!0),D;ge(!1);const I=null===(d=il(null===D||void 0===D||null===(a=D.nextForm)||void 0===a?void 0:a.fields,"FormAdditionalData"))||void 0===d||null===(t=d.model)||void 0===t?void 0:t.value;let Z=null;var p,h;if(I)if(Z=JSON.parse(I),null!==(p=Z)&&void 0!==p&&p.IsSuccessfulResponse){var g,C,x,F,y,b,E;const e=null===_||void 0===_||null===(g=_.route)||void 0===g||null===(C=g.fields)||void 0===C||null===(x=C.formValues)||void 0===x||null===(F=x.value)||void 0===F||null===(y=F.find((e=>{var l;return"ReferencedByName"===(null===e||void 0===e||null===(l=e.name)||void 0===l?void 0:l.name)})))||void 0===y?void 0:y.value;(0,S.PR)((0,o.Z)((0,o.Z)({event:"form_status_message",form_submit_message:null===(b=Z)||void 0===b?void 0:b.MessageCode},!ue&&e?{referenced_by_name:e}:{}),ue&&null!==(E=Z)&&void 0!==E&&E.IsSuccessfulResponse?{product_name:ue}:(0,o.Z)({},e?{product_name:e}:{})))}else(0,S.PR)({event:"form_status_message",form_submit_message:e.t("SCR-LDCRT-EXCEPTION")});if(Ee(null===D||void 0===D?void 0:D.errors),Se(null===D||void 0===D?void 0:D.val
1idationErrors),(null===D||void 0===D||null===(u=D.errors)||void 0===u?void 0:u.find((e=>0===(null===e||void 0===e?void 0:e.indexOf("REDIRECT:")))))&&(A.errors=[]),null===D||void 0===D||null===(s=D.nextForm)||void 0===s||null===(r=s.fields)||void 0===r||r.forEach((e=>{var l;"{AF2DA405-4C38-4273-8CA0-175AF351AE44}"===(null===e||void 0===e||null===(l=e.model)||void 0===l?void 0:l.fieldTypeItemId)&&Y((l=>{var i;return(0,o.Z)((0,o.Z)({},l),{},{recaptcha:!0,recaptchaName:null===e||void 0===e||null===(i=e.valueField)||void 0===i?void 0:i.name})}))})),null===l||void 0===l||null===(v=l.data)||void 0===v||v.find((e=>{var l;return null===e||void 0===e||null===(l=e.key)||void 0===l?void 0:l.includes("NavigationButtons")})),null!==D&&void 0!==D&&D.success&&Ll(null===D||void 0===D||null===(h=D.nextForm)||void 0===h?void 0:h.fields),null===D||void 0===D||!D.success){var w;const e=null===(w=Object.entries(null===D||void 0===D?void 0:D.validationErrors))||void 0===w?void 0:w.map((e=>{let[l,i]=e;const o=l.indexOf("[")+1,n=l.indexOf("]");return l.substring(o,n)})),l=null===Ke||void 0===Ke?void 0:Ke.find((l=>e.some((e=>{var i;return(null===l||void 0===l||null===(i=l.model)||void 0===i?void 0:i.itemId)===e}))));if(l){var j;const e=document.getElementById(null===l||void 0===l||null===(j=l.valueField)||void 0===j?void 0:j.id);setTimeout((()=>{null===e||void 0===e||e.focus()}),400)}}if(Ve&&(Se([]),Oe(!1)),le((e=>Object.fromEntries(Object.keys(e).map((e=>[e,!0]))))),ce){let e=B("missingDocFields");U(e),(e=>{if(!(e instanceof Set)||0===e.size)return!1;for(let l of e)if(!l.endsWith("-true"))return!0;return!1})(e)&&Ee([""])}return D}catch(N){console.error("error",N),console.error(N.message),ql(N.message),Kl(!0)}finally{ge(!1)}},errorComponent:()=>(0,m.jsx)(m.Fragment,{})},e)),(0,m.jsx)("div",{className:"after-form-errors",children:(0,m.jsx)("div",{className:"content sitecore-form-wrapper",children:(0,m.jsx)("div",{className:(0,r.Z)("form-errors"),children:((l,i)=>{const o=Object.entries(we||{}),d=null===o||void 0===o?void 0:o.filter((e=>{let[l]=e;return l.toLowerCase().includes("fields")})),t=null===d||void 0===d?void 0:d.flatMap((e=>{let[l,i]=e;return i})),a="OTPAttemptsFailed"!==ie&&!(null===be||void 0===be||!be[0])&&!(null!==t&&void 0!==t&&t.includes(be[0]));return(0,m.jsxs)(m.Fragment,{children:[a&&(0,m.jsx)("p",{"data-errorCode":ie,"data-remainingTimeInSeconds":vl,"data-seconds-left":wl,"data-custom-disabled":El,className:(0,r.Z)("showGenericFormError invalid ".concat(ie)),children:be[0]}),!a&&!!we&&(null===e||void 0===e||null===(l=e.fields)||void 0===l||null===(i=l.fields)||void 0===i?void 0:i.map(((e,l)=>{var i,o,d;return(0,m.jsx)(n.Fragment,{children:"{AF2DA405-4C38-4273-8CA0-175AF351AE44}"===(null===e||void 0===e||null===(i=e.model)||void 0===i?void 0:i.fieldTypeItemId)&&null!==we&&void 0!==we&&we.hasOwnProperty(null===e||void 0===e||null===(o=e.valueField)||void 0===o?void 0:o.name)?(0,m.jsx)("p",{className:"invalid",children:we[null===e||void 0===e||null===(d=e.valueField)||void 0===d?void 0:d.name]}):null},l)})))]})})()})})})]}),null===e||void 0===e||null===(I=e.fields)||void 0===I||null===(Z=I.fields)||void 0===Z?void 0:Z.map(((e,l)=>{var i,o;if("{AF2DA405-4C38-4273-8CA0-175AF351AE44}"===(null===e||void 0===e||null===(i=e.model)||void 0===i?void 0:i.fieldTypeItemId))return(0,m.jsx)(n.Fragment,{children:(0,m.jsx)(Je.Z,{ref:J,size:"invisible",sitekey:(null===e||void 0===e||null===(o=e.model)||void 0===o?void 0:o.siteKey)||"",badge:"bottomright"})},l)})),(0,m.jsx)(el,{t:T,handlePopUpClose:()=>{Kl(!1),G(null)},setShowGenericErrorPopUp:Kl,showGenericErrorPopUp:Ul}),(0,m.jsx)(Qe.Z,{size:"lg","aria-labelledby":H,centered:!0,show:Vl,onHide:()=>{Rl(!1),G(null)},className:(0,r.Z)("modal--theme1","error-theme","hidden"),"aria-hidden":"true",tabIndex:-1,children:(0,m.jsxs)(Qe.Z.Body,{className:"modal--theme1",children:[(0,m.jsx)("div",{className:"motalTop flex-it flex-justify-end",children:(0,m.jsx)("div",{className:"modalClose",onClick:Wl,onKeyDown:e=>$l(e),tabIndex:"0",role:"button",ref:Jl,children:(0,m.jsx)(x.Z,{lazy:!1,src:(0,F.z)(Gl,"jssmedia/Project/FAB2/shared/images/icon_close-blue.svg"),alt:T("txtCloseModalButton")})})}),(0,m.jsxs)("div",{className:"modalWrap flex-it ",children:[(0,m.jsx)("div",{className:"modalArrowRightUp flex-it flex-align-item-center",children:(0,m.jsx)(x.Z,{lazy:!1,src:(0,F.z)(Gl,"jssmedia/Project/FAB2/shared/images/popup-alert-icon.svg"),alt:""})}),(0,m.jsxs)("div",{className:"text",children:[(0,m.jsx)("h4",{children:T("APIPopupTitle")}),(0,m.jsx)("br",{}),(0,m.jsx)("div",{className:"global-rich-text sharing-description",children:T("APIPopupDesc")}),(0,m.jsx)("br",{}),(0,m.jsx)("div",{className:"modalButtons flex-it flex-justify-end",children:(0,m.jsx)(q.Z,{link:{value:{text:T("APIPopupClose")}},onClick:Wl,removeHref:!0,className:"button-outline-primary"})})]})]})]})})]});var Yl})),function(e){let l=(0,Xe.TH)(),i=(0,Xe.s0)(),n=(0,Xe.UO)();return(0,m.jsx)(nl,(0,o.Z)((0,o.Z)({},e),{},{location:l,navigate:i,params:n}))});var nl}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.