1"use strict";(self.webpackChunkpg_gatsby=self.webpackChunkpg_gatsby||[]).push([[1026],{4854:function(e,t,a){a.d(t,{Z:function(){return Se}});var l=a(7294),n=a(6010),r=a(3291);const o=e=>{let{year:t,month:a,day:l}=e;if(!t||!a||!l||Number(t)<100)return null;const n=new Date(Date.now()),r=new Date(+t,+a-1,+l);let o=n.getFullYear()-r.getFullYear();const s=n.getMonth()-r.getMonth();return(s<0||0===s&&n.getDate()<r.getDate())&&o--,0===o?null:o},s={41:14,42:14,43:13,44:12,45:12,46:11,47:11,48:10,49:10,50:9,51:9,52:8,53:7,54:7,55:6,56:5,57:5,58:5,59:5,60:5},c=e=>{let{age:t,childAge:a,income:l,numChildren:n}=e;if(t<18||t>67||0===l)return 0;const r=n&&a&&26-a>=65-t?65-(26-a):t;return r>=18&&r<=40?15:r>=61&&r<=67?4:s[r]},u=e=>{let{age:t,childAge:a,numChildren:l}=e;if(!t)return 0;let n=5*Math.ceil((65-t)/5);if(n>30&&(n=30),n<10&&(n=10),!a||!l)return n;let r=5*Math.ceil((26-a)/5);return r<10&&(r=10),r>n?r:n},m=e=>{let{income:t,spousalIncome:a,age:l,multiplier:n,debt:r,savings:o,numChildren:s,hasSpouse:c,collegeCosts:u}=e;const m=o||0,i=r||0;if(null===t)return null;if(!l||l>67)return null;if(0===t&&0===s)return null;if(0===t)return 11e4*(s||0)-(c?m/2:m);const d=s&&u?17e4*s:0,g=a?t/(t+a):1,p=t*n+(c?i*g:i)+(c?d*g:d)-(c?m/2:m);return Math.round(p)},i=l.createContext(void 0),d=e=>{let{children:t}=e;const[a,n]=(0,l.useState)(null),[r,s]=(0,l.useState)(null),[d,g]=(0,l.useState)(null),[p,v]=(0,l.useState)(null),[h,b]=(0,l.useState)(null),[E,N]=(0,l.useState)(null),[f,y]=(0,l.useState)(null),[x,T]=(0,l.useState)(null),[C,S]=(0,l.useState)(null),[w,k]=(0,l.useState)(null),[I,L]=(0,l.useState)(null),[U,z]=(0,l.useState)(null),[D,A]=(0,l.useState)(null),[H,Y]=(0,l.useState)(null),[_,$]=(0,l.useState)(null),[M,F]=(0,l.useState)(null),[W,B]=(0,l.useState)(0),[O,Z]=(0,l.useState)(0),[P,R]=(0,l.useState)(0),[q,G]=(0,l.useState)(0),[Q,V]=(0,l.useState)(null),[j,J]=(0,l.useState)(null),[K,X]=(0,l.useState)(!1),[ee,te]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{v(o({year:d,month:a,day:r}))}),[d,a,r]),(0,l.useEffect)((()=>{k(o({year:C,month:f,day:x}))}),[C,f,x]),(0,l.useEffect)((()=>{B(c({age:p||68,childAge:null!==D?+D:null,income:null!==h?+h:null,numChildren:null!==U?+U:null}))}),[p,D,h,U]),(0,l.useEffect)((()=>{Z(c({age:w||68,childAge:null!==D?+D:null,income:null!==I?+I:null,numChildren:null!==U?+U:null}))}),[w,D,I,U]),(0,l.useEffect)((()=>{R(u({age:p,childAge:null!==D?+D:null,numChildren:null!==U?+U:null}))}),[p,D,U]),(0,l.useEffect)((()=>{G(u({age:w||68,childAge:null!==D?+D:null,numChildren:null!==U?+U:null}))}),[w,D,U]),(0,l.useEffect)((()=>{V(m({income:null!==h?+h:null,spousalIncome:null!==I?+I:null,age:p,multiplier:W,debt:null!==_?+_:null,savings:null!==M?+M:null,numChildren:null!==U?+U:null,hasSpouse:E,collegeCosts:H}))}),[h,I,p,w,W,_,M,U,E,H]),(0,l.useEffect)((()=>{J(m({income:null!==I?+I:null,spousalIncome:null!==h?+h:null,age:w,multiplier:O,debt:null!==_?+_:null,savings:null!==M?+M:null,numChildren:null!==U?+U:null,hasSpouse:!0,collegeCosts:H}))}),[h,I,p,w,O,_,M,U,E,H]),(0,l.useEffect)((()=>{!K&&p&&h&&X(!0)}),[p,h]),(0,l.useEffect)((()=>{!ee&&w&&I&&te(!0)}),[w,I]),l.createElement(i.Provider,{value:{dobMonth:a,dobDay:r,dobYear:d,age:p,annualIncome:h,spouse:E,spouseDobMonth:f,spouseDobDay:x,spouseDobYear:C,spouseAge:w,spouseAnnualIncome:I,numberOfChildrenUnder18:U,ageOfYoungest:D,collegeCosts:H,totalHouseHoldDebt:_,totalHouseHoldSavings:M,multiplier:W,spouseMultiplier:O,term:P,spouseTerm:q,coverage:Q,spouseCoverage:j,hasInfo:K,spouseHasInfo:ee,setDobMonth:n,setDobDay:s,setDobYear:g,setAge:v,setAnnualIncome:b,setSpouse:N,setSpouseDobMonth:y,setSpouseDobDay:T,setSpouseDobYear:S,setSpouseAge:k,setSpouseAnnualIncome:L,setNumberOfChildrenUnder18:z,setAgeOfYoungest:A,setCollegeCosts:Y,setTotalHouseHoldDebt:$,setTotalHouseHoldSavings:F,setMultiplier:B,setSpouseMultiplier:Z,setTerm:R,setSpouseTerm:G,setCoverage:V,setSpouseCoverage:J}},t)};var g=a(4293);const p=1e6,v=e=>null!==e.coverage?e.coverage<=0?"--":e.coverage>=p?`$${Math.round(e.coverage/p*10)/10}M`:`$${e.coverage.toLocaleString()}`:"--";var h=a(279),b=a(5075),E="index-module--data--bd80a",N="index-module--dataEntry--1f468",f="index-module--dataLabel--b65ad",y=a(9539);var x=e=>{let{spouse:t=!1}=e;const{term:a,coverage:o,annualIncome:s,spouseAnnualIncome:c,numberOfChildrenUnder18:u,age:m,spouseAge:d,hasInfo:p,spouseHasInfo:x}=(0,l.useContext)(i),{trackEvent:T}=(0,g.rS)(),C=(e=>{const{term:t,spouseTerm:a,coverage:n,spouseCoverage:r}=(0,l.useContext)(i);return{years:e?a:t,coverage:e?r:n}})(t),S=Number(C.coverage)>0,w=(Number(c)||Number(u))&&Number(d)<67,k=(Number(s)||Number(u))&&Number(m)<67,I=S&&(t?w:k)&&(t?x:p),L=`optimal_${t?"spouse_":""}cta`;return l.createElement("div",{className:"index-module--coveragePanel--15cd6"},l.createElement("div",{className:"index-module--contentBox--b42e3"},l.createElement("div",{className:"index-module--contentInfo--f483a"},l.createElement("div",{className:"index-module--contentHeader--3c1a0"},l.createElement(r.LabelText,{className:"index-module--label--c1b6b",color:"green",size:"large"},"Optimal coverage"),l.createElement(r.UtilityText,{className:"index-module--info--4bc59",size:"small"},"The most optimal level of protection to replace your lost income.")),l.createElement("div",{className:"index-module--dataEntries--a77a3"},l.createElement("div",{className:N},l.createElement(r.LabelText,{className:f,color:"secondary"},"Your term"),l.createElement(r.TitleText,{className:E,size:"small"},I?`${C.years} Years`:"--")),l.createElement("div",{className:N},l.createElement(r.LabelText,{className:f,color:"secondary"},"Your coverage"),l.createElement(r.TitleText,{className:E,size:"small"},v(C)))),l.createElement("input",{type:"hidden",name:"term",value:C.years}),l.createElement("input",{type:"hidden",name:"coverage",value:C.coverage||""})),l.createElement("div",{className:"index-module--contentFooter--4e9d0"},l.createElement("button",{className:(0,n.Z)("index-module--button--24f17",y.ou,y.bb,y.Lg),name:"cta_source",onClick:()=>{T({input:"cta",name:"Clicked Button",source:"coverage-calculator",triggered_from:L}),T({input:"cta",name:"Completed Widget",source:"coverage-calculator",age:m,coverage:o,policy_length:a})},type:"submit",value:L},"Compare Quotes",l.createElement("span",{className:y.q9},l.createElement("img",{src:h.Z,alt:"right arrow",width:"9",height:"15"}))),l.createElement("div",{className:"index-module--contentFooterText--dd268"},l.createElement(r.UtilityText,{size:"small"},"Powered by"),l.createElement("img",{src:b.Z,alt:"Policygenius logo",className:"index-module--policygeniusLogo--509bc"})))))},T="index-module--coverageTitle--69c96",C="index-module--recommendationHeader--000da",S="index-module--recommendationWrapper--6268a";const w=e=>{let{spouse:t,over67:a}=e;return a?l.createElement(r.UtilityText,{size:"small"},"Our calculator recommends life insurance coverage for people age 67 and younger. If"," ",t?"your spouse is ":"you're ","over 67, talk to a Policygenius expert to find the right coverage option for"," ",t?"them":"you","."):l.createElement(r.UtilityText,{size:"small"}
1,"Based on your family circumstances, we are not recommending coverage"," ",t?"for your spouse ":"","at this time. You can speak to a Policygenius agent to get a more personalized recommendation",t?" for them":"",".")};var k=e=>{let{spouse:t,over67:a}=e;const{trackEvent:n}=(0,g.rS)(),o=`no_recommendation_${t?"spouse_":""}cta`;return l.createElement("div",{className:"index-module--noRecommendationWrapper--2bbcd"},l.createElement(r.TitleText,{size:"small",className:"index-module--noRecommendationTitle--6f697"},"We need a little more information"),l.createElement(w,{spouse:t,over67:a}),l.createElement(r.Button,{type:"submit",name:"cta_source",value:o,fullWidth:!0,variant:t?"secondary":"primary",size:"large",className:"index-module--overAgeButton--75316",onClick:()=>{n({input:"cta",name:"Clicked Button",source:"coverage-calculator",triggered_from:o})}},"Get quotes"))};var I=()=>{const{spouse:e,coverage:t,spouseCoverage:a,spouseAge:o,age:s,hasInfo:c,spouseHasInfo:u}=(0,l.useContext)(i),m=c&&(null===t||Number(t)<=0),d=u&&(null===a||Number(a)<=0),g=!!s&&s>=67,p=!!e&&!!o&&o>=67;return l.createElement(l.Fragment,null,g||m?l.createElement(k,{over67:g}):l.createElement("div",{className:S},l.createElement("div",{className:C},l.createElement(r.TitleText,{size:"small",className:T},"Recommended coverage for you")),l.createElement(x,null)),e&&(p||d)&&l.createElement(k,{spouse:!0,over67:p}),e&&!(p||d)&&l.createElement("div",{className:S},l.createElement("div",{className:C},l.createElement(r.TitleText,{size:"small",className:(0,n.Z)(T,{"index-module--spouse--93d07":e})},"Recommended coverage for your partner")),l.createElement(x,{spouse:!0})))},L="index-module--link--ecdf9";var U=()=>{const{trackEvent:e}=(0,g.rS)();return l.createElement("div",{className:"index-module--disclaimerWrapper--64af6"},l.createElement("p",{className:"index-module--text--e8ce0"},"These estimates are for educational purposes only and shouldn't take the place of professional advice. Your coverage needs may vary based on other factors not considered here. Interested in more personalized quotes?"," ",l.createElement("a",{href:"https://www.policygenius.com/life-insurance/start",onClick:()=>e({name:"Clicked Link",text:"Compare for free online",href:"https://www.policygenius.com/life-insurance/start",source:"coverage-calculator"}),className:L},"Compare for free online"),", or call"," ",l.createElement("a",{href:"tel:1-855-695-2255",onClick:()=>e({name:"Clicked Link",text:"1-855-695-2255",href:"tel:1-855-695-2255",source:"coverage-calculator"}),className:L},"1-855-695-2255")," ","to speak with one of our licensed agents."))},z="index-module--link--d2c2c",D="index-module--section--4a491",A="index-module--text--f2548";var H=()=>{const{age:e,term:t,numberOfChildrenUnder18:a}=(0,l.useContext)(i),n=Number(a)>0;return l.createElement("div",{className:D},l.createElement(r.LabelText,{size:"medium",className:A},"How did we calculate your term?"),e&&e<35?l.createElement(r.UtilityText,{size:"small",className:A},"Based on your age, we recommend a term of ",l.createElement("b",null,"30 years"),", the longest widely available option."):l.createElement(r.UtilityText,{size:"small",className:A},"Based on your age ",n&&"and the age of your youngest child, ","we recommend a term of ",l.createElement("b",null,t," years")," to cover you until retirement",n&&" and until your youngest child turns 26","."))};var Y=()=>{const{totalHouseHoldDebt:e,totalHouseHoldSavings:t,collegeCosts:a,annualIncome:n,spouseAnnualIncome:o,numberOfChildrenUnder18:s,multiplier:c,spouse:u}=(0,l.useContext)(i),m=!Number(e)&&!Number(t),d=!!Number(e)||!!Number(t),p=!Number(n)&&!!Number(s),v=!Number(n)&&!Number(s),h=Number(n)/(Number(n)+Number(o)),b=Math.round(Number(e)*Number(h)).toLocaleString(),{trackEvent:E}=(0,g.rS)();return l.createElement("div",{className:D},l.createElement(r.LabelText,{size:"medium",className:A},"How did we calculate your coverage?"),m&&l.createElement(r.UtilityText,{size:"small",className:A},"Based on your age and term length, we multiplied your income by ",l.createElement("b",null,c),"."),d&&l.createElement(l.Fragment,null,l.createElement(r.UtilityText,{size:"small",className:A},"Based on your age and term length, we multiplied your income by ",l.createElement("b",null,c),!!Number(e)&&l.createElement(l.Fragment,null," ","and added ",l.createElement("b",null,"$",b)," to cover your share of your household debt, proportional to your income"),". ",u?"We also subtracted half of your household savings.":"We also subtracted your household savings.")),!!Number(n)&&a&&l.createElement(r.UtilityText,{size:"small",className:A},"Because you wanted to include coverage for college costs, we also added ",l.createElement("b",null,"$170,000")," ","per child proportional to your income."," ",l.createElement("a",{href:"https://research.collegeboard.org/media/pdf/trends-college-pricing-student-aid-2021.pdf",onClick:()=>
1E({name:"Clicked Link",text:"The average total cost",href:"https://research.collegeboard.org/media/pdf/trends-college-pricing-student-aid-2021.pdf",source:"coverage-calculator"}),className:z},"The average total cost")," ","of college in 2021-22 is $169,707. Your costs may be higher or lower depending on the ages of your children and the type of school they attend."),p&&l.createElement(r.UtilityText,{size:"small",className:A},"We added ",l.createElement("b",null,"$110,000")," per child to cover the cost of childcare."),v&&l.createElement(r.UtilityText,{size:"small",className:A},"Because you have no income and you don't have children, we're not recommending coverage at this time. A Policygenius expert can help you determine what level of coverage makes sense for your situation."))};var _=()=>{const{spouseAge:e,spouseTerm:t,numberOfChildrenUnder18:a}=(0,l.useContext)(i),n=Number(a)>0;return l.createElement("div",{className:D},l.createElement(r.LabelText,{size:"medium",className:A},"How did we calculate your spouse/partnerâs term?"),e&&e<35?l.createElement(r.UtilityText,{size:"small",className:A},"Based on your spouse/partner's age, we recommend a term of ",l.createElement("b",null,"30 years"),", the longest widely available option."):l.createElement(r.UtilityText,{size:"small",className:A},"Based on your spouse/partner's age ",n&&"and the age of your youngest child, ","we recommend a term of ",l.createElement("b",null,t," years")," to cover you until retirement",n&&" and until your youngest child turns 26","."))};var $=()=>{const{totalHouseHoldDebt:e,totalHouseHoldSavings:t,collegeCosts:a,annualIncome:n,spouseAnnualIncome:o,spouseMultiplier:s,numberOfChildrenUnder18:c}=(0,l.useContext)(i),u=!Number(e)&&!Number(t),m=!(!Number(o)||!Number(e)&&!Number(t)),d=!Number(o)&&!!Number(c),p=!Number(o)&&!Number(c),v=!!Number(o)&&!!Number(c)&&!!a,h=Number(o)/(Number(n)+Number(o)),b=Math.round(Number(e)*Number(h)).toLocaleString(),{trackEvent:E}=(0,g.rS)();return l.createElement("div",{className:D},l.createElement(r.LabelText,{size:"medium",className:A},"How did we calculate your spouse/partnerâs coverage?"),u&&l.createElement(r.UtilityText,{size:"small",className:A},"Based on your spouse/partner's age and term length, we multiplied their income by"," ",l.createElement("b",null,s),"."),m&&l.createElement(l.Fragment,null,l.createElement(r.UtilityText,{size:"small",className:A},"Based on your spouse/partner's age and term length, we multiplied their income by"," ",l.createElement("b",null,s),!!Number(e)&&l.createElement(l.Fragment,null," ","and added ",l.createElement("b",null,"$",b)," to cover their share of your household debt, proportional to their income"),". We also subtracted half of your household savings.")),v&&l.createElement(r.UtilityText,{size:"small",className:A},"Because you wanted to include coverage for college costs, we also added ",l.createElement("b",null,"$170,000")," ","per child proportional to your partner's income."," ",l.createElement("a",{href:"https://research.collegeboard.org/media/pdf/trends-college-pricing-student-aid-2021.pdf",onClick:()=>E({name:"Clicked Link",text:"The average total cost",href:"https://research.collegeboard.org/media/pdf/trends-college-pricing-student-aid-2021.pdf",source:"coverage-calculator"}),className:z},"The average total cost")," ","of college in 2021-22 is $169,707. Your costs may be higher or lower depending on the ages of your children and the type of school they attend."),d&&l.createElement(r.UtilityText,{size:"small",className:A},"We added ",l.createElement("b",null,"$110,000")," per child to cover the cost of childcare.",!!Number(t)&&" We also subtracted half of your household savings."),p&&l.createElement(r.UtilityText,{size:"small",className:A},"Because your partner has no income and you don't have children, we're not recommending coverage at this time. A Policygenius expert can help you determine what level of coverage makes sense for your situation."))};var M=()=>{const{age:e,spouseAge:t,coverage:a,spouseCoverage:n,hasInfo:r,spouseHasInfo:o}=(0,l.useContext)(i);return r?l.createElement("div",{className:"index-module--explanations--67150"},e&&e<67&&Number(a)>0&&l.createElement(l.Fragment,null,l.createElement(H,null),l.createElement(Y,null)),o&&Number(t)<67&&Number(n)>0&&l.createElement(l.Fragment,null,l.createElement(_,null),l.createElement($,null))):null};var F=()=>l.createElement("div",{className:"index-module--header--c417b"},l.createElement(r.TitleText,{as:"h2",className:"index-module--title--7ad59",id:"life-insurance-coverage-calculator"},"How much life insurance do you need?")),W="index-module--tag--f8b37";const B=e=>{let{label:t="Your Information",spouse:a=!1}=e;const{age:n,spouseAge:o,annualIncome:s,spouseAnnualIncome:c,numberOfChildrenUnder18:u,totalHouseHoldDebt:m,totalHouseHoldSavings:d}=(0,l.useContext)(i),g={age:a?o:n,children:u,debt:m?+m:null,savings:d?+d:null,income:a?null!==c?+c:null:null!==s?+s:null};return l.createElement("div",{className:"index-module--informationSummary--ebad8"},l.createElement(r.LabelText,{className:"index-module--label--91921"},t),l.createElement("div",{className:"index-module--tagWrapper--c8735"},!(null==g||!g.age)&&l.createElement(r.LabelText,{className:W},g.age," years old"),null!==(null==g?void 0:g.income)&&l.createElement(r.LabelText,{className:W}
1,"$",g.income.toLocaleString()," annual income"),!(null==g||!g.children)&&l.createElement(r.LabelText,{className:W},g.children," children"),null!==(null==g?void 0:g.savings)&&l.createElement(r.LabelText,{className:W},"$",g.savings.toLocaleString()," savings"),null!==(null==g?void 0:g.debt)&&l.createElement(r.LabelText,{className:W},"$",g.debt.toLocaleString()," debt")))};var O=()=>{const{spouse:e,hasInfo:t,spouseHasInfo:a}=(0,l.useContext)(i);return t?l.createElement("div",{className:"index-module--informationSection--c869b"},l.createElement(B,{label:"Your information"}),e&&a&&l.createElement(B,{label:"Your partner's information",spouse:e})):null};var Z=e=>{let{message:t,id:a}=e;return l.createElement("div",{className:"index-module--errorWrapper--8867a",id:a,role:"alert"},l.createElement(r.UtilIconInfo,{color:"dangerActive"}),l.createElement(r.UtilityText,{size:"xsmall",color:"maroon",className:"index-module--errorText--d922a"},t))},P="index-module--dobInput--13d56",R="index-module--errorContainer--6384b",q="index-module--input--72529",G="index-module--inputAndText--37530",Q="index-module--inputWrapper--b254b",V="index-module--label--b51a0",j="index-module--subtitle--2fe23",J="index-module--wrapper--8848d";const K=e=>e.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1");var X=()=>{const{ageOfYoungest:e,setAgeOfYoungest:t}=(0,l.useContext)(i),[a,n]=(0,l.useState)(!1),{trackEvent:o}=(0,g.rS)();return l.createElement("div",{className:J},l.createElement(r.LabelText,{as:"label",htmlFor:"age-of-youngest-child",size:"medium",className:V},"Age of youngest child"),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{name:"age_of_youngest_child",id:"age-of-youngest-child",className:q,value:null!=e?e:"",onChange:e=>{const a=K(e.target.value);n(+a>18),t(a)},onFocus:()=>{o({name:"Touched Input",input:"age-of-youngest-child",source:"coverage-calculator"})},maxLength:2,inputMode:"numeric","aria-describedby":a?"age-error":void 0,"aria-invalid":!!a||void 0})),a&&l.createElement("div",{className:R,id:"age-error"},l.createElement(Z,{message:"Please enter an age under 18"})),l.createElement("div",{className:"index-module--spacer--71ef5"})))};var ee=e=>{let{partner:t=!1}=e;const{setAnnualIncome:a,setSpouseAnnualIncome:n,annualIncome:o,spouseAnnualIncome:s}=(0,l.useContext)(i),c=s&&`$${(+s).toLocaleString("en-US")}`,u=o&&`$${(+o).toLocaleString("en-US")}`,{trackEvent:m}=(0,g.rS)(),d=t?"spouse_income":"income";return l.createElement("div",{className:J},l.createElement(r.LabelText,{as:"label",htmlFor:d,size:"medium",className:V},t?"Partner's annual income":"Annual income"),t?l.createElement(r.UtilityText,{size:"small",className:j},"If your spouse doesn't have income, leave this as $0. We'll recommend insurance that covers the cost of their contributions to the household, such as childcare."):l.createElement(r.UtilityText,{size:"small",className:j},"Your total annual salary and/or earnings, before taxes."),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{className:q,id:d,value:t?c||"":u||"",onChange:e=>{t?n(K(e.target.value)):a(K(e.target.value))},onFocus:e=>{m({name:"Touched Input",input:e.target.name,source:"coverage-calculator"})},maxLength:11,inputMode:"numeric",placeholder:"$",name:t?"spouse_annual_income":"annual_income"}),l.createElement("input",{type:"hidden",name:d,value:t?s||"":o||""}))))};var te=()=>{const{setTotalHouseHoldDebt:e,totalHouseHoldDebt:t}=(0,l.useContext)(i),[a,n]=(0,l.useState)(t),{trackEvent:o}=(0,g.rS)();return l.createElement("div",{className:J},l.createElement(r.LabelText,{as:"label",htmlFor:"debt",size:"medium",className:V},"Total household debt"),l.createElement(r.UtilityText,{size:"small",className:j},"Include all debts, such as mortgages, student loans, car loans, credit cards, etc."),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{name:"debt",id:"debt",className:q,value:a||"",onChange:t=>{const a=Number(K(t.target.value)),l=a?`$${a.toLocaleString("en-US")}`:"";n(l),e(K(t.target.value))},onFocus:()=>{o({name:"Touched Input",input:"debt",source:"coverage-calculator"})},maxLength:11,inputMode:"numeric",placeholder:"$"}))))};const ae=(e,t,a)=>e&&t&&a?`${e}-${t}-${a}`:"",le=(e,t)=>
1e?`spouse_dob_${t}`:`dob_${t}`;var ne=e=>{let{partner:t=!1}=e;const{age:a,spouseAge:o,dobMonth:s,dobDay:c,dobYear:u,spouseDobMonth:m,spouseDobDay:d,spouseDobYear:p,setDobMonth:v,setDobDay:h,setDobYear:b,setSpouseDobMonth:E,setSpouseDobDay:N,setSpouseDobYear:f}=(0,l.useContext)(i),[y,x]=(0,l.useState)(!1),{trackEvent:T}=(0,g.rS)(),C=a&&a<18,S=o&&o<18,w=e=>{T({name:"Touched Input",input:e.target.name,source:"coverage-calculator"})};return l.createElement("fieldset",{className:J},l.createElement(r.LabelText,{as:"legend",className:V},t?"Partner's date of birth":"Date of birth"),!t&&l.createElement(r.UtilityText,{size:"small",className:j},"Age is one of the many factors that determines your life insurance rates."),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{className:(0,n.Z)(q,P),value:(t?m:s)||"",placeholder:"MM",maxLength:2,onChange:e=>{var a;let l=K(e.target.value);+l>12&&(l="12"),(null===(a=e.target.value)||void 0===a?void 0:a.length)>1&&+l<1&&(l="01"),t?E(l):v(l)},onFocus:w,inputMode:"numeric",name:le(t,"month"),"aria-describedby":y||!t&&C||t&&S?"dob-error-"+(t?"spouse":"self"):void 0,"aria-invalid":!!(y||!t&&C||t&&S)||void 0}),l.createElement("input",{className:(0,n.Z)(q,P),value:(t?d:c)||"",placeholder:"DD",maxLength:2,onChange:e=>{var a;let l=K(e.target.value);+l>31&&(l="31"),(null===(a=e.target.value)||void 0===a?void 0:a.length)>1&&+l<1&&(l="01"),t?N(l):h(l)},onFocus:w,inputMode:"numeric",name:le(t,"day"),"aria-describedby":y||!t&&C||t&&S?"dob-error-"+(t?"spouse":"self"):void 0,"aria-invalid":!!(y||!t&&C||t&&S)||void 0}),l.createElement("input",{className:(0,n.Z)(q,P),value:(t?p:u)||"",placeholder:"YYYY",maxLength:4,onChange:e=>{var a;let l=K(e.target.value);4===(null===(a=e.target.value)||void 0===a?void 0:a.length)&&+l<1900&&(l="1900"),t?f(l):b(l)},onBlur:e=>{+K(e.target.value)<1900?(x(!0),console.error("invalid age",y)):x(!1)},onFocus:w,inputMode:"numeric",name:le(t,"year"),"aria-describedby":y||!t&&C||t&&S?"dob-error-"+(t?"spouse":"self"):void 0,"aria-invalid":!!(y||!t&&C||t&&S)||void 0}),l.createElement("input",{type:"hidden",name:"date_of_birth",value:ae(u,s,c)}),l.createElement("input",{type:"hidden",name:"spouse_date_of_birth",value:ae(p,m,d)})),(y||!t&&C||t&&S)&&l.createElement("div",{className:R,id:"dob-error-"+(t?"spouse":"self")},y&&l.createElement(Z,{message:"Enter in MM/DD/YYYY format"}),!t&&C&&l.createElement(Z,{message:"Age must be at least 18 years old"}),t&&S&&l.createElement(Z,{message:"Age must be at least 18 years old"}))))};var re=()=>{const{numberOfChildrenUnder18:e,setNumberOfChildrenUnder18:t}=(0,l.useContext)(i),{trackEvent:a}=(0,g.rS)();return l.createElement("div",{className:J},l.createElement(r.LabelText,{as:"label",htmlFor:"number-of-children",size:"medium",className:V},"Number of children under age 18"),l.createElement(r.UtilityText,{size:"small",className:j},"We'll take the number and ages of your children into account when calculating your coverage."),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{id:"number-of-children",className:q,name:"number_of_children",value:null!=e?e:"",onChange:e=>{t(K(e.target.value))},onFocus:()=>{a({name:"Touched Input",input:"number_of_children",source:"coverage-calculator"})},maxLength:2,inputMode:"numeric"}),null!==e&&l.createElement("input",{type:"hidden",name:"has_children",value:String("0"!==e)}))))};var oe=()=>{const{setTotalHouseHoldSavings:e,totalHouseHoldSavings:t}=(0,l.useContext)(i),[a,n]=(0,l.useState)(t),{trackEvent:o}=(0,g.rS)();return l.createElement("div",{className:J},l.createElement(r.LabelText,{as:"label",htmlFor:"savings",size:"medium",className:V},"Total household savings"),l.createElement(r.UtilityText,{size:"small",className:j},"Your total household liquid savings (i.e. the funds are accessible without taxes or other penalties whenever you need them)."),l.createElement("div",{className:G},l.createElement("div",{className:Q},l.createElement("input",{name:"savings",id:"savings",className:q,value:a||"",onChange:t=>
1{const a=Number(K(t.target.value)),l=a?`$${a.toLocaleString("en-US")}`:"";n(l),e(K(t.target.value))},onFocus:()=>{o({name:"Touched Input",input:"savings",source:"coverage-calculator"})},maxLength:11,inputMode:"numeric",placeholder:"$"}))))},se="index-module--input--7f1d5",ce="index-module--inputAndText--8899e",ue="index-module--inputWrapper--dde12",me="index-module--label--38f3e",ie="index-module--radioText--563fa",de="index-module--radioWrapper--81f88",ge="index-module--subtitle--f6c57";var pe=()=>{const{collegeCosts:e,setCollegeCosts:t}=(0,l.useContext)(i),{trackEvent:a}=(0,g.rS)(),n=e=>{t("true"===e.target.value)};return l.createElement("fieldset",{onFocus:()=>{a({name:"Touched Input",input:"college-costs",source:"coverage-calculator"})},className:"index-module--genderWrapper--8b64e"},l.createElement(r.LabelText,{as:"legend",className:me},"Do you want to include an additional amount to cover college costs?"),l.createElement(r.UtilityText,{size:"small",className:ge},"We'll add an amount per child that represents the average cost of a four-year degree."),l.createElement("div",{className:ce},l.createElement("div",{className:de},l.createElement("label",{className:ue},l.createElement("input",{type:"radio",name:"college-costs",className:se,value:"true",onChange:n,checked:!0===e}),l.createElement(r.UtilityText,{className:ie},"Yes")),l.createElement("label",{className:ue},l.createElement("input",{type:"radio",name:"college-costs",value:"false",className:se,onChange:n,checked:!1===e}),l.createElement(r.UtilityText,{className:ie},"No")))))};var ve=()=>{const{spouse:e,setSpouse:t}=(0,l.useContext)(i),{trackEvent:a}=(0,g.rS)(),n=e=>{"true"===e.target.value?t(!0):t(!1)};return l.createElement("fieldset",{onFocus:()=>{a({name:"Touched Input",input:"partner",source:"coverage-calculator"})},className:"index-module--wrapper--b7456"},l.createElement(r.LabelText,{as:"legend",className:me},"Do you have a spouse or partner?"),l.createElement(r.UtilityText,{size:"small",className:ge},"We can recommend a coverage amount for your partner, too."),l.createElement("div",{className:ce},l.createElement("div",{className:de},l.createElement("label",{className:ue},l.createElement("input",{type:"radio",value:"true",className:se,onChange:n,checked:!0===e}),l.createElement(r.UtilityText,{className:ie},"Yes")),l.createElement("label",{className:ue},l.createElement("input",{type:"radio",value:"false",className:se,onChange:n,checked:!1===e}),l.createElement(r.UtilityText,{className:ie},"No")))))},he="index-module--container--4bb5d",be="index-module--hr--2da45";var Ee=()=>{const{spouse:e,numberOfChildrenUnder18:t}=(0,l.useContext)(i);return l.createElement(l.Fragment,null,l.createElement("div",{className:"index-module--inputSection--c1313"},l.createElement(ne,null),l.createElement(ee,null),l.createElement("hr",{className:be}),l.createElement(ve,null),e&&l.createElement(l.Fragment,null,l.createElement(ne,{partner:!0}),l.createElement(ee,{partner:!0})),l.createElement("hr",{className:be}),l.createElement(re,null),!!Number(t)&&l.createElement(X,null),!!Number(t)&&l.createElement(pe,null),l.createElement("hr",{className:be}),l.createElement(te,null),l.createElement(oe,null),l.createElement("div",{className:"index-module--lockWrapper--8d7cf"},l.createElement("img",{className:"index-module--lock--9c00a",src:"/images/LockGray.svg",alt:"",width:12,height:15}),l.createElement(r.UtilityText,{size:"xsmall",className:"index-module--lockText--5d783"},"Your data security is our priority."))))},Ne=a(2722),fe="index-module--ctaText--ac188",ye="index-module--partnerResult--84215",xe="index-module--result--40292";const Te=e=>{let{label:t,value:a,className:r}=e;return l.createElement("div",{className:r},l.createElement("p",{className:(0,n.Z)(fe,"index-module--ctaLabel--17c8b")},t),l.createElement("p",{className:(0,n.Z)(fe,"index-module--ctaValue--ccb7c")},a))};var Ce=e=>{let{hidden:t}=e;const{age:a,term:r,spouseTerm:o,coverage:s,spouseCoverage:c,spouse:u,spouseAge:m,annualIncome:d,spouseAnnualIncome:p,numberOfChildrenUnder18:h,hasInfo:b,spouseHasInfo:E}=(0,l.useContext)(i),{trackEvent:N}=(0,g.rS)(),f=!b||Number(a)>=67||Number(s)<0||0===Number(d)&&0===Number(h),x=!E||Number(m)>=67||Number(c)<0||0===Number(p)&&0===Number(h);return l.createElement("div",{className:(0,n.Z)("index-module--container--ac010",{"index-module--hidden--196c8":t})},l.createElement("div",{className:(0,n.Z)("index-module--containerRow--34953",Ne.oI)},l.createElement("div",{className:"index-module--containerCol--8a070"},l.createElement("div",{className:"index-module--resultsContainer--8649d"},l.createElement(Te,{label:"Your term",value:f?"--":`${r} years`,className:xe}),l.createElement(Te,{label:"Your coverage",value:v({coverage:s}),className:xe}),u&&l.createElement(l.Fragment,null,l.createElement(Te,{label:"Your partner's term",value:x?"--":`${o} years`,className:(0,n.Z)(xe,ye)}),l.createElement(Te,{label:"Your partner's coverage",value:v({coverage:c}),className:(0,n.Z)(xe,ye)}))),l.createElement("button",{type:"submit",name:"cta_source",value:"sticky_cta",onClick:()=>{N({input:"cta",name:"Clicked Button",source:"coverage-calculator",triggered_from:"Sticky CTA"}),N({input:"cta",name:"Completed Widget",source:"coverage-calculator",age:a,coverage:s,policy_length:r})},className:(0,n.Z)(y.ou,y.bb,y.Lg)},"Get my quotes"))))};var Se=()=>{const[e,t]=(0,l.useState)(!1);let a="",r="";var o;"undefined"!=typeof window&&(a=null===(o=window.traits)||void 0===o?void 0:o.uuid,r
1=window.location.href);return(0,l.useEffect)((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{const a=e.target.getAttribute("data-intersection-id");"input-section"===a&&(e.isIntersecting?t(!0):e.boundingClientRect.top>0&&t(!1)),"coverage-section"===a&&(e.isIntersecting?t(!1):e.boundingClientRect.top>0&&t(!0))}))}),{root:null,threshold:0}),a=document.querySelector("[data-intersection-id='input-section']"),l=document.querySelector("[data-intersection-id='coverage-section']");e.observe(a),e.observe(l)}),[]),l.createElement(d,null,l.createElement("form",{action:"https://www.policygenius.com/calculator_preferences",target:"_blank",className:(0,n.Z)("index-module--background--cd6cc","calculator")},l.createElement("button",{type:"submit",disabled:!0,className:"index-module--hiddenSubmit--0c509","aria-hidden":"true"}),l.createElement("div",{className:Ne.oI,"data-intersection-id":"input-section"},l.createElement("div",{className:he},l.createElement(F,null),l.createElement(Ee,null),l.createElement("div",{className:"index-module--coverageSection--2b6f8","data-intersection-id":"coverage-section"},l.createElement(I,null),l.createElement(O,null)))),l.createElement("div",{className:Ne.oI},l.createElement("div",{className:he},l.createElement(M,null),l.createElement(U,null))),l.createElement("input",{type:"hidden",name:"uuid",value:a}),l.createElement("input",{type:"hidden",name:"source_path",value:r}),l.createElement(Ce,{hidden:!e})))}}}]);
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.