1import{j as e,r as h,o as we,az as Ue,$ as Y,bQ as Oe,y as ke,B as Be,d as U,E as Le,O as w,a0 as le,a1 as ce,f as c,Y as We,A as W,aM as tt,ay as at,p as $e,D as Te,el as it,w as nt,er as ot,es as st,et as rt,X as qe,cX as lt,a3 as je,z as ct,n as Ae,W as dt,ac as pt,aP as ut,a7 as Ne,aT as mt,aR as ht,aK as ft,b5 as ne,b6 as O,ar as St}from"./index-D9MYIGKW.js";import{O as gt}from"./OmjsLoading-WaklZ-Nt.js";import{b as Dt,d as re,s as J,D as xt,I as yt,u as bt,U as ge,O as Tt,c as jt,M as Ct,a as At}from"./useDocuments-C93tqbkz.js";import{l as vt,o as Je,n as Ye,p as Nt,d as Et,D as Ve,c as _t,h as S,i as P,u as Rt}from"./types-nUEUzytC.js";import{P as K}from"./PageTitle-BAelLhCh.js";import{u as Ge,s as oe,a as It}from"./MsrDocumentsPage.module-CxecwBFm.js";import{f as de,O as pe}from"./date-Bl_d-4qu.js";import{P as $}from"./enum.config-VH678rOH.js";import{v as ze}from"./validateIdNumberByForm-dhUtZAHd.js";import{O as Ft}from"./OmjsList-DNw_JI-9.js";import{U as Mt}from"./useUpdateMaritalStatusStep-BKLNpk-U.js";import{a as Pt}from"./formatDate-cHmzrRqQ.js";import{h as wt}from"./MuslimMppPage.config-DcO-sX_d.js";import{M as Ut,b as Ot,F as kt}from"./commonUploadFile-F7bCHxhB.js";import{s as k}from"./ApplicationFlowNavigator.module-Dvcs-KPh.js";import{S as p,a as g,g as Bt,M as ee}from"./ApplicationStatusSection-B0qVfHlA.js";import{B as He}from"./BreadcrumbsComponent-nnze9ftg.js";import{u as Lt}from"./useMyInfoForm-D6qMT8nB.js";import{S as Xe}from"./SectionCard-CoLueA2m.js";import{w as X}from"./wogaa-xETJ3pTr.js";import{c as Wt}from"./convertObjectToQueryString-BOknggjE.js";/* empty css */import"./MasterLayout-CuVEAvGS.js";import"./Layout.module-Dc8Sh_vh.js";import"./TitleBackButton-BfwHb1mZ.js";import"./download-BCx_vgGZ.js";import"./_baseIndexOf-Be9UPhX8.js";import"./_baseFindIndex-Cj99RmFE.js";import"./TableRow-CQR2BRoj.js";import"./useFilteredOptions-Ch6mRED_.js";import"./useMyInfo-B9OGy-Rx.js";const $t=Object.freeze({marriage:{certificateNumber:"",date:""},death:{certificateNumber:"",date:"",place:""}}),Ee=Object.freeze({fullName:"",dateOfBirth:"",idType:"",idNumber:"",nationality:"",gender:"",citizenship:"",mobileNumber:"",email:"",finNumber:""}),qt=Object.freeze({document1:void 0,document2:void 0,document3:void 0,document4:void 0,document5:void 0}),Jt=()=>{const[t,a]=h.useState($t),[i,o]=h.useState(Ee),[r,s]=h.useState(Ee),[u,n]=h.useState(qt),[d,m]=h.useState(vt),[T,b]=h.useState(),A={...t,applicant:i,joint:r,documents:u},{myInfo:D,formFieldStatus:N,myInfoForPrefill:E}=Dt();return h.useEffect(()=>{D&&o(M=>({...M,...we(E,"ethnic","nationality","maritalStatus")}))},[D,E]),{detailsOfMarriageAndDeath:t,setDetailsOfMarriageAndDeath:a,applicantProfile:i,setApplicantProfile:o,jointApplicantProfile:r,setJointApplicantProfile:s,declaration:d,setDeclaration:m,myInfo:D,myInfoFormFieldStatus:N,updateSpousalDeathApplicationFormData:A,documents:u,setDocuments:n,setSupportingDocument:b,supportingDocument:T}},Ke=h.createContext({}),Yt=t=>{const a=Jt();return e.jsx(Ke.Provider,{value:a,children:t.children})},q=()=>h.useContext(Ke),F=!0,Vt=[{type:"text",id:"certificateNumber",title:"Death certificate number",isRequired:F,rule:t=>Ue.SYSTEM_TEXT.test(t),maxLength:Je},{type:"date",id:"date",title:"Death date",maxDate:new Date(Date.now()-pe),minDate:new Date(de),isRequired:F},{type:"select",id:"place",title:"Place of death",isRequired:F,optionIdInReference:Y.COUNTRY}],Gt=[{type:"text",id:"certificateNumber",title:"Marriage certificate number",isRequired:F,rule:Ue.SYSTEM_TEXT,maxLength:Je},{type:"date",id:"date",title:"Marriage date",maxDate:new Date(Date.now()-pe),minDate:new Date(de),isRequired:F,rule:(t,a)=>{const i=new Date(t),o=new Date(a.death.date);return i>o?"Marriage date cannot be after the death date.":""}}],Qe=[{sectionId:"death",sectionTitle:"Late spouse death details",fields:Vt},{sectionId:"marriage",sectionTitle:"Related marriage details",fields:Gt}],zt=(t=!1)=>[{type:"select",id:"idType",title:"ID type",optionIdInReference:Y.ID_TYPE,isDisabled:t,isRequired:F},{type:"text",id:"idNumber",title:"ID number",allowedChars:"a-zA-Z0-9",rule:ze("idT
1ype"),uppercase:!0,isRequired:F}],Ht=(t=!1)=>[{type:"select",id:"idType",title:"ID type",optionIdInReference:Y.ID_TYPE,isDisabled:t,isRequired:F},{type:"text",id:"idNumber",title:"ID number",allowedChars:"a-zA-Z0-9",rule:ze("idType"),uppercase:!0,tooltip:"You may find the ID number in your late spouseâs death certificate or your marriage certificate. If it is not stated in either document, you may select ID type âForeign Travel Documentâ and enter âNILâ as the ID number to proceed with your application.",isRequired:F}],Xt=t=>[...Ye,zt(t===$.Applicant),{type:"select",id:"citizenship",title:"Citizenship",isRequired:F,optionIdInReference:Y.RESIDENTIAL_STATUS,hidden:t===$.Joint},{type:"text",id:"finNumber",title:"FIN",uppercase:!0,allowedChars:"a-zA-Z0-9",maxLength:ke.ID_NUMBER,hidden:t===$.Applicant,rule:Oe("idType")},{type:"select",id:"nationality",title:"Nationality",isRequired:F,optionIdInReference:Y.NATION},{type:"date",id:"dateOfBirth",title:"Date of birth",maxDate:new Date(Date.now()-pe),minDate:new Date(de),isRequired:F}],Kt=t=>[...Ye,Ht(t===$.Applicant),{type:"select",id:"citizenship",title:"Citizenship",isRequired:F,optionIdInReference:Y.RESIDENTIAL_STATUS,hidden:t===$.Joint},{type:"text",id:"finNumber",title:"FIN",uppercase:!0,allowedChars:"a-zA-Z0-9",maxLength:ke.ID_NUMBER,hidden:t===$.Applicant,rule:Oe("idType")},{type:"select",id:"nationality",title:"Nationality",isRequired:F,optionIdInReference:Y.NATION},{type:"date",id:"dateOfBirth",title:"Date of birth",maxDate:new Date(Date.now()-pe),minDate:new Date(de),isRequired:F}],Qt=[{sectionId:"applicantDetails",sectionTitle:"",fields:Xt($.Applicant)},{sectionId:"applicantContact",sectionTitle:"Contact details",fields:Nt}],Zt=[{sectionId:"jointApplicantDetails",sectionTitle:"",fields:Kt($.Joint)}],ea=t=>{const{applicantProfile:a,setApplicantProfile:i,myInfo:o,myInfoFormFieldStatus:r,detailsOfMarriageAndDeath:s}=q(),{formSections:u,handleFieldChange:n,errors:d,setErrors:m,validateAllFields:T,overrideFormFields:b,optionStore:A}=Ge(a,i,Qt,r);h.useEffect(()=>{re(m,s.marriage.date,a.dateOfBirth)},[a.dateOfBirth]);const D=()=>{const N=T(),E=re(m,s.marriage.date,a.dateOfBirth);Be(),!(!N||!E)&&t()};return h.useEffect(()=>{!a.nationality&&o?.nationality&&i(N=>({...N,nationality:o.nationality}))},[o]),h.useEffect(()=>{o&&b(we(r,"idType"))},[r]),{applicantFormSections:u,applicantForm:a,errors:d,setErrors:m,handleFieldChange:n,optionStore:A,handleContinue:D}},ta=({onContinue:t})=>{const{applicantForm:a,applicantFormSections:i,errors:o,setErrors:r,handleFieldChange:s,optionStore:u,handleContinue:n}=ea(t),d=U(),m=()=>{d(c.maritalStatusUpdateSpousalDeathRecordDetail)};return e.jsxs("div",{className:J.updateMaritalStatus,children:[e.jsx(K,{title:"Your details"}),e.jsx(Le,{sections:i,formData:a,errors:o,setErrors:r,onChange:s,optionStore:u}),e.jsxs("div",{className:J.buttonWrapper,children:[e.jsx(w,{onClick:n,children:le}),e.jsx(w,{onClick:m,className:J.marginLeft,theme:"secondary",children:ce})]})]})},Ce={declarationPreviewTitle:"Application summary",declarations:[{text:"I have read, understood and agree to be bound by the following terms and conditions:",list:["MSF provides a one-stop service for individuals to update their marital status records in a database, which may be used by individuals to transact with Government Agencies and Statutory Boards or access Government e-Services via MyInfo portal, and by Government Agencies and Statutory Boards to administer schemes.","It is my personal responsibility to ensure that all information provided in this form are true and accurate. My update is purely administrative in nature and not a statutory requirement. My update does not affect the validity or otherwise of a marriage.","While every care is taken by MSF in updating the database, MSF does not make any warranty or representation that the marital status is free from error. MSF shall not be liable for any losses, damages, costs and expenses caused as a result of or occasioned by (whether directly or indirectly) the use of the database.","The database is not open to search and inspection by the public. MSF reserves all rights to reject any application to access or update marital status records at any time without ascribing any reasons.","To safeguard records, all electronic storage and transmission of marital status records are secured with appropriate security technologies. Whilst making every attempt to secure the marital status records, MSF is not liable for the security, authenticity, integrity or confidentiality of any transmission of records to MyInfo portal, or other Government Agencies or Statutory Boards.","MSF reserves the right to introduce new or revised fees for the updating of marital status records from time to time.","These Terms and Conditions shall be governed and construed in accordance with laws of the Republic of Singapore.","MSF reserves the right to update or revise these Terms and Conditions at any time."]},{text:"I consent and agree that MSF may collect, share and use my personal data for the following purposes:",list:["To determine if I and/or my family qualify for government schemes including: (i) healthcare, aged care, childcare, education, employment, housing, social assistance and counselling services and schemes; and (ii) any form of financial assistance such as subsidies, grants, tax reliefs, vouchers or bursaries.","To provide me and/or my family with the relevant government schemes.","Data analysis, evaluation and policy-making by Government Agencies and Statutory Boards."]}],acknowledged:"I have read, understood and agree to be bound by all the terms and conditions set out herein."},aa=t=>{const{declaration:a,setDeclaration:i}=q(),[o,r]=h.useState(!1),{openSnackbar:s}=We(),[u,n]=h.useState("1");return{formData:a,handleSubmit:async()=>{r(!0);try{const{data:b}=await W.draftMsr.submitSpousalMSRDraft({headers:{[tt]:!0}});t(b.eventId,Mt.Death)}catch{s({severity:"error",body:at(),autoHideDuration:6e4})}finally{r(!1)}},loading:o,setFormData:i,step:u,handleNextStep:()=>{n("2")},handlePreviousStep:()=>{n("1")}}},ia=({sections:t})=>e.jsx("div",{children:t.map((a,i)=>a.type==="document"?e.jsx(xt,{title:a.title,onEdit:a.onEdit,fields:a.fields},i):e.jsx(yt,{title:a.title,onEdit:a.onEdit,fields:a.fields},i))}),na="_title_1t2a5_34",oa="_marginLeft_1t2a5_57",_e={title:na,marginLeft:oa},sa=({onSubmit:t})=>{const a=U(),i=$e(),{detailsOfMarriageAndDeath:o,applicantProfile:r,jointApplicantProfile:s,supportingDocument:u}=q(),n=(N,E)=>{const M=N?.trim().toUpperCase(),v=E?.find(l=>l.value===M);return v?v.label.toUpperCase():M},d=[{label:"Death certificate number",title:n(o.death.certificateNumber,i.COUNTRY||[])},{label:"",title:""},{label:"Place of death",title:n(o.death.place,i.COUNTRY||[])},{label:"Death date",title:Pt(o.death.date)}],m=[{label:"Full name",title:r.fullName},{label:"ID type",title:n(r?.idType||"",i.ID_TYPE||[])},{label:"ID number",title:r.idNumber}],T=[{label:"Full name",title:s.fullName},{label:"ID type",title:n(s?.idType||"",i.ID_TYPE||[])},{label:"ID number",title:s.idNumber}],A=(N=>{const E=new Map;return N.filter(v=>v.required===!0&&v.files&&v.files.length>0).sort((v,l)=>v.displayOrder-l.displayOrder).forEach(v=>{const l=v.fileTypeName,R=v.description||void 0,I=v.files.map(j=>j.fileName);if(E.has(l)){const j=E.get(l);j.title=Array.isArray(j.title)?[...j.title,...I]:[j.title,...I]}else E.set(l,{label:l,title:I.length===1?I[0]:I,description:R})}),Array.from(E.values())})(u),D=[{type:"info",title:"Spousal Death Update",onEdit:()=>a(c.maritalStatusUpdateSpousalDeathRecordDetail),fields:d}
1,{type:"info",title:"Applicant details",onEdit:()=>a(c.maritalStatusUpdateSpousalDeathRecordApplicant),fields:m},{type:"info",title:"Late spouseâs details",onEdit:()=>a(c.maritalStatusUpdateSpousalDeathRecordJoin),fields:T},{type:"document",title:"Supporting documents",onEdit:()=>a(c.maritalStatusUpdateSpousalDeathRecordDoc),fields:A}];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:_e.title,children:Ce.declarationPreviewTitle}),e.jsx(ia,{sections:D}),e.jsxs(w,{theme:"primary",onClick:t,children:[" ","Save and continue"]}),e.jsxs(w,{className:_e.marginLeft,theme:"secondary",onClick:()=>a(c.maritalStatusUpdateSpousalDeathRecordDoc),children:[" ","Back"]})]})},ra=({onSubmit:t})=>{const{formData:a,setFormData:i,handleSubmit:o,loading:r,step:s,handleNextStep:u,handlePreviousStep:n}=aa(t);U();const d=e.jsx("div",{children:Ce.declarations.map(m=>e.jsxs("section",{className:"declaration-section",children:[e.jsx(Te,{children:m.text}),m.list&&e.jsx(Ft,{contentList:m.list,listStyleType:"number"}),e.jsx("br",{})]},m.text))});return e.jsx(e.Fragment,{children:s==="1"?e.jsx(sa,{onSubmit:u}):e.jsx(Et,{setFormData:i,formData:a,onSubmit:o,loading:r,confirmText:it,checkBoxLabel:Ce.acknowledged,htmlOfAgreement:d,isPreview:!0,goBackButton:e.jsx("span",{children:e.jsxs(w,{theme:"secondary",onClick:n,children:[" ","Back"]})})})})},la=t=>{const{detailsOfMarriageAndDeath:a,setDetailsOfMarriageAndDeath:i}=q(),{formSections:o}=nt(Qe),r=$e(),{errors:s,setErrors:u,validateAllFields:n}=ot(o,a);return{applicantFormSections:o,applicantForm:a,errors:s,setErrors:u,handleFieldChange:(T,b,A)=>{i(D=>st({...D},[T,b],A))},optionStore:r,handleContinue:()=>{n()&&t()}}},Re=({onContinue:t})=>{const{applicantForm:a,errors:i,setErrors:o,handleFieldChange:r,optionStore:s,handleContinue:u}=la(t);return e.jsxs("div",{children:[e.jsx(K,{title:"Update of spousal death"}),e.jsx(rt,{sections:Qe,formData:a,errors:i,setErrors:o,onChange:r,optionStore:s}),e.jsx("div",{className:J.buttonWrapper,children:e.jsx(w,{onClick:u,children:le})})]})},De=5,ca=t=>{const{onContinue:a,pageTitle:i,primaryDocTitle:o,setDocuments:r,fileUploadGroupType:s,documents:u,description:n,retrieveDraftData:d}=t,{handleFieldChange:m,handleContinue:T,localFiles:b,setLocalFiles:A}=bt(a,u,r),{supportingDocument:D,setSupportingDocument:N}=q(),E=D?.filter(x=>x.section==="DEATH_DETAILS"),M=D?.filter(x=>x.section==="MARRIAGE_DETAILS"),[v,l]=h.useState(!1),[R,I]=h.useState("NO"),j=D?.find(x=>x.fileType==="MSR_DEATH_CERTIFICATE_ENGLISH_COPY"),B=D?.filter(x=>x.section==="LATE_SPOUSE_DETAILS"),V=D?.filter(x=>x.fileType!=="MSR_DEATH_CERTIFICATE_ENGLISH_COPY")?.every(x=>x.required?x.files&&x.files.length>0:!0),G=U(),te=()=>{G(c.maritalStatusUpdateSpousalDeathRecordJoin)},me=D?.filter(x=>x.section==="OTHERS"),Z=[];me[0]?.files?.map(x=>{const z={fileKey:x.fileKey,filename:x.fileName,type:x.type,size:x.size,uploadTime:x.uploadTime};Z.push(z)});const ae=async(x,z)=>{try{await W.draftMsr.deleteMSRSupportingDocument({fileKey:x,msrType:z});const H=D.map(L=>{if(L.section==="OTHERS"){const ie=L.files.filter(fe=>fe.fileKey!==x);return{...L,files:ie}}return L});N(H),A(L=>L.filter(ie=>ie.fileKey!==x))}catch(H){console.error("Failed to delete document:",H)}},he=()=>{R==="NO"&&j?.files?.[0]?.fileKey&&ae(j?.files?.[0]?.fileKey,j?.msrType),T()};return e.jsxs("div",{className:oe.msrDocumentPage,children:[e.jsx(K,{...i}),e.jsx("div",{className:oe.description,children:n}),e.jsx("div",{style:{marginTop:"15px"},children:e.jsx(ge,{title:"Spousal death details",dataSupportingDocument:E,handleFieldChange:d,msrType:"DEATH_DETAILS",titleDocumentCopy:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"English translated copy of late spouseâs death certificate."}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{children:"(Translations provided must come from either the relevant Embassy or a certified translator in Singapore, or a notary public from Singapore)"})]}),documentCopyType:Ut.MSR_DEATH_CERTIFICATE_ENGLISH_COPY,radioTitle:"Is your late spouseâs death certificate in a foreign language (other than the 4 official languages in Singapore)?",setIsUploadCopyDoc:l,setOptionUploadCopy:I})}
1),e.jsx("div",{style:{marginTop:"15px"},children:e.jsx(ge,{title:"Marriage details",dataSupportingDocument:M,handleFieldChange:d})}),e.jsx("div",{style:{marginTop:"15px"},children:e.jsx(ge,{title:"Your late spouse",dataSupportingDocument:B,handleFieldChange:d})}),e.jsx("div",{style:{marginTop:"50px"},children:e.jsx(Tt,{multiple:!0,uploadFile:x=>Ot(x,s,"DEATH"),onChange:m,maxFileSizeOfByte:5242880,fieldTitle:o,maxFileLength:De,disabled:b.length>0?b.length>=De:Z.length>=De,value:b.length>0?b:Z,uploadButtonPosition:"top",showMaxFileSizeHint:!1,downloadFile:wt,deleteFile:ae,msrType:"DEATH"})}),e.jsxs("div",{className:oe.buttonWrapper,children:[e.jsx(w,{onClick:he,disabled:R==="NO"&&!V&&!v||R==="YES"&&(!V||!v),children:le}),e.jsx(w,{onClick:te,className:oe.marginLeft,theme:"secondary",children:ce})]})]})},xe={primaryDocTitle:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"Other supporting documents"}),e.jsx("div",{style:{marginTop:"15px",fontWeight:400,fontSize:"0.875rem"},children:"Other supporting documents (e.g. Deed poll for name change, annulment certificate from previous marriage, if applicable)"})]}),pageTitle:{title:"Upload supporting documents",subtitle:""},description:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("p",{children:"Please ensure that you upload the correct documents as required and they are of clear, legible, and in accepted formats before submitting."}),e.jsx("br",{}),e.jsx("p",{children:"Documents uploaded are subject to approval by MSF. You will receive an email notification if you need to re-upload documents that have not been accepted."}),e.jsx("br",{}),e.jsxs("p",{children:[e.jsx("span",{style:{fontWeight:"bold"},children:"Accepted formats:"})," PDF, DOC, PNG, JPG"]}),e.jsxs("p",{children:[e.jsx("span",{style:{fontWeight:"bold"},children:"File size:"})," Not exceeding 5 MB for each file"]})," ",e.jsx("br",{}),e.jsx("p",{children:"Documents marked with * are mandatory."}),e.jsx("br",{})]})},da=({onContinue:t,retrieveDraftData:a})=>{const{setDocuments:i,documents:o}=q();return e.jsx(ca,{pageTitle:xe.pageTitle,description:xe?.description,primaryDocTitle:xe.primaryDocTitle,onContinue:t,setDocuments:i,fileUploadGroupType:kt.MSR_DEATH,documents:o,retrieveDraftData:a})},Ze=t=>{const{jointApplicantProfile:a,setJointApplicantProfile:i,applicantProfile:o,detailsOfMarriageAndDeath:r}=q(),{formSections:s,handleFieldChange:u,errors:n,setErrors:d,validateAllFields:m,optionStore:T,overrideFormFields:b}=Ge(a,i,Zt);return It(o,a,b),console.log("UpdateSpousalDeathRecord useApplicantProfileForm useJointApplicantProfileForm: ",Ze),h.useEffect(()=>{re(d,r.marriage.date,"",a.dateOfBirth)},[a.dateOfBirth]),{applicantFormSections:s,applicantForm:a,errors:n,setErrors:d,handleFieldChange:u,optionStore:T,handleContinue:()=>{const D=m(),N=re(d,r.marriage.date,"",a.dateOfBirth);Be(),!(!D||!N)&&t()}}},pa=({onContinue:t})=>{const{applicantForm:a,applicantFormSections:i,errors:o,setErrors:r,handleFieldChange:s,optionStore:u,handleContinue:n}=Ze(t),d=U(),m=()=>{d(c.maritalStatusUpdateSpousalDeathRecordApplicant)};return e.jsxs("div",{className:J.updateMaritalStatus,children:[e.jsx(K,{title:"Late spouse details"}),e.jsx(Le,{sections:i,formData:a,errors:o,setErrors:r,onChange:s,optionStore:u}),e.jsxs("div",{className:J.buttonWrapper,children:[e.jsx(w,{onClick:n,children:le}),e.jsx(w,{onClick:m,className:J.marginLeft,theme:"secondary",children:ce})]})]})},ye={[p.Detail]:0,[p.ApplicantProfile]:1,[p.JoinProfile]:2,[p.UploadSupportingDocument]:3,[p.SubmitApplication]:4},ua={[c.maritalStatusUpdateSpousalDeathRecordDetail]:p.Detail,[c.maritalStatusUpdateSpousalDeathRecordApplicant]:p.ApplicantProfile,[c.maritalStatusUpdateSpousalDeathRecordJoin]:p.JoinProfile,[c.maritalStatusUpdateSpousalDeathRecordDoc]:p.UploadSupportingDocument,[c.maritalStatusUpdateSpousalDeathRecordDeclaration]:p.SubmitApplication},ma=[{title:"Spousal death update",editLabel:"Edit",type:"DETAIL"},{title:"Your details",editLabel:"Edit",type:"APPLICANT_DETAIL"},{title:"Your Late spouse",editLabel:"Edit",type:"JOIN_DETAIL"},{title:"Upload supporting documents",editLabel:"Manage",type:"UPLOAD_SUPPORTING_DOCUMENT"},{title:"Review and submit application",editLabel:"Edit",type:"SUBMIT_APPLICATION"}],ha=t=>{const{pathname:a}=qe(),i=ua[a],o=h.useMemo(()=>ma,[t.type]);if(!i)return e.jsx(e.Fragment,{children:t.children});const r=ye[i],s=n=>ye[n]<r,u=n=>ye[n]===r?k.current:s(n)?k.done:k.next;return e.jsxs("div",{style:{marginTop:"100px"},className:k.pageContent,children:[!t.isNotExist&&e.jsx("div",{className:k.backButton,role:"link","aria-label":ce,onClick:t.handleOnback,children:lt}),e.jsx("div",{className:k.mainContent,children:t.children}),e.jsx("div",{className:je(k.sectionWrapper),children:o?.map(n=>e.jsxs("section",{className:je(k.section,u(n.type)),children:[s(n.type)&&e.jsx(Ve,{}),e.jsx("span",{className:k.title,children:n.title})]},n.type))})]})},fa=()=>{const[t,a]=h.useState(),[i,o]=h.useState(),[r,s]=h.useState(!1),u=h.useRef(!1),[n,d]=h.useState(),[m,T]=h.useState();return{stage:t,setStage:a,draftMarriageApplicationResponse:i,setDraftMarriageApplicationResponse:o,saveLoading:r,setSaveLoading:s,isDraftDeleted:u,eventId:n,applicationStatus:m,setEventId:d,setApplicationStatus:T}},et=h.createContext({}),Sa=t=>{const a=fa();return e.jsx(et.Provider,{value:a,children:t.children})},ue=()=>h.useContext(et),ga=t=>!t,Da=t=>{const{draftMarriageApplicationResponse:a}
1=ue(),i=n=>n.map(d=>a?.[d]),o=(n,d)=>d.map(ct).every(ga)?g.Done:g.Coming,r=n=>{const d=i(n.fields);return o(n,d)},s=()=>{const n=[];return t.forEach((d,m)=>{switch(n[m-1]?.status){case g.Coming:case g.Next:n.push({...d,status:g.Next});break;case g.Done:case void 0:n.push({...d,status:r(d)});break;default:n.push(d)}}),n};return{getSectionResultStatus:()=>{const n={};return s().forEach(m=>{n[m.key]=m.status}),{...n}}}},xa=()=>{const t={[p.Detail]:{showSection:!0},[p.ApplicantProfile]:{showSection:!0},[p.SpouseProfile]:{showSection:!0},[p.JoinProfile]:{showSection:!0},[p.UploadSupportingDocument]:{showSection:!0},[p.SubmitApplication]:{showSection:!0},[p.Declaration]:{showSection:!0}};return Object.keys(t).filter(a=>t[a].showSection)},ya=new Ae("useDashboardPage"),ba=()=>{const{draftMarriageApplicationResponse:t,setStage:a,isDraftDeleted:i}=ue(),o=h.useMemo(()=>xa(),[t]),s=[{key:p.Detail,fields:["marriage"],status:g.Next},{key:p.ApplicantProfile,fields:["applicant"],status:g.Next},{key:p.JoinProfile,fields:["joint"],status:g.Next},{key:p.UploadSupportingDocument,fields:["isValidSupportingDocument"],status:g.Next},{key:p.SubmitApplication,fields:["submit"],status:g.Next}].filter(l=>o.includes(l.key)),u=U(),[n,d]=h.useState({[p.Detail]:g.Next,[p.ApplicantProfile]:g.Next,[p.SpouseProfile]:g.Next,[p.JoinProfile]:g.Next,[p.UploadSupportingDocument]:g.Next,[p.SubmitApplication]:g.Next,[p.Declaration]:g.Next}),[m,T]=h.useState({}),{getSectionResultStatus:b}=Da(s),A=l=>n[l]===g.Done,D=l=>n[l]===g.Next,N=l=>A(l.type)?l.editLabel:_t.startLabel,E=l=>!0,M=()=>{const l=b();ya.log`section status: ${l}`,d(l)};return h.useEffect(()=>{M()},[t]),{sectionStatus:n,isSectionDone:A,isSectionNext:D,enterStep:l=>()=>{const R={[p.Detail]:c.maritalStatusUpdateSpousalDeathRecordDetail,[p.ApplicantProfile]:c.maritalStatusUpdateSpousalDeathRecordApplicant,[p.JoinProfile]:c.maritalStatusUpdateSpousalDeathRecordJoin,[p.UploadSupportingDocument]:c.maritalStatusUpdateSpousalDeathRecordDoc,[p.SubmitApplication]:c.maritalStatusUpdateSpousalDeathRecordDeclaration};if(R[l])return u(R[l])},sectionInfos:m,draft:t,getButtonText:N,shouldDisableButton:E,currentSections:o,setStage:a,isDraftDeleted:i}};function Ta({historyPush:t,isSectionDone:a,isSectionNext:i,data:o}){return{title:"Applicant details",actionButtons:(()=>
1{if(i)return null;const s={[S.Start]:{label:S.Start,theme:P.primary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordApplicant)},[S.Edit]:{label:S.Edit,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordApplicant)},[S.View]:{label:S.View,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordApplicant)}},u=a?S.Edit:S.Start;return[s[u]]})(),type:p.ApplicantProfile,viewMore:"Verify your personal details retrieved from your Singpass.",editLabel:"",doneTitle:`Name: ${o?.fullName}${o?.idNumber?.includes("*")?"":` 2ID No.: ${o?.idNumber}`}`}}function ja({historyPush:t,isSectionDone:a,isSectionNext:i}){return{title:"Review and submit application",actionButtons:(()=>{if(i)return null;const r={[S.Start]:{label:S.Start,theme:P.primary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDeclaration)},[S.Edit]:{label:S.Edit,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDeclaration)},[S.View]:{label:S.View,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDeclaration)}},s=a?S.Edit:S.Start;return[r[s]]})(),type:p.SubmitApplication,viewMore:"Acknowledge the terms and conditions for the application submission.",editLabel:"",doneTitle:""}}function Ca({historyPush:t,isSectionDone:a,isSectionNext:i,data:o}){return{title:"Late spouse",actionButtons:(()=>
2{if(i)return null;const s={[S.Start]:{label:S.Start,theme:P.primary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordJoin)},[S.Edit]:{label:S.Edit,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordJoin)},[S.View]:{label:S.View,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordJoin)}},u=a?S.Edit:S.Start;return[s[u]]})(),type:p.JoinProfile,viewMore:"Complete your late spouse personal details as required.",editLabel:"",doneTitle:`Name: ${o?.fullName||""} 3${o?.idNumber&&!o.idNumber.includes("*")?`ID No.: ${o.idNumber}`:""}`}}function Aa({historyPush:t,isSectionDone:a,isSectionNext:i}){return{title:"Upload supporting documents",actionButtons:(()=>{if(i)return null;const r={[S.Start]:{label:S.Start,theme:P.primary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDoc)},[S.Edit]:{label:S.Edit,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDoc)},[S.View]:{label:S.View,theme:P.secondary,onClick:()=>t(c.maritalStatusUpdateSpousalDeathRecordDoc)}},s=a?S.Edit:S.Start;return[r[s]]})(),type:p.UploadSupportingDocument,viewMore:"Upload the correct documents as required and they are of clear, legible, and in accepted file size and formats before submitting.",doneTitle:"Please ensure that you upload the correct documents as required and they are of clear, legible, and in accepted formats before submitting. Documents uploaded are subject to approval by MSF. You will receive an email notification if you need to re-upload documents that have not been accepted.",editLabel:""}}const va=t=>{const{draftMarriageApplicationResponse:a}=ue(),i=a?.applicant,o=a?.joint,r=a,s=U(),u=D=>t&&t[D]===g.Done,n=D=>t&&t[D]===g.Next,d=Bt({historyPush:s,isSectionDone:u(p.Detail)??!1,isSectionNext:n(p.Detail)??!1,dataDetail:r}),m=Ta({historyPush:s,isSectionDone:u(p.ApplicantProfile)??!1,isSectionNext:n(p.ApplicantProfile)??!1,data:i}),T=Ca({isSectionDone:u(p.JoinProfile)??!1,isSectionNext:n(p.JoinProfile)??!1,historyPush:s,data:o}),b=Aa({isSectionDone:u(p.UploadSupportingDocument)??!1,isSectionNext:n(p.UploadSupportingDocument)??!1,historyPush:s}),A=ja({isSectionDone:u(p.SubmitApplication)??!1,isSectionNext:n(p.SubmitApplication)??!1,historyPush:s});return[d,m,T,b,A]},Ie={sectionTitle:{[g.Done]:"Completed tasks",[g.Coming]:"Ongoing task",[g.Next]:"Next tasks"},popUpConfirm:{title:"You are going to delete your draft application.",content:"This action will permanently delete your draft application and it cannot be recovered",confirmText:"Confirm delete",cancelText:"Close"}},Na="_muslimDashboard_mupqm_41",Ea="_pageTitle_mupqm_45",_a="_importantNote_mupqm_85",Ra="_sectionWrapper_mupqm_99",Ia="_done_mupqm_129",Fa="_section_mupqm_99",Ma="_coming_mupqm_183",Pa="_viewMore_mupqm_213",wa="_next_mupqm_216",Ua="_sectionInfo_mupqm_296",Oa="_subTitle_mupqm_312",ka="_sectionAction_mupqm_355",Ba="_sectionNext_mupqm_377",La="_sectionComing_mupqm_384",Wa="_step_mupqm_387",$a="_sectionDone_mupqm_390",qa="_deleteDraft_mupqm_442",_={muslimDashboard:Na,pageTitle:Ea,importantNote:_a,sectionWrapper:Ra,done:Ia,section:Fa,coming:Ma,viewMore:Pa,next:wa,sectionInfo:Ua,subTitle:Oa,sectionAction:ka,sectionNext:Ba,sectionComing:La,step:Wa,sectionDone:$a,deleteDraft:qa},Ja=()=>{const t={[g.Done]:_.done,[g.Coming]:_.coming,[g.Next]:_.next},a={[g.Done]:_.sectionDone,[g.Coming]:_.sectionComing,[g.Next]:_.sectionNext},i=U(),{openConfirmDialog:o}=dt(),{isSectionDone:r,sectionStatus:s,sectionInfos:u,currentSections:n,setStage:d,isDraftDeleted:m,draft:T}=ba(),{retrieveMyInfo:b}=Lt(),{openSnackbar:A}=We();h.useEffect(()=>{b()},[]);const D=l=>{const{type:R,viewMore:I,doneTitle:j,subTitle:B}=l;if(u?.[l.type]){const{date:V,name:G}=u[R]??{};return e.jsx("div",{className:_.viewMore,children:e.jsxs("p",{children:["date and time: ",V]})})}if(r(R))return e.jsx("div",{className:_.viewMore,children:typeof j=="string"?e.jsx(Te,{preserveLineBreaks:!0,children:j}):j});const Q=typeof I=="string";return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:_.subTitle,children:B}),e.jsx("div",{className:_.viewMore,children:Q?e.jsx(Te,{children:I}):I})]})},E=va(s).filter(l=>n.includes(l.type)),M=async()=>{try{await W.draftMsr.manualDeleteLatestMSRDraft(T?.id),d("NOT_EXIST"),m.current=!0,sessionStorage.removeItem("targetType"),sessionStorage.removeItem("url"),i(c.msrDeleteDraftDeathConfirmation)}catch{A({severity:"error",body:pt})}},v=()=>{o({...Ie.popUpConfirm,onConfirm:M})};return e.jsx("div",{children:e.jsxs("div",{className:_.muslimDashboard,children:[e.jsx(He,{}),e.jsxs(K,{title:"Update spousal death application",className:_.pageTitle,children:["Please complete the following tasks for your spousal death update. It will take about estimated 15-20 minutes."," ",e.jsxs("div",{className:_.importantNote,children:[e.jsx("h4",{children:"Important Note:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"Please ensure that all entries in the application form are in English alphanumeric format (letters and numbers). Special symbols or non-English characters may not be accepted."}),e.jsx("li",{children:e.jsxs("span",{children:["If you no longer wish to proceed with this draft application, you can"," ",e.jsxs(w,{onClick:v,theme:"text",className:_.deleteDraft,children:[" ","delete"]})," ","this draft."]})})]})]})]}),e.jsx("div",{className:_.sectionWrapper,children:E?.map((l,R)=>e.jsxs(h.Fragment,{children:[e.jsx("h2",{className:t[s[l.type]],children:Ie.sectionTitle[s[l.type]]}),e.jsxs("section",{className:je([_.section,a[s[l.type]]]),children:[r(l.type)&&e.jsx(Ve,{}),e.jsxs("div",{className:_.sectionInfo,children:[e.jsxs("div",{className:_.step,children:["Step ",R+1]}),e.jsx("div",{style:{fontWeight:600,fontSize:"1.5rem",marginBottom:"12px"},children:l.title}),D(l)]}),e.jsx("div",{className:_.sectionAction,children:l.actionButtons?.map(({theme:I,label:j,onClick:B,disabled:Q})=>e.jsx(w,{theme:I,size:"large","aria-label":j,onClick:B,children:j},j))})]})]},l.type))})]})})},Ya="_normalText_fccct_34",Va="_marginBottom_fccct_40",Ga="_marginTop_fccct_44",za="_titleWrapper_fccct_48",Ha="_title_fccct_48",Xa="_sectionWrapper_fccct_81",Ka="_sectionCard_fccct_86",Qa="_sectionCardWarning_fccct_89",Za="_sectionCardError_fccct_92",ei="_sectionCardApproved_fccct_95",ti="_badgeWarning_fccct_99",ai="_badgeSuccess_fccct_108",ii="_badgeError_fccct_11
37",C={normalText:Ya,marginBottom:Va,marginTop:Ga,titleWrapper:za,title:Ha,sectionWrapper:Xa,sectionCard:Ka,sectionCardWarning:Qa,sectionCardError:Za,sectionCardApproved:ei,badgeWarning:ti,badgeSuccess:ai,badgeError:ii},ni=t=>({title:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:C.normalText,children:["Application number: ",t]}),e.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[e.jsx("span",{className:C.marginBottom,children:"Your application status:"})," ",e.jsx("span",{className:C.badgeSuccess,children:"Approved"})]})]}),titlePending:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:C.normalText,children:["Application number: ",t]}),e.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[e.jsx("span",{className:C.marginBottom,children:"Your application status:"})," ",e.jsx("span",{className:C.badgeWarning,children:"Pending review"})]})]}),titleResubmission:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:C.normalText,children:["Application number: ",t]}),e.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[e.jsx("span",{className:C.marginBottom,children:"Your application status:"})," ",e.jsx("span",{className:C.badgeError,children:"Resubmission required"})]})]}),subTitle:e.jsxs("div",{className:C.marginTop,children:[e.jsx("p",{children:"Your application has been approved. You will receive an email notification."}),e.jsx("p",{children:"You may view your updated information after 3 working days:"}),e.jsxs("ol",{children:[e.jsxs("li",{children:[e.jsx("span",{style:{marginRight:"15px"},children:"1."}),' Open Singpass app and go to "My Profile" > "View All"']}),e.jsxs("li",{children:[e.jsx("span",{style:{marginRight:"15px"},children:"2."}),' Click the three dots (top right) > "Refresh Profile"']}),e.jsxs("li",{children:[e.jsx("span",{style:{marginRight:"15px"},children:"3."}),' Select "Family" to view updated marital information']})]})]}),subTitlePending:e.jsxs("div",{className:C.marginTop,children:[e.jsx("p",{children:"Your application is being processed and may take up to 15 working days. You will receive an email notification if your application require follow-up."}),e.jsx("p",{style:{marginTop:"7px"},children:"For complex cases, processing may take longer than the standard timeframe. We appreciate your patience and will notify you once the review is complete."})]}),subTitleResubmit:e.jsxs("div",{className:C.marginTop,children:[e.jsx("p",{children:"Additional information or resubmission of documentation is needed to process your application."}),e.jsx("p",{children:"Please upload all required documents as specified in the 'Upload Documents' section below. "}),e.jsx("p",{children:"Please ensure all documents are clear, legible, and in the accepted file formats before submission."})]}),reminderMessage:"Waiting for spouse-to-be to join the application and fill in details.",startLabel:"Start"}),oi=(t,a)=>{const i=ni(a);return t===ee.PENDING||t===ee.DOCS_RESUBMITTED||t===ee.PENDING_REWORK||t===ee.REVIEW_DONE?{title:i.titlePending,subTitle:i.subTitlePending}:t===ee.RESUBMISSION_REQUIRED?{title:i.titleResubmission,subTitle:i.subTitleResubmit}:{title:i.title,subTitle:i.subTitle}},si={APPROVED:C.sectionCardApproved,REVIEW_DONE:C.sectionCardWarning,PENDING_REWORK:C.sectionCardWarning,DOCS_RESUBMITTED:C.sectionCardWarning,RESUBMISSION_REQUIRED:C.sectionCardError,PENDING:C.sectionCardWarning},ri=t=>(t&&si[t])??C.sectionCard,li=({forceDisable:t,applicationStatus:a,eventId:i})=>{const{title:o,subTitle:r}=oi(a,i);return e.jsxs("section",{className:C.sectionWrapper,children:[e.jsx("header",{className:C.titleWrapper,children:e.jsx("h2",{className:C.title,children:"Application status"})}),e.jsx(Xe,{className:ri(a),forceDisable:t,title:o,subTitle:r,dataTestId:""})]})},Fe={title:"Document Upload Requirements",subTitle:e.jsxs("div",{children:[e.jsx("p",{children:"You will receive an email notification if any documents need to be re-uploaded. Upload the correct documents as required."}),e.jsx("p",{style:{marginTop:"7px"},children:"Documents marked with * are mandatory."})]})},ci="_titleWrapper_c8ahx_34",di="_title_c8ahx_34",pi="_sectionWrapper_c8ahx_67",ui="_sectionCard_c8ahx_72",se={titleWrapper:ci,title:di,sectionWrapper:pi,sectionCard:ui},mi=t=>{const a=U(),i=t.applicationStatus==="RESUBMISSION_REQUIRED"||t.applicationStatus==="DOCS_RESUBMITTED";return e.jsxs("div",{children:[" ",e.jsx("div",{className:se.titleWrapper,children:e.jsx("h2",{className:se.title,children:"Upload documents"})}),e.jsx("div",{className:se.sectionWrapper,children:e.jsx(h.Fragment,{children:e.jsx(Xe,{className:se.sectionCard,title:Fe.title,dataTestId:"",subTitle:Fe.subTitle,buttonAttributes:{editLabel:"Upload",isDisabled:!i,theme:"secondary",onClick:()=>a(c.maritalStatusUpdateSpousalDeathEchangeUpload)}})})})]})},Me={title:"Update spousal death application",subTitle:""},hi="_muslimDashboard_glhg8_41",fi="_pageTitle_glhg8_61",Pe={muslimDashboard:hi,pageTitle:fi},Si=t=>e.jsxs("div",{className:Pe.muslimDashboard,children:[e.jsx(He,{}),e.jsx(K,{title:Me.title,subtitle:Me.subTitle,className:Pe.pageTitle}),e.jsx(li,{eventId:t.eventId,applicationStatus:t.applicationStatus}),e.jsx(mi,{applicationStatus:t.applicationStatus})]}),gi=new Map([["NOT_EXIST",[c.maritalStatusUpdateSpousalDeathRecordDashboard]],["DRAFT",[c.maritalStatusUpdateSpousalDeathRecordDashboard,c.maritalStatusUpdateSpousalDeathRecordDetail,c.maritalStatusUpdateSpousalDeathRecordApplicant,c.maritalStatusUpdateSpousalDeathRecordJoin,c.maritalStatusUpdateSpousalDeathRecordDoc,c.maritalStatusUpdateSpousalDeathRecordDeclaration]],["SUBMITTED",[c.maritalStatusUpdateSpousalDeathPaidDashboard]]]),Di={CIVIL:gi},xi=new Ae("useStagePath"),yi=t=>({currentStagePath:h.useMemo(()=>{const i=ut(Di.CIVIL),o=i.get("DRAFT")||[];return i.set("DRAFT",o),xi.log`current stage path: ${i.get("DRAFT")}`,i},[t])}
3),be=new Ae("useUpdateMaritalStatusStep");ft.get();const bi=()=>{const{detailsOfMarriageAndDeath:t,applicantProfile:a,jointApplicantProfile:i,setDetailsOfMarriageAndDeath:o,setApplicantProfile:r,setJointApplicantProfile:s,setSupportingDocument:u,supportingDocument:n}=q(),{setStage:d,stage:m,setDraftMarriageApplicationResponse:T,draftMarriageApplicationResponse:b,setSaveLoading:A,eventId:D,applicationStatus:N,setEventId:E,setApplicationStatus:M}=ue(),{currentStagePath:v}=yi(b),l=U(),R=qe(),[I,j]=h.useState(!0),B=h.useRef(null),{navigationChecker:Q}=Rt(()=>!!B.current?.isDataChanged()),V=v,G=m==="NOT_EXIST"||m==="SUBMITTED"&&["APPROVED","REJECTED","LAPSED"].includes(N||""),te=async()=>{const y=f=>{const Se=V.get(f);if(!Se){be.error`No stage paths found for stage: ${f}`;return}const ve=mt(Se);ve.includes(R.pathname)||l(ht(ve[0]),{replace:!0})};try{const f=await W.draftMsr.findDraftMSRStageAndType({msrType:"DEATH"});return y(f?.data?.draftMsrStatus),E(f?.data?.eventId),M(f?.data?.progressStatus),f?.data?.draftMsrStatus}catch(f){if(console.error("RAW ERROR:",f),be.error`findApplicationStage break error: ${f}`,!Ne.isAxiosError(f))return;f.response?.status!==401&&l(c.systemError,{state:{errorCode:f.response?.status??500}});return}},me=async y=>{try{const f={};switch(y){case"1":f.marriage=t;break;case"2":f.applicant=a;break;case"3":f.joint=i;break;case"4":f.marriage=t.marriage,f.applicant=a,f.joint=i;break;default:return}if(G?await W.draftMsr.createSpousalDeathMSRDraft(f.marriage):await W.draftMsr.editSpousalDeathMSRDraft(y==="1"?f.marriage:f,b?.id))switch(y){case"1":G?(d("DRAFT"),l(c.maritalStatusUpdateSpousalDeathRecordDashboard)):l(c.maritalStatusUpdateSpousalDeathRecordApplicant);break;case"2":l(c.maritalStatusUpdateSpousalDeathRecordJoin);break;case"3":l(c.maritalStatusUpdateSpousalDeathRecordDoc);break;case"4":l(c.maritalStatusUpdateSpousalDeathRecordDeclaration);break}}catch(f){console.error("API error:",f)}},Z=()=>{Q(c.civilMarriageApplicationDashboard)},ae=(y,f)=>{switch(f){case"marriage":X.util.start(X.wogaaIdMap.updateOverseaMaritalStatusApplicationFlow);break;case"death":X.util.start(X.wogaaIdMap.updateSpouseDeathRecordFlow);break;case"divorce":case"annulment":X.util.start(X.wogaaIdMap.updateDivorceOrAnnulmentRecordFlow);break}M("PENDING"),l({pathname:c.maritalStatusUpdateConfirmation,search:Wt({applicationId:y,applicationType:f},!0)},{replace:!0})},he=()=>{},x=y=>()=>l(y),z=async()=>{try{const{data:y}=await W.draftMsr.getSpousalMSRDraft();T(y);const{data:f}=await W.draftMsr.getRequiredDocumentMSR(y?.id);u(f),y.marriage&&o(y),y.applicant&&r(y.applicant),y.joint&&s(y.joint)}catch(y){be.log`retrieveDraftData break error: ${y}`,Ne.isAxiosError(y)&&l(c.systemError,{state:{errorCode:y.response?.status??500}})}},H=async()=>{},L=async()=>{switch(m){case"NOT_EXIST":break;case"DRAFT":j(!0),await z();break;case"SUBMITTED":await H();break;default:j(!0),d(await te());return}j(!1)},fe=n?.filter(y=>y.fileType!=="MSR_DEATH_CERTIFICATE_ENGLISH_COPY")?.every(y=>y.required?y.files&&y.files.length>0:!0);return h.useEffect(()=>{(async()=>{if(R.pathname.includes("paid-dashboard")){const f=await te();d(f)}})()},[R.pathname]),jt(b,T,fe,n),h.useEffect(()=>{L()},[m,R]),{stage:m,handleSubmit:ae,goBack:he,loading:I,goToNextPath:x,backToDashboard:Z,dataChangeCheckRef:B,retrievePaidData:H,handleContinueDraftForLocal:me,draftMarriageApplicationResponse:b,applicantForm:t,applicantProfileForm:a,joinApplicantForm:i,navigate:l,retrieveDraftData:z,isNotExist:G,eventId:D,applicationStatus:N}},Ti=()=>{const{handleSubmit:t,handleContinueDraftForLocal:a,loading:i,retrieveDraftData:o,navigate:r,isNotExist:s,eventId:u,applicationStatus:n,stage:d}=bi();if(d==="NOT_EXIST"&&window.location.pathname.includes("dashboard"))return r(c.maritalStatusUpdateSpousalDeathRecordDetail),null;const T=d==="SUBMITTED"&&["REJECTED","LAPSED","APPROVED"].includes(n||"")?"NOT_EXIST":d;if(T==="NOT_EXIST"&&(window.location.pathname.includes("paid-dashboard")||window.location.pathname.includes("dashboard")))return r(c.maritalStatusUpdateSpousalDeathRecordDetail),null;const b=()=>{r(c.maritalStatusUpdateSpousalDeathRecordDashboard)},A=new Map([["NOT_EXIST",e.jsx(ne,{children:e.jsx(O,{path:"detail",element:e.jsx(Re,{onContinue:()=>a("1")})},"NOT_EXIST")})],["DRAFT",e.jsxs(St.Fragment,{children:[e.jsx(ne,{children:e.jsx(O,{path:"dashboard",element:e.jsx(Ja,{})},"dashboard")}),e.jsx(ha,{isNotExist:s,handleOnback:b,type:"CIVIL",children:e.jsxs(ne,{children:[e.jsx(O,{path:"detail",element:e.jsx(Re,{onContinue:()=>a("1")})}),e.jsx(O,{path:"applicant",element:e.jsx(ta,{onContinue:()=>a("2")})}),e.jsx(O,{path:"join-applicant",element:e.jsx(pa,{onContinue:()=>a("3")})}),e.jsx(O,{path:"document",element:e.jsx(da,{retrieveDraftData:o,onContinue:()=>a("4")})}),e.jsx(O,{path:"declaration",element:e.jsx(ra,{onSubmit:t})})]})})]},"DRAFT")],["SUBMITTED",e.jsxs(ne,{children:[e.jsx(O,{path:"paid-dashboard",element:e.jsx(Si,{eventId:u,applicationStatus:n})},"paid"),e.jsx(O,{path:"upload-document",element:e.jsx(At,{eventID:u,type:n,recordType:"SPOUSAL"})},"paid")]},"SUBMITTED")]]);return e.jsx(gt,{isLoading:i,children:A.get(T)})},tn=()=>e.jsx(Ct,{children:e.jsx(Sa,{children:e.jsx(Yt,{children:e.jsx(Ti,{})})})});export{tn 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.