1import{a as U,b as A,d as J}from"/build/_shared/chunk-ETWI2KFO.js";import{b as E}from"/build/_shared/chunk-2G3BUNAD.js";import{e as m}from"/build/_shared/chunk-MA6AGVSE.js";import"/build/_shared/chunk-S2I5YMHW.js";import"/build/_shared/chunk-Q6UE3OVN.js";import{a as w}from"/build/_shared/chunk-LXYKMAPX.js";import{a as z}from"/build/_shared/chunk-ELXM45ZL.js";import"/build/_shared/chunk-6XX3ATVP.js";import"/build/_shared/chunk-H5UJJ74Q.js";import{e as K,g as O}from"/build/_shared/chunk-J24524FQ.js";import{E as u,F as j,b as k,z as F}from"/build/_shared/chunk-TQS5E2SK.js";import{d as Q,e as _,v as M,w as R}from"/build/_shared/chunk-RBFCHJWR.js";import"/build/_shared/chunk-GZJBGZQO.js";import{a as Ce}from"/build/_shared/chunk-JUM7J4TY.js";import{a as H}from"/build/_shared/chunk-RW7BUM27.js";import{e as x}from"/build/_shared/chunk-ADMCF34Z.js";var l=x(Ce());var t=x(H());function Be({onCloseClick:V,isUpgrade:r}){let{theme:Pe,profile:N,siteConfig:a,isSignatureEligible:I}=M("root");(0,l.useEffect)(()=>{I||i(v.pathname)},[I]);let{signatureUpgradePageName:W,signatureUpgradeDescription:q,signatureInterestPageName:G,signatureInterestDescription:X,signatureInterestEmailText:Y,signatureInterestEmailPlaceholder:Z,signatureInterestEmailError:$,employmentStatusQuestionText:L,employmentStatusPlaceholder:ee,employmentStatusList:p,employmentStatusError:te,jobTitleQuestionText:ae,jobTitleQuestionPlaceholder:ne,jobTitleQuestionError:oe,fundGameplayQuestionText:se,fundGameplayQuestionPlaceholder:re,fundGameplayQuestionList:d,fundGameplayQuestionError:ue,netIncomeQuestionText:me,netIncomeQuestionPlaceholder:le,netIncomeQuestionList:b,netIncomeQuestionError:ce,disposableIncomeQuestionText:ie,disposableIncomeQuestionPlaceholder:pe,disposableIncomeQuestionList:y,disposableIncomeQuestionError:de,signatureUpgradeSubmitButtonText:be,signatureUpgradeSubmitButtonType:ye,signatureUpgradeSubmitButtonSize:Se,signatureInterestSubmitButtonText:ge,signatureInterestSubmitButtonType:fe,signatureInterestSubmitButtonSize:he,loginFormLoadingSVG:c,registerFieldSuccessIcon:S,registerFieldErrorIcon:g,registerFieldAlertIcon:f,registerFieldShow:h,registerFieldHide:T}=a,i=_(),v=Q(),s=R(),[D,C]=(0,l.useState)(),[B,P]=(0,l.useState)(!1),[Te,xe]=(0,l.useState)(!1),Ee=()=>"Error occurred while trying to submit data, please try again.";function Ne(e){if(e.error){C(Ee),P(!1);return}i(E.menu_signature_success,{replace:!0})}(0,l.useEffect)(()=>{if(s.state==="idle"&&(s==null?void 0:s.data)!==void 0){let e=JSON.parse(s.data);Ne(e)}},[s.state,s==null?void 0:s.data]);let Ie=O().shape({selectedEmail:r?K().optional():m($,"text"),selectedEmploymentStatus:m(te,"text"),selectedJobTitle:m(oe,"text"),selectedMainFunding:m(ue,"text"),selectedNetIncome:m(ce,"text"),selectedDisposableIncome:m(de,"text")}),ve=e=>{if(r)i(E.menu_signature_upload,{replace:!0,state:{caseComments:A(e)}});else{let n={uploadDoc:"false",uploadDocType:"HVC",emailAddress:null,caseData:{recordTypeId:a==null?void 0:a.signatureSalesforceCaseRecordType,origin:a==null?void 0:a.signatureSalesforceCaseOrigin,subject:a==null?void 0:a.signatureInterestSalesforceCaseSubject,description:a==null?void 0:a.signatureInterestSalesforceCaseDescription,comments:U(e)}},o=J(null,n);s.submit(o.formData,{action:"/actions/salesforce/submit",encType:"multipart/form-data",method:"post"})}},De=()=>r?ye:fe;return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsx)(F,{username:w(N),menuTitle:r?W:G,menuTitleClasses:"text-signatureMenuTitle",closeIconSrc:"/images/close-icon.svg",backIconSrc:"/images/back-icon.svg",onCloseIconClick:V,onBackIconClick:()=>{i(v.pathname)},accountIconSrc:"/images/account-icon.svg",menuUserClasses:"text-white"}),(0,t.jsxs)("div",{className:"px-4 py-8 flex flex-col gap-4",children:[(0,t.jsx)("article",{"safely-set-inner-html":z(r?q:X)}),(0,t.jsxs)(j,{schema:Ie,submitting:B,onSubmit:e=>{P(!0),C(null),ve(e)},submitButtonComponent:(0,t.jsx)(k,{className:"w-full",label:r?be:ge,size:r?Se:he,type:Te?De():"white",submittable:!0,svgSource:c==null?void 0:c.url,loading:B}),icons:{success:S==null?void 0:S.url,error:g==null?void 0:g.url,warning:f==null?void 0:f.url,spinner:c==null?void 0:c.url,show:h==null?void 0:h.url,hide:T==null?void 0:T.url},onFormStatusChange:e=>{xe(e)},children:[!r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h3",{className:"mt-1",children:Y}),(0,t.jsx)(u,{name:"selectedEmail",type:"text",placeholder:Z,defaultValue:N.Email,trimWhitespace:!0})]}),(0,t.jsx)("h3",{className:"mt-1",children:L}),(0,t.jsx)(u,{name:"selectedEmploymentStatus",type:"select",className:"mb-8",options:[{label:ee,value:"",disabled:!0},...p==null?void 0:p.map(e=>{var n,o;return{label:(n=e==null?void 0:e.content)==null?void 0:n.itemValue,value:(o=e==null?void 0:e.content)==null?void 0:o.itemKey}})]}),(0,t.jsx)("h3",{className:"mt-1",children:ae}),(0,t.jsx)(u,{name:"selectedJobTitle",type:"text",placeholder:ne}),(0,t.jsx)("h3",{className:"mt-1",children:se}),(0,t.jsx)(u,{name:"selectedMainFunding",type:"select",className:"mb-8",options:[{label:re,value:"",disabled:!0},...d==null?void 0:d.map(e=>{var n,o;return{label:(n=e==null?void 0:e.content)==null?void 0:n.itemValue,value:(o=e==null?void 0:e.content)==null?void 0:o.itemKey}})]}),(0,t.jsx)("h3",{className:"mt-1",children:me}),(0,t.jsx)(u,{name:"selectedNetIncome",type:"select",className:"mb-8",options:[{label:le,value:"",disabled:!0},...b==null?void 0:b.map(e=>{var n,o;return{label:(n=e==null?void 0:e.content)==null?void 0:n.itemValue,value:(o=e==null?void 0:e.content)==null?void 0:o.itemKey}})]}),(0,t.jsx)("h3",{className:"mt-1",children:ie}),(0,t.jsx)(u,{name:"selectedDisposableIncome",type:"select",className:"mb-8",options:[{label:pe,value:"",disabled:!0},...y==null?void 0:y.map(e=>{var n,o;return{label:(n=e==null?void 0:e.content)==null?void 0:n.itemValue,value:(o=e==null?void 0:e.content)==null?void 0:o.itemKey}})]})]}),D&&(0,t.jsx)("div",{className:"px-2 py-4",children:(0,t.jsx)("p",{className:"text-error font-bold",children:D})})]})]})}export{Be as default};
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.