PageSourceSearch

https://myka.ng/assets/index-Ckt8e3nH.js

js myka.ng collected 2026-10-09 22:41:36 UTC 211,800 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PlanSelectionPage-HYI-GYkM.js","assets/vendor-react-DfYGAhtm.js","assets/index-DsBgCU7r.js","assets/vendor-icons-1odZwi-b.js","assets/vendor-ui-DA_r9yXk.js","assets/vendor-state-BsBVN-fX.js","assets/vendor-forms-BP-7CbAP.js","assets/index-BuY3nPpA.css","assets/Modal-DS-VW05m.js","assets/LinkPaymentMethodOption-CuZHpNDU.js","assets/routes-rIK6zvx1.js","assets/useFlowDropoff-B2TCwQre.js","assets/ProductAuthGate-BV--HzK8.js","assets/policyDetailFromApi-DMEz0xFY.js","assets/errors-BYKXB8DF.js","assets/ComparePlansFooter-CPpdpWCW.js","assets/PromoCardSkeleton-Dncq1PuK.js","assets/contentfulPreview-UQGJUROZ.js","assets/healthCategoryUi-C2_keODf.js","assets/other-icon-DC1bN4dP.js","assets/savings-BJUwUGln.js","assets/routes-BR5I3bEX.js","assets/annuity-retirement-C1dZ1QHM.js","assets/health-ped-DAki1cTK.js","assets/professional-indemnity-Cx_HID73.js","assets/property-building-content-BPs_xKUv.js","assets/property-business-assets-DHEXMjWx.js","assets/property-home-content-BS-RQEdB.js","assets/savings-specialized-hA4moY7S.js","assets/savings-targeted-goals-BG697KhM.js","assets/constants-UDB7jJ0h.js","assets/useBreakpoint-C_7Gw8n1.js","assets/useMotorVerifyFlow-DJY-GKHO.js","assets/verifyStateConfig-DY_95LNG.js","assets/verification_mark-CJRfnqWz.js","assets/coverageModalQuery-rAl8RmMu.js","assets/KycNinModal-HYhUNMVV.js","assets/NinVerificationPanel-Cl3L-HVS.js","assets/mascot-header-BIwJJ2kn.js","assets/embla-carousel-react.esm-DyMEp6Qu.js","assets/SelectField-B8rkxDSz.js","assets/DropdownPopover-KjBTPKBF.js","assets/travel-D23Ir66-.js","assets/routes-BwXTp1y7.js","assets/routes-sl-sVJBZ.js","assets/routes-CkGlntR3.js","assets/routes-CNOe4p0Z.js","assets/routes-jB7S3MB-.js","assets/routes-UmHx9_5t.js","assets/routes-0SZn-6GV.js","assets/routes-TkfgV80o.js","assets/routes-DM9LZteW.js","assets/routes-D6u-5hjo.js","assets/routes-D-Rb-ubu.js","assets/routes-CkWG0BpN.js","assets/routes-SlierU_8.js","assets/checkoutSessionStore-BRM5sYZN.js","assets/underwriterLogoDisplay-B0FBG3Nn.js","assets/CollapsibleSection-5BGvoOUT.js","assets/paymentReturnUrls-CXEwLwaV.js","assets/walletApi-DyFgHNVA.js","assets/walletMandateApi-Du1GplC_.js","assets/walletMandateSession-B-c6J5GS.js","assets/failed-Dd90HJgP.js","assets/success-C0L8gZxS.js","assets/useAnalytics-HP01GbIH.js","assets/userEmail-9DwyWHBc.js","assets/transactionsApi-CANA4ntQ.js","assets/paymentFrequencyLabels-0Hau-h8R.js","assets/stepBreadcrumbs-FCtSk5Kj.js","assets/StepPageLayout-DdZUweau.js","assets/Checkbox-DwOz6egu.js","assets/PaymentTermsConsentCopy-DOzXQujc.js","assets/EmailVerificationModal-BxNiYJiq.js","assets/usePaymentReadiness-DQ-J6Nqr.js","assets/normalizeBrand-Cr5Qmi7I.js","assets/time-CKDfeoln.js","assets/nin-Bkcssw0H.js","assets/phone-ouFZPfGU.js","assets/nigerianPhone-B1rv0Wc5.js","assets/missedContributionRetry-D0dCo6_S.js","assets/policiesApi-DYBxVdNQ.js","assets/useApiQuery-mQnoCtpJ.js","assets/api-BEJchXjA.js","assets/Tag-CjDhIpKV.js","assets/CarLogo-DqMBPg2N.js","assets/useOpenLoginModalOnAuthRequired-D6y-uK5-.js","assets/cacRegistrationNumber-CQHoH1B4.js","assets/text-D803XGGZ.js","assets/QRCODE-C9WIFLqn.js","assets/valid-11xrBmDj.js","assets/device-DbCxnG1h.js","assets/green_strip-C4meNRuY.js","assets/useUploader-CBNPOY8T.js","assets/fix-webm-duration-DBGubGlL.js","assets/inspectionAnalysis.runtime-CbjBTDqp.js","assets/sseStream-C28FcIBw.js","assets/recording.constants-Cr2cQllO.js","assets/IncidentTypePage-Cg6SL62e.js","assets/fnolAccidentDetailsSchema-J33INL6o.js","assets/FnolIncidentTypeStep-DVnqmQq_.js","assets/AccidentDetailsPage-KgGq6Xge.js","assets/parseFnolIncidentDateTime-CKHWIQeQ.js","assets/FnolAccidentDetailsStep-DvNdoEaO.js","assets/cancelled-Dfzba4Al.js","assets/UploadEvidencePage-BEBkHIUz.js","assets/FnolUploadEvidenceStep-C11SRrEp.js","assets/Police_report-Dz-RURJ2.js","assets/SuccessPage-CKqde2jz.js","assets/FnolSuccessStep-D7T_rD2y.js","assets/AccidentDetailsPage-B_yFZQ48.js","assets/VideoInspectionPage-uzv6K08R.js","assets/LiveVideoInspectionStep-nl3Dla8k.js","assets/VideoUploadedPage-Sb2zu5u4.js","assets/VideoUploadedStep-CpSkj3QY.js","assets/ThirdPartyInfoPage-D_oEEKGz.js","assets/PoliceReportPage-Lf65yDZD.js","assets/PoliceReportStep-BJ2mZ1r4.js","assets/VerifyingInsuranceStep-CsmnSoQg.js","assets/InsuranceVerifiedPage-UuRtHnfh.js","assets/getPolicyClaimEntryPath-DKxxrScc.js","assets/policyProductType-BD61ZnUx.js","assets/transit-insurance-DHaUSpuL.js","assets/fire-BtgY-J44.js","assets/ocrConfig-B-KSx9JM.js","assets/gadgetPostPaymentFlowConfig-ChCU4qBA.js","assets/routes-Dr23NpA-.js","assets/routes-BTwm__Y5.js","assets/routes-alBnq1HL.js","assets/InsuranceVerifiedStep-BpDQ_b4O.js","assets/SelectVehiclePage-BO2agAsq.js","assets/SelectIncidentVehicleStep-Cs1RrX_F.js","assets/AccidentDetailsPage-D9HLncB4.js","assets/VideoInspectionPage-BFyf9XOm.js","assets/VideoUploadedPage-BbBoXCZB.js","assets/ThirdPartyInfoPage-BmYKnr7P.js","assets/PoliceReportPage-DjFIUYxG.js","assets/InsuranceVerifiedPage-C2WIZjvU.js","assets/AccidentDetailsPage-CHg6A80m.js","assets/IncidentTypeStep-BgT0yTkg.js","assets/ReportIncidentPage-BTsBrArP.js","assets/ReportIncidentStep-B4RZyuSc.js","assets/VideoInspectionPage-DQ-QGv82.js","assets/VideoUploadedPage-kfz02EDI.js","assets/IncidentDetailsPage-CXdoqGbG.js","assets/IncidentDetailsStep-PxR7AISK.js","assets/LicenseUploadPage-5wTgb-hM.js","assets/DriverLicenseUploadStep-BacaFbd-.js","assets/PolicyVerifiedPage-CfiqdAra.js","assets/WorkshopsPage-hw8wIsfy.js","assets/WorkshopSelectionStep-EqN6aEYT.js","assets/InspectionDetail
1sPage-0tPOOQO-.js","assets/InspectionDetailsStep-_fUbU5cs.js","assets/AccidentDetailsPage-CgfIDOx9.js","assets/SelectVehiclePage-CfmfvN7b.js","assets/ReportIncidentPage-DBsaw4IY.js","assets/VideoInspectionPage-hSxiFIeV.js","assets/VideoUploadedPage-DNhvHG2L.js","assets/IncidentDetailsPage-CwnLx-DJ.js","assets/LicenseUploadPage-Blb4Ttcb.js","assets/PolicyVerifiedPage-CMQ2HH4W.js","assets/WorkshopsPage-42qROv7u.js","assets/InspectionDetailsPage-7KP9zrhL.js"])))=>i.map(i=>d[i]);
2import{M as pr,a as y}from"./routes-rIK6zvx1.js";import{j as e,r as x,u as de,d as Ss,N as Ce,p as je,h as Cs,k as yt}from"./vendor-react-DfYGAhtm.js";import{m as n,g as N,C as mr,e as ve,D as Ps,d as ut,G as se,R as kt,I as ws,x as J,t as O,B as ne,J as Ts,y as pt,K as Is,P as hr,L as As,N as Rs,O as ks,Q as Vs,T as Es,U as Ns,V as _s,W as Ds,X as Ls,b as Ms,Y as Vt,Z as Et,$ as Ue,a0 as zs,a1 as Fs,a as Bs,a2 as Ws,a3 as Os,a4 as Us,z as F,_ as B}from"./index-DsBgCU7r.js";import{u as Hs}from"./useFlowDropoff-B2TCwQre.js";import{P as Ys}from"./ProductAuthGate-BV--HzK8.js";import{u as Gs,a as qs,b as Qs,f as xr,c as Xs,d as gr,i as br,r as $s,o as Ks,e as Js,g as Zs,h as en,j as tn,k as rn}from"./policyDetailFromApi-DMEz0xFY.js";import{A as ft,g as te}from"./errors-BYKXB8DF.js";import"./LinkPaymentMethodOption-CuZHpNDU.js";import{F as sn,G as nn,J as on,K as an,N as ln,m as cn,O as yr,f as dn,A as un,a as fr,P as jr,Q as pn,S as mn,T as hn,U as vr,V as Sr,y as Cr,W as xn,c as gn,d as Pr,X as bn,Y as yn,Z as fn,_ as jn,$ as wr,a0 as vn,a1 as Sn,a2 as Cn,a3 as Pn,a4 as wn,a5 as Tr,a6 as Ir,a7 as Ar,a8 as Rr,D as kr,a9 as Vr,z as Er,aa as Tn,q as In,ab as An,ac as Rn,ad as kn,ae as Vn,p as En,af as Nn}from"./vendor-icons-1odZwi-b.js";import{C as _n}from"./ComparePlansFooter-CPpdpWCW.js";import"./healthCategoryUi-C2_keODf.js";import"./constants-UDB7jJ0h.js";import{S as qe}from"./SelectField-B8rkxDSz.js";import"./verifyStateConfig-DY_95LNG.js";import"./travel-D23Ir66-.js";import{c as Dn}from"./checkoutSessionStore-BRM5sYZN.js";import{c as Ln}from"./PromoCardSkeleton-Dncq1PuK.js";import{a as u,T as l,F as w,n as He,H as z,V as v,o as ue,w as ye,v as W,i as xe,y as Mn,S as Nt,G as fe,z as Ye,E as zn,m as ot,I as it,k as Fn,J as Bn,K as Wn,M as On,s as Se}from"./vendor-ui-DA_r9yXk.js";import{g as Nr}from"./underwriterLogoDisplay-B0FBG3Nn.js";import{M as Ie}from"./Modal-DS-VW05m.js";import{u as _r}from"./useBreakpoint-C_7Gw8n1.js";import{C as Dr}from"./CollapsibleSection-5BGvoOUT.js";import{f as he,b as Un,u as Hn,a as Yn,D as Gn,P as qn,c as Qn}from"./paymentReturnUrls-CXEwLwaV.js";import{P as Lr,a as Xn,g as $n,b as Kn,c as _t}from"./paymentFrequencyLabels-0Hau-h8R.js";import{g as Jn}from"./stepBreadcrumbs-FCtSk5Kj.js";import{S as ee}from"./StepPageLayout-DdZUweau.js";import{C as Yt}from"./Checkbox-DwOz6egu.js";import{P as Gt,a as Zn,g as eo,c as Mr,r as to,u as ro}from"./PaymentTermsConsentCopy-DOzXQujc.js";import{E as zr}from"./EmailVerificationModal-BxNiYJiq.js";import{u as so,L as no}from"./usePaymentReadiness-DQ-J6Nqr.js";import{g as mt,h as Pe,f as oo}from"./vendor-state-BsBVN-fX.js";import{u as Qe}from"./useAnalytics-HP01GbIH.js";import{s as Dt}from"./success-C0L8gZxS.js";import{n as io}from"./normalizeBrand-Cr5Qmi7I.js";import{b as we,C as Q,o as Xe,s as X,c as ht,d as at,a as ao,e as lo,n as co,f as uo,g as po,h as mo,i as ho}from"./vendor-forms-BP-7CbAP.js";import{p as xo,f as go}from"./time-CKDfeoln.js";import{i as bo}from"./nin-Bkcssw0H.js";import{i as yo}from"./phone-ouFZPfGU.js";import{f as fo}from"./failed-Dd90HJgP.js";import{n as jo}from"./useMotorVerifyFlow-DJY-GKHO.js";import"./missedContributionRetry-D0dCo6_S.js";import{u as Fr}from"./policiesApi-DYBxVdNQ.js";import{T as lt}from"./Tag-CjDhIpKV.js";import{C as Lt,g as vo,c as So}from"./CarLogo-DqMBPg2N.js";import{u as Co}from"./useOpenLoginModalOnAuthRequired-D6y-uK5-.js";import{C as Po,b as wo}from"./cacRegistrationNumber-CQHoH1B4.js";import{f as To}from"./text-D803XGGZ.js";import{q as Io}from"./QRCODE-C9WIFLqn.js";import{N as Ao}from"./NinVerificationPanel-Cl3L-HVS.js";import{v as Ro}from"./valid-11xrBmDj.js";import{v as ko}from"./verification_mark-CJRfnqWz.js";import{h as Vo}from"./userEmail-9DwyWHBc.js";import{i as Br}from"./device-DbCxnG1h.js";import{g as Eo}from"./green_strip-C4meNRuY.js";import{u as No}
2from"./useUploader-CBNPOY8T.js";import{f as _o}from"./fix-webm-duration-DBGubGlL.js";import{i as Do}from"./inspectionAnalysis.runtime-CbjBTDqp.js";import{R as Lo}from"./recording.constants-Cr2cQllO.js";const Mo=({value:t,size:r=160,thickness:s=10,color:o=n.orange[500],trackColor:i=n.gray[200],showLabel:a=!0})=>{const d=Math.min(Math.max(t,0),100),c=(r-s)/2,p=2*Math.PI*c,h=p-d/100*p,b=r/2;return e.jsxs(u,{position:"relative",display:"inline-flex",w:`${r}px`,h:`${r}px`,children:[e.jsxs("svg",{width:r,height:r,children:[e.jsx("circle",{cx:b,cy:b,r:c,fill:"none",stroke:i,strokeWidth:s}),e.jsx("circle",{cx:b,cy:b,r:c,fill:"none",stroke:o,strokeWidth:s,strokeLinecap:"round",strokeDasharray:p,strokeDashoffset:h,transform:`rotate(-90 ${b} ${b})`,style:{transition:"stroke-dashoffset 0.4s ease"}})]}),a&&e.jsx(u,{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",children:e.jsxs(l,{fontSize:"2xl",fontWeight:"bold",color:n.navy[500],children:[Math.round(d),"%"]})})]})},xt=t=>t.motorVehicleInfo.vehicleInfoForm;let Je=null;const zo=()=>typeof window>"u"||window.YT?.Player?Promise.resolve():Je||(Je=new Promise(t=>{const r=window.onYouTubeIframeAPIReady;if(window.onYouTubeIframeAPIReady=()=>{r?.(),t()},document.querySelector('script[src="https://www.youtube.com/iframe_api"]'))return;const o=document.createElement("script");o.src="https://www.youtube.com/iframe_api",o.async=!0,document.body.appendChild(o)}),Je),qt=t=>{if(!Number.isFinite(t)||t<0)return"0:00";const r=Math.floor(t/60),s=Math.floor(t%60);return`${r}:${String(s).padStart(2,"0")}`},Fo="52px",Bo=({videoId:t,title:r,autoPlay:s=!0,aspectRatio:o="16 / 9",borderRadius:i="2xl"})=>{const d=`youtube-player-${x.useId().replace(/:/g,"")}`,c=x.useRef(null),p=x.useRef(null),h=x.useRef(null),[b,m]=x.useState(!1),[g,f]=x.useState(!1),[j,P]=x.useState(!1),[T,S]=x.useState(0),[k,_]=x.useState(0),L=x.useCallback(()=>{h.current!=null&&(cancelAnimationFrame(h.current),h.current=null)},[]),I=x.useCallback(()=>{L();const V=()=>{const A=p.current;A&&(S(A.getCurrentTime()||0),_(A.getDuration()||0),h.current=requestAnimationFrame(V))};h.current=requestAnimationFrame(V)},[L]);x.useEffect(()=>{let V=!1;return(async()=>{await zo(),!(V||!window.YT?.Player)&&(p.current=new window.YT.Player(d,{videoId:t,width:"100%",height:"100%",playerVars:{autoplay:s?1:0,mute:0,controls:0,disablekb:1,fs:0,modestbranding:1,rel:0,iv_load_policy:3,playsinline:1,cc_load_policy:0},events:{onReady:E=>{if(V)return;E.target.unMute(),s&&E.target.playVideo(),m(!0),P(!1),_(E.target.getDuration()||0);const C=c.current?.querySelector("iframe");C&&(C.style.border="0",C.style.width="100%",C.style.height="100%",C.style.display="block"),I()},onStateChange:E=>{if(V||!window.YT)return;const C=E.data===window.YT.PlayerState.PLAYING;f(C),C?I():L()}}}))})(),()=>{V=!0,L(),p.current?.destroy(),p.current=null}},[s,d,I,L,t]);const D=()=>{const V=p.current;!V||!b||(g?V.pauseVideo():V.playVideo())},M=()=>{const V=p.current;!V||!b||(V.isMuted()?(V.unMute(),P(!1)):(V.mute(),P(!0)))},U=V=>{const A=p.current;!A||!b||(A.seekTo(V,!0),S(V))},q=()=>{const V=c.current;if(V){if(document.fullscreenElement){document.exitFullscreen();return}V.requestFullscreen?.()}};return e.jsxs(u,{ref:c,as:"section","aria-label":r,w:"100%",h:"100%",borderRadius:i,overflow:"hidden",bg:n.gray[100],aspectRatio:o,position:"relative",children:[e.jsx(u,{id:d,position:"absolute",inset:0,w:"100%",h:"100%"}),e.jsx(u,{position:"absolute",inset:0,bottom:Fo,onClick:D,cursor:"pointer",zIndex:1}),e.jsxs(w,{position:"absolute",left:0,right:0,bottom:0,zIndex:2,align:"center",gap:2,px:3,py:2.5,bg:"linear-gradient(transparent, rgba(0,0,0,0.72))",children:[e.jsx(He,{"aria-label":g?"Pause":"Play",size:"sm",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200"},onClick:D,disabled:!b,children:g?e.jsx(sn,{size:20}):e.jsx(nn,{size:20})}),e.jsx(l,{fontSize:"xs",color:"white",minW:"34px",children:qt(T)}),e.jsx(u,{flex:1,minW:0,children:e.jsx("input",{"aria-label":"Seek",type:"range",min:0,max:k||0,step:.1,value:T,disabled:!b||k<=0,onChange:V=>U(Number(V.target.value)),style:{width:"100%",accentColor:n.orange[500],cursor:"pointer"}})}),e.jsx(l,{fontSize:"xs",color:"white",minW:"34px",textAlign:"right",children:qt(k)}),e.jsxs(z,{gap:0,children:[e.jsx(He,{"aria-label":j?"Unmute":"Mute",size:"sm",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200"},onClick:M,disabled:!b,children:j?e.jsx(on,{size:18}):e.jsx(an,{size:18})}),e.jsx(He,{"aria-label":"Fullscreen",size:"sm",variant:"ghost",color:"white",_hover:{bg:"whiteAlpha.200"},onClick:q,children:e.jsx(ln,{size:18})})]})]})]})},Wo=1900,Oo=(t=new Date)=>t.getFullYear()+1,Wr=t=>{if(!t||t.trim().length===0)return"Year of manufacture is required";if(!/^\d{4}$/.test(t))return"Enter a valid 4-digit year";const r=Number(t);if(r<Wo)return"Enter a valid year";
2const s=Oo();return r>s?`Year cannot exceed ${s}`:!0},Uo="/assets/complete-payment-card-DgzZE_FM.png",Ho=t=>{const r=t.trim();return r===""||r==="—"||r==="-"},Yo=({rows:t})=>{const r=t.filter(s=>!Ho(s.value));return r.length===0?null:e.jsx(u,{bg:"white",border:"1px solid",borderColor:"rgba(0,0,0,0.06)",borderRadius:"20px",p:{base:5,md:"25px"},children:e.jsx(v,{gap:0,align:"stretch",children:r.map((s,o)=>e.jsxs(z,{justify:"space-between",py:3,...o<r.length-1&&{borderBottom:"1px solid",borderColor:"rgba(0,0,0,0.04)"},children:[e.jsx(l,{fontSize:"sm",color:n.text.primary,children:s.label}),e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:s.valueColor??n.text.label,children:s.value})]},s.label))})})},Go=({disclosures:t})=>t.length===0?null:e.jsxs(u,{bg:"white",border:"1px solid",borderColor:"rgba(0,0,0,0.06)",borderRadius:"16px",p:{base:4,md:5},children:[e.jsxs(z,{gap:2,mb:3,children:[e.jsx(cn,{color:n.orange[500],size:16}),e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.orange[500],children:"Important Disclosures"})]}),e.jsx(v,{gap:2,align:"stretch",children:t.map(r=>e.jsxs(z,{gap:2,align:"flex-start",children:[e.jsx(u,{mt:2,w:"6px",h:"6px",borderRadius:"full",bg:n.orange[500],flexShrink:0}),e.jsxs(l,{fontSize:"13px",color:n.text.primary,lineHeight:"20px",children:[e.jsxs(l,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",r.text]})]},r.label))})]}),Or="/assets/card-edu-BrQjTfKf.jpeg",Ze={width:"107.78%",height:"362.85%",left:"-3.89%",top:"-96.22%"},qo=({planLabel:t,vehicleLabel:r,premiumLabel:s,premiumDisplay:o})=>e.jsxs(u,{borderRadius:"24px",p:8,position:"relative",overflow:"hidden",w:"100%",children:[e.jsxs(u,{"aria-hidden":!0,position:"absolute",inset:0,pointerEvents:"none",borderRadius:"24px",children:[e.jsx(u,{position:"absolute",inset:0,overflow:"hidden",borderRadius:"24px",children:e.jsx(ue,{src:Or,alt:"",position:"absolute",maxW:"none",w:Ze.width,h:Ze.height,left:Ze.left,top:Ze.top})}),e.jsx(u,{position:"absolute",inset:0,bg:"rgba(31, 54, 95, 0.6)",borderRadius:"24px"})]}),e.jsxs(v,{gap:0,align:"stretch",position:"relative",zIndex:1,children:[e.jsx(l,{fontSize:"10px",letterSpacing:"0.5px",textTransform:"uppercase",color:"rgba(255, 255, 255, 0.5)",lineHeight:"15px",children:"Selected Plan"}),e.jsx(l,{fontSize:"22px",fontWeight:"600",color:"white",letterSpacing:"-0.5px",lineHeight:"33px",pt:"4px",children:t}),e.jsxs(z,{gap:4,align:"center",pt:"4px",flexWrap:"wrap",children:[e.jsx(l,{fontSize:"13px",color:"rgba(255, 255, 255, 0.7)",lineHeight:"19.5px",children:r}),e.jsxs(l,{fontSize:"13px",color:"rgba(255, 255, 255, 0.7)",lineHeight:"19.5px",children:[s,":"," ",e.jsx(l,{as:"span",fontWeight:"semibold",color:"white",children:o})]})]})]})]}),Qo=({summary:t,detailRows:r,disclosures:s,totalDueDisplay:o,termsAccepted:i,onTermsAcceptedChange:a,autoRenew:d,onAutoRenewChange:c,onProceed:p,isProceedDisabled:h=!1,requiresDebitConsent:b=!1,paymentIncompleteNotice:m})=>{const g=Mr({termsAccepted:i,debitConsent:d,requiresDebitConsent:b});return e.jsx(u,{w:"100%",bg:"white",border:"2px solid",borderColor:"rgba(46, 74, 123, 0.09)",borderRadius:{base:"32px",md:"61px"},px:{base:5,md:8},pt:{base:6,md:"52px"},pb:{base:6,md:10},overflow:"hidden",children:e.jsxs(v,{gap:0,align:"stretch",w:"100%",children:[e.jsxs(v,{gap:0,align:"center",mb:6,textAlign:"center",children:[e.jsx(ue,{src:Uo,alt:"",w:"46px",h:"43px",objectFit:"contain",mb:4}),e.jsx(l,{fontSize:"28px",fontWeight:"600",color:n.text.label,letterSpacing:"-1.5px",lineHeight:"42px",children:"Complete Payment"}),e.jsx(l,{fontSize:"sm",color:n.gray[400],mt:1,children:"See the payment details below"})]}),m?e.jsx(u,{borderWidth:"1px",borderColor:"orange.300",bg:"orange.50",borderRadius:"md",px:4,py:3,mb:4,children:e.jsx(l,{fontSize:"sm",color:"gray.800",children:m})}):null,e.jsx(qo,{...t}),e.jsx(u,{mt:6,children:e.jsx(Yo,{rows:r})}),s.length>0?e.jsx(u,{mt:4,children:e.jsx(Go,{disclosures:s})}):null,e.jsxs(z,{justify:"space-between",align:"center",bg:"white",border:"1px solid",borderColor:"rgba(0,0,0,0.06)",borderRadius:"16px",px:5,py:5,mt:4,children:[e.jsx(l,{fontSize:"md",fontWeight:"semibold",color:n.text.label,children:"Total Premium Due"}),e.jsx(l,{fontSize:"24px",fontWeight:"bold",color:n.orange[500],letterSpacing:"-0.5px",lineHeight:"36px",children:o})]}),b?e.jsxs(z,{gap:3,align:"flex-start",bg:"white",border:"1px solid",borderColor:"rgba(0,0,0,0.06)",borderRadius:"14px",px:4,py:4,mt:4,cursor:"pointer",role:"checkbox","aria-checked":d,"aria-label":Gt,tabIndex:0,onClick:()=>c(!d),onKeyDown:f=>{(f.key===" "||f.key==="Enter")&&(f.preventDefault(),c(!d))},children:[e.jsx(u,{flexShrink:0,pt:"2px",pointerEvents:"none",children:e.jsx(Yt,{checked:d})}),e.jsx(l,{fontSize:"13px",color:n.text.primary,lineHeight:"20px",children:Gt})]}):null,e.jsxs(z,{gap:3,align:"flex-start",bg:"white",border:"1px solid",borderColor:"rgba(0,0,0,0.06)",borderRadius:"14px",px:4,py:4,mt:4,cursor:"pointer",role:"checkbox","aria-checked":i,"aria-label":eo(b),tabIndex:0,onClick:f=>{f.target.closest("a")||a(!i)},onKeyDown:f=>{f.target===f.currentTarget&&(f.key===" "||f.key==="Enter")&&(f.preventDefault(),a(!i))},children:[e.jsx(u,{flexShrink:0,pt:"2px",pointerEvents:"none",children:e.jsx(Yt,{checked:i})}),e.jsx(l,{fontSize:"13px",color:n.text.primary,lineHeight:"20px",children:e.jsx(Zn,{instalment:b})})]}),e.jsx(u,{mt:6,children:e.jsx(N,{buttonType:"primary",size:"lg",text:"Select payment method",fullWidth:!0,disabled:!g||h,onClick:p})})]})})},Xo=({frequency:t,amountDisplay:r,isSelected:s,onSelect:o})=>e.jsx(u,{role:"radio","aria-checked":s,tabIndex:0,cursor:"pointer",onClick:()=>o(t),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),o(t))},bg:s?"#FFF9F6":"white",border:"1px solid",borderColor:s?"rgba(228,105,33,0.22)":"transparent",borderRadius:"16px",px:4,py:3.5,boxShadow:s?"0px 1px 2px rgba(0,0,0,0.06)":void 0,transition:"border-color 0.15s ease, background-color 0.15s ease",_hover:{borderColor:n.orange[300]},children:e.jsxs(z,{justify:"space-between",children:[e.jsxs(z,{gap:3,children:[e.jsx(u,{w:"20px",h:"20px",borderRadius:"full",border:"1.5px solid",borderColor:s?n.orange[500]:n.gray[300],display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:s&&e.jsx(u,{w:"10px",h:"10px",borderRadius:"full",bg:n.orange[500]})}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.primary,children:Lr[t]})]}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.primary,children:r})]})}),et={width:"107.78%",height:"362.85%",left:"-3.89%",top:"-96.22%"},$o=({grossPremium:t,frequencies:r,summaryItems:s,isSubmitting:o=!1,onContinue:i})=>{const[a,d]=x.useState("ANNUAL");
2return e.jsx(u,{w:"100%",bg:"white",border:"2px solid",borderColor:"rgba(46, 74, 123, 0.09)",borderRadius:{base:"32px",md:"61px"},px:{base:5,md:8},pt:{base:6,md:"52px"},pb:{base:6,md:10},overflow:"hidden",children:e.jsxs(v,{gap:0,align:"stretch",w:"100%",children:[e.jsxs(v,{gap:0,align:"start",mb:8,children:[e.jsxs(l,{fontSize:"32px",fontWeight:"600",color:"#868D9B",letterSpacing:"-1px",lineHeight:"1.15",children:["Your"," ",e.jsx(l,{as:"span",color:n.orange[500],children:"Premium Quote"})]}),e.jsx(l,{fontSize:"sm",color:n.gray[400],mt:1,children:"Review your estimated premium based on vehicle details"})]}),e.jsxs(u,{borderRadius:"24px",p:{base:4,md:8},position:"relative",overflow:"hidden",children:[e.jsxs(u,{"aria-hidden":!0,position:"absolute",inset:0,pointerEvents:"none",borderRadius:"24px",children:[e.jsx(u,{position:"absolute",inset:0,overflow:"hidden",borderRadius:"24px",children:e.jsx(ue,{src:Or,alt:"",position:"absolute",maxW:"none",w:et.width,h:et.height,left:et.left,top:et.top})}),e.jsx(u,{position:"absolute",inset:0,bg:"rgba(31, 54, 95, 0.6)",borderRadius:"24px"})]}),e.jsxs(u,{position:"relative",zIndex:1,children:[e.jsx(l,{fontSize:"13px",lineHeight:"19.5px",color:"rgba(255, 255, 255, 0.5)",children:"Annual Premium"}),e.jsxs(l,{fontSize:{base:"32px",md:"48px"},fontWeight:"700",color:"white",letterSpacing:{base:"-1px",md:"-2px"},lineHeight:{base:"44px",md:"72px"},pt:"4px",children:[he(t),e.jsx(l,{as:"span",fontSize:{base:"14px",md:"18px"},fontWeight:"400",lineHeight:{base:"21px",md:"27px"},children:"/yr"})]}),s&&s.length>0&&e.jsx(ye,{columns:2,gapX:{base:3,md:"21px"},gapY:{base:4,md:"21px"},mt:{base:4,md:6},children:s.map(c=>e.jsxs(u,{minW:0,children:[e.jsx(l,{fontSize:{base:"12px",md:"14px"},lineHeight:{base:"18px",md:"21px"},color:"rgba(255, 255, 255, 0.4)",children:c.label}),e.jsx(l,{fontSize:{base:"14px",md:"18px"},fontWeight:"500",color:"white",lineHeight:{base:"20px",md:"27px"},mt:"5px",overflowWrap:"break-word",wordBreak:"normal",children:c.value})]},c.label))})]})]}),e.jsxs(u,{bg:"#F3F8FF",border:"1px solid",borderColor:"rgba(228,105,33,0.15)",borderRadius:"20px",p:{base:4,md:"25px"},mt:4,children:[e.jsx(l,{fontSize:"16px",fontWeight:"600",color:n.text.primary,mb:3,children:"How would you like to pay?"}),e.jsx(v,{gap:2,align:"stretch",children:Xn.map(c=>e.jsx(Xo,{frequency:c,amountDisplay:he(r[c]),isSelected:a===c,onSelect:d},c))})]}),e.jsx(u,{mt:8,children:e.jsx(N,{buttonType:"primary",size:"lg",text:"Continue",fullWidth:!0,loading:o,disabled:o,onClick:()=>i(a)})})]})})},Ko=async t=>(await ve.post("/api/v1/compliance/vehicle",t)).data,Jo=async t=>(await ve.post("/api/v1/compliance/business",t)).data,Zo=async t=>(await ve.post("/api/v1/compliance/kyc/",t)).data,ei=async t=>(await ve.post("/api/v1/compliance/vehicle",t)).data,ti=async t=>{const r=new FormData;return r.append("file",t),(await ve.post("/api/v1/compliance/vehicle/image",r,{headers:{"Content-Type":"multipart/form-data"}})).data},ri=()=>{const{mutateAsync:t,isPending:r}=Pe({mutationKey:["motor","compliance","vin"],mutationFn:ei});return{verifyVinAsync:t,isLoading:r}},si=()=>{const{mutateAsync:t,isPending:r}=Pe({mutationKey:["motor","compliance","vin-image"],mutationFn:ti});return{verifyVinByImageAsync:t,isLoading:r}},ni=()=>{const{mutate:t,mutateAsync:r,isPending:s,isError:o,error:i,isSuccess:a,data:d}=Pe({mutationKey:["motor","compliance","vehicle"],mutationFn:Ko});return{verifyVehicle:t,verifyVehicleAsync:r,isLoading:s,isError:o,error:i,isSuccess:a,data:d}},oi=()=>{const t=mt(),{mutate:r,mutateAsync:s,isPending:o,isError:i,error:a,isSuccess:d,data:c}=Pe({mutationKey:["motor","compliance","business"],mutationFn:Jo,onSuccess:()=>{t.invalidateQueries({queryKey:mr})}});return{verifyBusiness:r,verifyBusinessAsync:s,isLoading:o,isError:i,error:a,isSuccess:d,data:c}},ii=()=>{const t=mt(),{mutate:r,mutateAsync:s,isPending:o,isError:i,error:a,isSuccess:d,data:c}=Pe({mutationKey:["motor","compliance","kyc"],mutationFn:Zo,onSuccess:()=>{t.invalidateQueries({queryKey:mr})}});return{verifyKyc:r,verifyKycAsync:s,isLoading:o,isError:i,error:a,isSuccess:d,data:c}},ai="/api/v1/motor-policy/add-vehicle",li=async t=>(await ve.post(ai,t)).data,ci=()=>{const{mutate:t,mutateAsync:r,isPending:s,isError:o,error:i}=Pe({mutationKey:["motor","policy","add-vehicle"],mutationFn:li});return{addManualVehicle:t,addManualVehicleAsync:r,isLoading:s,isError:o,error:i}},di=async({policyId:t,body:r})=>(await ve.post(`/api/v1/motor-policy/${t}/document/reference`,r)).data,ui=()=>{const t=mt(),{mutateAsync:r,isPending:s,isError:o,error:i}=Pe({mutationKey:["motor","policy","document","reference"],mutationFn:di,onSuccess:(a,d)=>{t.invalidateQueries({queryKey:["policy",d.policyId]})}});return{saveMotorDocumentReferenceAsync:r,isSavingDocumentReference:s,isError:o,error:i}},pi=async t=>(await ve.get(`/api/v1/motor-policy/${t}/payment-frequencies/`)).data,mi=t=>{const{data:r,isPending:s,isError:o,error:i,refetch:a}=oo({queryKey:["motor","policy",t,"payment-frequencies"],queryFn:()=>pi(t),enabled:!!t});return{paymentFrequencies:r?.data,isLoading:!!t&&s,isError:o,error:i,refetch:a}},hi=async({policyId:t,payload:r})=>(await ve.patch(`/api/v1/motor-policy/${t}/payment-frequencies/`,r)).data,Ur=()=>{const{mutate:t,isPending:r,isError:s,error:o}=Pe({mutationKey:["motor","policy","payment-frequencies","save"],mutationFn:hi});return{savePaymentFrequency:t,isLoading:r,isError:s,error:o}},xi=({children:t})=>e.jsx(e.Fragment,{children:t}),gi=t=>{if(!t||typeof t!="object")return!1;const r=t;return typeof r.policyId=="string"&&r.policyId.trim()!==""&&r.quoteData!=null&&typeof r.quoteData=="object"&&typeof r.savedAt=="number"},bi=Dn({key:"myka.motor.completePayment.checkout",isValid:gi}),{save:yi,load:fi,clear:Hr}=bi,ji=({termsAccepted:t,autoRenew:r})=>({...t?{consent:!0}:{},...r?{debitConsent:!0}:{}});function $e(t){return t!==void 0&&"quoteReference"in t}const vi=t=>{if(t==null||typeof t!="object")return!1;const r=t;
2return typeof r.name=="string"&&typeof r.description=="string"},Qt=t=>Array.isArray(t)?t.map(r=>vi(r)?{name:r.name.trim()||"Coverage item",description:r.description.trim()||"—"}:null).filter(r=>r!=null):[],Yr=t=>{if(t==null)return[];if(Array.isArray(t)){const r=Qt(t);return r.length===0?[]:[{title:"Coverage",items:r}]}if(typeof t=="object"){const r=[];for(const[s,o]of Object.entries(t)){const i=Qt(o);if(i.length===0)continue;const a=s.trim()||"Coverage";r.push({title:a,items:i})}return r}return[]};function Si(t,r,s){const o=t.registrationNumber?.trim()||"—",i=[t.brand,t.model].filter(Boolean).join(" ").trim()||t.model||"—";return{id:t.registrationNumber?.trim()||`vehicle-${s}`,brand:t.brand?.trim()||"—",plate:o,model:i,coverageType:r,category:t.vehicleType?.trim()||"—",color:t.color?.trim()||"—",yearOfManufacture:t.year?.trim()||"—",chassisOrId:t.chassisNumber?.trim()||"—",bodyColor:t.color?.trim()||"—",usageClass:t.vehicleType?.trim()||"—"}}function Ci(t,r){return{id:t.id,brand:t.make,plate:t.plateNumber,model:`${t.make} ${t.model}`.trim(),coverageType:r,category:t.category,color:t.color,yearOfManufacture:t.year??"",chassisOrId:t.chassisNumber,bodyColor:t.color,usageClass:t.category}}function Pi(t){return{id:"unknown",brand:"—",plate:"—",model:"Vehicle details unavailable",coverageType:t,category:"—",color:"—",yearOfManufacture:"—",chassisOrId:"—",bodyColor:"—",usageClass:"—"}}function Gr(t){return $e(t)?t.quoteReference:t.quoteId}const wi=(t,r)=>{const s=Yr(r),o=s.flatMap(c=>c.items),i=o.map(c=>c.name).join(" · "),a=s.length>0?{coverageGroups:s,...o.length>0&&{coverageLines:o}}:o.length>0?{coverageLines:o}:{};if($e(t))return{name:t.underwriterProductName,description:i,planType:t.underwriter,policyId:t.quoteReference,...a};const d=t;return{name:d.productName,description:i,planType:d.underwriter,policyId:d.quoteId,...a}},Ti="We could not start payment. Please try again.",Ii=({config:t,policyId:r,quoteData:s,origin:o})=>{if(!t.routes.download)return;const i=Gr(s),a=`/${t.routes.completePayment}`;return Un({origin:o,policyId:r,successPath:`/${t.routes.download}`,failedPath:a,...i?{extraSuccessParams:{quoteId:i}}:{}})},Ai=({config:t,policyId:r,quoteData:s,paymentRedirectUrls:o})=>{const i=s?Gr(s):void 0;if(r&&t.routes.policyActivation){const a=new URLSearchParams({policyId:r,...i?{quoteId:i}:{}});return`/${t.routes.policyActivation}?${a.toString()}`}if(o){const a=new URL(o.successUrl);return`${a.pathname}${a.search}`}return null},Ri=t=>{const r=t??{};return{quoteData:r.quoteData,policyId:r.policyId,paymentOption:r.paymentOption,planDuration:r.planDuration}},qr=t=>{if(!$e(t))return t.vehicle},ki=({quoteData:t,formVehicle:r,coverageLabel:s})=>{const o=qr(t);
2if(o){const i=[o.make,o.model,o.year].filter(Boolean).join(" ");if(i)return i}if(r){const i=[r.brand,r.model,r.year].filter(Boolean).join(" ");if(i)return i}return s},Vi=({quoteData:t,coverageLabel:r})=>{if($e(t)){if(t.underwriterProductName)return t.underwriterProductName}else{const s=t.productName;if(s)return s}return`${r} Motor`},Ei=({quoteData:t,paymentOption:r,coverageLabel:s,displayName:o,formVehicle:i})=>{const a=r?.frequency??"ANNUAL",c=qr(t)?.purchaseValue??i?.sumInsured,p=c?he(c):"—",h=Number(r?r.frequencies[r.frequency]:t.premium??0),b=he(h);return{planLabel:Vi({quoteData:t,coverageLabel:s}),vehicleLabel:ki({quoteData:t,coverageLabel:s,...i?{formVehicle:i}:{}}),premiumLabel:$n(a),premiumDisplay:b,totalDueDisplay:b,amountDue:h,detailRows:[{label:"Name",value:o||"—"},{label:"Vehicle Value",value:p},{label:"Coverage amount",value:he(t.premium),valueColor:n.success[700]},{label:"Frequency",value:Lr[a]},{label:"Underwriter",value:t.underwriter||"—"}],disclosures:a==="ANNUAL"?[]:[{label:"Installment Rules",text:"Unpaid premium balances are deducted from any claim payout."},{label:"Sum Insured",text:`Capped at your provided asset value (${p}).`}]}},Ni="/assets/badge-B-VqV_TE.webp",_i="/assets/badge_star-Dl1XIqha.svg",Mt=`/${Ps.Overview}`,Xt=[{value:"all",label:"All Prices"},{value:"under-10k",label:"Under ₦10,000",min:0,max:9999},{value:"10k-15k",label:"₦10,000 - ₦15,000",min:1e4,max:15e3},{value:"15k-20k",label:"₦15,000 - ₦20,000",min:15e3,max:2e4},{value:"20k-30k",label:"₦20,000 - ₦30,000",min:2e4,max:3e4},{value:"over-30k",label:"Over ₦30,000",min:3e4}],su=[{planType:"third_party",title:"Third-Party",icon:Ni,benefits:[{label:"Legal Compliance",description:"Required by Nigerian law to stay on the road."},{label:"Liability Cover",description:"Repairs to other driver's cars or medical bills."},{label:"Zero Own-Damage Cover",description:"Note: There is no protection for your own car."}]},{planType:"third-party-plus",title:"Advanced",icon:Ln,benefits:[{label:"Liability Cover",description:"Fixes the other driver's car and covers their medical bills."},{label:"Limited Own-Car Protection",description:"Provides capped financial support for specific damages to your own vehicle."},{label:"Smart Upgrade",description:"More theft, accident or fire protection than standard third-party, without the comprehensive price tag."}]},{planType:"comprehensive",title:"Comprehensive",icon:_i,iconSize:"80px",benefits:[{label:"Full Accident Repair",description:"Fixes your car after a crash, even if it's your fault."},{label:"Total Risk Protection",description:"Covers theft, fire, floods, and even civil riots."},{label:"All-Inclusive Benefits",description:"Includes every benefit in the Third Party plans."}]}],Di=t=>{if(t==null||typeof t!="object")return!1;const r=t;return typeof r.id=="string"&&r.id.trim()!==""},Li=t=>{const r=t.documents;return!Array.isArray(r)||r.length===0?!1:r.some(Di)},Qr="manualVehicleContext",Mi=t=>{const r=t?.[Qr];if(!(!r||typeof r!="object")&&!(r.origin!=="plate"&&r.origin!=="vin"))return r},Xr=t=>({[Qr]:t}),zi=(t,r)=>{const s=r?.trim();return s?{[t]:s}:{}},Fi=({form:t,context:r})=>{const s=(t.plateNumber||r.plateNumber||"").trim().toUpperCase();if(!s)throw new ft("A plate number is required to register this vehicle.");const o=(t.chassisNumber||r.chassisNumber||"").trim().toUpperCase();if(!o)throw new ft("A VIN / chassis number is required to register this vehicle.");const i=t.year.trim();if(!i)throw new ft("Please select the year your vehicle was made.");const a=t.vehicleType||r.vehicleType;return{plateNumber:s,type:a,make:t.make.trim(),model:t.model.trim(),chassisNumber:o,category:a,year:i,engineNumber:t.engineNumber.trim().toUpperCase(),...zi("sumInsured",t.sumInsured)}},Bi=t=>{const{data:r}=t;return Array.isArray(r)?r[0]??{}:r&&typeof r=="object"?r:t},Wi=({response:t,request:r})=>{const s=Bi(t);if(!s.id)return null;const o=new Date().toISOString();return{id:s.id,plateNumber:s.plateNumber??r.plateNumber,purchaseValue:s.purchaseValue??r.sumInsured??"",status:"VERIFIED",isVerified:!0,make:s.make??r.make,model:s.model??r.model,chassisNumber:s.chassisNumber??r.chassisNumber,category:s.category??r.category??r.type,year:s.year??r.
2year,marketValue:s.marketValue??r.sumInsured??null,provider:s.provider??"MANUAL",reference:s.reference??s.id,firstname:s.firstname??null,lastname:s.lastname??null,createdAt:s.createdAt??o,updatedAt:s.updatedAt??o}},nu=(t,r)=>{const s=pr[t],o=`${r}/${s}`;return t==="third_party"&&r==="personal"?`${o}/plate-verify`:t==="third_party"&&r==="business"?`${o}/plate-verify`:t==="comprehensive"&&r==="personal"?`${o}/plate-verify`:t==="comprehensive"&&r==="business"?`${o}/plate-verify`:t==="third-party-plus"&&r==="personal"?"personal/third-party-plus/plate-verify":t==="third-party-plus"&&r==="business"?"business/third-party-plus/plate-verify":o},ou=(t,r)=>{const s=pr[t];return`${r}/${s}/vin-identify`},Oi=t=>{const r=t?.plateNumbers;if(!(!Array.isArray(r)||r.length===0))return r},zt=t=>{if(t==null)return;if(typeof t=="number")return Number.isFinite(t)?String(Math.trunc(t)):void 0;const r=String(t).trim();return r.length>0?r:void 0},be=t=>zt(t)===void 0,Ui=t=>({firstName:"",lastName:"",registrationNumber:t.plateNumber,vehicleType:"",chassisNumber:"",sumInsured:"",brand:"",model:"",numberOfVehicles:"",color:"",year:""}),Ft=t=>t==null?"":typeof t=="number"?Number.isFinite(t)?String(Math.trunc(t)):"":String(t).trim(),Hi=t=>({firstName:t.firstname??"",lastName:t.lastname??"",registrationNumber:t.plateNumber,vehicleType:t.category??"",chassisNumber:t.chassisNumber??"",sumInsured:"",brand:t.make??"",model:t.model??"",numberOfVehicles:"",color:"",year:Ft(t.year)}),Yi=t=>{const r=t?.verifyItems;if(!(!Array.isArray(r)||r.length===0))return r},$r=t=>{const r=t?.vehicles;if(Array.isArray(r))return r},Gi=t=>{const r=Yi(t);if(r)return r.map(Hi);const s=$r(t);if(s!==void 0)return s;const o=Oi(t);if(o)return o.map(Ui)},$t=["#6B4E9B","#E86B4A","#E8A838","#3A7BD5","#2ECC71","#E74C3C","#1ABC9C","#9B59B6"],Kr=t=>{let r=0;for(let s=0;s<t.length;s++)r=t.charCodeAt(s)+((r<<5)-r);return $t[Math.abs(r)%$t.length]},qi={ANNUAL:1,SEMI_ANNUAL:2,QUARTERLY:4,MONTHLY:12},Qi=t=>t?qi[t]??1:1;function Xi(t){return String(t??"").trim().toUpperCase().replace(/\s+/g,"_")==="RATE_BASED"?"RATE_BASED":"FIXED"}function $i(t){const r=t?.vehicles?.[0]?.sumInsured;if(r==null)return null;const s=r.trim();if(!s||s==="0")return null;const o=parseFloat(s.replace(/[^0-9.]/g,""));return isNaN(o)||o<=0?null:o}function Ki(t){if(t==null||t==="")return null;const r=parseFloat(String(t).replace(/[^0-9.-]/g,""));return isNaN(r)?null:r}function Kt(t){if(t==null)return null;let r=t;typeof t=="object"&&Array.isArray(t.d)&&(r=t.d[0]);const s=parseFloat(String(r).replace(/[^0-9.]/g,""));return isNaN(s)?null:s}function At(t,r,s){if(Xi(t.pricingStrategy)==="FIXED")return Kt(t.fixedPremium);const i=Kt(t.fixedPremium);if(i!=null)return i;const a=Ki(t.rate);return r==null||a==null?null:r*a/Qi(s)}function Jt(t,r,s,o,i){const a=At(t,s,i),d=At(r,s,i),c=a??(o==="asc"?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY),p=d??(o==="asc"?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY);return o==="asc"?c-p:p-c}const Ji=({vehicle:t,coverageLabel:r})=>{if(!t)return null;const s=t.make?.trim()||"—",o=[t.make,t.model].filter(Boolean).join(" ").trim()||t.model?.trim()||"—",i=t.plateNumber?.trim()||"—",a=t.category?.trim()||"—",d=t.color?.trim()||"—";return{id:t.id,brand:s,plate:i,model:o,coverageType:r,category:a,color:d,yearOfManufacture:typeof t.year=="number"?String(t.year):"—",chassisOrId:t.chassisNumber?.trim()||"—",bodyColor:d,usageClass:a}},Zi=["Acura","Alfa Romeo","Ashok Leyland","Aston Martin","Audi","BAIC","Bajaj","Bentley","BMW","Brilliance","Buick","BYD","Cadillac","Changan","Chery","Chevrolet","Chrysler","Citroën","DAF","Dacia","Daewoo","Daihatsu","Dodge","Dongfeng","DFSK","Exeed","FAW","Ferrari","Fiat","Ford","Foton","Freightliner","GAC","Geely","Golden Dragon","GMC","Great Wall","Hafei","Haval","Higer","Hino","Honda","Hongqi","Howo","Hummer","Hyundai","Infiniti","Innoson","International","Isuzu","Iveco","JAC","Jaguar","Jeep","Jet Motor","Jetour","JMC","Kenworth","Kia","King Long","Lamborghini","Land Rover","Lexus","Lifan","Lincoln","Mack","Mahindra","MAN","Maserati","Maxus","Mazda","Mercedes-Benz","MG","Mikano","Mini","Mitsubishi","Nissan","Nord","Omoda","Opel","Peugeot","Piaggio","Porsche","Proforce","RAM","Range Rover","Renault","Rolls-Royce","Scania","SEAT","Shacman","Sinotruk","Skoda","Smart","SsangYong","Subaru","Suzuki","Tank","Tata","Tesla","Toyota","TVS","Volkswagen","Volvo","Wuling","Yutong","Zotye","Other"],ea={Acura:["ILX","MDX","RDX","RL","RLX","TL","TLX","TSX","ZDX"],Audi:["A3","A4","A5","A6","A7","A8","Q3","Q5","Q7","Q8","TT"],BMW:["1 Series","2 Series","3 Series","4 Series","5 Series","6 Series","7 Series","X1","X3","X4","X5","X6","X7"],Chevrolet:["Aveo","Camaro","Captiva","Cruze","Equinox","Impala","Malibu","Silverado","Spark","Suburban","Tahoe","Trailblazer"],Ford:["Edge","Escape","Everest","Expedition","Explorer","F-150","Fiesta","Focus","Fusion","Mustang","Ranger","Transit"],Honda:["Accord","City","Civic","CR-V","Crosstour","Element","Fit","HR-V","Odyssey","Pilot","Ridgeline"],Hyundai:["Accent","Creta","Elantra","Grand i10","i10","i20","i30","K
2ona","Palisade","Santa Fe","Sonata","Tucson","Veloster"],Infiniti:["FX35","FX45","JX35","Q50","Q60","QX50","QX56","QX60","QX80"],Jeep:["Cherokee","Compass","Grand Cherokee","Liberty","Patriot","Renegade","Wrangler"],Kia:["Cerato","Forte","K5","Optima","Picanto","Rio","Seltos","Sorento","Soul","Sportage","Stinger"],"Land Rover":["Defender","Discovery","Discovery Sport","Freelander","LR3","LR4"],Lexus:["ES","GS","GX","IS","LS","LX","NX","RX","RX 330","RX 350","UX"],Mazda:["CX-3","CX-5","CX-7","CX-9","Mazda2","Mazda3","Mazda6","MX-5"],"Mercedes-Benz":["A-Class","C-Class","CLA","CLK","CLS","E-Class","G-Class","GLA","GLC","GLE","GLK","GLS","ML","S-Class","Sprinter"],Mitsubishi:["ASX","Canter","L200","Lancer","Montero","Outlander","Pajero","Space Star"],Nissan:["Almera","Altima","Armada","Frontier","Juke","Maxima","Micra","Murano","Navara","Note","Pathfinder","Patrol","Primera","Qashqai","Quest","Rogue","Sentra","Sunny","Titan","Urvan","X-Trail","Xterra"],Peugeot:["206","207","301","307","308","406","407","508","3008","5008"],"Range Rover":["Evoque","Range Rover","Sport","Velar","Vogue"],Renault:["Captur","Clio","Duster","Kwid","Logan","Megane","Sandero"],Suzuki:["Alto","Baleno","Celerio","Ertiga","Jimny","Swift","Vitara"],Toyota:["4Runner","Avalon","Avanza","Camry","Corolla","Coaster","Fortuner","Hiace","Highlander","Hilux","Land Cruiser","Matrix","Prado","Previa","Prius","RAV4","Sequoia","Sienna","Solara","Tacoma","Tundra","Venza","Yaris"],Volkswagen:["Amarok","Beetle","Caddy","Golf","Jetta","Passat","Polo","Sharan","Tiguan","Touareg","Transporter"],Volvo:["S60","S80","S90","V40","XC40","XC60","XC70","XC90"],"Ashok Leyland":["1618","2518","Dost","Falcon","Partner","Viking"],BAIC:["BJ40","D20","Senova D50","X25","X35","X55","X7"],Bajaj:["Boxer","Maxima","Pulsar","Qute","RE (Keke)"],Brilliance:["H230","H330","V3","V5","V6"],BYD:["Atto 3","Dolphin","F3","Han","Qin","S6","Seal","Song","Tang","Yuan","e6"],Changan:["Alsvin","CS15","CS35","CS35 Plus","CS55","CS75","CS85","CS95","Eado","Star Truck","UNI-K","UNI-T"],Chery:["Arrizo 5","Arrizo 6","QQ","Tiggo 2","Tiggo 3","Tiggo 4","Tiggo 5","Tiggo 7","Tiggo 8"],DFSK:["C31","Glory 500","Glory 580","K01","K05"],Dongfeng:["AX7","Captain","Glory 580","H30","Rich 6","S30"],Exeed:["LX","TXL","VX"],FAW:["Besturn B30","Besturn B50","J6 Truck","Tiger V","X40","X80"],Foton:["Auman","Aumark","Sauvana","Tunland","View"],Freightliner:["Cascadia","Century","Columbia","M2"],GAC:["Emkoo","Empow","GA3","GA4","GA6","GA8","GS3","GS4","GS5","GS8","M6","M8"],Geely:["Azkarra","Coolray","Emgrand","GX3","Okavango","Starray","Tugella"],"Golden Dragon":["Marcopolo","XML6122","XML6957"],"Great Wall":["Poer","Steed","Wingle 5","Wingle 7"],Haval:["Dargo","H2","H6","H9","Jolion"],Higer:["H5C","KLQ6118","V70"],Hino:["300 Series","500 Series","700 Series","Dutro","Ranger"],Hongqi:["E-HS9","H5","H9","HS5","HS7"],Howo:["A7","Sitrak","T5G","T7H"],Innoson:["IVM 6510","IVM 6581","IVM Carrier","IVM Connect","IVM Fox","IVM G12","IVM G20","IVM G40","IVM G5","IVM G6","IVM G6T","IVM G80","IVM Granite","IVM Smart","IVM Umu"],International:["4300","9800","DuraStar","LoneStar","ProStar"],Isuzu:["D-Max","Elf","FRR","Forward","MU-X","NPR"],JAC:["J3","J4","J5","N-Series","S2","S3","S4","S5","Sunray","T6","T8","X200"],"Jet Motor":["JM1","Jet Mover","Jet Van"],Jetour:["Dashing","T2","X70","X90"],JMC:["Boarding","Carrying","Conquer","Vigus"],Kenworth:["T680","T800","W900"],"King Long":["Kingo","XMQ6127","XMQ6900"],Lifan:["320","520","620","X50","X60"],Mack:["Anthem","CH","Granite","Pinnacle","Vision"],Mahindra:["Alfa","Bolero","Pik Up","Scorpio","XUV500"],MAN:["CLA","Diesel Truck","TGA","TGM","TGS","TGX"],Maxus:["D60","D90","G10","T60","T70","V80"],Mikano:["Alsvin","CS15","CS35","CS55","CS75","Eado"],Nord:["A3","A5","A7","Bassi","Flit","Max","Sport","Tank","Trooper","Trumpp","Tusker","Vantage"],Omoda:["C5","C7"],Piaggio:["Ape City","Ape Xtra","Porter"],Proforce:["Ara","Ares","PF Protected","Viper"],Scania:["G-Series","Marcopolo","P-Series","R-Series"],Shacman:["F2000","F3000","H3000","X3000"],Sinotruk:["Hohan","Howo A7","Howo T7H","Sitrak"],Tank:["Tank 300","Tank 500"],Tata:["Ace","Indica","LPT","Safari","Sumo","Xenon"],TVS:["Apache","HLX","King","Star"],Wuling:["Almaz","Bingo","Hongguang","Sunshine"],Yutong:["T7","ZK6118","ZK6122","ZK6729"],Zotye:["SR9","T600","Z300"]},ta=1980,Bt=t=>t.map(r=>({value:r,label:r})),ra=()=>Bt(Zi),sa=t=>{const r=ea[t.trim()];return r?Bt(r):[]},na=(t=new Date)=>{const r=t.getFullYear()+1,s=[];for(let o=r;o>=ta;o-=1)s.push(String(o));return Bt(s)},oa=()=>
2{const t=ut(xt);return x.useMemo(()=>$i(t),[t])},Zt=({label:t,defaultOpen:r,children:s})=>{const[o,i]=x.useState(r);return e.jsxs(u,{borderBottom:"1px solid",borderColor:"gray.100",py:4,children:[e.jsxs(w,{justify:"space-between",align:"center",cursor:"pointer",onClick:()=>i(!o),userSelect:"none",children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.label,children:t}),e.jsx(W,{as:fr,boxSize:4,color:n.text.gray,transform:o?"rotate(180deg)":void 0,transition:"transform 0.2s"})]}),o&&e.jsx(u,{pt:3,children:s})]})},er=({searchQuery:t,onSearchChange:r,priceRange:s,onPriceRangeChange:o,priceRangeOptions:i,underwriterNames:a,selectedUnderwriters:d,onToggleUnderwriter:c,sectionsStartExpanded:p=!0})=>e.jsxs(u,{bg:"white",borderRadius:"2xl",borderWidth:2,borderStyle:"solid",borderColor:"gray.100",p:"5",h:"fit-content",children:[e.jsxs(w,{align:"center",gap:2,mb:5,children:[e.jsx(W,{as:yr,boxSize:5,color:n.navy[500]}),e.jsx(xe,{size:"md",color:n.text.label,fontWeight:"semibold",children:"Filters"})]}),e.jsx(u,{mb:4,children:e.jsx(se,{placeholder:"Search providers...",value:t,borderRadius:".7rem",onChange:h=>r(h.target.value),leftIcon:e.jsx(W,{as:dn,boxSize:5,color:n.gray[400]}),bg:n.gray[50],size:"md"})}),e.jsxs(v,{align:"stretch",gap:0,children:[e.jsx(Zt,{label:"Price Range",defaultOpen:p,children:e.jsx(v,{align:"stretch",gap:2,children:i.map(h=>e.jsxs(w,{align:"center",gap:3,cursor:"pointer",onClick:()=>o(h.value),children:[e.jsx(w,{w:4,h:4,borderRadius:"full",border:"2px solid",borderColor:s===h.value?n.orange[500]:n.gray[300],bg:s===h.value?n.orange[500]:"white",align:"center",justify:"center",children:s===h.value&&e.jsx(u,{w:1.5,h:1.5,borderRadius:"full",bg:"white"})}),e.jsx(l,{fontSize:"sm",color:n.text.label,children:h.label})]},h.value))})}),a.length>0&&e.jsx(Zt,{label:"Providers",defaultOpen:p,children:e.jsx(v,{align:"stretch",gap:2,children:a.map(h=>{const b=d.includes(h);return e.jsxs(u,{as:"button",display:"flex",w:"full",textAlign:"left",alignItems:"center",gap:3,px:0,py:1,borderRadius:"md",borderWidth:"0",bg:"transparent",cursor:"pointer",transition:"background 0.15s",onClick:()=>c(h),_hover:{bg:n.gray[50]},children:[e.jsx(w,{boxSize:4,borderRadius:"full",align:"center",justify:"center",flexShrink:0,bg:b?n.orange[500]:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:b?n.orange[500]:n.gray[300],children:b&&e.jsx(W,{as:un,boxSize:2.5,color:"white",strokeWidth:2.5})}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.label,lineHeight:"short",children:h})]},h)})})})]})]}),tr=3,ia=({plan:t})=>{const r=Yr(t.coverageDetails),s=r.length>0;return e.jsxs(u,{borderWidth:"1px",borderStyle:"solid",borderColor:n.navy[100],borderRadius:"2xl",bg:n.navy[50],px:4,py:4,children:[e.jsx(l,{fontSize:"md",fontWeight:"bold",color:n.success[700],mb:3,children:"What is covered?"}),t.description.trim()?e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"tall",whiteSpace:"pre-wrap",mb:s||t.benefitAmount?4:0,children:t.description}):null,t.benefitAmount?e.jsxs(u,{mt:0,mb:s?4:0,pb:s?4:0,borderBottomWidth:s?"1px":"0",borderBottomColor:n.navy[100],children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.primary,mb:1,children:"Vehicle Value"}),e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:n.text.label,children:he(t.benefitAmount)})]}):null,s?e.jsx(v,{align:"stretch",gap:4,children:r.map((o,i)=>e.jsx(Dr,{defaultOpen:!1,contentGap:2,label:e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.label,children:o.title}),children:e.jsx(v,{align:"stretch",gap:0,children:o.items.map((a,d)=>e.jsxs(u,{pt:d>0?3:0,borderTopWidth:d>0?"1px":"0",borderTopColor:n.navy[100],children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.info,lineHeight:"short",mb:1.5,children:a.name}),e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"tall",children:a.description})]},`${a.name}-${String(d)}`))})},`${o.title}-${String(i)}`))}):!t.description.trim()&&!t.benefitAmount?e.jsx(l,{fontSize:"sm",color:n.text.gray,children:"Coverage details are not available for this plan yet."}):null]})},Jr=({annualPremium:t,onSelect:r,frequency:s})=>e.jsx(u,{flexShrink:0,borderTopWidth:"1px",borderTopColor:n.gray[100],bg:n.white.DEFAULT,px:{base:5,md:6},py:4,children:e.jsxs(w,{direction:{base:"column",sm:"row"},align:{base:"stretch",sm:"center"},justify:"space-between",gap:4,children:[e.jsxs(u,{children:[e.jsx(l,{fontSize:"xs",color:n.text.gray,mb:.5,children:"Pay"}),e.jsxs(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:n.orange[600],lineHeight:"1.1",children:[he(t),e.jsx(l,{as:"span",fontSize:"lg",fontWeight:"semibold",children:Kn(s)})]}),e.jsx(l,{fontSize:"10px",color:n.text.info,mt:1,children:_t(s)})]}),e.jsx(N,{buttonType:"primary",text:"Select this plan",size:"md",w:{base:"full",sm:"auto"},minW:{sm:"180px"},onClick:r})]})}),Zr={pl:{base:5,md:6}
2,pr:{base:18,md:16}},es={w:{base:"100%",md:"520px"},maxW:{base:"100%",md:"520px"},mx:{base:0,md:"auto"},maxH:{base:"80vh",md:"min(85dvh, 720px)"},display:"flex",flexDirection:"column",overflow:"hidden",overflowY:"hidden"},ts={p:0,overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minH:0,minW:0},aa=({open:t,onClose:r,plan:s,onSelectPlan:o,frequency:i})=>{const{isMobile:a}=_r(),d=()=>{r(),o(s)};return e.jsx(Ie,{open:t,onClose:r,size:"lg",maxW:"520px",mobileBottomSheet:!0,scrollBehavior:"inside",bodyPadded:!1,showCloseButton:!a,contentProps:es,bodyProps:ts,children:e.jsxs(v,{align:"stretch",gap:0,flex:1,minH:0,children:[e.jsxs(u,{...Zr,pt:5,pb:4,flexShrink:0,minW:0,children:[e.jsx(l,{fontSize:"lg",fontWeight:"bold",color:n.text.label,lineHeight:"short",mb:1,wordBreak:"break-word",children:s.name}),e.jsx(l,{fontSize:"sm",color:n.text.secondary,wordBreak:"break-word",children:s.underwriter.name})]}),e.jsx(u,{px:{base:5,md:6},pb:4,flex:1,minH:0,overflowY:"auto",css:{WebkitOverflowScrolling:"touch"},children:e.jsx(ia,{plan:s})}),e.jsx(Jr,{annualPremium:s.fixedPremium,onSelect:d,...i?{frequency:i}:{}})]})})},la={align:"center",gap:1.5,px:2,py:1,borderRadius:"full",borderWidth:"1px",borderStyle:"solid",borderColor:n.navy[200],bg:n.navy[50]},rs=({label:t,wrapText:r=!1})=>e.jsx(w,{...la,flexGrow:0,flexShrink:0,align:r?"flex-start":"center",minW:0,maxW:"100%",w:r?"max-content":"auto",children:e.jsx(l,{minW:r?0:void 0,fontSize:"xs",fontWeight:"medium",color:n.text.label,lineHeight:"short",whiteSpace:r?"normal":"nowrap",wordBreak:r?"break-word":void 0,pr:r?.5:0,children:t})}),ca=({open:t,onClose:r,plan:s,tags:o,onSelectPlan:i,frequency:a})=>{const{isMobile:d}=_r(),c=()=>{r(),i(s)};return e.jsx(Ie,{open:t,onClose:r,size:"lg",maxW:"520px",mobileBottomSheet:!0,scrollBehavior:"inside",bodyPadded:!1,showCloseButton:!d,contentProps:es,bodyProps:ts,children:e.jsxs(v,{align:"stretch",gap:0,flex:1,minH:0,children:[e.jsxs(u,{...Zr,pt:5,pb:2,flexShrink:0,minW:0,children:[e.jsx(l,{fontSize:"lg",fontWeight:"bold",color:n.text.label,wordBreak:"break-word",children:"Plan features"}),e.jsxs(l,{fontSize:"sm",color:n.text.gray,mt:1,wordBreak:"break-word",children:["Everything included with ",s.name]})]}),e.jsx(u,{px:{base:5,md:6},pb:4,flex:1,minH:0,overflowY:"auto",css:{WebkitOverflowScrolling:"touch"},children:e.jsx(w,{gap:2,flexWrap:"wrap",align:"flex-start",children:o.map((p,h)=>e.jsx(rs,{label:p},`${p}-${String(h)}`))})}),e.jsx(Jr,{annualPremium:s.fixedPremium,onSelect:c,...a?{frequency:a}:{}})]})})},da=({logo:t,fallbackLetter:r,brandLetterColor:s,onOpenCoverage:o})=>e.jsxs(w,{align:"center",justify:"space-between",gap:2,mb:3,minW:0,children:[e.jsx(u,{flex:1,minW:0,maxW:{base:"calc(100% - 96px)",sm:"calc(100% - 102px)"},overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"flex-start",children:t?e.jsx(ue,{src:t.src,alt:t.alt,h:{base:"28px",sm:"30px"},maxH:"34px",w:"auto",maxW:"50%",objectFit:"contain",objectPosition:"left center",filter:t.shouldDarken?"brightness(0)":void 0}):e.jsx(l,{fontSize:{base:"1.5rem",md:"1.75rem"},fontWeight:"bold",color:s,lineHeight:1,letterSpacing:"-0.02em",userSelect:"none",children:r})}),e.jsxs(u,{as:"button",display:"inline-flex",alignItems:"center",gap:1,flexShrink:0,px:2,py:1,borderRadius:"full",borderWidth:"1px",borderStyle:"solid",borderColor:n.success[600],bg:n.success[50],color:n.success[700],cursor:"pointer",lineHeight:1,transition:"background 0.15s, border-color 0.15s",onClick:o,_hover:{bg:n.success[100],borderColor:n.success[700]},children:[e.jsx(W,{as:jr,boxSize:4,flexShrink:0}),e.jsx(l,{as:"span",fontSize:"9px",fontWeight:"semibold",whiteSpace:"nowrap",letterSpacing:"0.01em",children:"What is covered?"})]})]}),ua=({annualPremium:t,onSelect:r,frequency:s})=>e.jsxs(w,{mt:"auto",align:"center",justify:"space-between",gap:3,wrap:"wrap",children:[e.jsxs(u,{children:[e.jsx(l,{fontSize:"xs",color:n.text.gray,mb:0,lineHeight:"1.1",children:"Pay"}),e.jsx(l,{fontSize:{base:"lg",md:"xl"},fontWeight:"bold",color:n.orange[600],lineHeight:"1.15",children:he(t)}),e.jsx(l,{fontSize:"10px",color:n.text.info,mt:.5,children:_t(s)})]}),e.jsx(N,{buttonType:"primary",text:"Select this plan",size:"sm",onClick:r})]}),pa=({name:t,description:r,hasTags:s})=>e.jsxs(e.Fragment,{children:[e.jsx(l,{fontWeight:"bold",fontSize:{base:"md",md:"lg"},color:n.text.label,lineClamp:3,mb:2,children:t}),e.jsx(l,{fontSize:"sm",color:n.text.gray,lineClamp:4,mb:s?3:4,children:r})]}),ma=({previewTags:t,showViewMore:r,onViewMore:s})=>e.jsx(u,{mb:4,children:e.jsx(u,{bg:n.navy[50],borderRadius:"2xl",borderWidth:"1px",borderStyle:"solid",borderColor:n.gray[200],px:2.5,py:2.5,children:e.jsxs(w,{flexWrap:"wrap",gap:2,w:"100%",alignItems:"center",rowGap:2,children:[t.map((o,i)=>e.jsx(rs,{label:o,wrapText:!0},`${o}-${String(i)}`)),r?e.jsx(u,{as:"button",display:"inline-flex",alignItems:"center",flexShrink:0,alignSelf:"center",fontSize:"xs",fontWeight:"semibold",color:n.orange[600],textDecoration:"underline",textUnderlineOffset:"2px",cursor:"pointer",bg:"transparent",border:"none",py:.5,px:.5,lineHeight:1,onClick:s,_hover:{color:n.orange[700]},children:"View more"}):null]})})}),ha=({plan:t,onSelect:r,frequency:s})=>{const o=Nr(t.underwriter.name),i=o===null?null:{src:o.src,alt:o.alt,...o.shouldDarken!==void 0?{shouldDarken:o.shouldDarken}:{}},a=Kr(t.underwriter.name),[d,c]=x.useState(!1),[p,h]=x.useState(!1),b=t.tags??[],m=b.slice(0,tr),g=b.length>tr;return e.jsxs(u,{bg:n.white.cardWhite,borderRadius:"2xl",border:".5px solid",borderColor:n.border.primary,p:{base:4,md:5}
2,transition:"all 0.2s",_hover:{borderColor:n.orange[300],boxShadow:"sm"},display:"flex",flexDirection:"column",height:"100%",children:[e.jsx(da,{logo:i,fallbackLetter:t.underwriter.name.charAt(0).toUpperCase(),brandLetterColor:a,onOpenCoverage:()=>c(!0)}),e.jsx(pa,{name:t.name,description:t.description,hasTags:b.length>0}),b.length>0?e.jsx(ma,{previewTags:m,showViewMore:g,onViewMore:()=>h(!0)}):null,e.jsx(ua,{annualPremium:t.fixedPremium,onSelect:()=>r(t),...s?{frequency:s}:{}}),e.jsx(aa,{open:d,onClose:()=>c(!1),plan:t,onSelectPlan:r,...s?{frequency:s}:{}}),e.jsx(ca,{open:p,onClose:()=>h(!1),plan:t,tags:b,onSelectPlan:r,...s?{frequency:s}:{}})]})},xa=[{value:"price-asc",label:"Price: Low to High"},{value:"price-desc",label:"Price: High to Low"}],ga=(t,r)=>{if(!r)return!0;const s=r.toLowerCase();return[t.underwriter?.name,t.name,t.description,...t.tags??[]].filter(i=>typeof i=="string"&&i.trim()!=="").map(i=>i.toLowerCase()).some(i=>i.includes(s))},ba=({onSelectPlan:t,title:r="Compare Plans & Providers",policyId:s,frequency:o,isSelectingPlan:i=!1})=>{const[a,d]=x.useState(""),[c,p]=x.useState("all"),[h,b]=x.useState("price-asc"),[m,g]=x.useState([]),[f,j]=x.useState(!1),P=Mn({base:!1,lg:!0})??!1,T=oa(),{plans:S,isLoading:k,isError:_,refetch:L}=Gs({policyId:s??"",enabled:!!s,...o?{params:{frequency:o}}:{}}),I=a.trim().toLowerCase(),D=x.useMemo(()=>I?S.filter(C=>ga(C,I)):S,[S,I]),M=x.useMemo(()=>{const C=new Set;for(const R of D){const H=R.underwriter?.name?.trim();H&&C.add(H)}return[...C].sort((R,H)=>R.localeCompare(H,void 0,{sensitivity:"base"}))},[D]),U=x.useMemo(()=>{const C=new Set(M);return m.filter(R=>C.has(R))},[m,M]),q=C=>{g(R=>{const H=new Set(M),Y=R.filter(G=>H.has(G));return Y.includes(C)?Y.filter(G=>G!==C):[...Y,C]})},V=x.useMemo(()=>{const C=Xt.find(H=>H.value===c),R=D.filter(H=>{if(U.length>0&&!U.includes(H.underwriter.name))return!1;if(!C||c==="all")return!0;const Y=At(H,T,o);return Y==null?!0:!(C.min!==void 0&&Y<C.min||C.max!==void 0&&Y>C.max)});return h==="price-asc"?[...R].sort((H,Y)=>Jt(H,Y,T,"asc",o)):h==="price-desc"?[...R].sort((H,Y)=>Jt(H,Y,T,"desc",o)):R},[D,h,c,T,U,o]),A={searchQuery:a,onSearchChange:d,priceRange:c,onPriceRangeChange:p,priceRangeOptions:[...Xt],underwriterNames:M,selectedUnderwriters:U,onToggleUnderwriter:q},E=e.jsx(u,{minW:0,children:k?e.jsx(w,{justify:"center",align:"center",minH:"200px",children:e.jsx(kt,{})}):_?e.jsxs(w,{direction:"column",justify:"center",align:"center",gap:4,minH:{base:"200px",md:"280px"},w:"100%",children:[e.jsx(l,{fontSize:"sm",color:n.error[600],textAlign:"center",maxW:"md",px:4,children:"We couldn't load the plans right now. Please try again."}),e.jsx(N,{type:"button",buttonType:"outline",text:"Retry",size:"md",onClick:()=>L()})]}):V.length===0?e.jsx(w,{justify:"center",align:"center",minH:{base:"200px",md:"280px"},w:"100%",children:e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"center",maxW:"md",px:4,children:"No plans found for your search criteria."})}):e.jsx(ye,{columns:{base:1,md:2,xl:3},gap:5,alignItems:"stretch",children:V.map(C=>e.jsx(ha,{plan:C,onSelect:t,...o?{frequency:o}:{}},C.id))})});return e.jsxs(u,{position:"relative",children:[i&&e.jsx(w,{position:"absolute",inset:0,zIndex:10,bg:"whiteAlpha.700",justify:"center",align:"center",borderRadius:"xl",children:e.jsx(Nt,{color:n.orange[500],size:"xl"})}),e.jsxs(w,{justify:"space-between",align:{base:"flex-start",md:"center"},direction:{base:"column",md:"row"},gap:3,mb:{base:3,lg:6},children:[e.jsx(xe,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:n.text.primary,children:r}),e.jsx(N,{buttonType:"whatsapp",text:"Chat with Myka",iconPosition:"left",size:"md",flexShrink:0,onClick:ws})]}),e.jsxs(w,{justify:"space-between",align:{base:"flex-start",sm:"center"},direction:{base:"column",sm:"row"},gap:3,mb:{base:3,lg:5},wrap:"wrap",children:[e.jsxs(l,{fontSize:"sm",color:n.text.gray,children:["Showing"," ",e.jsx(l,{as:"span",fontWeight:"bold",color:n.text.label,children:V.length})," ","plans"]}),e.jsxs(w,{align:"center",gap:2,w:{base:"100%",sm:"auto"},minW:0,flex:{base:"none",sm:1},justify:{base:"flex-start",sm:"flex-end"},flexWrap:"wrap",children:[e.jsx(l,{fontSize:"sm",color:n.text.gray,whiteSpace:"nowrap",children:"Sort by:"}),e.jsx(u,{flex:"1",minW:{base:0,sm:"160px"}
2,maxW:{base:"100%",sm:"280px"},children:e.jsx(qe,{options:[...xa],value:h,onChange:C=>b(C),borderRadius:"full"})}),P?null:e.jsx(He,{"aria-label":f?"Hide filters":"Show filters","aria-expanded":f,type:"button",onClick:()=>j(C=>!C),borderRadius:"full",size:"md",flexShrink:0,bg:n.orange[500],color:"white",_hover:{bg:n.orange[600]},_active:{bg:n.orange[700]},children:e.jsx(W,{as:yr,boxSize:5})})]})]}),P?e.jsxs(fe,{templateColumns:{base:"1fr",lg:"minmax(200px, 220px) 1fr"},gap:{base:6,lg:6},alignItems:"start",children:[e.jsx(Ye,{children:e.jsx(er,{...A,sectionsStartExpanded:!0})}),e.jsx(Ye,{children:E})]}):e.jsxs(u,{w:"100%",children:[f?e.jsx(u,{mb:4,w:"100%",children:e.jsx(er,{...A,sectionsStartExpanded:!1})}):null,E]}),e.jsx(_n,{})]})},ya=[{pathPrefix:"personal/third-party",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"verify",label:"Verify Identity"},{segment:"personal-info",label:"Personal Information"},{segment:"vehicle",label:"Vehicle Information"},{segment:"payment-option",label:"Payment Option"},{segment:"compare",label:"Plans"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"download",label:"Successful Payment"},{segment:"fleet-upload",label:"Upload Fleet"},{segment:"fleet-results",label:"Fleet Results"}]},{pathPrefix:"personal/third-party-plus",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"verify",label:"Verify Identity"},{segment:"personal-info",label:"Personal Information"},{segment:"vehicle",label:"Vehicle Information"},{segment:"payment-option",label:"Payment Option"},{segment:"compare",label:"Plans"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"download",label:"Successful Payment"},{segment:"fleet-upload",label:"Upload Fleet"},{segment:"fleet-results",label:"Fleet Results"}]},{pathPrefix:"personal/comprehensive",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"verify",label:"Verify Identity"},{segment:"personal-info",label:"Personal Info"},{segment:"vehicle",label:"Vehicle Information"},{segment:"vehicle-id",label:"Vehicle Identification"},{segment:"payment-option",label:"Payment Option"},{segment:"compare",label:"Compare Plans"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"inspection",label:"Vehicle Inspection"},{segment:"inspection-capture",label:"Inspection Recording"},{segment:"download",label:"Successful Payment"}]},{pathPrefix:"business/third-party-plus",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"vehicle-info",label:"Vehicle Information"},{segment:"payment-option",label:"Payment Option"},{segment:"compare-plans",label:"Plans"},{segment:"verify",label:"Verify Identity"},{segment:"personal-info",label:"Personal Info"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"download",label:"Successful Payment"}]},{pathPrefix:"business/third-party",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"vehicle-info",label:"Vehicle Information"},{segment:"payment-option",label:"Payment Option"},{segment:"compare-plans",label:"Plans"},{segment:"verify",label:"Verify Identity"},{segment:"personal-info",label:"Personal Info"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"download",label:"Successful Payment"}]},{pathPrefix:"business/comprehensive",steps:[{segment:"plate-verify",label:"Verify Plate"},{segment:"manual-vehicle",label:"Vehicle Details"},{segment:"vehicle",label:"Vehicle Information"},{segment:"payment-option",label:"Payment Option"},{segment:"compare",label:"Compare Plans"},{segment:"verify",label:"Verify Identity"},{segment:"vehicle-id",label:"Vehicle Identification"},{segment:"personal-info",label:"Personal Info"},{segment:"review-quote",label:"Review Your Quote"},{segment:"complete-payment",label:"Complete Payment"},{segment:"inspection",label:"Vehicle Inspection"},{segment:"inspection-capture",label:"Inspection Recording"},{segment:"download",label:"Successful Payment"}]},{pathPrefix:"claims/third-party/personal",steps:[{segment:"accident-details",label:"Accident Details"},{segment:"video-inspection",label:"Video Inspection"},{segment:"video-uploaded",label:"Video Uploaded"},{segment:"third-party-info",label:"Third-Party Information"},{segment:"police-report",label:"Police Report"},{segment:"verifying",label:"Verifying Insurance"},{segment:"verified",label:"Insurance Verified"}]},{pathPrefix:"claims/third-party/business",steps:[{segment:"accident-details",label:"Accident Details"},{segment:"video-inspection",label:"Video Inspection"},{segment:"video-uploaded",label:"Video Uploaded"},{segment:"third-party-info",label:"Third-Party Information"},{segment:"police-report",label:"Police Report"},{segment:"verifying",label:"Verifying Insurance"},{segment:"verified",label:"Insurance Verified"}]}
2,{pathPrefix:"claims/comprehensive/personal",steps:[{segment:"accident-details",label:"Accident Details"}]},{pathPrefix:"claims/comprehensive/business",steps:[{segment:"accident-details",label:"Accident Details"}]}],fa=t=>ya.filter(s=>t.startsWith(s.pathPrefix)).sort((s,o)=>o.pathPrefix.length-s.pathPrefix.length)[0]??null,rr="/motor",Te=()=>{const t=de(),r=Ss(),s=x.useMemo(()=>{const a=t.pathname??"";return a.startsWith(rr)?a.slice(rr.length).replace(/^\//,"")??"":""},[t.pathname]);return{items:x.useMemo(()=>{const a=fa(s);return a?Jn(a.pathPrefix,a.steps,s):[]},[s]),onGoBack:()=>r(-1)}},ke=({config:t})=>{const{items:r}=Te(),{navigate:s}=J(),o=de(),i=o.state?.policyId,a=o.state?.paymentOption,[d,c]=x.useState(!1),{generateQuote:p}=qs();if(!i)return e.jsx(Ce,{replace:!0,to:`/${t.routes.plateVerify}`});const h=m=>{c(!0);const g=a?.frequency??"ANNUAL";p({policyId:i,payload:{productId:m.id,paymentFrequency:g}},{onSuccess:f=>{s(`/${t.routes.reviewQuote}`,{state:{quoteData:f.data,policyId:i,planDuration:m.duration,paymentOption:a}})},onError:f=>{O.error(te(f)??"Failed to generate quote. Please try again."),c(!1)}})},b=()=>{s(-1)};return e.jsx(ee,{items:r,onGoBack:b,children:e.jsx(ba,{onSelectPlan:h,isSelectingPlan:d,policyId:i,frequency:a?.frequency??"ANNUAL"})})},ja=t=>{const{track:r}=Qe(),s=x.useCallback(({amountDue:i})=>{r(ne.MOTOR_PAYMENT_INITIATED,{product_type:"motor",premium_amount_ngn:i})},[r]),o=x.useCallback(({amountDue:i})=>{r(ne.MOTOR_PAYSTACK_OPENED,{product_type:"motor",premium_amount_ngn:i})},[r]);return Hn({...t,errorFallback:Ti,onSettleInitiated:s,onOnlineRedirectStart:o})},va="Your payment was not completed. Please try again or contact support if the issue persists.",Sa=({config:t})=>{const{navigate:r}=J(),s=de(),[o,i]=je(),{displayName:a}=Ts(),d=ut(xt),c=Ri(s.state),p=o.get("policyId"),h=fi(c.policyId??p),b=c.quoteData??h?.quoteData,m=c.policyId??h?.policyId??p??void 0,g=c.paymentOption??h?.paymentOption,f=c.planDuration??h?.planDuration,j=o.get("payment")==="failed",P=x.useRef(!1),T=to({productType:"MOTOR",coverType:t.coverType}),[S,k]=x.useState(!1),[_,L]=x.useState(!1),[I,D]=x.useState(!1),[M,U]=x.useState("success"),{savePaymentFrequency:q,isLoading:V}=Ur(),{recordPolicyConsentAsync:A,isRecordingConsent:E}=ro("motor"),C=x.useMemo(()=>b?Ei({quoteData:b,coverageLabel:t.coverageLabel,displayName:a,...g?{paymentOption:g}:{},...d?.vehicles?.[0]?{formVehicle:d.vehicles[0]}:{}}):null,[b,g,t.coverageLabel,a,d]),R=x.useMemo(()=>{if(!(typeof window>"u"||!m||!b))return Ii({config:t,policyId:m,quoteData:b,origin:window.location.origin})},[t,m,b]),H=x.useCallback(()=>{if(!o.has("payment"))return;const me=new URLSearchParams(o);me.delete("payment"),i(me,{replace:!0})},[o,i]),Y=x.useCallback(()=>{Hr();const me=Ai({config:t,policyId:m,quoteData:b,paymentRedirectUrls:R});me&&r(me,{replace:!0})},[t,m,b,R,r]),{isOpen:G,start:Z}=Yn({holdMs:Gn,onComplete:()=>{if(j||M==="failed"){H();return}Y()}});x.useEffect(()=>{!j||P.current||(P.current=!0,Z())},[j,Z]);const re=j?"failed":M,pe=x.useCallback(me=>{U(me),D(!1),Z()},[Z]),Ge=x.useCallback(()=>{!m||!b||yi({policyId:m,quoteData:b,...g?{paymentOption:g}:{},...f?{planDuration:f}:{}})},[m,b,g,f]),{continueAfterConsent:ge,isCheckingMandates:Ke,linkModalProps:Re}=so({onReadyForPayment:()=>D(!0)}),bs=x.useCallback(()=>{if(!Mr({termsAccepted:S,debitConsent:_,requiresDebitConsent:T}))return;const me=()=>{if(!m){ge();return}A({policyId:m,...ji({termsAccepted:S,autoRenew:_})}).then(()=>ge()).catch(bt=>{O.error(te(bt)??"We could not record your consent. Please try again.")})};if(!m||!g){me();return}q({policyId:m,payload:{frequency:g.frequency,frequencyAmount:g.frequencies[g.frequency],isSubscribed:_}},{onSuccess:me,onError:bt=>{O.error(te(bt)??"Failed to save payment frequency. Please try again.")}})},[_,ge,g,m,A,T,q,S]),{isProcessing:ys,handleSelectMethod:fs,handleEmailVerifiedAndPay:js,emailModal:vs}=ja({policyId:m,amountDue:C?.amountDue,paymentRedirectUrls:R,onDirectDebitCompleted:pe,onCloseMethodModal:()=>D(!1),onBeforeOnlineRedirect:Ge});return{isReady:!!(b&&m&&C),reviewQuotePath:`/${t.routes.reviewQuote}`,policyId:m,stepProps:C?{summary:{planLabel:C.planLabel,vehicleLabel:C.vehicleLabel,premiumLabel:C.premiumLabel,premiumDisplay:C.premiumDisplay},detailRows:C.detailRows,disclosures:C.disclosures,totalDueDisplay:C.totalDueDisplay,termsAccepted:S,onTermsAcceptedChange:k,autoRenew:_,onAutoRenewChange:L,onProceed:bs,isProceedDisabled:V||E||Ke,requiresDebitConsent:T}:null,methodModalProps:C?{open:I,onClose:()=>D(!1),amountDue:C.amountDue,isProcessing:ys,onConfirmPayment:fs}:null,emailModalProps:{...vs,onVerified:()=>{js()}},successModalProps:{open:G,outcome:re,...C?.totalDueDisplay&&re!=="failed"?{amountDisplay:C.totalDueDisplay}:{},...re==="failed"?{subtitle:va}:{}},linkModalProps:Re,handleBack:()=>r(-1)}},Ve=({config:t})=>{const{isReady:r,reviewQuotePath:s,policyId:o,stepProps:i,methodModalProps:a,emailModalProps:d,successModalProps:c,linkModalProps:p,handleBack:h}=Sa({config:t});return!r||!i||!a||!d?e.jsx(Ce,{replace:!0,to:s,state:{policyId:o}}):e.jsxs(ee,{items:[],contentMaxW:"840px",onGoBack:h,...t.mobileContentOnly&&{mobileContentOnly:!0},children:[e.jsx(zr,{...d}),e.jsx(Qo,{...i}),e.jsx(no,{...p}),e.jsx(qn,{...a}),e.jsx(Qn,{...c})]})},sr=({config:t})=>{const{navigate:r}=J(),{pathname:s}=de(),[o]=je(),{submitPolicyAsync:i}=Qs(),[a,d]=x.useState(()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).get("payment")==="success");x.useEffect(()=>{if(o.get("payment")!=="success")return;const p=o.get("policyId"),h=o.get("quoteId")??void 0;if(Hr(),!p){d(!1),r({pathname:s,search:""},{replace:!0});return}let b=!1;return(async()=>{try{await i({policyId:p,...h?{quoteId:h}:{}})}catch(m){O.error(te(m)??"Your payment went through, but we could not submit your policy. Our team will follow up.")}finally{b||(r({pathname:s,search:""},{replace:!0}),d(!1))}})(),()=>{b=!0}},[o,s,r,i]);const c=()=>{r(`/${t.routes.reviewQuote}`)};return a?e.jsx(ee,{items:[],onGoBack:c,contentMaxW:"600px",children:e.jsx(zn,{py:16,children:e.jsxs(v,{gap:3,children:[e.jsx(Nt,{size:"lg",color:n.orange[500]}),e.jsx(l,{fontSize:"sm",color:"gray.600",children:"Confirming your payment…"})]})})}):e.jsx(ee,{items:[],hideGoBack:!0,onGoBack:c,contentMaxW:"700px",children:e.jsxs(v,{align:"stretch",gap:5,children:[e.jsx(ot.div,{initial:{opacity:0,y:14}
2,animate:{opacity:1,y:0},transition:{duration:.42,ease:[.22,1,.36,1]},children:e.jsxs(u,{border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",overflow:"hidden",boxShadow:"0 1px 6px rgba(15,23,42,0.06)",children:[e.jsxs(v,{gap:2,pt:{base:8,md:10},pb:6,px:{base:6,md:10},align:"center",background:"linear-gradient(180deg, #E8F0FE 0%, #FFFFFF 100%)",children:[e.jsx(u,{display:"flex",justifyContent:"center",width:"100%",children:e.jsx(pt,{data:Dt,autoplay:!0,loop:!0,style:{width:"min(100%, 280px)",height:"min(220px, 50vw)",maxHeight:"280px"}})}),e.jsx(xe,{fontSize:{base:"lg",md:"xl"},fontWeight:"bold",fontStyle:"italic",color:n.success[600],textAlign:"center",children:"Payment Successful!"}),e.jsx(l,{fontSize:{base:"sm",md:"md"},color:n.text.primary,textAlign:"center",lineHeight:"tall",maxW:"400px",children:"Your payment has been processed. Your comprehensive policy is now pending vehicle inspection."})]}),e.jsxs(v,{gap:5,align:"center",p:{base:6,md:8},bg:"white",children:[e.jsxs(v,{gap:1,align:"center",children:[e.jsx(u,{w:"44px",h:"44px",borderRadius:"xl",bg:n.orange[50],display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(W,{as:pn,boxSize:5,color:n.orange[500]})}),e.jsx(l,{fontWeight:"bold",fontSize:{base:"md",md:"lg"},color:n.navy[500],textAlign:"center",children:"Complete Your Vehicle Inspection"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,lineHeight:"tall",textAlign:"center",maxW:"380px",children:"Download the Myka mobile app to complete the vehicle inspection and activate your policy."})]}),e.jsxs(w,{align:"center",gap:2,bg:"#FFF7ED",border:"1px solid",borderColor:n.orange[200],borderRadius:"xl",px:4,py:3,children:[e.jsx(W,{as:mn,boxSize:4,color:n.orange[500],flexShrink:0}),e.jsxs(l,{fontSize:"sm",color:n.navy[500],fontWeight:"medium",children:["You have"," ",e.jsx(l,{as:"span",fontWeight:"bold",color:n.orange[600],children:"2 days"})," ","to complete the inspection before your policy becomes active."]})]}),e.jsxs(v,{gap:3,align:"stretch",children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.gray,textTransform:"uppercase",letterSpacing:"0.08em",textAlign:"center",children:"Download the Myka App"}),e.jsxs(w,{gap:3,justify:"center",flexWrap:"wrap",children:[e.jsx("a",{href:Is,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(w,{align:"center",gap:2,px:5,py:3,bg:n.navy[500],borderRadius:"xl",cursor:"pointer",_hover:{opacity:.88},transition:"opacity 0.2s",minW:"150px",justify:"center",children:[e.jsx(W,{as:hn,boxSize:5,color:"white"}),e.jsxs(v,{gap:0,align:"start",children:[e.jsx(l,{fontSize:"9px",color:"whiteAlpha.800",lineHeight:"1",children:"Download on the"}),e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:"white",lineHeight:"1.3",children:"App Store"})]})]})}),e.jsx("a",{href:hr,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(w,{align:"center",gap:2,px:5,py:3,bg:n.navy[500],borderRadius:"xl",cursor:"pointer",_hover:{opacity:.88},transition:"opacity 0.2s",minW:"150px",justify:"center",children:[e.jsx(W,{as:vr,boxSize:4,color:"white"}),e.jsxs(v,{gap:0,align:"start",children:[e.jsx(l,{fontSize:"9px",color:"whiteAlpha.800",lineHeight:"1",children:"Get it on"}),e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:"white",lineHeight:"1.3",children:"Google Play"})]})]})})]})]})]})]})}),e.jsx(N,{buttonType:"primary",text:"Back to Dashboard",size:"lg",onClick:()=>r("/home",{replace:!0})})]})})},Ca=({children:t})=>e.jsx(u,{bg:"white",borderRadius:"2xl",background:`linear-gradient(145deg, white 55%, ${n.orange[50]} 100%)`,borderColor:n.border.secondary,p:{base:6,md:8},children:t}),Pa=()=>e.jsxs(u,{children:[e.jsxs(xe,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",mb:2,children:[e.jsxs(l,{as:"span",color:n.text.primary,fontWeight:"normal",children:["Verify Your"," "]}),e.jsx(l,{as:"span",color:n.text.label,fontWeight:"bold",children:"Business"})]}),e.jsx(l,{fontSize:"sm",color:n.text.gray,children:"Select your business type, then enter your CAC registration number"})]}),wa=()=>e.jsx(u,{borderLeft:"6px solid",borderColor:n.success[700],bg:n.white.DEFAULT,borderRadius:"lg",p:4,children:e.jsxs(z,{align:"flex-start",ga
2p:2,children:[e.jsx(u,{flexShrink:0,bg:n.white.DEFAULT,border:"2px solid",borderColor:n.success[200],borderRadius:"xl",p:2,display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(W,{as:Sr,boxSize:5,color:n.success[700]})}),e.jsxs(u,{children:[e.jsx(l,{fontWeight:"bold",fontSize:"sm",color:n.text.label,mb:1,children:"Why we need this"}),e.jsx(l,{fontSize:"xs",color:n.text.gray,lineHeight:"1.6",children:"To comply with NAICOM regulations and generate an accurate motor insurance quote, we need to verify your company through the Corporate Affairs Commission."})]})]})}),tt=({label:t,value:r})=>e.jsxs(u,{children:[e.jsx(l,{fontSize:"sm",color:n.text.gray,mb:.5,children:t}),e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.label,wordBreak:"break-word",children:r})]}),Ta=({onConfirm:t,verifyBusinessAsync:r})=>{const[s,o]=x.useState(null),[i,a]=x.useState(null),{verifyBusinessAsync:d,isLoading:c}=oi(),[p,h]=x.useState(!1),b=Co(),m=s?.isVerified&&s?.status==="VERIFIED",g=s!==null||i!==null,f=g&&!m,{register:j,control:P,handleSubmit:T,setValue:S,formState:{errors:k,isValid:_}}=we({defaultValues:{businessType:"limited_company",cacNumber:""},mode:"onChange"}),L=()=>{o(null),a(null),S("cacNumber","")},I=async A=>{if(m&&s){t(s);return}a(null);const E=wo({businessType:A.businessType,registrationNumberWithoutPrefix:A.cacNumber});try{const C=r?await(async()=>(h(!0),r(E)))():await(async()=>{const Y=(await d({rcNumbers:[E]})).data?.[0];if(!Y)throw new Error("Business not found. Please check your CAC number and try again.");return Y})(),R=C.status==="VERIFIED"&&C.isVerified===!0;o(C),R||a(C.reason??"Verification failed. Please check your CAC number and try again.")}catch(C){if(b(C))return;a(te(C)??"Verification failed. Please check your CAC number and try again.")}finally{h(!1)}},D=s?.details?.headOfficeAddress||s?.details?.branchAddress||"N/A",M=s?.details?.registrationDate,U=M?As(M,"en-NG",{dateStyle:"medium"}):"N/A",q=s?.details?.classification,V=q?To(q):"N/A";return e.jsx(Ca,{children:e.jsxs(v,{gap:6,align:"stretch",children:[e.jsx(Pa,{}),e.jsx("form",{onSubmit:T(I),children:e.jsxs(v,{gap:3,align:"stretch",children:[e.jsxs(u,{children:[e.jsxs(z,{gap:.5,mb:2,children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.info,children:"Business type"}),e.jsx(l,{fontSize:"md",color:n.error[500],children:"*"})]}),e.jsx(Q,{name:"businessType",control:P,rules:{required:"Select a business type"},render:({field:A})=>e.jsx(qe,{options:Po,value:A.value,onChange:E=>{A.onChange(E)},onBlur:A.onBlur,placeholder:"Select business type",isDisabled:g,hasError:!!k.businessType,borderRadius:"full"})}),k.businessType?.message&&e.jsx(l,{fontSize:"xs",color:n.error[500],mt:1,children:k.businessType.message})]}),e.jsxs(u,{children:[e.jsxs(z,{gap:.5,mb:2,children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.info,children:"Registration number"}),e.jsx(l,{fontSize:"md",color:n.error[500],children:"*"})]}),e.jsx(l,{fontSize:"xs",color:n.text.gray,mb:2,children:"Enter the number only (no RC, BN, or IT prefix). We add the correct prefix from your business type."}),e.jsx(se,{placeholder:"e.g. 1234567",border:`1px solid ${n.border.primary}`,bg:"white",_hover:{bg:"white"},hasError:!g&&(!!k.cacNumber||!!i),error:g?void 0:k.cacNumber?.message??i??void 0,disabled:g,...j("cacNumber",{required:"Registration number is required",minLength:{value:5,message:"Please enter a valid registration number"},validate:A=>{const E=A.trim();return/^(RC|BN|IT)/i.test(E)?"Enter the number only, without RC, BN, or IT at the start":!0}})})]}),e.jsxs(z,{justify:"center",gap:2,py:1,children:[e.jsx(W,{as:Cr,boxSize:4,color:n.success[500]}),e.jsx(l,{fontSize:"xs",color:n.text.gray,children:"Your data is encrypted and completely safe"})]}),s&&m&&e.jsx(u,{border:"1px solid",borderColor:n.success[200],bg:n.success[50],borderRadius:"xl",p:3,children:e.jsxs(z,{gap:2,children:[e.jsx(u,{bg:n.success[100],border:"2px solid",borderColor:n.success[300],borderRadius:"xl",p:1.5,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:e.jsx(W,{as:Sr,boxSize:4,color:n.success[700]})}),e.jsxs(u,{children:[e.jsxs(l,{fontWeight:"semibold",fontSize:"sm",color:n.success[700],children:["Company verified: ",s.name]}),D!=="N/A"&&e.jsx(l,{fontSize:"xs",color:n.text.gray,mt:.5,wordBreak:"break-word",children:D})]})]})}),s&&m&&e.jsx(u,{border:"1px solid",borderColor:n.border.primary,borderRadius:"xl",p:4,bg:"white",children:e.jsxs(fe,{templateColumns:{base:"1fr",sm:"1fr 1fr"},gap:4,children:[e.jsx(tt,{label:"Company Name",value:s.name}),e.jsx(tt,{label:"Registered Address",value:D}),e.jsx(tt,{label:"Date of Incorporation",value:U}),e.jsx(tt,{label:"Company Type",value:V}
2)]})}),f&&e.jsx(u,{border:"1px solid",borderColor:n.error[200],bg:n.error[50],borderRadius:"xl",p:3,children:e.jsxs(z,{gap:2,align:"flex-start",children:[e.jsx(u,{bg:n.error[100],border:"2px solid",borderColor:n.error[300],borderRadius:"xl",p:1.5,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:e.jsx(W,{as:xn,boxSize:4,color:n.error[700]})}),e.jsxs(u,{flex:1,children:[e.jsx(l,{fontWeight:"semibold",fontSize:"sm",color:n.error[700],children:s?`Verification failed: ${s.name}`:"Verification failed"}),e.jsx(l,{fontSize:"xs",color:n.error[600],mt:.5,children:s?.reason??i??"Please check your registration number and try again."})]})]})}),f&&e.jsx(N,{buttonType:"primary",text:"Try again",fullWidth:!0,size:"lg",h:"60px",type:"button",onClick:L,mt:2}),!f&&e.jsxs(e.Fragment,{children:[e.jsx(N,{buttonType:"primary",text:m?"Continue":"Verify Business",fullWidth:!0,size:"lg",h:"60px",type:"submit",loading:r?p:c,disabled:!_,mt:s?2:6}),m&&e.jsx(N,{buttonType:"text",text:"Not Your Business?",type:"button",size:"sm",onClick:L,mt:1})]})]})}),!g&&e.jsx(wa,{})]})})},rt=(t,r,s)=>{const o=new Date(s,r,t);o.setHours(0,0,0,0);const i=new Date;return i.setHours(0,0,0,0),o.getTime()>i.getTime()},Ia=({value:t,onSelect:r,onCancel:s,disableFutureDates:o=!1})=>{const i=new Date,a=Rs(t),d=!a||o&&rt(a.day,a.month,a.year)?null:a,[c,p]=x.useState(a?.year??i.getFullYear()),[h,b]=x.useState(a?.month??i.getMonth()),[m,g]=x.useState(d),f=ks(c,h),j=!o||c<i.getFullYear()||c===i.getFullYear()&&h<i.getMonth(),P=()=>{h===0?(b(11),p(I=>I-1)):b(I=>I-1)},T=()=>{j&&(h===11?(b(0),p(I=>I+1)):b(I=>I+1))},S=(I,D,M)=>m?.day===I&&m?.month===D&&m?.year===M,k=(I,D,M)=>i.getDate()===I&&i.getMonth()===D&&i.getFullYear()===M,_=()=>{m&&(o&&rt(m.day,m.month,m.year)||r(Ns(m.day,m.month,m.year)))},L=!m||o&&rt(m.day,m.month,m.year);return e.jsxs(u,{bg:"white",borderRadius:"2xl",p:6,w:"100%",children:[e.jsxs(w,{align:"center",justify:"space-between",mb:5,children:[e.jsxs(w,{align:"center",gap:1,cursor:"default",userSelect:"none",children:[e.jsxs(l,{fontSize:"lg",fontWeight:"bold",color:n.navy[700],children:[Vs[h]," ",c]}),e.jsx(u,{color:n.orange[500],children:e.jsx(fr,{size:16})})]}),e.jsxs(w,{gap:1,children:[e.jsx(u,{as:"button",onClick:P,color:n.orange[500],p:1.5,borderRadius:"lg",_hover:{bg:n.orange[50]},children:e.jsx(gn,{size:18})}),e.jsx(u,{as:"button",onClick:T,color:j?n.orange[500]:n.gray[300],p:1.5,borderRadius:"lg",cursor:j?"pointer":"not-allowed",...j?{_hover:{bg:n.orange[50]}}:{},"aria-disabled":!j,children:e.jsx(Pr,{size:18})})]})]}),e.jsx(fe,{templateColumns:"repeat(7, 1fr)",mb:2,children:Es.map(I=>e.jsx(l,{textAlign:"center",fontSize:"xs",fontWeight:"bold",color:n.navy[700],children:I},I))}),e.jsx(fe,{templateColumns:"repeat(7, 1fr)",gap:.5,children:f.map(({day:I,month:D,year:M,current:U},q)=>{const V=S(I,D,M),A=k(I,D,M),E=o&&rt(I,D,M),C=U&&!E;return e.jsx(u,{as:"button",onClick:()=>C&&g({day:I,month:D,year:M}),textAlign:"center",py:"6px",borderRadius:"xl",fontSize:"sm",fontWeight:V?"semibold":"normal",border:V?`1.5px solid ${n.orange[500]}`:A?`1px solid ${n.orange[300]}`:"1.5px solid transparent",bg:V?n.orange[50]:"transparent",color:C?V?n.orange[600]:n.text.primary:n.gray[300],_hover:{bg:C?n.orange[50]:void 0},cursor:C?"pointer":"default",children:I},q)})}),e.jsxs(w,{justify:"space-between",align:"center",mt:5,children:[e.jsx(N,{buttonType:"text",text:"Cancel",onClick:s}),e.jsx(N,{buttonType:"primary",text:"Select",onClick:_,disabled:L})]})]})},nr=({label:t,selected:r,onClick:s})=>e.jsx(u,{as:"button",textAlign:"center",py:"7px",borderRadius:"xl",fontSize:"sm",fontWeight:r?"semibold":"normal",border:r?`1.5px solid ${n.orange[500]}`:`1px solid ${n.gray[100]}`,bg:r?n.orange[50]:"transparent",color:r?n.orange[600]:n.text.primary,onClick:s,_hover:{bg:n.orange[50]},children:t}),Aa=({value:t,onSelect:r,onCancel:s})=>{const o=xo(t),[i,a]=x.useState(o.hour),[d,c]=x.useState(o.minute),[p,h]=x.useState(o.period),b=()=>{r(go(i,d,p))};return e.jsxs(u,{bg:"white",borderRadius:"2xl",p:6,w:"100%",children:[e.jsx(l,{fontSize:"lg",fontWeight:"bold",color:n.navy[700],mb:5,children:"Select Time"}),e.jsxs(v,{align:"stretch",gap:4,children:[e.jsxs(u,{children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.info,mb:2,children:"HOUR"}),e.jsx(fe,{templateColumns:"repeat(6, 1fr)",gap:1.5,children:_s.map(m=>e.jsx(nr,{label:m,selected:i===m,onClick:()=>a(m)},m))})]}),e.jsxs(u,{children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.info,mb:2,children:"MINUTE"}),e.jsx(fe,{templateColumns:"repeat(6, 1fr)",gap:1.5,children:Ds.map(m=>e.jsx(nr,{label:m,selected:d===m,onClick:()=>c(m)},m))})]}),e.jsxs(u,{children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.info,mb:2,children:"PERIOD"}),e.jsx(w,{gap:2,children:Ls.map(m=>e.jsx(u,{as:"button",flex:1,textAlign:"center",py:"8px",borderRadius:"xl",fontSize:"sm",fontWeight:p===m?"semibold":"normal",border:p===m?`1.5px solid ${n.orange[500]}`:`1px solid ${n.gray[100]}`,bg:p===m?n.orange[50]:"transparent",color:p===m?n.orange[600]:n.text.primary,onClick:()=>h(m),_hover:{bg:n.orange[50]},children:m},m))})]})]}),e.jsxs(w,{justify:"space-between",align:"center",mt:6,children:[e.jsx(N,{buttonType:"text",text:"Cancel",onClick:s}),e.jsx(N,{buttonType:"primary",text:"Select",onClick:b})]})]})},Ra=Xe({incidentDate:X().min(1,"Incident date is required"),timeOfIncident:X().min(1,"Time of incident is required"),preciseLocation:X().min(3,"Location is required")}),iu=({onContinue:t})=>{const[r,s]=x.useState(!1),[o,i]=x.useState(!1),{register:a,handleSubmit:d,setValue:c,control:p,formState:{errors:h}}=we({resolver:ht(Ra)}),b=at({control:p,name:"incidentDate"}),m=at({control:p,name:"timeOfIncident"});return e.jsxs(e.Fragment,{children:[e.jsx(u,{py:{base:4},children:e.jsx(u,{borderRadius:"3xl",border:"1px solid",borderColor:n.border.primary,p:{base:6,md:14}
2,pb:{base:20,md:32},w:"100%",boxShadow:"sm",background:`radial-gradient(ellipse at bottom right, #DBEAFE 0%, #EFF6FF 30%, transparent 40%), ${n.white.DEFAULT}`,children:e.jsxs(v,{align:"stretch",children:[e.jsx(xe,{fontSize:{base:"2xl",md:"3xl"},color:n.text.primary,fontWeight:"bold",lineHeight:"1.2",children:"Accident Details"}),e.jsx(l,{fontSize:"md",color:n.text.info,children:"Confirm when and where the accident happened."}),e.jsx("form",{onSubmit:d(t),children:e.jsxs(v,{align:"stretch",children:[e.jsxs(ye,{columns:{base:1,md:2},gap:4,children:[e.jsx(se,{label:"Incident Date",labelColor:n.text.info,leftIcon:e.jsx(bn,{size:16,color:n.orange[500]}),placeholder:"DD-MM-YYYY",value:b||"",readOnly:!0,cursor:"pointer",onClick:()=>s(!0),error:h.incidentDate?.message,hasError:!!h.incidentDate,border:`1px solid ${n.border.primary}`}),e.jsx(se,{label:"Time of Incident",labelColor:n.text.info,leftIcon:e.jsx(yn,{size:16,color:n.orange[500]}),placeholder:"e.g. 7:30PM",value:m||"",readOnly:!0,cursor:"pointer",onClick:()=>i(!0),error:h.timeOfIncident?.message,hasError:!!h.timeOfIncident,border:`1px solid ${n.border.primary}`})]}),e.jsx(se,{...a("preciseLocation"),label:"Precise Location",labelColor:n.text.info,leftIcon:e.jsx(fn,{size:16,color:n.orange[500]}),placeholder:"e.g. Apo Bridge, Abuja",error:h.preciseLocation?.message,hasError:!!h.preciseLocation,border:`1px solid ${n.border.primary}`}),e.jsx(w,{justify:"flex-end",mt:2,children:e.jsx(N,{size:"lg",buttonType:"primary",text:"Continue",type:"submit"})})]})})]})})}),e.jsx(Ie,{open:r,onClose:()=>s(!1),showCloseButton:!1,bodyPadded:!1,contentProps:{borderRadius:"2xl",overflow:"hidden",maxW:"380px"},children:e.jsx(Ia,{value:b,onSelect:g=>{c("incidentDate",g,{shouldValidate:!0}),s(!1)},onCancel:()=>s(!1)})}),e.jsx(Ie,{open:o,onClose:()=>i(!1),showCloseButton:!1,bodyPadded:!1,contentProps:{borderRadius:"2xl",overflow:"hidden",maxW:"380px"},children:e.jsx(Aa,{value:m,onSelect:g=>{c("timeOfIncident",g,{shouldValidate:!0}),i(!1)},onCancel:()=>i(!1)})})]})},ka="data:image/webp;base64,UklGRjQQAABXRUJQVlA4WAoAAAAQAAAAggAAggAAQUxQSEoGAAABoAPbtupG+qF7WAo9obJhUKjJRuEwc8TMzMzMzBlTxDPyMDNEbuaWG1Uj93lV+vee+/7991d1GBEOJEkKmkXPFQ+4PYzB5AfFtl9Z0D/llH674ez1YUrDmVPbzWaiDF/vN5sp8li3ocwov13WbiDLKDMntxvLaKNXeg1jueT2bjOZOcap7SawymU0c3C7WSx7jLCNdjzp/WFyKwtv74TEAZ+NklWaN8buMynBdxt+3F8QDdeLHfpSI8dof5eUcW50UqjKzkLUsw2vWxAOugKe22WhUCoWDt7TsKIXBt3nRpJDwJcMpoOwx0quTiTgSS8LwpRc5upbtbATxwNaL3TXcHO/LAJD0gbk4OszaNXskaVUX/EcoVc3gzIZRVR5JeHkunDgSwt1yklTOpxzub4e7PrSXEpjKjYZVRZBddxez5fhs1SYsrInORWkd6gwIuKYoZ11lGqJYPtDERKP0HkdU1fLhUaAgBiwzxqvsWqNQ5mYWGgNiAzqYKRD3wp8KqIhSxGIXmMMipAGQq608xkizUuBjSBEoiGSToaqDAcArEIOofaMdoqFNBoQm7YsG0QxCyWuC5NsZNoOpQSiGquhng9OSDhBT2gXxmzwSFQiInbEP2WyPiMJYFCxhTMAkcLSQAYo9bKKFBNIkuq2sFOd2R+iPZVzJj2/E6TZd9eIIBDvhKqEmQaARrLp5f4eC0VNuOeRJMjKqQIpP0/rl+2gLtDJNmqsO2HQCguVdeMIHgtUDiRkKLG+HokwwJhzs9vyDBKV9tnLa14kZA4puc6ORj57rFvUZYjU3Kalle5bXlugfnipwGoCWQcbdx11gwpq9OFBU0XpIgLLZ3WeGM1B/VOibFJ6KzP3Zbe3i3oBScgOlgQZBGHdW/KvDF/p1QoY2cyajfHyl6fpi78INPN/kVoB2im7JUUgJVs+3jJzcFv99DFf8UfwGk2lEUpWZmb4M+8HqPC/SK0AD0Bj64rl4yyd41g/grcG1mzDcvp/TDLt+b/IdH2PREysIBwJ+WxrxTFq6ki7cqmQRNz47v+L+K/WoB2MVLO5UAsmX3J/2/+pLFxTtqv+tce5zHS9DZ1x45o2shbeW8d35Z5g9Qsdw8RPuclQ4Ov6ftt7nUJOjPtN54TfC45kdJ2rkSBCpUDCWAs4Iy3seZo8NYA1KJXsSF5f4LZUosq4POpr3aCe24q+q8nURGedReTs/pirEdq0wHyR8N/T99NuYNpAVYHqy2gFRPpbpDVgijN0mYTME09E1XK54zc0gZDDgsjNNOCI152+m/JlICcAmInw2H7ruBtQvTYALhdu26jvBUhpVGbeCFmpcFk8XF6DSULKvDXBLDIWBdwq31vgulqr8DDKKsZkVDT/dbzeZUX00o9LZoFA2DIMppbEVfXCwY6LBKGLt9OXrD5Ka4Tn4Hqr6yMR9oTDduSRwG+EjxY4IWmAKi1tvjQaXnUs3MPhcP1vhsKxrY7emllJgsM2Osqj0+6zQ6Jq9tafs1syVyNTcRYK/Q+GSbJOMcgQjOxp90vE915LtlN/k6yYANSX6kIyIjL6q/hys9DtRWb66Sc77B/bKvmGrDGKxxPJuwyQ1QI65TwQx6ZH14a8ZLMA5BkPC6FAkmvknESTMS06RERD1SchywljsdB9dY5ibi4r4YDx0Qt4UrSOHmhJc6/3v1bJBVFo3nY6rknHlVADOfe3CUo2xe6HEtBt9U42UVMV/o3unxOsKAFSo9Qi855ENBTFocdNkU8FMuQBGRuqmZrL65ZE8FaA6E9vCIuTt6j3EDbbNNtG0uOioy6cfseKSX4JK5Nt1UQ+KU6bk+EvuOSPTanaXEfGgvvKqo3X3HTG3gcbCwizk9AoWnfMprT4/I5ezkB7kVPoi3FRFN3TLttPh3DHHLtIlrgqH1UQrfReFYS4jnVlc1A2Omlg0Pk07+ESkFz/G5Bx1yFWtc/7xpyecfJ8Dmbc3jcgN1rdLMgHg/k8QiUTl9zxb4LuL9BJPYtLqJqmomj1B3PEMd91tqsQeYzK73CDk4v4ZY87VshOctn57G+p4GNMWlVgTSl9cUQmaw4qsCZhWL2fJjRZKJ0t1jAseKO8hhzWrNO5HNa8w2OTI2FNLa1XtiQ4s6AruOWL7+4UDS+d7m7FtlUpAFZQOCDECQAAUC4AnQEqgwCDAD5tMJRHpCKiISnymyCADYlkANZqEz0f8V5k/K/c/8GgIugekfOz6GvMJ/ST9X+uV5iv3B9Xv0Xf4b1C/+V1JXoc9KV/cvOV6+XfO/wz/UDzC/zUiu3PZl8phlhTG/7F6Oudx649g/pYHCm9UdAyHh4Wiv+5hgjeEcwz/av5EfacJxqUndI9qf8RQgwBxp+dFA9V5aHWib3FqubGNr8wz6YTzX8aWUP73PVHWqfT7kRl9QH2HG5EQUOSGyMK+kLxGHg5G4g8d6RojAju6gn9AgLz30Feb3xVofou8I8/2eV+pNqHvGJkVFNM83MUB9O0rdk6pR4z6D80VcN1EAQC6RjGNmRD/KbNCXvfTl8BlI9WD0IxedM53BymhaFuIW/U7LS0WoSBbAsyoD++qfu07/tuwUYPLdd4Lbut6TakTVvbqALJ3yEBlsGOvQk94xG+mkiz0hL17xivtBoOF1z8/PRgZN01kKyW/22/v077mRF1AAD+/PhHb+QbDjSR9xohIoplIYsSjGHNiI0XnIMeoSiYN3WojJVS68NXZl3L7NZYXot9L64R7a0f0f4piubB+eSrMgs1UnBj9kz0oNRmQV/3yDXE0fIwsjA022sSLsaRef2VbGQVX/PQi5uqwezxbcxWhojkF5TWNC/PvlZjvC1J9hk0AQEDjbiBX9WS0u8B8DFD1ZeO9+t/3Bvlu8OvrXT3IefrvizcovvNxJC58Uv6n6s/5FW5V6XYlMIYjWvrx/zHQ34vtOZjA97hf23NVIjfQPYH75wDZO2JLNYo6XJLyNW57bvtYHZGCqGoo/9py3KF2dYm4/Ndvy0P1Ph32xCUxpddp1qamUAUQ+9fYZckUc1JPHr7zVkR1MZO19lshgFs5I7aoqyQUgVTZwwsE3b5TPVaVqBR6/S8GUUOnqAD+T8NStkFgYB7CXvOIbxA//H54hvgYWHcfaebl8hf0EJaPlLc03TrMe93dpqC5hAwiyuwYTHo/jPrLb6vtd8LTucSRMu7uc2OE+bU/E56M/7JuMdLGyJTx7SCCO7EYPyneiJ2ReDjWFsvtbOVtGqzaywzSOTHQqa8czch0jdpoJUx+80Cf6QU7x6pbby9akYMryX8HSNXPFQtWVOwrtZUcBXDNZUoiQCDYreqdR7KgsyyxlETc/D441meLElaMAv17mkunSPSGS1w98ISIyAiGgLhI1MMgPl8vZZlCwrbNk1Ufscc+WfdfljOJ5Ix+0F4wbkqTHR82MwLTO0EUcpmjih9SzgiGe8FnKG+GdXN9pkevndUoTwJKypab6cZ57zdT+2+W54hf/7L/DnmYkq4ZH2PtJWrF/AhEVpWD1TJrUfSj5wKdCFWpSwO54o1iey9DyzeXCG/yBjspSlzGD1CNrF/S57k8R0ijOZcoNt3p
2pM0oso4mIT18Vs/EdcvVDNQ8gZXdq+wgPXcHwjPJY2SA5/ZKKcImFL273ua31QWNNyD76mxwI1LttJL6Xv57Nnq8RkZP2DW6U/J4zGpdWVkxD/U0NosIsl/Ip0nTD4J67nwgp6nLxfutTxYI937GcE3xaN7jA0l8f7GjWgKGZ37KfnZKuTR1jUJL5/sTEjWzdYGp6RKjF09u8zpWoq5RGJ2aEIWKbq37jh0iJcN5cwdBGKEvpP3Pkj7FKUh7+N1nD+JCIPdsnwvVYwiSBnWeZ7BQ9hMNb1SJ/JCmvAgjaDkeZeMqESaKDg2j5YaF3JhAFXerLX0+jd1PTcRQWML94btyVu78mk2DZGZjb0bmt3IejPFe08p7yG+TAxjeg+dNGNcF0HgPW7kpQoKJzOif9AycE50hCxXWzckcvCxUIHaWMauomVTNuwQO/huLugA9jl7lCZMHfbuyKjiM8ksQcrywtdZtNs+nq+fdUh8dbnBidPiZZIfOvZDFwDi25n5fiXI4CLhogpDVz1fG0SNRBHUCwojQg6jIF4FPXJZJsHbdI/nYU37eo5enV1xs3pmqShVgS97yd6fRSRs6f1U3basJWmaPPQYRjMLBAn5cFVQ7c5x+2oy1LnwTz8liYJw551rEX7q8x9FKe+qH5tr5gRbPVFMFrMFkd0AZ4mXuioE3TgBGeBk6SDL82ghE2qKATzUgCVvKIdVhZ5U8IVg2KedFEe8COKtVBuoFfXXA+B+R4wK29xsOXtNE42At686odozq2FJyDBa5EiW7lkGUMH93/3gZqs73huiJhkY8YoVSp9MRq/M/glqxYYrMlx+LAmLxHP7RmXaaVel+P/aN2+XBGb9IEeywkqqaIeeWE+DsBrjfJ4jWUeb8T2AQwf45EH2FBicJARYQBjKwcFsW8C5EVLVU9Nw5L6O311pD+B/njgW/kjajOy206RhmU3hxIvzuTuTZd/w55hM1JKQIbaHy9d5BYsX0sSs4LZvRA13abmovpB5vkxOdcbXH8bW4guaRqgwSlktNiWm7ZGMoNXf8JGxFjWFso7SyyjCwrcoTJV8Vo21t7RATJPwVsGpCtJdMefrlJjhu/r660BXzgjXqUDyPk+KDSiDVORqIh2UkU3T/xjjdG5mOPnSN4n43HyIm32i+O6MjmPO2nivLQETrZR9nKmJhEwHWWAN/AlpY1bugCv96RLKYj7VLarBfjRiRLUtAmWw3/XGPzTRJUBzWLBf5f83i1pcqOKQ4Vo3HedqmmkQJbsPA+HpkgSZzKhXoW8JrRghUDoyXZIgX0QxT8zrXTPi6VIllj6NhCxl0M7qQrVkoTsRrPOkWCIyzHXQb/h1HEGIzayN/nVpXQ+wvII/0RssAWkHIdewXVfohPX76LtXDmiSl9gr3gzS2snjTPGcVj7BkmD5M9xa5PsYvrMZ1qWvNi0BGYbB8J8weUbc+nR67MSoO4afMUDOStQVoW2Hx/jdHrI31oDSDt6SEqVL0jOV+cqWAsm3OdPQ0vDkzkQ0wbY9POnPjs6PMKXDPaTYuZPpawmnH2N2FahRDB23zGEqgALi6DxtCqPi8v10InrkMSBepxM6FeQUc3a0CPbItYf3BKacxDPLkoM3YsuWARQsmEwE1/L1P3iJc95w/ZlZCXFymLRzs56UF2XJx3kedEJBc0wQjSjf7iqwZicbIfYiBHHd+8X0gAcZeitkM9jgT7s4G1/VmsqPdNCQWZUyIn3V4ycKTuVwlICw1JVo5hbuWPJKry4Q5DYcAK4inhJvDTXxAQjloTDd+bQB37OQnyj6yJtd/tjwMJktwcVaup8B98PhxD1yn+Nkyg873A/86Wl9UqfoaH8HZKXt+8BrXCwl5zkkdUSwWk3SJUf6DcmQCzZGSYOnrQf//qC9f//yy6AAAA==",Va=Xe({fullName:X().min(2,"Full name is required"),phoneNumber:X().min(1,"Phone number is required").refine(yo,"Please enter a valid phone number"),driverNin:X().min(1,"Driver NIN is required").refine(bo,"Please enter a valid NIN (11 digits)"),vehiclePlateNumber:X().min(3,"Plate number is required")}),au=({onContinue:t})=>{const{register:r,handleSubmit:s,formState:{errors:o,isValid:i}}=we({resolver:ht(Va),mode:"onChange"});return e.jsx(u,{borderRadius:"2xl",border:`1px solid ${n.gray[100]}`,p:{base:6,md:8},w:"100%",mt:4,background:"radial-gradient(ellipse at center, #FEFEFC 0%, #FBFEFD 70%, #FBFEFD 100%)",children:e.jsxs(v,{gap:6,align:"stretch",children:[e.jsx(w,{justify:"center",children:e.jsx(ue,{src:ka,alt:"driver details icon",w:"70px",h:"70px",objectFit:"contain"})}),e.jsxs(v,{gap:1,align:"center",children:[e.jsx(xe,{fontSize:{base:"3xl",md:"4xl"},fontWeight:"bold",color:n.text.primary,textAlign:"center",mb:2,children:"Third-Party Information"}),e.jsx(l,{fontSize:"md",color:n.text.info,maxW:"300px",textAlign:"center",lineHeight:"1.2",children:"Provide details of the other party involved in the accident."})]}),e.jsxs(u,{border:`1px solid ${n.gray[100]}`,borderRadius:"xl",p:5,bg:n.white.DEFAULT,children:[e.jsxs(z,{gap:2,mb:4,children:[e.jsx(jn,{size:18,color:n.orange[500]}),e.jsx(l,{fontWeight:"semibold",fontSize:"sm",color:n.orange[500],children:"Driver Details"})]}),e.jsx("form",{onSubmit:s(t),children:e.jsx(v,{gap:4,align:"stretch",children:e.jsxs(ye,{columns:{base:1,md:2},gap:4,children:[e.jsx(se,{...r("fullName"),label:"Full Name",labelColor:n.text.primary,placeholder:"John Alex",error:o.fullName?.message,hasError:!!o.fullName,border:`1px solid ${n.border.primary}`,bg:n.white.DEFAULT}),e.jsx(se,{...r("phoneNumber"),label:"Enter phone number",labelColor:n.text.primary,placeholder:"Enter Driver Phone",type:"tel",error:o.phoneNumber?.message,hasError:!!o.phoneNumber,border:`1px solid ${n.border.primary}`,bg:n.white.DEFAULT}),e.jsx(se,{...r("driverNin"),label:"Driver NIN",labelColor:n.text.primary,placeholder:"Enter Driver NIN Number",inputMode:"numeric",maxLength:11,error:o.driverNin?.message,hasError:!!o.driverNin,border:`1px solid ${n.border.primary}`,bg:n.white.DEFAULT}),e.jsx(se,{...r("vehiclePlateNumber"),label:"Vehicle Plate Number",labelColor:n.text.primary,placeholder:"Enter Vehicle Plate Number",error:o.vehiclePlateNumber?.message,hasError:!!o.vehiclePlateNumber,border:`1px solid ${n.border.primary}`,bg:n.white.DEFAULT})]})})})]}),e.jsx(w,{justify:"center",children:e.jsx(N,{buttonType:"primary",text:"Continue",onClick:s(t),disabled:!i,minW:"200px"})})]})})},ss="/assets/bus-CHKIFYxS.webp",ns="/assets/car-DXDSbbCl.png",os="/assets/mini_truck-Cj2oIdpB.webp",is="/assets/suv-DTdhtjR0.webp",as="/assets/tricycle-BUBxk1OH.webp",ls="/assets/truck-HcRFC7a_.webp",cs=[{value:"CAR",label:"CAR",icon:ns},{value:"SUV",label:"SUV",icon:is},{value:"BUS",label:"BUS",icon:ss},{value:"TRICYCLE",label:"TRICYCLE",icon:as},{value:"MINI_TRUCK",label:"MINI TRUCK",icon:os},{value:"TRUCK",label:"TRUCK",icon:ls}],Ea=".jpg,.jpeg,.png,.webp",Wt=10,ct=11,or={plateNumber:"",chassisNumber:"",engineNumber:"",vehicleType:"CAR",make:"",model:"",year:"",sumInsured:""},jt=(t,r=1)=>X().transform(s=>s.trim()).pipe(X().min(r,t)),Na=({requiresSumInsured:t})=>Xe({plateNumber:X().transform(r=>r.trim().toUpperCase()).pipe(X().min(6,"Enter a valid plate number").max(8,"Plate numbers are at most 8 characters")),chassisNumber:X().transform(r=>r.trim().toUpperCase()).pipe(X().min(ct,`VIN must be at least ${ct} characters`).max(17,"VIN is at most 17 characters")),engineNumber:X().transform(r=>r.trim().toUpperCase()).pipe(X().min(4,"Enter your engine number")),vehicleType:jt("Please select a vehicle type"),make:jt("Select your vehicle make"),model:jt("Select your vehicle model"),year:X().transform(r=>r.trim()).superRefine((r,s)=>{const o=Wr(r);o!==!0&&s.addIssue({code:"custom",message:o})}),sumInsured:X().transform(r=>r.trim()).superRefine((r,s)=>{t&&(!r||Number(r)<=0)&&s.addIssue({code:"custom",message:"Enter your vehicle's value"})})}),st=({label:t,error:r,children:s})=>e.jsxs(v,{gap:1.5,align:"stretch",w:"100%",children:[e.jsx(l,{fontSize:"xs",fontWeight:"medium",color:n.text.primary,children:t}),s,r?e.jsx(l,{fontSize:"xs",color:"red.500",children:r}):null]}),ds="48px",vt={h:ds,px:3,fontSize:"sm"},ir={h:ds,bg:"white",borderRadius:"xl",border:"1px solid",fontSize:"sm",color:n.gray[800],px:3},_a=({control:t,make:r,isDisabled:s})=>{const o=x.useMemo(()=>ra(),[]),i=x.useMemo(()=>na(),[]),a=x.useMemo(()=>sa(r),[r]),d=a.length===0;return e.jsx(u,{bg:n.gray[50],border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",p:{base:4,md:6},children:e.jsxs(v,{gap:4,align:"stretch",children:[e.jsxs(ye,{columns:{base:1,sm:2},gap:4,children:[e.jsx(Q,{name:"make",control:t,render:({field:c,fieldState:p})=>e.jsx(st,{label:"Make",error:p.error?.message,children:e.jsx(qe,{options:o,value:c.value,onChange:c.onChange,onBlur:c.onBlur,placeholder:"Select make",isDisabled:s,hasError:!!p.error,borderRadius:"xl",searchable:!0,flip:!0,triggerProps:vt})})}),e.jsx(Q,{name:"model",control:t,render:({field:c,fieldState:p})=>e.jsx(st,{label:"Model",error:p.error?.message,children:d?e.jsx(it,{...ir,value:c.value,onChange:c.onChange,onBlur:c.onBlur,name:c.name,placeholder:r?"e.g. Corolla":"Select a make first",disabled:s||!r,borderColor:p.error?"red.500":n.border.primary}):e.jsx(qe,{options:a,value:c.value,onChange:c.onChange,onBlur:c.onBlur,placeholder:"Select model",isDisabled:s,hasError:!!p.error,borderRadius:"xl",searchable:!0,flip:!0,triggerProps:vt})})})]}),e.jsxs(ye,{columns:{base:1,sm:2},gap:4,children:[e.jsx(Q,{name:"year",control:t,render:({field:c,fieldState:p})=>e.jsx(st,{label:"Year",error:p.error?.message,children:e.jsx(qe,{options:i,value:c.value,onChange:c.onChange,onBlur:c.onBlur,placeholder:"Select year",isDisabled:s,hasError:!!p.error,borderRadius:"xl",searchable:!0,flip:!0,triggerProps:vt})})}),e.jsx(Q,{name:"engineNumber",control:t,render:({field:c,fieldState:p})=>e.jsx(st,{label:"Engine number",error:p.error?.message,children:e.jsx(it,{...ir,value:c.value,onChange:h=>c.onChange(h.target.value.toUpperCase()),onBlur:c.onBlur,name:c.name,placeholder:"e.g. 2NZ1234567",disabled:s,autoCapitalize:"characters",autoComplete:"off",borderColor:p.error?"red.500":n.border.primary})})})]})]})})},Da=[{value:"CAR",label:"Car",icon:ns},{value:"SUV",label:"SUV",icon:is},{value:"BUS",label:"Bus",icon:ss},{value:"TRICYCLE",label:"Tricycle",icon:as},{value:"MINI_TRUCK",label:"Mini Truck",icon:os},{value:"TRUCK",label:"Truck",icon:ls}],Rt={type:"spring",stiffness:420,damping:30},dt='"License Plate", "Oswald", "Arial Black", sans-serif',La=8,Ma=17,za=t=>
2t?`₦${Number(t).toLocaleString("en-NG")}`:"",Fa=t=>t.replace(/\D/g,""),Ot=({value:t,onChange:r,onBlur:s,name:o,isDisabled:i=!1})=>e.jsx(it,{value:za(t),onBlur:s,name:o,onChange:a=>r(Fa(a.target.value)),placeholder:"₦0.00",disabled:i,inputMode:"numeric",textAlign:"center",fontFamily:dt,fontWeight:"700",fontSize:{base:"4xl",md:"5xl"},lineHeight:"1",letterSpacing:"0.15em",color:n.navy[500],bg:"transparent",border:"none",h:{base:"80px",md:"96px"},px:2,_placeholder:{color:"#B0BAD0",fontFamily:dt,fontWeight:"700",letterSpacing:"0.15em"},_focus:{boxShadow:"none",outline:"none"},_disabled:{opacity:.6,cursor:"not-allowed"}}),Ae=({label:t,error:r,children:s,icon:o=wr})=>e.jsxs(v,{gap:1,align:"stretch",children:[e.jsxs(u,{w:"100%",borderRadius:"2xl",border:"1px solid",borderColor:n.border.primary,p:4,bg:n.gray[50],children:[e.jsxs(z,{mb:3,mt:3,gap:2,children:[e.jsx(W,{as:o,boxSize:4,color:n.text.orange}),e.jsx(l,{fontSize:"lg",fontWeight:"semibold",color:n.text.primary,children:t})]}),e.jsx(u,{borderRadius:"3xl",border:"2.5px solid",borderColor:"#B8C5E8",bg:"white",px:4,py:1,children:s})]}),r?e.jsx(l,{fontSize:"sm",color:"red.500",textAlign:"center",children:r}):null]}),Ba=({isSelected:t})=>e.jsx(u,{position:"absolute",top:2,right:2,children:e.jsx(u,{w:"18px",h:"18px",borderRadius:"full",border:"2px solid",borderColor:t?n.orange[500]:n.gray[300],display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.2s ease",children:e.jsx(Fn,{mode:"popLayout",children:t&&e.jsx(ot.span,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:Rt,style:{display:"block",width:9,height:9,borderRadius:"50%",background:n.orange[500]}},"vehicle-type-dot")})})}),Wa=({value:t,label:r,icon:s,isSelected:o,index:i,onSelect:a})=>{const d=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(t))};return e.jsx(ot.div,{role:"button",tabIndex:0,"aria-pressed":o,"aria-label":`Select ${r}`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...Rt,delay:i*.045},whileTap:{scale:.97},whileHover:{y:-2},onClick:()=>a(t),onKeyDown:d,style:{outline:"none",height:"100%"},children:e.jsxs(u,{h:"100%",cursor:"pointer",border:"1px solid",borderColor:o?n.orange[400]:n.border.primary,borderRadius:"xl",p:3,position:"relative",bg:o?n.orange[50]:"white",transition:"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.25s ease",boxShadow:o?"0 8px 24px rgba(242, 116, 32, 0.14)":void 0,_hover:{borderColor:n.orange[300]},children:[e.jsx(Ba,{isSelected:o}),e.jsxs(v,{gap:1,align:"start",pt:1,children:[e.jsx(ot.img,{src:s,width:32,height:32,alt:r,animate:{scale:o?1.08:1},transition:Rt}),e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.navy[500],children:r})]})]})})},Ut=({options:t,value:r,onChange:s,error:o})=>e.jsxs(u,{border:"1px solid",borderColor:o?"red.500":n.border.primary,borderRadius:"2xl",p:4,children:[e.jsxs(z,{gap:2,mb:4,children:[e.jsx(wr,{size:16,color:n.text.orange}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.navy[500],children:"Select Vehicle Type"})]}),e.jsx(fe,{templateColumns:{base:"repeat(2, 1fr)",md:"repeat(3, 1fr)"},gap:3,children:t.map((i,a)=>e.jsx(Wa,{value:i.value,label:i.label,icon:i.icon,isSelected:r===i.value,index:a,onSelect:s},i.value))}),o?e.jsx(l,{fontSize:"sm",color:"red.500",mt:3,children:o}):null]}),Oa=()=>e.jsxs(v,{gap:2,align:"stretch",children:[e.jsxs(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",lineHeight:"1.15",color:n.text.primary,children:["Tell us about"," ",e.jsx(l,{as:"span",color:n.text.orange,children:"Your Vehicle"})]}),e.jsx(l,{fontSize:"md",color:n.text.info,lineHeight:"1.6",children:"We could not retrieve your vehicle details automatically, so let's do this the manual way."})]}),gt=({variant:t,value:r,onChange:s,onBlur:o,name:i,isDisabled:a=!1,placeholder:d})=>{const c=t==="vin",p=c?Ma:La,h=b=>b.replace(/[^A-Z0-9]/gi,"").toUpperCase().slice(0,p);return e.jsx(it,{value:r,onChange:b=>s(h(b.target.value)),onBlur:o,name:i,placeholder:d??(c?"4T1BF3EKX5U817366":"ABC123XY"),disabled:a,autoCapitalize:"characters",autoComplete:"off",spellCheck:!1,textAlign:"center",fontFamily:dt,fontWeight:"700",fontSize:c?{base:"2xl",md:"3xl"}:{base:"4xl",md:"5xl"},letterSpacing:c?"0.12em":"0.15em",color:n.navy[500],bg:"transparent",border:"none",h:c?{base:"72px",md:"88px"}:{base:"80px",md:"96px"},px:2,_placeholder:{color:"#B0BAD0",fontFamily:dt,fontWeight:"700",letterSpacing:c?"0.12em":"0.15em"},_focus:{boxShadow:"none",outline:"none"},_disabled:{opacity:.6,cursor:"not-allowed"}})},Ua=({control:t,isDisabled:r})=>e.jsx(Q,{name:"plateNumber",control:t,render:({field:s,fieldState:o})=>e.jsx(Ae,{label:"Enter Vehicle Plate Number",error:o.error?.message,children:e.jsx(gt,{variant:"plate",value:s.value,onChange:s.onChange,onBlur:s.onBlur,name:s.name,isDisabled:r})})}),Ha=({control:t,isDisabled:r})=>e.jsx(Q,{name:"chassisNumber",control:t,render:({field:s,fieldState:o})=>e.jsx(Ae,{label:"VIN / Chassis Number",error:o.error?.message,children:e.jsx(gt,{variant:"vin",value:s.value,onChange:s.onChange,onBlur:s.onBlur,name:s.name,isDisabled:r})})}),Ya=({context:t,planType:r,isSubmitting:s,onSubmit:o,whatsAppUrl:i})=>{const a=r!=="third_party",d=x.useMemo(()=>Na({requiresSumInsured:a}
2),[a]),{control:c,handleSubmit:p,setValue:h}=we({resolver:ht(d),mode:"onTouched",defaultValues:{...or,plateNumber:t.plateNumber??"",chassisNumber:t.chassisNumber??"",vehicleType:t.vehicleType||or.vehicleType,sumInsured:t.sumInsured??""}}),b=at({control:c,name:"make"}),m=x.useRef(b);return x.useEffect(()=>{m.current!==b&&(m.current=b,h("model","",{shouldValidate:!1,shouldDirty:!0}))},[b,h]),e.jsx(u,{py:{base:4},children:e.jsx(u,{borderRadius:{base:"none",md:"3xl"},border:{base:"none",md:`1px solid ${n.border.primary}`},p:{base:0,md:10},w:"100%",boxShadow:{base:"none",md:"sm"},bg:"white",children:e.jsxs(v,{as:"form",onSubmit:p(o),gap:6,align:"stretch",children:[e.jsx(Oa,{}),e.jsxs(v,{gap:3,align:"stretch",children:[e.jsx(Ua,{control:c,isDisabled:s}),e.jsx(Ha,{control:c,isDisabled:s}),a?e.jsx(Q,{name:"sumInsured",control:c,render:({field:g,fieldState:f})=>e.jsx(Ae,{label:"What is the value of your car?",error:f.error?.message,icon:vn,children:e.jsx(Ot,{value:g.value,onChange:g.onChange,onBlur:g.onBlur,name:g.name,isDisabled:s})})}):null,e.jsx(Q,{name:"vehicleType",control:c,render:({field:g,fieldState:f})=>e.jsx(Ut,{options:cs,value:g.value,onChange:g.onChange,error:f.error?.message})})]}),e.jsxs(v,{gap:4,align:"stretch",children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.text.primary,children:"Enter your vehicle information"}),e.jsx(_a,{control:c,make:b,isDisabled:s})]}),e.jsx(N,{buttonType:"primary",text:"Continue",size:"lg",type:"submit",fullWidth:!0,loading:s}),i?e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",style:{width:"100%"},children:e.jsx(N,{buttonType:"whatsapp",text:"Need help? WhatsApp us",fullWidth:!0})}):null]})})})},Ga=({control:t,mode:r,isDisabled:s})=>{const o=r==="vin";return e.jsx(Q,{name:"plateNumber",control:t,rules:{required:o?"VIN is required":"Plate number is required"},render:({field:i,fieldState:a})=>e.jsx(Ae,{label:o?"VIN":"Enter Vehicle Plate Number",error:a.error?.message,children:e.jsx(gt,{variant:r,value:i.value,onChange:i.onChange,onBlur:i.onBlur,name:i.name,isDisabled:s})})})},qa=({control:t,isDisabled:r})=>e.jsx(Q,{name:"sumInsured",control:t,rules:{required:"Value of vehicle is required"},render:({field:s,fieldState:o})=>e.jsx(Ae,{label:"Value of Vehicle",error:o.error?.message,children:e.jsx(Ot,{value:s.value,onChange:s.onChange,onBlur:s.onBlur,name:s.name,isDisabled:r})})}),Qa="Vehicle verification failed. Please check the plate number and try again.",Xa=({mode:t,onVerified:r,onVerificationFailed:s})=>{const{verifyVehicle:o,isLoading:i}=ni();return{submit:d=>{const c=t==="vin"?d.plateNumber:jo(d.plateNumber);o({plateNumbers:[{plateNumber:c}]},{onSuccess:p=>{const h=p.data??[];if(h.length>0&&h.every(f=>f.status==="VERIFIED"&&f.isVerified===!0)){r(h,d.vehicleType,d.sumInsured);return}const g=h.find(f=>f.status!=="VERIFIED"||!f.isVerified)?.reason??p.message??Qa;s?s(g,{...d,plateNumber:c}):O.error(g)},onError:p=>{O.error(te(p)??"Verification failed. Please check your plate number and try again.")}})},isVerifying:i}},$a=({control:t})=>e.jsx(Q,{name:"vehicleType",control:t,rules:{required:"Please select a vehicle type"},render:({field:r,fieldState:s})=>e.jsx(Ut,{options:Da,value:r.value,onChange:r.onChange,error:s.error?.message})}),Ka=({onSubmit:t,onVerificationFailed:r,planType:s,isCreatingPolicy:o=!1,mode:i="plate"})=>{const a=i==="vin",d=s!=="third_party",{control:c,handleSubmit:p}=we({defaultValues:{plateNumber:"",vehicleType:"CAR",sumInsured:""}}),{submit:h,isVerifying:b}=Xa({mode:i,onVerified:t,...r?{onVerificationFailed:r}:{}}),m=b||o,g=Ms();return e.jsx(u,{py:{base:4},children:e.jsx(u,{borderRadius:{base:"none",md:"3xl"},border:{base:"none",md:`1px solid ${n.border.primary}`},p:{base:0,md:10},w:"100%",boxShadow:{base:"none",md:"sm"},bg:"white",children:e.jsxs(v,{as:"form",onSubmit:p(h),gap:2,align:"stretch",children:[e.jsx(Ga,{control:c,mode:i,isDisabled:m}),d?e.jsx(qa,{control:c,isDisabled:m}):null,e.jsx($a,{control:c}),e.jsx(N,{buttonType:"primary",text:a?"Lookup Vehicle":"Continue",size:"lg",type:"submit",loading:m}),e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",style:{width:"100%"},children:e.jsx(N,{buttonType:"whatsapp",text:"Need help? WhatsApp us",fullWidth:!0})})]})})})},Ja=({policyType:t="third-party",coverageType:r="personal"})=>{const s=t==="comprehensive"?"Comprehensive":t==="third-party-plus"?"Third Party Plus":"Third Party Only",o=r==="business"?"Commercial Motor":"Private Motor",i=t==="comprehensive"?"Rates may vary by insurer. Compare quotes from multiple underwriters.":"All rates are set by the Insurance Regulatory Authority (IRA) and are non-negotiable for Third Party Cover.";return e.jsxs(v,{gap:5,w:"100%",children:[e.jsxs(u,{w:"100%",borderRadius:"2xl",overflow:"hidden",border:"1px solid",borderColor:"gray.100",children:[e.jsxs(u,{bg:`linear-gradient(135deg, ${n.navy[800]}, ${n.navy[400]})`,px:6,py:5,children:[e.jsx(l,{color:"white",fontWeight:"bold",fontSize:"lg",children:"Premium Summary"}),e.jsx(l,{color:"whiteAlpha.800",fontSize:"sm",mt:1,children:"Official IRA regulator rates"})]}),e.jsxs(u,{bg:"white",px:6,py:5,children:[e.jsxs(v,{gap:4,align:"stretch",children:[e.jsx(St,{label:"Policy Type",value:s}),e.jsx(St,{label:"Vehicle Class",value:o}),e.jsx(St,{label:"Duration",value:"12 Months"})]}),e.jsxs(z,{mt:5,p:4,bg:n.gray[50],borderRadius:"xl",align:"flex-start",ga
2p:3,children:[e.jsx(W,{as:Sn,boxSize:5,color:n.navy[300],flexShrink:0,mt:.5}),e.jsx(l,{fontSize:"xs",color:n.text.primary,lineHeight:"1.5",children:i})]})]})]}),e.jsx(u,{w:"100%",bg:n.gray[100],borderRadius:"2xl",border:"1px solid",borderColor:n.border.primary,px:6,py:5,children:e.jsxs(z,{gap:3,align:"flex-start",children:[e.jsx(w,{w:8,h:8,borderRadius:"lg",bg:n.orange[50],align:"center",justify:"center",flexShrink:0,children:e.jsx(W,{as:Cn,boxSize:4,color:n.orange[500]})}),e.jsxs(u,{children:[e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:n.text.label,letterSpacing:"wider",textTransform:"uppercase",children:"INSTANT ISSUANCE"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,mt:1,lineHeight:"1.5",children:"Digital certificates are generated instantly and sent to your email and the NTSA portal upon payment."})]})]})})]})},St=({label:t,value:r})=>e.jsxs(w,{justify:"space-between",align:"center",children:[e.jsx(l,{fontSize:"sm",color:n.text.gray,children:t}),e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:n.text.label,children:r})]}),Za=({onConfirm:t,confirmButtonText:r,premiumDisplay:s,frequency:o,isLoading:i=!1})=>e.jsxs(w,{direction:{base:"column",md:"row"},justify:{base:"stretch",md:"flex-end"},align:{base:"center",md:"center"},w:"100%",minW:0,pt:4,borderTop:`1px solid ${n.border.primary}`,gap:4,children:[e.jsxs(u,{flexShrink:0,minW:0,children:[e.jsx(l,{fontSize:"xs",color:n.text.gray,mb:0,lineHeight:"1.1",children:"Pay"}),e.jsx(l,{fontSize:{base:"lg",md:"xl"},fontWeight:"bold",color:n.orange[600],lineHeight:"1.15",children:s}),e.jsx(l,{fontSize:"10px",color:n.text.info,mt:.5,children:_t(o)})]}),e.jsx(N,{size:"lg",buttonType:"primary",text:r??"",onClick:t,disabled:i,loading:i,borderRadius:"full",px:{base:6,md:8},width:{base:"100%",md:"auto"},maxW:"100%"})]}),el=()=>e.jsx(v,{gap:2,align:"stretch",children:e.jsxs(z,{gap:3,align:"flex-start",children:[e.jsx(u,{bg:n.orange[50],borderRadius:"lg",p:2.5,display:"inline-flex",flexShrink:0,children:e.jsx(W,{as:Pn,boxSize:6,color:n.orange[500]})}),e.jsxs(v,{gap:1,align:"stretch",flex:1,children:[e.jsx(xe,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:n.text.label,lineHeight:"1.2",children:"Review Your Quote"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,lineHeight:"1.5",children:"Please confirm the vehicle and policy details before proceeding to payment."})]})]})}),tl=({provider:t})=>{const r=Nr(t.planType),s=t.planType?.trim()||"—",o=Kr(t.planType),i=s.replace(/[^A-Za-z]/g,"").charAt(0).toUpperCase()||"?",a=t.description?t.description.split("·").map(g=>g.trim()).filter(Boolean):[],d=t.coverageGroups??[],c=t.coverageLines??[],p=d.length>0,h=c.length>0,b=a.length>0,m=p||h||b;return e.jsxs(v,{align:"stretch",gap:4,p:5,bg:n.gray[50],borderRadius:"xl",borderWidth:"1px",borderColor:n.border.primary,children:[e.jsx(u,{children:e.jsxs(w,{align:"flex-start",gap:{base:3,md:4},direction:"row",children:[e.jsx(w,{boxSize:{base:"52px",md:"64px"},borderRadius:"full",align:"center",justify:"center",flexShrink:0,overflow:"hidden",bg:r?n.gray[50]:o,borderWidth:"1px",borderStyle:"solid",borderColor:r?n.border.primary:"transparent",boxShadow:r?"0 1px 3px rgba(15, 23, 42, 0.08)":void 0,p:r?2:0,children:r?e.jsx(ue,{src:r.src,alt:r.alt,maxW:"100%",maxH:"100%",w:"auto",h:"auto",objectFit:"contain",objectPosition:"center",filter:r.shouldDarken?"brightness(0)":void 0}):e.jsx(l,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:"white",lineHeight:1,userSelect:"none",children:i})}),e.jsxs(v,{align:"stretch",gap:{base:1,md:1.5},flex:1,minW:0,children:[e.jsx(l,{fontSize:{base:"sm",md:"md"},fontWeight:"700",color:n.orange[500],children:s}),e.jsx(l,{fontWeight:"800",fontSize:{base:"md",md:"lg"},color:n.navy[500],lineHeight:"1.25",children:t.name}),e.jsxs(l,{fontSize:"xs",color:n.text.gray,children:["Policy ID: ",t.policyId]})]})]})}),m?e.jsxs(u,{borderWidth:"1px",borderStyle:"solid",borderColor:n.navy[100],borderRadius:"2xl",bg:n.navy[50],px:4,py:4,children:[e.jsx(l,{fontSize:"md",fontWeight:"bold",color:n.success[700],mb:3,children:"What is covered?"}),p?e.jsx(v,{align:"stretch",gap:4,children:d.map((g,f)=>e.jsx(Dr,{defaultOpen:f===0,contentGap:2,label:e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.label,children:g.title}),children:e.jsx(v,{align:"stretch",gap:0,children:g.items.map((j,P)=>e.jsxs(u,{pt:P>0?3:0,borderTopWidth:P>0?"1px":"0",borderTopColor:n.navy[100],children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.info,lineHeight:"short",mb:1.5,children:j.name}),e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"tall",children:j.description})]},`${j.name}-${String(P)}`))})},`${g.title}-${String(f)}`))}):h?e.jsx(ye,{columns:{base:1,sm:2,lg:4},gap:3,w:"100%",children:c.map(g=>e.jsxs(u,{px:4,py:3,bg:"white",borderRadius:"lg",borderWidth:"1px",borderColor:n.border.primary,h:"100%",children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.info,mb:1.5,lineHeight:"short",children:g.name}),e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"tall",children:g.description})]},`${g.name}-${g.description}`))}):e.jsx(ye,{columns:{base:1,sm:2,lg:4},gap:3,w:"100%",children:a.map(g=>e.jsx(u,{px:4,py:3,bg:"white",borderRadius:"lg",borderWidth:"1px",borderColor:n.border.primary,h:"100%",children:e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"tall",children:g})},g))})]}):null]})},Ct=t=>{if(t==null)return!1;const r=t.trim();if(r==="")return!1;const s=r.replace(/\s/g,"");return!(s==="—"||s==="-"||s==="N/A"||s.toLowerCase()==="n/a")},ar=({vehicle:t})=>{const r=Ct(t.category),s=Ct(t.plate),o=Ct(t.chassisOrId),i=r||s||o;return e.jsx(u,{background:"linear-gradient(135deg, #EEF4FB 0%, #F8FBFF 60%, #FFFFFF 100%)",borderRadius:"xl",border:`1px solid ${n.border.primary}`,overflow:"hidden",px:{base:5,md:6},py:{base:2,md:2},boxShadow:"0px 10.64px 42.82px 0px #0000000A",children:e.jsxs(w,{align:{base:"stretch",md:"center"},justify:"space-between",gap:4,direction:{base:"column",md:"row"},children:[e.jsxs(v,{align:"stretch",gap:2,flex:1,minW:0,order:{base:2,md:1},children:[e.jsx(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"800",color:n.text.primary,lineHeight:"1.1",textTransform:"capitalize",children:t.model?.toLowerCase()}),e.jsxs(z,{gap:2,flexWrap:"wrap",children:[e.jsx(lt,{variant:"subtle",size:"lg",rounded:"full",px:2,py:1,fontWeight:"500",customColors:{bg:n.orange[100],color:n.orange[500]},startElement:e.jsx(W,{as:wn,boxSize:4,color:n.orange[300],display:"inline-block",flexShrink:0}),children:t.coverageType}),e.jsx(lt,{variant:"subtle",size:"lg",rounded:"full",px:2,py:1,fontWeight:"500",customColors:{bg:n.success[100],color:n.success[800]},startElement:e.jsx(W,{as:Tr,boxSize:3.5,color:n.success[700],display:"inline-block",flexShrink:0}),children:"Verified"})]}),i?e.jsxs(v,{align:"stretch",gap:1.5,children:[r?e.jsxs(z,{gap:2,fontSize:"sm",children:[e.jsx(W,{as:Ir,boxSize:4,color:n.navy[500],flexShrink:0}),e.jsx(l,{color:n.text.gray,fontWeight:"500",children:"Category:"}),e.jsx(l,{color:n.text.label,fontWeight:"600",lineClamp:1,children:t.category})]}
2):null,s||o?e.jsxs(z,{gap:{base:4,md:6},fontSize:"sm",flexWrap:"wrap",children:[s?e.jsxs(z,{gap:2,children:[e.jsx(W,{as:Ar,boxSize:4,color:n.orange[500],flexShrink:0}),e.jsx(l,{color:n.text.gray,fontWeight:"500",children:"Plate No.:"}),e.jsx(l,{color:n.text.label,fontWeight:"600",children:t.plate})]}):null,o?e.jsxs(z,{gap:2,children:[e.jsx(W,{as:Rr,boxSize:4,color:n.navy[400],flexShrink:0}),e.jsx(l,{color:n.text.gray,fontWeight:"500",children:"Chassis No.:"}),e.jsx(l,{color:n.text.label,fontWeight:"600",lineClamp:1,children:t.chassisOrId})]}):null]}):null]}):null]}),e.jsx(u,{flexShrink:0,alignSelf:{base:"center",md:"auto"},order:{base:1,md:2},w:{base:"140px",md:"340px"},h:{base:"140px",md:"340px"},children:e.jsx(Lt,{brand:t.brand,size:"100%"})})]})})},rl=({vehicles:t,provider:r,premiumDisplay:s,frequency:o="ANNUAL",onContinue:i})=>e.jsx(u,{py:{base:4},children:e.jsx(u,{bg:"white",borderRadius:"2xl",border:"1px solid",borderColor:n.border.primary,p:{base:6,md:10},w:"100%",boxShadow:"sm",children:e.jsxs(v,{gap:8,align:"stretch",children:[e.jsx(el,{}),e.jsx(v,{gap:4,align:"stretch",children:t.length===1?e.jsx(u,{mx:"auto",w:"100%",children:e.jsx(ar,{vehicle:t[0]})}):e.jsx(ye,{columns:{base:1,lg:2},gap:6,children:t.map(a=>e.jsx(ar,{vehicle:a},a.id))})}),e.jsxs(v,{gap:4,align:"stretch",children:[e.jsx(l,{fontSize:"xs",fontWeight:"700",color:n.text.gray,letterSpacing:"0.08em",textTransform:"uppercase",mb:{base:2,md:3},children:"Selected provider"}),e.jsx(tl,{provider:r})]}),e.jsx(v,{gap:2,align:"stretch",children:e.jsx(Za,{onConfirm:i,confirmButtonText:"Continue →",frequency:o,...s!==void 0&&{premiumDisplay:s}})})]})})}),Ht=({icon:t,title:r})=>e.jsxs(z,{gap:3,children:[e.jsx(w,{w:9,h:9,borderRadius:"lg",bg:n.orange[50],align:"center",justify:"center",children:e.jsx(W,{as:t,boxSize:4,color:n.orange[500]})}),e.jsx(l,{fontWeight:"bold",fontSize:"md",color:n.text.label,children:r})]}),sl={awaiting_activation:"Ready to activate",checking:"Verifying status",cooldown:"Processing purchase"},nl=({message:t,progress:r,phase:s,remainingSeconds:o})=>{const i=s==="checking"?e.jsx(Nt,{size:"sm",color:n.success[600]}):e.jsx(l,{fontSize:"xs",color:n.text.gray,fontWeight:"500",children:s==="awaiting_activation"?"Complete":xr(o)});return e.jsx(u,{border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",px:6,py:5,bg:"white",children:e.jsxs(v,{align:"stretch",gap:3,children:[e.jsx(l,{fontSize:"sm",fontWeight:"600",color:n.text.label,children:t}),e.jsx(Bn,{value:r,size:"sm",borderRadius:"full",bg:n.gray[100],children:e.jsx(Wn,{borderRadius:"full",children:e.jsx(On,{bg:n.success[500]})})}),e.jsxs(u,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,children:[e.jsx(l,{fontSize:"xs",color:n.text.gray,fontWeight:"500",children:sl[s]}),i]})]})})},ol="Your payment is confirmed. We are processing your policy with the insurer — this usually takes about a minute.",il="Your motor insurance has been successfully paid for. You must activate the policy before it begins.",al=({isAutoActivate:t})=>e.jsxs(v,{gap:4,align:"center",pt:4,children:[e.jsx(u,{display:"flex",justifyContent:"center",width:"100%",children:e.jsx(pt,{data:Dt,autoplay:!0,loop:!0})}),e.jsx(xe,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:n.success[600],textAlign:"center",children:"Payment Successful"}),e.jsx(l,{fontSize:{base:"sm",md:"md"},color:n.text.gray,textAlign:"center",maxW:"360px",lineHeight:"tall",children:t?ol:il})]}),ll=({primaryButtonText:t,isPrimaryDisabled:r,isPrimaryLoading:s,onActivate:o})=>e.jsx(v,{gap:3,align:"stretch",children:e.jsx(N,{buttonType:"primary",text:t,size:"lg",onClick:o,loading:s,disabled:r})}),cl=({transactionRef:t,copied:r,onCopy:s})=>e.jsx(u,{border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",px:6,py:5,bg:"white",children:e.jsxs(v,{gap:1,align:"center",children:[e.jsx(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.gray,textTransform:"uppercase",letterSpacing:"0.1em",children:"Transaction Ref"}),e.jsxs(u,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(l,{fontSize:{base:"lg",md:"xl"},fontWeight:"bold",color:n.text.label,fontFamily:"mono",children:t}),e.jsx(He,{"aria-label":r?"Copied!":"Copy transaction ref",variant:"ghost",size:"sm",color:r?n.success[600]:n.text.gray,onClick:s,children:e.jsx(kr,{})})]})]})}),dl=({onNext:t})=>{const{control:r,handleSubmit:s,formState:{errors:o}}=we({defaultValues:{plateNumber:"",chassisNumber:"",engineNumber:""}}),i=()=>{t()};return e.jsx(u,{py:{base:4},children:e.jsx(u,{bg:"white",borderRadius:"2xl",border:"1px solid",borderColor:"gray.100",p:{base:6,md:10},w:"100%",children:e.jsx("form",{onSubmit:s(i),children:e.jsxs(v,{gap:6,align:"stretch",children:[e.jsx(Ht,{icon:Vr,title:"Enter vehicle identification details"}),e.jsxs(fe,{templateColumns:{base:"1fr",md:"1fr 1fr"},gap:5,children:[e.jsx(Ye,{children:e.jsx(Q,{name:"plateNumber",control:r,rules:{required:"This field is required"},render:({field:a})=>e.jsx(se,{label:"Vehicle plate number",placeholder:"YAB JYY 656",value:a.value,onChange:a.onChange,error:o.plateNumber?.message,hasError:!!o.plateNumber,bg:n.gray[50]})})}),e.jsx(Ye,{children:e.jsx(Q,{name:"chassisNumber",control:r,rules:{required:"This field is required"},render:({field:a})=>e.jsx(se,{label:"Chassis number",placeholder:"2025",value:a.value,onChange:a.onChange,error:o.chassisNumber?.message,hasError:!!o.chassisNumber,bg:n.gray[50]})})})]}),e.jsx(Q,{name:"engineNumber",control:r,rules:{required:"This field is required"},render:({field:a})=>e.jsx(se,{label:"Engine number",placeholder:"424263535636",value:a.value,onChange:a.onChange,error:o.engineNumber?.message,hasError:!!o.engineNumber,bg:n.gray[50]})}),e.jsx(u,{bg:n.gray[50],borderRadius:"xl",p:4,textAlign:"center",children:e.jsx(l,{fontSize:"sm",color:n.text.gray,children:"These details must match official vehicle records."})}),e.jsx(w,{justify:"flex-end",children:e.jsx(N,{type:"submit",buttonType:"primary",text:"Continue",icon:e.jsx(Er,{}),iconPosition:"right",size:"lg"})})]})})})})},Pt=({index:t,control:r,errors:s,name:o,label:i,inputMode:a="text",maxLength:d})=>{const c=s.vehicles?.[t];return e.jsx(Q,{name:`vehicles.${t}.${o}`,control:r,render:({field:p})=>e.jsx(u,{mt:4,children:e.jsx(se,{label:e.jsxs(e.Fragment,{children:[i," ",e.jsx(l,{as:"span",color:"red.500",children:"*"})]}),value:p.value,onChange:h=>{const b=h.target.value;if(o==="year"){p.onChange(b.replace(/\D/g,"").slice(0,d??4));return}p.onChange(b)},inputMode:a,maxLength:d,error:c?.[o]?.message,hasError:!!c?.[o],bg:n.gray[50],border:`1px solid ${n.gray[200]}`})})})},ul=({index:t,control:r})=>
2{const s=at({control:r,name:`vehicles.${t}.brand`}),[o,i]=x.useState(""),a=x.useMemo(()=>{if(!s)return"";const d=io(s);return d?vo(d):""},[s]);return e.jsxs(w,{justify:"space-between",align:"center",gap:3,children:[e.jsx(Ht,{icon:Vr,title:"Vehicle Details"}),a&&o!==a?e.jsx(ue,{src:a,alt:`${s??"Vehicle"} logo`,h:"60px",maxW:"180px",objectFit:"contain",onError:()=>i(a)}):null]})},pl=["White","Black","Gray","Silver","Blue","Red","Green","Brown / Beige","Yellow / Gold","Others"],ml={White:"#FFFFFF",Black:"#1A202C",Gray:"#A0AEC0",Silver:"#CBD5E0",Blue:"#3182CE",Green:"#38A169",Red:"#E53E3E","Brown / Beige":"#C19A6B","Yellow / Gold":"#D69E2E",Others:"#718096"},ce=lo([X(),co(),uo(),po(),mo()]).transform(t=>t==null?"":typeof t=="string"?t:String(t)),hl=Xe({firstName:ce,lastName:ce,registrationNumber:ce,vehicleType:ce,chassisNumber:ce,sumInsured:ce,brand:ce,model:ce,numberOfVehicles:ce,color:ce.pipe(X().min(1,"Please select a vehicle color")),year:ce}),xl={firstName:"",lastName:"",registrationNumber:"",vehicleType:"",chassisNumber:"",sumInsured:"",brand:"",model:"",numberOfVehicles:"",color:"",year:""},gl=t=>Xe({vehicles:ao(hl).superRefine((r,s)=>{r.forEach((o,i)=>{const a=t[i];if(a&&(be(a.brand)&&!o.brand.trim()&&s.addIssue({code:"custom",message:"Please enter the vehicle brand",path:[i,"brand"]}),be(a.model)&&!o.model.trim()&&s.addIssue({code:"custom",message:"Please enter the vehicle model",path:[i,"model"]}),be(a.year))){const d=Wr(o.year.trim());d!==!0&&s.addIssue({code:"custom",message:d,path:[i,"year"]})}})})}),bl=t=>{const r=t.vehicles;if(!Array.isArray(r))return"Please review your vehicle details and try again.";for(const s of r)if(!(!s||typeof s!="object")){for(const o of Object.values(s))if(o&&typeof o=="object"&&"message"in o&&typeof o.message=="string")return o.message}return"Please review your vehicle details and try again."},yl=({value:t,onChange:r})=>e.jsx(w,{gap:2,flexWrap:"wrap",children:pl.map(s=>{const o=t===s,i=ml[s]??n.gray[400];return e.jsx(N,{buttonType:o?"primary":"outline",text:s,icon:e.jsx(u,{w:3,h:3,borderRadius:"full",bg:i,border:"1px solid",borderColor:i==="#FFFFFF"?n.gray[300]:"transparent",flexShrink:0}),iconPosition:"left",type:"button",size:"sm",border:"1px solid",borderColor:n.gray[200],onClick:()=>r(s)},s)})}),fl=({index:t,control:r,errors:s,initialVehicle:o})=>{const i=be(o?.brand),a=be(o?.model),d=be(o?.year);return e.jsxs(u,{mt:6,children:[e.jsx(Ht,{icon:Tn,title:"Other Specifications"}),e.jsxs(u,{mt:3,children:[e.jsxs(l,{fontSize:"sm",color:n.text.info,mb:3,mt:4,children:["Vehicle Color"," ",e.jsx(l,{as:"span",color:"red.500",children:"*"})]}),e.jsx(Q,{name:`vehicles.${t}.color`,control:r,render:({field:c})=>e.jsx(yl,{value:c.value,onChange:c.onChange})}),s.vehicles?.[t]?.color&&e.jsx(l,{fontSize:"xs",color:"red.500",mt:2,children:s.vehicles[t].color.message}),i?e.jsx(Pt,{index:t,control:r,errors:s,name:"brand",label:"Vehicle Brand"}):null,a?e.jsx(Pt,{index:t,control:r,errors:s,name:"model",label:"Vehicle Model"}):null,d?e.jsx(Pt,{index:t,control:r,errors:s,name:"year",label:"Year of manufacture",inputMode:"numeric",maxLength:4}):null]})]})},us=({label:t,value:r})=>e.jsxs(w,{justify:"space-between",align:"center",py:3,borderBottom:"1px solid",borderColor:"gray.100",_last:{borderBottom:"none"},children:[e.jsx(l,{fontSize:"sm",color:n.text.info,flexShrink:0,mr:4,children:t}),e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.label,textAlign:"right",wordBreak:"break-all",children:r})]}),Ee=({index:t,control:r,name:s,label:o})=>e.jsx(Q,{name:`vehicles.${t}.${s}`,control:r,render:({field:i})=>{const a=zt(i.value);return a?e.jsx(us,{label:o,value:a}):e.jsx(e.Fragment,{})}}),jl=({index:t,control:r})=>e.jsx(Q,{name:`vehicles.${t}.firstName`,control:r,render:({field:s})=>e.jsx(Q,{name:`vehicles.${t}.lastName`,control:r,render:({field:o})=>{const i=zt([s.value,o.value].filter(Boolean).join(" "));return i?e.jsx(us,{label:"Registered Owner",value:i}):e.jsx(e.Fragment,{})}})}),vl=({index:t,control:r,initialVehicle:s})=>{const o=!be(s?.brand),i=!be(s?.model),a=!be(s?.year);
2return e.jsxs(u,{mt:3,children:[e.jsx(Ee,{index:t,control:r,name:"registrationNumber",label:"Plate Number"}),e.jsx(Ee,{index:t,control:r,name:"chassisNumber",label:"Chassis Number"}),o?e.jsx(Ee,{index:t,control:r,name:"brand",label:"Vehicle Brand"}):null,i?e.jsx(Ee,{index:t,control:r,name:"model",label:"Vehicle Model"}):null,a?e.jsx(Ee,{index:t,control:r,name:"year",label:"Year of manufacture"}):null,e.jsx(Ee,{index:t,control:r,name:"vehicleType",label:"Vehicle Category"}),e.jsx(jl,{index:t,control:r})]})},Sl=({index:t,control:r,errors:s,initialVehicle:o,isExpanded:i,onToggle:a,onRemove:d,isInputRequired:c=!1})=>e.jsxs(u,{bg:"white",borderRadius:"2xl",border:"1px solid",borderColor:"gray.100",mb:4,overflow:"hidden",p:{base:5,md:6},children:[e.jsx(ul,{index:t,control:r}),e.jsx(vl,{index:t,control:r,...o!==void 0?{initialVehicle:o}:{}}),e.jsx(fl,{index:t,control:r,errors:s,...o!==void 0?{initialVehicle:o}:{}})]}),Cl=({vehicleList:t,footer:r,policyType:s,coverageType:o})=>e.jsxs(w,{direction:"column",h:{lg:"100%"},gap:8,mt:5,children:[e.jsxs(fe,{templateColumns:{base:"1fr",lg:"3fr 2fr"},gap:8,alignItems:"flex-start",flex:{lg:"1"},minH:{lg:0},children:[e.jsx(Ye,{overflowY:{lg:"auto"},h:{lg:"100%"},pr:{lg:2},css:{"&::-webkit-scrollbar":{width:"4px"},"&::-webkit-scrollbar-thumb":{background:n.gray[300],borderRadius:"4px"}},children:t}),e.jsx(Ye,{display:{base:"none",lg:"block"},h:{lg:"100%"},children:e.jsx(Ja,{...s!==void 0?{policyType:s}:{},...o!==void 0?{coverageType:o}:{}})})]}),r]}),Pl=({onBack:t,onContinue:r,isSubmitting:s})=>e.jsxs(w,{justify:"space-between",align:"center",children:[e.jsxs(z,{gap:2,cursor:"pointer",onClick:t,color:n.text.primary,_hover:{color:n.text.orange},children:[e.jsx(W,{as:In,boxSize:4}),e.jsx(l,{fontSize:"sm",fontWeight:"medium",children:"Back"})]}),e.jsx(N,{type:"button",buttonType:"primary",text:"Continue",icon:e.jsx(Er,{}),iconPosition:"right",size:"lg",loading:s,onClick:r})]}),wl=({whatsAppUrl:t})=>e.jsxs(e.Fragment,{children:[e.jsxs(w,{justify:"space-between",align:{base:"flex-start",md:"center"},direction:{base:"column",md:"row"},gap:3,wrap:"wrap",children:[e.jsxs(xe,{fontSize:"xl",fontWeight:"bold",color:n.text.info,flex:"1",minW:0,children:["Review your Vehicle",e.jsxs(l,{as:"span",fontWeight:"bold",color:n.text.label,children:[" ","Information"]})]}),t?e.jsx(u,{flexShrink:0,w:{base:"100%",md:"auto"},ml:{md:"auto"},children:e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",style:{display:"block"},children:e.jsx(N,{buttonType:"whatsapp",text:"Chat with Myka",iconPosition:"left",size:"md",w:{base:"100%",md:"auto"}})})}):null]}),e.jsx(l,{fontSize:"sm",color:n.text.gray,children:"Check and confirm your vehicle details before proceeding to the next step."})]}),Tl=({initialVehicles:t,onNext:r})=>{const s=x.useMemo(()=>t&&t.length>0?t:[xl],[t]),o=x.useMemo(()=>gl(s),[s]),[i,a]=x.useState(new Set([0])),{control:d,handleSubmit:c,formState:{errors:p},reset:h}=we({resolver:ht(o),defaultValues:{vehicles:s}});x.useEffect(()=>{t&&t.length>0&&h({vehicles:t})},[t,h]);const{fields:b}=ho({control:d,name:"vehicles"}),m=P=>{a(T=>{const S=new Set(T);return S.has(P)?S.delete(P):S.add(P),S})},j=c(P=>{r(P)},P=>{O.error(bl(P))});return{control:d,errors:p,fields:b,schemaInitialVehicles:s,expandedVehicles:i,toggleVehicle:m,submitVehicleInfo:j}},Il=({onNext:t,onBack:r,initialVehicles:s,policyType:o,coverageType:i,isSubmitting:a,whatsAppUrl:d})=>{const{control:c,errors:p,fields:h,schemaInitialVehicles:b,expandedVehicles:m,toggleVehicle:g,submitVehicleInfo:f}=Tl({onNext:t,...s!==void 0?{initialVehicles:s}:{}});return e.jsxs(e.Fragment,{children:[e.jsx(wl,{whatsAppUrl:d}),e.jsx("form",{onSubmit:j=>{j.preventDefault(),f()},children:e.jsx(Cl,{...o!==void 0?{policyType:o}:{},...i!==void 0?{coverageType:i}:{},vehicleList:h.map((j,P)=>e.jsx(Sl,{index:P,control:c,errors:p,initialVehicle:b[P],isExpanded:m.has(P),onToggle:()=>g(P),isInputRequired:o==="third-party"},j.id)),footer:e.jsx(Pl,{onBack:r,onContinue:()=>void f(),...a!==void 0?{isSubmitting:a}:{}})})})]})},lr=({isActive:t,onClick:r,label:s,icon:o})=>e.jsxs(w,{flex:1,align:"center",justify:"center",gap:2,py:2.5,borderRadius:"lg",cursor:"pointer",fontWeight:"semibold",fontSize:"sm",transition:"all 0.2s",bg:t?"white":"transparent",color:t?n.navy[500]:n.gray[500],boxSh
2adow:t?"0 1px 3px rgba(0,0,0,0.08)":"none",onClick:r,children:[o?e.jsx(W,{as:o,boxSize:4}):null,e.jsx(l,{children:s})]}),Al=({value:t,onChange:r})=>{const s=o=>()=>r(o);return e.jsxs(w,{bg:n.gray[50],borderRadius:"xl",p:1,gap:1,children:[e.jsx(lr,{isActive:t==="text",onClick:s("text"),label:"Enter Chassis Number"}),e.jsx(lr,{isActive:t==="image",onClick:s("image"),label:"Capture Chassis Number",icon:An})]})},Rl=Wt*1024*1024,kl=()=>{const[t,r]=x.useState(null),[s,o]=x.useState(null),i=x.useRef(null),a=x.useCallback(m=>{if(m.size>Rl){O.error(`Image must be smaller than ${Wt}MB.`);return}r(m);const g=new FileReader;g.onload=f=>o(f.target?.result),g.readAsDataURL(m)},[]),d=x.useCallback(()=>{r(null),o(null),i.current&&(i.current.value="")},[]),c=x.useCallback(()=>{i.current?.click()},[]),p=x.useCallback(m=>{const g=m.target.files?.[0];g&&a(g)},[a]),h=x.useCallback(m=>{m.preventDefault();const g=m.dataTransfer.files[0];g&&a(g)},[a]),b=x.useCallback(m=>{m.preventDefault()},[]);return{selectedFile:t,imagePreview:s,fileInputRef:i,openFilePicker:c,onFileInputChange:p,onDrop:h,onDragOver:b,clear:d}},Vl="Vehicle verification failed. Please check the VIN and try again.",El=({onVerified:t,onVerificationFailed:r})=>{const{verifyVinAsync:s,isLoading:o}=ri(),{verifyVinByImageAsync:i,isLoading:a}=si(),d=(h,b,m,g,f)=>{if(h.length>0&&h.every(S=>S.status==="VERIFIED"&&S.isVerified===!0)){t(h,m,g);return}const T=h.find(S=>S.status!=="VERIFIED"||!S.isVerified)?.reason??b??Vl;r?r(T,{vehicleType:m,sumInsured:g,...f?{chassisNumber:f}:{}}):O.error(T)};return{submitText:async({chassisNumber:h,vehicleType:b,sumInsured:m})=>{try{const g=h.trim(),f=await s({chassisNumber:g});d(f.data,f.message,b,m,g)}catch(g){O.error(te(g)??"VIN verification failed. Please check the number and try again.")}},submitImage:async({file:h,vehicleType:b,sumInsured:m})=>{try{const g=await i(h);d(g.data,g.message,b,m)}catch(g){O.error(te(g)??"Image verification failed. Please try a clearer photo.")}},isLoading:o||a}},Nl=({imagePreview:t,selectedFile:r,onClear:s})=>e.jsxs(v,{gap:3,children:[e.jsx(ue,{src:t,alt:"Chassis number photo",maxH:"200px",borderRadius:"lg",objectFit:"contain"}),e.jsxs(z,{gap:2,children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:n.success[600],children:r?.name}),e.jsx(W,{as:Rn,boxSize:4,color:n.error[500],cursor:"pointer",onClick:o=>{o.stopPropagation(),s()}})]})]}),_l=({onPick:t})=>e.jsxs(v,{gap:3,py:4,children:[e.jsx(w,{boxSize:"56px",borderRadius:"full",bg:"white",align:"center",justify:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.06)",children:e.jsx(W,{as:kn,boxSize:6,color:n.orange[500]})}),e.jsxs(v,{gap:.5,children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:n.text.primary,children:"Upload a photo of the chassis number"}),e.jsxs(l,{fontSize:"xs",color:n.text.gray,children:["JPG, PNG or WebP — max ",Wt,"MB"]})]}),e.jsx(N,{buttonType:"outline",text:"Choose File",size:"sm",onClick:r=>{r.stopPropagation(),t()}})]}),Dl=({image:t})=>{const{selectedFile:r,imagePreview:s,fileInputRef:o,openFilePicker:i,onFileInputChange:a,onDrop:d,onDragOver:c,clear:p}=t;return e.jsxs(u,{borderRadius:"2xl",border:"2px dashed",borderColor:r?n.success[300]:n.border.primary,bg:r?n.success[50]:n.gray[50],p:6,transition:"all 0.2s",cursor:"pointer",_hover:{borderColor:r?n.success[400]:n.orange[300],bg:r?n.success[50]:n.orange[50]},onClick:i,onDragOver:c,onDrop:d,children:[e.jsx("input",{ref:o,type:"file",accept:Ea,style:{display:"none"},onChange:a}),s?e.jsx(Nl,{imagePreview:s,selectedFile:r,onClear:p}):e.jsx(_l,{onPick:i})]})},ps=()=>e.jsxs(z,{justify:"center",gap:2,children:[e.jsx(W,{as:Cr,boxSize:4,color:n.success[500]}),e.jsx(l,{fontSize:"xs",color:n.text.gray,children:"Your data is encrypted and completely safe"})]}),ms=({control:t,isDisabled:r})=>e.jsx(Q,{name:"sumInsured",control:t,rules:{required:"Value of vehicle is required"},render:({field:s,fieldState:o})=>e.jsx(Ae,{label:"Value of Vehicle",error:o.error?.message,children:e.jsx(Ot,{value:s.value,onChange:s.onChange,onBlur:s.onBlur,name:s.name,isDisabled:r})})}),hs=({control:t})=>e.jsx(Q,{name:"vehicleType",control:t,rules:{required:"Please select a vehicle type"},render:({field:r,fieldState:s})=>e.jsx(Ut,{options:cs,value:r.value,onChange:r.onChange,error:s.error?.message})}),Ll=({control:t,shouldCollectSumInsured:r,isLoading:s,image:o,onSubmit:i})=>e.jsxs(v,{gap:4,align:"stretch",children:[e.jsx(Dl,{image:o}),r?e.jsx(ms,{control:t,isDisabled:s}):null,e.jsx(hs,{control:t}),e.jsx(ps,{}),e.jsx(N,{buttonType:"primary",text:"Verify from Photo",size:"lg",loading:s,disabled:!o.selectedFile,onClick:i})]}),Ml=({control:t,isDisabled:r})=>e.jsx(Q,{name:"chassisNumber",control:t,rules:{required:"VIN / Chassis number is required",minLength:{value:ct,message:`VIN must be at least ${ct} characters`}},render:({field:s,fieldState:o})=>e.jsx(Ae,{label:"VIN / Chassis Number",error:o.error?.message,children:e.jsx(gt,{variant:"vin",value:s.value,onChange:s.onChange,onBlur:s.onBlur,name:s.name,isDisabled:r})})}),zl=({control:t,shouldCollectSumInsured:r,isLoading:s,onSubmit:o})=>e.jsxs(v,{as:"form",onSubmit:o,gap:4,align:"stretch",children:[e.jsx(Ml,{control:t,isDisabled:s}),r?e.jsx(ms,{control:t,isDisabled:s}):null,e.jsx(hs,{control:t}),e.jsx(ps,{}),e.jsx(N,{buttonType:"primary",text:"Lookup Vehicle",size:"lg",type:"submit",loading:s})]}),Fl=({onSubmit:t,onVerificationFailed:r,planType:s,whatsAppUrl:o})=>{const[i,a]=x.useState("text"),d=s!=="third_party",{control:c,handleSubmit:p,getValues:h}=we({defaultValues:{chassisNumber:"",vehicleType:"CAR",sumInsured:""}}),b=kl(),{submitText:m,submitImage:g,isLoading:f}=El({onVerified:t,...r?{onVerificationFailed:r}:{}}),j=T=>m({chassisNumber:T.chassisNumber,vehicleType:T.vehicleType,sumInsured:T.sumInsured}),P=()=>{if(!b.selectedFile){O.error("Please select an image of the chassis number.");return}const{vehicleType:T,sumInsured:S}=h();g({file:b.selectedFile,vehicleType:T,sumInsured:S})};return e.jsx(u,{py:{base:4},children:e.jsx(u,{borderRadius:{base:"none",md:"3xl"},border:{base:"none",md:`1px solid ${n.border.primary}`},p:{base:0,md:10},w:"100%",boxShadow:{base:"none",md:"sm"},bg:"white",children:e.jsxs(v,{gap:4,align:"stretch",children:[e.jsx(Al,{value:i,onChange:a}),i==="text"?e.jsx(zl,{control:c,shouldCollectSumInsured:d,isLoading:f,onSubmit:p(j)}
2):e.jsx(Ll,{control:c,shouldCollectSumInsured:d,isLoading:f,image:b,onSubmit:P}),o?e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{width:"100%"},children:e.jsx(N,{buttonType:"whatsapp",text:"Need help? WhatsApp us",fullWidth:!0})}):null]})})})},Ne=({config:t})=>{const{items:r}=Te(),{navigate:s,navigateImmediate:o}=J(),i=de(),a=Vt(),{track:d}=Qe(),{addManualVehicle:c,isLoading:p}=ci(),h=Mi(i.state),b=t.usageType==="BUSINESS"?i.state?.businessItem:void 0,m=`/${t.routes.plateVerify}`;x.useEffect(()=>{h||s(m,{replace:!0})},[h,s,m]),x.useEffect(()=>{h&&d(ne.MOTOR_MANUAL_ENTRY_STARTED,{product_type:"motor",lookup_method:h.origin==="vin"?"vin":"plate_number"})},[h,d]);const g=t.coverageType&&t.planType?Et({name:a?.kyc?.firstName??null,coverageType:t.coverageType,planType:t.planType}):void 0;if(!h)return null;const f=()=>{s(Mt)},j=h.origin==="vin"?"vin":"plate_number",P=(S,k)=>{d(ne.MOTOR_MANUAL_VEHICLE_FAILED,{product_type:"motor",lookup_method:j}),O.error(te(S)??k)},T=S=>{let k;try{k=Fi({form:S,context:h})}catch(_){P(_,"Please check your vehicle details and try again.");return}c(k,{onSuccess:_=>{const L=Wi({response:_,request:k});if(!L){P(null,"Your vehicle was submitted but we did not get a reference back. Please try again.");return}d(ne.MOTOR_MANUAL_VEHICLE_ATTACHED,{product_type:"motor",lookup_method:j,vehicle_make:k.make,vehicle_model:k.model,vehicle_year:k.year});const I=new URLSearchParams({type:k.type,...S.sumInsured?{sumInsured:S.sumInsured}:{},...S.year?{year:S.year}:{}});o(`/${t.routes.vehicleInfo}?${I}`,{state:{verifyItems:[L],...b!==void 0&&{businessItem:b}}})},onError:_=>{P(_,"We could not register your vehicle. Please try again.")}})};return e.jsx(ee,{items:r,onGoBack:f,contentMaxW:"700px",mobileContentOnly:!0,children:e.jsx(Ya,{context:h,planType:t.planType,isSubmitting:p,onSubmit:T,...g?{whatsAppUrl:g}:{}})})},_e=({config:t})=>{const{navigate:r}=J(),[s]=je(),o=s.get("policyId")??void 0,{track:i}=Qe(),a=x.useRef(!1);x.useEffect(()=>{a.current||(a.current=!0,i(ne.MOTOR_PAYMENT_FAILED,{product_type:"motor",failure_reason:"declined"}))},[i]);const d=()=>{r(`/${t.routes.reviewQuote}`,{state:{policyId:o}})},c=()=>{r("/home",{replace:!0})};return e.jsx(ee,{items:[],hideGoBack:!0,onGoBack:c,contentMaxW:"600px",children:e.jsxs(v,{bg:"white",borderRadius:"2xl",background:`linear-gradient(145deg, white 55%, ${n.orange[50]} 100%)`,border:"1px solid",borderColor:n.border.secondary,p:{base:6,md:10},align:"stretch",gap:6,children:[e.jsxs(v,{gap:4,align:"center",pt:4,children:[e.jsx(u,{display:"flex",justifyContent:"center",width:"100%",children:e.jsx(pt,{data:fo,autoplay:!0,loop:!1,style:{width:120,height:120}})}),e.jsx(xe,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:n.error[700],textAlign:"center",children:"Payment Failed"}),e.jsx(l,{fontSize:{base:"sm",md:"md"},color:n.text.gray,textAlign:"center",maxW:"360px",lineHeight:"tall",children:"Your payment was not completed. Please try again or contact support if the issue persists."})]}),e.jsxs(v,{gap:3,align:"stretch",children:[e.jsx(N,{buttonType:"primary",text:"Try Again",size:"lg",onClick:d}),e.jsx(N,{buttonType:"outline",text:"Back to Dashboard",size:"lg",onClick:c})]})]})})},cr=({config:t})=>{const{navigate:r}=J(),o=de().state?.policyId,i=ut(xt),{paymentFrequencies:a,isLoading:d,isError:c,refetch:p}=mi(o),{savePaymentFrequency:h,isLoading:b}=Ur(),m=x.useMemo(()=>{const j=i?.vehicles?.[0],P=[{label:"Selected Cover",value:t.coverageLabel}];
2if(j){const T=[j.brand,j.model,j.year].filter(Boolean).join(" ");T&&P.push({label:"Vehicle",value:T}),j.sumInsured&&P.push({label:"Vehicle Value",value:he(j.sumInsured)}),j.year&&P.push({label:"Year",value:j.year})}return P},[i,t.coverageLabel]),g=()=>{r(-1)};if(!o)return e.jsx(Ce,{replace:!0,to:`/${t.routes.plateVerify}`});const f=j=>{a&&h({policyId:o,payload:{frequency:j,frequencyAmount:a.frequencies[j],isSubscribed:!1}},{onSuccess:()=>{const P={frequency:j,frequencies:a.frequencies,grossPremium:a.grossPremium};r(`/${t.routes.compare}`,{state:{policyId:o,paymentOption:P}})},onError:P=>{O.error(te(P)??"Failed to save payment frequency. Please try again.")}})};return e.jsx(ee,{items:[],contentMaxW:"840px",onGoBack:g,...t.mobileContentOnly&&{mobileContentOnly:!0},children:d?e.jsx(kt,{}):c||!a?e.jsxs(w,{direction:"column",align:"center",gap:4,py:12,children:[e.jsx(l,{fontSize:"14px",color:n.error[600],textAlign:"center",children:"We couldn't load the payment options right now. Please try again."}),e.jsx(N,{type:"button",buttonType:"outline",text:"Retry",size:"md",onClick:()=>void p()})]}):e.jsx($o,{grossPremium:a.grossPremium,frequencies:a.frequencies,summaryItems:m,isSubmitting:b,onContinue:f})})},Bl=1800,De=({config:t})=>{const{items:r}=Te(),{navigate:s,navigateImmediate:o}=J(),i=de(),{track:a}=Qe(),d=x.useRef(0),c=t.usageType==="BUSINESS"?i.state?.businessItem:void 0;x.useEffect(()=>{a(ne.MOTOR_FLOW_STARTED,{product_type:"motor",entry_point:"home_card"})},[a]);const p=x.useRef(null);x.useEffect(()=>()=>{p.current!=null&&clearTimeout(p.current)},[]);const h=()=>{s(Mt)},b=(g,f)=>{if(a(ne.MOTOR_VEHICLE_NOT_FOUND,{product_type:"motor",lookup_method:"plate_number",attempt_number:d.current+=1}),O.error(g),!t.routes.manualVehicle)return;const j=t.routes.manualVehicle;p.current=setTimeout(()=>{O.info("No problem — enter your vehicle's details and we'll continue."),o(`/${j}`,{state:{...Xr({origin:"plate",plateNumber:f.plateNumber,vehicleType:f.vehicleType,sumInsured:f.sumInsured}),...c!==void 0&&{businessItem:c}}})},Bl)},m=(g,f,j)=>{const P=g[0];P&&a(ne.MOTOR_VEHICLE_FOUND,{product_type:"motor",lookup_method:"plate_number",vehicle_make:P.make??"unknown",vehicle_model:P.model??"unknown",vehicle_year:P.year??"unknown"});const T=Ft(g[0]?.year),S={verifyItems:g,...c!==void 0&&{businessItem:c}},k=new URLSearchParams({type:f,...j?{sumInsured:j}:{},...T?{year:T}:{}});o(`/${t.routes.vehicleInfo}?${k.toString()}`,{state:S})};return e.jsx(ee,{items:r,onGoBack:h,contentMaxW:"700px",mobileContentOnly:!0,children:e.jsx(Ka,{onSubmit:m,onVerificationFailed:b,planType:t.planType})})},Wl=({label:t,description:r,icon:s,status:o,onClick:i})=>{const a=o==="passed";return e.jsxs(w,{align:"center",gap:{base:3,md:4},border:"1px solid",borderColor:a?n.success[200]:n.border.primary,borderRadius:"2xl",p:{base:3.5,md:5},bg:a?n.success[50]:"white",cursor:a?"default":"pointer",onClick:a?void 0:i,transition:"all 0.2s ease",w:"100%",minW:0,_hover:a?{}:{borderColor:n.orange[300],bg:n.orange[50]},children:[e.jsx(u,{flexShrink:0,w:{base:"44px",md:"60px"},h:{base:"44px",md:"60px"},borderRadius:"xl",bg:a?n.success[100]:n.gray[50],border:"1px solid",borderColor:a?n.success[200]:n.border.primary,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",p:2,children:e.jsx(ue,{src:s,alt:t,w:"100%",h:"100%",objectFit:"contain"})}),e.jsxs(v,{align:"stretch",gap:1,flex:1,minW:0,children:[e.jsxs(z,{gap:2,flexWrap:"wrap",align:"center",children:[e.jsx(l,{fontSize:{base:"sm",md:"md"},fontWeight:"semibold",color:a?n.success[700]:n.text.primary,lineHeight:"short",children:t}),e.jsx(u,{px:2,py:.5,borderRadius:"full",bg:a?n.success[100]:n.orange[100],border:"1px solid",borderColor:a?n.success[300]:n.orange[300],flexShrink:0,children:e.jsx(l,{fontSize:"2xs",fontWeight:"bold",color:a?n.success[700]:n.text.orange,textTransform:"uppercase",letterSpacing:"wider",children:a?"Passed":"Pending"})})]}),e.jsx(l,{fontSize:{base:"xs",md:"sm"},color:n.text.gray,lineHeight:"1.5",children:r})]}),!a&&e.jsx(u,{flexShrink:0,alignSelf:"center",w:{base:"32px",md:"36px"},h:{base:"32px",md:"36px"},borderRadius:"full",bg:n.orange[500],display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(Pr,{size:18,color:"white"})})]})},wt=t=>{if(t==null)return!1;const r=t.trim();if(r==="")return!1;const s=r.replace(/\s/g,"");return!(s==="—"||s==="-"||s==="N/A"||s.toLowerCase()==="n/a")},Tt=({icon:t,label:r,value:s})=>e.jsxs(w,{align:"center",gap:2,minW:0,children:[e.jsx(W,{as:t,boxSize:3.5,color:n.text.gray,flexShrink:0,"aria-hidden":!0}),e.jsx(l,{as:"span",fontSize:"sm",color:n.text.info,flexShrink:0,children:r}),e.jsx(l,{as:"span",fontSize:"sm",fontWeight:"semibold",color:n.text.label,lineClamp:1,children:s})]}),Ol=({vehicle:t})=>{const r=wt(t.category),s=wt(t.plate),o=wt(t.chassisOrId);return e.jsx(u,{bg:n.white.DEFAULT,borderRadius:"xl",borderLeftColor:n.orange[500],boxSh
2adow:"0 4px 20px rgba(31, 54, 95, 0.05)",px:{base:4,md:5},py:{base:4,md:4},children:e.jsxs(w,{align:"flex-start",justify:"space-between",gap:{base:4,md:6},direction:{base:"column",sm:"row"},children:[e.jsxs(v,{align:"stretch",gap:3,flex:1,minW:0,children:[e.jsx(l,{as:"h2",fontSize:{base:"lg",md:"xl"},fontWeight:"semibold",color:n.text.label,lineHeight:"snug",letterSpacing:"-0.02em",children:t.model}),e.jsxs(z,{gap:2,flexWrap:"wrap",children:[e.jsx(lt,{variant:"subtle",size:"sm",rounded:"full",px:2.5,py:.5,fontWeight:"medium",customColors:{bg:n.orange[50],color:n.orange[600]},children:t.coverageType}),e.jsx(lt,{variant:"subtle",size:"sm",rounded:"full",px:2.5,py:.5,fontWeight:"medium",customColors:{bg:n.success[100],color:n.success[800]},startElement:e.jsx(W,{as:Tr,boxSize:3,color:n.success[700],display:"inline-block",flexShrink:0,"aria-hidden":!0}),children:"Verified"})]}),(r||s||o)&&e.jsxs(v,{align:"stretch",gap:2,pt:.5,children:[r?e.jsx(Tt,{icon:Ir,label:"Category:",value:t.category}):null,s?e.jsx(Tt,{icon:Ar,label:"Plate No:",value:t.plate}):null,o?e.jsx(Tt,{icon:Rr,label:"Chassis No.:",value:t.chassisOrId}):null]})]}),e.jsx(u,{flexShrink:0,alignSelf:{base:"flex-end",sm:"center"},opacity:.88,w:{base:"72px",md:"88px"},h:{base:"72px",md:"88px"},children:e.jsx(Lt,{brand:t.brand,size:"100%"})})]})})},Ul=({policyId:t,open:r,onClose:s,onPassed:o})=>{const{verifyPolicyBusinessAsync:i}=Xs(t),a=c=>{o(c),s()},d=async c=>{const p=await i({rcNumber:c}),h=p.data?.business;if(!h)throw new Error(p.message||"Business not found. Please check your CAC number and try again.");return h};return e.jsx(Ie,{open:r,onClose:s,closeOnInteractOutside:!1,closeOnEscape:!1,size:"xl",maxW:"580px",contentProps:{borderRadius:"28px",px:{base:5,md:8},py:{base:6,md:8}},bodyProps:{p:0},children:e.jsx(Ta,{onConfirm:a,verifyBusinessAsync:d})})},Hl=({videoId:t})=>e.jsx(Bo,{videoId:t,title:"Vehicle inspection guide"}),Yl=({open:t,onClose:r})=>{const s=x.useRef(null);return e.jsx(Ie,{open:t,onClose:r,size:"xl",initialFocusEl:()=>s.current,contentProps:{borderRadius:"28px",maxW:{base:"calc(100vw - 24px)",md:"min(92vw, 840px)"},px:{base:6,md:12},py:{base:8,md:10},w:"full"},children:e.jsxs(v,{ref:s,tabIndex:-1,outline:"none",gap:{base:7,md:8},align:"stretch",children:[e.jsxs(v,{align:"center",gap:{base:5,md:6},children:[e.jsxs(v,{align:"center",gap:3,children:[e.jsx(u,{borderWidth:"2px",borderColor:n.orange[500],borderRadius:"20px",bg:n.white.DEFAULT,p:{base:"6px",md:"8px"},lineHeight:0,boxShadow:"sm",children:e.jsx(ue,{src:Io,alt:"QR code to download the Myka app",w:{base:"220px",sm:"260px",md:"320px"},maxW:"100%",h:"auto",display:"block",verticalAlign:"top"})}),e.jsx(l,{fontSize:{base:"md",md:"lg"},fontWeight:"semibold",textAlign:"center",color:n.text.label,letterSpacing:"tight",children:"Scan to download the app"})]}),e.jsxs(v,{align:"center",gap:2,children:[e.jsx(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",textAlign:"center",color:n.text.primary,lineHeight:"short",children:"Continue on your phone"}),e.jsx(l,{fontSize:{base:"sm",md:"md"},textAlign:"center",color:n.text.gray,maxW:"480px",children:"Vehicle inspections require recording a video of your vehicle, so they can’t be completed on a laptop or desktop. Please Open the Myka app or use your mobile browser to continue."})]})]}),e.jsx(z,{gap:3,flexWrap:"wrap",justify:"center",children:e.jsx("a",{href:hr,target:"_blank",rel:"noopener noreferrer",children:e.jsx(N,{buttonType:"primary",text:"Google Play",icon:e.jsx(vr,{}),iconPosition:"left"})})})]})})},Gl=({open:t,onClose:r,onPassed:s})=>{const o=mt(),i=Ue(j=>j?.email??""),a=Ue(j=>j?.kyc),d=Ue(j=>j?.kycApproved??!1),{verifyKycAsync:c}=ii(),[p,h]=x.useState(!1),b=x.useMemo(()=>!a||!d?null:{fullName:[a.firstName,a.middleName,a.lastName].filter(Boolean).join(" ").trim()||"N/A",nin:a.documentNo??"N/A",email:i||"N/A",phoneNumber:a.phoneNumber??"N/A"},[a,d,i]),m=async j=>{const P=await c({documentType:"NIN",documentNumber:j});if(P.success===!1)throw new Error(P.message?.trim()||"Verification could not be completed. Please try again.");const T=P.data,S=[T?.firstName,T?.middleName,T?.lastName].filter(
2Boolean).join(" "),k=T?.phoneNumber||T?.phone||"";return{fullName:S||"N/A",nin:j,email:i||"N/A",phoneNumber:k||"N/A"}},g=async()=>{h(!0);try{await zs(o)}catch(j){O.error(te(j)??"We verified your NIN but could not refresh your profile.")}finally{h(!1)}s(),r()},f=async j=>{try{return await m(j)}catch(P){throw new Error(te(P)||"Verification failed. Please check your NIN and try again.")}};return e.jsx(Ie,{open:t,onClose:r,closeOnInteractOutside:!1,closeOnEscape:!1,size:"xl",maxW:"580px",contentProps:{borderRadius:"28px",px:{base:5,md:8},py:{base:6,md:8}},bodyProps:{p:0},children:e.jsx(Ao,{onVerifyNin:f,onContinue:g,isContinuing:p,continueButtonText:"Mark as Done",noteDescription:"To activate your motor policy and comply with NAICOM rules, we need to verify your identity. Your information is encrypted and secure.",...b&&{initialInfo:b}})})},ql=[{id:"nin",label:"NIN Verification",description:"Confirm your identity with your National Identification Number (NIN) to proceed.",icon:Ro,applies:()=>!0},{id:"email_verification",label:"Email Verification",description:"Verify your email address so we can send your policy documents and updates.",icon:ko,applies:()=>!0},{id:"business_verification",label:"Business Verification",description:"Provide your RC/BN so we can verify your registered business details.",icon:Fs,applies:t=>t.usageType==="BUSINESS"},{id:"vehicle_inspection",label:"Vehicle Inspection",description:"Record and upload short videos of your vehicle from all sides.",icon:So,applies:t=>t.coverType==="COMPREHENSIVE"}],Ql=t=>ql.filter(r=>r.applies(t)),Xl={nin:t=>t.kycApproved?"passed":"pending",email_verification:t=>t.hasVerifiedEmail?"passed":"pending",business_verification:t=>(t.policyUsageType??t.config.usageType)==="BUSINESS"&&t.hasBusiness?"passed":"pending",vehicle_inspection:t=>t.config.coverType==="COMPREHENSIVE"&&(t.policyStatus==="ACTIVE"||t.inspectionDoneOnMobile)?"passed":"pending"},$l=(t,{currentStatus:r,context:s})=>r==="passed"?"passed":Xl[t](s),Kl=t=>Object.fromEntries(t.map(r=>[r.id,"pending"])),Le=({config:t})=>{const[r]=je(),s=de(),{navigate:o}=J(),i=r.get("policyId"),a=x.useMemo(()=>Ql(t),[t]),d=Ue(R=>R?.kycApproved??!1),c=Ue(R=>R?.email),p=Vo(c),{data:h,isLoading:b}=Fr(i??""),m=h?.data,g=m?.vehicle,f=x.useMemo(()=>Ji({vehicle:g,coverageLabel:t.coverageLabel}),[g,t.coverageLabel]),[j,P]=x.useState(()=>{const R=Kl(a),H=!!s.state?.vehicleInspectionCompleted;return d&&(R.nin="passed"),p&&(R.email_verification="passed"),H&&(R.vehicle_inspection="passed"),R}),[T,S]=x.useState(null),[k,_]=x.useState(!1),{activatePolicyAsync:L,isLoading:I}=gr(),D={config:t,kycApproved:d,hasVerifiedEmail:p,policyUsageType:m?.usageType??null,hasBusiness:m?.business!=null,policyStatus:m?.status??null,inspectionDoneOnMobile:m!=null?Li(m):!1},M=R=>{P(H=>({...H,[R]:"passed"}))},U=R=>$l(R,{currentStatus:j[R]??"pending",context:D}),q=b&&a.some(R=>R.id==="business_verification"||R.id==="vehicle_inspection"),V=a.every(R=>U(R.id)==="passed");if(!i)return e.jsx(Ce,{to:"/home",replace:!0});const A=R=>{if(R==="vehicle_inspection"){if(Br()&&t.routes.vehicleInspection){o(`/${t.routes.vehicleInspection}?policyId=${i}`);return}_(!0);return}S(R)},E=()=>{M("email_verification"),S(null)},C=async()=>{const R=m?.quoteReference??r.get("quoteId")??"";if(!R){O.error("Missing quote reference. Please retry from Review Quote.");return}try{const Y=(await L({policyId:i,quoteId:R})).data,G=br(Y),Z=t.routes.activationSuccess,re=[g?.make??"",g?.model??"",g?.plateNumber?`- ${g.plateNumber}`:""].join(" ").replace(/\s+/g," ").trim();if(G){if(Z){const pe=new URLSearchParams({policyId:i,status:Y.status??"",policyNumber:Y.policyNumber??"",startDate:Y.startDate??"",endDate:Y.endDate??"",certificateUrl:Y.certificateUrl??"",mykaCertificate:Y.mykaCertificate??"",vehicleTitle:re||"Your Vehicle",...g?.make?.trim()?{vehicleBrand:g.make.trim()}:{}});o(`/${Z}?${pe.toString()}`,{replace:!0});return}O.success("Policy activated successfully!"),o(`/policies/${i}`,{replace:!0});return}O.success("Policy Pending"),o(`/policies/${i}`,{replace:!0})}catch{O.success("Policy Pending"),o(`/policies/${i}`,{replace:!0})}};
2return e.jsxs(u,{w:"100%",maxW:{base:"100%",md:"840px"},bg:"white",border:"2px solid",borderColor:"rgba(46, 74, 123, 0.09)",borderRadius:{base:"24px",md:"61px"},px:{base:4,md:8},pt:{base:5,md:"52px"},pb:{base:5,md:10},overflow:"hidden",mx:"auto",children:[e.jsxs(u,{w:"100%",maxW:"740px",mx:"auto",children:[e.jsxs(u,{mb:6,children:[e.jsx(u,{as:"span",display:"inline-flex",alignItems:"center",px:3,py:1,mb:3,borderRadius:"full",bg:n.orange[50],border:"1px solid",borderColor:n.orange[200],children:e.jsxs(l,{fontSize:"xs",fontWeight:"semibold",color:n.text.orange,letterSpacing:"wide",children:["Motor insurance · ",t.coverageLabel]})}),e.jsx(l,{as:"h1",fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:n.text.label,mb:2,lineHeight:"shorter",children:"Activate your policy"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,lineHeight:"1.65",children:"Complete the steps below, including email verification and any inspection required, then activate your cover. It only takes a few minutes."})]}),e.jsx(u,{mb:6,children:b?e.jsx(u,{bg:n.white.DEFAULT,borderRadius:"xl",borderWidth:"1px",borderColor:n.border.primary,borderLeftWidth:"4px",borderLeftColor:n.orange[500],px:{base:4,md:5},py:{base:4,md:4},children:e.jsxs(w,{align:"flex-start",gap:4,children:[e.jsx(Se,{borderRadius:"md",h:"72px",w:"72px",flexShrink:0}),e.jsxs(v,{align:"stretch",gap:2,flex:1,children:[e.jsx(Se,{height:"18px",width:"55%",borderRadius:"md"}),e.jsx(Se,{height:"22px",width:"85%",borderRadius:"md"}),e.jsx(Se,{height:"14px",width:"70%",borderRadius:"md"})]})]})}):f?e.jsx(Ol,{vehicle:f}):e.jsx(u,{bg:n.white.DEFAULT,borderRadius:"xl",borderWidth:"1px",borderColor:n.border.primary,borderLeftWidth:"4px",borderLeftColor:n.orange[500],px:{base:4,md:5},py:{base:4,md:4},children:e.jsxs(w,{align:"flex-start",gap:4,children:[e.jsx(Se,{borderRadius:"md",h:"72px",w:"72px",flexShrink:0}),e.jsxs(v,{align:"stretch",gap:2,flex:1,children:[e.jsx(Se,{height:"18px",width:"55%",borderRadius:"md"}),e.jsx(Se,{height:"22px",width:"85%",borderRadius:"md"})]})]})})}),e.jsx(l,{fontSize:"sm",fontWeight:"bold",color:n.text.label,mb:3,children:"Activation steps"}),e.jsx(v,{align:"stretch",gap:4,mb:6,children:q?e.jsx(e.Fragment,{children:a.map(R=>e.jsx(Se,{height:"108px",borderRadius:"2xl",borderWidth:"1px",borderColor:n.border.primary},R.id))}):a.map(R=>e.jsx(Wl,{label:R.label,description:R.description,icon:R.icon,status:U(R.id),onClick:()=>A(R.id)},R.id))}),!V&&e.jsxs(w,{align:"flex-start",gap:3,bg:n.orange[50],border:"1px solid",borderColor:n.orange[200],borderRadius:"xl",px:4,py:3.5,mb:6,children:[e.jsx(W,{as:jr,boxSize:5,color:n.orange[600],flexShrink:0,mt:.5,"aria-hidden":!0}),e.jsx(l,{fontSize:"sm",color:n.text.primary,lineHeight:"1.6",children:"Complete every step in the checklist to unlock activation. You can continue anytime — your payment is already secured."})]})]}),e.jsxs(v,{w:"100%",maxW:"640px",mx:"auto",gap:2.5,align:"stretch",mt:2,children:[e.jsx(N,{buttonType:"primary",text:"Activate Policy",fullWidth:!0,size:"lg",loading:I,disabled:!V||I,onClick:()=>void C()}),e.jsx(N,{buttonType:"outline",text:"View Policy",fullWidth:!0,border:`1px solid ${n.border.primary}`,size:"lg",disabled:I,onClick:()=>o(`/policies/${i}`)})]}),e.jsx(Gl,{open:T==="nin",onClose:()=>S(null),onPassed:()=>M("nin")}),e.jsx(zr,{open:T==="email_verification",onClose:()=>S(null),onVerified:E,initialEmail:c?.trim()??"",pendingEmail:c?.trim()??"",description:"We need a verified email so we can send your policy documents and important updates."}),e.jsx(Ul,{policyId:i,open:T==="business_verification",onClose:()=>S(null),onPassed:R=>M("business_verification")}),e.jsx(Yl,{open:k,onClose:()=>_(!1)})]})},Me=({config:t})=>{const[r]=je(),{navigate:s}=J(),[o,i]=x.useState(!1),a=r.get("policyId")??"",d=r.get("policyNumber")??"—",c=r.get("vehicleTitle")??"Your Vehicle",h=(r.get("vehicleBrand")?.trim()??"")||c,b=r.get("mykaCertificate")??"",m=r.get("certificateUrl")??"",g=$s(b,m),f=g!=null&&b.trim()!==""&&g===b.trim(),j=g?[{title:c,certLabel:`Policy No: ${d}`,url:g,downloadLabel:"Download Policy Certificate"}]:[],P=(()=>{const S=new Date,k=S.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),_=S.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1});return`Today, ${k} • ${_}`})(),T=async()=>{!d||d==="—"||(await navigator.clipboard.writeText(d),i(!0),O.success("Policy number copied"),window.setTimeout(()=>i(!1),1400))};return e.jsxs(ee,{items:[],hideGoBack:!0,onGoBack:()=>
2s("/home"),contentMaxW:"750px",mobileContentOnly:!0,children:[e.jsx(u,{w:"full",minW:0,maxW:"100%",backgroundImage:`linear-gradient(139.29deg, #F8FCF4 50%, #F2F8EC 100%), url(${Eo})`,backgroundSize:"cover",backgroundPosition:"top center",border:"1px solid",borderColor:"rgba(120, 53, 13, 0.11)",borderRadius:"33px",boxShadow:"0px 13px 74.8px 0px rgba(0, 0, 0, 0.01)",p:{base:4,md:"32px 28px"},children:e.jsxs(v,{gap:3,align:"stretch",children:[e.jsxs(v,{bg:"white",borderRadius:"2xl",border:"1px solid",borderColor:n.border.primary,py:{base:6,md:8},px:{base:4,md:6},gap:3,align:"center",children:[e.jsx(pt,{data:Dt,autoplay:!0,loop:!1}),e.jsxs(v,{gap:1,align:"center",children:[e.jsx(l,{fontWeight:"bold",fontSize:{base:"2xl",md:"3xl"},color:n.navy[500],textAlign:"center",lineHeight:"1.2",children:"You're All Set!"}),e.jsx(l,{textAlign:"center",color:n.text.gray,fontSize:"sm",lineHeight:"1.6",maxW:"360px",children:"Your policy has been activated and successfully issued. Download your documents below."})]}),e.jsx(u,{border:"1px solid",borderColor:n.border.primary,borderRadius:"xl",px:5,py:4,w:"full",children:e.jsxs(v,{gap:1,align:"center",children:[e.jsx(l,{fontSize:"xs",color:n.text.gray,fontWeight:"semibold",textTransform:"uppercase",letterSpacing:"0.1em",children:"Your Policy Number"}),e.jsxs(z,{gap:1,align:"center",justify:"center",maxW:"full",children:[e.jsx(l,{fontSize:{base:"lg",sm:"xl",md:"2xl"},fontWeight:"bold",color:n.navy[500],fontFamily:"mono",letterSpacing:"0.02em",textAlign:"center",wordBreak:"break-all",lineHeight:"1.25",children:d}),e.jsx(He,{"aria-label":o?"Copied!":"Copy policy number",variant:"ghost",size:"sm",color:o?n.success[600]:n.text.gray,onClick:()=>void T(),children:e.jsx(kr,{size:18})})]})]})})]}),j.map(S=>e.jsxs(w,{direction:{base:"column",md:"row"},justify:{base:"flex-start",md:"space-between"},align:{base:"stretch",md:"center"},gap:3,border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",p:4,bg:"white",w:"full",minW:0,children:[e.jsxs(z,{gap:3,align:"flex-start",flex:1,minW:0,w:{base:"full",md:"auto"},children:[e.jsx(u,{flexShrink:0,lineHeight:0,children:e.jsx(Lt,{brand:h,size:"56px",alt:S.title})}),e.jsxs(v,{align:"start",gap:.5,minW:0,flex:1,children:[e.jsx(l,{fontWeight:"bold",color:n.navy[500],fontSize:"sm",w:"full",wordBreak:"break-word",lineHeight:"short",children:S.title}),e.jsx(l,{fontSize:"xs",color:n.text.gray,w:"full",wordBreak:"break-word",lineHeight:"short",children:S.certLabel})]})]}),e.jsx(N,{type:"button",buttonType:"outline",text:S.downloadLabel,icon:e.jsx(Vn,{}),iconPosition:"left",size:"sm",border:`1px solid ${n.border.primary}`,onClick:()=>Ks(S.url),w:{base:"full",md:"auto"},alignSelf:{base:"stretch",md:"auto"},flexShrink:0})]},S.url)),e.jsxs(u,{bg:"white",border:"1px solid",borderColor:n.border.primary,borderRadius:"2xl",p:5,children:[e.jsx(l,{fontWeight:"bold",color:n.navy[500],fontSize:"md",mb:4,children:"Purchase Timeline"}),e.jsxs(v,{align:"stretch",gap:0,position:"relative",children:[e.jsx(u,{position:"absolute",left:"11px",top:"22px",bottom:"22px",w:"2px",bg:n.success[300]}),["Certificate sent to WhatsApp","Certificate sent to Email"].map(S=>e.jsxs(z,{align:"center",gap:3,py:3,position:"relative",children:[e.jsx(u,{flexShrink:0,color:n.success[500],children:e.jsx(En,{size:24})}),e.jsxs(v,{align:"start",gap:0,minW:0,flex:1,children:[e.jsx(l,{fontWeight:"semibold",color:n.text.primary,fontSize:"sm",wordBreak:"break-word",lineHeight:"short",children:S}),e.jsx(l,{fontSize:"xs",color:n.text.gray,children:P})]})]},S))]})]})]})}),e.jsx(u,{mt:4,w:"full",minW:0,children:e.jsx(N,{buttonType:"primary",text:"View Policy Details",fullWidth:!0,size:"lg",onClick:()=>s(`/policies/${a}`)})})]})},ze=({config:t})=>{const{items:r}=Te(),{navigate:s}=J(),o=de(),[i]=je(),a=i.get("policyId"),d=o.state??{},c=d.quoteData,p=d.policyId??a??void 0,h=d.planDuration??"ANNUALLY",b=d.paymentOption,m=b?.frequency??"ANNUAL",g=ut(xt),f=x.useMemo(()=>{const k=g?.vehicles;if(k?.length)return k.map((_,L)=>Si(_,t.coverageLabel,L));if(c&&!$e(c)){const _=c;if(_.vehicle)return[Ci(_.vehicle,t.coverageLabel)]}return[Pi(t.coverageLabel)]},[g,c,t.coverageLabel]),j=()=>{s(-1)},P=()=>{!p||!c||s(`/${t.routes.completePayment}`,{state:{policyId:p,quoteData:c,planDuration:h,paymentOption:b}}
2)};if(!c)return e.jsx(Ce,{replace:!0,to:`/${t.routes.compare}`,state:{policyId:p}});if(!p)return e.jsx(Ce,{replace:!0,to:`/${t.routes.compare}`,state:{policyId:p}});const T=wi(c,c.coverageDetails),S=he(c.premium);return e.jsx(ee,{items:r,onGoBack:j,...t.mobileContentOnly&&{mobileContentOnly:!0},children:e.jsx(v,{align:"stretch",gap:4,children:e.jsx(rl,{vehicles:f,provider:T,premiumDisplay:S,frequency:m,onContinue:P})})})},Jl=2e3,Zl="Missing quote reference. Please open the policy to continue.",ec=({config:t})=>{const{navigate:r}=J(),[s]=je(),o=Ue(G=>G?.kycApproved??!1),{activatePolicyAsync:i,isLoading:a}=gr(),[d,c]=x.useState(!1),p=s.get("policyId")??void 0,h=s.get("quoteId")??s.get("reference")??s.get("trxref")??void 0,b=s.get("trxref")??s.get("reference")??s.get("quoteId")??void 0,m=Js({config:t,kycApproved:o}),{refetch:g}=Fr(p??""),f=x.useCallback(G=>{O.success("Policy Pending"),r(`/policies/${G}`,{replace:!0})},[r]),j=x.useCallback(G=>{if(!t.routes.activationSuccess){O.success("Policy activated successfully!"),r(`/policies/${G.id}`,{replace:!0});return}const Z=Zs(G);r(`/${t.routes.activationSuccess}?${Z.toString()}`,{replace:!0})},[t.routes.activationSuccess,r]),P=x.useCallback(G=>{O.success("Policy activated successfully!"),j(G)},[j]),T=x.useCallback(G=>{f(G)},[f]),{autoFlowPhase:S,remainingSeconds:k,autoActivationProgress:_,autoActivationMessage:L,isAwaitingManualActivation:I}=en({enabled:m&&!!p,policyId:p,quoteId:h,refetchPolicy:async()=>({data:(await g()).data}),onPolicyActive:P,onPolicyUnresolved:T}),D=x.useCallback(()=>{b&&navigator.clipboard.writeText(b).then(()=>{c(!0),window.setTimeout(()=>c(!1),Jl)})},[b]),M=x.useCallback(async()=>{if(!p)return;let G=h?.trim();try{G=(await g()).data?.data?.quoteReference?.trim()||G}catch{}if(!G){O.error(Zl),f(p);return}try{const Z=await i({policyId:p,quoteId:G});if(br(Z.data))try{const pe=(await g()).data?.data;if(pe&&tn(pe.status)){P(pe);return}}catch{}f(p)}catch{f(p)}},[i,P,p,h,f,g]),U=x.useCallback(()=>{if(m){I&&M();return}if(p&&t.routes.policyActivation){r(`/${t.routes.policyActivation}?policyId=${p}`);return}if(p){r(`/policies/${p}`);return}r("/policies")},[t.routes.policyActivation,M,m,I,r,p]),q=x.useCallback(()=>{r("/home",{replace:!0})},[r]),V=m?I?"Activate Policy":S==="checking"?"Checking policy status…":`Preparing policy (${xr(k)})`:"Complete Policy Activation";return{isAutoActivate:m,transactionRef:b,transactionRefProps:b?{transactionRef:b,copied:d,onCopy:D}:null,statusCardProps:m?{message:L,progress:_,phase:S,remainingSeconds:k}:null,actionsProps:{primaryButtonText:V,isPrimaryDisabled:m?!I||a:!1,isPrimaryLoading:a||S==="checking",isSecondaryDisabled:a||S==="checking",onActivate:U,onBackToDashboard:q}}},Fe=({config:t})=>{const{isAutoActivate:r,transactionRefProps:s,statusCardProps:o,actionsProps:i}=ec({config:t}),{track:a}=Qe(),d=x.useRef(!1);return x.useEffect(()=>{d.current||(d.current=!0,a(ne.MOTOR_PAYMENT_COMPLETED,{product_type:"motor"}),a(ne.MOTOR_CERTIFICATE_ISSUED,{product_type:"motor"}),a(ne.MOTOR_FLOW_COMPLETED,{product_type:"motor"}))},[a]),e.jsx(ee,{items:[],hideGoBack:!0,onGoBack:i.onBackToDashboard,contentMaxW:"600px",children:e.jsxs(v,{bg:"white",borderRadius:"2xl",background:`linear-gradient(145deg, white 55%, ${n.orange[50]} 100%)`,border:"1px solid",borderColor:n.border.secondary,p:{base:6,md:10},align:"stretch",gap:6,children:[e.jsx(al,{isAutoActivate:r}),s&&e.jsx(cl,{...s}),o&&e.jsx(nl,{...o}),e.jsx(ll,{...i})]})})},dr=({config:t})=>{const{items:r}=Te(),{navigate:s}=J(),{compare:o,inspection:i}=t.routes;if(!i)throw new Error("SharedVehicleIdentificationPage: routes.inspection is required");const a=()=>{s(`/${i}`)},d=()=>{s(`/${o}`)};return e.jsx(ee,{items:r,onGoBack:d,contentMaxW:"800px",children:e.jsx(dl,{onNext:a})})},Be=({config:t})=>{const{items:r}=Te(),s=Bs(),o=Vt(),{navigate:i}=J(),a=de(),[d]=je(),c=d.get("type")??"CAR",p=d.get("sumInsured")??"",h=d.get("year")??"",b=x.useMemo(()=>{const I=Gi(a.state);if(!I)return I;const D=!!p.trim(),M=!!h.trim();return!D&&!M?I:I.map((U,q)=>q===0?{...U,...D&&{sumInsured:p},...M&&{year:h.trim()}}:U)},[a.state,p,h]),m=a.state?.verifyItems,g=a.state?.businessItem,f=t.routes.fleetResults?!!$r(a.state):!1,j=`/${t.routes.plateVerify}`,{createMotorPolicyAsync:P,isLoading:T}
2=rn(),S=T,k=t.coverageType&&t.planType?Et({name:o?.kyc?.firstName??null,coverageType:t.coverageType,planType:t.planType}):void 0;x.useEffect(()=>{b||i(j,{replace:!0})},[b,i,j]);const _=async I=>{s(Ws(I));try{const D=I.vehicles[0]?.sumInsured?.trim()||p.trim(),M=D&&D!=="0"?D:void 0,U=I.vehicles[0],q=U?.color?.trim(),V=U?.brand?.trim(),A=U?.model?.trim(),E=U?.year?.trim(),C=await P({usageType:t.usageType,coverType:t.coverType,type:c,vehicles:m?.map(R=>R.id)??[],...M?{sumInsured:M}:{},...q?{color:q}:{},...V?{make:V}:{},...A?{model:A}:{},...E?{year:E}:{},...t.usageType==="BUSINESS"&&g?.id!==void 0&&{businessId:g.id}});i(`/${t.routes.paymentOption??t.routes.compare}`,{state:{policyId:C.data.id}})}catch(D){O.error(te(D)??"Failed to create policy. Please try again.")}},L=()=>{i(f&&t.routes.fleetResults?`/${t.routes.fleetResults}`:j)};return b?e.jsx(ee,{items:r,onGoBack:L,...t.mobileContentOnly&&{mobileContentOnly:!0},children:e.jsx(Il,{onNext:_,onBack:L,initialVehicles:b,policyType:t.policyType,coverageType:t.coverageType,isSubmitting:S,whatsAppUrl:k})}):null},tc="car_verification",rc=t=>t.includes("mp4")?"mp4":(t.includes("webm"),"webm"),sc=t=>{const r=Math.floor(t/60),s=t%60;return`${String(r).padStart(2,"0")}:${String(s).padStart(2,"0")}`},nc=({policyId:t,onComplete:r})=>{const[s,o]=x.useState("instructions"),{uploadFile:i,getUploadUrl:a,progress:d,resetUploaderState:c}=No({multipartThresholdBytes:0,getAccessToken:()=>Os.getAccessToken()}),{saveMotorDocumentReferenceAsync:p}=ui(),h=x.useCallback(()=>{o("recording")},[]),b=x.useCallback(()=>{o("review")},[]),m=x.useCallback(()=>{o("instructions")},[]),g=x.useCallback(async f=>{o("uploading"),c();try{const j=f.type.split(";")[0]?.trim()||"video/webm",P=rc(j),T=`motor-inspection-${t}-${Date.now()}.${P}`,S=new File([f],T,{type:j}),k=await i({file:S,filename:T,mimeType:j,contextType:tc,contextId:t}),_=k.url.trim()||(await a(k.key)).url,L=await p({policyId:t,body:{type:"INSPECTION",referenceUrl:_}});if(!L.success)throw new Error(L.message||"Could not save inspection. Please try again.");o("success"),window.setTimeout(()=>{r()},1800)}catch(j){o("review"),O.error(te(j)??"Upload failed. Please try again or retake the video.")}},[a,r,t,c,p,i]);return{step:s,uploadPercent:Math.round(d?.percent??0),formatElapsed:sc,goToRecording:h,goToReview:b,goToInstructions:m,submitRecording:g}},oc=()=>Do()?"":["video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"].find(r=>MediaRecorder.isTypeSupported(r))??"",nt=t=>{t?.getTracks().forEach(r=>r.stop())},ic=t=>new Promise(r=>{window.setTimeout(r,t)}),ac=()=>{const t=x.useRef(null),r=x.useRef(null),s=x.useRef(null),o=x.useRef([]),i=x.useRef(""),a=x.useRef(0),d=x.useRef(null),c=x.useRef(!1),[p,h]=x.useState(!1),[b,m]=x.useState(0),[g,f]=x.useState(null),[j,P]=x.useState(null),[T,S]=x.useState(!1),[k,_]=x.useState(!1),L=x.useCallback(()=>{P(A=>(A&&URL.revokeObjectURL(A),null))},[]),I=x.useCallback(()=>{if(c.current)return;const A=s.current;if(A&&A.state!=="inactive")try{A.stop()}catch{}s.current=null,nt(r.current),r.current=null,t.current&&(t.current.srcObject=null),_(!1)},[]),D=x.useCallback(async A=>{for(let E=0;E<12;E+=1){const C=t.current;if(C)return C.setAttribute("playsinline","true"),C.setAttribute("webkit-playsinline","true"),C.muted=!0,C.srcObject=A,await C.play().catch(()=>{}),!0;await ic(40)}return!1},[]),M=x.useCallback(async()=>{S(!1),_(!1);try{const A=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"},width:{ideal:720},height:{ideal:960}},audio:!0});if(r.current=A,A.getTracks().forEach(C=>{C.onended=()=>S(!0)}),!await D(A)){nt(A),r.current=null,S(!0);return}_(!0)}catch{S(!0)}},[D]);x.useEffect(()=>{const A=t.current;return()=>{d.current&&clearInterval(d.current),c.current=!1;const E=s.current;if(E&&E.state!=="inactive")try{E.stop()}catch{}s.current=null,nt(r.current),r.current=null,A&&(A.srcObject=null),L()}},[L]);const U=x.useCallback(()=>{if(!r.current||p)return;o.current=[],L(),f(null);const A=oc(),E=new MediaRecorder(r.current,A?{mimeType:A}:void 0);i.current=E.mimeType||A,o.current=[],E.ondataavailable=C=>{C.data.size>0&&o.current.push(C.data)},E.onerror=()=>S(!0),s.current=E,a.current=Date.now(),E.start(250),h(!0),m(0),d.current=setInterval(()=>{m(C=>C+1)},1e3)},[L,p]),q=x.useCallback(()=>new Promise(A=>{const E=s.current;if(!E||E.state==="inactive"){c.current=!1,I(),h(!1),A(null);return}c.current=!0;let C=!1;const R=()=>{d.current&&(clearInterval(d.current),d.current=null)},H=async()=>
2{if(C)return;C=!0,window.clearTimeout(Y),R(),h(!1);const re=o.current;if(!re.length){c.current=!1,I(),A(null);return}const pe=re[0].type||E.mimeType||i.current||"video/webm",Ge=new Blob(re,{type:pe});let ge=Ge;if(pe.includes("webm")&&a.current>0)try{const Re=Date.now()-a.current;ge=await _o(Ge,Re,{logger:!1})}catch{ge=Ge}if(ge.size===0){c.current=!1,I(),A(null);return}const Ke=URL.createObjectURL(ge);f(ge),P(Re=>(Re&&URL.revokeObjectURL(Re),Ke)),c.current=!1,s.current=null,nt(r.current),r.current=null,t.current&&(t.current.srcObject=null),_(!1),A(Ke)},Y=window.setTimeout(()=>{H()},Lo);let G=!1;const Z=()=>{o.current.length&&H()};E.ondataavailable=re=>{re.data.size>0&&o.current.push(re.data),G&&Z()},E.onstop=()=>Z(),E.onerror=()=>{H()},G=!0,E.stop()}),[I]),V=x.useCallback(()=>{d.current&&(clearInterval(d.current),d.current=null),h(!1),m(0),f(null),L()},[L]);return{videoRef:t,isCameraReady:k,cameraError:T,isRecording:p,elapsedSeconds:b,recordedBlob:g,previewUrl:j,startCamera:M,releaseCamera:I,startRecording:U,stopAndGetUrl:q,resetRecording:V}},ur=({config:t})=>{const[r]=je(),{navigate:s}=J(),o=r.get("policyId")??"",i=t.routes.policyActivation?`/${t.routes.policyActivation}`:"/home",{step:a,uploadPercent:d,formatElapsed:c,goToRecording:p,goToReview:h,goToInstructions:b,submitRecording:m}=nc({policyId:o,onComplete:()=>{s(`${i}?policyId=${o}`,{replace:!0,state:{vehicleInspectionCompleted:!0}})}}),{videoRef:g,isCameraReady:f,cameraError:j,isRecording:P,elapsedSeconds:T,recordedBlob:S,previewUrl:k,startCamera:_,releaseCamera:L,startRecording:I,stopAndGetUrl:D,resetRecording:M}=ac();if(x.useEffect(()=>{if(a==="recording")return _(),()=>{L()}},[L,_,a]),!o)return e.jsx(Ce,{to:"/home",replace:!0});if(!Br())return e.jsx(Ce,{replace:!0,to:`${i}?policyId=${o}`});const U=()=>{p()},q=()=>{D().then(E=>{if(!E){O.error("No video was captured. Please try recording again.");return}h()})},V=()=>{M(),p()},A=()=>{S&&m(S)};return a==="instructions"?e.jsxs(w,{direction:"column",w:"100%",maxW:"520px",mx:"auto",px:4,pt:2,pb:4,minH:{base:"calc(100dvh - 220px)",md:"calc(100dvh - 180px)"},bg:n.white.DEFAULT,children:[e.jsxs(v,{align:"stretch",gap:4,flexShrink:0,children:[e.jsxs(u,{children:[e.jsx(l,{fontSize:{base:"xl",md:"2xl"},fontWeight:"bold",color:n.text.label,mb:2,children:"How to inspect your vehicle"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,lineHeight:"1.6",children:"Watch this short guide, then record a walk-around video of your vehicle outdoors."})]}),e.jsx(Hl,{videoId:Us})]}),e.jsxs(v,{align:"stretch",gap:3,flexShrink:0,mt:"auto",pt:6,children:[e.jsx(N,{buttonType:"primary",text:"Begin inspection",size:"lg",fullWidth:!0,onClick:U}),e.jsx(N,{buttonType:"ghost",text:"Back",borderColor:n.border.primary,borderWidth:1,size:"lg",fullWidth:!0,onClick:()=>s(`${i}?policyId=${o}`)})]})]}):a==="recording"?e.jsxs(w,{direction:"column",w:"100%",h:{base:"calc(100dvh - 200px)",md:"calc(100dvh - 160px)"},maxH:"100dvh",bg:"white",overflow:"hidden",children:[e.jsxs(u,{flex:"1",minH:0,position:"relative",bg:n.gray[100],children:[e.jsx("video",{ref:g,autoPlay:!0,playsInline:!0,muted:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block"}}),j?e.jsx(w,{position:"absolute",inset:0,align:"center",justify:"center",px:6,bg:"blackAlpha.600",zIndex:1,children:e.jsx(l,{color:"white",textAlign:"center",children:"Could not access your camera. Allow camera and microphone permissions, then try again."})}):null,!f&&!j?e.jsx(w,{position:"absolute",inset:0,align:"center",justify:"center",zIndex:1,children:e.jsx(l,{color:n.text.gray,fontSize:"sm",children:"Opening camera…"})}):null,P?e.jsxs(w,{position:"absolute",top:4,left:"50%",transform:"translateX(-50%)",align:"center",gap:2,bg:"white",px:3,py:1.5,borderRadius:"full",fontSize:"sm",fontWeight:"bold",zIndex:2,boxShadow:"0 2px 10px rgba(0,0,0,0.12)",children:[e.jsx(u,{w:"8px",h:"8px",borderRadius:"full",bg:n.error[500]}),e.jsxs(l,{color:n.error[600],children:["REC ",c(T)]})]}):null]}),e.jsxs(v,{gap:3,px:4,pt:4,pb:{base:4,md:4},flexShrink:0,bg:"white",borderTopRadius:"2xl",children:[e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"center",children:"Walk around your vehicle and record all sides. Stop when you are done."}),P?e.jsx(N,{buttonType:"primary",text:"Stop recording",size:"lg",fullWidth:!0,bg:n.error[500],_hover:{bg:n.error[600]},_active:{bg:n.error[700]},onClick:q}):e.jsx(N,{buttonType:"primary",text:f?"Start recording":"Opening c
2amera…",size:"lg",fullWidth:!0,disabled:!f||j,onClick:I}),e.jsx(N,{buttonType:"ghost",text:"Cancel",size:"lg",fullWidth:!0,disabled:P,onClick:()=>{L(),b()}})]})]}):a==="review"?e.jsxs(w,{direction:"column",w:"100%",h:{base:"calc(100dvh - 200px)",md:"calc(100dvh - 160px)"},maxH:"100dvh",bg:n.white.DEFAULT,overflow:"hidden",children:[e.jsx(u,{flex:"1",minH:0,position:"relative",bg:"black",children:k?e.jsx("video",{src:k,controls:!0,playsInline:!0,preload:"metadata",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"contain",display:"block",backgroundColor:"#000"}},k):e.jsx(w,{position:"absolute",inset:0,align:"center",justify:"center",children:e.jsx(l,{color:"whiteAlpha.800",fontSize:"sm",children:"Preparing preview…"})})}),e.jsxs(v,{gap:3,px:4,py:4,align:"stretch",flexShrink:0,children:[e.jsx(l,{fontSize:"lg",fontWeight:"semibold",color:n.text.label,textAlign:"center",children:"Review your inspection video"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"center",children:"Looks good? Submit it, or retake if you need another take."}),e.jsx(N,{buttonType:"primary",text:"Submit",size:"lg",fullWidth:!0,disabled:!S,onClick:A}),e.jsx(N,{buttonType:"ghost",text:"Retake",borderColor:n.border.primary,borderWidth:1,size:"lg",fullWidth:!0,onClick:V})]})]}):a==="uploading"?e.jsx(w,{w:"100%",h:{base:"calc(100dvh - 220px)",md:"calc(100dvh - 180px)"},align:"center",justify:"center",px:6,bg:n.white.DEFAULT,children:e.jsxs(v,{gap:3,children:[e.jsx(Mo,{value:d,size:120,thickness:12}),e.jsx(l,{fontSize:"md",fontWeight:"semibold",color:n.text.label,textAlign:"center",children:"Uploading inspection video…"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"center",children:"Please keep this screen open until upload finishes."})]})}):e.jsx(w,{w:"100%",h:{base:"calc(100dvh - 220px)",md:"calc(100dvh - 180px)"},align:"center",justify:"center",px:6,bg:n.white.DEFAULT,children:e.jsxs(v,{gap:2,children:[e.jsx(l,{fontSize:"xl",fontWeight:"bold",color:n.success[700],textAlign:"center",children:"Inspection complete"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"center",children:"Taking you back to activation…"})]})})},lc="/assets/car-vin-C6o0_qmz.png",We=({config:t})=>{const{navigate:r}=J(),{items:s}=Te(),o=()=>{r(t.routes.backFromPlateVerify)},i=()=>{t.routes.vinInput&&r(`/${t.routes.vinInput}`)},a=()=>{r(`/${t.routes.plateVerify}`)};return e.jsx(ee,{items:s,onGoBack:o,contentMaxW:"620px",mobileContentOnly:!0,children:e.jsx(w,{align:"center",justify:"center",px:{base:4,md:6},py:{base:4,md:6},w:"100%",children:e.jsxs(u,{w:"100%",bg:"white",borderRadius:"3xl",border:"1px solid",borderColor:n.border.primary,overflow:"hidden",boxShadow:"sm",children:[e.jsx(u,{px:{base:6,md:8},pt:{base:6,md:8},pb:4,children:e.jsx(l,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",color:n.text.primary,lineHeight:"1.15",children:"Identify your vehicle with VIN"})}),e.jsx(u,{px:{base:6,md:8},pb:4,children:e.jsxs(u,{bg:n.orange[50],borderRadius:"xl",border:"1px solid",borderColor:n.orange[100],px:5,py:4,children:[e.jsx(l,{fontSize:"xs",fontWeight:"bold",color:n.text.orange,letterSpacing:"wider",textAlign:"center",textTransform:"uppercase",mb:1,children:"Where to find your VIN"}),e.jsx(l,{fontSize:"sm",color:n.text.gray,textAlign:"justify",lineHeight:"1.6",children:"Your VIN is a 17-character code used to identify your vehicle. You can find it on the dashboard (visible through the windshield), inside the driver's door frame, or on your vehicle documents."})]})}),e.jsx(u,{mx:{base:6,md:8},mb:5,borderRadius:"2xl",overflow:"hidden",border:"1px solid",borderColor:n.border.primary,bg:n.navy[50],position:"relative",h:{base:"220px",md:"260px"},children:e.jsx(ue,{src:lc,alt:"VIN location on vehicle",w:"100%",h:"100%",objectFit:"cover",objectPosition:"center"})}),e.jsx(u,{px:{base:6,md:8},pb:5,children:e.jsx(N,{buttonType:"primary",text:" Enter VIN",iconPosition:"left",fullWidth:!0,size:"lg",onClick:i})}),e.jsxs(w,{align:"center",justify:"center",gap:2,pb:{base:6,md:8},px:{base:6,md:8},children:[e.jsx(l,{fontSize:"sm",color:n.text.gray,children:"Do you have a plate no?"}),e.jsxs(z,{gap:1,cursor:"pointer",onClick:a,color:n.text.orange,_hover:{opacity:.75},transition:"opacity 0.2s",children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",children:"Use Plate No"}),e.jsx(Nn,{size:14})]})]})]})})})},cc=1800,Oe=({config:t})=>{const{items:r}=Te(),{navigate:s,navigateImmediate:o}=J(),i=de(),a=Vt(),d=t.usageType==="BUSINESS"?i.state?.businessItem:void 0,c=x.useRef(null);x.useEffect(()=>()=>{c.current!=null&&clearTimeout(c.current)},[]);const p=()=>{s(Mt)},h=(g,f)=>{if(O.error(g),!t.routes.manualVehicle)return;const j=t.routes.manualVehicle;c.current=setTimeout(()=>{O.info("No problem — enter your vehicle's details and we'll continue."),o(`/${j}`,{state:{...Xr({origin:"vin",chassisNumber:f.chassisNumber,vehicleType:f.vehicleType,sumInsured:f.sumInsured}),...d!==void 0&&{businessItem:d}}})},cc)},b=(g,f,j)=>{const P=Ft(g[0]?.year),T={verifyItems:g,...d!==void 0&&{businessItem:d}},S=new URLSearchParams({type:f,...j?{sumInsured:j}:{},...P?{year:P}:{}});o(`/${t.routes.vehicleInfo}?${S.toString()}`,{state:T})}
2,m=t.coverageType&&t.planType?Et({name:a?.kyc?.firstName??null,coverageType:t.coverageType,planType:t.planType}):void 0;return e.jsx(ee,{items:r,onGoBack:p,contentMaxW:"700px",mobileContentOnly:!0,children:e.jsx(Fl,{onSubmit:b,onVerificationFailed:h,planType:t.planType,...m?{whatsAppUrl:m}:{}})})},$={usageType:"BUSINESS",coverType:"COMPREHENSIVE",policyType:"comprehensive",coverageType:"business",planType:"comprehensive",coverageLabel:"Comprehensive",mobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/business`,plateVerify:y.BusinessComprehensivePlateVerify,vinIdentify:y.BusinessComprehensiveVinIdentify,vinInput:y.BusinessComprehensiveVinInput,manualVehicle:y.BusinessComprehensiveManualVehicle,vehicleInfo:y.BusinessComprehensiveVehicle,paymentOption:y.BusinessComprehensivePaymentOption,compare:y.BusinessComprehensiveCompare,reviewQuote:y.BusinessComprehensiveReviewQuote,completePayment:y.BusinessComprehensiveCompletePayment,download:y.BusinessComprehensiveDownload,paymentFailed:y.BusinessComprehensivePaymentFailed,inspection:y.BusinessComprehensiveInspection,vehicleInspection:y.BusinessComprehensiveVehicleInspection,fleet
2Upload:y.BusinessComprehensiveFleetUpload,fleetUploadBack:y.BusinessComprehensivePlateVerify,fleetResults:y.BusinessComprehensiveFleetResults,policyActivation:y.BusinessComprehensiveActivate,activationSuccess:y.BusinessComprehensiveActivationSuccess}},oe={usageType:"BUSINESS",coverType:"THIRD_PARTY",policyType:"third-party",coverageType:"business",planType:"third_party",coverageLabel:"Third-Party Only",mobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/business`,plateVerify:y.BusinessThirdPartyPlateVerify,vinIdentify:y.BusinessThirdPartyVinIdentify,vinInput:y.BusinessThirdPartyVinInput,manualVehicle:y.BusinessThirdPartyManualVehicle,vehicleInfo:y.BusinessThirdPartyVehicleInfo,compare:y.BusinessThirdPartyComparePlans,reviewQuote:y.BusinessThirdPartyReviewQuote,completePayment:y.BusinessThirdPartyCompletePayment,download:y.BusinessThirdPartyDownload,paymentFailed:y.BusinessThirdPartyPaymentFailed,fleetUpload:y.BusinessThirdPartyFleetUpload,fleetUploadBack:y.BusinessThirdPartyVehicleCount,fleetResults:y.BusinessThirdPartyFleetResults,vehicleCount:y.BusinessThirdPartyVehicleCount,policyActivation:y.BusinessThirdPartyActivate,activationSuccess:y.BusinessThirdPartyActivationSuccess}},ie={usageType:"BUSINESS",coverType:"THIRD_PARTY_PLUS",policyType:"third-party-plus",coverageType:"business",planType:"third-party-plus",coverageLabel:"Third-Party Plus",mobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/business`,plateVerify:y.BusinessThirdPartyPlusPlateVerify,vinIdentify:y.BusinessThirdPartyPlusVinIdentify,vinInput:y.BusinessThirdPartyPlusVinInput,manualVehicle:y.BusinessThirdPartyPlusManualVehicle,vehicleInfo:y.BusinessThirdPartyPlusVehicleInfo,compare:y.BusinessThirdPartyPlusComparePlans,reviewQuote:y.BusinessThirdPartyPlusReviewQuote,completePayment:y.BusinessThirdPartyPlusCompletePayment,download:y.BusinessThirdPartyPlusDownload,paymentFailed:y.BusinessThirdPartyPlusPaymentFailed,fleetUpload:y.BusinessThirdPartyPlusFleetUpload,fleetUploadBack:y.BusinessThirdPartyPlusVehicleCount,fleetResults:y.BusinessThirdPartyPlusFleetResults,vehicleCount:y.BusinessThirdPartyPlusVehicleCount,policyActivation:y.BusinessThirdPartyPlusActivate,activationSuccess:y.BusinessThirdPartyPlusActivationSuccess}},K={usageType:"PERSONAL",coverType:"COMPREHENSIVE",policyType:"comprehensive",coverageType:"personal",planType:"comprehensive",coverageLabel:"Comprehensive",mobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/personal`,plateVerify:y.PersonalComprehensivePlateVerify,vinIdentify:y.PersonalComprehensiveVinIdentify,vinInput:y.PersonalComprehensiveVinInput,manualVehicle:y.PersonalComprehensiveManualVehicle,vehicleInfo:y.PersonalComprehensiveVehicle,paymentOption:y.PersonalComprehensivePaymentOption,compare:y.PersonalComprehensiveCompare,reviewQuote:y.PersonalComprehensiveReviewQuote,completePayment:y.PersonalComprehensiveCompletePayment,download:y.PersonalComprehensiveDownload,paymentFailed:y.PersonalComprehensivePaymentFailed,inspection:y.PersonalComprehensiveInspection,vehicleInspection:y.PersonalComprehensiveVehicleInspection,fleet
2Upload:y.PersonalComprehensiveFleetUpload,fleetUploadBack:y.PersonalComprehensivePlateVerify,fleetResults:y.PersonalComprehensiveFleetResults,policyActivation:y.PersonalComprehensiveActivate,activationSuccess:y.PersonalComprehensiveActivationSuccess}},ae={usageType:"PERSONAL",coverType:"THIRD_PARTY",policyType:"third-party",coverageType:"personal",planType:"third_party",coverageLabel:"Third-Party Only",mobileContentOnly:!0,verifyIdentityMobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/personal`,plateVerify:y.PersonalThirdPartyPlateVerify,vinIdentify:y.PersonalThirdPartyVinIdentify,vinInput:y.PersonalThirdPartyVinInput,manualVehicle:y.PersonalThirdPartyManualVehicle,vehicleInfo:y.PersonalThirdPartyVehicle,compare:y.PersonalThirdPartyCompare,reviewQuote:y.PersonalThirdPartyReviewQuote,completePayment:y.PersonalThirdPartyCompletePayment,download:y.PersonalThirdPartyDownload,paymentFailed:y.PersonalThirdPartyPaymentFailed,fleetUpload:y.PersonalThirdPartyFleetUpload,fleetUploadBack:y.PersonalThirdPartyPlateVerify,fleetResults:y.PersonalThirdPartyFleetResults,policyActivation:y.PersonalThirdPartyActivate,activationSuccess:y.PersonalThirdPartyActivationSuccess}},le={usageType:"PERSONAL",coverType:"THIRD_PARTY_PLUS",policyType:"third-party-plus",coverageType:"personal",planType:"third-party-plus",coverageLabel:"Third-Party Plus",mobileContentOnly:!0,routes:{backFromPlateVerify:`/${y.PlanSelection}/personal`,plateVerify:y.PersonalThirdPartyPlusPlateVerify,vinIdentify:y.PersonalThirdPartyPlusVinIdentify,vinInput:y.PersonalThirdPartyPlusVinInput,manualVehicle:y.PersonalThirdPartyPlusManualVehicle,vehicleInfo:y.PersonalThirdPartyPlusVehicle,compare:y.PersonalThirdPartyPlusCompare,reviewQuote:y.PersonalThirdPartyPlusReviewQuote,completePayment:y.PersonalThirdPartyPlusCompletePayment,download:y.PersonalThirdPartyPlusDownload,paymentFailed:y.PersonalThirdPartyPlusPaymentFailed,fleetUpload:y.PersonalThirdPartyPlusFleetUpload,fleetUploadBack:y.PersonalThirdPartyPlusPlateVerify,fleetResults:y.PersonalThirdPartyPlusFleetResults,policyActivation:y.PersonalThirdPartyPlusActivate,activationSuccess:y.PersonalThirdPartyPlusActivationSuccess}},dc=F(()=>B(()=>import("./PlanSelectionPage-HYI-GYkM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),uc=F(()=>B(()=>import("./IncidentTypePage-Cg6SL62e.js"),__vite__mapDeps([98,1,2,3,4,5,6,7,99,100,65,9,10,70,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),pc=F(()=>B(()=>import("./AccidentDetailsPage-KgGq6Xge.js"),__vite__mapDeps([101,1,2,3,4,5,6,7,102,76,14,99,103,8,104,9,10,70,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),mc=F(()=>B(()=>import("./UploadEvidencePage-BEBkHIUz.js"),__vite__mapDeps([105,1,2,3,4,5,6,7,99,106,65,14,102,76,107,93,9,10,70,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97]))),hc=F(()=>B(()=>import("./SuccessPage-CKqde2jz.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,99,109,70]))),xc=F(()=>B(()=>import("./AccidentDetailsPage-B_yFZQ48.js"),__vite__mapDeps([110,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),gc=F(()=>B(()=>import("./VideoInspectionPage-uzv6K08R.js"),__vite__mapDeps([111,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,112,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),bc=F(()=>B(()=>import("./VideoUploadedPage-Sb2zu5u4.js"),__vite__mapDeps([113,1,2,3,4,5,6,7,9,75,114,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),yc=F(()=>B(()=>import("./ThirdPartyInfoPage-D_oEEKGz.js"),__vite__mapDeps([115,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),fc=F(()=>B(()=>import("./PoliceReportPage-Lf65yDZD.js"),__vite__mapDeps([116,1,2,3,4,5,6,7,9,75,117,107,118,8,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),jc=F(()=>B(()=>import("./InsuranceVerifiedPage-UuRtHnfh.js"),__vite__mapDeps([119,1,2,3,4,5,6,7,99,18,19,20,21,22,23,24,25,26,27,28,29,120,121,122,123,46,124,9,56,125,126,127,10,52,128,55,75,129,30,33,34,35,42,43,44,45,47,48,49,50,51,53,54,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),vc=F(()=>B(()=>import("./SelectVehiclePage-BO2agAsq.js"),__vite__mapDeps([130,1,2,3,4,5,6,7,9,75,131,85,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,86,87,88,89,90,91,92,93,94,95,96,97]))),Sc=F(()=>B(()=>import("./AccidentDetailsPage-D9HLncB4.js"),__vite__mapDeps([132,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Cc=F(()=>B(()=>import("./VideoInspectionPage-BFyf9XOm.js"),__vite__mapDeps([133,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,112,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Pc=F(()=>B(()=>import("./VideoUploadedPage-BbBoXCZB.js"),__vite__mapDeps([134,1,2,3,4,5,6,7,9,75,114,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),wc=F(()=>B(()=>import("./ThirdPartyInfoPage-BmYKnr7P.js"),__vite__mapDeps([135,1,2,3,4,5,6,7,9,75,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Tc=F(()=>B(()=>import("./PoliceReportPage-DjFIUYxG.js"),__vite__mapDeps([136,1,2,3,4,5,6,7,9,75,117,107,118,8,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Ic=F(()=>B(()=>import("./InsuranceVerifiedPage-C2WIZjvU.js"),__vite__mapDeps([137,1,2,3,4,5,6,7,99,18,19,20,21,22,23,24,25,26,27,28,29,120,121,122,123,46,124,9,56,125,126,127,10,52,128,55,75,129,30,33,34,35,42,43,44,45,47,48,49,50,51,53,54,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Ac=F(()=>B(()=>import("./AccidentDetailsPage-CHg6A80m.js"),__vite__mapDeps([138,1,2,3,4,5,6,7,9,75,139,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Rc=F(()=>B(()=>import("./ReportIncidentPage-BTsBrArP.js"),__vite__mapDeps([140,1,2,3,4,5,6,7,9,75,141,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),kc=F(()=>B(()=>import("./VideoInspectionPage-DQ-QGv82.js"),__vite__mapDeps([142,1,112,3,2,4,5,6,7,9,10,70,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Vc=F(()=>B(()=>import("./VideoUploadedPage-kfz02EDI.js"),__vite__mapDeps([143,1,2,3,4,5,6,7,9,75,114,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Ec=F(()=>B(()=>import("./IncidentDetailsPage-CXdoqGbG.js"),__vite__mapDeps([144,1,2,3,4,5,6,7,9,75,145,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Nc=F(()=>B(()=>import("./LicenseUploadPage-5wTgb-hM.js"),__vite__mapDeps([146,1,2,3,4,5,6,7,9,75,118,8,147,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),_c=F(()=>B(()=>import("./PolicyVerifiedPage-CfiqdAra.js"),__vite__mapDeps([148,1,2,3,4,5,6,7,9,75,129,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Dc=F(()=>B(()=>import("./WorkshopsPage-hw8wIsfy.js"),__vite__mapDeps([149,1,2,3,4,5,6,7,9,75,150,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Lc=F(()=>B(()=>
2import("./InspectionDetailsPage-0tPOOQO-.js"),__vite__mapDeps([151,1,2,3,4,5,6,7,9,75,152,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,70,10,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Mc=F(()=>B(()=>import("./AccidentDetailsPage-CgfIDOx9.js"),__vite__mapDeps([153,1,2,3,4,5,6,7,9,75,139,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),zc=F(()=>B(()=>import("./SelectVehiclePage-CfmfvN7b.js"),__vite__mapDeps([154,1,2,3,4,5,6,7,9,75,131,85,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,86,87,88,89,90,91,92,93,94,95,96,97]))),Fc=F(()=>B(()=>import("./ReportIncidentPage-DBsaw4IY.js"),__vite__mapDeps([155,1,2,3,4,5,6,7,9,75,141,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Bc=F(()=>B(()=>import("./VideoInspectionPage-hSxiFIeV.js"),__vite__mapDeps([156,1,112,3,2,4,5,6,7,9,10,70,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,8,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Wc=F(()=>B(()=>import("./VideoUploadedPage-DNhvHG2L.js"),__vite__mapDeps([157,1,2,3,4,5,6,7,9,75,114,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Oc=F(()=>B(()=>import("./IncidentDetailsPage-CwnLx-DJ.js"),__vite__mapDeps([158,1,3,2,4,5,6,7,8,9,75,145,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Uc=F(()=>B(()=>import("./LicenseUploadPage-Blb4Ttcb.js"),__vite__mapDeps([159,1,2,3,4,5,6,7,9,75,118,8,147,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Hc=F(()=>B(()=>import("./PolicyVerifiedPage-CMQ2HH4W.js"),__vite__mapDeps([160,1,2,3,4,5,6,7,9,75,129,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Yc=F(()=>B(()=>import("./WorkshopsPage-42qROv7u.js"),__vite__mapDeps([161,1,2,3,4,5,6,7,9,75,150,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,10,70,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),Gc=F(()=>B(()=>import("./InspectionDetailsPage-7KP9zrhL.js"),__vite__mapDeps([162,1,2,3,4,5,6,7,9,75,152,84,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,42,43,44,45,46,47,48,49,50,51,52,53,54,55,70,10,11,12,13,14,15,16,17,8,31,32,36,37,38,39,40,41,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,73,74,76,77,78,79,80,81,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97]))),xs=[{path:"select-plan/:category",element:e.jsx(dc,{})},{path:"personal/third-party/plate-verify",element:e.jsx(De,{config:ae})},{path:"personal/third-party/vin-identify",element:e.jsx(We,{config:ae})},{path:"personal/third-party/vin-input",element:e.jsx(Oe,{config:ae})},{path:"personal/third-party/manual-vehicle",element:e.jsx(Ne,{config:ae})},{path:"personal/third-party/vehicle",element:e.jsx(Be,{config:ae})},{path:"personal/third-party/compare",element:e.jsx(ke,{config:ae})},{path:"personal/third-party/review-quote",element:e.jsx(ze,{config:ae})},{path:"personal/third-party/complete-payment",element:e.jsx(Ve,{config:ae})},{path:"personal/third-party/download",element:e.jsx(Fe,{config:ae})},{path:"personal/third-party/payment-failed",element:e.jsx(_e,{config:ae})},{path:"personal/third-party/activate",element:e.jsx(Le,{config:ae})},{path:"personal/third-party/activation-success",element:e.jsx(Me,{config:ae})},{path:"personal/third-party-plus/plate-verify",element:e.jsx(De,{config:le})},{path:"personal/third-party-plus/vin-identify",element:e.jsx(We,{config:le})},{path:"personal/third-party-plus/vin-input",element:e.jsx(Oe,{config:le})},{path:"personal/third-party-plus/manual-vehicle",element:e.jsx(Ne,{config:le})},{path:"personal/third-party-plus/vehicle",element:e.jsx(Be,{config:le})},{path:"personal/third-party-plus/compare",element:e.jsx(ke,{config:le})},{path:"personal/third-party-plus/review-quote",element:e.jsx(ze,{config:le})},{path:"personal/third-party-plus/complete-payment",element:e.jsx(Ve,{config:le})},{path:"personal/third-party-plus/download",element:e.jsx(Fe,{config:le})},{path:"personal/third-party-plus/activate",element:e.jsx(Le,{config:le})},{path:"personal/third-party-plus/activation-success",element:e.jsx(Me,{config:le})},{path:"personal/third-party-plus/payment-failed",element:e.jsx(_e,{config:le})}
2,{path:"personal/comprehensive/plate-verify",element:e.jsx(De,{config:K})},{path:"personal/comprehensive/vin-identify",element:e.jsx(We,{config:K})},{path:"personal/comprehensive/vin-input",element:e.jsx(Oe,{config:K})},{path:"personal/comprehensive/manual-vehicle",element:e.jsx(Ne,{config:K})},{path:"personal/comprehensive/vehicle",element:e.jsx(Be,{config:K})},{path:"personal/comprehensive/payment-option",element:e.jsx(cr,{config:K})},{path:"personal/comprehensive/compare",element:e.jsx(ke,{config:K})},{path:"personal/comprehensive/review-quote",element:e.jsx(ze,{config:K})},{path:"personal/comprehensive/complete-payment",element:e.jsx(Ve,{config:K})},{path:"personal/comprehensive/download",element:e.jsx(Fe,{config:K})},{path:"personal/comprehensive/payment-failed",element:e.jsx(_e,{config:K})},{path:"personal/comprehensive/activate",element:e.jsx(Le,{config:K})},{path:"personal/comprehensive/activation-success",element:e.jsx(Me,{config:K})},{path:"personal/comprehensive/vehicle-id",element:e.jsx(dr,{config:K})},{path:"personal/comprehensive/inspection",element:e.jsx(sr,{config:K})},{path:"personal/comprehensive/vehicle-inspection",element:e.jsx(ur,{config:K})},{path:"business/third-party/plate-verify",element:e.jsx(De,{config:oe})},{path:"business/third-party/vin-identify",element:e.jsx(We,{config:oe})},{path:"business/third-party/vin-input",element:e.jsx(Oe,{config:oe})},{path:"business/third-party/manual-vehicle",element:e.jsx(Ne,{config:oe})},{path:"business/third-party/vehicle-info",element:e.jsx(Be,{config:oe})},{path:"business/third-party/compare-plans",element:e.jsx(ke,{config:oe})},{path:"business/third-party/review-quote",element:e.jsx(ze,{config:oe})},{path:"business/third-party/complete-payment",element:e.jsx(Ve,{config:oe})},{path:"business/third-party/download",element:e.jsx(Fe,{config:oe})},{path:"business/third-party/payment-failed",element:e.jsx(_e,{config:oe})},{path:"business/third-party/activate",element:e.jsx(Le,{config:oe})},{path:"business/third-party/activation-success",element:e.jsx(Me,{config:oe})},{path:"business/third-party-plus/plate-verify",element:e.jsx(De,{config:ie})},{path:"business/third-party-plus/vin-identify",element:e.jsx(We,{config:ie})},{path:"business/third-party-plus/vin-input",element:e.jsx(Oe,{config:ie})},{path:"business/third-party-plus/manual-vehicle",element:e.jsx(Ne,{config:ie})},{path:"business/third-party-plus/vehicle-info",element:e.jsx(Be,{config:ie})},{path:"business/third-party-plus/compare-plans",element:e.jsx(ke,{config:ie})},{path:"business/third-party-plus/review-quote",element:e.jsx(ze,{config:ie})},{path:"business/third-party-plus/complete-payment",element:e.jsx(Ve,{config:ie})},{path:"business/third-party-plus/download",element:e.jsx(Fe,{config:ie})},{path:"business/third-party-plus/payment-failed",element:e.jsx(_e,{config:ie})},{path:"business/third-party-plus/activate",element:e.jsx(Le,{config:ie})},{path:"business/third-party-plus/activation-success",element:e.jsx(Me,{config:ie})},{path:"business/comprehensive/plate-verify",element:e.jsx(De,{config:$})},{path:"business/comprehensive/vin-identify",element:e.jsx(We,{config:$})},{path:"business/comprehensive/vin-input",element:e.jsx(Oe,{config:$})},{path:"business/comprehensive/manual-vehicle",element:e.jsx(Ne,{config:$})},{path:"business/comprehensive/vehicle",element:e.jsx(Be,{config:$})},{path:"business/comprehensive/payment-option",element:e.jsx(cr,{config:$})},{path:"business/comprehensive/compare",element:e.jsx(ke,{config:$})},{path:"business/comprehensive/review-quote",element:e.jsx(ze,{config:$})},{path:"business/comprehensive/complete-payment",element:e.jsx(Ve,{config:$})},{path:"business/comprehensive/vehicle-id",element:e.jsx(dr,{config:$})},{path:"business/comprehensive/inspection",element:e.jsx(sr,{config:$})},{path:"business/comprehensive/vehicle-inspection",element:e.jsx(ur,{config:$})},{path:"business/comprehensive/download",element:e.jsx(Fe,{config:$})},{path:"business/comprehensive/payment-failed",element:e.jsx(_e,{config:$})},{path:"business/comprehensive/activate",element:e.jsx(Le,{config:$})}
2,{path:"business/comprehensive/activation-success",element:e.jsx(Me,{config:$})},{path:"claims/fnol/incident-type",element:e.jsx(uc,{})},{path:"claims/fnol/accident-details",element:e.jsx(pc,{})},{path:"claims/fnol/upload-evidence",element:e.jsx(mc,{})},{path:"claims/fnol/success",element:e.jsx(hc,{})},{path:"claims/third-party/personal/accident-details",element:e.jsx(xc,{})},{path:"claims/third-party/personal/video-inspection",element:e.jsx(gc,{})},{path:"claims/third-party/personal/video-uploaded",element:e.jsx(bc,{})},{path:"claims/third-party/personal/third-party-info",element:e.jsx(yc,{})},{path:"claims/third-party/personal/police-report",element:e.jsx(fc,{})},{path:"claims/third-party/personal/verified",element:e.jsx(jc,{})},{path:"claims/third-party/business/select-vehicle",element:e.jsx(vc,{})},{path:"claims/third-party/business/accident-details",element:e.jsx(Sc,{})},{path:"claims/third-party/business/video-inspection",element:e.jsx(Cc,{})},{path:"claims/third-party/business/video-uploaded",element:e.jsx(Pc,{})},{path:"claims/third-party/business/third-party-info",element:e.jsx(wc,{})},{path:"claims/third-party/business/police-report",element:e.jsx(Tc,{})},{path:"claims/third-party/business/verified",element:e.jsx(Ic,{})},{path:"claims/comprehensive/personal/accident-details",element:e.jsx(Ac,{})},{path:"claims/comprehensive/personal/report-incident",element:e.jsx(Rc,{})},{path:"claims/comprehensive/personal/video-inspection",element:e.jsx(kc,{})},{path:"claims/comprehensive/personal/video-uploaded",element:e.jsx(Vc,{})},{path:"claims/comprehensive/personal/incident-details",element:e.jsx(Ec,{})},{path:"claims/comprehensive/personal/license-upload",element:e.jsx(Nc,{})},{path:"claims/comprehensive/personal/verified",element:e.jsx(_c,{})},{path:"claims/comprehensive/personal/workshops",element:e.jsx(Dc,{})},{path:"claims/comprehensive/personal/inspection-details",element:e.jsx(Lc,{})},{path:"claims/comprehensive/business/accident-details",element:e.jsx(Mc,{})},{path:"claims/comprehensive/business/select-vehicle",element:e.jsx(zc,{})},{path:"claims/comprehensive/business/report-incident",element:e.jsx(Fc,{})},{path:"claims/comprehensive/business/video-inspection",element:e.jsx(Bc,{})},{path:"claims/comprehensive/business/video-uploaded",element:e.jsx(Wc,{})},{path:"claims/comprehensive/business/incident-details",element:e.jsx(Oc,{})},{path:"claims/comprehensive/business/license-upload",element:e.jsx(Uc,{})},{path:"claims/comprehensive/business/verified",element:e.jsx(Hc,{})},{path:"claims/comprehensive/business/workshops",element:e.jsx(Yc,{})},{path:"claims/comprehensive/business/inspection-details",element:e.jsx(Gc,{})}],gs="select-plan/:category",It=xs.find(t=>t.path===gs),qc=xs.filter(t=>t.path!==gs),Qc=()=>e.jsx(x.Suspense,{fallback:e.jsx(kt,{}),children:e.jsxs(Cs,{children:[It&&e.jsx(yt,{path:It.path,element:It.element}),e.jsx(yt,{element:e.jsx(Ys,{}),children:qc.map(({path:t,element:r})=>e.jsx(yt,{path:t,element:r},t))})]})}),Xc=/\/(download|activation-success|comprehensive-success)/,$c=t=>t.split("?")[0].replace(/\/$/,"").split("/").pop()||"unknown",Kc=()=>{const t=x.useRef(0);return x.useEffect(()=>{t.current=Date.now()},[]),Hs({event:ne.MOTOR_FLOW_DROPPED,routePrefix:"/motor",isComplete:()=>Xc.test(window.location.pathname),getDropProps:()=>({product_type:"motor",drop_off_screen:$c(window.location.pathname),time_in_flow_seconds:Math.round((Date.now()-t.current)/1e3)})}),e.jsx(xi,{children:e.jsx(Qc,{})})},lu=Object.freeze(Object.defineProperty({__proto__:null,MotorRoutesEnum:y,default:Kc},Symbol.toStringTag,{value:"Module"}));export{iu as A,Mo as C,ka as I,su as M,au as T,ou as a,Ta as b,nu as g,lu as i,Te as u};

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.