1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3746],{1812:(e,t,l)=>{"use strict";l.d(t,{A:()=>x});var n=l(37876),a=l(14232),r=l(98477),s=l(38773),i=l(90939),o=l(78593),c=l(50839),u=l(32033);let d="linear-gradient(180deg, #A296FF 0%, #6C5CE7 100%)",m=[{value:"Son",label:"Son"},{value:"Daughter",label:"Daughter"}],p={check:"/icons/edit-details/check.svg",close:"/icons/edit-details/close.svg",minus:"/icons/edit-details/minus.svg",plus:"/icons/edit-details/plus.svg"};function h(e){let{checked:t,size:l=22}=e;return l>=32?t?(0,n.jsx)("img",{src:p.check,alt:"",className:"size-8 shrink-0","aria-hidden":!0}):(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg border-2 border-[#DDD9F7] bg-white"}):(0,n.jsx)("span",{className:"flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded border-2 transition-colors ".concat(t?"border-[#6C5CE7] bg-[#6C5CE7]":"border-gray-300 bg-white"),children:t&&(0,n.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})})}function f(e){let{onClick:t,desktop:l=!1}=e;return(0,n.jsx)("button",{type:"button",onClick:t,className:l?"relative size-6 shrink-0":"flex h-8 w-8 items-center justify-center rounded-full transition-colors hover:bg-gray-100","aria-label":"Close",children:l?(0,n.jsx)("img",{src:p.close,alt:"",className:"size-6","aria-hidden":!0}):(0,n.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"#555",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,n.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}function x(e){let{isOpen:t=!0,onClose:l,onSave:x,requirementData:g=null,insuranceType:v="health",variant:y="sheet",advisorName:b,coverageValue:_=null}=e,w=(null==v?void 0:v.toLowerCase())==="term",j=w?"Term":"Health",k=b||(w?i.u1:i.Mo),C="modal"===y,[N,S]=(0,a.useState)("base"),[E,A]=(0,a.useState)(!0),[I,F]=(0,a.useState)(""),[L,D]=(0,a.useState)([]),[T,P]=(0,a.useState)(""),[B,q]=(0,a.useState)(!1),[R,H]=(0,a.useState)(u.P1),[O,M]=(0,a.useState)(!1),[z,U]=(0,a.useState)(null),[G,V]=(0,a.useState)(null),[W,J]=(0,a.useState)(""),[Y,K]=(0,a.useState)(c.rU),[Q,X]=(0,a.useState)([]),[$,Z]=(0,a.useState)(null),{selectedMembers:ee,ages:et,childrenCount:el,childrenData:en,city:ea,illnesses:er}=R,es=(0,a.useCallback)(e=>{F(""),H(t=>({...t,...e}))},[]);(0,a.useEffect)(()=>{if(!t)return;let e=!1;return(async()=>{var t,l,n,a,r;let{requirement:s,cities:i}=await (0,u.JU)(g,j);if(e)return;let o=(0,u.iI)(s);Z(s||null),H(o),X(o.illnesses);let d=(0,c.K6)(null!=(r=null!=(a=null!=_?_:null==s?void 0:s.sum_assured)?a:null==s||null==(l=s.personas)||null==(t=l[0])?void 0:t.sum_assured)?r:null,c.r4);V(d.selection),J(d.custom),K((0,c.P5)(d.selection,d.custom)),P((null==(n=o.city)?void 0:n.city_name)||""),u.f7.some(e=>o.selectedMembers[e])&&M(!0),D(i),A(!1)})(),()=>{e=!0}},[t,g,j,_]),(0,a.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&("illness"===N?S("base"):null==l||l())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,N,l]);let ei=(0,a.useMemo)(()=>(0,s.Rg)(L,T),[L,T]),eo=e=>{F(""),H(t=>{let l={...t.selectedMembers};return l[e]?(delete l[e],"children"===e)?{...t,selectedMembers:l,childrenCount:0,childrenData:[]}:{...t,selectedMembers:l}:(l[e]={...(0,u.ru)(e),count:1},"children"===e)?{...t,selectedMembers:l,childrenCount:1,childrenData:[{relation:"",age:null}]}:{...t,selectedMembers:l}})},ec=e=>{F(""),H(t=>{let l=Math.max(1,t.childrenCount+e),n=l>t.childrenData.length?[...t.childrenData,...Array.from({length:l-t.childrenData.length},()=>({relation:"",age:null}))]:t.childrenData.slice(0,l);return{...t,childrenCount:l,childrenData:n}})},eu=(e,t,l)=>{F(""),H(n=>{let a=[...n.childrenData];return a[e]={...a[e],[t]:l},{...n,childrenData:a}})},ed=e=>{es({city:e}),P(e.city_name),q(!1)},em=e=>{ed(L.find(t=>t.city_name.toLowerCase().startsWith(e.toLowerCase()))||{city_id:null,city_name:e})},ep=e=>{X(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eh=()=>{let e=(0,u.DG)(R);if(e)return void F(e);if(!(null==ea?void 0:ea.city_name))return void F("Please select your city");let t=(0,u.GT)(R),n=(0,c.P5)(G,W),a=(0,u.xS)({baseRequirement:$||g,personas:t,city:ea,illnesses:er,coverage:n,insuranceType:j}),r={...(0,u.xY)({previousRequirement:$||g,updatedRequirement:a,personas:t,membersSummary:(0,u.cw)(ee,en)}),coverageValue:n,coverageChanged:n!==Y};null==x||x(t,a,r),null==l||l()};if(!t||"undefined"==typeof document)return null;let ef=e=>(0,r.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[99999] flex ".concat(C?"items-stretch justify-start py-4 pl-4":"items-end justify-center"),children:[(0,n.jsx)("div",{className:"animate-backdrop-in absolute inset-0 bg-black/25 backdrop-blur-[3px]",onClick:l}),(0,n.jsx)("div",{className:"animate-sheet-up relative flex w-full flex-col overflow-hidden bg-white ".concat(C?"h-full max-h-[calc(100dvh-32px)] w-[400px] max-w-[400px] rounded-2xl shadow-[0px_6px_4px_2px_rgba(22,18,46,0.08)]":"max-h-[88dvh] rounded-t-3xl"),style:C?void 0:{paddingBottom:"env(safe-area-inset-bottom, 16px)"},children:e})]}),document.body);if(E)return ef((0,n.jsxs)("div",{className:"flex justify-center gap-1 py-16",children:[(0,n.jsx)("span",{className:"h-2 w-2 animate-bounce rounded-full bg-[#6C5CE7]",style:{animationDelay:"0ms"}}),(0,n.jsx)("span",{className:"h-2 w-2 animate-bounce rounded-full bg-[#6C5CE7]",style:{animationDelay:"150ms"}}),(0,n.jsx)("span",{className:"h-2 w-2 animate-bounce rounded-full bg-[#6C5CE7]",style:{animationDelay:"300ms"}})]}));if("illness"===N)return ef((0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:C?"px-4 pt-4":"px-6 pt-6",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{X(er),S("base")},className:"flex h-7 w-7 items-center justify-center","aria-label":"Back",children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#261E48",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,n.jsx)("h2",{className:C?"text-[22px] font-semibold text-[#261E48]":"text-[20px] font-bold text-[#1A1A2E]",children:"Edit Illness"})]}),(0,n.jsx)(f,{onClick:l,desktop:C})]}),(0,n.jsxs)("p",{className:C?"mt-2 pl-9 text-[14px] font-medium leading-[1.3] text-[#525252]":"mt-1 pl-9 text-[13px] text-gray-400",children:[k," uses this to find the right plans"]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto ".concat(C?"px-4 py-4":"px-6 py-5"),children:(0,n.jsx)("div",{className:"grid grid-cols-2 gap-3",children:u._9.map(e=>{let t=Q.includes(e.value);return(0,n.jsxs)("button",{type:"button",onClick:()=>ep(e.value),className:"flex items-center gap-2.5 rounded-xl border bg-white px-3.5 py-3.5 text-left transition-colors ".concat(t?"border-[#6C5CE7]":"border-[#DDD9F7] hover:border-[#C8C2F0]"),children:[(0,n.jsx)(h,{checked:t,size:C?32:22}),(0,n.jsx)("span",{className:"text-[14px] font-medium text-[#261E48]",children:e.label})]},e.value)})})}),(0,n.jsx)("div",{className:C?"shrink-0 bg-white p-4 shadow-[0px_-3px_13px_rgba(38,30,72,0.08)]":"border-t border-gray-100 px-6 py-4",children:(0,n.jsx)("button",{type:"button",onClick:()=>{es({illnesses:Q}),S("base")},className:C?"flex h-10 w-full items-center justify-center rounded-full bg-[#6C5CE7] text-[16px] font-medium tracking-[-0.32px] text-white":"w-full rounded-2xl py-3.5 text-sm font-bold text-white",style:C?void 0:{background:d},children:"Save"})})]}));let ex=u.zB.filter(e=>O||!u.f7.includes(e.id));return ef(C?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto p-4 pb-28",children:[(0,n.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,n.jsxs)("div",{className:"flex w-full items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("h2",{className:"text-[22px] font-semibold leading-[1.5] text-[#261E48]",children:"Edit Details"}),(0,n.jsxs)("p",{className:"text-[14px] font-medium leading-[1.3] text-[#525252]",children:[k," uses this to find the right plans"]})]}),(0,n.jsx)(f,{onClick:l,desktop:!0})]}),(0,n.jsx)("div",{className:"flex w-full flex-col gap-4",children:ex.map(e=>{let t=!!ee[e.id],l="children"===e.id;return(0,n.jsxs)("div",{className:"flex w-full items-start gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>eo(e.id),"aria-label":e.label,className:"mt-2 shrink-0",children:(0,n.jsx)(h,{checked:t,size:32})}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2 rounded-2xl border border-solid border-[#DDD9F7] px-3 py-2 ".concat(l&&t?"":"h-12 justify-center"," ").concat(t?"":"cursor-pointer"),onClick:()=>!t&&eo(e.id),children:[(0,n.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,n.jsx)("p",{className:"min-w-0 flex-1 text-[14px] font-medium leading-[1.5] text-[#525252]",children:e.label}),t&&!l?(0,n.jsx)("div",{className:"w-[120px] shrink-0",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(o.A,{value:et["".concat(e.id,"_0")]||"",onChange:t=>es({ages:{...et,["".concat(e.id,"_0")]:parseInt(t,10)||null}}),placeholder:"Select age",options:u.vL.map(e=>({value:e,label:"".concat(e," years")})),isOpen:z==="".concat(e.id,"_age"),onToggle:t=>U(t?"".concat(e.id,"_age"):null),triggerClassName:"h-8 w-full rounded-lg bg-[#F5F5F5] px-2",textClassName:"text-[12px]",menuClassName:"right-0 w-[160px]"})}):null,t&&l?(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2 px-2",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{type:"button",onClick:()=>ec(-1),"aria-label":"Remove a child",className:"size-5 shrink-0",children:(0,n.jsx)("img",{src:p.minus,alt:"",className:"size-5","aria-hidden":!0})}),(0,n.jsx)("div",{className:"flex h-7 w-[42px] items-center justify-center rounded-lg border border-solid border-[#DDD9F7]",children:(0,n.jsx)("span",{className:"text-[14px] font-medium text-[#261E48]",children:el})}),(0,n.jsx)("button",{type:"button",onClick:()=>ec(1),"aria-label":"Add a child",className:"size-5 shrink-0",children:(0,n.jsx)("img",{src:p.plus,alt:"",className:"size-5","aria-hidden":!0})})]}):null]}),t&&l&&en.length>0?en.map((e,t)=>(0,n.jsxs)("div",{className:"flex w-full gap-2",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("div",{className:"min-w-0 flex-1",children:(0,n.jsx)(o.A,{value:e.relation,onChange:e=>eu(t,"relation",e),placeholder:"Select Relation",options:m,isOpen:z==="child_".concat(t,"_rel"),onToggle:e=>U(e?"child_".concat(t,"_rel"):null),triggerClassName:"h-8 w-full rounded-lg bg-[#F5F5F5] px-2",textClassName:"text-[12px]"})}),(0,n.jsx)("div",{className:"min-w-0 flex-1",children:(0,n.jsx)(o.A,{value:e.age||"",onChange:e=>eu(t,"age",parseInt(e,10)||null),placeholder:"Select age",options:u.oH.map(e=>({value:e,label:"".concat(e," years")})),isOpen:z==="child_".concat(t,"_age"),onToggle:e=>U(e?"child_".concat(t,"_age"):null),triggerClassName:"h-8 w-full rounded-lg bg-[#F5F5F5] px-2",textClassName:"text-[12px]"})})]},t)):null]})]},e.id)})}),(0,n.jsxs)("button",{type:"button",onClick:()=>M(e=>!e),className:"flex items-center gap-2 text-[14px] font-medium leading-[1.3] text-[#6C5CE7]",children:[O?"Show less members":"Show more members",(0,n.jsx)(o.c,{open:O,size:16,stroke:"#6C5CE7"})]})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-[14px] font-semibold leading-[1.3] text-[#261E48]",children:"Existing Illness"}),(0,n.jsxs)("button",{type:"button",onClick:()=>{X(er),S("illness")},className:"flex h-12 w-full items-center gap-2 rounded-2xl bg-[#F5F5F5] px-3 text-left",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-[14px] font-medium text-[#525252]",children:(0,u.Vy)(er)}),(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#525252",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
1children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})]})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-[14px] font-semibold leading-[1.3] text-[#261E48]",children:"Cover amount"}),(0,n.jsx)(c.Ay,{options:c.r4,selection:G,onSelectionChange:V,customLakhs:W,onCustomChange:J,isOpen:"coverage"===z,onToggle:e=>U(e?"coverage":null)})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,n.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,n.jsxs)("p",{className:"text-[14px] font-semibold leading-[1.3] text-[#261E48]",children:["Your City"," ",(0,n.jsx)("span",{className:"text-[12px] font-medium",children:"(Enter city or pin code)"})]}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{type:"text",value:T,onChange:e=>{P(e.target.value),q(!0),F("")},placeholder:"Search city...",className:"h-12 w-full rounded-2xl bg-[#F5F5F5] px-3 text-[14px] font-medium text-[#525252] outline-none"}),B&&T.length>0&&ei.length>0&&(0,n.jsx)("div",{className:"absolute left-0 right-0 top-full z-10 mt-1 max-h-40 overflow-y-auto rounded-xl border border-[#DDD9F7] bg-white shadow-lg",children:ei.slice(0,5).map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>ed(e),className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm transition-colors hover:bg-[#EFF0FE]",children:(0,n.jsx)("span",{className:"font-medium text-[#6C5CE7]",children:e.city_name})},e.city_id))})]})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-[14px] font-medium leading-[1.5] text-[#261E48]",children:"Select your city"}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-4",children:[u.u9.map(e=>{var t;let l=null==ea||null==(t=ea.city_name)?void 0:t.toLowerCase().startsWith(e.toLowerCase());return(0,n.jsx)("button",{type:"button",onClick:()=>em(e),className:"flex h-8 items-center rounded-full border border-solid px-3 text-[14px] font-medium text-[#525252] ".concat(l?"border-[#6C5CE7]":"border-[#DDD9F7]"),children:e},e)}),(0,n.jsx)("button",{type:"button",onClick:()=>{P(""),es({city:null})},className:"flex h-8 items-center rounded-full border border-solid border-[#DDD9F7] px-3 text-[14px] font-medium text-[#525252]",children:"Other"})]})]})]})]}),(0,n.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-white p-4 shadow-[0px_-3px_13px_rgba(38,30,72,0.08)]",children:[I?(0,n.jsx)("p",{className:"mb-2 text-center text-xs text-red-500",children:I}):null,(0,n.jsx)("button",{type:"button",onClick:eh,className:"flex h-10 w-full items-center justify-center rounded-full bg-[#6C5CE7] text-[16px] font-medium tracking-[-0.32px] text-white",children:"Show Plan"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"px-6 pt-6",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("h2",{className:"text-[20px] font-bold text-[#1A1A2E]",children:"Edit Details"}),(0,n.jsx)(f,{onClick:l})]}),(0,n.jsxs)("p",{className:"mt-1 text-[13px] text-gray-400",children:[k," uses this to find the right plans"]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:[(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ex.map(e=>{let t=!!ee[e.id],l="children"===e.id;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("button",{type:"button",onClick:()=>eo(e.id),"aria-label":e.label,children:(0,n.jsx)(h,{checked:t})}),(0,n.jsxs)("div",{onClick:()=>!t&&eo(e.id),className:"flex flex-1 items-center justify-between rounded-xl border border-gray-200 px-4 ".concat(l&&t?"py-2":"py-2.5"," ").concat(t?"":"cursor-pointer"),children:[(0,n.jsx)("span",{className:"text-[15px] font-medium text-[#1A1A2E]",children:e.label}),t&&!l&&(0,n.jsx)("div",{className:"w-[124px] shrink-0",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(o.A,{value:et["".concat(e.id,"_0")]||"",onChange:t=>es({ages:{...et,["".concat(e.id,"_0")]:parseInt(t,10)||null}}),placeholder:"Select age",options:u.vL.map(e=>({value:e,label:"".concat(e," years")})),isOpen:z==="".concat(e.id,"_age"),onToggle:t=>U(t?"".concat(e.id,"_age"):null),triggerClassName:"h-9 w-full rounded-lg border border-gray-200 bg-white px-2.5",textClassName:"text-[13px]",menuClassName:"right-0 w-[160px]"})}),t&&l&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>ec(-1),className:"flex h-7 w-7 items-center justify-center rounded-md border border-gray-300 text-gray-600","aria-label":"Remove a child",children:"â"}),(0,n.jsx)("span",{className:"w-5 text-center text-[14px] font-semibold text-[#1A1A2E]",children:el}),(0,n.jsx)("button",{type:"button",onClick:()=>ec(1),className:"flex h-7 w-7 items-center justify-center rounded-md border border-gray-300 text-gray-600","aria-label":"Add a child",children:"+"})]})]})]}),t&&l&&en.length>0&&(0,n.jsx)("div",{className:"mt-2 ml-[34px] flex flex-col gap-2",children:en.map((e,t)=>(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("div",{className:"min-w-0 flex-1",children:(0,n.jsx)(o.A,{value:e.relation,onChange:e=>eu(t,"relation",e),placeholder:"Select Relation",options:m,isOpen:z==="child_".concat(t,"_rel"),onToggle:e=>U(e?"child_".concat(t,"_rel"):null),triggerClassName:"h-10 w-full rounded-lg border border-gray-200 bg-white px-3",textClassName:"text-[13px]"})}),(0,n.jsx)("div",{className:"min-w-0 flex-1",children:(0,n.jsx)(o.A,{value:e.age||"",onChange:e=>eu(t,"age",parseInt(e,10)||null),placeholder:"Select age",options:u.oH.map(e=>({value:e,label:"".concat(e," years")})),isOpen:z==="child_".concat(t,"_age"),onToggle:e=>U(e?"child_".concat(t,"_age"):null),triggerClassName:"h-10 w-full rounded-lg border border-gray-200 bg-white px-3",textClassName:"text-[13px]"})})]},t))})]},e.id)})}),(0,n.jsxs)("button",{type:"button",onClick:()=>M(e=>!e),className:"mt-3 flex items-center gap-1 text-[13px] font-medium text-[#6C5CE7]",children:[O?"Show less members":"Show more members",(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:O?"rotate-180":"",children:(0,n.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,n.jsx)("p",{className:"mt-5 text-[13px] font-semibold text-[#1A1A2E]",children:"Existing Illness"}),(0,n.jsxs)("button",{type:"button",onClick:()=>{X(er),S("illness")},className:"mt-2 flex w-full items-center justify-between gap-3 rounded-xl border border-gray-200 px-4 py-3 text-left",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-[14px] text-[#1A1A2E]",children:(0,u.Vy)(er)}),(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#9A97AD",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})]}),(0,n.jsx)("p",{className:"mt-5 text-[13px] font-semibold text-[#1A1A2E]",children:"Cover amount"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(c.Ay,{options:c.r4,selection:G,onSelectionChange:V,customLakhs:W,onCustomChange:J,isOpen:"coverage"===z,onToggle:e=>U(e?"coverage":null),triggerClassName:"h-11 w-full rounded-xl border border-gray-200 bg-white px-4",textClassName:"text-[14px]"})}),(0,n.jsxs)("p",{className:"mt-5 text-[13px] font-semibold text-[#1A1A2E]",children:["Your City"," ",(0,n.jsx)("span",{className:"text-[12px] font-normal text-gray-400",children:"(Enter city or pin code)"})]}),(0,n.jsxs)("div",{className:"relative mt-2",children:[(0,n.jsx)("input",{type:"text",value:T,onChange:e=>{P(e.target.value),q(!0),F("")},placeholder:"Search city...",className:"w-full rounded-xl border border-gray-200 px-4 py-3 text-[14px] text-[#1A1A2E] outline-none focus:border-[#6C5CE7]"}),B&&T.length>0&&ei.length>0&&(0,n.jsx)("div",{className:"absolute left-0 right-0 top-full z-10 mt-1 max-h-40 overflow-y-auto rounded-xl border border-gray-200 bg-white shadow-lg",children:ei.slice(0,5).map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>ed(e),className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm transition-colors hover:bg-[#
1EFF0FE]",children:[(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6C5CE7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),(0,n.jsx)("circle",{cx:"12",cy:"10",r:"3"})]}),(0,n.jsx)("span",{className:"font-medium text-[#6C5CE7]",children:e.city_name})]},e.city_id))})]}),(0,n.jsx)("p",{className:"mt-4 text-[13px] font-semibold text-[#1A1A2E]",children:"Select your city"}),(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[u.u9.map(e=>{var t;let l=null==ea||null==(t=ea.city_name)?void 0:t.toLowerCase().startsWith(e.toLowerCase());return(0,n.jsx)("button",{type:"button",onClick:()=>em(e),className:"rounded-full border px-4 py-2 text-[13px] transition-all",style:l?{background:"#EDE9FF",borderColor:"#6C5CE7",color:"#6C5CE7",fontWeight:600}:{background:"white",borderColor:"#E0E0E0",color:"#444"},children:e},e)}),(0,n.jsx)("button",{type:"button",onClick:()=>{P(""),es({city:null})},className:"rounded-full border px-4 py-2 text-[13px] transition-all",style:{background:"white",borderColor:"#E0E0E0",color:"#444"},children:"Other"})]})]}),(0,n.jsxs)("div",{className:"border-t border-gray-100 px-6 py-4",children:[I&&(0,n.jsx)("p",{className:"mb-2 text-center text-xs text-red-500",children:I}),(0,n.jsx)("button",{type:"button",onClick:eh,className:"w-full rounded-2xl py-3.5 text-sm font-bold text-white",style:{background:d},children:"Show Plan"})]})]}))}},13029:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/new-health-insurance",function(){return l(46765)}])},46765:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>et,default:()=>el});var n=l(37876),a=l(18847),r=l.n(a),s=l(94839),i=l(90939),o=l(173),c=l(55907),u=l(81981),d=l(79796),m=l(84524),p=l(38773),h=l(11599),f=l(78761),x=l(77328),g=l.n(x);l(54587);var v=l(89099),y=l(14232),b=l(17531),_=l(15318),w=l(57449),j=l(51741),k=l(96542),C=l(31319),N=l(1812),S=l(50839),E=l(27470),A=l(24309);let I={sortBy:"Sort",coverage:"Cover",insurer:"Insurer",premium:"Premium",planType:"Plan type"},F=["sortBy","coverage","insurer","premium","planType"];function L(e){return I[null==e?void 0:e.key]||(null==e?void 0:e.label)||""}function D(e){var t,l;return null==e||null==(l=e.optionsData)||null==(t=l.find(t=>t.label===e.selected))?void 0:t.value}function T(){return(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,n.jsx)("polyline",{points:"6 9 12 15 18 9"})})}function P(e){let{filters:t=[],onOpenFilter:l}=e,a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[...e.filter(e=>{var t;return null==e||null==(t=e.optionsData)?void 0:t.length})].sort((e,t)=>{let l=F.indexOf(e.key),n=F.indexOf(t.key);return(-1===l?F.length:l)-(-1===n?F.length:n)})}(t);return a.length?(0,n.jsx)("div",{className:"block w-full shrink-0 bg-white sm:hidden",children:(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto px-3 py-2.5 hide-scrollbar",children:a.map((e,t)=>{var a,r,s,i,o;let c=void 0!==D(e)&&D(e)!==(null!=(o=null==e||null==(r=e.optionsData)||null==(a=r.find(e=>e.is_default))?void 0:a.value)?o:null==e||null==(i=e.optionsData)||null==(s=i[0])?void 0:s.value);return(0,n.jsxs)("button",{type:"button",onClick:()=>null==l?void 0:l(e.key),className:["animate-chip-in inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full border px-4 text-sm font-medium transition-[color,background-color,border-color,transform] duration-200 active:scale-95",c?"border-[#6C5CE7] bg-[#EDE9FF] text-[#6C5CE7]":"border-[#DDD9F7] bg-white text-[#261E48]"].join(" "),style:{animationDelay:"".concat(45*t,"ms")},children:[L(e),(0,n.jsx)(T,{})]},e.key)})})}):null}var B=l(98477);function q(e){let{filter:t,draftValue:l,onSelect:a,onClose:r,onDone:s}=e;return t&&"undefined"!=typeof document?(0,B.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[99998] flex flex-col justify-end sm:hidden",children:[(0,n.jsx)("div",{className:"animate-backdrop-in absolute inset-0 bg-black/40",onClick:r}),(0,n.jsxs)("div",{className:"animate-sheet-up relative w-full rounded-t-3xl bg-white",style:{maxHeight:"85dvh",paddingBottom:"env(safe-area-inset-bottom, 16px)"},role:"dialog","aria-modal":"true","aria-label":L(t),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-2",children:[(0,n.jsx)("p",{className:"text-lg font-bold text-[#1A1A2E]",children:L(t)}),(0,n.jsx)("button",{type:"button",onClick:r,className:"flex h-8 w-8 items-center justify-center rounded-full","aria-label":"Close",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#1A1A2E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,n.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,n.jsx)("div",{className:"flex flex-col overflow-y-auto px-5 py-2",style:{maxHeight:"calc(85dvh - 160px)"},children:t.optionsData.map(e=>{let t=l===e.value;return(0,n.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:"flex items-center gap-3 py-3 text-left transition-colors active:bg-black/[0.03]",children:[(0,n.jsx)("span",{className:["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",t?"border-[#6C5CE7]":"border-[#DDD9F7]"].join(" "),"aria-hidden":!0,
1children:(0,n.jsx)("span",{className:["h-2.5 w-2.5 rounded-full bg-[#6C5CE7] transition-transform duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t?"scale-100":"scale-0"].join(" ")})}),(0,n.jsx)("span",{className:"min-w-0 flex-1 text-[15px] text-[#1A1A2E]",children:e.label})]},e.value)})}),(0,n.jsx)("div",{className:"px-5 pt-2 pb-4",children:(0,n.jsx)("button",{type:"button",onClick:s,className:"w-full rounded-full bg-[#6C5CE7] py-3.5 text-base font-semibold text-white transition-[background-color,transform] duration-150 hover:bg-[#5A50E6] active:scale-[0.98]",children:"Done"})})]})]}),document.body):null}var R=l(45678),H=l(84523),O=l(3632),M=l(80881),z=l(71537),U=l(32033),G=l(29814);let V={mixpanelPageName:"New Health Listing Page",path:"/new-health-insurance",gaPageTitle:"New Health Insurance Plans",gtmPageSlug:"new-health-insurance"};function W(e){if(null!=e&&""!==e){let t=String(Array.isArray(e)?e[0]:e).toLowerCase();if("plan"===t||"plans"===t)return"Plans"}return"Ira"}function J(e,t){let l=t[e.company_id],n=l?e.plans:e.plans.slice(0,1),a=Math.max(e.plans.length-1,0),r=new Map;return n.forEach(e=>{let t=e.product_name;r.has(t)||r.set(t,{product_name:t,usp:e.usps||[],variants:[],ctaLabel:"Select this plan"});let l=r.get(t);
1e.variants.forEach(t=>{l.variants.find(e=>e.sum_assured===t.sum_assured)||l.variants.push({product_id:t.product_id,sum_assured:t.sum_assured,premium:t.premium,monthly_premium:t.monthly_premium||Math.round((t.premium||0)/12),premiumLabel:"â¹".concat(t.premium.toLocaleString("en-IN"),"/year"),usp:Array.isArray(e.usps)?e.usps:Array.isArray(e.usp)?e.usp:[]})})}),{transformedPlans:Array.from(r.values()).map(e=>{var t,l,n,a;return e.variants.sort((e,t)=>e.sum_assured-t.sum_assured),{...e,product_id:null==(t=e.variants[0])?void 0:t.product_id,premium:null==(l=e.variants[0])?void 0:l.premium,premiumLabel:null==(n=e.variants[0])?void 0:n.premiumLabel,sum_assured:null==(a=e.variants[0])?void 0:a.sum_assured,sumInsuredLabel:"Cover"}}),hiddenPlansCount:a,isExpanded:l}}r()(()=>Promise.all([l.e(4299),l.e(7043),l.e(1678),l.e(6283),l.e(6042),l.e(9875),l.e(868),l.e(4733),l.e(5161),l.e(6210),l.e(7452),l.e(4214),l.e(7585),l.e(87)]).then(l.bind(l,57585)).catch(()=>(window.location.reload(),Promise.all([l.e(4299),l.e(7043),l.e(1678),l.e(6283),l.e(6042),l.e(9875),l.e(868),l.e(4733),l.e(5161),l.e(6210),l.e(7452),l.e(4214),l.e(7585),l.e(87)]).then(l.bind(l,57585)))),{loadableGenerated:{webpack:()=>[57585]},ssr:!1,loading:()=>(0,n.jsx)("div",{className:"flex flex-col items-center justify-center w-full h-full bg-[#F7F7F7]",children:(0,n.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-[#555]",children:"Connecting you with Agent"}),(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"0ms"}}),(0,n.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"150ms"}}),(0,n.jsx)("div",{className:"w-1.5 h-1.5 bg-[#555] rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})]})})});let Y="health_inactivity_popup_seen_session",K=r()(()=>Promise.all([l.e(4299),l.e(6283),l.e(4733)]).then(l.bind(l,34733)),{loadableGenerated:{webpack:()=>[34733]},ssr:!1}),Q=new Map,X=async e=>{let t=Q.get(e),l=Date.now();if((null==t?void 0:t.data)&&l-t.timestamp<5e3)return t.data;if(null==t?void 0:t.promise)return t.promise;let n=(0,p.wz)(e,"Health").then(t=>(Q.set(e,{data:t,timestamp:Date.now()}),t)).finally(()=>{let t=Q.get(e);if(null==t?void 0:t.promise){var l,n;Q.set(e,{data:null!=(l=t.data)?l:null,timestamp:null!=(n=t.timestamp)?n:Date.now()})}});return Q.set(e,{promise:n,timestamp:l}),n},$=function(){var e,t;let{serverLeadId:a=null,initialFilters:r=[],initialPlans:x=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},I=(0,v.useRouter)(),F=(null==x?void 0:x.ok)&&(null==x?void 0:x.companies),[L,T]=(0,y.useState)(F?x.companies:[]),[B,Q]=(0,y.useState)(F?x.companies:[]),[$,Z]=(0,y.useState)(F&&null!=(t=null==(e=x.meta)?void 0:e.product_count)?t:0),[ee,et]=(0,y.useState)({}),[el,en]=(0,y.useState)(!F),[ea,er]=(0,y.useState)(!1),[es,ei]=(0,y.useState)([]),[eo,ec]=(0,y.useState)(!1),[eu,ed]=(0,y.useState)(0),[em,ep]=(0,y.useState)(null),eh=(0,y.useMemo)(()=>{var e,t;if(!L||0===L.length)return null;let l=L[0],n=null==l||null==(e=l.plans)?void 0:e[0];if(!n)return null;let a=null==(t=n.variants)?void 0:t[0];return a?{product_id:a.product_id,product_name:n.product_name,company_logo:l.logo,sum_assured:a.sum_assured,premium:a.premium,monthly_premium:a.monthly_premium||Math.round((a.premium||0)/12),highlights:Array.isArray(n.usps)?n.usps.slice(0,3):[]}:null},[L]),[ef,ex]=(0,y.useState)(""),[eg,ev]=(0,y.useState)(""),[ey,eb]=(0,y.useState)(null),[e_,ew]=(0,y.useState)(F&&x.members?x.members:[]),[ej,ek]=(0,y.useState)(a),[eC,eN]=(0,y.useState)(Array.isArray(r)&&r.length>0?r:[]),[eS,eE]=(0,y.useState)(null),[eA,eI]=(0,y.useState)(null),[eF,eL]=(0,y.useState)(null),[eD,eT]=(0,y.useState)(!1),[eP,eB]=(0,y.useState)(0),[eq,eR]=(0,y.useState)([]),[eH,eO]=(0,y.useState)(!1),eM=(0,y.useRef)(null),ez=(0,H.A)(),eU=(0,y.useRef)(null),[eG,eV]=(0,y.useState)(!1),eW=e=>{(0,u.trackFanTvHealthUx)("edit_details_sheet_open",{source:e}),eV(!0)},[eJ,eY]=(0,y.useState)(null),[eK,eQ]=(0,y.useState)(null),[eX,e$]=(0,y.useState)("ira");(0,y.useEffect)(()=>{sessionStorage.setItem("healthInsurance_activeTab",eX)},[eX]),(0,y.useEffect)(()=>{try{let e=sessionStorage.getItem("ct_shortlisted_plans");if(e){let t=JSON.parse(e);Array.isArray(t)&&t.length>0&&eR(t)}}catch(e){}},[]),(0,y.useEffect)(()=>
1{if(0!==eq.length)try{sessionStorage.setItem("ct_shortlisted_plans",JSON.stringify(eq))}catch(e){}},[eq]),(0,y.useEffect)(()=>{if(!I.isReady)return;let e=I.query.tab;if(void 0===e)return;let t=String(Array.isArray(e)?e[0]:e).toLowerCase();if("plan"===t||"plans"===t)return void e$("plans");("ira"===t||"chat"===t)&&e$("ira")},[I.isReady,I.query.tab]),(0,y.useEffect)(()=>{if(!I.isReady)return;let e=I.query.plan_id,t=I.query.product_name,l=I.query.insurer;null!=e&&""!==e&&eE(String(Array.isArray(e)?e[0]:e)),null!=t&&""!==t&&eI(String(Array.isArray(t)?t[0]:t)),null!=l&&""!==l&&eL(String(Array.isArray(l)?l[0]:l))},[I.isReady,I.query.plan_id,I.query.product_name,I.query.insurer]);let[eZ,e0]=(0,y.useState)(!0),e1=(0,y.useRef)(!1),e2=(0,y.useRef)(null),e5=(0,y.useRef)(0),e4=(0,y.useRef)(null),[e3,e6]=(0,y.useState)(!1),[e8,e9]=(0,y.useState)({}),[e7,te]=(0,y.useState)(null),[tt,tl]=(0,y.useState)(null),[tn,ta]=(0,y.useState)(null),[tr,ts]=(0,y.useState)(!!(null==x?void 0:x.has_parent_recommendations)),[ti,to]=(0,y.useState)({self:[],parents:[],kids:[]}),[tc,tu]=(0,y.useState)({self:[],parents:[],kids:[]}),[td,tm]=(0,y.useState)("self"),[tp,th]=(0,y.useState)("monthly"),[tf,tx]=(0,y.useState)(!1),tg=(0,y.useRef)(null),tv=(0,y.useRef)(Date.now()),ty=(0,y.useRef)(0),[tb,t_]=(0,y.useState)(!1),[tw,tj]=(0,y.useState)(!0),tk=(0,y.useRef)(!1),tC=(0,y.useRef)(null),tN=(0,y.useRef)(""),[tS,tE]=(0,y.useState)(null),tA=(0,y.useRef)(tS);(0,y.useEffect)(()=>{tA.current=tS},[tS]);let[tI,tF]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let e=(0,p.cG)();if(!e)return void tF(!0);let t=!1;return(async()=>{try{let l=await X(e);if(t)return;if(null==l?void 0:l.requirement){let e="string"==typeof l.requirement?JSON.parse(l.requirement):l.requirement;tE(e)}}catch(e){console.error("Error fetching requirement from v2:",e)}finally{t||tF(!0)}})(),()=>{t=!0}},[]),(0,y.useEffect)(()=>{try{let e=localStorage.getItem("compare_plans_health");if(e){let t=JSON.parse(e);Array.isArray(t)&&t.length>0&&ei(t)}let t=new URLSearchParams(window.location.search),l=t.get("lead_id")||t.get("leadId"),n=(0,s.Ch)(),a=localStorage.getItem("leadId")||localStorage.getItem("onboarding_lead_id"),r=l||(n&&a&&!(0,s.zc)(a)?a:null);r&&ek(r)}catch(e){console.error("Error restoring state from localStorage:",e)}},[]);let tL=(0,y.useRef)(!1),tD=(0,y.useRef)(!1);(0,y.useEffect)(()=>{"ira"!==eX||tD.current||(tD.current=!0,(0,u.trackPageViewed)(V.mixpanelPageName,"Call Interface",{route:V.path,tab:W(I.query.tab)}))},[eX,I.query.tab]),(0,y.useEffect)(()=>{var e;if(!I.isReady)return;(0,s.Ji)();let t=I.query.lead_id,l=localStorage.getItem("onboarding_lead_id"),n=localStorage.getItem("leadId")||localStorage.getItem("tempLeadId"),i=t||l||n||a;if(i||(console.log("\uD83D\uDCF1 No leadId found - generating temporary session data for health-insurance page"),l=i=(0,s.AP)().leadId),i&&(ek(i),t&&!(0,s.zc)(t)&&(0,h.HN)(t),!tL.current)){tL.current=!0;let e=()=>{(0,o.trackPageView)(V.gaPageTitle,V.path,{lead_id:i}),(0,u.trackPageViewed)(V.mixpanelPageName,"",{route:V.path,tab:W(I.query.tab)}),(0,o.initGATracking)()};"undefined"!=typeof requestIdleCallback?requestIdleCallback(e,{timeout:2e3}):setTimeout(e,100)}let c=I.query.product_name?String(I.query.product_name):void 0,d=I.query.insurer?String(I.query.insurer):void 0,m=I.query.insurer_id?String(I.query.insurer_id):void 0;eY(null!=c?c:null),eQ(null!=d?d:null),ta(null!=m?m:null),(0===r.length||tS)&&tJ(tS),(null==tS||null==(e=tS.personas)?void 0:e.length)>0&&ex(tV(tS))},[I.isReady,I.query.lead_id,I.query.product_name,I.query.insurer,I.query.insurer_id,a,r.length,tS]),(0,y.useEffect)(()=>{var e;if(!I.isReady)return;let t=Array.isArray(L)&&L.length>0||$>0;if("true"===I.query.open_edit_modal&&!e1.current&&"plans"===eX){e1.current=!0,eW("open_edit_modal_query");let e={...I.query};delete e.open_edit_modal,I.replace({pathname:I.pathname,query:e},void 0,{shallow:!0});return}let l=(null==tS||null==(e=tS.personas)?void 0:e.length)>0;!tI||e1.current||l||"plans"!==eX||el||t||(console.log("â ï¸ No valid requirement from v2 and no plans â opening Edit Members Modal (Plans tab)"),e1.current=!0,eW("auto_missing_requirement"),en(!1))},[I,I.isReady,I.pathname,I.query.open_edit_modal,eX,tI,tS,L,$,el]);let tT=(0,y.useRef)("up");(0,y.useEffect)(()=>{let e=e4.current;if(!e||"plans"!==eX)return;let t=!1,l=()=>{t||(t=!0,requestAnimationFrame(()=>{let l=e.scrollTop,n=e.scrollHeight-e.clientHeight-l<10,a=l-e5.current;!n&&a>50&&l>100?("down"!==tT.current&&(tT.current="down",e0(!1)),e5.current=l):a<-50&&("up"!==tT.current&&(tT.current="up",e0(!0)),e5.current=l),t=!1}))};return e.addEventListener("scroll",l,{passive:!0}),()=>e.removeEventListener("scroll",l)},[eX]),(0,y.useEffect)(()=>{let e="true"===sessionStorage.getItem(Y),t="true"===localStorage.getItem("health_inactivity_popup_dismissed");if(!ej||tf||e||t)return;let l=()=>{tv.current=Date.now(),tg.current&&clearTimeout(tg.current),tg.current=setTimeout(()=>{Date.now()-tv.current>=6e4&&!tf&&(sessionStorage.setItem(Y,"true"),ty.current=1,(0,u.trackPopupViewedQuestions)("Do you have any questions?",V.path,"plan_listing"),tx(!0))},6e4)},n=["mousedown","mousemove","keypress","touchstart","click"];
1return n.forEach(e=>{window.addEventListener(e,l,{passive:!0})}),l(),()=>{n.forEach(e=>{window.removeEventListener(e,l)}),tg.current&&clearTimeout(tg.current)}},[ej,tf]);let tP=async function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r=(0,z.ds)(t),{ok:s,requirement:i}=await (0,z.Px)({filterPreferences:r,requirement:tA.current});if(s){let e=tA.current;if(i)if(e){var a;let t={...e,filter_preferences:i.filter_preferences||e.filter_preferences,insurance_type:i.insurance_type||e.insurance_type};i.personas&&Array.isArray(i.personas)&&i.personas.length>((null==(a=e.personas)?void 0:a.length)||0)&&(t.personas=i.personas),tA.current=t,tE(t)}else tA.current=i,tE(i);else e&&(e.filter_preferences=r,tA.current=e,tE({...e}))}else console.warn("Failed to sync filter preferences to API, but continuing with fetchPlans");e&&t.length>0&&!l?(await tK(t,n),sessionStorage.setItem("collected_info_synced_".concat(e),Date.now().toString())):l||er(!1)}catch(a){console.error("Error syncing filter preferences to API:",a),e&&t.length>0&&!l?await tK(t,n):er(!1)}},tB=(0,y.useMemo)(()=>{var e;let t=null==(e=eC.find(e=>"coverage"===e.key))?void 0:e.customCoverage;return(null==t?void 0:t.min)!=null&&t.min===t.max?t.min:null},[eC]),tq=async function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;er(!0),tE(t),ex(tV(t)),eV(!1);let n=await (0,U.Sh)({leadId:ej,previousRequirement:tA.current,updatedRequirement:t,personas:e});n&&(tE(n),ex(tV(n)));let a=eC;(null==l?void 0:l.coverageChanged)&&eN(a=(0,S.FP)(eC,l.coverageValue)),ej&&a.length>0&&await tK(a),er(!1)},tR=(0,y.useRef)(!0),tH=(0,y.useRef)(!!F||null!==x),tO=(0,y.useRef)(!1),tM=(0,y.useRef)(!1),tz=(0,y.useRef)(null),tU=(0,y.useRef)(eX);(0,y.useEffect)(()=>{if(el||ea||0!==$)$>0&&(tO.current=!1);else if(!tO.current){let e=I.pathname||V.path;(0,c.trackNoPlanShown)("Health",e,""),(0,u.trackNoPlanShown)("Health",e,""),tO.current=!0}},[el,ea,$,I.pathname]),(0,y.useEffect)(()=>{if(0!==L.length)try{var e;let t=tA.current,l=null==t||null==(e=t.personas)?void 0:e[0],n=eC.filter(e=>{var t,l;return((null==(t=e.selectedOption)?void 0:t.label)||e.selected)&&"All"!==((null==(l=e.selectedOption)?void 0:l.label)||e.selected)}).map(e=>{var t;return"".concat(e.label,":").concat((null==(t=e.selectedOption)?void 0:t.label)||e.selected)}).join(", "),a={page_path:V.path,plans:$,insurers:L.length,persona:l?"".concat(l.age||"").concat((l.gender||"")[0]||""," ").concat(l.smoker?"Smoker":"NS").trim():void 0,income:(null==t?void 0:t.annual_income)||void 0,city:(null==t?void 0:t.city)||void 0,filters:n||void 0,members:e_.length>0?e_.map(e=>"".concat(e.age||"").concat((e.relation||e.relationship||"")[0]||"")).join(", "):void 0};Object.keys(a).forEach(e=>void 0===a[e]&&delete a[e]);let r=JSON.stringify({page_path:V.path,metadata:a});if(tN.current===r)return;tN.current=r,(0,d.sx)({event_type:"page_view",metadata:a})}catch(e){}},[L,$,eC,e_,tS]),(0,y.useEffect)(()=>{if(ej&&0!==eC.length&&tR.current){if(tH.current){let e=tA.current;if((null==e?void 0:e.personas)&&Array.isArray(e.personas)&&e.personas.length>0){console.log("\uD83D\uDD04 SSR ran but v2 requirement has personas - re-fetching ("+e.personas.length+" personas)"),tK(eC),tR.current=!1;return}en(!1),tR.current=!1;return}console.log("\uD83D\uDD04 Scenario 1: Initial page load - calling swift-action directly (no leads table update)"),tK(eC),tH.current=!0,setTimeout(()=>{tR.current=!1},1e3)}},[ej,eC.length]);let tG=()=>{try{var e,t;let l=localStorage.getItem("onboarding_requirement");if(!l)return tA.current;let n=JSON.parse(l),a=tA.current,r=(null==n||null==(e=n.personas)?void 0:e.length)>0,s=(null==a||null==(t=a.personas)?void 0:t.length)>0,i=r&&(!s||n.personas.length>a.personas.length),o=(null==n?void 0:n.city)&&!(null==a?void 0:a.city),c=(null==n?void 0:n.filter_preferences)&&Object.keys(n.filter_preferences).length>0;if(!i&&!o&&!c)return a;let u={...a||{},...n,personas:i?n.personas:(null==a?void 0:a.personas)||n.personas,filter_preferences:{...(null==a?void 0:a.filter_preferences)||{},...(null==n?void 0:n.filter_preferences)||{}}};return tA.current=u,tE(u),u}catch(e){return tA.current}},tV=e=>{if(!(null==e?void 0:e.personas)||0===e.personas.length)return"";let t={};
1e.personas.forEach(e=>{let l=e.relationship||"Unknown",n=e.age||"?";t[l]||(t[l]=[]),t[l].push(n)});let l=[];Object.entries(t).forEach(e=>{let[t,n]=e,a="primary_applicant"===t?"Self":"spouse"===t?"Spouse":t.charAt(0).toUpperCase()+t.slice(1);1===n.length?l.push("".concat(a," (").concat(n[0],")")):n.forEach((e,t)=>{l.push("".concat(a).concat(t+1," (").concat(e,")"))})});let n=l.join(", ")+(l.length>2?" +":"");return(null==e?void 0:e.city)&&(n+=" ⢠".concat(e.city)),n},tW=e=>{if(!e||0===e.length)return"";let t=[];return e.forEach(e=>{let l="primary_applicant"===e.relationship?"Self":"spouse"===e.relationship?"Spouse":e.relationship.charAt(0).toUpperCase()+e.relationship.slice(1);t.push("".concat(l," (").concat(e.age,")"))}),t.join(", ")+(t.length>1?" +":"")},tJ=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{let t=null!=e?e:tA.current,l=await (0,z.IH)();if(!l)return;let n=(0,z.kk)(l,t);if(0===n.length){let e=await (0,z.IH)({forceRefresh:!0});n=e?(0,z.kk)(e,t):[]}n.length>0&&eN(n)}catch(e){console.error("Error fetching filter metadata:",e)}},tY=(0,E.A)({leadId:ej,insuranceType:"Health",filters:eC,setFilters:eN,onRequirement:(0,y.useCallback)(e=>{tA.current=e,tE(e)},[]),onRefresh:async e=>{e.length>0&&await tK(e,!0)}}),tK=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eC,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!ej){en(!1),er(!1);return}t&&er(!0);try{let d=(0,G.dn)(e),m=(0,p.cG)(),h=localStorage.getItem("onboarding_lead_id"),x=I.query.lead_id,g={"Content-Type":"application/json"};m&&(g.Authorization="Bearer ".concat(m));let v=null,y=null,b=null,_=null,w=null,j=null,k=tA.current;if(k){if(k.personas&&Array.isArray(k.personas)&&k.personas.length>0&&k.personas,k.filter_preferences){let e=k.filter_preferences.coverage||k.filter_preferences.sum_assured;e&&(e.custom&&void 0!==e.min&&void 0!==e.max?(v=e.min,y=e.max):"number"==typeof e&&(v=e,y=e));let t=k.filter_preferences.premium||k.filter_preferences.budget;t&&(t.custom&&void 0!==t.min&&void 0!==t.max?(b=t.min,_=t.max):t.meta&&t.meta.max?(b=t.meta.min||t.meta.max,_=t.meta.max):"number"==typeof t&&(b=t,_=t));let l=k.filter_preferences.insurer;l&&(w=l.label);let n=k.filter_preferences.policy_period;j=n?n.value:"1"}if(null===v||null===y){let t=e.find(e=>"coverage"===e.key);if(t){if(t.customCoverage)v=t.customCoverage.min,y=t.customCoverage.max;else if(t.optionsData){let e=t.optionsData.find(e=>e.label===t.selected);e&&!e.is_default&&e.meta&&e.meta.max?(v=e.meta.min||e.meta.max,y=e.meta.max):e&&"number"==typeof e.value&&(v=e.value,y=e.value)}}}if(null===b||null===_){let t=e.find(e=>"premium"===e.key);if(t){if(t.customPremium)b=t.customPremium.min,_=t.customPremium.max;else if(t.optionsData){let e=t.optionsData.find(e=>e.label===t.selected);e&&e.meta&&e.meta.max?(b=e.meta.min||e.meta.max,_=e.meta.max):e&&"number"==typeof e.value&&(b=e.value,_=e.value)}}}}let C={lead_id:x||h,filters:d,website:!0,send_flag:!1,send_whatsapp_flag:!1,insurance_type:"health"};if(null===v||null===y){let e=tz.current||(0,G.SJ)(ej);e&&(v=e.min,y=e.max)}if(null===v||null===y){let t=e.find(e=>"coverage"===e.key);if(t&&t.optionsData){let e=t.optionsData.find(e=>e.is_default)||t.optionsData[0];e&&e.meta?(v=e.meta.min||e.meta.max||1e6,y=e.meta.max||1e6):(v=5e4,y=1e6)}else v=5e4,y=1e6}null!==v&&(C.preferred_sum_assured_min=v),null!==y&&(C.preferred_sum_assured_max=y),null!==b&&(C.budget_min=b),null!==_&&(C.budget_max=_),null!==w&&(C.preferred_insurer=w),null!==j&&(C.term=j);let N=await fetch(f.vT,{method:"POST",headers:g,body:JSON.stringify(C)});if(N.ok){var n,a,r,s,i,o,u;let d=await N.json();console.log("swift-action response keys:",Object.keys(d),"plans_sent:",d.plans_sent,"inline_recommendations:",null==(n=d.inline_recommendations)?void 0:n.length,"backup_recommendations:",null==(a=d.backup_recommendations)?void 0:a.length,"recommendations:",null==(r=d.recommendations)?void 0:r.length);let m=(0,G.nv)(d);if(console.log("transformedData",m),m.ok&&m.companies){let n=!!d.has_parent_recommendations;ts(n);let a=(null==k?void 0:k.city)||(null==k?void 0:k.city_name)||"";a&&(m.companies=(0,G.Br)(m.companies,a));let r=Array.isArray(null==k?void 0:k.personas)?k.personas:[];if(0===r.length)try{let e=localStorage.getItem("onboarding_requirement"),t=e?JSON.parse(e):null;Array.isArray(null==t?void 0:t.personas)&&t.personas.length>0&&(r=t.personas)}catch(e){}if(0===r.length)try{let{synthesizePersonasFromFamilyScenario:e}=l(28703);r=e(null==d?void 0:d.family_scenario)}catch(e){}let p=e=>{try{let{applyNivaReAssureAgeFilter:t}=l(28703);if(!e||0===r.length)return e;return t(e,r)}catch(t){return e}};m.companies=p(m.companies);let h=m.companies,f=m.companies,x=null;if(n){let l=[...d.inline_recommendations||[],...d.backup_recommendations||[]],n=[...d.parent_inline_recommendations||[],...d.parent_backup_recommendations||[]],a=[...d.kids_inline_recommendations||[],...d.kids_backup_recommendations||[]],r=p((0,G.pG)(l)),s=p((0,G.pG)(n)),i=p((0,G.pG)(a));if(x={self:r,parents:s,kids:i},tu(x),t){let t=tQ(e,r),l=tQ(e,s),n=tQ(e,i);to({self:t,parents:l,kids:n}),h=t}else to({self:r,parents:s,kids:i}),h=r;f=r}else to({self:[],parents:[],kids:[]}),tu({self:[],parents:[],kids:[]});Q(f);let g=new Set;(n?[...(null==x?void 0:x.self)||[],...(null==x?void 0:x.parents)||[],...(null==x?void 0:x.kids)||[]]:m.companies).forEac
1h(e=>{e&&e.company_name&&e.company_name.trim()&&g.add(e.company_name.trim())}),console.log("\uD83D\uDCCA Updating insurer filter with ".concat(g.size," unique insurers from resultset:"),Array.from(g)),eN(e=>(console.log(e,"prevFilters"),e.map(e=>{if("insurer"===e.key){let t=["All Insurers",...Array.from(g).sort()],l=[{value:"all",label:"All Insurers",is_default:!0},...Array.from(g).sort().map(e=>({value:e.toLowerCase().replace(/\s+/g,"_"),label:e}))],n=e.selected,a=t.includes(n)?n:"All Insurers";return{...e,options:t,optionsData:l,selected:a}}return e})));let v=n?h:m.companies;if(!n){if(t){let t=e.find(e=>"coverage"===e.key);if(t&&t.selected){let e=null==(s=t.optionsData)?void 0:s.find(e=>e.label===t.selected);if(e){let l=null,n=null;if(t.customCoverage)l=t.customCoverage.min,n=t.customCoverage.max;else if(e.meta)l=e.meta.min,n=e.meta.max;else if(e.value&&"0"!==e.value){let t={1:{min:5e4,max:5e5},2:{min:5e5,max:9e5},3:{min:1e6,max:23e5},4:{min:25e5,max:99e5}}[e.value];t&&(l=t.min,n=t.max)}null!==l&&null!==n&&(v=v.map(e=>({...e,plans:e.plans.map(e=>{let t=e.variants.filter(t=>{let a=t.sum_assured||e.sum_assured||0;return a>=l&&a<=n});return t.length>0?{...e,variants:t,sum_assured:t[0].sum_assured||e.sum_assured}:null}).filter(Boolean)})).filter(e=>e.plans.length>0))}}let l=e.find(e=>"premium"===e.key);if(l&&l.selected&&"Any"!==l.selected){let e=null,t=null;if(l.customPremium)e=l.customPremium.min,t=l.customPremium.max;else{let n=null==(i=l.optionsData)?void 0:i.find(e=>e.label===l.selected);n&&n.meta&&(e=n.meta.min,t=n.meta.max)}null!==e&&null!==t&&(v=v.map(l=>({...l,plans:l.plans.map(l=>{let n=l.variants.filter(n=>{let a=n.premium||l.premium||0;return a>=e&&a<=t});return n.length>0?{...l,variants:n,premium:n[0].premium||l.premium}:null}).filter(Boolean)})).filter(e=>e.plans.length>0))}}eJ?v=v.map(e=>{let t=e.plans.filter(e=>{let t=(e.product_name||"").trim().toLowerCase(),l=eJ.trim().toLowerCase();return t===l||t.includes(l)||l.includes(t)});return t.length>0?{...e,plans:t}:null}).filter(Boolean):(eK||tn)&&(v=v.filter(e=>(0,G.Kq)(e,eK,tn)));let l=e.find(e=>"insurer"===e.key);if(!eJ&&!eK&&!tn&&l&&l.selected&&"All Insurers"!==l.selected){let e=null==(o=l.optionsData)?void 0:o.find(e=>e.label===l.selected);if(e){let t=l.selected,n=null==e?void 0:e.value;v=v.filter(e=>(0,G.Kq)(e,t,n))}}let n=e.find(e=>"sortBy"===e.key);if(n&&n.selected){let e=null==(u=n.optionsData)?void 0:u.find(e=>e.label===n.selected);if(e){let t=e.value;v=v.map(e=>({...e,plans:[...e.plans].sort((e,l)=>(0,G.iT)(t,e,l))})).sort((e,l)=>e.plans[0]||l.plans[0]?e.plans[0]?l.plans[0]?(0,G.iT)(t,e.plans[0],l.plans[0]):-1:1:0)}}}let y=v.reduce((e,t)=>e+t.plans.reduce((e,t)=>e+t.variants.length,0),0);Z(y),console.log("filteredCompanies",v),console.log("filteredProductCount",y),T(v),!t&&y>0?(0,c.trackViewItemList)("health",y):t||0!==y||(0,c.trackErrorEmptyResults)("health",{lead_id:ej,reason:"no_plans_found"});let b=tA.current;if(b){let e=tV(b);ex(e),b.personas&&ew(b.personas)}else if(m.members){ew(m.members);let e=tW(m.members);ex(e)}}else console.error("Invalid API response:",m),T([]),Z(0),(0,c.trackErrorEmptyResults)("health",{lead_id:ej})}else console.error("API request failed:",N.status),T([]),Z(0),(0,c.trackErrorEmptyResults)("health",{lead_id:ej,error:"api_failed"})}catch(e){console.error("Error fetching plans:",e),T([]),Z(0),(0,c.trackErrorEmptyResults)("health",{lead_id:ej,error:e.message})}finally{t?er(!1):en(!1)}};(0,y.useEffect)(()=>{let e=tU.current;tU.current=eX,"plans"===eX&&"plans"!==e&&ej&&0!==eC.length&&(tG(),(!(Array.isArray(L)&&L.length>0||$>0)||tM.current)&&(console.log("\uD83D\uDD04 Switched to Plans tab â calling swift-action after chat/onboarding requirements"),tM.current=!1,en(!0),tK(eC)))},[eX,ej,eC.length,L,$]);let tQ=(e,t)=>(0,G.Eg)(e,t,{productNameFilter:eJ,insurerFilter:eK,insurerIdFilter:tn}),tX=()=>{var e,t,l;return tr?(null==(e=tc.self)?void 0:e.length)>0||(null==(t=tc.parents)?void 0:t.length)>0||(null==(l=tc.kids)?void 0:l.length)>0:B.length>0},t$=e=>{if(tr){let t=tQ(e,tc.self||[]),l=tQ(e,tc.parents||[]),n=tQ(e,tc.kids||[]);to({self:t,parents:l,kids:n});let a="self"===td?t:"parents"===td?l:n;Z(a.reduce((e,t)=>
1e+t.plans.reduce((e,t)=>e+t.variants.length,0),0)),T(a)}else{let t=tQ(e,B);Z(t.reduce((e,t)=>e+t.plans.reduce((e,t)=>e+t.variants.length,0),0)),T(t)}en(!1)},tZ=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!ej)return void er(!1);eU.current&&clearTimeout(eU.current),eU.current=setTimeout(()=>{tP(ej,e,t,l)},500)},t0=(e,t)=>{if(("insurer"===t||"sortBy"===t)&&tX()){tZ(e,!0,!0),t$(e),er(!1);return}er(!0),tZ(e,!1,!0)},t1=e=>{et(t=>({...t,[e]:!t[e]}))},t2=e=>{let t=new URLSearchParams({product_id:e.product_id});e.sum_assured&&t.append("sum_assured",e.sum_assured.toString()),e.tenure&&t.append("tenure",e.tenure.toString()),e.premium&&t.append("premium",e.premium.toString()),ej&&t.append("leadId",ej.toString());let l=tA.current;l&&(l.city&&t.append("city",l.city),l.city_id&&t.append("city_id",l.city_id.toString())),t.set("return_path","/new-health-insurance"),t.set("return_tab","ira"===eX?"ira":"plans"),I.push("/plan-feature?".concat(t.toString()))},t5=e=>{let t;if((0,c.trackCompareButtonClicked)("add_to_compare",V.path),es.includes(e))t=es.filter(t=>t!==e);else{if(!(es.length<2))return void alert("You can compare up to 2 plans only");t=[...es,e]}ei(t);try{localStorage.setItem("compare_plans_health",JSON.stringify(t))}catch(e){console.error("Error saving compare plans to localStorage:",e)}};(0,y.useMemo)(()=>{var e;let t=null==tS||null==(e=tS.personas)?void 0:e.length;return t&&t>1?"Family of ".concat(t):ef?ef.split(" â¢")[0].trim():"Self"},[tS,ef]);let t4=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"show_plans",l=Object.entries(e).map(e=>{var t;let[l,n]=e,a=eC.find(e=>e.key===l),r=null==a||null==(t=a.optionsData)?void 0:t.find(e=>e.value===n);return{filter_key:l,value:n,label:null==r?void 0:r.label}});(0,u.trackFanTvHealthUx)("filter_sheet_applied",{selection_count:l.length,selections:l,apply_cta:t});let n=eC.map(t=>{var l;let n=e[t.key];if(void 0===n)return t;let a=null==(l=t.optionsData)?void 0:l.find(e=>e.value===n);if(!a)return t;let r={...t,selected:a.label};return"coverage"===t.key&&delete r.customCoverage,"premium"===t.key&&delete r.customPremium,r}),a=Object.keys(e).some(e=>"insurer"!==e&&"sortBy"!==e);if(eN(n),e6(!1),e9({}),te(null),tl(null),"ira"===eX&&ed(e=>e+1),ej){if(!a&&tX()){tZ(n,!0,!0),t$(n),er(!1);return}er(!0),tZ(n,!1,!0)}},t3=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;localStorage.setItem("communication_preference","call"),localStorage.setItem("hasShownCallInterface","true");let n=e=>null!=e&&""!==e&&("string"==typeof e||"number"==typeof e);eE(n(e)?String(e):null),eI(n(t)?String(t):null),eL(n(l)?String(l):null),ev(""),eb(null),e2.current=eX,e$("ira"),eT(!0),eB(e=>e+1)},t6=(0,y.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{reason:t="ira_chat",pendingCall:l=!1,pendingChat:n=!1,allowClose:a=!0}=e;tj(a),l?tC.current={}:tC.current=null,n&&(tk.current=!0),(0,u.trackLeadFormViewedDetailed)(V.path,t),t_(!0)},[]),t8=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("true"===localStorage.getItem(f.A8)){tC.current={planId:e,planName:t,companyName:l},(0,u.trackLeadFormViewedDetailed)(V.path,"talk_before_call"),t_(!0);return}t3(e,t,l)},t9=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(localStorage.setItem("communication_preference","chat"),localStorage.setItem("hasShownCallInterface","true"),e&&(0,u.captureNewHealthListingTabForNextChatMessage)(eX),e$("ira"),eT(!1),eb(null),!l){let e=t||"plan_listing";(0,c.trackContactAdvisorClick)("chat","plan_listing"),(0,c.trackButtonClicked)("Talk to Advisor","talk_adv_he_btn",V.path,e),(0,u.trackButtonClickedTalkToAdvisorListing)("health",V.path,e)}e&&ev(e)},t7=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t8(e,t,l)},le=I.isReady&&"plans"===eX&&("true"===I.query.preview_no_plans||"1"===I.query.preview_no_plans),lt=!el&&!le&&L.length>0,ll=!el&&(0===L.length||le);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(g(),{children:[(0,n.jsx)("link",{rel:"canonical",href:"https://www.covertiger.com/health-insurance"},"canonical"),(0,n.jsx)("title",{children:"Health Insurance Plans - Compare & Buy Online | CoverTiger"}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-content"}
1),(0,n.jsx)("link",{rel:"preconnect",href:"https://wxofebyviealmeyltqtm.supabase.co"}),(0,n.jsx)("link",{rel:"preload",href:"/home/logo.svg",as:"image"}),(0,n.jsx)("meta",{name:"description",content:"Compare and buy the best health insurance plans from top insurers. Get instant quotes, compare coverage, premiums, and benefits. Find the perfect health insurance plan for you and your family."}),(0,n.jsx)("meta",{name:"keywords",content:"health insurance, health insurance plans, compare health insurance, buy health insurance online, health insurance quotes, family health insurance, individual health insurance"}),(0,n.jsx)("meta",{property:"og:title",content:"Health Insurance Plans - Compare & Buy Online | CoverTiger"}),(0,n.jsx)("meta",{property:"og:description",content:"Compare and buy the best health insurance plans from top insurers. Get instant quotes, compare coverage, premiums, and benefits."}),(0,n.jsx)("meta",{property:"og:type",content:"website"})]}),(0,n.jsxs)("div",{className:"flex h-dvh max-h-dvh min-h-0 w-full flex-col overflow-hidden bg-[#F5F5F5]",children:[(0,n.jsx)(R.A,{open:ez.sheetOpen,planId:ez.planId,trigger:ez.trigger,surface:"mobile",advisorLabel:(0,O.VT)()?"Talk to an advisor now":"Get a call back from an advisor",onContinue:()=>{ez.stay(),e$("ira")},onTalkToAdvisor:()=>{let e=ez.planId||"";ez.stay(),e$("ira"),setTimeout(()=>{var t;null==(t=eM.current)||t.call(eM,"advisor_call||".concat(e,"||Connect me to an advisor now"))},600)},onLeave:ez.leave}),(0,n.jsx)(j.A,{activeMobileTab:eX,visible:eZ,onBack:()=>ez.requestLeave(()=>{sessionStorage.removeItem("healthInsurance_activeTab"),I.push("/")}),onIraTabClick:()=>{"ira"!==eX&&(0,u.trackTabClickedNewHealthListing)("ira",V.path,"header_toggle"),e$("ira"),e0(!0),localStorage.setItem("hasShownCallInterface","true"),eT(!1),eb(null),ev("")},onPlansTabClick:()=>{"plans"!==eX&&(0,u.trackTabClickedNewHealthListing)("plans",V.path,"header_toggle"),e$("plans"),e0(!0)},onEditMembers:()=>eW("header_family_chip"),onStartTalking:()=>{(0,u.trackFanTvHealthUx)("header_call_icon_click",{source:"mobile_header"}),t8()},shortlistCount:eq.length,onShortlistClick:()=>eO(!0)}),"plans"===eX&&!el&&(0,n.jsx)(P,{filters:eC,onOpenFilter:e=>{let t=eC.find(t=>t.key===e);t&&((0,u.trackFanTvHealthUx)("filter_sheet_open",{source:"plans_filter_chip",filter_key:e}),tl(D(t)),te(e))}}),eH&&(0,n.jsx)(k.A,{plans:eq,onClose:()=>eO(!1),onBuyNow:e=>{eO(!1);let t=new URLSearchParams({plan_id:e.product_id});I.push((0,m.YB)(t,"ira"))},onTalkToIra:e=>{eO(!1),e$("ira"),eE(e.product_id),eI(e.product_name),eL(e.company||e.company_short)},onRemove:e=>{var t;eR(t=>t.filter(t=>t.product_id!==e.product_id)),null==(t=eM.current)||t.call(eM,"shortlist_remove||".concat(e.product_id),{skipUserMessageUi:!0})}}),"ira"===eX&&(0,n.jsx)(C.A,{leadId:ej,selectedPlanId:eS,selectedPlanName:eA,selectedPlanCompany:eF,shouldStartCall:eD,callSessionKey:eP,initialMessage:eg,onInitialMessageConsumed:()=>ev(""),onPlanIdProcessed:()=>{eE(null),eI(null),eT(!1)},onFilterUpdate:function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;"sortBy"===e?(0,o.trackSortApplied)(e,t,V.gtmPageSlug):(0,o.trackFilterApplied)(e,JSON.stringify(t),V.gtmPageSlug),(0,u.trackDropdownClickedTopFilter)(e,t,"health",V.path,"plan_listing"),eN(n=>{let a=[...n.map(n=>{if(n.key===e){let a={...n,selected:t};return"coverage"===e&&l?a.customCoverage=l:"coverage"!==e||l||delete a.customCoverage,"premium"===e&&l?a.customPremium=l:"premium"!==e||l||delete a.customPremium,a}return n})];return t0(a,e),a})},onEditMembers:tq,onEditDetails:()=>eW("chat_composer_edit"),onAddToCart:e=>{let{productId:t,plan:l}=e;(0,u.trackButtonClickedBuyNow)(V.path,u.NEW_HEALTH_LISTING_SUBPAGE.IRA_CHAT,u.NEW_HEALTH_LISTING_SUBEVENT.IRA);let n=new URLSearchParams({plan_id:t});(null==l?void 0:l.sum_assured)&&n.append("sum_assured",String(l.sum_assured)),(null==l?void 0:l.tenure)&&n.append("tenure",String(l.tenure)),(null==l?void 0:l.premium)&&n.append("premium",String(l.premium)),I.push((0,m.YB)(n,"ira"))},onShowAllPlans:()=>{(0,u.trackTabClickedNewHealthListing)("plans",V.path,"ira_show_all_plans"),e$("plans")},onInsuranceSummaryReceived:e=>{var t,l;tM.current=!0;let n=Number(null==e||null==(t=e.coverage)?void 0:t.value);n>0&&(tz.current={min:n,max:n}),((null==e||null==(l=e.membersCovered)?void 0:l.length)||(null==e?void 0:e.city))&&tG()},onScrollDirectionChange:e=>e0("up"===e),editDetailsSummary:em,onEditDetailsSummaryConsumed:()=>ep(null),onCallEnd:()=>{e2.current&&(e$(e2.current),e2.current=null)},bestFitPlan:eh,filterBestFitTrigger:eu,compareResultsShown:eo,onCompareResultsShownChange:ec,onOpenMobileFilters:()=>{let e={};
1eC.forEach(t=>{var l;let n=null==(l=t.optionsData)?void 0:l.find(e=>e.label===t.selected);n&&(e[t.key]=n.value)}),e9(e),e6(!0)},selectedAddToCompareLeads:es,onCompareChange:(e,t)=>{"add"===t?!es.includes(e)&&es.length<2&&ei([...es,e]):"remove"===t&&ei(es.filter(t=>t!==e))},onBack:()=>{(0,u.trackTabClickedNewHealthListing)("plans",V.path,"ira_back"),e$("plans")},onRequestGetStartedModal:t6,onShortlistChange:e=>eR(e),onRequirementUpdatedThisTurn:tY,onSendMessageReady:e=>{eM.current=e}}),(0,n.jsx)("main",{ref:e4,className:"relative min-h-0 flex-1 overflow-y-auto overscroll-y-contain".concat("ira"===eX?" hidden sm:block":""),children:el?(0,n.jsx)(_.A,{}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"flex gap-4 lg:mt-3",children:[(0,n.jsxs)("div",{className:"relative mb-40 w-full max-w-5xl md:px-2 lg:px-12",children:[ea&&(0,n.jsx)("div",{className:"flex absolute inset-0 z-40 justify-center items-start pt-40 bg-white bg-opacity-75 rounded-lg",children:(0,n.jsx)("div",{className:"px-8 py-6 rounded-2xl border shadow-xl backdrop-blur-sm bg-white/90 border-gray-200/50",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4 items-center",children:[(0,n.jsx)("div",{className:"relative",children:(0,n.jsx)("div",{className:"w-12 h-12 rounded-full border-4 animate-spin border-t-transparent",style:{borderColor:"#6B61FF transparent #6B61FF #6B61FF"}})}),(0,n.jsx)("div",{className:"text-lg font-medium text-gray-700",children:"Loading..."})]})})}),(0,n.jsx)("div",{className:"mt-1 flex flex-col gap-5",children:lt&&L.map((e,t)=>{var l,a;let{transformedPlans:r,hiddenPlansCount:s,isExpanded:o}=J(e,ee),c={};return r.forEach(e=>{var t,l,n,a;let r=(null==(t=e.variants)?void 0:t.length)>0?e.variants.some(e=>es.includes(e.product_id)):es.includes(e.product_id);c[null!=(a=null==(n=e.variants)||null==(l=n[0])?void 0:l.product_id)?a:e.product_id]=r}),(0,n.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,n.jsx)("div",{className:"flex flex-col gap-5 px-4",children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(w.A,{plans:r,companyLogo:e.logo,companyName:e.company_name,insurance_type:"health",index:t,variant:"company",showCompareToggle:!1,compareStates:c,premiumFrequency:tp,analyticsSubevent:u.NEW_HEALTH_LISTING_SUBEVENT.PLANS,onStartTalking:t7,onSummarizePlan:e=>t9("Summarize the ".concat(e," plan for me"),u.NEW_HEALTH_LISTING_SUBPAGE.PLAN_LISTING,!0),onCompareToggle:e=>t5(e.product_id),onViewAllFeatures:e=>t2(e),onCtaClick:e=>{let t=new URLSearchParams({plan_id:e.product_id});e.sum_assured&&t.append("sum_assured",e.sum_assured.toString()),e.tenure&&t.append("tenure",e.tenure.toString()),e.premium&&t.append("premium",e.premium.toString()),I.prefetch((0,m.YB)(t,"plans")),I.push((0,m.YB)(t,"plans"))}}),s>0&&(0,n.jsx)("div",{className:"text-center",children:(0,n.jsx)("button",{onClick:()=>{var t,l;let n=o?"Show less plans from ".concat(e.company_name.split(" ")[0]," ").concat((null==(t=e.company_name)?void 0:t.split(" ")[1])||""):"View ".concat(s," more plan").concat(s>1?"s":""," from ").concat(e.company_name.split(" ")[0]," ").concat((null==(l=e.company_name)?void 0:l.split(" ")[1])||"");(0,u.trackButtonClickedViewMorePlans)(n,V.path,"plan_listing"),t1(e.company_id)},className:"px-6 py-1 bg-[#E8E9FF] text-black rounded-b-lg text-sm font-medium hover:bg-[#d8d9ff] transition-colors cursor-pointer",children:o?"Show less plans from ".concat(e.company_name.split(" ")[0]," ").concat((null==(l=e.company_name)?void 0:l.split(" ")[1])||""):"View ".concat(s," more plan").concat(s>1?"s":""," from ").concat(e.company_name.split(" ")[0]," ").concat((null==(a=e.company_name)?void 0:a.split(" ")[1])||"")})})]})}),0===t&&L.length>1&&(0,n.jsx)("div",{className:"px-4",children:(0,n.jsxs)("div",{className:"w-full rounded-2xl p-4 relative overflow-hidden",style:{background:"linear-gradient(97.11deg, #6C5CE7 5.08%, #FE9BF3 94.92%)"},children:[(0,n.jsx)("img",{src:i.Bg,alt:i.Mo,className:"absolute top-3 right-3 w-16 h-16 rounded-full object-cover shadow-md"}),(0,n.jsx)("div",{className:"pr-20",children:(0,n.jsx)("div",{className:"text-[17px] font-bold text-white leading-snug",children:"Find your ideal health plan today"})}),(0,n.jsxs)("button",{onClick:()=>{(0,u.trackButtonClickedIdealPlanBannerAdvisor)(V.path,"plan_listing",{placement:"after_first_insurer",advisor_name:i.Mo}),(0,u.trackButtonClickedAskQuestionsAIAdvisor)(i.qQ,V.path,"plan_listing"),t9("I am looking to buy a health insurance plan. Can you help me find the right insurance?","",!0)},className:"mt-4 flex items-center gap-2 rounded-full bg-white px-4 py-2 text-sm font-semibold text-[#2D3436] shadow-sm cursor-pointer",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#6B61FF]",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,n.jsx)("path",{d:"M6.62 10.79a15.053 15.053 0 006.59 6.59l2.2-2.2a1 1 0 011.01-.24c1.12.37 2.33.57 3.58.57a1 1 0 011 1V20a1 1 0 01-1 1C10.61 21 3 13.39 3 4a1 1 0 011-1h3.5a1 1 0 011 1c0 1.25.2 2.46.57 3.58a1 1 0 01-.25 1.01l-2.2 2.2z"})}),"Talk to advisor"]})]})}),2===t&&L.length>3&&(0,n.jsx)("div",{className:"px-4",children:(0,n.jsxs)("div",{className:"w-full rounded-2xl bg-gradient-to-br from-[#6B61FF] to-[#FE9BF3] p-4 flex items-center justify-between gap-3 cursor-pointer",onClick:()=>{(0,u.trackButtonClickedAskQuestionsAIAdvisor)("Talk to ".concat(i.Mo),V.path,"plan_listing"),t9("I am looking to buy a health insurance plan. Can you help me find the right insurance?","",!0)},children:[(0,n.jsxs)("div",{className:"text-[17px] font-bold text-white leading-snug",children:[i.Mo," our AI advisor is here to help you 24/7"]}),(0,n.jsx)("img",{src:i.Bg,alt:i.Mo,className:"h-16 w-16 shrink-0 rounded-full object-cover shadow-md border-2 border-white/40"})]})})]},e.company_id)})}),ll&&(0,n.jsxs)("div",{className:"mt-2 mb-2 w-full flex flex-col items-center justify-center min-h-[60vh] px-3 sm:px-4",children:[le&&(0,n.jsxs)("p",{className:"mb-3 w-full max-w-md rounded-full bg-amber-50 px-3 py-2 text-center text-xs text-amber-900 ring-1 ring-amber-200/80",children:["Preview: empty state â remove"," ",(0,n.jsx)("code",{className:"rounded bg-amber-100/80 px-1 py-0.5 font-mono text-[11px]",children:"preview_no_plans=1"})," ","from the URL to see real results."]}),(0,n.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center w-full text-center md:flex-row md:gap-4",children:[(0,n.jsxs)("div",{className:"w-full md:w-1/2",children:[(0,n.jsx)("div",{className:"flex justify-center mb-4 sm:mb-6 md:mb-8",children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("div",{className:"w-12 h-12 sm:w-16 sm:h-16 md:w-20 md:h-20 mx-auto bg-gradient-to-br from-[#E8E9FF] to-[#F8F7FC] rounded-full flex items-center justify-center shadow-lg",children:(0,n.jsx)("svg",{className:"w-12 h-12 sm:w-16 sm:h-16 md:w-20 md:h-20 text-[#6B61FF]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,n.jsx)("div",{className:"absolute -top-1 -right-1 sm:-top-2 sm:-right-2 w-8 h-8 sm:w-12 sm:h-12 md:w-16 md:h-16 bg-[#6B61FF] rounded-full opacity-20 blur-xl"}),(0,n.jsx)("div",{className:"absolute -bottom-1 -left-1 sm:-bottom-2 sm:-left-2 w-8 h-8 sm:w-12 sm:h-12 md:w-16 md:h-16 bg-[#FE9BF3] rounded-full opacity-20 blur-xl"})]})}),(0,n.jsx)("h2",{className:"text-lg sm:text-xl font-bold text-[#2D3436] mb-2 sm:mb-3 md:mb-4",children:"No Plans Found"}),(0,n.jsx)("p",{className:"text-xs sm:text-sm text-[#636E72] mb-4 sm:mb-5 md:mb-6 leading-relaxed px-2 sm:px-0",children:"We couldn't find any plans matching your current filters.\n Don't worry, we're here to help you find the perfect\n insurance plan!"})]}),(0,n.jsx)("div",{className:"w-full md:w-auto",children:(0,n.jsx)(b.h0,{onStartChat:()=>{t9("I couldn't find plans matching my filters. Can you help me find the right insurance?")}})})]}),B.length>0&&!le&&(0,n.jsxs)("div",{className:"mt-8 w-full",children:[(0,n.jsx)("h2",{className:"text-xl font-bold text-[#2D3436] mb-6 text-left",children:"Other Available Plans"}),(0,n.jsx)("div",{className:"space-y-6",children:B.map((e,t)=>{var l,a;let{transformedPlans:r,hiddenPlansCount:s,isExpanded:i}=J(e,ee),o={};return r.forEach(e=>{var t,l,n,a;let r=(null==(t=e.variants)?void 0:t.length)>0?e.variants.some(e=>es.includes(e.product_id)):es.includes(e.product_id);o[null!=(a=null==(n=e.variants)||null==(l=n[0])?void 0:l.product_id)?a:e.product_id]=r}),(0,n.jsx)("div",{className:"space-y-4 p-4 ".concat(0===s?"mb-6":"mb-10"),children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(w.A,{plans:r,companyLogo:e.logo,companyName:e.company_name,insurance_type:"health",index:t,variant:"company",showCompareToggle:!1,compareStates:o,premiumFrequency:tp,analyticsSubevent:u.NEW_HEALTH_LISTING_SUBEVENT.PLANS,onStartTalking:t7,onSummarizePlan:e=>t9("Summarize the ".concat(e," plan for me"),u.NEW_HEALTH_LISTING_SUBPAGE.PLAN_LISTING,!0),onCompareToggle:e=>t5(e.product_id),onViewAllFeatures:e=>t2(e),onCtaClick:e=>{let t=new URLSearchParams({plan_id:e.product_id});e.sum_assured&&t.append("sum_assured",e.sum_assured.toString()),e.tenure&&t.append("tenure",e.tenure.toString()),e.premium&&t.append("premium",e.premium.toString()),I.prefetch((0,m.YB)(t,"plans")),I.push((0,m.YB)(t,"plans"))}}),s>0&&(0,n.jsx)("div",{className:"text-center absolute bottom-[-26px] left-0 right-0",children:(0,n.jsx)("button",{onClick:()=>{var t,l;let n=i?"Show less plans from ".concat(e.company_name.split(" ")[0]," ").concat((null==(t=e.company_name)?void 0:t.split(" ")[1])||""):"View ".concat(s," more plan").concat(s>1?"s":""," from ").concat(e.company_name.split(" ")[0]," ").concat((null==(l=e.company_name)?void 0:l.split(" ")[1])||"");(0,u.trackButtonClickedViewMorePlans)(n,V.path,"plan_listing"),t1(e.company_id)},className:"px-6 py-1 bg-[#E8E9FF] text-black rounded-b-lg text-sm font-medium hover:bg-[#d8d9ff] transition-colors cursor-pointer",children:i?"Show less plans from ".concat(e.company_name.split(" ")[0]," ").concat((null==(l=e.company_name)?void 0:l.split(" ")[1])||""):"View ".concat(s," more plan").concat(s>1?"s":""," from ").concat(e.company_name.split(" ")[0]," ").concat((null==(a=e.company_name)?void 0:a.split(" ")[1])||"")})})]})},e.company_id)})})]})]})]}),!1]})})}),(0,n.jsx)(M.A,{activeMobileTab:eX,onAskIra:e=>{t9(e,"plan_listing",!0)},advisorName:i.Mo}),(0,n.jsx)(A.A,{isOpen:e3,onClose:()=>e6(!1),filters:eC,pendingMobileFilters:e8,onFilterChange:(e,t)=>
1e9(l=>({...l,[e]:t})),onApply:()=>t4(e8)}),(0,n.jsx)(q,{filter:eC.find(e=>e.key===e7)||null,draftValue:tt,onSelect:tl,onClose:()=>{(0,u.trackFanTvHealthUx)("filter_sheet_dismiss",{dismiss_method:"chip_sheet_close",filter_key:e7}),te(null),tl(null)},onDone:()=>{if(!e7||void 0===tt)return void te(null);t4({[e7]:tt},"done")}}),(0,n.jsx)(b.x6,{position:"bottom-right",onStartChat:()=>{(0,u.trackButtonClickedAskQuestionsAIAdvisor)("Floating Chat Button",V.path,"plan_listing"),t9("I am looking to buy a health insurance plan. Can you help me find the right insurance?","",!0)}}),(0,n.jsx)(N.A,{isOpen:eG,variant:"sheet",onClose:()=>eV(!1),onSave:(e,t,l)=>{tq(e,t,l),l&&(l.cityChanged||l.membersChanged||l.illnessChanged||l.coverageChanged)&&(ep(l),ed(e=>e+1),e$("ira"))},requirementData:tS,insuranceType:"health",coverageValue:tB}),(0,n.jsx)(K,{isOpen:tb,onClose:()=>{tw&&(t_(!1),tj(!0),tC.current=null,tk.current=!1)},allowClose:tw,skipNavigation:!0,onSubmitSuccess:e=>{if(console.log("[HEALTH-INSURANCE] Lead form submitted successfully:",e),e.lead_id&&((0,s.x$)(e.lead_id),ek(e.lead_id),localStorage.setItem("onboarding_lead_id",e.lead_id),localStorage.setItem("leadId",e.lead_id),(0,u.updateMixpanelUserIdentity)(e.lead_id)),(0,s.BC)("health"),t_(!1),tj(!0),tk.current){tk.current=!1,eE(null),eI(null),eB(e=>e+1),"ira"!==eX&&t9("I am looking to buy a health insurance plan. Can you help me find the right insurance?","plan_listing",!0);return}e.lead_id&&I.replace({pathname:I.pathname,query:{...I.query,lead_id:e.lead_id}})}})]})]})};var Z=l(85280);let ee=r()(()=>Promise.all([l.e(9717),l.e(7922),l.e(5300),l.e(2572),l.e(9988)]).then(l.bind(l,79988)),{loadableGenerated:{webpack:()=>[79988]},ssr:!1});var et=!0;function el(e){let{initialIsDesktop:t,...l}=e;return(0,Z.Ay)(t)?(0,n.jsx)(ee,{...l}):(0,n.jsx)($,{...l})}},71537:(e,t,l)=>{"use strict";l.d(t,{IH:()=>u,Px:()=>m,XC:()=>o,ds:()=>d,kk:()=>c});var n=l(78761),a=l(38773),r=l(65364);let s="filter_metadata_health",i=["plan_type","coverage","premium","insurer","sort_by"];function o(){return[{key:"planType",code:"plan_type",label:"Plan Type",selected:"Individual",options:["Individual","Family Floater"],optionsData:[{value:"individual",label:"Individual",is_default:!0},{value:"family_floater",label:"Family Floater"}]},{key:"coverage",code:"coverage",label:"Coverage",selected:"Below â¹5 Lac",options:["Below â¹5 Lac","â¹5-9 Lac","â¹10-24 Lac","â¹25-99 Lac"],optionsData:[{value:"1",label:"Below â¹5 Lac",meta:{min:5e4,max:5e5}},{value:"2",label:"â¹5-9 Lac",meta:{min:5e5,max:9e5}},{value:"3",label:"â¹10-24 Lac",meta:{min:1e6,max:23e5}},{value:"4",label:"â¹25-99 Lac",meta:{min:25e5,max:99e5}}]},{key:"premium",code:"premium",label:"Premium",selected:"Any",options:["Any","Below â¹1,000","â¹1,000-2,000","â¹2,000-5,000","Above â¹5,000"],optionsData:[{value:"any",label:"Any",is_default:!0},{value:"1",label:"Below â¹1,000",meta:{min:0,max:1e3}},{value:"2",label:"â¹1,000-2,000",meta:{min:1e3,max:2e3}},{value:"3",label:"â¹2,000-5,000",meta:{min:2e3,max:5e3}},{value:"4",label:"Above â¹5,000",meta:{min:5e3,max:999999}}]},{key:"insurer",code:"insurer",label:"Insurer",selected:"All Insurers",options:["All Insurers","Care Health","Niva Bupa","ICICI Lombard","Star Health"],optionsData:[{value:"all",label:"All Insurers",is_default:!0},{value:"care",label:"Care Health"},{value:"niva_bupa",label:"Niva Bupa"},{value:"icici_lombard",label:"ICICI Lombard"},{value:"star",label:"Star Health"}]},{key:"sortBy",code:"sort_by",label:"Sort By",selected:"Relevance",options:["Relevance","Premium: Low to High","Premium: High to Low","Coverage: High to Low"],optionsData:[{value:"relevance",label:"Relevance",is_default:!0},{value:"premium_low_high",label:"Premium: Low to High"},{value:"premium_high_low",label:"Premium: High to Low"},{value:"coverage_high_low",label:"Coverage: High to Low"}]}]}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=[];return i.forEach(n=>{var a,r;let s=null==e?void 0:e[n];if(!s)return;let i=null,o=null,c=null,u=null==t||null==(a=t.filter_preferences)?void 0:a[n];if(u)if("coverage"===n&&u.custom&&u.min&&u.max){let e=(u.min/1e5).toFixed(0),t=(u.max/1e5).toFixed(0);i=e===t?"â¹".concat(e," Lac"):"â¹".concat(e,"-").concat(t," Lac"),c={min:u.min,max:u.max}}else u.label?(o=s.options.find(e=>e.label===u.label))&&(i=o.label):u.value&&(o=s.options.find(e=>e.value===u.value))&&(i=o.label);if(!i){let e=s.options.find(e=>e.is_default);i=e?e.label:null==(r=s.options[0])?void 0:r.label,o=e||s.options[0]}let d={key:n.replace(/_([a-z])/g,e=>e[1].toUpperCase()),code:s.code,label:s.label,selected:i,options:s.options.map(e=>e.label),optionsData:s.options};c&&(d.customCoverage=c),l.push(d)}),l}async function u(){let{forceRefresh:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)try{let e=localStorage.getItem(s);if(e){let t=JSON.parse(e);if((null==t?void 0:t.ok)&&t.filters)return t.filters}}catch(e){console.error("Error parsing cached filter metadata:",e)}let t=(0,a.cG)(),l={"Content-Type":"application/json"};t&&(l.Authorization="Bearer ".concat(t));let n=await fetch("https://wxofebyviealmeyltqtm.supabase.co/functions/v1/filter-metadata-v1?product=health",{headers:l});if(!n.ok)return null;let r=await n.json();return(null==r?void 0:r.ok)&&r.filters?(localStorage.setItem(s,JSON.stringify(r)),r.filters):null}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};
1return e.forEach(e=>{if("coverage"===e.key&&e.customCoverage){t[e.code]={custom:!0,min:e.customCoverage.min,max:e.customCoverage.max,label:e.selected};return}if(!e.optionsData)return;let l=e.optionsData.find(t=>t.label===e.selected);l&&!l.is_default&&(t[e.code]={value:l.value,label:e.selected,meta:l.meta||void 0})}),t}async function m(e){let{filterPreferences:t,requirement:l=null,insuranceType:s="Health"}=e,i=(0,a.cG)(),o={"Content-Type":"application/json"};o.Authorization="Bearer ".concat(i||r.env.NEXT_PUBLIC_SUPABASE_ANON_KEY||"");let c=null,u=null,d=null;if(Array.isArray(null==l?void 0:l.personas)&&l.personas.length>0){d=l.personas;let e=l.personas.find(e=>"primary_applicant"===e.relationship||"self"===e.relationship);e&&(c=e.age||null,u=e.gender||null)}let m=await fetch(n.xR,{method:"POST",headers:o,body:JSON.stringify({step:"FILTERS",filter_preferences:t,insurance_type:s,age:c,gender:u,education:(null==l?void 0:l.education)||null,personas:d})});if(!m.ok)return{ok:!1,requirement:null};let p=await m.json();if(!(null==p?void 0:p.requirement))return{ok:!0,requirement:null};try{let e="string"==typeof p.requirement?JSON.parse(p.requirement):p.requirement;return{ok:!0,requirement:e}}catch(e){return console.error("Error parsing requirement from FILTERS response:",e),{ok:!0,requirement:null}}}}},e=>{var t=t=>e(e.s=t);e.O(0,[7043,4928,2626,421,1598,7478,166,8224,4800,5649,201,9230,636,8792],()=>t(13029)),_N_E=e.O()}]);
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.