https://every-demo.vercel.app/_next/static/chunks/pages/v2/benefits/health-setup-6abe36232ef9d3b8.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4452],{12879:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/v2/benefits/health-setup",function(){return t(76062)}])},76062:function(e,n,t){"use strict";t.r(n),t.d(n,{SetupBenefitsWorkflow:function(){return U},default:function(){return G}});var i=t(52903),a=t(2784),l=t(97729),o=t.n(l),r=t(52955),d=t(37880),c=t(5632),s=t(33379),m=t(32955),u=t(96804),p=t(35082),h=t(38078),y=t(50296),f=t(24975);let{WorkflowStateProvider:v,useWorkflowState:k}=(0,h.zB)({shopBenefitsStep:{},companyDetailsStep:{},companyContributionStep:{}});var b=t(63955),g=t(33161),S=t(51015),N=t(42731),Z=t(53538);let _=Z.Ry({meetingScheduled:Z.O7().optional()});function w(){let{goToNextStep:e}=(0,h.DW)(),{update:n,data:t}=k(),a=(0,b.cI)({defaultValues:(null==t?void 0:t.shopBenefitsStep)||{},mode:"all",resolver:(0,g.F)(_)});return(0,i.tZ)(N.l0,{...a,children:(0,i.BX)("form",{onSubmit:a.handleSubmit(t=>{n(e=>{if(e)return e.shopBenefitsStep=t,e}),e()}),className:"w-full space-y-6",children:[(0,i.tZ)(y.KF,{children:"Shop Benefit Plans"}),(0,i.tZ)(y.s2,{children:"To shop for health plans, please schedule time with our team."}),(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Schedule a meeting with our team"}),(0,i.tZ)("div",{className:"mt-10 w-full",children:(0,i.tZ)(S.z,{type:"button",variant:"default",size:"default",onClick:()=>{window.open("https://calendly.com/terence-every/benefits-at-every","_blank")},children:"Book a time"})})]}),(0,i.tZ)(y.Jg,{className:"flex gap-2 justify-between space-y-0",children:(0,i.tZ)(S.z,{type:"submit",children:"Next"})})]})})}var P=t(24432),C=t(80603),V=t(23861);let B=Z.Ry({planStart:Z.Z_().min(1,"Plan start is required"),ceo:Z.Z_().min(1,"CEO is required"),insuranceCarrier:Z.Z_().optional().or(Z.i0("")).transform(e=>e||void 0),waitingPeriod:Z.Z_().min(1,"Waiting period is required")}),D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"V2_GetCompanyDetailsStepInfo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"companyId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_company_employee"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"company_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"companyId"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"end_date"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}},{kind:"ObjectField",name:{kind:"Name",value:"user"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"user_job_profile"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"employment_type"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_neq"},value:{kind:"EnumValue",value:"Contractor"}}]}}]}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_company_details"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"end_date"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"start_date"},value:{kind:"EnumValue",value:"desc"}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"employment_type"}}]}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"user_profile"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name_first"}},{kind:"Field",name:{kind:"Name",value:"name_last"}},{kind:"Field",name:{kind:"Name",value:"name_middle"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"company_details"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"company_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"companyId"}}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ceo_user_id"}},{kind:"Field",name:{kind:"Name",value:"company"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"company_details_billing"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"workers_comp"}}]}},{kind:"Field",name:{kind:"Name",value:"workplaces"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"primary_filing"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"BooleanValue",value:!0}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"address_state"}}]}}]}}]}}]}}]};var F=t(27669);let O=[{label:"1st month after hire date",value:"1st month after hire date"}];function E(e){let{setupYear:n=new Date().getFullYear()}=e,{currentCompany:t}=(0,d.flO)(),{goToNextStep:a}=(0,h.DW)(),{update:l,data:o}=k(),r=(0,b.cI)({defaultValues:(null==o?void 0:o.companyDetailsStep)||{},mode:"all",resolver:(0,g.F)(B)}),{setValue:c,watch:s}=r,{data:m}=(0,P.aM)(D,{variables:{companyId:t.id},onCompleted:e=>{var n,t,i,a,o,r,d,s;let m=null===(i=e.company_details)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:null===(n=t.company.company_details_billing)||void 0===n?void 0:n.workers_comp,u=null===(a=e.company_details)||void 0===a?void 0:a[0].ceo_user_id,p=null===(s=e.company_details)||void 0===s?void 0:null===(d=s[0])||void 0===d?void 0:null===(r=d.company.workplaces)||void 0===r?void 0:null===(o=r[0])||void 0===o?void 0:o.address_state;m&&c("insuranceCarrier",m),u&&c("ceo",u),p&&l(e=>{if(e)return e.companyState=p,e})}}),u=(0,F.A3)(n),p=((null==m?void 0:m.user_company_employee)||[]).map(e=>{var n;let t=null==e?void 0:null===(n=e.user)||void 0===n?void 0:n.user_profile;return{label:(t?[t.name_first,t.name_middle,t.name_last].filter(
1Boolean).join(" "):null)||"No name found (".concat(e.user.id,")"),value:e.user.id}}),f=3>(0,C.p)(new Date,new V.eJ(s("planStart")));return(0,i.tZ)(N.l0,{...r,children:(0,i.BX)("form",{onSubmit:r.handleSubmit(e=>{l(n=>{if(n)return n.companyDetailsStep=e,n}),a()}),className:"w-full space-y-6",children:[(0,i.tZ)(y.KF,{children:"Setup Health, Dental and Vision Benefits"}),(0,i.tZ)(y.s2,{children:"Submit by month-end for coverage starting the 1st of the next month. While your coverage will be effective from that date, please note that carriers typically need 2-3 weeks to process your application. During this processing period, you may need to pay out-of-pocket and submit claims for reimbursement later."}),(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"When would you like this plan to start?"}),(0,i.tZ)(y.W9,{label:"Plan Start Date",name:"planStart",control:r.control,options:u,placeholder:"Select plan start date",description:f?(0,i.BX)("div",{className:"text-primary",children:[(0,i.tZ)("p",{children:"- Approval of application may come after effective date"}),(0,i.tZ)("p",{children:"- If supporting documents for application not submitted in time, then effective date could get pushed"})]}):"Your application must be submitted by the last day of the previous month you selected.",descriptionPosition:"bottom"})]}),(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Who is the current CEO?"}),(0,i.tZ)(y.W9,{label:"CEO",name:"ceo",control:r.control,options:p,placeholder:"Select CEO"})]}),(0,i.BX)(y.Jg,{children:[(0,i.BX)(y.Ny,{children:["Unless you are an owner-only group, you will need workers compensation to qualify for a plan. If you don't have it, please purchase it"," ",(0,i.tZ)("a",{href:"https://www.coverdash.com/p/every/startup",target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-lg underline",children:"here."})]}),(0,i.tZ)(y.Wr,{label:"Worker's Compensation Insurance Carrier",name:"insuranceCarrier",control:r.control,placeholder:"Enter insurance carrier name"})]}),(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"How long does an employee have to wait after they are hired before being eligible for benefits?"}),(0,i.tZ)(y.W9,{label:"Waiting Period",name:"waitingPeriod",control:r.control,options:O,placeholder:"Select waiting period"})]}),(0,i.tZ)(y.Jg,{className:"flex gap-2 justify-between space-y-0",children:(0,i.tZ)(S.z,{type:"submit",children:"Next"})})]})})}var j=t(42855);let T=Z.dj(e=>{if(""!==e&&null!=e){if("string"==typeof e){let n=parseFloat(e);return isNaN(n)?void 0:n}return e}},Z.Rx({required_error:"This field is required",invalid_type_error:"This field is required"}).min(50,"Must be at least 50%").max(100,"Must be at most 100%"));Z.Ry({coverType:Z.Z_().min(1,"Company cover type is required"),healthEmployeePercentage:Z.Rx().optional(),healthDependentPercentage:Z.Rx().optional(),dentalVisionEmployeePercentage:Z.Rx().optional(),dentalVisionDependentPercentage:Z.Rx().optional(),soi:j.V5.ZodSchema().optional(),hasCaliforniaWorkplace:Z.O7().optional()});let W=Z.Ry({coverType:Z.i0("percentage"),healthEmployeePercentage:T,healthDependentPercentage:T,dentalVisionEmployeePercentage:T,dentalVisionDependentPercentage:T,soi:j.V5.ZodSchema().optional()}),X=Z.Ry({coverType:Z.i0("base_plan"),healthEmployeePercentage:T,healthDependentPercentage:T,dentalVisionEmployeePercentage:T,dentalVisionDependentPercentage:T,soi:j.V5.ZodSchema().optional()}),x=Z.VK("coverType",[W,X]),J=e=>{if(e){let e=j.V5.ZodSchema({required:!0,message:"Statement of Information is required for California companies"}),n=W.extend({soi:e}),t=X.extend({soi:e});return Z.VK("coverType",[n,t])}return x};var I=t(59475);let R=[{label:"Percentage",value:"percentage"},{label:"Base Plan",value:"base_plan"}];function q(e){let{onSaveFn:n}=e,{goToNextStep:t}=(0,h.DW)(),{update:l,data:o}=k(),[d,c]=(0,a.useState)(!1),[s,m]=(0,a.useState)(null),u=(null==o?void 0:o.companyState)==="CA",p=(0,a.useMemo)(()=>J(u),[u]),f=(0,b.cI)({defaultValues:(null==o?void 0:o.companyContributionStep)||{},mode:"all",resolver:(0,g.F)(p)}),{watch:v}=f,Z=async e=>{if(l(n=>{if(n)return n.companyContributionStep=e,n}),n){c(!0),m(null);try{let t={...o,companyContributionStep:e};await n(t)}catch(e){console.error("Error saving benefits setup:",e),m(e instanceof Error?e.message:"Error saving benefits setup")}finally{c(!1)}}else t()},_=v("coverType");return(0,i.tZ)(N.l0,{...f,children:(0,i.BX)("form",{onSubmit:f.handleSubmit(Z),className:"w-full space-y-6",children:[(0,i.tZ)(y.KF,{children:"How much will your company contribute?"}),(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Cover Type"}),(0,i.tZ)(y.W9,{label:"How would you like to contribute?",name:"coverType",control:f.control,options:R,placeholder:"Select cover type"})]}),"percentage"===_&&(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Health Percentage Contribution"}),(0,i.BX)("div",{className:"space-y-4",children:[(0,i.tZ)(y.Wr,{label:"Percentage of Costs for Employee (%)",name:"healthEmployeePercentage",type:"number",control:f.control,placeholder:"95",description:"The percentage of health costs the company will pay for an employee. Recommended: 95%",descriptionPosition:"bottom"}),(0,i.tZ)(y.Wr,{label:"Percentage of Costs for Employee's Dependents (%)",name:"healthDependentPercentage",type:"number",control:f.control,placeholder:"75",description:"The percentage of health costs the company will pay for each depen
1dent of an employee. Recommended: 75%",descriptionPosition:"bottom"})]})]}),"base_plan"===_&&(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Base Plan Percentage Contribution"}),(0,i.BX)("div",{className:"space-y-4",children:[(0,i.tZ)(y.Wr,{label:"Percentage of base plan premium paid for the employee (%)",name:"healthEmployeePercentage",type:"number",control:f.control,placeholder:"100",description:"The percentage of the base plan health insurance costs the company will pay for an employee.",descriptionPosition:"bottom"}),(0,i.tZ)(y.Wr,{label:"Percentage of base plan premium paid for dependents (%)",name:"healthDependentPercentage",type:"number",control:f.control,placeholder:"0",description:"The percentage of the base plan healthcare costs the company will pay for each dependent of an employee.",descriptionPosition:"bottom"})]})]}),("percentage"===_||"base_plan"===_)&&(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Dental and Vision Percentage Contribution"}),(0,i.BX)("div",{className:"space-y-4",children:[(0,i.tZ)(y.Wr,{label:"Percentage of Costs for Employee (%)",name:"dentalVisionEmployeePercentage",type:"number",control:f.control,placeholder:"95",description:"The percentage of dental and vision costs the company will pay for an employee. Recommended: 95%",descriptionPosition:"bottom"}),(0,i.tZ)(y.Wr,{label:"Percentage of Costs for Employee's Dependents (%)",name:"dentalVisionDependentPercentage",type:"number",control:f.control,placeholder:"75",description:"The percentage of dental and vision costs the company will pay for each dependent of an employee. Recommended: 75%",descriptionPosition:"bottom"})]})]}),u&&(0,i.BX)(y.Jg,{children:[(0,i.tZ)(y.Ny,{children:"Statement of Information"}),(0,i.tZ)(y.Uo,{name:"soi",control:f.control,description:"Upload your Statement of Information document as required for California companies.",accept:".pdf,.doc,.docx,.png,.jpg,.jpeg",label:"Upload SOI Document",documentType:I.ECG.SOI,documentOwner:r.cyM.Company})]}),(0,i.tZ)(y.Jg,{className:"flex gap-2 justify-between space-y-0",children:(0,i.tZ)(S.z,{type:"submit",disabled:d,className:d?"opacity-50":"",children:d?"Saving...":n?"Complete Setup":"Next"})}),s&&(0,i.tZ)("p",{className:"text-[0.8rem] font-medium text-error mt-2",role:"alert",children:s})]})})}let A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"V2_SetupHealthBenefitPolicy"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"setupConfig"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SetupHealthBenefitPolicyInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"SetupHealthBenefitPolicy"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"setupConfig"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"policyIds"}}]}}]}}]},H=e=>{let{onSaveFn:n}=e,{goToNextStep:t}=(0,h.DW)(),a=async e=>{await n(e),t()};return(0,i.tZ)(q,{onSaveFn:a})};function z(e){let{error:n}=e,{resetBoundary:t}=(0,m.cO)(),a=(0,c.useRouter)(),l=(null==n?void 0:n.message)||"We encountered an error while setting up your benefits.";return(0,i.BX)(y.UT,{children:[(0,i.tZ)(y.pm,{type:"failure"}),(0,i.tZ)(y.tM,{children:"Benefits setup failed!"}),(0,i.tZ)(y.h8,{children:l}),(0,i.BX)(y.Ex,{children:[(0,i.tZ)(y.Ms,{onClick:t,children:"Try again"}),(0,i.tZ)(y.Ey,{onClick:()=>a.push("/v2/benefits"),children:"Back to Benefits"})]})]})}let K=()=>{let e=(0,c.useRouter)(),{currentCompany:n}=(0,d.flO)(),[t,l]=(0,a.useState)(!1),o=(0,u.S)(new Date),[r]=(0,s.D)(A,{refetchQueries:[d.r3m,d.JTE,p.u]}),m=async e=>{if(!t){l(!0);try{var i;let t={coverType:e.companyContributionStep.coverType,soiFilePath:null===(i=e.companyContributionStep.soi)||void 0===i?void 0:i.filePath};void 0!==e.companyContributionStep.healthEmployeePercentage&&(t.healthEmployeePercentage=e.companyContributionStep.healthEmployeePercentage),void 0!==e.companyContributionStep.healthDependentPercentage&&(t.healthDependentPercentage=e.companyContributionStep.healthDependentPercentage),void 0!==e.companyContributionStep.dentalVisionEmployeePercentage&&(t.dentalVisionEmployeePercentage=e.companyContributionStep.dentalVisionEmployeePercentage),void 0!==e.companyContributionStep.dentalVisionDependentPercentage&&(t.dentalVisionDependentPercentage=e.companyContributionStep.dentalVisionDependentPercentage),await r({variables:{setupConfig:{companyId:n.id,year:o,companyDetails:{planStart:e.companyDetailsStep.planStart,ceo:e.companyDetailsStep.ceo,insuranceCarrier:e.companyDetailsStep.insuranceCarrier,waitingPeriod:e.companyDetailsStep.waitingPeriod},companyContribution:t,payrollRan:{hasRanPayroll:!1}}}}),l(!1);return}catch(e){throw console.error("Setup benefits error:",e),l(!1),e}}};return(0,i.BX)(h.bt,{onClose:()=>e.push("/v2/benefits"),children:[(0,i.tZ)(h._G,{onWorkflowClose:()=>e.push("/v2/benefits")}),(0,i.BX)(h.xU,{children:[(0,i.tZ)(h.JJ,{label:"Shop Plans",children:(0,i.tZ)(w,{})}),(0,i.tZ)(h.JJ,{label:"Company Details",children:(0,i.tZ)(E,{setupYear:o})}),(0,i.tZ)(h.JJ,{label:"Coverage & Costs",children:(0,i.tZ)(H,{onSaveFn:m})}),(0,i.tZ)(h.JJ,{children:(0,i.tZ)("div",{className:"flex-1 flex items-center justify-center w-full min-h-[60vh]",children:(0,i.tZ)(f.C,{})})})]})]})},M=()=>(0,i.tZ)(m.SV,{FallbackComponent:z,children:(0,i.tZ)(v,{children:(0,i.tZ)(K,{})})}),U=()=>(0,i.BX)(a.Fragment,{children:[(0,i.tZ)(d.pbF,{redirectTo:"/v2/benefits",roles:[r.P8B.Owner,r.P8B.Accountant,r.P8B.Hr]}),(0,i.tZ)(o(),{children:(0,i.tZ)("title",{children:"Setup Health Benefits - Every"})}),(0,i.tZ)(M,{})]});U.Layout=e=>{let{children:n}=e;return n};var G=U},24975:function(e,n,t){"use strict";t.d(n,{C:function(){return r}});
1var i=t(52903),a=t(51015),l=t(39922),o=t(5632);let r=()=>{let e=(0,o.useRouter)();return(0,i.BX)(l.LZ,{className:"max-w-md",children:[(0,i.tZ)(l.by,{src:"/static/images/not-setup/benefits.png",width:128,height:128,alt:"Benefits setup illustration",className:"mb-4"}),(0,i.tZ)(l.fF,{className:"font-headline text-lg font-medium leading-none",children:"We're setting up your benefits"}),(0,i.tZ)(l.Ko,{className:"mt-2 leading-[1.5]",children:"We're putting the finishing touches on your benefit plans and getting everything ready in Every. Once we're done, open enrollment will kick off and we'll let you and your team know it's time to choose your plans."}),(0,i.BX)(l.Ko,{className:"mt-2 leading-[1.5]",children:["Questions?",(0,i.tZ)("br",{}),"Reach out to"," ",(0,i.tZ)("a",{href:"mailto:[email protected]",className:"underline",children:"[email protected]"})]}),(0,i.tZ)(a.z,{className:"mt-6",onClick:()=>{e.push("/v2/benefits")},children:"Back to Benefits"})]})}}},function(e){e.O(0,[3955,558,5478,3676,2249,2107,7413,3625,6803,737,906,2855,296,8078,3113,2888,9774,179],function(){return e(e.s=12879)}),_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.