1import{j as e,d as v,r as f}from"./vendor-react-DfYGAhtm.js";import{bA as H,bB as R,bw as A}from"./vendor-icons-1odZwi-b.js";import{u as C,e as _}from"./vendor-state-BsBVN-fX.js";import{m as r,g as T,B as x,bd as N}from"./index-DsBgCU7r.js";import{u as I}from"./useHealthStepBreadcrumbs-CBh-jmUl.js";import{u as w}from"./useAnalytics-HP01GbIH.js";import{u as z,i as P}from"./enquiryPolicyApi-9jp9YRr5.js";import{S as L}from"./StepPageLayout-DdZUweau.js";import{g as k}from"./errors-BYKXB8DF.js";import{a as S}from"./text-D803XGGZ.js";import{a as c,H as y,T as l,G,V as B,v as p,F}from"./vendor-ui-DA_r9yXk.js";import{g as M,H as q}from"./flowGuard-BvyU_Hq7.js";import{H as U}from"./routes-Dr23NpA-.js";import"./vendor-forms-BP-7CbAP.js";import"./stepBreadcrumbs-FCtSk5Kj.js";const W=s=>{const t=["Group Health Insurance enquiry."];if(s){t.push(`Company: ${s.name}`),t.push(`CAC number: ${s.rcNumber}`);const a=S(s.details?.classification);a&&t.push(`Industry: ${a}`)}return t.join(` 2`)},$=s=>{const t=s.replace(/\D/g,"");return t.startsWith("234")?t:t.startsWith("0")?"234"+t.slice(1):"234"+t},D=()=>z("group-health"),O=({label:s,value:t})=>e.jsxs(c,{children:[e.jsx(l,{fontSize:"sm",color:r.text.gray,mb:1,children:s}),e.jsx(c,{fontSize:"sm",fontWeight:"semibold",color:r.text.label,children:t})]}),g=({icon:s,title:t,fields:a,children:m})=>e.jsxs(c,{border:"1px solid",borderColor:r.border.primary,borderRadius:"xl",p:4,bg:r.white.DEFAULT,children:[e.jsxs(y,{gap:2,mb:4,children:[e.jsx(c,{bg:r.orange[50],borderRadius:"lg",p:1.5,display:"flex",alignItems:"center",justifyContent:"center",children:s}),e.jsx(l,{fontWeight:"semibold",fontSize:"sm",color:r.text.primary,children:t})]}),a.length>0&&e.jsx(G,{templateColumns:"1fr 1fr",gap:4,children:a.map(n=>e.jsx(O,{label:n.label,value:n.value},n.label))}),m]}),V=()=>e.jsxs(y,{gap:1,children:[e.jsx(p,{as:A,boxSize:4,color:r.success[600]}),e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:r.success[700],children:"Verified"})]}),ue=()=>{const{items:s}=I(),t=v(),a=C(),[m,n]=f.useState(null),{company:u,representative:i}=_(o=>o.groupHealth),{submitEnquiryAsync:j,isSubmitting:b}=D(),{track:h}=w(),E=async()=>{if(i){n(null);try{await j({productType:"GROUP_HEALTH",fullName:`${i.firstName} ${i.lastName}`,email:i.email,phone:$(i.phone),message:W(u)}),h(x.FORM_GROUP_HEALTH_SUBMITTED,{product_type:"group_health"});const o={kind:"enquiry",submittedAt:new Date().toISOString()};a(N(o)),t(`/${U.Submitted}`,{replace:!0,state:{submissionResult:o}})}catch(o){if(P(o))return;h(x.FORM_GROUP_HEALTH_SUBMIT_FAILED,{product_type:"group_health",failure_reason:"server_error"}),n(k(o)??"Submission failed. Please check your details and try again.")}}},d=M(q.ReviewSubmit,u,i,null);return f.useEffect(()=>{d&&t(d,{replace:!0})},[d,t]),d||!i?null:e.jsx(L,{items:s,contentMaxW:"800px",children:e.jsx(c,{bg:"white",borderRadius:"2xl",p:{base:6,md:10},background:`linear-gradient(145deg, white 55%, ${r.orange[50]} 100%)`,border:"1px solid",borderColor:r.border.secondary,children:e.jsxs(B,{gap:6,align:"stretch",children:[e.jsxs(c,{children:[e.jsxs(l,{fontSize:{base:"3xl",md:"4xl"},fontWeight:"bold",color:r.text.label,mb:2,children:[e.jsxs(l,{as:"span",color:r.orange[500],children:["Review &"," "]}),"Submit"]}),e.jsx(l,{fontSize:"md",color:r.text.gray,children:"Verify all details before submitting your Group Health Insurance application."})]}),u&&e.jsx(g,{icon:e.jsx(p,{as:H,boxSize:5,color:r.orange[500]}),title:"Company Identification",fields:[{label:"Company Name",value:u.name},{label:"CAC Number",value:u.rcNumber},{label:"Industry",value:S(u.details?.classification)},{label:"Status",value:e.jsx(V,{})}]}),e.jsx(g,{icon:e.jsx(p,{as:R,boxSize:5,color:r.orange[500]}),title:"Authorized Representative",fields:[{label:"First Name",value:i.firstName},{label:"Last Name",value:i.lastName},{label:"Phone",value:i.phone},{label:"Email",value:i.email}]}),m&&e.jsx(l,{fontSize:"sm",color:r.error[600],children:m}),e.jsx(F,{justify:"flex-end",children:e.jsx(T,{buttonType:"primary",text:"Submit",size:"lg",type:"button",loading:b,disabled:b,onClick:()=>{E()}})})]})})})};export{ue 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.