PageSourceSearch

https://assets.uniacco.com/_next/static/chunks/23854.7a0d7b13c4b2d59a.js

js uniacco.com collected 2026-10-02 05:52:12 UTC 12,042 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23854],{23854:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var n=a(95155),l=a(12115),r=a(52596),i=a(62177),s=a(3951),d=a(53032),o=a(83025),m=a(55857),c=a(47298),u=a(19494),g=a(90834),y=a(34925),v=a(33704),x=a(76369),h=a(89720),_=a(43947),p=a(78258),j=a(76087),f=a(56493),A=a(94648),b=a(25500),C=a(32111),w=a.n(C);function N(e){var t,a;let{state:C,dispatch:N,handleBack:P,handleNext:I}=e,D=new f.A,T=(0,l.useMemo)(()=>(0,p.RE)(b.bf),[]),S=(0,l.useMemo)(()=>(0,p.j2)(b.Xr),[]),[q,k]=(0,l.useState)(!1),{handleSubmit:E,control:B,formState:{errors:L}}=(0,i.mN)({defaultValues:{lead_hash:C.lead_hash||"",emergency_salutation:(null==C?void 0:C.emergency_salutation)||"",emergency_contact_name:(null==C?void 0:C.emergency_contact_name)||"",emergency_dob:(null==C?void 0:C.emergency_dob)||null,emergency_relship:(null==C?void 0:C.emergency_relship)||"",emergency_email_addr:(null==C?void 0:C.emergency_email_addr)||"",emergency_cc:(null==C?void 0:C.emergency_cc)||"",emergency_contact_numb:(null==C?void 0:C.emergency_contact_numb)||"",emergency_nationality:(null==C?void 0:C.emergency_nationality)||"",emergency_addr_one:(null==C?void 0:C.emergency_addr_one)||"",emergency_addr_two:(null==C?void 0:C.emergency_addr_two)||"",emergency_home_city:(null==C?void 0:C.emergency_home_city)||"",emergency_home_state:(null==C?void 0:C.emergency_home_state)||"",emergency_home_zip:(null==C?void 0:C.emergency_home_zip)||""}}),[$,z]=(0,l.useState)({show:!1,message:""}),O=async e=>{k(!0),N({type:"form-data",payload:e});let t=await (0,_.Xl)(),a={...e,emergency_dob:(0,j.i$)({date:new Date(e.emergency_dob)}),steps:4,recaptchaToken:t};(null==e?void 0:e.dob)&&(a={...a,dob:(0,j.i$)({date:e.dob})}),(null==e?void 0:e.guarantor_dob)&&(a={...a,guarantor_dob:(0,j.i$)({date:e.guarantor_dob})}),(null==e?void 0:e.moveIndate)&&(a={...a,moveIndate:(0,j.i$)({date:e.moveIndate})});let n=new FormData;Object.entries(a).map(e=>{let[t,a]=e;n.append(t,a)}),D.updateBookingData(3,C.lead_hash,n).then(()=>{I(),(0,p.IK)(),(0,_.PH)()}).catch(e=>{var t;console.error("Error: ",e.message),k(!1);let a=null==e||null==(t=e.response)?void 0:t.data,n=((null==a?void 0:a.details)?a.details.replace(/^[^:]+:\s*/,""):null)||"Something went wrong, please try again.";n&&z({show:!0,message:n})})};return(0,n.jsxs)("form",{onSubmit:E(O),autoComplete:"off","data-cy":"emergency-contact-form",children:[(0,n.jsx)("h2",{children:"Emergency Contact"}),(0,n.jsx)(d.A,{sx:{mt:1.25,mb:3}}),(0,n.jsxs)(s.Ay,{container:!0,alignItems:"flex-start",justifyContent:"space-between",sx:{gap:{xs:2.5,md:4}},children:[(0,n.jsxs)(s.Ay,{item:!0,container:!0,alignItems:"flex-end",xs:12,md:5.6,children:[(0,n.jsx)(s.Ay,{item:!0,xs:12,sx:{display:"flex"},children:(0,n.jsx)(c.A,{className:w().formLabel,error:!!L.emergency_salutation||!!L.emergency_contact_name,children:"Full Name*"})}),(0,n.jsx)(s.Ay,{item:!0,xs:4,children:(0,n.jsx)(i.xI,{name:"emergency_salutation",control:B,rules:{required:{value:!0,message:"Please select the Salutation"}},render:e=>{let{field:{onChange:t,value:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(v.A,{...l,options:A.sV,selectedOption:(0,p.ZH)(a),placeholder:"Mr.",handleOptionSelect:e=>t(null==e?void 0:e.value),dataCy:"salutation-input-field"})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:8,children:(0,n.jsx)(i.xI,{name:"emergency_contact_name",control:B,rules:{required:{value:!0,message:"Please enter your Full Name"},pattern:{value:p.dl,message:"Please enter a valid name"}},render:e=>{let{field:{onChange:t,...a}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...a,onChange:e=>t((0,p.g7)(e.target.value)),variant:"outlined",placeholder:"John Smith",error:!!(null==L?void 0:L.emergency_contact_name),dataAttributes:{"input-data-cy":"name-input-field"},forPhone:!0})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,children:(L.emergency_salutation||L.emergency_contact_name)&&(0,n.jsx)(o.A,{variant:"outlined",className:w().formHelperText,error:!0,children:(null==L||null==(t=L.emergency_contact_name)?void 0:t.message)||(null==L||null==(a=L.emergency_salutation)?void 0:a.message)})})]}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:5.6,children:(0,n.jsx)(i.xI,{name:"emergency_dob",control:B,rules:{required:{value:!0,message:"Please select the date of birth"},validate:{valid:e=>
1new Date(e)instanceof Date&&!isNaN(new Date(e).valueOf())||"Please select a valid date",format:e=>new Date(e)instanceof Date&&!isNaN(new Date(e).valueOf())&&4===new Date(e).getFullYear().toString().length||"Please provide a valid date in mm/dd/yyyy format",maxDate:e=>!(new Date(e).getTime()>new Date().getTime())||"Please select a valid date"}},render:e=>{var t;let{field:{onChange:a,value:l,...r}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(x.A,{...r,variant:"outlined",label:"Date of birth*",value:l?(0,j.$T)({date:new Date(l)}):"",max:(0,j.$T)({date:new Date}),onChange:a,error:!!(null==L?void 0:L.emergency_dob),helperText:null==L||null==(t=L.emergency_dob)?void 0:t.message,dataAttributes:{"data-cy":"dob-date-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:5.6,children:(0,n.jsx)(i.xI,{name:"emergency_relship",control:B,rules:{required:{value:!0,message:"Please enter the Relationship"}},render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,onChange:e=>a((0,p.g7)(e.target.value)),variant:"outlined",label:"Relationship*",placeholder:"Sibling",error:!!(null==L?void 0:L.emergency_relship),helperText:null==L||null==(t=L.emergency_relship)?void 0:t.message,dataAttributes:{"input-data-cy":"relationship-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:5.6,children:(0,n.jsx)(i.xI,{name:"emergency_email_addr",control:B,rules:{required:{value:!0,message:"Please enter the email address"},pattern:{value:p.Uo,message:"Please provide a valid email address"}},render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value.toLowerCase())),label:"Email*",placeholder:"[email protected]",error:!!(null==L?void 0:L.emergency_email_addr),helperText:null==L||null==(t=L.emergency_email_addr)?void 0:t.message,dataAttributes:{"input-data-cy":"email-input-field"}})})}})}),(0,n.jsxs)(s.Ay,{item:!0,container:!0,alignItems:"flex-end",xs:12,md:5.6,children:[(0,n.jsx)(s.Ay,{item:!0,xs:12,sx:{display:"flex"},children:(0,n.jsx)(c.A,{className:w().formLabel,error:!!L.emergency_cc||!!L.emergency_contact_name,children:"Phone number*"})}),(0,n.jsx)(s.Ay,{item:!0,xs:6,children:(0,n.jsx)(i.xI,{name:"emergency_cc",control:B,rules:{required:!0},render:e=>{var t;let{field:{onChange:a,value:l,...r}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(h.A,{...r,variant:"outlined",options:S,placeholder:"UK +44",value:null!=(t=null==S?void 0:S.find(e=>(null==e?void 0:e.id)===l))?t:null,onChange:e=>a(null==e?void 0:e.id),showClearButton:!1,error:!!(null==L?void 0:L.emergency_cc),dataAttributes:{"input-data-cy":"country-code-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:6,children:(0,n.jsx)(i.xI,{name:"emergency_contact_numb",control:B,rules:{required:!0,minLength:6,maxLength:15,pattern:/^\d+$/i,validate:{valid:e=>"1234567890"!==e}},render:e=>{let{field:{onChange:t,...a}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...a,variant:"outlined",onChange:e=>t((0,p.g7)(e.target.value)),type:"tel",placeholder:"12345 67890",autoComplete:"new-password",error:!!(null==L?void 0:L.emergency_contact_numb),dataAttributes:{"input-data-cy":"phone-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,children:(L.emergency_cc||L.emergency_contact_numb)&&(0,n.jsx)(o.A,{variant:"outlined",className:w().formHelperText,error:!0,children:"Please provide a valid contact detail"})})]}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:5.6,children:(0,n.jsx)(i.xI,{name:"emergency_nationality",control:B,rules:{required:{value:!0,message:"Please select your nationality"}},render:e=>{var t,a;let{field:{value:l,onChange:r,...i}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(h.A,{...i,label:"Nationality*",placeholder:"Select",options:T,variant:"outlined",value:null!=(a=null==T?void 0:T.find(e=>(null==e?void 0:e.value)===l))?a:null,onChange:e=>r(null==e?void 0:e.value),showClearButton:!1,error:!!(null==L?void 0:L.emergency_nationality),helperText:null==L||null==(t=L.emergency_nationality)?void 0:t.message,dataAttributes:{"input-data-cy":"nationality-input-field"}})})}})}),(0,n.jsxs)(s.Ay,{item:!0,xs:12,mt:6,children:[(0,n.jsx)("h3",{children:"Emergency Contact's Address"}),(0,n.jsx)(d.A,{sx:{mt:1.25,mb:3}})]}),(0,n.jsx)(s.Ay,{item:!0,xs:12,children:(0,n.jsx)(i.xI,{name:"emergency_addr_one",control:B,rules:{required:{value:!0,message:"Please enter your Address"}},render:e=>{var t;
1let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value)),label:"Street Address Line 1*",error:!!(null==L?void 0:L.emergency_addr_one),helperText:null==L||null==(t=L.emergency_addr_one)?void 0:t.message,dataAttributes:{"input-data-cy":"address-one-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,children:(0,n.jsx)(i.xI,{name:"emergency_addr_two",control:B,render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value)),label:"Street Address Line 2",error:!!(null==L?void 0:L.emergency_addr_two),helperText:null==L||null==(t=L.emergency_addr_two)?void 0:t.message,dataAttributes:{"input-data-cy":"address-two-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:3.6,children:(0,n.jsx)(i.xI,{name:"emergency_home_city",control:B,rules:{required:{value:!0,message:"Please enter your City name"}},render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value)),label:"City*",error:!!(null==L?void 0:L.emergency_home_city),helperText:null==L||null==(t=L.emergency_home_city)?void 0:t.message,dataAttributes:{"input-data-cy":"city-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:3.6,children:(0,n.jsx)(i.xI,{name:"emergency_home_state",control:B,rules:{required:{value:!0,message:"Please enter your State/Province name"}},render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value)),label:"State/Province*",error:!!(null==L?void 0:L.emergency_home_state),helperText:null==L||null==(t=L.emergency_home_state)?void 0:t.message,dataAttributes:{"input-data-cy":"state-input-field"}})})}})}),(0,n.jsx)(s.Ay,{item:!0,xs:12,md:3.6,children:(0,n.jsx)(i.xI,{name:"emergency_home_zip",control:B,rules:{required:{value:!0,message:"Please enter your Postal/Zip code"}},render:e=>{var t;let{field:{onChange:a,...l}}=e;return(0,n.jsx)("div",{className:w().formAutoComplete,children:(0,n.jsx)(y.A,{...l,variant:"outlined",onChange:e=>a((0,p.g7)(e.target.value)),label:"Postal/Zip Code*",error:!!(null==L?void 0:L.emergency_home_zip),helperText:null==L||null==(t=L.emergency_home_zip)?void 0:t.message,dataAttributes:{"input-data-cy":"zip-input-field"}})})}})}),$.show&&(0,n.jsx)(s.Ay,{item:!0,xs:12,mt:3,children:(0,n.jsx)(u.A,{severity:"error",children:$.message})}),(0,n.jsxs)(s.Ay,{item:!0,container:!0,justifyContent:"space-between",alignItems:"center",xs:12,mt:9,children:[(0,n.jsx)(m.A,{type:"button",variant:"text",color:"inherit",disableElevation:!0,onClick:P,className:(0,r.A)(w().formBtn,w().formBtnBack),disabled:q,children:"← \xa0 Back"}),(0,n.jsx)("div",{}),(0,n.jsx)(g.default,{disableElevation:!0,className:w().formBtn,type:"submit",disabled:q,children:"Next \xa0 →"})]})]})]})}}}]);

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.