PageSourceSearch

https://www.hellofresh.co.nz/_next/static/chunks/56222-ce0f05a78cbfaccc.js

js hellofresh.co.nz collected 2026-09-26 10:57:17 UTC 378,326 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56222],{190174:function(e,n,t){t.d(n,{x:function(){return p}});var r,o,i=t(456552),a=t(671718),l=t(447178),u=t(699219),s=t(140224);function c(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var f=(r=function(e,n){var t,r=arguments;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){switch(o.label){case 0:return[4,(r.length>2&&void 0!==r[2]?r[2]:a.Z)("/api/plans",n,{method:"GET",query:{includeCanceled:null!==(t=null==e?void 0:e.includeCanceled)&&void 0!==t&&t},parentSpan:null==e?void 0:e.parentSpan,headers:{"Content-Type":"application/json"}})];case 1:return[2,o.sent().json()]}})},o=function(){var e=this,n=arguments;return new Promise(function(t,o){var i=r.apply(e,n);function a(e){c(i,t,o,a,l,"next",e)}function l(e){c(i,t,o,a,l,"throw",e)}a(void 0)})},function(e,n){return o.apply(this,arguments)}),p=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(0,l.Z)().fetch,r=(0,s.O)(),o=[u.Z["customer-plans.get"],e];return(0,i.useQuery)(o,function(){return f(d({},e,r),o,t)},d({suspense:!1},n))}},777843:function(e,n,t){t.d(n,{z:function(){return f}});var r,o,i=t(456552),a=t(671718),l=t(447178),u=t(699219),s=t(140224);function c(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}var d=(r=function(e,n){var t=arguments;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(r){switch(r.label){case 0:return[4,(t.length>2&&void 0!==t[2]?t[2]:a.Z)("/questionnaire/surveys/".concat(e.survey_id,"/translations/").concat(e.version),n,{method:"GET",headers:{"Content-Type":"application/json"},query:{locale:e.locale,brand:e.brand}})];case 1:return[2,r.sent().json()]}})},o=function(){var e=this,n=arguments;return new Promise(function(t,o){var i=r.apply(e,n);function a(e){c(i,t,o,a,l,"next",e)}function l(e){c(i,t,o,a,l,"throw",e)}a(void 0)})},function(e,n){return o.apply(this,arguments)}),f=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{suspense:!1},t=(0,l.Z)().fetch,r=(0,s.O)(),o={brand:r.systemCountry,locale:r.locale,survey_id:null==e?void 0:e.survey_id,version:null==e?void 0:e.version},a=[u.Z["questionnaire.survey-translation"],o];return(0,i.useQuery)(a,function(){return d(o,a,t)},n)}}
1,971584:function(e,n,t){t.d(n,{Z:function(){return y}});var r=t(687800);t(827378);var o=t(184883),i=t(602307),a=t(318066),l=t(277425),u=t(553911),s=t(768587),c=t(428637),d=t(164528),f=t(66077),p={addOnValue:0,addOnsPerWeek:0,overrides:[{systemCountry:t(26730).Z.FJ,values:{addOnValue:4,addOnsPerWeek:2}}]},v=(0,f.Z)("free-for-multi-week-banner-feature-config",p).useConfig,h=function(e){var n=e.numberOfWeeks,t=e.backgroundImageUrl,o=v(),i=o.addOnValue,f=o.addOnsPerWeek,p=(0,d.ZP)("funnel").translateRaw,h=i*f*n,y=p("funnel.benefitsTest.ffmwBanner.plans.title",{addOnsPerWeek:f}),m=p("funnel.benefitsTest.ffmwBanner.plans.subtitle",{savingsValue:h,weeks:n}),b=p("funnel.benefitsTest.ffmwBanner.plans.savings.text",{savingsValue:h});return h<=0?null:(0,r.BX)(s.xu,{display:"flex",borderColor:"neutral.300",borderWidth:1,borderRadius:"global.md",borderStyle:"solid",width:[343,383],height:[96,123],children:[(0,r.tZ)(s.xu,{position:"relative",width:140,children:(0,r.tZ)(a.ZP,{src:(0,l.Z)(t),fill:!0,alt:p("funnel.benefitsTest.ffmwBanner.plans.image.alt"),style:{objectFit:"cover"}})}),(0,r.BX)(s.xu,{display:"flex",flexDirection:"column",paddingY:["global.xxs","global.xs"],paddingX:["global.xs","global.md-1"],alignItems:"flex-start",children:[(0,r.tZ)(s.xv,{type:["body-md-bold","body-lg-bold"],children:y}),(0,r.BX)(s.xu,{display:"flex",textAlign:"left",marginBottom:["global.xxs","global.xs"],children:[(0,r.tZ)(s.xu,{marginRight:"global.xxs",children:(0,r.tZ)(c.Z,{})}),(0,r.tZ)(s.xv,{as:"p",type:["body-xs-regular","body-sm-regular"],children:m})]}),(0,r.tZ)(s.xv,{color:"error.600",type:"body-md-bold",children:(0,r.tZ)(u.Z,{hasMarkdown:!0,copy:b})})]})]})},y=function(e){var n=e.numberOfWeeks,t=e.backgroundImageUrl;return n<=0?null:(0,r.tZ)(i.Z,{claim:{name:"activations-rte",githubTeam:"hellofresh/activations-rte",tribe:"conversions",alliance:"growth",jiraPrefix:"USCRO",slackChannel:"#squad-curation",slackAlertsChannel:"#squad-curation",skipLabelsOnPR:!1,teamIdentifier:"activations-rte"},children:(0,r.tZ)(o.Z,{scope:"free-for-multi-week-banner-feature",fallback:(0,r.tZ)(r.HY,{}),children:(0,r.tZ)(h,{backgroundImageUrl:t,numberOfWeeks:n})})})}},638773:function(e,n,t){function r(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}t.d(n,{Hu:function(){return a},Rs:function(){return u},wU:function(){return l}});var o,i=(0,t(575085).Z)("order-review-feature-config",(o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:return[4,t.e(83809).then(t.bind(t,683809))];case 1:return[2,e.sent()]}})},function(){var e=this,n=arguments;return new Promise(function(t,i){var a=o.apply(e,n);function l(e){r(a,t,i,l,u,"next",e)}function u(e){r(a,t,i,l,u,"throw",e)}l(void 0)})})),a=i.ProjectConfigProvider,l=i.configMiddleware,u=i.useConfig},809197:function(e,n,t){t.d(n,{p:function(){return r}});var r=function(){try{return!!(window.ApplePaySession&&ApplePaySession.canMakePayments())}catch(e){return!1}}},921318:function(e,n,t){t.d(n,{Bc:function(){return h},qC:function(){return v},yS:function(){return p}});var r=t(156006),o=t(581340),i=t(285087),a=t(647220),l=function(e){var n=(0,i.l)();if(!(0,a.e)())return null;try{var t=n.getItem("hf_cross_page_experiment_decisions");if(!t)return null;var r=e.find(function(e){return t[e]});return r?t[r]:null}catch(e){return null}},u=function(e,n){if(!e||!n)return null;var t=n.find(function(n){return e[n]});return t?e[t].variationKey:null},s=t(734835),c=t(744335);function d(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var f=["ccomms-351-influencers-ad-continuity","ccomms-1039-value-props-ad-progression"],p=function(e,n){var t=(0,o.t)(),i=(0,r.i)().getSlotConfig(e,t),a=i.isEnabled,l=i.content,p=(0,s.Sl)(),v=p.setSlotAccessAttributes,h=p.setSlotCommSpanAttributes,y=u((n||{}).publicExperimentDecisions,f);h(d({},c.Xk.EXPERIMENT_DECISION,(0,c.YF)(y||void 0)));var m=(0,c.PO)(l);
1return(v(e,(0,c.WN)(l,a),m),"control"===y)?n:a&&Object.keys(l).length>0?function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){d(e,n,t[n])})}return e}({},n,l):n},v=function(e){var n=(0,o.t)(),t=(0,r.i)().getSlotConfig(e,n),i=t.isEnabled,a=t.content,u=(0,s.Sl)(),p=u.setSlotAccessAttributes,v=u.setSlotCommSpanAttributes,h=l(f);v(d({},c.Xk.EXPERIMENT_DECISION,(0,c.YF)(h||void 0)));var y=(0,c.PO)(a);return(p(e,(0,c.WN)(a,i),y),"control"===h)?{isEnabled:!1,content:{}}:{isEnabled:i,content:a}},h=function(e){var n=(0,o.t)(),t=(0,r.i)().getSlotConfig(e,n).content,i=(0,s.Sl)().setSlotAccessAttributes,a=(0,c.PO)(t);return i(e,!!a,a),{campaignId:a||""}}},375745:function(e,n,t){t.d(n,{m:function(){return i}});var r=t(718583);function o(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}function i(e,n){return a.apply(this,arguments)}function a(){var e;return e=function(e,n){var t,o,i,a,l,u,s,c;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(d){switch(d.label){case 0:if(!(null===(o=window)||void 0===o?void 0:null===(t=o.crypto)||void 0===t?void 0:t.subtle)||"function"!=typeof window.crypto.getRandomValues)return[2];d.label=1;case 1:return d.trys.push([1,4,,5]),i=function(e){for(var n=window.atob(e),t=n.length,r=new Uint8Array(t),o=0;o<t;o++)r[o]=n.charCodeAt(o);return r}(n),a=window.crypto.getRandomValues(new Uint8Array(16)),l=function(e,n){var t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e);for(var o=e.length;o<r.length;o++)r[o]=t;return r}(new TextEncoder().encode(e),0),[4,window.crypto.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt"])];case 2:return u=d.sent(),[4,window.crypto.subtle.encrypt({name:"AES-CBC",iv:a},u,l)];case 3:s=d.sent(),(c=new Uint8Array(a.byteLength+s.byteLength)).set(a),c.set(new Uint8Array(s),a.byteLength);try{r.ZP.setItem("encryptedZipcode",function(e){for(var n="",t=0;t<e.byteLength;t++)n+=String.fromCharCode(e[t]);return window.btoa(n)}(c))}catch(e){console.error("Error while setting encrypted zipcode in local storage",e)}return[3,5];case 4:return console.error("Error while encrypting zipcode",d.sent()),[3,5];case 5:return[2]}})},(a=function(){var n=this,t=arguments;return new Promise(function(r,i){var a=e.apply(n,t);function l(e){o(a,r,i,l,u,"next",e)}function u(e){o(a,r,i,l,u,"throw",e)}l(void 0)})}).apply(this,arguments)}},860270:function(e,n,t){var r={preferences:[],overrides:[{systemCountry:t(26730).Z.FJ,values:{preferences:[{handle:"keto",subpreferences:[{handle:"keto--nonspicy",dietType:"nonspicy"}]},{handle:"caloriesmart",subpreferences:[{handle:"caloriesmart--nonspicy",dietType:"nonspicy"}]},{handle:"proteinplus",subpreferences:[{handle:"proteinplus--porkfree",dietType:"porkfree"},{handle:"proteinplus--nonspicy",dietType:"nonspicy"}]},{handle:"chefschoice",subpreferences:[{handle:"chefschoice--porkfree",dietType:"porkfree"},{handle:"chefschoice--nonspicy",dietType:"nonspicy"}]},{handle:"flexitarian",subpreferences:[]},{handle:"veganvegetarian",subpreferences:[]}]}}]};n.Z=r},376099:function(e,n,t){t.d(n,{P:function(){return i}});var r=t(66077),o=t(860270),i=(0,r.Z)("hf.plan-personalization-config",o.Z).useConfig},307495:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(736026),o=t(66077),i=t(26730),a={chargeAtCheckoutConfig:{enabled:!1},overrides:[{systemCountry:[i.Z.AT,i.Z.AU,i.Z.CA,i.Z.CH,i.Z.GB,i.Z.IE,i.Z.NZ,i.Z.US,i.Z.YE,i.Z.GN,i.Z.CF],values:{chargeAtCheckoutConfig:{enabled:!0,channel:["directsales","leadsgeneration"]}}},{systemCountry:[i.Z.BE,i.Z.DE,i.Z.DK,i.Z.NO,i.Z.NL,i.Z.SE],values:{chargeAtCheckoutConfig:{enabled:!0,channel:["directsales"]}}}]},l=(0,o.Z)("operations.charge-at-checkout.config",a).useConfig,u=function(e){var n,t,o=e.voucherCode,i=l().chargeAtCheckoutConfig,a=!!o,u=(0,r.D)({code:o},{suspense:!1,enabled:a}),s=u.data,c=u.isFetched,d=u.isError;if(a&&d)return{isChargeableVoucher:!1,isFetched:!0,hasVoucherCode:!0,isError:!0};if(!a)return{isChargeableVoucher:!1,isFetched:!0,hasVoucherCode:!1,isError:!1};var f=null!==(t=null==s?void 0:null===(n=s.channel)||void 0===n?void 0:n.replace(/[^A-Z0-9]/gi,"").toLowerCase())&&void 0!==t?t:"",p=i.enabled,v=i.channel,h=(null==v?void 0:v.indexOf(f))!==-1;return{isChargeableVoucher:p&&h,isFetched:c,hasVoucherCode:!0,isError:!1}},s=function(e){var n=e.isSeasonalFlow,t=e.isGiftCardBuyer;return{isEligible:!(n||t)}},c=function(e){var n=e.voucherCode,t=s({isSeasonalFlow:e.isSeasonalFlow,isGiftCardBuyer:e.isGiftCardBuyer}).isEligible,r=u({voucherCode:n}),o=r.isChargeableVoucher,i=r.isFetched,a=r.hasVoucherCode,l=r.isError;return t?!i||a&&l?{shouldPerformCharge:!1,isReady:!1}:{shouldPerformCharge:o,isReady:!0}:{shouldPerformCharge:!1,isReady:!0}}},70258:function(e,n,t){var r=t(567921),o=t.n(r),i=t(435172),a=t(695743);n.Z=function(){var e,n,t,r,l=(0,a.z)("website").data,u=(null==l?void 0:null===(e=l.checkout)||void 0===e?void 0:e.seasonalProductSkus)||[],s=o().get("hf_cart_id")||"",c=(0,i.P)({id:s},{enabled:!!s,suspense:!1}).data;return{isSeasonalFlow:!!((null!==(r=null==c?void 0:null===(n=c.items)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>0&&(null==c?void 0:null===(t=c.items)||void 0===t?void 0:t.every(function(e){return u.includes(e.sku)})))}}},95834:function(e,n,t){t.d(n,{$:function(){return y}});var r=t(827378),o=t(581340),i=t(468891),a=t(43011),l=t(566838),u=t(681335),s=t(953137),c=t(190174),d=t(463171),f="plans-4848_consumer-core_subscription-endpoint_use-plans-api",p=function(){var e=(0,d.Z)(f).isEnabled,n=(0,u.kH)({},{suspense:!1,enabled:e}),t=n.data,r=n.isFetched,o=e&&r&&!!(null==t?void 0:t.planCreationAllowed)&&(null==t?void 0:t.redirect)==null,i=(0,c.x)({includeCanceled:!0},{enabled:o,suspense:!1}),a=i.data;return{isPlanCreationAllowedWithoutRedirect:o,isPlansFetched:i.isFetched,areAllPlansCancelled:!!(null==a?void 0:a.length)&&a.every(function(e){return!!e.canceledAt})}},v=function(){var e,n=(0,d.Z)(f).isEnabled,t=(0,u.kH)({},{suspense:!1,enabled:n}),r=t.data,o=t.isError,i=p(),a=i.isPlanCreationAllowedWithoutRedirect,l=i.isPlansFetched,c=i.areAllPlansCancelled,v=(0,s.u)({},{suspense:!1,enabled:!n}).data;if(n)return!o&&(a?!!l&&c:(null==r?void 0:r.redirect)==="reactivation");var h=(null==v?void 0:null===(e=v.items)||void 0===e?void 0:e.filter(function(e){var n,t,r,o,i;return(null===(t=e.productType)||void 0===t?void 0:null===(n=t.specs)||void 0===n?void 0:n.recurrency)===0&&(null===(i=e.productType)||void 0===i?void 0:null===(o=i.family)||void 0===o?void 0:null===(r=o.tags)||void 0===r?void 0:r.includes("is_mealbox"))}))||[];return h.length>0&&(null==h?void 0:h.every(function(e){return null==e?void 0:e.canceledAt}))},h=function(){var e=(0,d.Z)(f).isEnabled,n=(0,u.kH)({},{suspense:!1,enabled:e}),t=n.data,r=n.isError,o=p(),i=o.isPlanCreationAllowedWithoutRedirect,a=o.isPlansFetched,l=o.areAllPlansCancelled,c=(0,s.u)({},{suspense:!1,enabled:!e}).data;return e?!!r||(i?!!a&&l:(null==t||!t.planCreationAllowed)&&((null==t?void 0:t.redirect)==="home"||(null==t?void 0:t.redirect)==="reactivation")):(null==c?void 0:c.items.find(function(e){var n,t,r,o,i;return(null===(t=e.productType)||void 0===t?void 0:null===(n=t.specs)||void 0===n?void 0:n.recurrency)===0&&(null===(i=e.productType)||void 0===i?void 0:null===(o=i.family)||void 0===o?void 0:null===(r=o.tags)||void 0===r?void 0:r.includes("is_mealbox"))}))||!1},y=function(e){var n=e.signedInRedirectUrl,t=e.reactivationRedirectUrl,u=e.checkForGiftCardRedemption,s=(0,o.t)(),c=(0,a.Z)(),d=(0,l.Z)(),f=h(),p=n&&t&&c&&f&&!(u&&d),y=v(),m=i.stringify(s.query)?"?".concat(i.stringify(s.query)):"";return(0,r.useEffect)(function(){p&&(y?s.push(t+m):s.push(n+m))},[p,y,m,s,t,n]),null}},732078:function(e,n,t){var r=t(827378),o=t(72065),i=t(783244),a=t(865489),l=t(799146),u=t(256130);function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}n.Z=function(e){var n,t=e.productHandles,c=e.couponCode,d=(0,r.useMemo)(function(){return null==t?void 0:t.map(function(e){return e})},[t]),f=(function(e){if(Array.isArray(e))return e}(n=(0,i.Z)("hf_prefill_zipcode"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,n){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}
1(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],p=(0,l.B)(u.d.ACTIVATION_SUBSCRIPTION),v=(0,o.RA)(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({voucherCode:c||"",productIds:d||[]},f&&{zipCode:f},p&&{headers:p}),{suspense:!1,enabled:!!d}).data;return(0,a.rK)(v)}},279810:function(e,n,t){function r(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}t.d(n,{kY:function(){return l},x2:function(){return a}});var o,i=(0,t(575085).Z)("hf.funnel.plans.plansWidget",(o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return[2,t.e(43289).then(t.bind(t,943289))]})},function(){var e=this,n=arguments;return new Promise(function(t,i){var a=o.apply(e,n);function l(e){r(a,t,i,l,u,"next",e)}function u(e){r(a,t,i,l,u,"throw",e)}l(void 0)})})),a=i.ProjectConfigProvider,l=(i.configMiddleware,i.useConfig)},502814:function(e,n,t){t.d(n,{f:function(){return a}});var r=t(237947),o=t(567921),i=t.n(o),a=function(e){var n=(null!=e?e:{}).isWebConfigEnabled,t=(0,r.o)(),o=i().get("hf_ssr_e_gift_card_purchase");return"1"===t.hf_ssr_e_gift_card_purchase||"1"===o?{isEnabled:!1,isLoading:!1,source:"gift-card-fallback"}:{isEnabled:!!n,isLoading:!1,source:n?"web-config":"error"}}},566838:function(e,n,t){var r=t(567921),o=t.n(r),i=t(827378);n.Z=function(){return(0,i.useMemo)(function(){try{return"1"===o().get("hf_ssr_e_gift_card_checkout")}catch(e){return!1}},[])}},956222:function(e,n,t){t.d(n,{Z:function(){return oW}});var r,o,i=t(687800),a=t(827378),l=t(929651),u=t(602307),s=t(184883),c=t(647220),d=t(231140),f=t(712501),p=t(768587),v=t(718583),h=t(957711),y=t(581340),m=t(783244),b=t(200770),g=t(26730),S=t(527157),P=t(543790),O=t(169821),w=t(408558),k=t(764291),x=t(783045),C=t(268481),A=t(612771),Z=t(235487),_=t(497249),E=t(662018),j=t(921318),I=t(656938),T=t(95834),D=t(871583),F=t(23470),R=t(932023),M=t(693961),z=t(448249),N=t(567921),L=t.n(N),q=t(124665),G=t(641634),H=t(991869),U=t(471600),B=t(692909),Q=t(183006),W=t(961081),V=t(482559),J=function(){var e=document.getElementById("mainContent")||document.querySelector('[data-test-id="sqf-container"]');if(e){var n=e.querySelectorAll('a, button, input, textarea, select, details, [role="checkbox"], [role="radio"], [tabindex]:not([tabindex="-1"])');n.length>0&&n[0].focus({preventScroll:!0})}},K=function(){var e=(0,W.sV)().stepName;(0,a.useEffect)(function(){e!==V.h.goalsPlanRecommendation&&window.scrollTo({top:0,left:0,behavior:"instant"}),setTimeout(J,100)},[e])},Y=t(359839),$=function(e,n){(0,a.useLayoutEffect)(function(){n(!1)},[e,n])},X=function(e){var n=e.selectedPreferences,t=e.setIsDisabled,r=(0,W.sV)(),o=r.step,i=r.stepName,l=(0,Y.r9)().isHighProteinEnabled;$(o,t),(0,a.useEffect)(function(){l&&i===V.h.goalsPlanRecommendation&&t(0===n.length)},[l,i,n,t])},ee=t(494467),en=t(648897),et=["FJ","CF","TO","TT"],er=function(e){var n,t,r=e.setIsDisabled,o=(0,b.Z)(),i=(0,W.sV)().stepName,l=(0,U.Z)().preferences,u=(0,q.Z)(),s=(0,w.iQ)(),c=null==s?void 0:s.id,d=(null==s?void 0:null===(t=s.items)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.sku)||"",f=(0,ee.Z)(),p=(0,en.d)();(0,a.useEffect)(function(){o!==g.Z.US&&(null==l?void 0:l.length)&&!p&&(f&&u(f,d),et.includes(o)&&i===V.h.preferences&&r(0===f.length))},[c])}
1,eo=t(341698),ei=t(306286),ea=t(230145),el=function(){var e=(0,W.sV)().stepOrder;return e.indexOf(V.h.meals)<e.indexOf(V.h.size)};function eu(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var es=function(e){var n,t,r=e.products,o=e.setSizeOptions,i=e.setMealsOptions,l=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(null))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return eu(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eu(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=l[0],s=l[1],c=(0,ei.$h)(),d=(0,ei.jy)(),f=el(),p=(0,U.Z)().planFamily,v=(0,ea.Z)().preSelectedSku,h=null===(t=c.product)||void 0===t?void 0:t.handle,y=null==p?void 0:p.handle;(0,a.useEffect)(function(){!u&&v&&s(v)},[v,u]),(0,a.useEffect)(function(){if(r&&v&&h&&u&&v!==u&&h!==v){s(v);var e,n,t=(0,eo.YB)(r,v);t&&(o((0,eo.WN)(r,"size")),i((0,eo.WN)(r,"meals",f?void 0:{size:t.specs.size,meals:t.specs.meals})),c.setProduct((e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},t),n=n={familyHandle:y},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e)),d.setSize(t.specs.size),d.setMeals(t.specs.meals),L().set("hf_ssr_stored_sku",t.handle,{expires:30}))}},[v,u,r,f,h])},ec=function(){var e=(0,W.sV)().isLastStep;(0,a.useEffect)(function(){e&&L().set("hf_has_visited_single_question_last_step","true")},[e])},ed=function(){var e,n,t,r=(0,ei.jy)(),o=(null===(t=(0,w.iQ)())||void 0===t?void 0:null===(n=t.items)||void 0===n?void 0:null===(e=n[0])||void 0===e?void 0:e.sku)||"";(0,a.useEffect)(function(){if(o){var e=parseInt(o.split("-")[3]),n=parseInt(o.split("-")[2]);r.setSize(e),r.setMeals(n)}},[o])},ef=t(165218),ep=t.n(ef),ev=ep()(function(){return t.e(47707).then(t.bind(t,392313))},{loadableGenerated:{webpack:()=>[392313]}}),eh=ep()(function(){return t.e(43739).then(t.bind(t,739772))},{loadableGenerated:{webpack:()=>[739772]}}),ey=ep()(function(){return t.e(83211).then(t.bind(t,26998))},{loadableGenerated:{webpack:()=>[26998]}}),em=ep()(function(){return t.e(6671).then(t.bind(t,164078))},{loadableGenerated:{webpack:()=>[164078]}}),eb=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(24853),t.e(60181)]).then(t.bind(t,809771))},{loadableGenerated:{webpack:()=>[809771]}}),eg=ep()(function(){return t.e(78533).then(t.bind(t,557042))},{loadableGenerated:{webpack:()=>[557042]}}),eS=ep()(function(){return Promise.resolve().then(t.bind(t,819762))},{loadableGenerated:{webpack:()=>[819762]}});ep()(function(){return t.e(25e3).then(t.bind(t,379022))},{loadableGenerated:{webpack:()=>[379022]}});var eP=ep()(function(){return t.e(12292).then(t.bind(t,302806))},{loadableGenerated:{webpack:()=>[302806]}}),eO=ep()(function(){return t.e(73828).then(t.bind(t,156210))},{loadableGenerated:{webpack:()=>[156210]}}),ew=ep()(function(){return t.e(32632).then(t.bind(t,606163))},{loadableGenerated:{webpack:()=>[606163]}}),ek=ep()(function(){return t.e(35541).then(t.bind(t,617912))},{loadableGenerated:{webpack:()=>[617912]}}),ex=ep()(function(){return t.e(3075).then(t.bind(t,522009))},{loadableGenerated:{webpack:()=>[522009]}}),eC=ep()(function(){return t.e(15186).then(t.bind(t,554232))},{loadableGenerated:{webpack:()=>[554232]}}),eA=ep()(function(){return t.e(77539).then(t.bind(t,311910))},{loadableGenerated:{webpack:()=>[311910]}}),eZ=ep()(function(){return Promise.resolve().then(t.bind(t,46911))},{loadableGenerated:{webpack:()=>[46911]}}),e_=ep()(function(){return Promise.resolve().then(t.bind(t,159402))},{loadableGenerated:{webpack:()=>[159402]}}),eE=ep()(function(){return Promise.all([t.e(10447),t.e(72232),t.e(49194),t.e(34996)]).then(t.bind(t,355079))},{loadableGenerated:{webpack:()=>[355079]}}),ej=ep()(function(){return Promise.all([t.e(11323),t.e(98044)]).then(t.bind(t,113805))},{loadableGenerated:{webpack:()=>[113805]}}),eI=ep()(function(){return t.e(48506).then(t.bind(t,839285))},{loadableGenerated:{webpack:()=>[839285]}}),eT=ep()(function(){return t.e(25709).then(t.bind(t,166783))},{loadableGenerated:{webpack:()=>[166783]}}),eD=ep()(function(){return Promise.all([t.e(72769),t.e(95507)]).then(t.bind(t,772769))},{loadableGenerated:{webpack:()=>[772769]}}),eF=ep()(function(){return Promise.all([t.e(98365),t.e(50754),t.e(78890)]).then(t.bind(t,316187))},{loadableGenerated:{webpack:()=>[316187]}});ep()(function(){return Promise.all([t.e(98365),t.e(50754),t.e(34992)]).then(t.bind(t,338254))},{loadableGenerated:{webpack:()=>[338254]}});var eR=t(893423),eM=t(313954),ez=t(638773),eN=t(279810);function eL(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}var eq=(0,p.q)(p.xu),eG=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(72769),t.e(40810)]).then(t.bind(t,851219))},{loadableGenerated:{webpack:()=>[851219]}}),eH=ep()(function(){return Promise.all([t.e(12696),t.e(10447),t.e(21334),t.e(2112),t.e(72232),t.e(5634),t.e(50886),t.e(49194),t.e(24853),t.e(17769),t.e(95490)]).then(t.bind(t,531630))},{loadableGenerated:{webpack:()=>[531630]}}),eU=ep()(function(){return Promise.all([t.e(12696),t.e(10447),t.e(21334),t.e(2112),t.e(72232),t.e(5634),t.e(50886),t.e(49194),t.e(24853),t.e(17769),t.e(41561)]).then(t.bind(t,370458))},{loadableGenerated:{webpack:()=>[370458]}}),eB=ep()(function(){return Promise.all([t.e(10447),t.e(21334),t.e(72232),t.e(50886),t.e(49194),t.e(24853),t.e(17769),t.e(56081)]).then(t.bind(t,759515))},{loadableGenerated:{webpack:()=>[759515]}}),eQ=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(5634),t.e(93809)]).then(t.bind(t,193809))},{loadableGenerated:{webpack:()=>[193809]}}),eW=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(5634),t.e(42182)]).then(t.bind(t,142182))},{loadableGenerated:{webpack:()=>[142182]}}),eV=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(5634),t.e(36913)]).then(t.bind(t,36913))},{loadableGenerated:{webpack:()=>[36913]}}),eJ=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(5634),t.e(67074)]).then(t.bind(t,467074))},{loadableGenerated:{webpack:()=>[467074]}}),eK=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(5634),t.e(52076)]).then(t.bind(t,252076))},{loadableGenerated:{webpack:()=>[252076]}}),eY=ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(93998)]).then(t.bind(t,93998))},{loadableGenerated:{webpack:()=>[93998]}});ep()(function(){return Promise.all([t.e(12696),t.e(21334),t.e(2112),t.e(98046)]).then(t.bind(t,998046))},{loadableGenerated:{webpack:()=>[998046]}});var e$=t(393761),eX=function(){return(0,i.tZ)(p.xu,{width:"100%",height:e$.i8,maxHeight:e$.fM}
1)},e0=ep()(function(){return Promise.all([t.e(16049),t.e(88874)]).then(t.bind(t,688874))},{loadableGenerated:{webpack:()=>[688874]},loading:eX}),e1=ep()(function(){return Promise.all([t.e(31653),t.e(9006)]).then(t.bind(t,991451))},{loadableGenerated:{webpack:()=>[991451]},loading:eX}),e2=ep()(function(){return Promise.all([t.e(31653),t.e(46398)]).then(t.bind(t,726742))},{loadableGenerated:{webpack:()=>[726742]},loading:eX}),e6=ep()(function(){return Promise.all([t.e(31653),t.e(55846)]).then(t.bind(t,678126))},{loadableGenerated:{webpack:()=>[678126]},loading:eX}),e3=ep()(function(){return Promise.all([t.e(31653),t.e(59660)]).then(t.bind(t,376990))},{loadableGenerated:{webpack:()=>[376990]},loading:eX}),e8=ep()(function(){return Promise.all([t.e(12696),t.e(98365),t.e(89496)]).then(t.bind(t,507710))},{loadableGenerated:{webpack:()=>[507710]},loading:eX}),e7=ep()(function(){return Promise.all([t.e(12696),t.e(6045),t.e(44806)]).then(t.bind(t,483205))},{loadableGenerated:{webpack:()=>[483205]},loading:eX}),e5=ep()(function(){return Promise.all([t.e(12696),t.e(5634),t.e(20760)]).then(t.bind(t,828172))},{loadableGenerated:{webpack:()=>[828172]},loading:eX}),e4=ep()(function(){return Promise.all([t.e(12696),t.e(13132)]).then(t.bind(t,459610))},{loadableGenerated:{webpack:()=>[459610]},loading:eX}),e9=ep()(function(){return Promise.all([t.e(12696),t.e(72769),t.e(3595)]).then(t.bind(t,762709))},{loadableGenerated:{webpack:()=>[762709]},loading:eX}),ne=ep()(function(){return Promise.all([t.e(51643),t.e(73475)]).then(t.bind(t,558063))},{loadableGenerated:{webpack:()=>[558063]},loading:eX}),nn=ep()(function(){return Promise.all([t.e(51643),t.e(34857)]).then(t.bind(t,322397))},{loadableGenerated:{webpack:()=>[322397]},loading:eX}),nt=ep()(function(){return Promise.all([t.e(16049),t.e(96305)]).then(t.bind(t,832946))},{loadableGenerated:{webpack:()=>[832946]},loading:eX}),nr=ep()(function(){return Promise.all([t.e(31602),t.e(31832)]).then(t.bind(t,191702))},{loadableGenerated:{webpack:()=>[191702]},loading:eX}),no=(0,a.createContext)(null),ni=function(){var e=(0,a.useContext)(no);if(!e)throw Error("useStepRenderContext must be used within StepRenderProvider");return e},na=no.Provider;function nl(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var nu=function(){var e=ni(),n=e.selectedGenericStepAnswers,t=e.setGenericStepAnswers,r=e.dataFromQuestionnaireService,o=e.setIsDisabled,a=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(eB,{selectedAnswers:n,setSelectedAnswers:t,dataFromQuestionnaireService:r,setIsDisabled:o,setDisableCTA:o,renderCTAWithBackButton:a})},ns=(nl(r={},V.h.preferences,function(){var e=ni(),n=e.filteredPreferences,t=e.onSetPreferences,r=e.onSetHighProteinPreference,o=e.selectedPreferences,a=e.shouldRenderCTAWithBackButton,l=e.plansConfigThermomixPlan;return(0,i.tZ)(eM.Z,{componentName:"sqf-preference-step",children:(0,i.tZ)(eI,{preferences:n,onSetPreferences:t,onSetHighProteinPreference:r,selectedPreferences:o,shouldRenderCTAWithBackButton:a,plansConfigThermomixPlan:l})})}),nl(r,V.h.goals,function(){var e=ni(),n=e.selectedGoalsOptions,t=e.setSelectedGoalsOptions,r=e.dataFromQuestionnaireService,o=e.onSetPreferences;return(0,i.tZ)(eS,{selectedGoalsOptions:n,setSelectedGoalsOptions:t,dataFromQuestionnaireService:r,onSetPreferences:o})}),nl(r,V.h.assuranceStep,function(){var e=ni().selectedGoalsOptionsSortedByPrioritySliced;return(0,i.tZ)(ey,{goals:e,initialTransitionDuration:void 0})}),nl(r,V.h.additionalPreference,function(){var e=ni(),n=e.selectedAdditionalPreferenceOptions,t=e.setSelectedAdditionalPreferenceOptions,r=e.dataFromQuestionnaireService,o=e.shouldRenderCTAWithBackButton,a=e.onSetPreferences;return(0,i.tZ)(ev,{selectedAdditionalPreferenceOptions:n,setSelectedAdditionalPreferenceOptions:t,dataFromQuestionnaireService:r,shouldRenderCTAWithBackButton:o,onSetPreferences:a})}),nl(r,V.h.planRecommendation,function(){var e,n=(0,S.Z)(),t=(0,_.T)(),r=ni(),o=r.products,l=r.mealsOptions,u=r.sizeOptions,s=r.onChangeMeals,c=r.onChangeSize,d=r.currentSize,f=r.currentMeals,p=r.shouldRenderCTAWithBackButton,v=r.selectedGenericStepAnswers,h=r.setGenericStepAnswers,y=r.dataFromQuestionnaireService,m=r.setIsDisabled,b=n===P.Z.factor||n===P.Z.youfoodz,g=b?"UniversalStep":"PlanRecommendationStep",O=null!==(e=null==o?void 0:o.length)&&void 0!==e?e:0;return((0,a.useEffect)(function(){var e=t.startSpan("funnel.tracking.plan-recommendation-entry");e.setAttributes({"entry.componentRendered":g,"entry.productsRenderedCount":O,"entry.productsEmpty":0===O}),e.end()},[g,O]),b)?(0,i.tZ)(eB,{selectedAnswers:v,setSelectedAnswers:h,dataFromQuestionnaireService:y,setIsDisabled:m,setDisableCTA:m,renderCTAWithBackButton:p}):(0,i.tZ)(eE,{products:o,mealOptions:l,sizeOptions:u,onChangeMeals:s,onChangeSize:c,currentSize:d,currentMeals:f,shouldRenderCTAWithBackButton:p})}),nl(r,V.h.mealTypeStep,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.onSetPreferences;return(0,i.tZ)("div",{children:(0,i.tZ)(eO,{dataFromQuestionnaireService:n,onSetPreferences:t})})}),nl(r,V.h.goalsQuiz,function(){var e=ni().onGoalsQuizSelectionChange;return(0,i.tZ)(eg,{onGoalsQuizSelectionChange:e})}),nl(r,V.h.chooseProgram,function(){var e=ni().setIsDisabled;return(0,i.tZ)(em,{setDisableCTA:e})}),nl(r,V.h.goalsPlanNumberOfPeople,function(){var e=ni().onGoalsPlanRecommendationSelectionChange;return(0,i.tZ)(eA,{onGoalsPlanRecommendationSelectionChange:e})}),nl(r,V.h.goalsPlanMealsPerDay,function(){var e=ni().onGoalsPlanRecommendationSelectionChange;return(0,i.tZ)(ew,{onGoalsPlanRecommendationSelectionChange:e})}),nl(r,V.h.goalsPlanMealsPerWeek,function(){var e=ni().onGoalsPlanRecommendationSelectionChange;return(0,i.tZ)(ek,{onGoalsPlanRecommendationSelectionChange:e})}),nl(r,V.h.goalsPlanRecommendation,function(){var e=ni(),n=e.onGoalsPlanRecommendationSelectionChange,t=e.selectedOptions,r=e.setSelectedOptions,o=e.initialProducts;return(0,i.tZ)(eb,{onGoalsPlanRecommendationSelectionChange:n,selectedOptions:t,setSelectedOptions:r,products:o})}),nl(r,V.h.planSelector,function(){var e=ni(),n=e.initialProducts,t=e.selectedOptions,r=e.setSelectedOptions,o=e.voucherCode,a=e.onGoalsPlanRecommendationSelectionChange;return(0,i.tZ)(eN.x2,{children:(0,i.tZ)(ez.Hu,{children:(0,i.tZ)(ej,{products:n,selectedBoxCount:t,setSelectedBoxCount:r,voucherCode:o,onBoxCountSelectionChange:a})})})}
1),nl(r,V.h.meals,function(){var e=ni(),n=e.onChangeMeals,t=e.currentSize,r=e.currentMeals,o=e.mealsOptions;return(0,i.tZ)(eM.Z,{componentName:"singe-plans-page-step-two",children:(0,i.tZ)(ex,{onChangeMeals:n,currentSize:t,currentMeals:r,mealOptions:o,handleKeyDownMeals:function(e,t){var r=t;switch(e.code){case"ArrowRight":case"ArrowDown":e.preventDefault(),r=t+1<=o.length-1?t+1:0,n(o[r]);break;case"ArrowLeft":case"ArrowUp":e.preventDefault(),r=t-1>=0?t-1:o.length-1,n(o[r])}}})})}),nl(r,V.h.size,function(){var e=ni(),n=e.selectedPreferences,t=e.setSelectedPreferences,r=e.setIsDisabled,o=e.sizeOptions;return(0,i.tZ)(eM.Z,{componentName:"singe-plans-page-step-three",children:(0,i.tZ)(eD,{selectedPreferences:n,setSelectedPreferences:t,setIsDisabled:r,sizeOptions:o})})}),nl(r,V.h.zipCode,function(){var e=ni(),n=e.setIsDisabled,t=e.SQFLoadSpan;return(0,i.tZ)(eF,{setDisableCTA:n,SQFLoadSpan:t})}),nl(r,V.h.planPersonalizationPork,function(){var e=ni(),n=e.directToNextPage,t=e.selectedPreferences,r=e.setIsDisabled;return(0,i.tZ)(eZ,{directToNextPage:n,selectedPreferences:t,setDisableCTA:r})}),nl(r,V.h.planPersonalizationSpicy,function(){var e=ni(),n=e.directToNextPage,t=e.selectedPreferences,r=e.setIsDisabled;return(0,i.tZ)(e_,{directToNextPage:n,selectedPreferences:t,setDisableCTA:r})}),nl(r,V.h.newExclusionsProteins,function(){var e=ni().dataFromQuestionnaireService;return(0,i.tZ)(eC,{dataFromQuestionnaireService:e,subtitleTranslationKey:"funnel.plans.singleQuestionFlow.newExclusionsProtein.subtitle",answerKeys:["pork","fish","shellfish"]})}),nl(r,V.h.newExclusionsIngredients,function(){var e=ni().dataFromQuestionnaireService;return(0,i.tZ)(eC,{dataFromQuestionnaireService:e,subtitleTranslationKey:"funnel.plans.singleQuestionFlow.newExclusionsIngredients.subtitle",answerKeys:["spicy","mushrooms"]})}),nl(r,V.h.assuranceAfterQuiz,eh),nl(r,V.h.loadingStep,function(){var e,n,t=(0,p.q_)({from:{opacity:.33},to:(e=function(e){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(n){switch(n.label){case 0:return[4,e({opacity:.8})];case 1:return n.sent(),[4,e({opacity:.33})];case 2:return n.sent(),[2]}})},n=function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){eL(i,r,o,a,l,"next",e)}function l(e){eL(i,r,o,a,l,"throw",e)}a(void 0)})},function(e){return n.apply(this,arguments)}),config:{duration:1e3,easing:p.Gk.linear},loop:!0});return(0,i.tZ)(p.xu,{children:(0,i.tZ)(eq,{style:t,"data-test-id":"experiment-placeholder-content",backgroundColor:"neutral.300",height:"600px",width:"100%",position:"relative",borderRadius:"border-radius-sm"})})}),nl(r,V.h.quizIntro,function(){var e=ni().SQFLoadSpan;return(0,i.tZ)(eT,{SQFLoadSpan:e})}),nl(r,V.h.exZipCode,function(){var e=ni(),n=e.stepName,t=e.setIsDisabled;return(0,i.tZ)(eB,{stepName:n,setDisableCTA:t})}),nl(r,V.h.exHouseholdSize,function(){var e=ni(),n=e.selectedPreferences,t=e.setSelectedPreferences,r=e.setIsDisabled,o=e.sizeOptions;return(0,i.tZ)(eM.Z,{componentName:"extended-funnel-household-size-step",children:(0,i.tZ)(eG,{selectedPreferences:n,setSelectedPreferences:t,setIsDisabled:r,sizeOptions:o})})}),nl(r,V.h.exGoalsStep,function(){var e=ni(),n=e.selectedGoalsOptions,t=e.setSelectedGoalsOptions,r=e.dataFromQuestionnaireService,o=e.selectedPreferences,a=e.setSelectedPreferences,l=e.setIsDisabled;return(0,i.tZ)(eH,{selectedGoalsOptions:n,setSelectedGoalsOptions:t,dataFromQuestionnaireService:r,selectedPreferences:o,setSelectedPreferences:a,setIsDisabled:l})}),nl(r,V.h.exGoalsAssurance,nu),nl(r,V.h.exMomentOfAssurance,nu),nl(r,V.h.exDietaryRestrictions,nu),nl(r,V.h.exMealType,nu),nl(r,V.h.exNutritionPreferences,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.selectedPreferences,r=e.setSelectedPreferences,o=e.setIsDisabled;return(0,i.tZ)(eU,{dataFromQuestionnaireService:n,selectedPreferences:t,setSelectedPreferences:r,setIsDisabled:o})}),nl(r,V.h.exFlavorPreferences,nu),nl(r,V.h.exProteinPreferences,nu),nl(r,V.h.exCuisinePreference,nu),nl(r,V.h.exDinnerPreferences,nu),nl(r,V.h.exIngredientExclusions,nu),nl(r,V.h.exDietaryPreferences,nu),nl(r,V.h.exCookingFrequency,nu),nl(r,V.h.genericStep,nu),nl(r,V.h.default,nu),nl(r,V.h.exFJGoalsStep,function(){var e=ni(),n=e.selectedGoalsOptions,t=e.setSelectedGoalsOptions,r=e.dataFromQuestionnaireService,o=e.onSetPreferences,a=e.setIsDisabled;return(0,i.tZ)(eQ,{selectedGoalsOptions:n,setSelectedGoalsOptions:t,dataFromQuestionnaireService:r,onSetPreferences:o,setDisableCTA:a})}),nl(r,V.h.exFJIngredientExclusions,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.setIsDisabled;return(0,i.tZ)(eW,{dataFromQuestionnaireService:n,setDisableCTA:t})}),nl(r,V.h.exFJHouseholdSize,function(){var e=ni(),n=e.onGoalsPlanRecommendationSelectionChange,t=e.dataFromQuestionnaireService;return(0,i.tZ)(eV,{onGoalsPlanRecommendationSelectionChange:n,dataFromQuestionnaireService:t})}),nl(r,V.h.exFJMealsPerDay,function(){var e=ni(),n=e.onGoalsPlanRecommendationSelectionChange,t=e.dataFromQuestionnaireService;return(0,i.tZ)(eJ,{onGoalsPlanRecommendationSelectionChange:n,dataFromQuestionnaireService:t})}),nl(r,V.h.exFJFreeForLifeReminder,eY),nl(r,V.h.exFJMealsPerWeek,function(){var e=ni(),n=e.onGoalsPlanRecommendationSelectionChange,t=e.dataFromQuestionnaireService;return(0,i.tZ)(eK,{onGoalsPlanRecommendationSelectionChange:n,dataFromQuestionnaireService:t})}),nl(r,V.h.exDesktopGoalsStep,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.setSelectedGoalsOptions,r=e.onSetPreferences,o=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(nt,{dataFromQuestionnaireService:n,setSelectedGoalsOptions:t,onSetPreferences:r,shouldRenderCTAWithBackButton:o})}),nl(r,V.h.exDesktopIngredientExclusionsStep,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(e0,{dataFromQuestionnaireService:n,shouldRenderCTAWithBackButton:t})}
1),nl(r,V.h.exDesktopCuisine,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e1,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopFlavors,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e2,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopProteins,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e6,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopDinnerType,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e3,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopZipCode,function(){var e=ni(),n=e.setIsDisabled,t=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(e8,{setDisableCTA:n,shouldRenderCTAWithBackButton:t})}),nl(r,V.h.exDesktopGoalsAssurance,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e7,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopNutritionPreferences,function(){var e=ni(),n=e.dataFromQuestionnaireService,t=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(e5,{dataFromQuestionnaireService:n,shouldRenderCTAWithBackButton:t})}),nl(r,V.h.exDesktopCookingFrequency,function(){var e=ni().shouldRenderCTAWithBackButton;return(0,i.tZ)(e4,{shouldRenderCTAWithBackButton:e})}),nl(r,V.h.exDesktopHouseholdSize,function(){var e=ni(),n=e.selectedPreferences,t=e.setSelectedPreferences,r=e.setIsDisabled,o=e.sizeOptions,a=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(e9,{selectedPreferences:n,setSelectedPreferences:t,setIsDisabled:r,sizeOptions:o,shouldRenderCTAWithBackButton:a})}),nl(r,V.h.exDesktopMealType,function(){var e=ni(),n=e.onSetPreferences,t=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(ne,{onSetPreferences:n,shouldRenderCTAWithBackButton:t})}),nl(r,V.h.exDesktopDietaryPreferences,function(){var e=ni(),n=e.selectedPreferences,t=e.setSelectedPreferences,r=e.shouldRenderCTAWithBackButton;return(0,i.tZ)(nn,{selectedPreferences:n,setSelectedPreferences:t,shouldRenderCTAWithBackButton:r})}),nl(r,V.h.exDesktopMomentOfAssurance,function(){var e=ni().directToNextPage;return(0,i.tZ)(nr,{directToNextPage:e})}),r),nc=t(55322),nd=t(698764);function nf(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function np(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var nv=function(e){var n=e.sizeOptions,t=e.setSizeOptions,r=e.mealsOptions,o=e.setMealsOptions,l=e.setIsDisabled,u=e.selectedPreferences,s=e.setSelectedPreferences,c=e.selectedOptions,d=e.setSelectedOptions,f=e.selectedGoalsOptions,p=e.setSelectedGoalsOptions,v=e.selectedAdditionalPreferenceOptions,h=e.setSelectedAdditionalPreferenceOptions,y=e.dataFromQuestionnaireService,m=e.directToNextPage,b=e.voucherCode,g=e.SQFLoadSpan,S=e.shouldRenderCTAWithBackButton,P=e.selectedGenericStepAnswers,O=e.setGenericStepAnswers,w=(0,ei.jy)(),k=(0,ei.$h)(),x=(0,nc.j)().isGoalsSelectionRequired,C=(0,W.sV)().stepName,A=(0,H.Z)(u).trackProductChange,Z=(0,U.Z)(),_=Z.preferences,E=Z.plansConfigThermomixPlan,j=Z.planFamily,I=(0,G.Z)(_),T=(0,q.Z)(),D=null==j?void 0:j.handle,F=(0,B.Z)().products,R=(0,Y.r9)().includeSkus,M=(0,eo.E$)({initialProducts:F,includeSkus:R}),z=(0,eR.f)(),N=(0,Q.q)({selectedPreferences:u,setSelectedPreferences:s,setIsDisabled:l});K(),X({selectedPreferences:u,setIsDisabled:l}),er({setIsDisabled:l}),es({products:M,setSizeOptions:t,setMealsOptions:o}),ec(),ed();var V=N.updatePreference,J=N.updateHighProteinPreference,$=(0,a.useCallback)(function(e,n,r){if(M){w.setMeals(e.value);var o=n||w.size,i={meals:e.value,size:o}
1,a=(0,eo.WN)(M,"size",i);t(a);var l=(0,eo._d)(M,o,e.value);if(a&&!a.find(function(e){return e.value===o})){var s=(0,eo.jh)(a,o);w.setSize(s),l=(0,eo._d)(M,s,e.value)}k.setProduct(np(nf({},l),{familyHandle:D})),L().set("hf_ssr_stored_sku",l.handle,{expires:30}),A(l),(void 0===r||r)&&T(u,l.handle)}},[M,w.size,D,u]),ee=(0,a.useCallback)(function(e,n,t){if(M){w.setSize(e.value);var r=n||w.meals,i=(0,eo.WN)(M,"meals",{meals:r,size:e.value});o(i);var a=(0,eo._d)(M,e.value,r);if(i&&!i.find(function(e){return e.value===r})){var l=(0,eo.jh)(i,r);w.setMeals(l),a=(0,eo._d)(M,e.value,l)}k.setProduct(np(nf({},a),{familyHandle:D})),L().set("hf_ssr_stored_sku",a.handle,{expires:30}),(void 0===t||t)&&T(u,a.handle),A(a)}},[M,w.meals,D,u]),en=(0,a.useCallback)(function(e){l(x&&e<1)},[x,l]),et=(0,a.useCallback)(function(e){l(e<1)},[l]),ea=(0,a.useMemo)(function(){return{filteredPreferences:I,onSetPreferences:V,onSetHighProteinPreference:J,selectedPreferences:u,setSelectedPreferences:s,plansConfigThermomixPlan:E,selectedGoalsOptions:f,setSelectedGoalsOptions:p,selectedGoalsOptionsSortedByPrioritySliced:z,selectedAdditionalPreferenceOptions:v,setSelectedAdditionalPreferenceOptions:h,products:null!=M?M:[],initialProducts:F,sizeOptions:n,mealsOptions:r,currentSize:w.size,currentMeals:w.meals,onChangeMeals:$,onChangeSize:ee,selectedOptions:c,setSelectedOptions:d,setIsDisabled:l,shouldRenderCTAWithBackButton:S,dataFromQuestionnaireService:y,SQFLoadSpan:g,voucherCode:b,directToNextPage:m,onGoalsQuizSelectionChange:en,onGoalsPlanRecommendationSelectionChange:et,selectedGenericStepAnswers:P,setGenericStepAnswers:O,stepName:C}},[I,V,J,u,s,E,f,p,z,v,h,M,F,n,r,w.size,w.meals,$,ee,c,d,l,S,y,g,b,m,en,et,P,O,C]);if(!(0,nd.K)()&&!M)return(0,i.tZ)(eP,{});var el=ns[C];return el?(0,i.tZ)(na,{value:ea,children:(0,i.tZ)(el,{})}):null},nh=t(164528),ny=t(200061),nm=t(531592),nb=t(625889),ng=function(e){var n,t,r,o,a=e.dataFromQuestionnaireService,l=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translateRaw,u=(0,W.sV)(),s=u.stepName,c=u.flowType,d="mobile"===(0,C.Sj)(),f=(0,S.Z)(),v=d&&f===P.Z.factor,h=(0,nm.$)().isVariation,y=(0,j.qC)("header-title-slot"),m=y.isEnabled,b=y.content,g=l("funnel.plans.singleQuestionFlow.".concat(s,".title"));return((0,nb.c)(c)||f===P.Z.hellofresh)&&(s===V.h.planRecommendation||s===V.h.planRecommendationV2)&&!d||((0,nb.c)(c)&&s===V.h.meals&&(g=l("funnel.plans.singleQuestionFlow.newPlanSelection.meals.title")),(0,nb.c)(c)&&s===V.h.size&&(g=l("funnel.plans.singleQuestionFlow.newPlanSelection.people.title")),(0,nb.c)(c)&&s===V.h.planRecommendation&&(g=l("funnel.plans.singleQuestionFlow.newPlanSelection.planRecommendation.title")),a&&s===V.h.additionalPreference&&(g=(null==a?void 0:null===(r=a.questions.find(function(e){return"dietary-preferences"===e.question_handle}))||void 0===r?void 0:r.text)||""),a&&s===V.h.goals&&(g=(null==a?void 0:null===(o=a.questions.find(function(e){return"goals"===e.question_handle}))||void 0===o?void 0:o.text)||""),s===V.h.goalsQuiz&&(g=l("funnel.plans.singleQuestionFlow.goalsQuizStep.title")),s===V.h.zipCode&&(g=""),v&&s===V.h.goalsPlanRecommendation&&(g=l("funnel.plans.singleQuestionFlow.goalsPlanRecommendation.qkwins.title")),s===V.h.planPersonalizationPork&&(g=l("funnel.plans.singleQuestionFlow.personalization.pork.title")),s===V.h.planPersonalizationSpicy&&(g=l("funnel.plans.singleQuestionFlow.personalization.spice.title")),s===V.h.newExclusionsProteins&&(g=l("funnel.plans.singleQuestionFlow.new-exclusions-protein.title")),s===V.h.newExclusionsIngredients&&(g=l("funnel.plans.singleQuestionFlow.new-exclusions-ingredients.title")),s===V.h.planSelector&&(g=l("funnel.plans.singleQuestionFlow.newPlanSelection.planMealsSelection.title")),s===V.h.mealTypeStep&&(g=l("funnel.plans.singleQuestionFlow.mealsType")),s===V.h.freeForLifeSelection||s===V.h.goalsPlanRecommendation&&h)||(m&&b&&b.listOfTitles&&s in b.listOfTitles&&(g=b.listOfTitles[s]),s===V.h.proteinExclusion&&(g=l("funnel.plans.singleQuestionFlow.proteinExclusion.title")),!g)?null:(0,i.tZ)(p.xu,{display:"flex",width:"100%",children:(0,i.tZ)(p.xu,{width:"100%",textAlign:["unset","center"],paddingBottom:"global.xs",children:(0,i.tZ)(p.xv,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({id:ny.tf,"data-test-id":ny.tf},s===V.h.planRecommendation&&{"data-wnkd-id":"plans-header-title"}),t=t={as:"h2",wordBreak:"break-word",children:g},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))})})},nS=t(285087),nP=t(917983),nO=t(292362),nw=t(885748),nk=t(726745),nx=t(835814),nC=t(523921),nA=t(950928),nZ=function(e){var n=e.isDisabled,t=e.isLoading,r=e.onClick,o=e.CTAText,a=e.ctaAriaLabel,l=e.dataTestId,u=e.productHandle,s=(0,nx.Z)(),c=(0,nC.o)().isExtendedFunnelDesktopEnabled,d=(0,nk.Z)(),f=(0,nA.z)();return(0,i.tZ)(p.xu,{marginX:"auto",width:c||d||f?"100%":["100%","377px","360px"],position:[s?"static":"fixed","static"],bottom:[0,"auto"],left:[0,"auto"],zIndex:[4,"auto"],backgroundColor:["alias.elevation.level-2","transparent"],boxShadow:["alias.box.md","global.none"],"data-test-id":null!=l?l:"single-page-base-cta",children:(0,i.tZ)(p.xu,{padding:["global.sm-2","global.none"],backgroundColor:["alias.elevation.level-2","transparent"],children:(0,i.tZ)(p.xu,{width:"100%",children:(0,i.tZ)(p.zx.Primary,{"data-test-id":"single-page-continue-button","data-test-sku":u,disabled:n,onClick:r,loading:t,"aria-label":a||void 0,children:o})})})})},n_=t(151649),nE=function(){var e=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translate;return(0,i.BX)(p.xu,{display:"flex",flexDirection:"column",justifyContent:"space-around","data-test-id":"no-commitment-content",maxWidth:"50%",children:[(0,i.tZ)(p.xv,{type:"body-sm-bold",textAlign:"left",children:e("funnel.plans.singleQuestionFlow.cta.noCommitment.title")}),(0,i.tZ)(p.xv,{textAlign:"left",type:"body-sm-regular",children:e("funnel.plans.singleQuestionFlow.cta.noCommitment.subtitle")})]})},nj=function(e){var n=e.isLastStep,t=e.showPriceOnCTA,r=e.isPlanRecommenderStep;return n&&t?(0,i.tZ)(p.xu,{display:"flex",flexDirection:"column",justifyContent:"space-around","data-test-id":"price-on-quiz-flow-content",maxWidth:"90%",minHeight:"60px",alignItems:"center",width:"100%","aria-busy":"true",children:(0,i.tZ)(p.$j,{size:"md",variant:"primary","data-test-id":"price-on-quiz-flow-spinner","aria-hidden":"true"})}):r?null:(0,i.tZ)(p.xu,{display:"flex",justifyContent:"center",alignItems:"center",children:(0,i.tZ)(p.$j,{size:"sm",variant:"currentColor"})})};function nI(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function nT(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return nI(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nI(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nD=function(e){var n,t,r=e.isDisabled,o=e.isLoading,l=e.onClick,u=e.isLastStep,s=e.isSQF2,c=e.isFullWidthCTA,d=e.showPriceOnCTA,f=e.CTAText,v=e.dataTestId,h=e.isPlanRecommenderStep,y=e.productHandle,m=(0,S.Z)()===P.Z.hellofresh,b=nT((0,a.useState)(!1),2),g=b[0],w=b[1],k=nT((0,a.useState)(!c),2),x=k[0],A=k[1],Z=(0,C.Sj)(),_=(0,nx.Z)();(0,a.useLayoutEffect)(function(){c&&(w(!0),setTimeout(function(){return A(!0)},400))},[c]);var E=(0,a.useMemo)(function(){return g?"40%":"100%"},[g]);return(0,i.tZ)(O.Z,{children:(0,i.tZ)(p.xu,{width:"100%",position:[_?"static":"fixed","static"],bottom:[
10,"auto"],right:[0,"auto"],left:[0,"auto"],zIndex:[4,"auto"],backgroundColor:["alias.elevation.level-2","transparent"],marginTop:u?"global.none":["global.none","global.md-1"],boxShadow:["alias.box.md","global.none"],"data-test-id":null!=v?v:"no-commitment-cta",children:(0,i.BX)(p.xu,{maxWidth:["100%",m?"556px":"100%"],margin:"auto",padding:["global.sm-2","global.none"],backgroundColor:["alias.elevation.level-2","transparent"],display:"flex",justifyContent:h?"center":"space-between",flexDirection:"row",gap:"global.sm-2",flexWrap:["nowrap","nowrap"],children:[(0,i.tZ)(p.xu,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({display:"inline-flex",alignItems:"center"},u&&d&&{flex:"1",minWidth:"0"},s&&"mobile"!==Z&&{flex:"1",minWidth:"0"}),t=t={children:(0,i.tZ)(a.Suspense,{fallback:(0,i.tZ)(nj,{isLastStep:u,showPriceOnCTA:d,isPlanRecommenderStep:h}),children:u&&d?(0,i.tZ)(n_.Z,{showPrice:x}):(0,i.tZ)(nE,{})})},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n)),(0,i.tZ)(p.xu,{width:[c?E:"50%","100%"],transition:"width ".concat(400,"ms ease-in-out"),my:"auto",minWidth:["88px",u?"auto":"377px"],maxWidth:["152px","377px"],flexShrink:0,children:(0,i.tZ)(p.zx.Primary,{"data-test-id":"single-page-continue-button","data-test-sku":y,disabled:r,onClick:l,loading:o,children:f})})]})})})},nF=function(e,n,t){switch(e){case V.h.quizIntro:return n("funnel.plans.singleQuestionFlow.quiz-intro.ctaText");case V.h.assuranceAfterQuiz:return t;default:return n("funnel.plans.singleQuestionFlow.cta.continue")}};function nR(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var nM="assurance-button-loaded",nz=function(e){var n,t=e.isDisabled,r=e.isLoading,o=e.isLastStep,l=e.onClick,u=e.productHandle,s=(0,Y.r9)(),c=(0,S.Z)(),d=(0,W.sV)(),f=d.stepName,v=d.flowType,h=(0,a.useMemo)(function(){return c===P.Z.hellofresh},[c]),y=(0,nS.l)(),m=(0,a.useMemo)(function(){return o&&h||s.showNoCommitmentCTA},[o,h,s.showNoCommitmentCTA]),b=(0,nh.ZP)("funnel.plans.singleQuestionFlow"),g=b.translate,O=b.translateRaw,w=(0,nh.ZP)("funnel.plans.single-question-flow"),k=w.translate,x=w.translateRaw,C=f===V.h.assuranceAfterQuiz,A=f===V.h.planRecommendation,Z=v===nP.Z.WLMealKitPlanRecommendationSQF2,_=function(e){if(Array.isArray(e))return e}(n=a.useState(!1))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return nR(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nR(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),E=_[0],j=_[1],I=(0,nO.SL)().isRafFunnelEnabled,T=(0,nw.Tq)().isRafOrderSummaryEnabled,D=(I||T)&&A;a.useEffect(function(){var e=function(){null==y||y.removeItem(nM)};return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}},[y]),a.useEffect(function(){!C||(null==y?void 0:y.getItem(nM))||(j(!0),setTimeout(function(){j(!1),null==y||y.setItem(nM,"true")},3200))},[C,y]);var F=f===V.h.meals,R=E?(0,i.BX)(p.xu,{display:"flex",alignItems:"center",gap:"xs",children:[(0,i.tZ)(p.$j,{size:"md",variant:"neutral"}),g("funnel.plans.singleQuestionFlow.assurance.cta.loading")]}):g("funnel.plans.singleQuestionFlow.assurance.cta.ready"),M=(0,nk.Z)(),z=M?k("funnel.plans.single-question-flow.extended.cta.next"):nF(f,g,R),N=M?x("funnel.plans.single-question-flow.extended.cta.next"):O("funnel.plans.singleQuestionFlow.cta.continue"),L=!!F,q=f===V.h.assuranceAfterQuiz?t||E:t;return M?(0,i.tZ)(nZ,{isDisabled:q,isLoading:r,onClick:l,CTAText:z,ctaAriaLabel:N,productHandle:u}):L&&s.shouldDisplayPriceInStickyCTAOnPlansPage&&v!==nP.Z.WLMealKitPlanRecommendation&&v!==nP.Z.WLMealKitPlanRecommendationSQF2&&v!==nP.Z.GreenChefUS?(0,i.tZ)(nD,{isDisabled:t,isLoading:r,isLastStep:o,isFullWidthCTA:!s.shouldDisplayPriceInStickyCTAOnPlansPage,showPriceOnCTA:L,onClick:l,CTAText:z,dataTestId:"price-in-sticky-cta-on-plans-page-wls",productHandle:u}):D?(0,i.tZ)(nZ,{isDisabled:q,isLoading:r,onClick:l,CTAText:z,ctaAriaLabel:N,productHandle:u}):m?(0,i.tZ)(nD,{isDisabled:t,isLoading:r,isLastStep:o,isFullWidthCTA:!s.showNoCommitmentCTA,showPriceOnCTA:h,onClick:l,CTAText:z,isPlanRecommenderStep:A,productHandle:u}):o&&s.showNoCommitmentCTAOnLastStepOnly?(0,i.tZ)(nD,{isDisabled:t,isLoading:r,isLastStep:o,isFullWidthCTA:!s.showNoCommitmentCTA,showPriceOnCTA:s.showPriceOnCTA,isSQF2:Z,onClick:l,CTAText:z,isPlanRecommenderStep:A,productHandle:u}):o&&(v===nP.Z.WLMealKitPlanRecommendation||v===nP.Z.GreenChefUS)?(0,i.tZ)(nD,{isDisabled:t,isLoading:r,isLastStep:o,isSQF2:Z,isFullWidthCTA:!s.showNoCommitmentCTA,showPriceOnCTA:s.showPriceOnCTA,onClick:l,CTAText:z,productHandle:u}):(0,i.tZ)(nZ,{isDisabled:q,isLoading:r,onClick:l,CTAText:z,ctaAriaLabel:N,productHandle:u})},nN="hf_discount_comm_id",nL=function(){var e,n=(0,y.t)(),t=(0,b.Z)(),r=n.query,o=n.asPath,i=r.discount_comm_id,l=t===g.Z.US,u=null===(e=Array.isArray(i)?i[0]:i)||void 0===e?void 0:e.trim(),s=(0,a.useMemo)(function(){return L().get(nN)},[]),c=l&&u&&s!==u;(0,a.useEffect)(function(){c&&L().set(nN,u)},[u,c]),(0,a.useEffect)(function(){if(l){var e=function(e){o.split("?")[0]!==e.split("?")[0]&&L().remove(nN)};return n.events.on("beforeHistoryChange",e),function(){n.events.off("beforeHistoryChange",e)}}},[o,n,l])},nq=t(887824),nG=t(966622),nH=t(407792),nU=t(529970),nB=t(167699);function nQ(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function nW(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1))),r.forEach(function(n){nQ(e,n,t[n])})}return e}function nV(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var nJ=(nV(o={},V.h.additionalPreference,"dietaryPreferences"),nV(o,V.h.meals,"numberMeals"),nV(o,V.h.size,"numberPeople"),o),nK=function(){var e=(0,nG.py)({runUsingStatsig:!0}),n=e.track,t=e.isReady,r=(0,nH.O)(),o=r.id,i=r.attributes;return{trackStepLoad:function(e,t,r){var a=nJ[t]||t,l=(t===V.h.size||t===V.h.meals)&&r?r:"";n({experimentationUserId:o,experimentationUserAttributes:i,eventName:"Checkout_PlansStep".concat(e),eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:a,EventLabel:l}})},isReady:t}},nY=t(456552),n$=t(875418),nX=t(580766),n0=t(431328),n1=t(699219),n2=t(504243),n6=t(344884),n3=t(134094),n8=t(732078),n7=t(217361),n5=function(e,n,t){if(0===e.length)return[];var r=e.filter(function(e){return!t.includes(e)});return 0===r.length&&n.length>0?[n[0].preferenceName]:r},n4=function(e,n,t){var r=null==n?void 0:n.split("-")[2],o=L().get("hf_goals_plan_recommended_cookie");if(r&&o){var i=e.startSpan("goals-plan-recommendation-selection",{attributes:{customerSelection:r,recommendedPlanSize:o,selectionMatchesRecommendation:r===o}});i.setStatus({code:n6.Z.OK}),t&&i.setStatus({code:n6.Z.ERROR,message:t}),i.end()}},n9=t(52016),te=function(e){var n,t=(0,U.Z)(),r=t.preferences,o=t.presets,i=t.multiplePreferences,a=(0,ei.$h)();return e&&(null==e?void 0:e.length)!==0&&(null===(n=a.product)||void 0===n?void 0:n.handle)&&(0,n9.Up)({selectedPreferences:e,preferences:r,multiplePreferences:i,productCtx:a,presets:o})||""},tn=t(775107),tt=t(928698),tr=t(276312),to=t(148159),ti=t.n(to),ta=t(958042),tl=t(43011),tu=t(502814),ts=t(468891),tc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(0,ts.parseUrl)(e),r=t.query,o=t.url,i=n.step,a=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},i&&{step:i},void 0===r?{}:r,function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(n,["step"])),l=(0,ts.stringify)(a,{sort:!1});return l?"".concat(o,"?").concat(l):o||e};function td(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var tf=function(){var e=(0,y.t)(),n=(0,S.Z)(),t=(0,ta.Z)(),r=(0,tl.Z)(),o=(0,ei.$h)(),i=(0,Y.r9)().isLegoCheckoutEnabled,l=(0,tu.f)({isWebConfigEnabled:i}).isEnabled;return(0,a.useCallback)(function(i){var a,u,s,c,d=ti()(e.query,["c","step","mealsize"]),f="/checkout-form/address";l&&(f="/checkout");var p=l?{step:"address"}:{};if(r)return n===P.Z.hellofresh||l?e.push(tc(f,td((a=td({},p),u=u={locale:t},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(u)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(u,e))}),a),d))):e.push(tc("/checkout/delivery",td({sku:null===(c=o.product)||void 0===c?void 0:c.handle,cartId:i},d)));if(n===P.Z.hellofresh){var v=tc(f,p);return e.push(tc("/register",td({returnUrl:v},d)))}return e.push(tc("/signup/".concat(null===(s=o.product)||void 0===s?void 0:s.handle),td({cartId:i},d)))},[e,n,t,r,o,l])},tp=t(83380);function tv(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function th(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var ty=function(e){var n,t,r=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(!1))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return tv(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tv(e,2)}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1],l=(0,U.Z)(),u=l.preferences,s=l.planFamily,c=l.products,d=(0,Y.r9)().displayOnlyPreferences,f=(0,ei.$h)(),p=(0,n7.n)().orderType,v=(0,tr.Z)(),h=(0,w.iQ)(),y=(0,n$.m)(),m=(0,nX.S)(),b=(0,n0.u)().mutate,g=(0,_.T)(),O=(0,n2.C)().startPageTransition,k=tf(),x=(0,nY.useQueryClient)(),C=(0,tp.N)().trackAddToCartSnowplowEvent,A=(0,S.Z)()===P.Z.youfoodz,Z=(0,a.useMemo)(function(){var n=n5(e,u,d);return A?(0,tn.xV)(n):n},[e,u,d,A]),E=(0,tt.t)(v[p]),j=(0,n8.Z)({productHandles:c,couponCode:E}),I=null==j?void 0:null===(t=j.products)||void 0===t?void 0:t.find(function(e){var n;return e.handle===(null===(n=f.product)||void 0===n?void 0:n.handle)}),T=te(Z),D=(0,H.Z)(Z),F=D.trackSubmitPlan,R=D.trackGoToCart,M=(0,a.useCallback)(function(){var e,n,t,r,o,a,l,u,c,d=!(arguments.length>0)||void 0===arguments[0]||arguments[0],v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r="",o="",d?(r="single-question-flow.create-cart",o="cart created"):(r="single-question-flow.patch-cart",o="cart changed successfully"),a=null===(e=f.product)||void 0===e?void 0:e.handle,l=g.startSpan(r),{variables:th({voucher:E,items:[{quantity:1,sku:a,metadata:(u=th({productFamily:(null==s?void 0:s.handle)||"",timestamp:Date.now()},null==h?void 0:null===(t=h.items)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.metadata),c=c={mealsPreset:T,presets:Z||[""],checkoutType:p},Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(c)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(c)).forEach(function(e){Object.defineProperty(u,e,Object.getOwnPropertyDescriptor(c,e))}),u)}]},v),options:{onSuccess:function(e){l.setStatus({message:o,code:n6.Z.OK}),l.end(),d&&L().set(n3.KQ,e.id,{expires:30}),n4(g,a);var n=function(){i(!1),k(e.id)};if(E){b({cartId:e.id,voucher:E},{onSettled:n});return}n()},onError:function(e){l.setStatus({message:e.message,code:n6.Z.ERROR}),l.end(),n4(g,a,e.message),i(!1)}}}},[y,T,s,f,k,Z,g,E,h,p,b]);return{isLoading:o,onSelectPlan:(0,a.useCallback)(function(){f.product&&(F(),R(f.product),C({productHandle:f.product.handle,productName:f.product.name,productPrice:(null==I?void 0:I.unitPrice)||0,selectedPreferences:Z.join(","),planHandle:(null==s?void 0:s.handle)||"",shippingPrice:(null==I?void 0:I.shippingAmount)||0,couponDiscount:(null==I?void 0:I.couponMoneyValue)||0,shippingDiscount:(null==I?void 0:I.shippingDiscountAmount)||0})),i(!0),O();var e,n,t=null===(e=f.product)||void 0===e?void 0:e.handle,r=L().get(n3.KQ),o=[n1.Z["cart.byId"],{id:r}];if(r&&t&&null!==(n=x.getQueryData(o))&&void 0!==n&&n){var a=M(!1,{cartId:r}),l=a.variables,u=a.options;m.mutate(l,u)}else{var c=M(!0,{}),d=c.variables,p=c.options;y.mutate(d,p)}},[y,m,f,R,C,F,x,M,O,null==s?void 0:s.handle,Z,null==I?void 0:I.unitPrice,null==I?void 0:I.shippingAmount,null==I?void 0:I.couponMoneyValue,null==I?void 0:I.shippingDiscountAmount])}},tm=function(e){var n=(0,_.T)(),t=(0,a.useRef)(null);return t.current||(t.current=n.startSpan("single-question-flow-load",{attributes:e})),t.current},tb=function(e){var n=e.products,t=e.defaultSize,r=e.defaultMeals,o=e.preSelectedSku,i=e.forcedPeopleSize;return i?(0,eo._d)(n,i,(0,eo.bn)(n,o)||r):(0,eo.YB)(n,o)||(0,eo._d)(n,t,r)},tg=function(e){var n=e.products,t=e.setSizeOptions,r=e.setMealsOptions,o=e.defaultPreference,i=e.setDefaultPreference,l=e.isHFDefaultGlobalFlow,u=(0,ei.$h)(),s=(0,ei.jy)(),c=el(),d=(0,Y.r9)().forcedPeopleSize,f=(0,ea.Z)(),p=f.featuredPreset,v=f.preSelectedSku,h=(0,U.Z)(),y=h.defaultMeals,m=h.defaultSize,b=h.planFamily;(0,a.useLayoutEffect)(function(){if(n&&n.length>0&&!o){var e,a,f=u.product,p=f&&n.some(function(e){return e.handle===f.handle})?f:tb({products:n,defaultSize:m,defaultMeals:y,preSelectedSku:v,forcedPeopleSize:d});L().set("hf_ssr_stored_sku",p.handle,{expires:30}),u.setProduct((e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},p),a=a={familyHandle:null==b?void 0:b.handle},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))}),e)),r((0,eo.WN)(n,"meals",!c||l?{size:p.specs.size,meals:p.specs.meals}:void 0)),s.setSize(p.specs.size),s.setMeals(p.specs.meals),t((0,eo.WN)(n,"size")),i(p)}},[n,m,y,v,p,d,o,c,l])},tS=t(142432),tP=t(506647),tO=t(340332),tw=t(478568),tk=t(12939),tx=function(){var e=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translate,n=(0,W.sV)().stepName;return n===V.h.planRecommendation?null:(0,i.tZ)(p.xu,{display:"flex",width:"100%",textAlign:["start","center"],justifyContent:["start","center"],mb:["global.sm-2","global.md-2","global.md-3"],children:(0,i.tZ)(p.xv,{id:ny.j1,"data-test-id":ny.j1,type:"body-md-regular",color:"shared-alias.neutral.foreground.dark",children:e("funnel.plans.singleQuestionFlow.".concat(n,".subtitle"))})})},tC=t(748130),tA=t(572344),tZ=t(253977),t_=t(380624),tE=t(46911),tj=t(159402),tI=t(343168);function tT(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function tD(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var tF=function(){var e=(0,nq.Z)().push,n=(0,C.Sj)(),t=(0,t_.E)().selectedSpicePreference,r=(0,tZ.t)().selectedPorkPreference,o=(0,tI.Z)().trackStatsigEvent;return{checkAndTrackPlanPersonalizationResponse:function(i){var a={plan_type:"rte",event:"gaEventTrigger",viewport:n,event_name:"Checkout_FunnelQuizPlus",gaEventAction:"goalPlusSubmit",squad:"rte-growth-and-onboarding",tribe:"rte-consumer"};if(i===V.h.planPersonalizationPork){var l="pork"===r?"YesPork":"NoPork",u=tE.PORK_CONFIG.options.findIndex(function(e){return e.key===r})+1;e(tD(tT({},a),{gaEventCategory:"funnelQuiz_goalsPlanEatPork",gaEventLabel:l,quizQuestion:"EatPork",selectedAnswer:l,selectOrder:u})),o({eventName:"Checkout_FunnelQuizPlus",eventTags:{EventAction:"goalPlusSubmit",EventCategory:"funnelQuiz_goalsPlanPork",EventLabel:l,quizQuestion:"Pork",selectedAnswer:l}})}if(i===V.h.planPersonalizationSpicy){var s="spicy"===t?"Spice":"NoSpice",c=tj.SPICY_CONFIG.options.findIndex(function(e){return e.key===t})+1;e(tD(tT({},a),{gaEventCategory:"funnelQuiz_goalsPlanSpicyFood",gaEventLabel:s,quizQuestion:"SpicyFood",selectedAnswer:s,selectOrder:c})),o({eventName:"Checkout_FunnelQuizPlus",eventTags:{EventAction:"goalPlusSubmit",EventCategory:"funnelQuiz_goalsPlanSpicyFood",EventLabel:s,quizQuestion:"SpicyFood",selectedAnswer:s}})}}}},tR=t(953137),tM=t(877520),tz=t(90295),tN=function(e,n){L().set("hf_".concat(e,"_notification_dismiss"),n,{expires:31})},tL=function(e){e.setVoucherCode({code:"",valid:!0,error:""})},tq=t(334985),tG={dm:["meals","servings","first-box-meals","free-box","buy1get1"],dm_gifts:["gifts"],dm_dollars:["true"],dm_custom:["tote","zon"]},tH=["hf_dm_meals","hf_dm_box","hf_dm_gifts","hf_dm_dollars","hf_dm_custom"],tU=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,y.t)().query,r=(0,_.T)();(0,a.useEffect)(function(){var e=r.startSpan("usePricePresentationNotification");e.setAttributes({dm:t.dm||"",dm_gifts:t.dm_gifts||"",dm_dollars:t.dm_dollars||"",dm_custom:t.dm_custom||""}),e.end()},[t.dm,t.dm_gifts,t.dm_dollars,t.dm_custom,r]);var o=(0,b.Z)()===g.Z.US;return e&&!n&&(!o||!!t.discount_comm_id||!(function(){var e=function(e){if(t[e])return{v:tG[e].some(function(n){return n===t[e]})}};for(var n in tG){var r=e(n);if("object"==(r&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r))return r.v}}()||tH.some(function(e){return!!L().get(e)})))},tB=t(682617),tQ=function(e,n,t,r){var o,i,a=tM.ZP.create("","pricePresentationNotification",{type:tM.k$.success,meta:(o=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},e),i=i={isPricePresentationNotification:!0}
1,Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o),overrideId:"pricePresentationNotification",delayedDismiss:n,delayedDismissDuration:t,onClose:r});(0,tz.iX)(function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isPricePresentationNotification)||"price-presentation-error"===e.id}),(0,tz.wN)(a)},tW=function(e,n,t,r){var o,i,a=tM.ZP.create("","voucherNotification",{type:tM.k$.success,meta:(o=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},e),i=i={isVoucherNotification:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o),delayedDismiss:n,delayedDismissDuration:t,onClose:r});(0,tz.iX)(function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isVoucherNotification)||"voucher-error"===e.id}),(0,tz.wN)(a)},tV=function(e,n,t){var r=tM.ZP.create(e,n,t);(0,tz.iX)(function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isPricePresentationNotification)}),(0,tz.FV)(r),(0,tz.wN)(r)},tJ=function(e,n,t){var r=tM.ZP.create(e,n,t);(0,tz.iX)(function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isVoucherNotification)}),(0,tz.FV)(r),(0,tz.wN)(r)};function tK(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var tY=function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isPricePresentationNotification)||"price-presentation-error"===e.id},t$=function(e){var n;return!!(null===(n=e.meta)||void 0===n?void 0:n.isVoucherNotification)||"voucher-error"===e.id},tX=function(e){var n,t,r=e.isPricePresentationEnabled,o=(0,nh.ZP)("senf-notification").translateRaw,i=(0,tw.H)(),l=(0,n7.n)().orderType,u=(0,tr.Z)(),s=l===tB.hv.oneTimePurchase,c=u[l],d=c.code,f=c.isValid,p=(0,ei.$h)(),v=(0,ei.jy)(),h=(function(e){if(Array.isArray(e))return e}(n=(0,m.Z)("hf_prefill_zipcode")||[""])||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,n){if(e){if("string"==typeof e)return tK(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tK(e,1)}}(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],b=(0,_.T)(),g=(0,y.t)(),S=g.query,P=g.asPath,O=(0,nG.py)({runUsingStatsig:!0}).track,w=(0,nH.O)(),x=w.id,C=w.attributes,A=(0,tR.u)({}).data,Z=(0,a.useMemo)(function(){return!!A&&!!(A.count>0&&A.items.filter(function(e){return e.isActive}))},[A]),E=null===(t=p.product)||void 0===t?void 0:t.handle,j=(0,tq.Z)(E).voucherData,I="1"===L().get("hf_ssr_e_gift_card_checkout"),T=tU(r,I);(0,a.useEffect)(function(){if(j&&S.c){var e=j.code,n=j.discount_type,t=j.discount_value;O({experimentationUserId:x,experimentationUserAttributes:C,eventName:"Voucher_VoucherFromURL",eventTags:{Eventcategory:"coupons",EventAction:P,EventLabel:"".concat(e," | ").concat(n," | ").concat(t),brand:"HelloFresh",tribe:"Conversions Journey"}})}},[j,O,x,C,P,S.c]);var D=(0,k.Z)().data,F=(0,a.useMemo)(function(){var e,n,t;return null==D?void 0:null===(t=D.plans)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:null===(e=n.children)||void 0===e?void 0:e.map(function(e){return e.handle})},[D]);return(0,a.useEffect)(function(){if(""!==d&&v.meals&&v.size&&p.product){if(f)T?tQ(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({code:d,sku:p.product.handle,productSkus:F||[p.product.handle],shouldShowUrgencyBanner:!0,zipcode:h},s&&{checkoutType:tB.hv.oneTimePurchase}),!1,0,function(){return tN("price_presentation",d)}):tW({code:d,productDetails:{servings:v.meals*v.size,sku:p.product.handle},pricingDetails:{subTotal:p.product.price,shippingAmount:p.product.special_fee},isFromUrl:!0},!1,0,function(){return tN("voucher",d)});else{var e=i.error?o("senf-notification.voucher.rejected.".concat(i.error))||o("senf-notification.voucher.rejected"):o("senf-notification.voucher.rejected.fallback"),n=b.startSpan("amazon-voucher-message");n.setAttributes({content:e,hasValidSubscription:Z,couponErrorMsg:i.error,isCouponFailed:!i.valid,plansPageVersion:"single-question","banner-hidden":!1}),n.end(),T?tV(e,"price-presentation-error",{type:tM.k$.error,overrideId:"price-presentation-error",onClose:function(){return tL(i)}}):tJ(e,"voucher-error",{type:tM.k$.error,overrideId:"voucher-error",onClose:function(){return tL(i)}})}}},[v,o,i,p,Z,T,I,b,h,F,s,d,f]),(0,a.useEffect)(function(){return function(){(0,tz.iX)(T?tY:t$)}},[]),null},t0=t(786282),t1=t(496329),t2=function(e){var n,t,r,o,i,a,l,u,s,c,d=e.productSkus,f=e.discountCommunicationId,p=e.storedVoucherCode,v=e.subscription,h=e.defaultSku,y=(0,t1.Z)(),m=(0,t0.m)({productSkus:d,voucherCode:p||"",discountCommunicationId:f},{enabled:!!p&&d.length>0,suspense:!1}).data,b=y&&v?null==m?void 0:null===(r=m.presets)||void 0===r?void 0:null===(n=r[null==v?void 0:null===(t=v.product)||void 0===t?void 0:t.sku])||void 0===n?void 0:n.terms_and_conditions:null==m?void 0:null===(i=m.presets)||void 0===i?void 0:null===(o=i[h])||void 0===o?void 0:o.terms_and_conditions,g=y&&v?null==m?void 0:null===(u=m.presets)||void 0===u?void 0:null===(a=u[null==v?void 0:null===(l=v.product)||void 0===l?void 0:l.sku])||void 0===a?void 0:a.terms_and_conditions_expiry_countdown:null==m?void 0:null===(c=m.presets)||void 0===c?void 0:null===(s=c[h])||void 0===s?void 0:s.terms_and_conditions_expiry_countdown;return!!b||!!g},t6=t(463171);function t3(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var t8=function(e){var n,t=e.shouldAlignItemsStart,r=e.hasGoalsQuiz,o=e.isZipcodeStep,l=e.externalZipCodeStep,u=e.children,s=(0,S.Z)(),c=(0,C.Sj)(),d=s===P.Z.hellofresh,f=s===P.Z.factor,v=s===P.Z.youfoodz,h=(0,en.d)(),y="mobile"===c&&s===P.Z.factor,b=(0,W.sV)(),g=b.stepName,O=b.flowType,w=b.step,k=(0,nA.z)(),x=(function(e){if(Array.isArray(e))return e}(n=(0,m.Z)("hf_funnel_first_step"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return t3(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return t3(e,2)}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],A=(0,Y.r9)(),Z=A.shouldBeTopAligned,_=A.goalsQuizStyling,E=(0,t6.Z)("greenchef_nl_migration").isEnabled,j=(0,nC.o)(),I=(0,nk.Z)(),T=Z&&(g===V.h.additionalPreference||g===V.h.goals),D=g===V.h.assuranceStep||g===V.h.assuranceAfterQuiz||g===V.h.quizIntro||g===V.h.exMomentOfAssurance,F=g===V.h.planRecommendation;(0,a.useEffect)(function(){"1"!==w||l?x("false"):x("true")},[w,x,l]);var R=O===nP.Z.HelloFreshDefaultGlobal,M=function(){return k?"global.white":"alias.elevation.base"},z=(0,i.tZ)(p.xu,{"data-test-id":"sqf-container","data-test-flow-type":O,"data-test-step-name":g,backgroundColor:M(),maxWidth:k?["100%","100%","1148px"]:d?F||j||I?["1144px","1144px","1144px"]:["100%","752px","752px"]:["100%","960px","1144px"],justifyContent:d?"unset":"center",width:"100%",marginY:k?["global.none","global.none","global.none"]:E?["global.lg-2","global.none","global.lg-2"]:["global.none","global.none","global.md-1"],marginX:"auto",paddingX:k?["global.xs","global.xs","global.xs"]:[D?"global.none":"global.sm-2","global.md-1",d||I?"global.none":"global.lg-3"],paddingY:k?["global.sm-2","global.sm-2","global.sm-2"]:["global.none",d?"global.none":"global.md-1",d||I?"global.none":"global.md-3"],display:"flex",alignItems:t?["flex-start","center"]:"center",flexDirection:"column",borderRadius:k?void 0:["global.none","border-radius-lg"],children:(0,i.tZ)(p.xu,{"data-test-id":"sqf-content",display:"flex",justifyContent:d||_||r||R?["none",d?"center":"space-between"]:"space-between",flexDirection:"column",flexGrow:t||T?[0,1]:1,width:"100%",paddingTop:d?["global.xs","global.lg-1"]:g===V.h.freeForLifeSelection||y&&g!==V.h.goalsPlanRecommendation||v&&h?["global.none"]:["global.md-1",d?"global.lg-1":"global.none"],minHeight:o?"inherit":"initial",children:u})});return f?(0,i.tZ)(p.xu,{"data-test-id":"sqf-backdrop",backgroundColor:["transparent",M(),M()],display:["block","flow-root","flow-root"],width:"100%",children:z}):z},t7=t(973524),t5=t(971584),t4=t(930780),t9=ep()(function(){return t.e(26276).then(t.bind(t,526276)).then(function(e){return e.QuizStepBanner})},{loadableGenerated:{webpack:()=>[526276]}}),re=function(e){var n=e.voucherCode,t=(0,C.Sj)(),r=(0,W.sV)().stepName,o=(0,t4.W_)().showQuizStepBanner,a=(0,Y.r9)().freeForMultiWeekBanner,l=(0,nA.z)(),u=(0,t7.Z)({voucherCode:n}).multiWeekVoucherInfo,c=null==u?void 0:u.isEligible;return"mobile"===t&&r===V.h.preferences&&c&&a.isEnabled?(0,i.tZ)(p.xu,{justifyContent:"center",display:"flex",children:(0,i.tZ)(t5.Z,{numberOfWeeks:u.numberOfWeeks||0,backgroundImageUrl:a.backgroundImageUrl})}):(0,i.tZ)(s.Z,{scope:"single-questions-social-proof-banner",fallback:(0,i.tZ)(i.HY,{}),children:o&&!l&&(0,i.tZ)(p.xu,{"data-test-id":"quizStepBanner",children:(0,i.tZ)(t9,{stepName:r})})})},rn=t(857660),rt=t(521732),rr=t(975453),ro=t(290051),ri=t(292282),ra=function(e){var n,t,r=e.isDisabled,o=e.isLoading,a=e.isLastStep,l=e.isClient,u=e.programsRedirectIsLoading,c=e.directToNextPage,d=e.handlePreferencePopoverVisibility,f=e.stepName,v=e.setPreferencesStepVisited,h=e.onBack,m=e.mealSelectionEditSaveSticky,b=e.productHandle,g=e.isFirstStep,S=(0,y.t)(),P=(0,nh.ZP)("funnel.plans.singleQuestionFlow"),O=P.translate,w=P.translateRaw,k=(0,nA.z)(),x=(0,nk.Z)(),C=f===V.h.zipCode||f===V.h.exDesktopZipCode,A=C||g;return(0,i.tZ)(s.Z,{scope:"single-plans-page-cta-with-back-button",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(p.xu,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({display:"flex",alignItems:"center",bottom:"0","data-test-id":"sqf-cta-with-back-button",width:"100%"},C&&!m?{position:"absolute"}:{}),t=t={children:m?(0,i.tZ)(p.xu,{flex:1,width:"100%",children:(0,i.tZ)(p.zx.Primary,{width:"100%","data-test-id":"meal-selection-edit-save-cta",disabled:r,loading:o,onClick:m.onSave,children:m.saveMealsButtonText})}):(0,i.BX)(i.HY,{children:[!A&&(0,i.tZ)(p.xu,{flex:x?"none":1/4,marginRight:"global.md-1",width:x?"auto":"100%",children:(0,i.tZ)(p.zx.Secondary,{"data-test-id":"single-page-back-button",disabled:r,onClick:null!=h?h:function(){return S.back()},loading:o,"aria-label":w("funnel.plans.singleQuestionFlow.backButton"),leadingIcon:k||x?void 0:(0,i.tZ)(ri.default,{}),children:O("funnel.plans.singleQuestionFlow.backButton")})}),(0,i.tZ)(p.xu,{flex:A||x?1:3/4,children:(0,i.tZ)(nz,{isDisabled:r||!l,isLoading:o||u,isLastStep:a,productHandle:b,onClick:function(){c({replaceState:!1}),d(f,v)}})})]})}
1,Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))})},rl=function(e){var n=e.children,t=(0,nx.Z)();return(0,i.tZ)(p.xu,{marginX:"auto",width:"100%",position:[t?"static":"fixed","static"],bottom:[0,"auto"],left:[0,"auto"],zIndex:[4,"auto"],backgroundColor:["alias.elevation.level-2","transparent"],boxShadow:["alias.box.md","global.none"],children:(0,i.tZ)(p.xu,{paddingTop:["global.sm-2","global.none"],paddingX:["global.sm-2","global.none"],paddingBottom:["global.sm-2","global.none"],backgroundColor:["alias.elevation.level-2","transparent"],children:n})})},ru=t(383817),rs=t(60074),rc=t(931846),rd=t(52130),rf=function(e){var n=e.pageVariationId,t=e.collectionId,r=e.contentfulStepId,o=e.campaignId;return n||t||r||o||"Unknown"},rp=function(e,n){return e.indexOf(n)},rv=function(){var e=(0,rd.L3)().trackJanusEvent,n=(0,a.useRef)(null);return{trackFunnelQuizStepImpression:(0,a.useCallback)(function(t){var r=t.stepName,o=t.stepOrder,i=t.defaultSelections,a=t.funnelId,l=t.funnelName,u=t.visitId,s=t.pageVariationId,c=t.collectionId,d=t.contentfulStepId,f=t.campaignId;try{var p=rp(o,r),v="".concat(r,":").concat(p);if(n.current===v)return;n.current=v,e(rc.U.janusEvent({configurationTrigger:rc.U.configurationTrigger({configurationId:rf({pageVariationId:s,collectionId:c,contentfulStepId:d,campaignId:f})}),funnel:rc.U.funnel({funnelId:null!=a?a:null,funnelName:null!=l?l:null,visitId:null!=u?u:null}),funnelQuizDefaultAnswer:rc.U.funnelQuizDefaultAnswer({quizDefaultAnswer:null!=i?i:"",quizDefaultAnswerPositions:null}),funnelQuizQuestion:rc.U.funnelQuizQuestion({quizQuestion:r,quizQuestionIndex:p})}))}catch(e){(0,rs.Tb)(e,{tags:{event:"PlanSelection_Card_FunnelQuizStep_Impression",component:"useFunnelQuizStepImpressionSnowplowEvent"}})}},[e])}},rh=t(809365),ry=function(){var e=(0,rd.L3)().trackJanusEvent;return{trackSubmitStepButtonClick:(0,a.useCallback)(function(n){var t,r=n.stepName,o=n.stepOrder,i=n.eventLabel,a=n.selectedOptionsIndexList,l=n.funnelId,u=n.funnelName,s=n.pageVariationId,c=n.collectionId,d=n.contentfulStepId,f=n.campaignId;try{e(rh.m.janusEvent({configurationTrigger:rh.m.configurationTrigger({configurationId:rf({pageVariationId:s,collectionId:c,contentfulStepId:d,campaignId:f})}),funnel:rh.m.funnel({funnelId:null!=l?l:null,funnelName:null!=u?u:null}),funnelQuizAnswer:rh.m.funnelQuizAnswer({quizAnswer:i||null,quizAnswerPositions:null!==(t=null==a?void 0:a[0])&&void 0!==t?t:null}),funnelQuizQuestion:rh.m.funnelQuizQuestion({quizQuestion:r,quizQuestionIndex:rp(o,r)}),uiComponent:rh.m.uiComponent({uiComponentName:"FunnelQuizStepCta",uiComponentLabel:null})}))}catch(e){(0,rs.Tb)(e,{tags:{event:"PlanSelection_Submit_Step_Button_Click",component:"useSubmitStepButtonClickSnowplowEvent"}})}},[e])}};function rm(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function rb(e,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n}function rg(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function rS(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function rP(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return rm(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rm(e,n)}}
1(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rO=["raf","share","raf-share","raf-freebie","freebies","charles"],rw=function(e,n){return(null==e?void 0:e.length)?n?e.map(function(e){var t=n.get(e);return(null==t?void 0:t.handle)||e}).filter(Boolean).join(","):e.join(","):""},rk=function(e){var n=e.selectedOptions,t=e.defaultOptions,r=e.answerMap;return{selectedOptionsValues:rw(n,r),defaultOptionsValues:rw(t,r)}},rx=function(e){var n,t=e.stepName,r=e.selectedOptionsValues,o=e.defaultOptionsValues,i=e.adults,a=e.kids,l=e.current,u=e.isHouseholdSizeStep;if("size"===t)return{eventLabel:"adults:".concat(i,"|kids:").concat(a),defaultSelections:"".concat(l)};if(u&&r.includes("adults:")){if(o&&!o.includes("adults:")){var s=parseInt(o)||0;n="adults:".concat(s,"|kids:0")}else n=o||r;return{eventLabel:r,defaultSelections:n}}return{eventLabel:r,defaultSelections:o}},rC=function(e){var n=e.stepName,t=e.stepOrder,r=e.selectedOptions,o=e.defaultOptions,i=e.answerMap,a=e.selectedOptionsIndexList,l=e.adults,u=e.kids,s=e.current,c=e.isHouseholdSizeStep,d=t.join(","),f=rk({selectedOptions:void 0===r?[]:r,defaultOptions:o,answerMap:i,stepName:n}),p=f.selectedOptionsValues,v=f.defaultOptionsValues,h=rx({stepName:n,selectedOptionsValues:p,defaultOptionsValues:v,adults:l,kids:u,current:s,isHouseholdSizeStep:c});return{orderOfSteps:d,selectedOptionsValues:p,defaultOptionsValues:v,eventLabel:h.eventLabel,defaultSelections:h.defaultSelections,selectedOptionsIndexString:rw(void 0===a?[]:a)}},rA=function(){var e=(0,nq.Z)().push,n=(0,C.Sj)(),t=(0,b.Z)(),r=(0,nU.Sz)(t),o=(0,S.Z)(),i=(0,ru.U)()||"default",l=(0,_.T)(),u=rv().trackFunnelQuizStepImpression,s=ry().trackSubmitStepButtonClick,c="funnel",d="Plans",f=(0,nG.py)({runUsingStatsig:!0}),p=f.isReady,v=f.track,h=(0,nH.O)(),y=h.id,g=h.attributes,P=rP((0,m.Z)("hf_selected_number_of_people"),1)[0],O=(0,a.useMemo)(function(){var e;try{e=P?JSON.parse(P):{}}catch(n){e={}}return e},[P]),w=O.kids,k=O.adults,x=O.current,A=function(e){var n={},t={},r=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=[];return Object.keys(e).forEach(function(i){if(!o.includes(i)){var a=e[i];if(a){var l=Array.isArray(a)?a[0]:a;r.includes(i)?n[i]=l:t[i]=l}}}),{utmParams:Object.keys(n).length>0?n:void 0,otherParams:Object.keys(t).length>0?t:void 0}},Z=function(e,n){var t,r=null===n;if(!(null===(t=window.performance)||void 0===t?void 0:t.getEntriesByType))return{};try{var o=performance.getEntriesByType("navigation")[0],i=null==o?void 0:o.type,a="reload"===i,l="undefined"!=typeof document?document.referrer:"",u=!!l&&!l.includes(window.location.hostname),s=!!l&&l.includes(window.location.hostname),c=window.location.pathname;return rg({isPageRefresh:a,isBackForward:"back_forward"===i,isDirectURL:r&&!a,navigationType:i,pathname:c},r?{referrer:l||"(direct)",isExternalReferrer:u,isInternalReferrer:s}:{})}catch(e){return{}}},E=function(t){var a=t.stepName,s=t.stepNameLabel,f=t.stepOrder,p=t.selectedOptions,v=t.defaultOptions,h=t.answerMap,y=t.selectedOptionsIndexList,m=t.campaignId,b=t.visitId,g=t.funnelId,S=t.funnelName,P=t.previousStepName,O=t.waitedForStatsig,C=t.routerQuery,_=t.contentfulStepId,E=t.isHouseholdSizeStep,j=t.stepPosition,I=t.collectionId,T=t.collectionFieldsId,D=t.pageVariationId,F=t.pageVariationFieldsId,R=l.startSpan("funnel.tracking-v2-step-loaded-ga");try{var M,z,N=Z(a,null!=P?P:null),L=C?A(C):{utmParams:void 0,otherParams:void 0},q=L.utmParams,G=L.otherParams,H=G?Object.entries(G).map(function(e){var n=rP(e,2),t=n[0],r=n[1];return"".concat(t,"=").concat(r)}
1).join("&"):void 0,U="SelectPlan_FunnelLoadStep",B=rC({stepName:a,stepOrder:f,selectedOptions:void 0===p?[]:p,defaultOptions:v,answerMap:h,selectedOptionsIndexList:void 0===y?[]:y,adults:k,kids:w,current:x,isHouseholdSizeStep:E}),Q=B.orderOfSteps,W=B.eventLabel,V=B.defaultSelections,J=B.selectedOptionsIndexString;e(rg({event_name:U,viewport:n,screen:d,brand:o,plan_type:i,event:"gaEventTrigger",gaEventCategory:c,gaEventAction:s,gaEventLabel:W,default_selections:V,stepOrder:Q,positions_selected:J},r,m?{commsConfigId:m}:{},b?{visit_id:b}:{},g?{funnel_id:g}:{},S?{funnel_name:S}:{},_?{contentful_step_id:_}:{},I?{collection_id:I}:{},T?{collection_fields_id:T}:{},D?{page_variation_id:D}:{},F?{page_variation_fields_id:F}:{})),u({stepName:a,stepOrder:f,defaultSelections:V,funnelId:g,funnelName:S,visitId:b,pageVariationId:D,collectionId:I,contentfulStepId:_,campaignId:m});var K=String(null!==(M=null==q?void 0:q.utm_source)&&void 0!==M?M:"").toLowerCase();rO.includes(K)&&e(rg({event:"gaEventTrigger",event_name:"Referral_FunnelLoadStep",gaEventCategory:"anomaly-detection",gaEventAction:"funnelLoadStep",referral_code:String(null!==(z=null==G?void 0:G.c)&&void 0!==z?z:"")},g?{funnel_id:g}:{},b?{visit_id:b}:{},S?{funnel_name:S}:{})),R.setAttributes(rg({"funnel.tracking.eventName":U,"funnel.tracking.stepName":s,"funnel.tracking.brand":o,"funnel.tracking.planType":i,"funnel.tracking.gtm.pushCalled":!0,"funnel.tracking.success":!0},j?{"funnel.tracking.stepPosition":j}:{},void 0!==O?{"funnel.tracking.waitedForStatsig":O}:{},P?{"funnel.tracking.previousStepName":P}:{},g?{"funnel.tracking.funnelId":g}:{},S?{"funnel.tracking.funnelName":S}:{},b?{"funnel.tracking.visitId":b}:{},_?{"funnel.tracking.contentfulStepId":_}:{},void 0!==N.isPageRefresh?{"funnel.tracking.isPageRefresh":N.isPageRefresh}:{},void 0!==N.isBackForward?{"funnel.tracking.isBackForward":N.isBackForward}:{},void 0!==N.isDirectURL?{"funnel.tracking.isDirectURL":N.isDirectURL}:{},N.navigationType?{"funnel.tracking.navigationType":N.navigationType}:{},N.referrer?{"funnel.tracking.referrer":N.referrer}:{},void 0!==N.isExternalReferrer?{"funnel.tracking.isExternalReferrer":N.isExternalReferrer}:{},void 0!==N.isInternalReferrer?{"funnel.tracking.isInternalReferrer":N.isInternalReferrer}:{},N.pathname?{"funnel.tracking.pathname":N.pathname}:{},H?{"funnel.tracking.allUrlParams":H}:{}))}catch(e){R.setAttributes({"funnel.tracking.error":!0,"funnel.tracking.error_message":rb(e,Error)?e.message:String(e),"funnel.tracking.error_stack":rb(e,Error)?e.stack:void 0})}finally{R.end()}},j=function(e){var n=e.stepName,t=e.stepNameLabel,a=e.stepOrder,u=e.selectedOptions,s=e.defaultOptions,d=e.answerMap,f=e.selectedOptionsIndexList,p=e.campaignId,h=e.visitId,m=e.funnelId,b=e.funnelName,S=e.previousStepName,P=e.waitedForStatsig,O=e.routerQuery,C=e.contentfulStepId,_=e.isHouseholdSizeStep,E=e.stepPosition,j=e.collectionId,I=e.collectionFieldsId,T=e.pageVariationId,D=e.pageVariationFieldsId,F=l.startSpan("funnel.tracking-v2-step-loaded-statsig");try{var R=Z(n,null!=S?S:null),M=(O?A(O):{otherParams:void 0}).otherParams,z=M?Object.entries(M).map(function(e){var n=rP(e,2),t=n[0],r=n[1];return"".concat(t,"=").concat(r)}
1).join("&"):void 0,N="SelectPlan_FunnelLoadStep",L=a.indexOf(n),q=rC({stepName:n,stepOrder:a,selectedOptions:void 0===u?[]:u,defaultOptions:s,answerMap:d,selectedOptionsIndexList:void 0===f?[]:f,adults:k,kids:w,current:x,isHouseholdSizeStep:_}),G=q.orderOfSteps,H=q.selectedOptionsValues,U=q.eventLabel,B=q.defaultSelections,Q=q.selectedOptionsIndexString;v({experimentationUserId:y,experimentationUserAttributes:g,eventName:N,eventTags:rg({EventCategory:c,EventAction:t,EventLabel:U,EventStepsOrder:G,default_selections:B,brand:o,plan_type:i,positions_selected:Q},r,p?{commsConfigId:p}:{},h?{visit_id:h}:{},m?{funnel_id:m}:{},b?{funnel_name:b}:{},C?{contentful_step_id:C}:{},j?{collection_id:j}:{},I?{collection_fields_id:I}:{},T?{page_variation_id:T}:{},D?{page_variation_fields_id:D}:{})}),F.setAttributes(rg(rS(rg({"funnel.tracking.eventName":N,"funnel.tracking.stepName":t,"funnel.tracking.stepIndex":L},E?{"funnel.tracking.stepPosition":E}:{}),{"funnel.tracking.brand":o,"funnel.tracking.planType":i,"funnel.tracking.selectedOptions":H,"funnel.tracking.stepOrder":G,"funnel.tracking.success":!0,"funnel.tracking.eventLabel":U,"funnel.tracking.experimentation.trackCalled":!0}),void 0!==P?{"funnel.tracking.waitedForStatsig":P}:{},S?{"funnel.tracking.previousStepName":S}:{},m?{"funnel.tracking.funnelId":m}:{},b?{"funnel.tracking.funnelName":b}:{},h?{"funnel.tracking.visitId":h}:{},C?{"funnel.tracking.contentfulStepId":C}:{},void 0!==R.isPageRefresh?{"funnel.tracking.isPageRefresh":R.isPageRefresh}:{},void 0!==R.isBackForward?{"funnel.tracking.isBackForward":R.isBackForward}:{},void 0!==R.isDirectURL?{"funnel.tracking.isDirectURL":R.isDirectURL}:{},R.navigationType?{"funnel.tracking.navigationType":R.navigationType}:{},R.referrer?{"funnel.tracking.referrer":R.referrer}:{},void 0!==R.isExternalReferrer?{"funnel.tracking.isExternalReferrer":R.isExternalReferrer}:{},void 0!==R.isInternalReferrer?{"funnel.tracking.isInternalReferrer":R.isInternalReferrer}:{},R.pathname?{"funnel.tracking.pathname":R.pathname}:{},z?{"funnel.tracking.allUrlParams":z}:{}))}catch(e){F.setAttributes({"funnel.tracking.error":!0,"funnel.tracking.error_message":rb(e,Error)?e.message:String(e),"funnel.tracking.error_stack":rb(e,Error)?e.stack:void 0})}finally{F.end()}},I=function(t){var a=t.stepName,u=t.stepNameLabel,f=t.selectedOptions,p=t.defaultOptions,v=t.stepOrder,h=t.answerMap,y=t.selectedOptionsIndexList,m=void 0===y?[]:y,b=t.campaignId,g=t.visitId,S=t.funnelId,P=t.funnelName,O=t.previousStepName,C=t.waitedForStatsig,_=t.routerQuery,E=t.contentfulStepId,j=t.isHouseholdSizeStep,I=t.stepPosition,T=t.collectionId,D=t.collectionFieldsId,F=t.pageVariationId,R=t.pageVariationFieldsId,M=l.startSpan("funnel.tracking-v2-continue-step-ga");try{var z=Z(a,null!=O?O:null),N=(_?A(_):{otherParams:void 0}).otherParams,L=N?Object.entries(N).map(function(e){var n=rP(e,2),t=n[0],r=n[1];return"".concat(t,"=").concat(r)}
1).join("&"):void 0,q="SelectPlan_FunnelContinue",G=rC({stepName:a,stepOrder:v,selectedOptions:void 0===f?[]:f,defaultOptions:p,answerMap:h,selectedOptionsIndexList:m,adults:k,kids:w,current:x,isHouseholdSizeStep:j}),H=G.orderOfSteps,U=G.eventLabel,B=G.defaultSelections,Q=G.selectedOptionsIndexString;e(rg({event_name:q,event:"gaEventTrigger",viewport:n,screen:d,brand:o,plan_type:i,gaEventCategory:c,gaEventAction:u,gaEventLabel:U,default_selections:B,stepOrder:H,positions_selected:Q},r,b?{commsConfigId:b}:{},g?{visit_id:g}:{},S?{funnel_id:S}:{},P?{funnel_name:P}:{},E?{contentful_step_id:E}:{},T?{collection_id:T}:{},D?{collection_fields_id:D}:{},F?{page_variation_id:F}:{},R?{page_variation_fields_id:R}:{})),s({stepName:a,stepOrder:v,eventLabel:U,selectedOptionsIndexList:m,funnelId:S,funnelName:P,pageVariationId:F,collectionId:T,contentfulStepId:E,campaignId:b}),M.setAttributes(rg({"funnel.tracking.eventName":q,"funnel.tracking.stepName":u,"funnel.tracking.brand":o,"funnel.tracking.planType":i,"funnel.tracking.gtm.pushCalled":!0,"funnel.tracking.success":!0},I?{"funnel.tracking.stepPosition":I}:{},void 0!==C?{"funnel.tracking.waitedForStatsig":C}:{},O?{"funnel.tracking.previousStepName":O}:{},S?{"funnel.tracking.funnelId":S}:{},P?{"funnel.tracking.funnelName":P}:{},g?{"funnel.tracking.visitId":g}:{},E?{"funnel.tracking.contentfulStepId":E}:{},void 0!==z.isPageRefresh?{"funnel.tracking.isPageRefresh":z.isPageRefresh}:{},void 0!==z.isBackForward?{"funnel.tracking.isBackForward":z.isBackForward}:{},void 0!==z.isDirectURL?{"funnel.tracking.isDirectURL":z.isDirectURL}:{},z.navigationType?{"funnel.tracking.navigationType":z.navigationType}:{},L?{"funnel.tracking.allUrlParams":L}:{}))}catch(e){M.setAttributes({"funnel.tracking.error":!0,"funnel.tracking.error_message":rb(e,Error)?e.message:String(e),"funnel.tracking.error_stack":rb(e,Error)?e.stack:void 0})}finally{M.end()}},T=function(e){var n=e.stepName,t=e.stepNameLabel,a=e.selectedOptions,u=e.defaultOptions,s=e.stepOrder,d=e.answerMap,f=e.selectedOptionsIndexList,p=e.campaignId,h=e.visitId,m=e.funnelId,b=e.funnelName,S=e.previousStepName,P=e.waitedForStatsig,O=e.routerQuery,C=e.contentfulStepId,_=e.isHouseholdSizeStep,E=e.stepPosition,j=e.collectionId,I=e.collectionFieldsId,T=e.pageVariationId,D=e.pageVariationFieldsId,F=l.startSpan("funnel.tracking-v2-continue-step-statsig");try{var R=Z(n,null!=S?S:null),M=(O?A(O):{otherParams:void 0}).otherParams,z=M?Object.entries(M).map(function(e){var n=rP(e,2),t=n[0],r=n[1];return"".concat(t,"=").concat(r)}
1).join("&"):void 0,N="SelectPlan_FunnelContinue",L=s.indexOf(n),q=rC({stepName:n,stepOrder:s,selectedOptions:void 0===a?[]:a,defaultOptions:u,answerMap:d,selectedOptionsIndexList:void 0===f?[]:f,adults:k,kids:w,current:x,isHouseholdSizeStep:_}),G=q.orderOfSteps,H=q.selectedOptionsValues,U=q.eventLabel,B=q.defaultSelections,Q=q.selectedOptionsIndexString;v({experimentationUserId:y,experimentationUserAttributes:g,eventName:N,eventTags:rg({brand:o,EventCategory:c,EventAction:t,EventLabel:U,EventStepsOrder:G,default_selections:B,plan_type:i,positions_selected:Q},r,p?{commsConfigId:p}:{},h?{visit_id:h}:{},m?{funnel_id:m}:{},b?{funnel_name:b}:{},C?{contentful_step_id:C}:{},j?{collection_id:j}:{},I?{collection_fields_id:I}:{},T?{page_variation_id:T}:{},D?{page_variation_fields_id:D}:{})}),F.setAttributes(rg(rS(rg({"funnel.tracking.eventName":N,"funnel.tracking.stepName":t,"funnel.tracking.stepIndex":L},E?{"funnel.tracking.stepPosition":E}:{}),{"funnel.tracking.brand":o,"funnel.tracking.planType":i,"funnel.tracking.selectedOptions":H,"funnel.tracking.stepOrder":s.join(","),"funnel.tracking.success":!0,"funnel.tracking.eventLabel":U,"funnel.tracking.experimentation.trackCalled":!0}),void 0!==P?{"funnel.tracking.waitedForStatsig":P}:{},S?{"funnel.tracking.previousStepName":S}:{},m?{"funnel.tracking.funnelId":m}:{},b?{"funnel.tracking.funnelName":b}:{},h?{"funnel.tracking.visitId":h}:{},C?{"funnel.tracking.contentfulStepId":C}:{},void 0!==R.isPageRefresh?{"funnel.tracking.isPageRefresh":R.isPageRefresh}:{},void 0!==R.isBackForward?{"funnel.tracking.isBackForward":R.isBackForward}:{},void 0!==R.isDirectURL?{"funnel.tracking.isDirectURL":R.isDirectURL}:{},R.navigationType?{"funnel.tracking.navigationType":R.navigationType}:{},z?{"funnel.tracking.allUrlParams":z}:{}))}catch(e){F.setAttributes({"funnel.tracking.error":!0,"funnel.tracking.error_message":rb(e,Error)?e.message:String(e),"funnel.tracking.error_stack":rb(e,Error)?e.stack:void 0})}finally{F.end()}};return{trackContinueOnNextStepV2:function(e){I(e),T(e)},trackContinueOnNextStepV2_GA:I,trackContinueOnNextStepV2_Statsig:T,trackStepLoadedV2:function(e){E(e),j(e)},trackStepLoadedV2_GA:E,trackStepLoadedV2_Statsig:j,trackBackToPreviousStepV2:(0,a.useCallback)(function(t){var a=t.stepName,u=t.stepNameLabel,s=t.previousStepName,f=t.stepOrder,h=t.campaignId,m=t.visitId,b=t.funnelId,S=t.funnelName,P=t.contentfulStepId,O=t.collectionId,w=t.collectionFieldsId,k=t.pageVariationId,x=t.pageVariationFieldsId,C=l.startSpan("funnel.tracking-v2-back-step");
1try{var A="SelectPlan_FunnelBack",Z=f.join(","),_=rg({},h?{commsConfigId:h}:{},m?{visit_id:m}:{},b?{funnel_id:b}:{},S?{funnel_name:S}:{},P?{contentful_step_id:P}:{},O?{collection_id:O}:{},w?{collection_fields_id:w}:{},k?{page_variation_id:k}:{},x?{page_variation_fields_id:x}:{});e(rg({event_name:A,event:"gaEventTrigger",viewport:n,screen:d,brand:o,plan_type:i,gaEventCategory:c,gaEventAction:u,gaEventLabel:s,stepOrder:Z},r,_)),p&&v({experimentationUserId:y,experimentationUserAttributes:g,eventName:A,eventTags:rg({brand:o,EventCategory:c,EventAction:u,EventLabel:s,EventStepsOrder:Z,plan_type:i},r,_)}),C.setAttributes(rg({"funnel.tracking.eventName":A,"funnel.tracking.stepName":u,"funnel.tracking.stepIndex":f.indexOf(a),"funnel.tracking.previousStepName":s,"funnel.tracking.brand":o,"funnel.tracking.planType":i,"funnel.tracking.stepOrder":Z,"funnel.tracking.gtm.pushCalled":!0,"funnel.tracking.experimentation.trackCalled":p,"funnel.tracking.success":!0},b?{"funnel.tracking.funnelId":b}:{},S?{"funnel.tracking.funnelName":S}:{},m?{"funnel.tracking.visitId":m}:{},P?{"funnel.tracking.contentfulStepId":P}:{}))}catch(e){C.setAttributes({"funnel.tracking.error":!0,"funnel.tracking.error_message":rb(e,Error)?e.message:String(e),"funnel.tracking.error_stack":rb(e,Error)?e.stack:void 0})}finally{C.end()}},[e,v,p,y,g,n,o,i,r,l]),trackFunnelNameResolvedV2:(0,a.useCallback)(function(t){var a=t.funnelId,l=t.funnelName,u=t.visitId,s=t.customerPublicId,f=t.collectionId,p=t.collectionFieldsId,h=t.pageVariationId,m=t.pageVariationFieldsId,b="SelectPlan_Fu
1nnelNameResolved",S=s||y;e(rg({event_name:b,viewport:n,screen:d,brand:o,plan_type:i,event:"gaEventTrigger",gaEventCategory:c,gaEventAction:"funnelNameResolved"},r,a?{funnel_id:a}:{},l?{funnel_name:l}:{},u?{visit_id:u}:{},S?{customer_public_id:S}:{},f?{collection_id:f}:{},p?{collection_fields_id:p}:{},h?{page_variation_id:h}:{},m?{page_variation_fields_id:m}:{})),v({experimentationUserId:y,experimentationUserAttributes:g,eventName:b,eventTags:rg({EventCategory:c,EventAction:"funnelNameResolved",brand:o,plan_type:i},r,a?{funnel_id:a}:{},l?{funnel_name:l}:{},u?{visit_id:u}:{},S?{customer_public_id:S}:{},f?{collection_id:f}:{},p?{collection_fields_id:p}:{},h?{page_variation_id:h}:{},m?{page_variation_fields_id:m}:{})})},[y,g,n,o,i,r,e,v]),isReady:p}},rZ=function(e){var n=e.stepName,t=e.selectedPreferences,r=e.selectedAdditionalPreferences,o=e.selectedGoals,i=e.goalsQuizSelectedGoals,a=e.selectedNumberOfPeople,l=e.selectedMealsPerDay,u=e.selectedDaysPerWeek,s=e.selectedOptions,c=e.storedMealTypes,d=e.meals,f=e.size,p=e.product,v=e.zipcode,h=e.getCurrentStepExclusions,y=e.selectedSurveyResponses,m=e.selectedSurveyResponseText,b=e.cookingFrequency,g=e.selectedGenericStepAnswers,S=e.isHouseholdSizeStep,P=e.contentfulStepContent,O=e.selectedGenericStepIndexList;switch(n){case V.h.preferences:case V.h.exPreferences:case V.h.exDietaryPreferences:return t;case V.h.additionalPreference:return r;case V.h.goals:case V.h.exGoalsStep:case V.h.exFJGoalsStep:return o;case V.h.goalsQuiz:return i;case V.h.proteinExclusion:case V.h.newExclusionsProteins:case V.h.newExclusionsIngredients:case V.h.exIngredientExclusions:case V.h.exFJProteinExclusions:case V.h.exFJIngredientExclusions:return h(n);case V.h.goalsPlanNumberOfPeople:case V.h.exHouseholdSize:case V.h.exFJHouseholdSize:return a?[a]:[];case V.h.goalsPlanMealsPerDay:case V.h.exFJMealsPerDay:return l?[l]:[];case V.h.goalsPlanMealsPerWeek:case V.h.exFJMealsPerWeek:return u?[u]:[];case V.h.goalsPlanRecommendation:return(null==p?void 0:p.handle)?[p.handle]:s.map(function(e){return e.toString()});case V.h.mealTypeStep:return c?JSON.parse(c).map(function(e){return e.name}):[];case V.h.exMealType:if(y.size>0)return Array.from(y);return[];case V.h.meals:return d?[d.toString()]:[];case V.h.size:return f?[f.toString()]:[];case V.h.planRecommendation:case V.h.planRecommendationV2:return p?[p.handle]:[];case V.h.zipCode:case V.h.exZipCode:case V.h.exFJZipCode:return v?[v]:[];case V.h.exCookingFrequency:return b?[b]:[];case V.h.genericStep:case V.h.default:if(S&&a)return[a];if((P||[]).some(function(e){return"planRecommendation"===e.contentTypeId})&&(null==p?void 0:p.handle))return[p.handle];if(!O||0===O.length)return[];return g;default:if(y.size>0)return Array.from(y);return m?[m]:[]}};function r_(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function rE(e){return function(e){if(Array.isArray(e))return r_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return r_(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r_(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rj=function(e,n){var t=[],r=[];return e.forEach(function(e,o){var i=e.answer_handle||e.text,a=i?null==n?void 0:n[i]:void 0;if((null==a?void 0:a.like)||(null==a?void 0:a.dislike)||(null==a?void 0:a.neutral)){var l=0;a.like?l=100:a.dislike&&(l=-100),t.push("".concat(e.text,":").concat(l)),r.push(o)}}),{labels:t,positions:r}},rI=function(e,n){var t=e.map(function(e){var t=n.find(function(n){return n.answer_id===e||n.answer_handle===e||n.text===e});return(null==t?void 0:t.answer_handle)||(null==t?void 0:t.text)||e}),r=t.map(function(e){return n.findIndex(function(n){return n.answer_handle===e||n.text===e})}).filter(function(e){return -1!==e});return{labels:t,indices:r}},rT=function(e,n){var t=e.map(function(e){var t=n.find(function(n){return n.id===e||n.answerKey===e||n.title===e});
1return(null==t?void 0:t.answerKey)||(null==t?void 0:t.title)||e}),r=t.map(function(e){return n.findIndex(function(n){return n.answerKey===e||n.title===e})}).filter(function(e){return -1!==e});return{labels:t,indices:r}},rD=function(e){var n=e.getStepSelectedOptions,t=e.goalsQuizSelectedGoals,r=e.originalGoalsOptions,o=e.selectedGoalsIndexList,i=e.selectedAdditionalPreferences,l=e.selectedAdditionalPreferencesIndexList,u=e.dataFromQuestionnaireService,s=e.plansConfigData,c=e.defaultPreference,d=e.questionnaireQuestion,f=e.ratings,p=e.selectedPreferences,v=e.size,h=e.householdSizeForTracking,y=e.product,m=e.zipcodeForTracking,b=e.cookingFrequencyForTracking,g=e.contentfulStepName,S=e.contentfulItemsMap,P=e.contentfulStepContent,O=e.currentQuestionDefaultRef,w=e.currentStepAnswersRef;return(0,a.useCallback)(function(e){var a,k,x,C,A,Z,_=n(e),E=[],j=[],I=e===V.h.exHouseholdSize||e===V.h.exFJHouseholdSize||e===V.h.exDesktopHouseholdSize,T=(e===V.h.default||e===V.h.genericStep)&&"HouseholdSize"===g,D=I||T;if((P||[]).some(function(e){return"planRecommendation"===e.contentTypeId}))return{selectedOptionsForTracking:(null==y?void 0:y.handle)?[y.handle]:_,selectedOptionsIndexList:y?[0]:[],defaultOptionsForTracking:(null==c?void 0:c.handle)?[c.handle]:[]};var F=(P||[]).filter(function(e){return"question"===e.contentTypeId||"conditionalContent"===e.contentTypeId&&"questions"===e.contentType});if(!D&&F.length>0){var R,M,z=null===(R=F[0])||void 0===R?void 0:R.handle,N=null==w?void 0:w.current,L=!!z&&!!N&&N.handle===z,q=L&&N?rE(N.positions):[],G=L&&N?rE(N.answers):[],H=null!==(M=null==O?void 0:O.current)&&void 0!==M?M:[];return{selectedOptionsForTracking:G.length>0?G:H,selectedOptionsIndexList:q,defaultOptionsForTracking:rE(H)}}switch(e){case V.h.goalsQuiz:E=t.map(function(e){return r.findIndex(function(n){return n===e})}).filter(function(e){return -1!==e});break;case V.h.goals:case V.h.exGoalsStep:E=o;break;case V.h.additionalPreference:var U=null==u?void 0:u.questions.find(function(e){return"dietary-preferences"===e.question_handle});_=i.map(function(e){var n,t=null==U?void 0:null===(n=U.answer_choices)||void 0===n?void 0:n.find(function(n){return n.text===e});return(null==t?void 0:t.answer_handle)||(null==t?void 0:t.text)||""}),E=l;break;case V.h.preferences:case V.h.exPreferences:case V.h.exDietaryPreferences:j=(null==s?void 0:null===(k=s.config)||void 0===k?void 0:null===(a=k.preferences)||void 0===a?void 0:a.filter(function(e){return e.default}).map(function(e){return e.preferenceName}))||[],p.length>0&&(null==s?void 0:null===(x=s.config)||void 0===x?void 0:x.preferences)&&(E=p.map(function(e){return s.config.preferences.findIndex(function(n){return n.preferenceName===e})}).filter(function(e){return -1!==e}));break;case V.h.meals:j=(null==c?void 0:null===(C=c.specs)||void 0===C?void 0:C.meals)?[c.specs.meals.toString()]:[];break;case V.h.size:case V.h.exHouseholdSize:j=(null==c?void 0:null===(A=c.specs)||void 0===A?void 0:A.size)?[c.specs.size.toString()]:[],(v||h)&&(E=[0]);break;case V.h.planRecommendation:case V.h.planRecommendationV2:j=(null==c?void 0:c.handle)?[c.handle]:[],y&&(E=[0]);break;case V.h.zipCode:case V.h.exZipCode:m&&(E=[0]);break;case V.h.exCookingFrequency:b&&(E=[0]);break;case V.h.genericStep:case V.h.default:D&&(j=(null==c?void 0:null===(Z=c.specs)||void 0===Z?void 0:Z.size)?[c.specs.size.toString()]:[],h&&(E=[0]));break;case V.h.exProteinPreferences:case V.h.exFlavorPreferences:case V.h.exCuisinePreference:if((null==_?void 0:_.length)>0){if(null==d?void 0:d.answer_choices){var B=rI(_,d.answer_choices);_=B.labels,E=B.indices}else{var Q=S[e];if(Q){var W=rT(_,Q);_=W.labels,E=W.indices}}}break;case V.h.exDesktopCuisine:case V.h.exDesktopFlavors:case V.h.exDesktopProteins:case V.h.exDesktopDinnerType:var J=rj((null==d?void 0:d.answer_choices)||[],f);_=rE(J.labels),E=rE(J.positions);break;case V.h.exNutritionPreferences:if((null==d?void 0:d.answer_choices)&&(null==_?void 0:_.length)>0){var K=rI(_,d.answer_choices);_=K.labels,E=K.indices}break;default:if((null==d?void 0:d.answer_choices)&&(null==_?void 0:_.length)>0){var Y=rI(_,d.answer_choices);_=Y.labels,E=Y.indices}}return{selectedOptionsForTracking:_,selectedOptionsIndexList:E,defaultOptionsForTracking:j}},[n,t,r,o,i,l,u,s,c,d,f,p,v,h,y,m,b,g,S,P,O,w])},rF=t(966259),rR=t(108243),rM=t(618213),rz=function(e){var n=e.saveMealsButtonText,t=e.onSave,r=e.isDisabled,o=e.isLoading;return(0,i.tZ)(p.zx.Primary,{width:"100%","data-test-id":"meal-selection-edit-save-cta",disabled:!!r,loading:!!o,onClick:t,children:n})},rN=t(254717),rL=function(e){var n=e.showBackButton,t=e.isDisabled,r=e.isLoading,o=e.onNext,a=e.onBack,l=e.secondaryButtonLabel,u=e.mealSelectionEditSaveOnly,s=(0,nh.ZP)("funnel.plans.single-question-flow").translate;return u?(0,i.tZ)(rl,{children:(0,i.tZ)(rz,{saveMealsButtonText:u.saveMealsButtonText,onSave:u.onSave,isDisabled:t,isLoading:r})}):(0,i.tZ)(rl,{children:(0,i.BX)(p.xu,{display:"flex",gap:"global.sm-1",children:[n&&(0,i.tZ)(p.xu,{children:(0,i.tZ)(p.zx.Secondary,{"data-test-id":rN.Ve,id:rN.Ve,disabled:!!r,onClick:a,children:null!=l?l:s("funnel.plans.single-question-flow.extended.cta.back",{defaultValue:"Back"})})}),(0,i.tZ)(p.xu,{flex:1,children:(0,i.tZ)(p.zx.Primary,{"data-test-id":rN.YI,id:rN.YI,disabled:!!t,loading:!!r,onClick:function(){o({replaceState:!1})},children:s("funnel.plans.single-question-flow.extended.cta.next",{defaultValue:"Next"})})})]})})},rq=t(518113),rG=t(345889),rH=t(599506),rU=t(411218),rB=t(111109);function rQ(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var rW=function(e){var n,t=e.onNext,r=(0,nh.ZP)("funnel.plans.single-question-flow").translate,o=(function(e){if(Array.isArray(e))return e}(n=(0,rH.Z)())||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return rQ(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rQ(e,2)}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],a=(0,rU.E)().trackSkipMealSelectionClick,l=function(e){e.preventDefault(),a(),t({replaceState:!1}),o({type:"CLEAR_CART"})};return(0,rB.MH)()?(0,i.tZ)(p.xu,{display:"flex",justifyContent:"center",children:(0,i.tZ)(p.rU,{href:"#","data-test-id":"factor-extended-funnel-skip-button",onClick:function(e){l(e)},onKeyDown:function(e){("Enter"===e.key||" "===e.key)&&l(e)},children:r("funnel.plans.single-question-flow.mealselection.cta.skip",{defaultValue:"Skip"})})}):null},rV=t(967352),rJ=t(818095),rK=t(425633),rY=t(135596),r$=function(e){var n,t,r=e.showBackButton,o=e.isDisabled,a=e.isLoading,l=e.onNext,u=e.onBack,s=e.secondaryButtonLabel,c=e.mealSelectionEditSaveOnly,d=(0,rB.ZP)(),f=(0,rJ.z)().matchedSystemContentType,v=(0,rK.mB)(),h=null!==(n=null==v?void 0:v.view)&&void 0!==n?n:"edit",y=null!==(t=null==v?void 0:v.setView)&&void 0!==t?t:function(){},m="mealSelection"===f&&d&&"browse"===h;return c?(0,i.tZ)(rl,{children:(0,i.BX)(p.xu,{display:"flex",flexDirection:"column",gap:"global.sm-1",children:[(0,i.BX)(p.xu,{display:"flex",gap:"global.sm-1",children:[d&&(0,i.tZ)(p.xu,{children:(0,i.tZ)(p.zx.Secondary,{"data-test-id":rY.hP,disabled:!!a,onClick:u,children:null!=s?s:"Back"})}),(0,i.tZ)(p.xu,{flex:1,children:(0,i.tZ)(rz,{saveMealsButtonText:c.saveMealsButtonText,onSave:function(){c.onSave()},isDisabled:o,isLoading:a})})]}),(0,i.tZ)(rW,{onNext:l})]})}):(0,i.tZ)(rl,{children:(0,i.BX)(p.xu,{display:"flex",gap:"global.sm-1",maxWidth:["100%","377px"],marginX:"auto",flexDirection:"column",children:[m&&(0,i.tZ)(p.xu,{marginBottom:"global.md-1",children:(0,i.tZ)(rV.Z,{isCartOpen:!0})}),(0,i.BX)(p.xu,{display:"flex",flexDirection:"row",gap:"global.sm-1",children:[r&&(0,i.tZ)(p.xu,{children:(0,i.tZ)(p.zx.Secondary,{"data-test-id":rY.hP,disabled:!!a,onClick:function(){m?y("edit"):null==u||u()},children:null!=s?s:"Back"})}),(0,i.tZ)(p.xu,{flex:1,children:(0,i.tZ)(p.zx.Primary,{"data-test-id":rY.li,disabled:!!o,loading:!!a,onClick:function(){l({replaceState:!1})},children:"Next"})})]})]})})},rX=t(987077),r0=t(94297);function r1(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var r2={answers:[],indices:[]},r6=function(e){var n,t=(function(e){if(Array.isArray(e))return e}(n=(0,m.Z)(r0.Z))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,n){if(e){if("string"==typeof e)return r1(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r1(e,1)}}(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,a.useMemo)(function(){if(!t||!e)return r2;try{var n=JSON.parse(t),r=e.content.find(function(e){return"question"===e.contentTypeId}),o=(null==r?void 0:r.handle)||"",i=n[e.name||""],a=n[o],l=[];if(Array.isArray(i)&&i.length>0?l=i:Array.isArray(a)&&(l=a),0===l.length)return r2;var u=(null==r?void 0:r.answers)||[],s=l.map(function(e){return u.findIndex(function(n){return n.handle===e||n.id===e})}).filter(function(e){return -1!==e});return{answers:l,indices:s}}catch(e){return r2}},[t,e])},r3=t(477765),r8=function(e){var n=e.isDisabled,t=e.systemContentType;return n&&"mealSelection"!==t},r7=t(237369),r5=t(852965),r4=t(872728),r9=t(729471),oe=function(e){var n=e.children,t=(0,W.sV)().step,r=(0,r9.X)(t),o=(0,r4.Tb)(r),l=(0,a.useMemo)(function(){return(0,r3.R)(o)},[o]);return(0,i.tZ)(rK.JW,{isMealSelectionStep:l,children:n})},on=t(479922);function ot(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}function or(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var oo=function(e){var n,t=e.id,r=e.goToNextPage,o=(0,a.useRef)(null),l=(0,ta.Z)(),u=(0,_.T)(),s=(0,nq.Z)().push,c=(0,tI.Z)().trackStatsigEvent,d=(0,a.useRef)(!1),f=(0,on.Z)(),v=(0,h.Z)(),y=v.funnelId,m=v.funnelName;(0,a.useEffect)(function(){if(!d.current){var e="ExpressCheckoutContinueApplePayButtonShow",n="continue with applepay show on plan selection step - phase 2",t=or({},y?{funnel_id:y}:{},m?{funnel_name:m}:{});s(or({event:"gaEventTrigger",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:e,gaEventLabel:n,event_name:"CheckoutAddress_ApplePayContinueShow"},t)),c({eventName:"Checkout_ExpressContinueApplePayDisplay",eventTags:or({EventCategory:"Payments_ExpressCheckout",EventAction:e,EventLabel:n},t)}
1),d.current=!0}},[s,c,y,m]);var b=a.useCallback((n=function(){var e,n,t,o,i,a,l;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(d){switch(d.label){case 0:e=u.startSpan("apple-pay-continue-button-click"),d.label=1;case 1:if(d.trys.push([1,3,4,5]),"function"!=typeof r)return e.setStatus({code:n6.Z.ERROR,message:"goToNextPage is not a function"}),[2];return t="ExpressCheckoutContinueApplePayButtonClick",o="continue with applepay click on plan selection step - phase 2",i=or({},y?{funnel_id:y}:{},m?{funnel_name:m}:{}),s(or({event:"gaEventTrigger",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:t,gaEventLabel:o,event_name:"CheckoutAddress_ApplePayContinueClick",screen:"Plans step"},i)),c({eventName:"Checkout_ExpressContinueApplePayClick",eventTags:or({EventCategory:"Payments_ExpressCheckout",EventAction:t,EventLabel:o,screen:"Plans step"},i)}),[4,r()];case 2:return a=d.sent(),null==f||null===(n=f.track)||void 0===n||n.call(f,"ExpressCheckoutPhase2_ContinueWithApplePayClick"),e.setAttribute("navigation_success",a),a?e.setStatus({code:n6.Z.OK}):e.setStatus({code:n6.Z.ERROR,message:"Navigation failed"}),[3,5];case 3:var p;return l=d.sent(),e.recordException(l),e.setStatus({code:n6.Z.ERROR,message:(null!=(p=Error)&&"undefined"!=typeof Symbol&&p[Symbol.hasInstance]?!!p[Symbol.hasInstance](l):l instanceof p)?l.message:"Unknown error"}),[3,5];case 4:return e.end(),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){ot(i,r,o,a,l,"next",e)}function l(e){ot(i,r,o,a,l,"throw",e)}a(void 0)})}),[r,u,s,c,f,y,m]),g=a.useCallback(function(){b()},[b]);return(0,a.useEffect)(function(){var e=null,n=!1;if(document.querySelector('script[src*="apple-pay-sdk.js"]'))n=!0;else{var t=document.createElement("script");t.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",t.crossOrigin="anonymous",t.onload=function(){n=!0},document.head.appendChild(t)}var r=setInterval(function(){n&&window.ApplePaySession&&o.current&&(o.current.querySelector("apple-pay-button")||((e=document.createElement("apple-pay-button")).setAttribute("buttonstyle","black"),e.setAttribute("type","continue"),e.setAttribute("locale",l),e.setAttribute("data-test-id","express-checkout-continue-with-apple-pay-button"),e.addEventListener("click",function(){g()}),o.current.appendChild(e)),clearInterval(r))},100);return function(){clearInterval(r),e&&e.removeEventListener("click",g)}},[l,g]),(0,i.BX)(i.HY,{children:[(0,i.tZ)("style",{children:"\n        apple-pay-button {\n          --apple-pay-button-width: 100%;\n          --apple-pay-button-height: 48px;\n          --apple-pay-button-border-radius: 6px;\n          --apple-pay-button-margin: 0px 0px 10px 0px;\n          --apple-pay-button-padding: 6px 0px;\n          --apple-pay-button-box-sizing: border-box;\n        }\n      "}),(0,i.tZ)(p.xu,{display:"flex","data-test-id":t,children:(0,i.tZ)("div",{role:"button",tabIndex:0,style:{flexGrow:1,cursor:"pointer"},onClick:function(e){var n,t=null===(n=o.current)||void 0===n?void 0:n.querySelector("apple-pay-button");t&&t.click()},onKeyDown:function(e){if("Enter"===e.key||" "===e.key){e.preventDefault();var n,t=null===(n=o.current)||void 0===n?void 0:n.querySelector("apple-pay-button");t&&t.click()}},children:(0,i.tZ)("div",{ref:o})})})]})};function oi(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function oa(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}function ol(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function ou(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return oi(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oi(e,n)}}
1(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var os=function(e){var n,t=e.onNext,r=(0,nh.ZP)("express-checkout").translateRaw,o=(0,y.t)(),l=(0,nS.l)(),u=(0,_.T)(),s=(0,nq.Z)().push,c=(0,tI.Z)().trackStatsigEvent,d=(0,on.Z)(),f=(0,h.Z)(),v=f.funnelId,b=f.funnelName,g=ou((0,m.Z)("hf_express_checkout_redirect_from_applepay_local"),3)[2],S=ou((0,m.Z)("hf_funnel_name"),2)[1];(0,a.useEffect)(function(){b&&S(b)},[b,S]);var P=(0,a.useCallback)((n=function(){var e,n;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(t){switch(t.label){case 0:e=u.startSpan("express-checkout-2-cta-navigation"),t.label=1;case 1:return t.trys.push([1,3,4,5]),g(),l.setItem("express_checkout_visited","true"),[4,o.push({pathname:"/checkout",query:{step:"expressCheckout"}})];case 2:return t.sent(),e.setStatus({code:n6.Z.OK}),[2,!0];case 3:var r;return n=t.sent(),e.recordException(n),e.setStatus({code:n6.Z.ERROR,message:(null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)?n.message:"Unknown error"}),[2,!1];case 4:return e.end(),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){oa(i,r,o,a,l,"next",e)}function l(e){oa(i,r,o,a,l,"throw",e)}a(void 0)})}),[o,l,u,g]),O=(0,a.useCallback)(function(){var e,n="ExpressCheckoutEnterDetailsManuallyClick",r="enter details manually click on plan selection step - phase 2";s(ol({event:"gaEventTrigger",gaEventCategory:"Payments_ExpressCheckout",gaEventAction:n,gaEventLabel:r,event_name:"ExpressCheckout_EnterDetailsManuallyClick"},v?{funnel_id:v}:{},b?{funnel_name:b}:{})),c({eventName:"Checkout_ExpressEnterDetailsManualClick",eventTags:ol({EventCategory:"Payments_ExpressCheckout",EventAction:n,EventLabel:r},v?{funnel_id:v}:{},b?{funnel_name:b}:{})}),g(),t({replaceState:!1}),null==d||null===(e=d.track)||void 0===e||e.call(d,"ExpressCheckoutPhase2_Abandoned_RegularCheckout")},[s,c,d,t,v,b,g]);return(0,i.BX)(p.xu,{width:"100%",marginX:"auto",position:"fixed",bottom:[0,"auto"],left:[0,"auto"],zIndex:[4,"auto"],backgroundColor:"alias.elevation.level-2",boxShadow:"alias.box.md",paddingX:"global.sm-2",paddingTop:"global.sm-2",paddingBottom:"global.sm-1",children:[(0,i.tZ)(p.xu,{marginBottom:"global.sm-1",children:(0,i.tZ)(p.zx.Secondary,{onClick:O,children:r("express-checkout.continue-with-email")})}),(0,i.tZ)(oo,{id:"express-checkout-phase-2-continue-with-apple-pay-button",goToNextPage:P}),(0,i.tZ)(p.xu,{display:"flex",justifyContent:"center",paddingY:"global.sm-1",children:(0,i.tZ)(p.xv,{textAlign:"center",children:r("express-checkout.checkout-securely-next")})})]})},oc="--hf-sqf-express-checkout-footer-padding-bottom",od=t(809197),of=t(307495),op=t(70258),ov=t(237947),oh=function(){var e=(0,ov.o)(),n="1"===e.hf_ssr_e_gift_card_checkout;return{isGiftCardBuyer:"1"===e.hf_ssr_e_gift_card_purchase,isGiftCardRedeemer:n}},oy=function(){var e=(0,tw.H)().code,n=(0,op.Z)().isSeasonalFlow,t=oh().isGiftCardBuyer;return(0,of.Z)({voucherCode:e,isSeasonalFlow:n,isGiftCardBuyer:t})},om=function(e){var n,t=(0,nG.py)({runUsingStatsig:!0}),r=t.decide,o=t.isReady,i=(0,nS.l)(),a=null===(n=(0,y.t)().asPath)||void 0===n?void 0:n.includes("".concat("express-checkout-test","=true")),l=(0,nH.O)(),u=l.id,s=l.attributes,c=!1,d=(0,od.p)(),f=oy().shouldPerformCharge;if(a)return i.setItem("hf_express_checkout_variation","true"),i.setItem("hf_express_checkout_variation_phase_2","Variation"),{isReady:!0,isExpressCheckoutEnabled:!0};if(o&&d&&!f&&e){var p=r({experimentKey:"pcon-3987-express-checkout-phase-2",experimentationUserId:u,experimentationUserAttributes:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},s)}).variationKey;(c="Variation"===p)&&(i.setItem("hf_express_checkout_variation","true"),i.setItem("hf_express_checkout_variation_phase_2",p))}return{isReady:o,isExpressCheckoutEnabled:c}};function ob(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var og=function(e){var n,t,r=(0,nG.py)({runUsingStatsig:!0}),o=r.decide,i=r.isReady,l=(0,nH.O)(),u=l.id,s=l.attributes,c=(0,y.t)(),d=(0,C.Sj)(),f=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(!1))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return ob(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ob(e,2)}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],v=f[1];return((0,a.useEffect)(function(){v(!0)},[]),p)?d!==A.P.mobile?{isReady:!0,isExpressCheckoutPaypalEnabled:!1}:(null===(t=c.asPath)||void 0===t?void 0:t.includes("".concat("express-checkout-paypal","=true")))?{isReady:!0,isExpressCheckoutPaypalEnabled:!0}:i&&e?{isReady:!0,isExpressCheckoutPaypalEnabled:"Variation"===o({experimentKey:"pcon-4675-express-checkout-paypal",experimentationUserId:u,experimentationUserAttributes:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},s)}).variationKey}:{isReady:!1,isExpressCheckoutPaypalEnabled:!1}:{isReady:!1,isExpressCheckoutPaypalEnabled:!1}},oS=function(e){var n=e.id,t=e.onContinue,r=(0,a.useRef)(null),o=(0,ta.Z)(),l=(0,a.useRef)(t);return l.current=t,(0,a.useEffect)(function(){var e=!1,t=!1;if(document.querySelector('script[src*="apple-pay-sdk.js"]'))e=!0;else{var i=document.createElement("script");i.src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",i.crossOrigin="anonymous",i.onload=function(){e=!0},i.onerror=function(){t=!0},document.head.appendChild(i)}var a=setInterval(function(){if(t){clearInterval(a);return}if(e&&window.ApplePaySession&&r.current&&!r.current.querySelector("apple-pay-button")){var i=document.createElement("apple-pay-button");i.setAttribute("buttonstyle","black"),i.setAttribute("type","continue"),i.setAttribute("locale",o),i.setAttribute("data-test-id",n),i.addEventListener("click",function(){return l.current()}),r.current.appendChild(i),clearInterval(a)}},100);return function(){return clearInterval(a)}},[o,n]),(0,i.BX)(i.HY,{children:[(0,i.tZ)("style",{children:"\n        apple-pay-button {\n          --apple-pay-button-width: 100%;\n          --apple-pay-button-height: 48px;\n          --apple-pay-button-border-radius: 6px;\n          --apple-pay-button-box-sizing: border-box;\n        }\n      "}),(0,i.tZ)("div",{ref:r})]})},oP=function(e){var n=e.height,t=void 0===n?20:n;return(0,i.BX)("svg",{height:t,width:3.8*t,viewBox:"0 0 76 20",fill:"none",role:"img","aria-label":"PayPal",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.tZ)("path",{d:"M9.00656 0.000976562H3.16875C2.76926 0.000976562 2.42952 0.291204 2.36721 0.685571L0.00612859 15.6553C-0.0408198 15.9507 0.187946 16.217 0.487562 16.217H3.27459C3.67408 16.217 4.01382 15.9268 4.07613 15.5315L4.71292 11.494C4.77438 11.0988 5.11497 10.8085 5.5136 10.8085H7.36166C11.2072 10.8085 13.4265 8.94766 14.0061 5.26007C14.2673 3.64674 14.0172 2.37913 13.2618 1.49138C12.4321 0.516557 10.9605 0.000976562 9.00656 0.000976562ZM9.68006 5.46835C9.36081 7.5631 7.7603 7.5631 6.21271 7.5631H5.33178L5.9498 3.65101C5.9865 3.41456 6.19137 3.24042 6.43038 3.24042H6.83413C7.88834 3.24042 8.88279 3.24042 9.39666 3.84137C9.70311 4.19988 9.797 4.73253 9.68006 5.46835Z",fill:"#253B80"}),(0,i.tZ)("path",{d:"M26.4569 5.40061H23.6613C23.4232 5.40061 23.2175 5.57474 23.1808 5.81119L23.057 6.5931L22.8615 6.3097C22.2563 5.43134 20.9068 5.1377 19.5598 5.1377C16.4706 5.1377 13.8321 7.47744 13.3182 10.7596C13.051 12.3968 13.4309 13.9623 14.3596 15.0541C15.2115 16.0579 16.4304 16.4762 17.8807 16.4762C20.3698 16.4762 21.7501 14.8757 21.7501 14.8757L21.6255 15.6525C21.5785 15.9495 21.8073 16.2158 22.1052 16.2158H24.6234C25.0237 16.2158 25.3617 15.9256 25.4249 15.5304L26.9358 5.96228C26.9836 5.66779 26.7557 5.40061 26.4569 5.40061ZM22.5602 10.8415C22.2905 12.4386 21.0228 13.5108 19.4061 13.5108C18.5943 13.5108 17.9456 13.2504 17.529 12.757C17.1159 12.267 16.9588 11.5696 17.0903 10.7929C17.3421 9.20941 18.631 8.10228 20.223 8.10228C21.0169 8.10228 21.6622 8.36605 22.0873 8.8637C22.5132 9.36648 22.6823 10.0681 22.5602 10.8415Z",fill:"#253B80"}),(0,i.tZ)("path",{d:"M41.3454 5.40039H38.5362C38.2682 5.40039 38.0163 5.53355 37.8644 5.75635L33.9899 11.4636L32.3475 5.97914C32.2443 5.63599 31.9276 5.40039 31.569 5.40039H28.8085C28.473 5.40039 28.24 5.72818 28.3467 6.04401L31.441 15.1247L28.5319 19.2314C28.3031 19.5549 28.5336 19.9997 28.9288 19.9997H31.7346C32.001 19.9997 32.2502 19.8699 32.4013 19.6514L41.7449 6.16437C41.9686 5.84171 41.7389 5.40039 41.3454 5.40039Z",fill:"#253B80"}),(0,i.tZ)("path",{d:"M50.6463 0.000976562H44.8077C44.409 0.000976562 44.0693 0.291204 44.007 0.685571L4
11.6459 15.6553C41.599 15.9507 41.8277 16.217 42.1256 16.217H45.1218C45.4001 16.217 45.6382 16.0138 45.6818 15.7373L46.3519 11.494C46.4133 11.0988 46.7539 10.8085 47.1525 10.8085H48.9997C52.8461 10.8085 55.0646 8.94766 55.6451 5.26007C55.9071 3.64674 55.6553 2.37913 54.8999 1.49138C54.071 0.516557 52.6003 0.000976562 50.6463 0.000976562ZM51.3198 5.46835C51.0015 7.5631 49.4009 7.5631 47.8525 7.5631H46.9724L47.5913 3.65101C47.628 3.41456 47.8312 3.24042 48.071 3.24042H48.4748C49.5281 3.24042 50.5234 3.24042 51.0373 3.84137C51.3437 4.19988 51.4368 4.73253 51.3198 5.46835Z",fill:"#179BD7"}),(0,i.tZ)("path",{d:"M68.0958 5.40061H65.3019C65.0621 5.40061 64.8581 5.57474 64.8222 5.81119L64.6984 6.5931L64.5021 6.3097C63.8969 5.43134 62.5482 5.1377 61.2012 5.1377C58.112 5.1377 55.4744 7.47744 54.9605 10.7596C54.6942 12.3968 55.0723 13.9623 56.001 15.0541C56.8546 16.0579 58.0719 16.4762 59.5222 16.4762C62.0113 16.4762 63.3916 14.8757 63.3916 14.8757L63.2669 15.6525C63.22 15.9495 63.4488 16.2158 63.7484 16.2158H66.2657C66.6643 16.2158 67.004 15.9256 67.0663 15.5304L68.5781 5.96228C68.6242 5.66779 68.3954 5.40061 68.0958 5.40061ZM64.1991 10.8415C63.931 12.4386 62.6617 13.5108 61.045 13.5108C60.2349 13.5108 59.5845 13.2504 59.1679 12.757C58.7548 12.267 58.5994 11.5696 58.7292 10.7929C58.9827 9.20941 60.2699 8.10228 61.8619 8.10228C62.6558 8.10228 63.3011 8.36605 63.7262 8.8637C64.1538 9.36648 64.3229 10.0681 64.1991 10.8415Z",fill:"#179BD7"}),(0,i.tZ)("path",{d:"M71.3916 0.41144L68.9955 15.6552C68.9485 15.9505 69.1773 16.2169 69.4752 16.2169H71.8841C72.2844 16.2169 72.6242 15.9266 72.6856 15.5314L75.0484 0.562529C75.0954 0.26718 74.8666 0 74.5687 0H71.8713C71.6331 0.00085361 71.4283 0.17499 71.3916 0.41144Z",fill:"#179BD7"})]})};function oO(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ow(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return oO(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oO(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ok="express-checkout-bottom-sheet",ox=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,oC=function(e){return ox.test(e||"")},oA={display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",border:"none",borderRadius:8,padding:"12px 16px",cursor:"pointer",backgroundColor:"#FFC439",color:"#000000",fontFamily:'-apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto, sans-serif',fontSize:20,fontWeight:500,lineHeight:"28px",letterSpacing:"0.0025em"},oZ=function(e){var n=e.isOpen,t=e.onDismiss,r=e.onContinueWithEmail,o=(0,a.useRef)(null),l=(0,y.t)(),u=(0,nh.ZP)("express-checkout").translateRaw,s=ow((0,a.useState)(""),2),c=s[0],d=s[1],f=ow((0,a.useState)(!1),2),v=f[0],h=f[1],m=ow((0,a.useState)(!1),2),b=m[0],g=m[1];(0,a.useEffect)(function(){g((0,od.p)())},[]);var S=ow((0,a.useState)(null),2),P=S[0],O=S[1],w=function(e){if(!P){O(e);var n=function(){return O(null)};l.push({pathname:"/checkout",query:{step:"expressCheckout",method:e}}).then(function(e){return!e&&n()}).catch(n)}},k=v&&!oC(c.trim());return(0,i.tZ)(p.dy.Container,{"data-test-id":ok,headerText:u("express-checkout.create-account-title"),returnFocusRef:o,placement:"bottom",isOpen:n,isModal:!0,onDismiss:t,onClose:t,width:"100%",backgroundColor:"alias.elevation.base",paddingX:"global.sm-2",paddingY:"global.sm-2",children:(0,i.BX)(p.xu,{display:"flex",flexDirection:"column",gap:"global.sm-2",children:[(0,i.tZ)(p.xv,{type:"body-md-regular",children:u("express-checkout.review-cart-subtitle")}),(0,i.tZ)("button",{type:"button","data-test-id":"".concat(ok,"-paypal-button"),onClick:function(){return w("paypal")},disabled:!!P,"aria-label":u("express-checkout.continue-with-paypal")||"Continue with PayPal","aria-busy":"paypal"===P,style:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},oA,P?{opacity:.6,cursor:"wait"}:{}),children:"paypal"===P?(0,i.tZ)(p.$j,{variant:"primary",size:"md"}):(0,i.BX)(i.HY,{children:[u("express-checkout.continue-with")||"Continue with",(0,i.tZ)(oP,{height:20})]})}),b&&(0,i.tZ)(oS,{id:"".concat(ok,"-apple-pay-button"),onContinue:function(){return w("applepay")}}),(0,i.BX)(p.xu,{display:"flex",alignItems:"center",gap:"global.sm-1",children:[(0,i.tZ)(p.xu,{flex:"1",children:(0,i.tZ)(p.iz,{})}),(0,i.tZ)(p.xv,{type:"body-sm-regular",color:"shared-alias.neutral.foreground.dark",children:u("express-checkout.or")}),(0,i.tZ)(p.xu,{flex:"1",children:(0,i.tZ)(p.iz,{})})]}),(0,i.tZ)(p.NI,{labelText:u("express-checkout.email-label"),children:(0,i.tZ)(p.NI.TextInput,{type:"email",name:"email","data-test-id":"".concat(ok,"-email-input"),value:c,error:k,errorText:k?u("express-checkout.email-invalid")||"Enter a valid email address.":void 0,onChange:function(e){d(e.target.value),v&&oC(e.target.value.trim())&&h(!1)},onBlur:function(){c.trim()&&h(!0)}})}),(0,i.tZ)(p.zx.Primary,{"data-test-id":"".concat(ok,"-continue-button"),onClick:function(){if(!oC(c.trim())){h(!0);return}r()},children:u("express-checkout.continue")})]})})};function o_(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function oE(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function oj(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){oE(e,n,t[n])})}return e}function oI(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function oT(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||oD(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oD(e,n){if(e){if("string"==typeof e)return o_(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o_(e,n)}}var oF={assuranceStep:"assurance-step-slot",goals:"goals-step-slot",preferences:"preferences-step-slot"},oR=function(e){var n=e.ssrOptimized,t=e.children;return n?(0,i.tZ)(i.HY,{children:t}):(0,i.tZ)(O.Z,{suspense:!0,children:t})},oM="calc(75vh - ".concat(298,"px)"),oz=function(e){var n,t,r,o,l,u,c,d,f,N,L,q,G,U,Q,J,K,$,X,ee,et,er,el,eu,es,ec,ed,ef,ep,ev,eh,ey,em,eb,eg,eS,eP,eO,ew,ek,ex,eC,eA,eZ,e_,eE,ej,eI,eT,eD,eF,eR=e.isPricePresentationNotificationEnabled,eM=e.isMobileAppWebview,ez=e.voucherCode,eN=e.externalZipCodeStep;nL();var eL=(0,ea.Z)().preSelectedSku,eq=(0,y.t)(),eG=(0,b.Z)();(0,a.useEffect)(function(){if("true"!==v.ZP.getItem("hf_raf_freebie_redirected")){var e=new URLSearchParams(window.location.search).get("utm_source");if(eG===g.Z.FR&&(null==e?void 0:e.toLowerCase())==="raf-freebie"){v.ZP.setItem("hf_raf_freebie_redirected","true");var n=new URL("/pages/value-messaging-raf",window.location.origin);n.search=window.location.search,window.location.href=n.toString()}}},[eG]);var eH=(0,w.iQ)(),eU=null==eH?void 0:null===(eA=eH.items)||void 0===eA?void 0:null===(eC=eA[0])||void 0===eC?void 0:eC.sku,eB=(0,C.Sj)(),eQ=(0,Z.D)(),eW=eQ.isMobile,eV=eQ.isTablet,eJ=eB===A.P.server?!!eW:eB===A.P.mobile,eK=eG===g.Z.US,eY=eG===g.Z.CG,e$=eG===g.Z.ER,eX=eG===g.Z.FJ,e0=eJ&&eX,e1=eB===A.P.server?!!eV:eB===A.P.tablet,e2=(eJ||e1)&&eX,e6=(0,W.sV)(),e3=e6.step,e8=e6.stepName,e7=e6.flowType,e5=e6.isLastStep,e4=e6.stepOrder,e9=e6.isInitialStep,ne=e6.goToNextStep,nn=(0,r4.PJ)(),nt=(0,en.d)(),nr=(0,rr.R)(),no=(0,a.useMemo)(function(){return nr&&(null==nn?void 0:nn.steps)&&e4?e4.map(function(e,n){var t=nn.steps[n];if(!t)return e;var r=t.subType===V.h.genericStep||t.subType===V.h.default;if(t.name)return(o=t.name)&&/\s/.test(o)?o.trim().split(/\s+/).filter(Boolean).map(function(e,n){return 0===n?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join(""):o;if(r){var o,i,a=null===(i=t.content)||void 0===i?void 0:i.find(function(e){return"question"===e.contentTypeId});if(a&&"handle"in a&&"generic"!==a.handle)return a.handle}return e}):e4},[e4,nn,nr]),ni=eq.query.discount_comm_id,na=Array.isArray(ni)?ni[0]:ni,nl=(0,k.Z)().data,nu=null==nl?void 0:null===(eZ=nl.config)||void 0===eZ?void 0:eZ.defaultSku,ns=(null==nl?void 0:null===(ej=nl.plans)||void 0===ej?void 0:null===(eE=ej[0])||void 0===eE?void 0:null===(e_=eE.children)||void 0===e_?void 0:e_.map(function(e){return e.handle}))||[],nc=(0,rG.K)(),nf=(0,S.Z)(),np=nf===P.Z.hellofresh,ny=(0,tw.H)(),nm=ez||(ny.valid?ny.code:""),nb=(0,x.zv)(),nS=oT((0,a.useState)(!1),2),nO=nS[0],nw=nS[1],nx=oT((0,a.useState)(!1),2),nZ=nx[0],n_=nx[1],nE=(0,tS.Q)(),nj=nE.selectedPreferences,nI=nE.setSelectedPreferences,nT=(0,F.x)(),nD=nT.selectedGoals,nF=nT.originalGoalsOptions,nR=(0,R.F)().selectedNumberOfPeople,nM=(0,M.S)().selectedMealsPerDay,nN=(0,z.w)().selectedDaysPerWeek,nV=(n=(0,nq.Z)().push,t=(0,C.Sj)(),r=(0,b.Z)(),o=(0,nU.Sz)(r),l=(0,nB.Z)().selectedExclusionHandles,c=(u=(0,nG.py)({runUsingStatsig:!0})).isReady,d=u.track,N=(f=(0,nH.O)()).id,L=f.attributes,{trackContinueOnNextStep:function(e,r,i){var a,u=(nQ(a={},V.h.preferences,"Preference"),nQ(a,V.h.additionalPreference,"Additional Preference"),nQ(a,V.h.proteinExclusion,"ProteinExclusion"),nQ(a,V.h.goals,"Goals"),nQ(a,V.h.meals,"Recipes"),nQ(a,V.h.size,"NrPeople"),nQ(a,V.h.assuranceStep,"MomentOfAssurance"),nQ(a,V.h.assuranceAfterQuiz,"MomentOfAssuranceII"),nQ(a,V.h.quizIntro,"QuizIntro"),a),s=i||u[e]||e,f=(null==nj?void 0:nj.length)?nj.join(","):"";(e===V.h.goals||e===V.h.assuranceStep)&&(f=(null==r?void 0:r.length)?r.join(","):""),(e===V.h.newExclusionsIngredients||e===V.h.newExclusionsProteins)&&(f=l.join("|")),n({event:"gaEventTrigger",event_name:"SelectPlan_QuizContinue",brand:"HelloFresh",tribe:"Conversions",screen:"Plans",gaEventCategory:"funnel",gaEventAction:s,viewport:t,gaEventLabel:f}),n(nW({event:"gaEventTrigger",event_name:"SelectPlan_ClickContinue".concat(s),screen:"Plans",gaEventCategory:"funnel",viewport:t,gaEventAction:"clickContinue".concat(s),gaEventLabel:f},nj&&nj.length>0&&{preferences:nj.join(",")},o)),c&&d({experimentationUserId:N,experimentationUserAttributes:L,eventName:"SelectPlan_ClickContinue".concat(s),eventTags:nW({screen:"Plans",EventCategory:"funnel",EventAction:"clickContinue".concat(s),viewport:t},nj&&{preferences:nj.join(",")},o)})},trackStepLoaded:function(e,r,o,i){var a,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=l.ga,s=l.experimentation,f=(nQ(a={},V.h.assuranceStep,"momentOfAssurance"),nQ(a,V.h.assuranceAfterQuiz,"momentOfAssuranceII"),a),p=i||f[e]||e;(void 0===s||s)&&c&&d({experimentationUserId:N,experimentationUserAttributes:L,eventName:"Load_Funnel_Step_".concat(p),eventTags:nW({screen:"Plans",EventCategory:"funnel",EventAction:"loadStep_".concat(p),EventLabel:r.join(","),EventStepsOrder:r.join(",")},o?{commsConfigId:o}:{})}),(void 0===u||u)&&n(nW({viewport:t,event:"gaEventTrigger",event_name:"Load_Funnel_Step_".concat(p),screen:"Plans",gaEventCategory:"funnel",gaEventAction:"loadStep_".concat(p),gaEventLabel:r.join(","),stepOrder:r.join(",")},o?{commsConfigId:o}:{}))},isReady:c}),nJ=nV.trackContinueOnNextStep,nY=nV.trackStepLoaded,n$=nV.isReady,nX=rA(),n0=nX.trackStepLoadedV2_GA,n1=nX.trackStepLoadedV2_Statsig,n2=nX.trackContinueOnNextStepV2_GA,n6=nX.trackContinueOnNextStepV2_Statsig,n3=nX.trackBackToPreviousStepV2,n8=nX.trackFunnelNameResolvedV2,n5=nX.isReady,n4=(0,tP.Z)(),n9=oF[e8],te=(0,j.qC
1)(n9),tn=te.isEnabled,tt=te.content,tr=tn&&tt.campaignId?tt.campaignId:"",to=(0,j.Bc)(n9).campaignId,ti=(0,h.Z)(),ta=ti.funnelId,tl=ti.visitId,tu=ti.funnelName,ts=ti.collectionId,tc=ti.collectionFieldsId,td=ti.pageVariationId,tf=ti.pageVariationFieldsId,tp=(0,a.useRef)(null);(0,a.useEffect)(function(){tu&&tu!==tp.current&&(tp.current=tu,n8({funnelId:ta||void 0,funnelName:tu,visitId:tl||void 0,collectionId:ts,collectionFieldsId:tc,pageVariationId:td,pageVariationFieldsId:tf}))},[tu,ta,tl,n8,ts,tc,td,tf]),tn&&tr?eD=tr:ta&&(eD=to||ta);var tv=(0,rX.X)(e8),th=tv.contentfulHeaderData,tb=tv.shouldUseContentfulHeaderSubtitle,tZ=parseInt(e3)-1,t_=(0,r4.Tb)(tZ),tE=(0,a.useMemo)(function(){return nr&&t_&&t_.name||null},[t_,nr]),tj=nr&&null!==(eF=null==t_?void 0:t_.content)&&void 0!==eF?eF:null,tI=(0,r7.e)(tj),tT=(0,r5.F)().mealSelectionEditSaveSticky,tD=tE||e8,tR=r6(t_),tM=(0,r3.j)(t_),tz=(e8===V.h.genericStep||e8===V.h.default)&&"momentsOfAssurance"===tM,tN=r8({isDisabled:nZ,systemContentType:tM}),tL=e8===V.h.exHouseholdSize||e8===V.h.exFJHouseholdSize||e8===V.h.exDesktopHouseholdSize||(e8===V.h.default||e8===V.h.genericStep)&&"HouseholdSize"===tE,tq=(0,a.useCallback)(function(e){var n,t=null==nn?void 0:null===(n=nn.steps)||void 0===n?void 0:n[e];return!!t&&"momentsOfAssurance"===(0,r3.j)(t)},[nn]),tG=(0,a.useCallback)(function(e){var n,t,r;n3(oI(oj({stepName:e8,stepNameLabel:tE||e8,previousStepName:null!==(t=null===(n=null!=no?no:e4)||void 0===n?void 0:n[e-1])&&void 0!==t?t:"",stepOrder:null!==(r=null!=no?no:e4)&&void 0!==r?r:[],campaignId:eD,visitId:tl||void 0,funnelId:ta||void 0,funnelName:tu||void 0},(null==t_?void 0:t_.id)&&{contentfulStepId:t_.id}),{collectionId:ts,collectionFieldsId:tc,pageVariationId:td,pageVariationFieldsId:tf}))},[n3,e8,tE,no,e4,eD,tl,ta,tu,t_,ts,tc,td,tf]),tH=(0,a.useCallback)(function(){var e=Number(e3),n=e-1,t=e4[n-1]===V.h.exMomentOfAssurance||tq(n-1)?e-2:e-1;tG(t),eq.push({pathname:"/plans",query:oI(oj({},eq.query),{step:t.toString()})},void 0,{shallow:!0})},[e3,e4,eq,tq,tG]),tU=(0,a.useMemo)(function(){return{mealSelectionEditSaveOnly:tT,onBack:tH}},[tT,tH]),tB=(0,a.useRef)(null),tQ=(0,a.useRef)(null);(0,a.useEffect)(function(){if(e8&&no){var e=tD||e8;tB.current!==e&&(tB.current=e,nY(e8,no,eD||"",e,{ga:!0,experimentation:!1}))}},[e8,eD,no,tD]),(0,a.useEffect)(function(){if(e8&&no&&n$){var e=tD||e8;tQ.current!==e&&(tQ.current=e,nY(e8,no,eD||"",e,{ga:!1,experimentation:!0}))}},[e8,n$,eD,no,tD]);var tW=(0,a.useRef)(null),tV=(0,a.useRef)(null),tJ=(0,a.useRef)(null),tK=nK(),tY=tK.trackStepLoad,t$=tK.isReady,t0=(0,E.Z)().recordStep,t1=ty(nj),t6=t1.isLoading,t3=t1.onSelectPlan,t7=(0,Y.r9)(),t5=t7.signedInRedirectUrl,t4=t7.reactivationRedirectUrl,t9=t7.checkForGiftCardRedemption;(0,a.useEffect)(function(){nw(!0)},[]);var ri=(0,tk.Z)(),ru=(0,tA.q8)(),rs=(0,B.Z)().products,rc=(0,H.Z)(nj).trackDefaultPreference,rd=(0,Y.r9)().includeSkus,rf=(0,eo.E$)({initialProducts:rs,includeSkus:rd}),rp=oT((0,a.useState)(),2),rv=rp[0],rh=rp[1],ry=oT((0,a.useState)([]),2),rm=ry[0],rb=ry[1],rg=oT((0,a.useState)([]),2),rS=rg[0],rP=rg[1],rO=e4.includes(V.h.goalsQuiz),rw=(q=(0,nq.Z)().push,G=(0,C.Sj)(),U=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translateRaw,J=(Q=(0,F.x)()).originalGoalsOptions,K=Q.selectedGoals,{trackGoalsQuizAnswers:function(){var e=K.map(function(e){return U("funnel.plans.singleQuestionFlow.goalsQuizStep.".concat(e))}),n=K.map(function(e){return J.findIndex(function(n){return n===e})}),t=e.join(" | ");rO?q({event:"gaEventTrigger",event_name:"Checkout_FunnelQuizPlus",tribe:"RTE",squad:"rte-growth",screen:"Plans",gaEventCategory:"funnelQuiz_goalsQuiz",gaEventAction:"goalPlusSubmit",gaEventLabel:t,quizQuestion:"goal",selectedAnswer:t,selectOrder:n.join(" | "),viewport:G}):q({event:"gaEventTrigger",event_name:"Checkout_FunnelQuiz",tribe:"RTE",squad:"rte-growth",screen:"Plans",gaEventCategory:"funnelQuiz",gaEventAction:"goalSubmit",gaEventLabel:t,quizQuestion:"goal",selectedAnswer:t,selectOrder:n.join(" | "),viewport:G})}}).trackGoalsQuizAnswers,rk=($=(0,nq.Z)().push,X=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translateRaw,ee=(0,M.S)().selectedMealsPerDay,et=(0,z.w)().selectedDaysPerWeek,er=(0,R.F)().selectedNumberOfPeople,{trackGoalsPlanAnswers:function(){var e=er;if(e8===V.h.goalsPlanMealsPerDay?e=ee:e8===V.h.goalsPlanMealsPerWeek&&(e=et),e){var n=X("funnel.plans.singleQuestionFlow.".concat(e8,".").concat(e));$({event:"gaEventTrigger",event_name:"Checkout_FunnelQuizPlus",tribe:"RTE",squad:"rte-growth",screen:"Plans",gaEventCategory:"funnelQuiz_".concat(e8),gaEventAction:"goalPlusSubmit",gaEventLabel:n,quizQuestion:"goal",selectedAnswer:n})}}}).trackGoalsPlanAnswers,rx=(el=(0,tO.SX)(),eu=(0,ei.$h)(),ec=(es=(0,tw.H)()).code?"with-coupon":"no-coupon",ed=(0,nq.Z)().push,{trackGoalsPlanSelection:function(){var e,n,t,r,o;ed({event:"gaEventTrigger_EE",event_name:"SelectPlan_RecommendedPlans",tribe:"rte-consumer",squad:"rte-growth-and-onboarding",screen:"/whitelabel/plans",gaEventCategory:"funnel",gaEventNonInteraction:!1,gaEventAction:"ProductPreferenceDefault",gaEventLabel:"".concat(null===(e=eu.product)||void 0===e?void 0:e.handle," | ").concat(ec),ecommerce:{click:{actionField:{currencyCode:el},products:[{name:null===(n=eu.product)||void 0===n?void 0:n.name,id:null===(t=eu.product)||void 0===t?void 0:t.handle,price:null===(r=eu.product)||void 0===r?void 0:r.price,brand:P.Z.factor,quantity:1,category:null===(o=eu.product)||void 0===o?void 0:o.family,coupon:es.code}]}}})}}).trackGoalsPlanSelection,rC=(0,rt.Z)().trackClickContinueMealType,r_=(0,n7.n)(),rE=r_.selectedGoals,rj=r_.setGoals,rI=r_.selectedGoalsIndexList,rT=r_.selectedAdditionalPreferences,rz=r_.setAdditionalPreferences,rH=r_.selectedAdditionalPreferencesIndexList,rU=r_.zipcode,rB=r_.selectedGenericStepAnswers,rQ=r_.setGenericStepAnswers,rV=r_.selectedGenericStepIndexList,rJ=r_.currentQuestionDefaultRef,rK=r_.currentStepAnswersRef,rY=oT((0,m.Z)("hf_prefill_zipcode"),1)[0],r0=oT((0,m.Z)("hf_selected_number_of_people"),1)[
10],r1=oT((0,m.Z)("hf_selected_number_of_meals"),1)[0],r2=rU||rY,r9=eG===g.Z.YE,oe=eX||r9,on=(0,a.useMemo)(function(){if(oe&&nR)return nR;if(r0){var e=JSON.parse(r0),n=e.adults||0,t=e.kids||0;return"adults:".concat(n,"|kids:").concat(t)}},[oe,nR,r0]),ot=r1||null,or=oT((0,a.useState)([]),2),oo=or[0],oi=or[1],oa=(0,a.useRef)([]),ol=(0,nB.Z)().selectedExclusionHandles,ou=null==ri?void 0:ri.questions.find(function(e){return e.question_handle===e8}),od=rN.cw[e8],of=null==ri?void 0:ri.questions.find(function(e){return e.question_handle===od}),op=(0,a.useMemo)(function(){var e=of||ou;if(!(null==e?void 0:e.answer_choices))return new Map;var n=new Map;return e.answer_choices.forEach(function(e){var t={id:e.answer_id,text:e.text,handle:e.answer_handle};n.set(e.text,t),n.set(e.answer_id,t),e.answer_handle&&n.set(e.answer_handle,t)}),n},[ou,of]),ov=oT((0,m.Z)("hf_selected_meal_types"),1)[0],oh=oT((0,m.Z)("hf_selected_number_of_meals",{expiresIn:ro.EL}),2),oy=oh[0],ob=oh[1],oS=oT((0,m.Z)("hf_selected_number_of_people",{expiresIn:ro.EL}),2),oP=oS[0],oO=oS[1],ow=(0,ei.jy)(),ok=ow.size,ox=ow.meals,oC=(0,ei.$h)().product;(0,a.useLayoutEffect)(function(){var e=eq.query.mealsize,n=!!(oy||oP);if(e&&eL&&!n){var t=eL.split("-"),r=parseInt(t[2]),o=parseInt(t[3]);Number.isFinite(r)&&Number.isFinite(o)&&(ob(r.toString()),oO(JSON.stringify({adults:o,kids:0,total:o,current:o})))}},[eL,eq.query.mealsize,oy,oP,ob,oO]);var oA=(0,a.useCallback)(function(e){if(e!==V.h.newExclusionsProteins&&e!==V.h.newExclusionsIngredients)return ol;var n=new Set(ol),t=new Set(oa.current);return Array.from(n).filter(function(e){return!t.has(e)})},[ol]),oz=(0,rq.Z)({surveyId:(null==ri?void 0:ri.survey_id)||"",translationId:(null==ri?void 0:ri.id)||"",questionId:(null==of?void 0:of.question_id)||"",answerChoices:(null==of?void 0:of.answer_choices)||[]}),oN=oz.selectedSurveyResponses,oL=oz.selectedSurveyResponseText,oq=oz.ratings,oG=rD({getStepSelectedOptions:(0,a.useCallback)(function(e){var n=on,t=e===V.h.exHouseholdSize||e===V.h.exFJHouseholdSize||e===V.h.exDesktopHouseholdSize,r=(e===V.h.default||e===V.h.genericStep)&&"HouseholdSize"===tE;if((t||r)&&!oe){var o=v.ZP.getItem("hf_selected_number_of_people");if(o){var i=JSON.parse(JSON.parse(o).value),a=i.adults||0,l=i.kids||0;n="adults:".concat(a,"|kids:").concat(l)}}return rZ({stepName:e,selectedPreferences:nj,selectedAdditionalPreferences:rT,selectedGoals:rE,goalsQuizSelectedGoals:nD,selectedNumberOfPeople:n,selectedMealsPerDay:nM,selectedDaysPerWeek:nN,selectedOptions:oo,storedMealTypes:ov,meals:ox,size:ok,product:oC,zipcode:r2,getCurrentStepExclusions:oA,selectedSurveyResponses:oN,selectedSurveyResponseText:oL,cookingFrequency:ot,selectedGenericStepAnswers:tR.answers,isHouseholdSizeStep:r,contentfulStepContent:tj,selectedGenericStepIndexList:rV})},[nj,rT,rE,nD,oA,nM,nN,oo,ov,ox,ok,oC,oN,oL,ot,on,r2,tR.answers,oe,tE,tj,rV]),goalsQuizSelectedGoals:nD,originalGoalsOptions:nF,selectedGoalsIndexList:rI,selectedAdditionalPreferences:rT,selectedAdditionalPreferencesIndexList:rH,dataFromQuestionnaireService:ri,plansConfigData:nl,defaultPreference:rv,questionnaireQuestion:of,ratings:oq,selectedPreferences:nj,size:ok,householdSizeForTracking:on,product:oC,zipcodeForTracking:r2,cookingFrequencyForTracking:ot,contentfulStepName:tE,contentfulItemsMap:(0,a.useMemo)(function(){var e;return oE(e={},V.h.exProteinPreferences,null==ru?void 0:ru.proteinPreferenceItems),oE(e,V.h.exFlavorPreferences,null==ru?void 0:ru.flavorPreferenceItems),oE(e,V.h.exCuisinePreference,null==ru?void 0:ru.cuisinePreferenceItems),e},[ru]),contentfulStepContent:tj,currentQuestionDefaultRef:rJ,currentStepAnswersRef:rK}),oH=(0,rn.t)(),oU=oH.selectedProgram,oB=oH.programsRedirectIsLoading,oQ=oH.redirectUserToFactorProgramsFunnel,oW=(ef=(0,nq.Z)().push,ep=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translateRaw,eh=(ev=(0,S.Z)())===P.Z.everyplate,ey=ev===P.Z.greenchef,em=(0,nG.py)({runUsingStatsig:!0}).track,eg=(eb=(0,nH.O)()).id,eS=eb.attributes,{trackGoalsAnswers:function(e,n){var t=e.map(function(e){return n?e:ep("funnel.plans.singleQuestionFlow.quiz.title-".concat(e))}).join(" | ");ef({event:"gaEventTrigger",event_name:"Checkout_FunnelQuiz",tribe:ey||eh?"Expansion":"Conversions",screen:"Plans",gaEventCategory:"funnelQuiz",gaEventAction:"subscriptionGoalsSubmit",gaEventLabel:t||"skip",quizQuestion:"SubscriptionGoals",selectedAnswer:t}),em({eventName:"Checkout_FunnelQuiz",experimentationUserId:eg||"",experimentationUserAttributes:eS,eventTags:{tribe:ey||eh?"Expansion":"Conversions",screen:"Plans",EventCategory:"funnelQuiz",EventAction:"subscriptionGoalsSubmit",EventLabel:t||"skip",quizQuestion:"SubscriptionGoals",selectedAnswer:t}})}}).trackGoalsAnswers,oV=(eP=(0,nq.Z)().push,eO=(0,nh.ZP)("funnel.plans.singleQuestionFlow").translateRaw,ek=(ew=(0,S.Z)())===P.Z.everyplate,ex=ew===P.Z.greenchef,{trackAdditionalPreferenceAnswers:function(e,n){var t=e.map(function(e){return n?e:eO("funnel.plans.singleQuestionFlow.quiz.additionalPreference.title-".concat(e))}).join(" | ");eP({event:"gaEventTrigger",event_name:"Checkout_FunnelQuiz",tribe:ex||ek?"Expansion":"Conversions",screen:"Plans",gaEventCategory:"funnelQuiz",gaEventAction:"dietaryPreferenceSubmit",gaEventLabel:t||"skip",quizQuestion:"DietaryPreference",selectedAnswer:t})}}).trackAdditionalPreferenceAnswers,oJ=e8===V.h.zipCode,oK=e8===V.h.planRecommendation,oY=(0,D.v)().trackClickCTAZi
1pcodeStep,o$=tF().checkAndTrackPlanPersonalizationResponse,oX=(0,nC.o)().isExtendedFunnelDesktopEnabled,o0=(0,nA.z)(),o1=(0,nd.K)(),o2=e7===nP.Z.HelloFreshDefaultGlobal||e7===nP.Z.HelloFreshDefaultGlobalDesktop||e7===nP.Z.HelloFreshDefaultUS||e7===nP.Z.HelloFreshDefaultDesktopUS||e7===nP.Z.ProteinExclusionExperimentIntl||e7===nP.Z.ProteinExclusionExperimentUS||e7===nP.Z.WLMealKitPlanRecommendation||e7===nP.Z.GreenChefUS,o6=o2&&(e8===V.h.meals||e8===V.h.size||e8===V.h.planRecommendation),o3=(0,tC.Z)(),o8=o3.trackClickContinueCookTimes,o7=o3.trackClickContinueAdultKids,o5=o3.trackClickContinueRecommendedPlan,o4=(0,_.T)(),o9=tm({brand:nf,stepName:e8});tg({products:rf,setSizeOptions:rb,setMealsOptions:rP,defaultPreference:rv,setDefaultPreference:function(e){rc(e),rh(e)},isHFDefaultGlobalFlow:o2});var ie=t2({storedVoucherCode:nm,discountCommunicationId:na,productSkus:ns,defaultSku:nu}),it=oT((0,a.useState)(!1),2),ir=it[0],io=it[1],ii=og(e5).isExpressCheckoutPaypalEnabled,ia=oT((0,a.useState)(!1),2),il=ia[0],iu=ia[1],is=function(e){var n=e.replaceState;if(!ir){io(!0);var t=tE||e8,r=e8===V.h.genericStep||e8===V.h.default?null==t_?void 0:t_.id:void 0,o=oG(e8),i={stepName:e8,stepNameLabel:t,selectedOptions:o.selectedOptionsForTracking,defaultOptions:o.defaultOptionsForTracking,stepOrder:no,answerMap:op,selectedOptionsIndexList:o.selectedOptionsIndexList,campaignId:eD,visitId:tl||void 0,funnelId:ta||void 0,funnelName:tu||void 0,previousStepName:tW.current,isFactorMobile:e0,routerQuery:eq.query,experimentFlags:{isExtendedFunnelEnabled:nc},contentfulStepId:r,isHouseholdSizeStep:tL,stepPosition:e4&&-1!==e4.indexOf(e8)?e4.indexOf(e8)+1:void 0,collectionId:ts,collectionFieldsId:tc,pageVariationId:td,pageVariationFieldsId:tf};if(n2(i),n5&&n6(i),oJ||nJ(e8,rE,tD||e8),o2&&e8===V.h.meals&&o8(),o2&&e8===V.h.size&&o7(),e8===V.h.mealTypeStep&&rC(),o2&&e8===V.h.planRecommendation&&o5(),oJ&&oY(),e8===V.h.goalsQuiz&&rw(),e8===V.h.chooseProgram){if(!oU)return;if(n4(oU,"continue"),"prog_weightloss"===oU){oQ();return}}if((e8===V.h.goalsPlanNumberOfPeople||e8===V.h.goalsPlanMealsPerDay||e8===V.h.goalsPlanMealsPerWeek)&&rk(),(e8===V.h.goalsPlanRecommendation||e8===V.h.planSelector||tI)&&rx(),e8===V.h.goals&&oW(rE,ri),e8===V.h.additionalPreference&&oV(rT,ri),o$(e8),e5){if(ii){iu(!0),io(!1);return}t3(),io(!1)}else ne(n)}};(0,a.useEffect)(function(){var e,n;tY(e3,e8,null==eH?void 0:null===(n=eH.items)||void 0===n?void 0:null===(e=n[0])||void 0===e?void 0:e.sku)},[e3,e8,null==eH?void 0:null===(eT=eH.items)||void 0===eT?void 0:null===(eI=eT[0])||void 0===eI?void 0:eI.sku,t$]),(0,a.useEffect)(function(){var e;t0({path:"/plans",name:null!==(e=null==no?void 0:no[Number(e3)-1])&&void 0!==e?e:e8,index:e3,flowType:e7})},[e3]),(0,a.useEffect)(function(){window.usabilla_live&&window.usabilla_live("hide")},[]);var ic=oT((0,m.Z)("hf_preferences-step-visited"),2)[1],id=function(e,n){e===V.h.preferences&&n("true")},ip=(0,nk.Z)(),iv=ip&&eX,ih=function(){if((oX||ip||o0)&&!tz)return(0,i.BX)(i.HY,{children:[(0,i.tZ)(ra,{isDisabled:tN||!nO,isLoading:t6||oB,isLastStep:e5,isClient:nO,programsRedirectIsLoading:oB,directToNextPage:is,handlePreferencePopoverVisibility:id,stepName:e8,setPreferencesStepVisited:ic,mealSelectionEditSaveSticky:tT,productHandle:null==oC?void 0:oC.handle,isFirstStep:"1"===e3,onBack:oX||ip||o0?function(){var e=Number(e3),n=e-1,t=e4[n-1]===V.h.exDesktopMomentOfAssurance||tq(n-1)?e-2:e-1;tG(t),eq.push({pathname:"/plans",query:oI(oj({},eq.query),{step:t.toString()})},void 0,{shallow:!0})}:void 0}),(0,i.tZ)(rW,{onNext:is})]})};(0,a.useEffect)(function(){if(e8&&(e8!==V.h.genericStep||tE||null==nn||!nn.steps)){var e=tE||e8;if(e!==(tV.current||tW.current)){var n=tW.current===V.h.newExclusionsProteins&&e8===V.h.newExclusionsIngredients,t=tW.current!==V.h.newExclusionsProteins&&tW.current!==V.h.newExclusionsIngredients;n&&(oa.current=ol),t&&(oa.current=[]);var r=oG(e8),o=r.selectedOptionsForTracking,i="true"===v.ZP.getItem("thermomixActive")?((function(e){if(Array.isArray(e))return o_(e)})(o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||oD(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["thermomix"]):o,a=e8===V.h.genericStep||e8===V.h.default?null==t_?void 0:t_.id:void 0,l={stepName:e8,stepNameLabel:e,stepOrder:no,answerMap:op,selectedOptions:i,defaultOptions:r.defaultOptionsForTracking,selectedOptionsIndexList:r.selectedOptionsIndexList,campaignId:eD,visitId:tl||void 0,funnelId:ta||void 0,funnelName:tu||void 0,previousStepName:tW.current,routerQuery:eq.query,isFactorMobile:e0,experimentFlags:{isExtendedFunnelEnabled:nc},contentfulStepId:a,isHouseholdSizeStep:tL,stepPosition:e4&&-1!==e4.indexOf(e8)?e4.indexOf(e8)+1:void 0,collectionId:ts,collectionFieldsId:tc,pageV
1ariationId:td,pageVariationFieldsId:tf};n0(l),n5?(n1(l),tJ.current=null):tJ.current=oI(oj({},l),{waitedForStatsig:!0}),tW.current=e8,tV.current=e}}},[e8,tE,n5]),(0,a.useEffect)(function(){if(n5&&tJ.current){var e=o4.startSpan("funnel.statsig-ready-queue-processing"),n=tJ.current;e.setAttributes({"funnel.statsig.queuedStepName":n.stepName,"funnel.statsig.becameReady":!0}),n1(n),tJ.current=null,e.end()}},[n5,n1,o4]),(0,a.useEffect)(function(){io(!1)},[e3]),(0,a.useEffect)(function(){try{var e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:e?"auto":"smooth"})}catch(e){window.scrollTo(0,0)}},[e3]);var iy=e8===V.h.quizIntro,im=e8===V.h.exZipCode||e8===V.h.exGoalsStep||e8===V.h.exGoalsAssurance||e8===V.h.exNutritionPreferences||e8===V.h.exMomentOfAssurance||e8===V.h.exHouseholdSize||e8===V.h.exCookingFrequency||e8===V.h.goalsPlanRecommendation||e8===V.h.exFJMealsPerWeek||e8===V.h.genericStep||e8===V.h.planRecommendation||e8===V.h.default,ib=nf===P.Z.factor&&!eX,ig=eX&&eJ||r9&&nt||ib&&nt,iS=om(e5),iP=iS.isReady,iO=iS.isExpressCheckoutEnabled,iw=iP&&iO&&e5;(0,a.useEffect)(function(){var e=document.documentElement.style;return iw&&eJ?e.setProperty(oc,"".concat(240,"px")):e.removeProperty(oc),function(){e.removeProperty(oc)}},[iw,eJ]);var ik=r9&&eJ&&nt,ix=nt&&eJ,iC=oX||nc||e2||ik||ix||tz||ip||o0;return(0,i.BX)(s.Z,{scope:"single-plans-page",tags:[["flowType",e7],["stepName",e8]],children:[(0,i.tZ)(T.$,{signedInRedirectUrl:t5,reactivationRedirectUrl:t4,checkForGiftCardRedemption:t9}),(0,i.tZ)(s.Z,{scope:"single-plans-page-voucher-notification",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(O.Z,{suspense:!0,children:(0,i.tZ)(tX,{isPricePresentationEnabled:eR})})}),(0,i.BX)(t8,{shouldAlignItemsStart:e9||eK||eY||e$,hasGoalsQuiz:rO,isZipcodeStep:oJ,externalZipCodeStep:eN,children:[(0,i.BX)(p.xu,{"data-test-id":"sqf-step-".concat(e8),"data-step-name":tE||void 0,opacity:t6?.3:1,inert:t6?"":void 0,"aria-busy":t6,minHeight:["calc(100vh - 215px)",np?"auto":oM],children:[e8===V.h.planRecommendation&&eG===g.Z.FJ?null:(0,i.tZ)(O.Z,{suspense:!0,children:nc?(0,i.tZ)(p.xu,{children:!im&&(tb?(0,i.tZ)(rM.Z,{header:th.title||void 0,subtitle:th.subtitle||void 0}):(0,i.BX)(i.HY,{children:[(0,i.tZ)(rF.Z,{}),(0,i.tZ)(rR.Z,{})]}))}):(0,i.tZ)(p.xu,{children:tb&&eJ&&!im?(0,i.tZ)(rM.Z,{header:th.title||void 0,subtitle:th.subtitle||void 0}):(0,i.BX)(i.HY,{children:[(0,i.tZ)(ng,{dataFromQuestionnaireService:ri}),o6&&(0,i.tZ)(tx,{})]})})}),(0,i.tZ)(p.xu,{width:"100%",display:"flex",flexDirection:"column",flexGrow:"1",maxWidth:np?["100%",oJ||oK||oX||ip?"100%":"556px"]:"auto",margin:"auto",children:(0,i.tZ)(nv,{setIsDisabled:n_,selectedPreferences:nj,setSelectedPreferences:nI,selectedOptions:oo,setSelectedOptions:oi,selectedGoalsOptions:rE,setSelectedGoalsOptions:rj,selectedAdditionalPreferenceOptions:rT,setSelectedAdditionalPreferenceOptions:rz,dataFromQuestionnaireService:ri,directToNextPage:is,sizeOptions:rm,setSizeOptions:rb,setMealsOptions:rP,mealsOptions:rS,voucherCode:ez,SQFLoadSpan:o9,shouldRenderCTAWithBackButton:function(){return ih()},selectedGenericStepAnswers:rB,setGenericStepAnswers:rQ})}),eJ&&!ig&&(0,i.tZ)(re,{voucherCode:ez})]}),(0,i.BX)(p.xu,{"data-test-id":"sqf-bottom-section",paddingX:iy&&!np?"global.sm-2":void 0,display:o0?"none":void 0,children:[eJ&&ie&&(0,i.BX)(i.HY,{children:[!nb&&(0,i.tZ)(p.iz,{variant:"horizontal",my:"global.none",mx:"-16px"})," ",(0,i.tZ)(I.Z,{storedVoucherCode:nm,discountCommunicationId:na,productSkus:ns,defaultSku:eU||nu,removePadding:!0})]}),iw&&(0,i.tZ)(i.HY,{children:(0,i.tZ)(s.Z,{scope:"express-checkout-single-plans-page-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(os,{onNext:is})})}),ii&&(0,i.tZ)(s.Z,{scope:"express-checkout-paypal",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(oZ,{isOpen:il,onDismiss:function(){return iu(!1)},onContinueWithEmail:t3})}),eM&&(0,i.tZ)(p.xu,{height:"64px"}),(0,i.BX)(oR,{ssrOptimized:o1,children:[!oX&&!ip&&nc&&!ik&&e8!==V.h.exMomentOfAssurance&&!tz&&!iw&&(0,i.tZ)(s.Z,{scope:"extended-funnel-single-plans-page-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(rL,oj({isDisabled:tN||!nO,isLoading:t6||oB,showBackButton:!e9,onNext:is},tU))}),!nc&&!ip&&e2&&!iw&&(0,i.tZ)(s.Z,{scope:"factor-extended-funnel-single-plans-page-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(r$,oj({isDisabled:tN||!nO,isLoading:t6||oB,showBackButton:!e9&&e8!==V.h.exMomentOfAssurance,onNext:is},tU))}),ix&&!nc&&!e2&&!tz&&!ik&&!iw&&(0,i.tZ)(s.Z,{scope:"modular-funnel-mobile-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(rL,oj({isDisabled:tN||!nO,isLoading:t6||oB,showBackButton:!e9,onNext:is},tU))}),ik&&!iw&&(0,i.tZ)(s.Z,{scope:"youfoodz-single-plans-page-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(rl,{children:(0,i.BX)(p.xu,{display:"flex",gap:"global.sm-1",children:["1"!==e3&&(0,i.tZ)(p.xu,{children:(0,i.tZ)(p.zx.Secondary,{"data-test-id":"single-page-back-button",disabled:t6||oB,onClick:function(){tG(Number(e3)-1),eq.push({pathname:"/plans",query:oI(oj({},eq.query),{step:(Number(e3)-1).toString()})},void 0,{shallow:!0})},children:"Back"})}),(0,i.tZ)(p.xu,{flex:1,children:(0,i.tZ)(p.zx.Primary,{"data-test-id":"single-page-continue-button","data-test-sku":null==oC?void 0:oC.handle,disabled:tN||!nO,loading:t6||oB,onClick:function(){is({replaceState:!1})},children:"Continue"})})]})})}),!iC&&!iw&&(0,i.tZ)(s.Z,{scope:"single-plans-page-cta",fallback:(0,i.tZ)(i.HY,{}),children:(0,i.tZ)(p.xu,{"data-test-id":"single-plans-page-cta",zIndex:1,px:np?["global.lg-2","global.none"]:"global.lg-2",mt:np?["global.none","global.md-2","global.md-3"]:"global.none",children:tT?(0,i.tZ)(p.zx.Primary,{width:"100%","data-test-id":"meal-selection-edit-save-cta",disabled:iy?!nO:tN||!nO,loading:t6||oB,onClick:tT.onSave,children:tT.saveMealsButtonText}):(0,i.tZ)(nz,{isDisabled:iy?!nO:tN||!nO,isLoading:t6||oB,isLastStep:e5,productHandle:null==oC?void 0:oC.handle,onClick:function(){is({replaceState:!1}),id(e8,ic)}})})})]}),!eJ&&!o0&&!iv&&(0,i.tZ)(re,{voucherCode:ez})]})]})]})},oN=function(e){return(0,i.tZ)(oe,{children:(0,i.tZ)(oz,oj({},e))})},oL=t(273656),oq=t(617947),oG=function(e){(0,oL.rS)({weeks:(0,oq.Z)(),exclude:[]},{suspense:!1,retry:!1,enabled:e})},oH=function(){var e,n,t=(0,r4.PJ)();return oG(null!==(n=null==t?void 0:null===(e=t.steps)||void 0===e?void 0:e.some(function(e){var n;return null===(n=e.content)||void 0===n?void 0:n.some(function(e){return"menuAssurance"===e.contentTypeId})}))&&void 0!==n&&n),null},oU=t(637357),oB=function(e){var n,t,r=e.children,o=(0,r4.PJ)(),a=(0,en.d)();return o&&a?(0,i.tZ)(s.Z,{scope:"intelligent-funnel",tags:[["funnel.id",null!==(n=o.entryId)&&void 0!==n?n:""],["funnel.name",null!==(t=o.funnelName)&&void 0!==t?t:""]],children:r}):(0,i.tZ)(i.HY,{children:r})},oQ=function(e){var n=e.children,t=(0,c.e)(),r=(0,f.Z)().isReady,o=(0,en.d)();return!t||r||o?(0,i.tZ)(i.HY,{children:n}):(0,i.tZ)(p.xu,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50svh","aria-busy":"true",children:(0,i.tZ)(p.$j,{size:"md",variant:"neutral","aria-hidden":"true"})})},oW=function(e){var n=e.isPricePresentationNotificationEnabled,t=e.isMobileAppWebview,r=e.voucherCode,o=e.externalZipCodeStep;return(0,i.tZ)(u.Z,{claim:{name:"activations-rte",githubTeam:"hellofresh/activations-rte",tribe:"conversions",alliance:"growth",jiraPrefix:"USCRO",slackChannel:"#squad-curation",slackAlertsChannel:"#squad-curation",skipLabelsOnPR:!1,teamIdentifier:"activations-rte"},children:(0,i.tZ)(s.Z,{scope:"single-question-flow",children:(0,i.tZ)(oB,{children:(0,i.tZ)(l.sE,{children:(0,i.tZ)(Y.W4,{children:(0,i.tZ)(oU.AV,{
1children:(0,i.tZ)(tA.yx,{children:(0,i.tZ)(tw.x,{children:(0,i.tZ)(ei.$X,{children:(0,i.tZ)(tS.V,{children:(0,i.tZ)(F.r,{children:(0,i.tZ)(n7.O,{children:(0,i.tZ)(rn.w,{children:(0,i.tZ)(M.d,{children:(0,i.tZ)(z.n,{children:(0,i.tZ)(R.i,{children:(0,i.tZ)(tZ.E,{children:(0,i.tZ)(t_.g,{children:(0,i.tZ)(t4.XO,{children:(0,i.tZ)(oQ,{children:(0,i.tZ)(W.WX,{children:(0,i.BX)(d.Z,{children:[(0,i.tZ)(oH,{}),(0,i.tZ)(oN,{isPricePresentationNotificationEnabled:void 0!==n&&n,isMobileAppWebview:void 0!==t&&t,voucherCode:void 0===r?"":r,externalZipCodeStep:void 0!==o&&o})]})})})})})})})})})})})})})})})})})})})})})})}},151649:function(e,n,t){t.d(n,{Z:function(){return k}});var r=t(687800),o=t(827378),i=t(718583),a=t(768587),l=t(887824),u=t(783244),s=t(375745),c=t(947998),d=t(140224),f=t(164528),p=t(8451),v=t(268481),h=t(596246),y=t(917983),m=t(961081),b=t(482559),g=t(345889),S=function(e){var n=e.originalPrice,t=e.priceWithDiscount,o=e.ariaLabel;return(0,r.BX)(a.xv,{"aria-label":o,children:[(0,r.tZ)(a.xv,{"data-test-id":"price-on-quiz-flow-original-price",type:"body-md-regular",color:"global.gray.700",strikethrough:!0,"aria-hidden":"true",children:n},"price-on-quiz-flow-original-price")," ",(0,r.tZ)(a.xv,{"data-test-id":"price-on-quiz-flow-price-with-discount",color:"shared-alias.negative.foreground.default","aria-hidden":"true",children:t},"price-on-quiz-flow-price-with-discount")]},"price-on-quiz-flow-container")},P=function(e){var n=e.hasDiscount,t=e.numberOfMeals,i=e.numberOfPeople,l=e.originalPricePerServing,u=e.discountPricePerServing,s=(0,d.O)().locale,c=(0,f.ZP)("funnel.plans.singleQuestionFlow").translateRaw,P=(0,m.sV)(),O=P.flowType,w=P.stepName,k=(0,v.Sj)(),x=(0,o.useMemo)(function(){return t*i},[t,i]),C=(0,o.useMemo)(function(){return(0,h.Z)(l,s)},[l,s]),A=(0,o.useMemo)(function(){return(0,h.Z)(u,s)},[u,s]),Z=O===y.Z.HelloFreshDefaultGlobal||O===y.Z.HelloFreshDefaultUS,_=w===b.h.planRecommendation,E=(0,g.K)();if(_&&"mobile"!==k)return null;var j="funnel.plans.singleQuestionFlow.cta.priceSummary.pricePerServing";return Z&&(j="funnel.plans.singleQuestionFlow.cta.priceSummary.pricePerServing.totalMeals"),E&&(j="funnel.plans.singleQuestionFlow.cta.priceSummary.pricePerServing.exFunnel.totalMeals"),(0,r.tZ)(a.xv,{"data-test-id":"price-on-quiz-flow-price-per-serving",type:"body-md-bold",textAlign:"left",children:(0,p.lU)(c(j),{numberOfServings:x,pricePerServing:n?(0,r.tZ)(S,{originalPrice:C,priceWithDiscount:A,ariaLabel:c("funnel.plans.singleQuestionFlow.cta.priceSummary.priceWithDiscount.accessibleLabel",{originalPrice:C,discountedPrice:A})}):(0,r.tZ)(a.xv,{"data-test-id":"price-on-quiz-flow-serving-price",children:C},"price-on-quiz-flow-serving-price")})})};function O(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function w(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}var k=function(e){var n,t=e.showPrice,d=e.isInExpressCheckoutCTA,f=(0,c.Z)(void 0,!d),p=(0,l.Z)().push,v=(function(e){if(Array.isArray(e))return e}(n=(0,u.Z)("hf_prefill_zipcode"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,n){if(e){if("string"==typeof e)return O(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O(e,1)}}(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];if((0,o.useEffect)(function(){if(t&&f&&f.isPriceFetched){var e,n;(e=function(){var e;return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(n){switch(n.label){case 0:if(!v)return[3,2];return[4,(0,s.m)(v,"IQeaMuojemGvpYdSi3Ho9yEi+F17ECXbaFoQKRTBP3w=")];case 1:n.sent(),n.label=2;case 2:return p({event:"gaEventTrigger",event_name:"user_saw_price",widget:"price-
1on-quiz-flow",totalPriceWithDiscount:f.priceWithDiscount,totalPrice:f.price,pricePerServing:f.originalPricePerServing,discountPricePerServing:f.discountPricePerServing.toFixed(2),totalShippingPrice:f.shippingFee,totalShippingPriceWithDiscount:f.shippingFee-f.shippingDiscount,pagePath:null===(e=location)||void 0===e?void 0:e.href,zipCode:i.ZP.getItem("encryptedZipcode")||"",tribe:"customer-benefits",squad:"pricing-experience"}),[2]}})},n=function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){w(i,r,o,a,l,"next",e)}function l(e){w(i,r,o,a,l,"throw",e)}a(void 0)})},function(){return n.apply(this,arguments)})()}},[t,f,v,p]),!t)return null;var h=!f||!f.isPriceFetched;return(0,r.tZ)(a.xu,{display:"flex",flexDirection:"column",justifyContent:"space-around","data-test-id":"price-on-quiz-flow-content",maxWidth:"90%",transition:"opacity ".concat(450,"ms ease-in-out"),minHeight:d?"40px":"60px",alignItems:h||d?"center":"flex-start",width:"100%",role:"status","aria-busy":h,children:h?(0,r.BX)(r.HY,{children:[(0,r.tZ)(a.$j,{size:"md",variant:"primary","data-test-id":"price-on-quiz-flow-spinner","aria-hidden":"true"}),(0,r.tZ)(a.xu,{as:"span",position:"absolute",width:"1px",height:"1px",margin:"zero",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",borderWidth:"zero",children:"Loading price information"})]}):(0,r.tZ)(P,{hasDiscount:f.hasDiscount,numberOfMeals:f.numberOfMeals,numberOfPeople:f.numberOfPeople,originalPricePerServing:f.originalPricePerServing,discountPricePerServing:f.discountPricePerServing})})}},930780:function(e,n,t){function r(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}t.d(n,{W_:function(){return l},XO:function(){return a}});var o,i=(0,t(575085).Z)("wl.single-question-flow.quiz-step-banner",(o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return[2,t.e(2885).then(t.bind(t,602885))]})},function(){var e=this,n=arguments;return new Promise(function(t,i){var a=o.apply(e,n);function l(e){r(a,t,i,l,u,"next",e)}function u(e){r(a,t,i,l,u,"throw",e)}l(void 0)})})),a=i.ProjectConfigProvider,l=(i.configMiddleware,i.useConfig)},506647:function(e,n,t){var r=t(887824),o=t(497249);n.Z=function(){var e=(0,r.Z)().push,n=(0,o.T)();return function(t,r){var o=n.startSpan("bau-funnel.choose-program-tracking");e({event_name:"SelectPlan_ProgramSelection",gaEventCategory:"ProgramSelection",gaEventAction:r,gaEventLabel:t,plan_type:"prog_weightloss",selected_option:t,action:r}),o.setAttributes({event_name:"SelectPlan_ProgramSelection",gaEventCategory:"ProgramSelection",gaEventAction:r,gaEventLabel:t,plan_type:"prog_weightloss",selected_option:t,action:r}),o.end()}}},819762:function(e,n,t){t.r(n),t.d(n,{GOALS_STEP_ID:function(){return S}});var r=t(687800),o=t(827378),i=t(768587),a=t(164528),l=t(783244),u=t(497249),s=t(921318),c=t(518113),d=t(200061),f=t(359839),p=t(22546),v=t(217361);function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function y(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||b(e,n)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,n){if(e){if("string"==typeof e)return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}}var g=["1","2","3","4","5"],S="goals",P=function(e){var n=e.isGoalsStepSlotEnabled,t=e.subtitle,o=(0,a.ZP)("funnel.plans.singleQuestionFlow").translateRaw,l="";return n&&t&&(l=t),n||(l=o("funnel.plans.singleQuestionFlow.lifestyle.subtitle")),(0,r.tZ)(i.xu,{mb:["global.sm-2","global.md-2","global.md-3"],textAlign:["start","center"],children:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"shared-alias.neutral.foreground.default",children:l})})};n.default=function(e){var n=e.selectedGoalsOptions,t=e.setSelectedGoalsOptions,h=e.dataFromQuestionnaireService,b=e.onSetPreferences,O=(0,p.ap)(),w=(0,a.ZP)("funnel.plans.singleQuestionFlow").translate,k=(0,v.n)(),x=k.selectedGoalsIndexList,C=k.setGoalsIndexList,A=(0,u.T)().startSpan("goal_step.rendering_source"),Z=(0,s.qC)("goals-step-slot"),_=Z.isEnabled,E=Z.content,j=_&&(null==E?void 0:E.questionHandle)?E.questionHandle:S,I=null==h?void 0:h.questions.find(function(e){return e.question_handle===j}),T=(null==I?void 0:I.answer_choices)||[],D=(0,c.Z)({surveyId:(null==h?void 0:h.survey_id)||"",translationId:(null==h?void 0:h.id)||"",questionId:(null==I?void 0:I.question_id)||"",answerChoices:T}),F=D.selectedSurveyResponses,R=D.answerIdsFromQuestionnaire,M=D.setSelectedSurveyResponses,z=T.map(function(e){return e.text}),N=y((0,o.useState)([]),2),L=N[0],q=N[1],G=(0,f.r9)().shouldUseQuizSubtitle;(0,o.useEffect)(function(){q(z.length>0?z:g)},[z.length]);var H=y((0,l.Z)("hf_selected_goals_options"),2),U=H[0],B=H[1],Q=y((0,l.Z)("hf_selected_goals_options_index_list"),2),W=Q[0],V=Q[1],J=function(e,r){var o,i,a,l,u=(null==I?void 0:null===(o=I.answer_choices.find(function(n){return n.text===e}))||void 0===o?void 0:o.answer_handle)||"";b&&u&&O(u,j,b),n.includes(e)?(i=n.filter(function(n){return n!==e}),a=x.filter(function(e){return e!==r})):(i=m(n).concat([e]),a=m(x).concat([r])),t(i),C(a),V(JSON.stringify(a)),B(JSON.stringify(i)),z&&M((null===(l=R.get(u))||void 0===l?void 0:l.id)||"")};return(0,o.useEffect)(function(){A.setAttributes({listOfOptionsFromQuestionnaire:z}),A.end()},[]),(0,o.useEffect)(function(){U&&t(JSON.parse(U)),W&&C(JSON.parse(W))},[U,W,t,C]),(0,r.BX)(i.xu,{children:[(G||_)&&(0,r.tZ)(P,{isGoalsStepSlotEnabled:_,subtitle:null==E?void 0:E.subTitle}),(0,r.tZ)(i.xu,{role:"radiogroup","aria-labelledby":d.tf,"data-test-id":"single-question-goals-screen",children:(0,r.tZ)(i.xu,{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:"global.sm-1",minHeight:"410px",children:L&&L.map(function(e,t){var o,a,l=(null==I?void 0:null===(o=I.answer_choices.find(function(n){return n.text===e}))||void 0===o?void 0:o.answer_handle)||"",u=z?F.has((null===(a=R.get(l))||void 0===a?void 0:a.id)||""):n.includes(e);return(0,r.tZ)(i.Zb.Selectable,{variant:"elevated",selected:u,"data-test-id":"goals-".concat(t),onClick:function(){return J(e,t)},disabled:!1,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:(0,r.tZ)(i.xv,{"data-test-id":"goals-title",whiteSpace:"normal",wordBreak:"break-word",type:"body-md-bold",children:z?e:w("funnel.plans.singleQuestionFlow.quiz.title-".concat(e))})},t)})})})]})}},176909:function(e,n,t){t.d(n,{E:function(){return r}});var r="factor-exclusions"},167699:function(e,n,t){var r=t(12939),o=t(518113),i=t(176909);n.Z=function(){var e=(0,r.Z)(),n=null==e?void 0:e.questions.find(function(e){return e.question_handle===i.E}),t=(0,o.Z)({surveyId:(null==e?void 0:e.survey_id)||"",translationId:(null==e?void 0:e.id)||"",questionId:(null==n?void 0:n.question_id)||"",answerChoices:(null==n?void 0:n.answer_choices)||[]}),a=t.selectedSurveyResponses,l=t.setSelectedSurveyResponses;return{selectedExclusionHandles:Array.from(a).map(function(e){var t=null==n?void 0:n.answer_choices.find(function(n){return n.answer_id===e});return(null==t?void 0:t.answer_handle)||""}),selectedExclusionResponses:a,setExclusionResponse:l}}},453851:function(e,n,t){t.d(n,{n:function(){return c}});var r=t(687800),o=t(827378),i=t(768587),a=t(164528),l=t(242200),u=t(359839),s=function(e){var n,t,a=e.name,s=e.icon,c=e.text,d=e.isSelected,f=void 0!==d&&d,p=e.handleClick,v=(0,u.r9)().isIntlUMKDesignEnabled,h=(0,o.useMemo)(function(){return{optionButton:{selected:{borderWidth:v?"2px":"3px",borderColor:"alias.interactive.foreground.default",backgroundColor:v?"global.hellofresh-lime.200":"alias.page-background.alternative"}}}},[v]);return(0,r.BX)(i.xu,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({as:"button",role:"checkbox","data-test-id":"standard-option-button-".concat(a),"aria-checked":f,backgroundColor:"alias.elevation.base",marginBottom:v?"global.sm-1":["global.xs","global.sm-2"],display:"flex",position:"relative",flexDirection:["column","row"],flex:"50%",alignItems:"center",minHeight:["100px","48px"],maxWidth:"48%",justifyContent:["space-around","flex-start"],height:v?"56px":["75px","48px"],boxShadow:v?void 0:"shadow-md",borderWidth:"1px",borderStyle:"solid",borderRadius:"global.sm",cursor:"pointer",paddingX:["global.xs","global.sm-2"],borderColor:v?"alias.interactive.foreground.default":"shared-alias.neutral.border.disabled"},f&&h.optionButton.selected),t=t={onClick:p,children:[f&&(0,r.tZ)(i.xu,{display:"flex",color:"alias.elevation.base",alignItems:"center",justifyContent:"center",borderRadius:"global.circle",backgroundColor:"alias.interactive.foreground.default",borderColor:"alias.interactive.foreground.default",borderWidth:"1px",borderStyle:"solid",position:"absolute","data-test-id":"standard-option-selected-check-icon",width:v?"16px":"27px",height:v?"16px":"27px",top:v?3:-7,left:v?3:-7,children:(0,r.tZ)(l.default,{})}),(0,r.BX)(i.xu,{display:"flex",alignItems:"center",flexDirection:["column","row"],width:"100%",children:[(0,r.tZ)(i.xu,{backgroundImage:"url(".concat(s,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:["bottom","center"],width:["32px","23px"],height:["32px","23px"],marginBottom:["global.xs","zero"],marginRight:["zero","global.sm-1"]}),(0,r.tZ)(i.xv,{children:c})]})]},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))},c=function(e){var n=e.optionSelected,t=e.setOptionSelected,o=e.config,l=(0,a.ZP)("funnel.plans.singleQuestionFlow").translateRaw,u=o.name,c=o.subtitle,d=o.options;return(0,r.BX)(i.xu,{"data-test-id":"personalization-question-".concat(u),children:[(0,r.tZ)(i.xu,{marginBottom:["global.md-1","global.md-2","global.md-3"],textAlign:["left","center"],children:(0,r.tZ)(i.xv,{type:"body-md-regular",color:"shared-alias.neutral.foreground.default",children:l(c)})}),(0,r.tZ)(i.xu,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",children:d.map(function(e){return(0,r.tZ)(s,{name:e.key,icon:l(e.icon),alt:l(e.alt),text:l(e.text),isSelected:n===e.key,handleClick:function(){return t(e.key)}},e.key)})})]})}},476426:function(e,n,t){var r=t(376099),o=t(52016),i=t(306286),a=t(471600);n.Z=function(e,n){var t,l=(0,i.$h)(),u=(0,a.Z)(),s=(0,r.P)().preferences,c=(0,o.Up)({selectedPreferences:e,preferences:u.preferences,multiplePreferences:u.multiplePreferences,productCtx:l,presets:u.presets});return!c||!((null===(t=s.find(function(e){return e.handle===c}))||void 0===t?void 0:t.subpreferences)||[]).some(function(e){return e.dietType===n})}},46911:function(e,n,t){t.r(n),t.d(n,{PORK_CONFIG:function(){return d}});var r=t(687800),o=t(827378),i=t(768587),a=t(253977),l=t(170231),u=t(738716),s=t(453851),c=t(476426),d={name:"pork",subtitle:"".concat(u.F,".pork.subtitle"),options:[{key:"pork",icon:"".concat(u.F,".pork.porkAcceptable.icon"),alt:"".concat(u.F,".pork.porkAcceptable.alt"),text:"".concat(u.F,".pork.porkAcceptable.text")},{key:"porkfree",icon:"".concat(u.F,".pork.porkFree.icon"),alt:"".concat(u.F,".pork.porkFree.alt"),text:"".concat(u.F,".pork.porkFree.text")}]};n.default=function(e){var n=(0,a.t)(),t=n.selectedPorkPreference,u=n.setPorkPreference,f=(0,c.Z)(e.selectedPreferences,"porkfree");return((0,o.useLayoutEffect)(function(){f?(u(void 0),e.directToNextPage({replaceState:!0})):e.setDisableCTA(!1)},[f]),f)?null:(0,r.tZ)(i.xu,{"data-test-id":"single-question-personalization-pork-screen",children:(0,r.tZ)(s.n,{config:d,optionSelected:t,setOptionSelected:function(e){(0,l.i)(e)&&u(e)}})})}},159402:function(e,n,t){t.r(n),t.d(n,{SPICY_CONFIG:function(){return f}});var r=t(687800),o=t(827378),i=t(768587),a=t(738716),l=t(253977),u=t(380624),s=t(959827),c=t(476426),d=t(453851),f={name:"spice",subtitle:"".concat(a.F,".spice.subtitle"),options:[{key:"spicy",icon:"".concat(a.F,".spice.spiceAcceptable.icon"),alt:"".concat(a.F,".spice.spiceAcceptable.alt"),text:"".concat(a.F,".spice.spiceAcceptable.text")},{key:"nonspicy",icon:"".concat(a.F,".spice.spiceFree.icon"),alt:"".concat(a.F,".spice.spiceFree.alt"),text:"".concat(a.F,".spice.spiceFree.text")}]};n.default=function(e){var n=(0,u.E)(),t=n.selectedSpicePreference,a=n.setSpicePreference,p=(0,l.t)().selectedPorkPreference,v=(0,c.Z)(e.selectedPreferences,"nonspicy")||"porkfree"===p;return((0,o.useLayoutEffect)(function(){v?(a(void 0),e.directToNextPage({replaceState:!0})):e.setDisableCTA(!1)},[v]),v)?null:(0,r.tZ)(i.xu,{"data-test-id":"single-question-personalization-spicy-screen",children:(0,r.tZ)(d.n,{config:f,optionSelected:t,setOptionSelected:function(e){(0,s.r)(e)&&a(e)}})})}},511195:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(66077),o=t(76898),i=t(543790),a={availableOptions:[],overrides:[{systemCountry:o.Rc[i.Z.factor].US,values:{availableOptions:[4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],hideMealsParamsOptions:{4:{utm_content:["appcrm","partnerships","sms"],utm_source:["pushnotification","push_notification","inapp","appcrm","deals","bx","wunderkind","partnership","groupon","deals"],utm_campaign:["pushnotification","partnerships","groupon","sms"],utm_medium:["app","push","sms","text"]}},defaultRecommendedMeals:6}},{systemCountry:o.Rc[i.Z.factor].CA,values:{availableOptions:[6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36]}},{systemCountry:o.Rc[i.Z.factor].BE,values:{availableOptions:[4,6,8,10,12,14,15,16]}},{systemCountry:o.Rc[i.Z.factor].NL,values:{availableOptions:[4,6,8,10,12,14,15,16]}},{systemCountry:o.Rc[i.Z.factor].DE,values:{availableOptions:[5,6,8,10,12,14,16]}},{systemCountry:o.Rc[i.Z.factor].DK,values:{availableOptions:[4,5,6,8,10,12,14,15,16]}},{systemCountry:o.Rc[i.Z.factor].SE,values:{availableOptions:[4,6,8,10,12,14,15,16]}},{systemCountry:o.Rc[i.Z.youfoodz].AU,values:{availableOptions:[5,6,7,8,10,12,14,16,18,20,25,30,35,40,45],defaultRecommendedMeals:10,zipcodeConfig:{shouldHideMealsByZipcode:!0,optionsToHide:[5],zipcodes:[822,850,853,2123,2164,2168,2170,2171,2173,2174,2175,2176,2177,2178,2233,2312,2422,2423,2426,2427,2428,2429,2430,2431,2439,2440,2441,2443,2444,2445,2446,2447,2448,2449,2450,2452,2454,2456,2470,2471,2472,2473,2474,2477,2478,2479,2480,2481,2482,2483,2484,2536,2537,2545,2546,2548,2549,2550,2551,2571,2572,2573,2574,2575,2576,2577,2578,2579,2581,2582,2583,2584,2585,2586,2587,2588,2590,2594,2621,2622,2626,2630,2644,2645,2648,2650,2651,2652,2653,2655,2656,2658,2659,2660,2661,2663,2665,2666,2680,2681,2700,2705,2706,2707,2710,2712,2713,2716,2717,2720,2722,2726,2727,2729,2738,2739,2758,2779,2780,2782,2783,2784,2785,2786,3221,3222,3223,3224,3225,3226,3227,3228,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3249,3250,3251,3254,3260,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,327
15,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3289,3293,3294,3300,3301,3302,3303,3304,3305,3322,3323,3324,3325,3328,3329,3330,3361,3373,3374,3375,3377,3378,3379,3380,3381,3384,3385,3400,3401,3409,3435,3442,3444,3446,3447,3448,3453,3468,3469,3496,3498,3500,3501,3505,3521,3522,3566,3567,3568,3575,3579,3580,3581,3583,3584,3585,3586,3588,3589,3700,3812,3813,3814,3815,3816,3818,3820,3821,3822,3823,3824,3825,3831,3833,3835,3840,3842,3844,3847,3850,3851,3852,3854,3856,3857,3858,3859,3860,3862,3864,3865,3869,3870,3871,3873,3874,3875,3878,3880,3882,3885,3886,3887,3888,3902,3903,3904,3909,3922,3923,3925,3945,3946,3950,3951,3953,3954,3956,3957,3958,3959,3960,3962,3964,3965,3966,3967,3971,3979,3981,3984,3987,3988,3990,3991,3992,3995,3996,4354,4401,4403,4405,4413,4580,4581,4650,4655,4659,4660,4662,4670,4671,4799,4800,4802,4805,4850,4859,4860,4865,4868,4869,4870,4871,4877,4878,4879,4880,4883,4884,4885,6e3,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6041,6042,6043,6044,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6076,6077,6078,6079,6081,6082,6083,6084,6090,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6121,6122,6123,6125,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6180,6181,6182,6207,6208,6209,6210,6211,6214,6215,6218,6220,6225,6229,6230,6232,6233,6237,6239,6271,6280,6281,6282,6284,6285,6286,6302,6401,6403,6503,6507,6511,6514,6516,6518,6521,6525,6528,6530,6532,6556,6558,6562,6566,7305,7306,7307,7310,7315,7316,7320,7321,7322,7325,7330,7331]}}}]},l=(0,r.Z)("hf.funnel.goalsPlan",a).useConfig},695442:function(e,n,t){t.d(n,{F9:function(){return c},b:function(){return u},od:function(){return s}});var r=t(693961),o=t(448249),i=t(932023),a=t(780742),l=t(511195),u={justMe:1,twoOfUs:2,groupFamily:3.5,team:5},s={justOne:1,lunchDinner:2,allMeals:3.5},c={oneTwoDays:1.5,threeDays:3,weekdays:5,everyday:7};n.ZP=function(e){var n=(0,r.S)().selectedMealsPerDay,t=(0,o.w)().selectedDaysPerWeek,d=(0,i.F)().selectedNumberOfPeople,f=(0,l.Z)().defaultRecommendedMeals;if(!d&&!t&&!n&&void 0!==f)return(0,a.Z)(e,f);var p=d?u[d]:u.groupFamily,v=Math.ceil(p*(t?c[t]:c.everyday)*(n?s[n]:s.allMeals));if(5===p){var h=5*Math.ceil(v/5),y=e.filter(function(e){return e%5==0});return y.length>0?(0,a.Z)(y,h):(0,a.Z)(e,h)}return(0,a.Z)(e,v)}},760283:function(e,n,t){var r=t(783244);function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}n.Z=function(){var e,n=function(e){if(Array.isArray(e))return e}(e=(0,r.Z)("hf_goals_plan_sku_cookie"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),3!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,3)||function(e,n){if(e){if("string"==typeof e)return o(e,3);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,3)}}(e,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return{setGoalSku:n[1],removeGoalSku:n[2]}}},780742:function(e,n,t){t.d(n,{R:function(){return o}});var r=function(e,n){for(var t=0;t<e.length;t++)if(e[t]>n)return t},o=function(e,n,t){if(!n||!t||!(null==e?void 0:e.recommendedPlanSizes)||void 0===e.recommendedIndex)return null==e?void 0:e.recommendedIndex;var r=e.recommendedPlanSizes,o=e.recommendedIndex,i=r[o],a=r.indexOf(t);return i===n&&-1!==a?a:o};n.Z=function(e,n){var t=e[0]>n?0:e[e.length-1]<n?e.length-1:e.includes(n)?e.indexOf(n):r(e,n);if(void 0!==t){if(0===t)return{recommendedPlanSizes:e.slice(0,4),recommendedIndex:0};if(!(e.length-3<t))return{recommendedPlanSizes:e.slice(t-1,t+3),recommendedIndex:1};var o=e.length-2<t?3:2;return{recommendedPlanSizes:e.slice(e.length-4,e.length),recommendedIndex:o}}}},625889:function(e,n,t){t.d(n,{c:function(){return o}});var r=t(917983),o=function(e){return[r.Z.HelloFreshDefaultGlobal,r.Z.ProteinExclusionExperimentIntl,r.Z.HelloFreshDefaultUS,r.Z.HelloFreshDefaultDesktopUS,r.Z.ProteinExclusionExperimentUS,r.Z.WLMealKitPlanRecommendation,r.Z.WLMealKitPlanRecommendationSQF2,r.Z.WLMealKitPlanRecommendationWithZipcode,r.Z.HelloFreshDefaultGlobalDesktopSQF2,r.Z.HelloFreshDefaultGlobalDesktop,r.Z.GreenChefUS].includes(e)}},720232:function(e,n,t){t.d(n,{y:function(){return u}});var r=t(66077),o=t(26730),i=t(543790),a=t(396887),l={minHeightOverride:"",canSkipZipcodeStep:!1,defaultZipcode:"",overrides:[{systemCountry:o.Z.YE,values:{minHeightOverride:"570px"}},{brand:i.Z.hellofresh,serverEnv:[a.Xe.staging,a.Xe.local],values:{canSkipZipcodeStep:!0}},{systemCountry:[o.Z.AT,o.Z.LU,o.Z.NZ],values:{defaultZipcode:"1010"}},{systemCountry:[o.Z.AU,o.Z.BE,o.Z.CH,o.Z.DK,o.Z.NO],values:{defaultZipcode:"2000"}},{systemCountry:[o.Z.ES,o.Z.US],values:{defaultZipcode:"10005"}},{systemCountry:o.Z.DE,values:{defaultZipcode:"10405"}},{systemCountry:o.Z.FR,values:{defaultZipcode:"59000"}},{systemCountry:o.Z.IT,values:{defaultZipcode:"20121"}},{systemCountry:o.Z.SE,values:{defaultZipcode:"11111"}},{systemCountry:o.Z.CA,values:{defaultZipcode:"M5V2K4"}},{systemCountry:o.Z.GB,values:{defaultZipcode:"EC2A2EZ"}},{systemCountry:o.Z.IE,values:{defaultZipcode:"D08E161"}},{systemCountry:o.Z.NL,values:{defaultZipcode:"5541RS"}}]},u=(0,r.Z)("hf.single-question-flow.zipcode-step",l).useConfig},871583:function(e,n,t){t.d(n,{v:function(){return y}});var r=t(887824),o=t(966622),i=t(407792),a=t(783244),l=t(268481),u=t(827378),s=t(60074),c=t(937558),d=t(52130),f=function(){var e=(0,d.L3)().trackJanusEvent;return{trackZipcodeSubmitClick:(0,u.useCallback)(function(n){var t=n.frontendZipcode,r=n.uiComponentName,o=n.uiComponentLabel;try{e(c.Z.janusEvent({uiComponent:c.Z.uiComponent({uiComponentName:r,uiComponentLabel:null!=o?o:null}),zipcode:c.Z.zipcode({frontendZipcode:t})}))}catch(e){(0,s.Tb)(e,{tags:{event:"Zipcode_Submit_ZipCode_Button_Click",component:"useZipcodeSubmitSnowplowEvent"}})}},[e])}};function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function h(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var y=function(){var e,n=(0,r.Z)().push,t=(0,o.py)({runUsingStatsig:!0}),u=t.track,s=t.isReady,c=(0,i.O)(),d=c.id,y=c.attributes,m=(0,l.Sj)(),b=(function(e){if(Array.isArray(e))return e}(e=(0,a.Z)("hf_prefill_zipcode"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,1)||function(e,n){if(e){if("string"==typeof e)return p(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],g=f().trackZipcodeSubmitClick,S={viewport:m,event:"gaEventTrigger",gaEventCategory:"funnel"},P={viewport:m,brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel"};return{trackZipcodeStepDisplayed:function(){n(h(v({},S),{event_name:"SelectPlan_ZIPCodePageDisplay",gaEventAction:"ZIPCodePagedisplay",gaEventLabel:"-"})),u({experimentationUserId:d,experimentationUserAttributes:y,eventName:"SelectPlan_ZIPCodePageDisplay",eventTags:h(v({},P),{EventAction:"ZIPCodePagedisplay",EventLabel:""})})},trackClickCTAZipcodeStep:function(){n(h(v({},S),{event_name:"SelectPlan_ZipCodeCTAClick",gaEventAction:"ZIPCodeCTAClick",gaEventLabel:b,ZIP_first_3_digits:b,publicID:d})),u({experimentationUserId:d,experimentationUserAttributes:y,eventName:"SelectPlan_ZipCodeCTAClick",eventTags:h(v({},P),{EventAction:"ZIPCodeCTAClick",EventLabel:b})}),g({frontendZipcode:Number(b),uiComponentName:"SelectPlan_ZipCodeCTAClick",uiComponentLabel:"Continue"})},isStatsigReady:s}}},637357:function(e,n,t){function r(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}t.d(n,{$4:function(){return s},AV:function(){return a},Nt:function(){return l},ge:function(){return u}});var o,i=(0,t(575085).Z)("hf.single-question-flow.questionnaire",(o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:return[4,t.e(51599).then(t.bind(t,651599))];case 1:return[2,e.sent()]}})},function(){var e=this,n=arguments;return new Promise(function(t,i){var a=o.apply(e,n);function l(e){r(a,t,i,l,u,"next",e)}function u(e){r(a,t,i,l,u,"throw",e)}l(void 0)})})),a=i.ProjectConfigProvider,l=i.configMiddleware,u=i.useConfig,s=i.getConfigFromSSRPayload},200061:function(e,n,t){t.d(n,{Bw:function(){return i},CU:function(){return a},j1:function(){return o},tf:function(){return r}});var r="single-question-step-header",o="single-question-step-subtitle",i="meal-type-step-subtitle",a="no-preference-error-text"},775107:function(e,n,t){t.d(n,{sL:function(){return o},xV:function(){return i}});var r={"protein-plus":t(291059).qN,"balanced-healthy":"balancedhealthy",sustenance:"proteinrich",glp1:"glp",diabetes:"carbsmart"},o=function(e){var n;return null!==(n=r[e])&&void 0!==n?n:e},i=function(e){return e.map(o)}},6471:function(e,n,t){t.d(n,{S:function(){return r},l:function(){return o}});var r={saveMoney:"goal-money",eatHealthy:"goal-eat-healthy",saveTime:"goal-save-time",discoverNewRecipes:"goal-discover-new-recipes",
1wasteLessFood:"goal-waste-less-food",easierMealPlanning:"goal-easier-meal-planning",goalLeanProtein:"goal-lean-protein",goalFruitsVeggies:"goal-fruits-veggies",goalReduceSugar:"goal-reduce-sugar",goalWholeGrains:"goal-whole-grains",goalAvoidProcessed:"-goal-avoid-processed",goalFiveMinutesOrLess:"goal-five-minutes-or-less",goalTenMinutesToFifteenMinutes:"goal-ten-minutes-to-fifteen-minutes",goalMoreThanTwentyMinutes:"goal-more-than-twenty-minutes",goalNoCook:"goal-no-cook",goalItDepends:"goal-it-depends",goalFreshHighQuality:"goal-fresh-high-quality",goalGreatFlavor:"goal-great-flavor",goalTrustedSourcing:"goal-trusted-sourcing",goalBalancedNutrition:"goal-balanced-nutrition",goalMealsThatLookGoodAsTaste:"goal-meals-that-look-good-as-taste",goalGlobalFlavors:"goal-global-flavors",goalNewDishesPerWeek:"goal-new-dishes-per-week",goalBalancedMeals:"goal-balanced-meals",goalLifestyleFitOptions:"goal-lifestyle-fit-options",goalAvoidBoredom:"goal-avoid-boredom"},o={saveMoney:"funnel.plans.singleQuestionFlow.quiz.title-1",eatHealthy:"funnel.plans.singleQuestionFlow.quiz.title-4",saveTime:"funnel.plans.singleQuestionFlow.quiz.title-2",discoverNewRecipes:"funnel.plans.singleQuestionFlow.quiz.title-8",wasteLessFood:"funnel.plans.singleQuestionFlow.quiz.title-9",easierMealPlanning:"funnel.plans.singleQuestionFlow.quiz.title-7"}},738716:function(e,n,t){t.d(n,{F:function(){return r}});var r="funnel.plans.singleQuestionFlow.personalization"},290051:function(e,n,t){t.d(n,{EL:function(){return o},WP:function(){return i},x$:function(){return a},xb:function(){return r}});var r="3",o=604800,i=9,a=2},639354:function(e,n,t){t.d(n,{qk:function(){return r},ry:function(){return o}});var r={chefschoice:"chefschoice",veggie:"veggie",fit:"fit",family:"family",quick:"quick",pescatarian:"pescatarian",premium:"premium",vegan:"veganvegetarian"},o="hf_ssr_stored_presets"},950928:function(e,n,t){t.d(n,{z:function(){return s}});var r=t(647220),o=t(581340),i=t(527157),a=t(543790),l=t(268481),u=t(726745),s=function(){var e=(0,r.e)(),n=(0,i.Z)(),t=(0,l.Sj)(),s=(0,o.t)().query,c=(0,u.Z)();return e&&n===a.Z.factor&&"mobile"!==t&&"1"===s.sqf&&c}},292362:function(e,n,t){t.d(n,{SL:function(){return s}});var r=t(827378),o=t(966622),i=t(407792),a=t(581340),l=t(479922),u="onbd-95-raf-freebies-funnel",s=function(){var e,n,t=(0,a.t)(),s=t.query,c=t.isReady,d=(0,l.Z)(),f=(0,r.useRef)(!1),p=(0,o.py)({runUsingStatsig:!0}),v=p.decide,h=p.isReady,y=(0,i.O)(),m=y.id,b=y.attributes,g=null==s?void 0:s.raf_freebies_funnel_test;if(void 0!==g)return{isRafFunnelEnabled:"CA"===g};var S="";if(s.utm_source&&(S=Array.isArray(s.utm_source)?s.utm_source[0]:s.utm_source),!h||!c)return{isRafFunnelEnabled:!1};var P=v({experimentKey:u,experimentationUserId:m,experimentationUserAttributes:(e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},b),n=n={utm_source:S},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e)}).variationKey;return P&&(null==d?void 0:d.setAttributes)&&!f.current&&(d.setAttributes({experiment_key:u,variation_key:P}),f.current=!0),{isRafFunnelEnabled:"variation"===P}}},408570:function(e,n,t){t.d(n,{Bw:function(){return s}});var r=t(827378),o=t(966622),i=t(407792),a=t(581340),l=t(479922),u="onbd-95-raf-freebies-funnel-us",s=function(){var e,n,t=(0,a.t)(),s=t.query,c=t.isReady,d=(0,l.Z)(),f=(0,r.useRef)(!1),p=(0,o.py)({runUsingStatsig:!0}),v=p.decide,h=p.isReady,y=(0,i.O)(),m=y.id,b=y.attributes,g=null==s?void 0:s.raf_freebies_funnel_test;if(void 0!==g)return{isRafFunnelUSEnabled:"US"===g};if(!h||!c||"freebies"!==s.utm_source)return{isRafFunnelUSEnabled:!1};var S=v({experimentKey:u,experimentationUserId:m,experimentationUserAttributes:(e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},b),n=n={utm_source:s.utm_source||""},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e)}).variationKey;return S&&(null==d?void 0:d.setAttributes)&&!f.current&&(d.setAttributes({experiment_key:u,variation_key:S}),f.current=!0),{isRafFunnelUSEnabled:"variation"===S}}},885748:function(e,n,t){t.d(n,{Tq:function(){return f}});var r=t(827378),o=t(966622),i=t(407792),a=t(581340),l=t(479922),u=t(961081),s=t(482559),c="onbd-117-raf-order-summary",d="variation",f=function(){var e,n,t=(0,u.sV)().stepName,f=(0,a.t)(),p=f.query,v=f.isReady,h=(0,l.Z)(),y=(0,r.useRef)(!1),m=(0,o.py)({runUsingStatsig:!0}),b=m.decide,g=m.isReady,S=(0,i.O)(),P=S.id,O=S.attributes,w=t===s.h.planRecommendation;if(!g||!v||!w)return{isRafOrderSummaryEnabled:!1};var k=null==p?void 0:p.raf_order_summary_test;if(void 0!==k)return{isRafOrderSummaryEnabled:k===d};var x="";p.utm_source&&(x=Array.isArray(p.utm_source)?p.utm_source[0]:p.utm_source);var C=b({experimentKey:c,experimentationUserId:P,experimentationUserAttributes:(e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},O),n=n={utm_source:x},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e)}).variationKey;return C&&(null==h?void 0:h.setAttributes)&&!y.current&&(h.setAttributes({experiment_key:c,variation_key:C}),y.current=!0),{isRafOrderSummaryEnabled:C===d}}},966259:function(e,n,t){var r=t(687800),o=t(768587),i=t(921318),a=t(482559),l=t(961081),u=t(409062),s=t(254717),c=t(12939),d=t(572344),f=t(707866);n.Z=function(e){var n,t,p=e.withPaddingBottom,v=(0,l.sV)().stepName,h=(0,c.Z)(),y=(0,i.qC)("header-title-slot"),m=y.isEnabled,b=y.content,g=s.cw[v],S=null==h?void 0:h.questions.find(function(e){return e.question_handle===g}),P=(0,d.q8)(),O=P.stepTitles,w=P.stepTitlesV2,k=((0,f.t)().isInExtendedFunnelV2Test&&w?w[v]:void 0)||O[v],x=(0,u.K)().proteinPreferenceTitle,C=(null==S?void 0:S.text)||"";return(v===a.h.exProteinPreferences&&x&&(C=x),k&&(C=k),m&&b&&b.listOfTitles&&v in b.listOfTitles&&(C=b.listOfTitles[v]),C)?(0,r.tZ)(o.xu,{display:"flex",width:"100%",children:(0,r.tZ)(o.xu,(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({width:"100%"},(void 0===p||p)&&{paddingBottom:"global.sm-2"}),t=t={children:(0,r.tZ)(o.xv,{id:s.HT,"data-test-id":s.HT,as:"h2",wordBreak:"break-word",children:C})},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}):null}},108243:function(e,n,t){var r=t(687800);t(827378);var o=t(768587),i=t(527157),a=t(543790),l=t(268481),u=t(783244),s=t(961081),c=t(482559),d=t(572344),f=t(254717);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function v(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}}
1(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(){var e=(0,s.sV)().stepName,n=(0,d.q8)(),t=n.stepSubtitles,p=n.planRecommendation,h=(0,i.Z)()===a.Z.factor,y=(0,l.Sj)(),m=e===c.h.planRecommendation,b=v((0,u.Z)("hf_selected_number_of_people"),1)[0],g=v((0,u.Z)("hf_selected_number_of_servings"),1)[0],S=0;if(m&&g){var P=Number(g);P>0&&(S=P)}if(0===S&&b)try{var O,w=null===(O=JSON.parse(b))||void 0===O?void 0:O.total;void 0!==w&&(S=Number(w))}catch(e){S=0}var k=1===S,x=t[e];return(m&&k&&(null==p?void 0:p.onePersonSubtitle)&&(x=p.onePersonSubtitle),x)?(0,r.tZ)(o.xu,{display:"flex",width:"100%",children:(0,r.tZ)(o.xu,{width:"100%",paddingBottom:"global.md-1",children:(0,r.tZ)(o.xv,{id:f.v9,"data-test-id":f.v9,type:"body-md-regular",color:"mobile"===y&&h?"shared-alias.neutral.background.darker":"shared-alias.neutral.foreground.default",children:x})})}):null}},572344:function(e,n,t){function r(e,n,t,r,o,i,a){try{var l=e[i](a),u=l.value}catch(e){t(e);return}l.done?n(u):Promise.resolve(u).then(r,o)}t.d(n,{q8:function(){return l},yx:function(){return a}});var o,i=(0,t(575085).Z)("hf.plans.single-question-flow.extended-funnel",(o=function(){return function(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(t)throw TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(e,a)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return[2,t.e(36630).then(t.bind(t,336630))]})},function(){var e=this,n=arguments;return new Promise(function(t,i){var a=o.apply(e,n);function l(e){r(a,t,i,l,u,"next",e)}function u(e){r(a,t,i,l,u,"throw",e)}l(void 0)})})),a=i.ProjectConfigProvider,l=(i.configMiddleware,i.useConfig);i.getConfigFromSSRPayload},254717:function(e,n,t){t.d(n,{A0:function(){return f},HT:function(){return a},MQ:function(){return b},Nb:function(){return k},OR:function(){return P},Ve:function(){return u},Xb:function(){return g},YI:function(){return s},cw:function(){return C},gS:function(){return O},kO:function(){return w},m$:function(){return v},mW:function(){return h},pP:function(){return m},tZ:function(){return x},v4:function(){return d},v9:function(){return l}});var r,o=t(482559);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var a="extended-funnel-header",l="extended-funnel-subtitle",u="extended-funnel-back-button",s="single-page-continue-button",c="p500-household-size",d="ef_up_cuisines",f="p500-goals",p="p500-meal-types",v="p500-ingredient-exclusion",h="ef_up_primaryProteins",y="p500-dietary-preferences",m="p500-nutrition-goals",b="p500-flavor-preferences",g="p500-dinner-preferences",S="p500-cooking-frequency",P="goals",O="peopleNumber",w="dailyMealsNumber",k="daysPerWeek",x="factor-exclusions",C=(i(r={},o.h.exHouseholdSize,c),i(r,o.h.exGoalsStep,f),i(r,o.h.exCuisinePreference,d),i(r,o.h.exNutritionPreferences,m),i(r,o.h.exDietaryRestrictions,v),i(r,o.h.exMealType,p),i(r,o.h.exDietaryPreferences,y),i(r,o.h.exProteinPreferences,h),i(r,o.h.exFlavorPreferences,b),i(r,o.h.exDinnerPreferences,g),i(r,o.h.exCookingFrequency,S),i(r,o.h.exFJGoalsStep,P),i(r,o.h.exFJHouseholdSize,O),i(r,o.h.exFJMealsPerDay,w),i(r,o.h.exFJMealsPerWeek,k),i(r,o.h.exDesktopCu
1isine,d),i(r,o.h.exDesktopFlavors,b),i(r,o.h.exDesktopProteins,h),i(r,o.h.exDesktopDinnerType,g),i(r,o.h.exDesktopNutritionPreferences,m),i(r,o.h.exDesktopCookingFrequency,S),i(r,o.h.exDesktopHouseholdSize,c),i(r,o.h.exDesktopMealType,p),i(r,o.h.exDesktopDietaryPreferences,y),r)},707866:function(e,n,t){t.d(n,{t:function(){return f}});var r=t(827378),o=t(783244),i=t(966622),a=t(407792),l=t(581340),u=t(479922),s=t(268481);function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var d="uscro-8140-p500_v2_test",f=function(){var e,n=(0,l.t)(),t=n.query,f=n.isReady,p=(0,u.Z)(),v=(0,r.useRef)(!1),h=(0,s.Sj)(),y=(0,i.py)({runUsingStatsig:!0}),m=y.decide,b=y.isReady,g=(0,a.O)(),S=g.id,P=g.attributes,O=function(e){if(Array.isArray(e))return e}(e=(0,o.Z)("hf_ex_funnel_v2"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,n){if(e){if("string"==typeof e)return c(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),w=O[0],k=O[1],x=(null==P?void 0:P.viewport)==="mobile"||"mobile"===h;if("4"===t.sqf&&x||w&&"1"===w)return{isInExtendedFunnelV2Test:!0};if(!b||!f||w&&"0"===w)return{isInExtendedFunnelV2Test:!1};var C=!1;if(b){var A=m({experimentKey:d,experimentationUserId:S,experimentationUserAttributes:P}).variationKey;A&&(null==p?void 0:p.setAttributes)&&!v.current&&(p.setAttributes({experiment_key:d,variation_key:A}),v.current=!0),k((C="variation_1"===A)?"1":"0")}return{isInExtendedFunnelV2Test:C}}},345889:function(e,n,t){t.d(n,{K:function(){return d}});var r=t(527157),o=t(200770),i=t(543790),a=t(26730),l=t(268481),u=t(612771),s=t(235487),c=t(872728),d=function(){var e=(0,c.KR)(),n=(0,l.Sj)(),t=(0,s.D)().isMobile,d=(0,r.Z)(),f=(0,o.Z)(),p=!!e&&e.length>0,v=d!==i.Z.factor&&d!==i.Z.youfoodz,h=f===a.Z.US||f===a.Z.FJ,y=n===u.P.server?!!t:"mobile"===n;return!!p&&!!v&&(!!y||!h)}},409062:function(e,n,t){t.d(n,{K:function(){return l}});var r=t(639354),o=t(572344),i=t(142432);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var l=function(){var e,n=(0,i.Q)().selectedPreferences,t=(0,o.q8)(),l=t.proteinPreferenceItems,u=t.seafoodPreferenceItems,s={idPrefix:"plant",proteinPreferenceTitle:"Which meat-free proteins do you enjoy?",preferenceItems:t.plantPreferenceItems},c=(a(e={},r.qk.veggie,s),a(e,r.qk.vegan,s),a(e,r.qk.pescatarian,{idPrefix:"seafood",proteinPreferenceTitle:"Which seafood do you enjoy?",preferenceItems:u}),e),d=[r.qk.veggie,r.qk.vegan,r.qk.pescatarian].find(function(e){return n.includes(e)});return d&&c[d]||{idPrefix:"protein",proteinPreferenceTitle:"Which proteins do you enjoy?",preferenceItems:l}}},531592:function(e,n,t){t.d(n,{$:function(){return a}});var r=t(827378),o=t(872728),i=t(482559),a=function(){var e=(0,o.ut)(i.h.goalsPlanRecommendation),n=(0,r.useMemo)(function(){var n,t,r,o;return null!==(o=null==e?void 0:null===(r=e.variations)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:null===(n=t.stepContents)||void 0===n?void 0:n[0])&&void 0!==o?o:null},[e]);return{isVariation:!!n&&"uiVariant"in n&&((null==n?void 0:n.uiVariant)==="mealkit-variation"||(null==n?void 0:n.uiVariant)==="ready-to-eat"||(null==n?void 0:n.uiVariant)==="ready-to-eat-v2")}}},135596:function(e,n,t){t.d(n,{KM:function(){return l},Py:function(){return c},RC:function(){return u},Rc:function(){return i},aD:function(){return a},hP:function(){return r},li:function(){return o},tu:function(){return d},vV:function(){return s},yb:function(){return f}});var r="factor-extended-funnel-back-button",o="single-page-continue-button",i="https://cdn.hellofresh.com/us/funnel-fragment/plans/FactorNewFFLReminder.png",a="Free add-ons options image",l="16/9",u=3,s=["freecategory2","cpj","modularity"],c=[{top:"global.md-2",left:"global.lg-1"},{top:"global.xl-1",right:"global.lg-2"},{top:"global.xxl",left:"global.xxl"}],d="funnel.plans.singleQuestionFlow.newFFLReminder.title",f="funnel.plans.singleQuestionFlow.newFFLReminder.subtitle"},393761:function(e,n,t){t.d(n,{Cb:function(){return u},ER:function(){return s},bd:function(){return a},f0:function(){return r},fM:function(){return i},i8:function(){return o},yt:function(){return l}});var r="extended-funnel-desktop-tile-layout",o="calc(100vh - 150px - 3rem)",i="720px",a={marginLeft:-12,marginRight:-12,paddingLeft:12,paddingRight:12},l=400,u=300,s=250},523921:function(e,n,t){t.d(n,{o:function(){return d}});var r=t(827378),o=t(783244),i=t(235487),a=t(200770),l=t(26730),u=t(268481),s=t(612771);function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var d=function(){var e,n=(0,i.D)(),t=n.isDesktop,d=n.isTablet,f=(0,u.Sj)(),p=f===s.P.server?!!t||!!d:"desktop"===f||"tablet"===f,v=(0,a.Z)(),h=function(e){if(Array.isArray(e))return e}(e=(0,o.Z)("hf_ex_funnel_desktop"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,n){if(e){if("string"==typeof e)return c(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,2)}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=h[0],m=h[1],b=p&&v===l.Z.US,g=b?"1":"0";return(0,r.useEffect)(function(){y!==g&&m(g)},[y,g]),{isExtendedFunnelDesktopEnabled:b}}},917983:function(e,n,t){t.d(n,{Z:function(){return r}});var r=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({Default:"Default",DefaultDesktop:"DefaultDesktop",YoufoodzDefault:"YoufoodzDefault",FactorUSDefault:"FactorUSDefault",RoutedFromPlans:"RoutedFromPlans",HelloFreshDefaultGlobal:"HelloFreshDefaultGlobal",HelloFreshDefaultGlobalDesktop:"HelloFreshDefaultGlobalDesktop",HelloFreshDefaultUS:"HelloFreshDefaultUS",HelloFreshDefaultDesktopUS:"HelloFreshDefaultDesktopUS",HelloFreshDefaultGlobalDesktopSQF2:"HelloFreshDefaultGlobalDesktopSQF2",ProteinExclusionExperimentUS:"ProteinExclusionUS",ProteinExclusionExperimentIntl:"ProteinExclusionIntl",FactorPlanRecommendationWithZipcode:"FactorPlanRecommendationWithZipcode",WLMealKitDefault:"WLMealKitDefault",WLMealKitPlanRecommendation:"WLMealKitPlanRecommendation",WLMealKitPlanRecommendationSQF2:"WLMealKitPlanRecommendationSQF2",WLMealKitPlanRecommendationWithZipcode:"WLMealKitPlanRecommendationWithZipcode",FactorUSFlowOnDesktopWithRecommender:"FactorUSFlowOnDesktopWithRecommender",GreenChefUS:"GreenChefUS"},{ExtendedFunnelMobile:"ExtendedFunnelMobile",ExtendedFunnelMobileV2:"ExtendedFunnelMobileV2",ExtendedFunnelDesktop:"ExtendedFunnelDesktop",FJExtendedFunnelMobile:"FJExtendedFunnelMobile",HelloFreshRAFFunnelCA:"HelloFreshRAFFunnelCA",HelloFreshRAFFunnelCADesktop:"HelloFreshRAFFunnelCADesktop",HelloFreshRAFFunnelUS:"HelloFreshRAFFunnelUS",HelloFreshRAFFunnelUSDesktop:"HelloFreshRAFFunnelUSDesktop"})},975453:function(e,n,t){t.d(n,{R:function(){return a}});var r=t(581340),o=t(872728),i=t(648897),a=function(){var e=(0,o.KR)(),n=(0,r.t)().query,t=(0,i.d)();return"0"!==n.sqf&&!!e&&e.length>0&&t}},494467:function(e,n,t){t.d(n,{Z:function(){return m}});var r=t(827378),o=t(567921),i=t.n(o),a=t(268481),l=t(408558),u=t(200770),s=t(26730),c=t(52016),d=t(230145),f=t(639354),p=t(813296),v=t(581340),h=function(e){var n,t=(0,v.t)();return(0,r.useMemo)(function(){if(0!==e.length){var n,r,o,i=(e.find(function(e){return e.default})||e[0]).preferenceName,a="string"==typeof(n=null===(r=t.query)||void 0===r?void 0:r.preference)&&""!==n?n:(0,p.isArray)(n)&&!(0,p.isEmpty)(n)?n[0]:i;return a!==i&&e.some(function(e){return e.preferenceName===a})&&(o=a),o}},[e,null===(n=t.query)||void 0===n?void 0:n.preference])},y=t(471600),m=function(){var e=(0,u.Z)()===s.Z.US,n=(0,y.Z)(),t=n.preferences,o=n.multiplePreferences,p=i().get(f.ry),v=(0,d.Z)(),m=v.featuredPreset,b=v.preferenceStatusIsDefault,g="mobile"===(0,a.Sj)(),S=(0,l.iQ)(),P=h(t),O=(0,r.useMemo)(function(){var e,n,t;return(null==S?void 0:null===(t=S.items)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:null===(e=n.metadata)||void 0===e?void 0:e.presets)||[]},[S]),w=(0,r.useMemo)(function(){return(0,c.mY)(t,m,!1,g)},[t,m,g]),k=(0,r.useMemo)(function(){return(0,c.bx)({preferences:t,maxNumberOfPreferences:null==o?void 0:o.maxNumberOfPreferences,featuredPreset:m,preferenceStatusIsDefault:b,presetsCookie:p,isMobile:g,preferencesFromCartService:O,preferenceFromURLSearchParams:P})},[t,o,m,b,p,g,O,P]);return e?w:k}},82148:function(e,n,t){var r=t(235487),o=t(268481),i=t(612771);n.Z=function(){var e=(0,o.Sj)(),n=(0,r.D)(),t=n.isDesktop,a=n.isTablet;return e===i.P.server?!!t||!!a:e===i.P.desktop||e===i.P.tablet}},726745:function(e,n,t){var r=t(827378),o=t(581340),i=t(497249),a=t(872728),l=t(82148);n.Z=function(){var e=(0,a.PJ)(),n=(0,l.Z)(),t=(0,o.t)().query,u=(0,i.T)();return(0,r.useEffect)(function(){var e=u.startSpan("useIsModularFunnelDesktop");e.setAttributes({utmContent:t.utm_content||""}),e.end()},[t.utm_content,u]),!!e&&!!n}},141897:function(e,n,t){t.d(n,{X:function(){return S}});var r=t(827378),o=t(567921),i=t.n(o),a=t(581340),l=t(497249),u=t(527157),s=t(200770),c=t(543790),d=t(26730),f=t(471600),p=t(359839),v=t(292362),h=t(408570),y=t(966622),m=t(407792),b=function(){var e,n,t=(0,a.t)(),r=t.query,o=t.isReady,i=(0,y.py)({runUsingStatsig:!0}),l=i.decide,u=i.isReady,s=(0,m.O)(),c=s.id,d=s.attributes;if(!u||!o)return{isDefaultFourMealsEnabled:!1};var f=Array.isArray(r.step)?r.step[0]:r.step;return{isDefaultFourMealsEnabled:"variation_1"===l({experimentKey:"ufi-11702-default-four-meals",experimentationUserId:c,experimentationUserAttributes:(e=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},d),n=n={step:f||"1"},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e)}).variationKey}},g={mobile:[{selector:"1/2",value:"2"},{selector:"3/4",value:"4"},{selector:"5/6",value:"5"},{selector:"All",value:"6"}],desktop:[{handle:"1-2-days-per-week",value:"2",selector:"1/2"},{handle:"3-4-days-per-week",value:"4",selector:"3/4"},{handle:"5-6-days-per-week",value:"5",selector:"5/6"},{handle:"every-day",value:"6",selector:"All"},{handle:"never",value:"2",selector:"0"}]},S=function(){var e,n,t=(0,a.t)(),o=t.asPath,y=t.query,m=(0,l.T)(),S=(0,u.Z)(),P=(0,s.Z)(),O=(0,f.Z)(),w=O.defaultMealSizeSpecs,k=O.defaultForAllUsers,x=O.defaultForPaidOnly,C=(0,p.r9)().mealSelectorMapping,A=String((null==w?void 0:w.meals)||3),Z=null==o?void 0:o.startsWith("/pages/value-messaging-raf"),_="1"===i().get("hf_ssr_e_plans_config_is_freebie")||o.startsWith("/pages/raf_lp11"),E=(null!==(n=null==y?void 0:y.utm_source)&&void 0!==n?n:"").toString().toLowerCase();(0,r.useEffect)(function(){var e=m.startSpan("useMealOptionsMappings");e.setAttributes({utmSource:E,utmCampaign:(null==y?void 0:y.utm_campaign)||""}),e.end()},[E,null==y?void 0:y.utm_campaign,m]);var j="raf"===E||"raf-share"===E||"raf-freebie"===E||"freebies"===E||"offline_freebies"===E,I=j||(null==y?void 0:y.utm_source)==="Offline_Freebies"||(null==y?void 0:y.utm_campaign)==="freebieofflineprintinglink",T=S===c.Z.hellofresh&&P===d.Z.DE&&j,D=(0,v.SL)().isRafFunnelEnabled,F=(0,h.Bw)().isRafFunnelUSEnabled,R=b().isDefaultFourMealsEnabled,M=D||F,z=M||R?g:C,N=(null===(e=z.mobile.find(function(e){return"3/4"===e.selector}))||void 0===e?void 0:e.value)||"3",L="3"===A&&"4"===N,q=T||M||k||x&&!(Z||_||I)||"4"===A||L,G=!T&&"2"===A;return{mealOptionsMapping:(0,r.useMemo)(function(){return z.mobile.map(function(e){if("3/4"===e.selector){var n,t,r="4"===A?"4":e.value;return n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},e),t=t={value:r},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n}return e})},[z,A]),shouldDefaultToFourMeals:q,shouldDefaultToTwoMeals:G}}},521732:function(e,n,t){var r=t(827378),o=t(966622),i=t(407792),a=t(887824),l=t(783244),u=t(200770),s=t(958042);function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return c(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(){var e=(0,a.Z)().push,n=(0,s.Z)(),t=(0,u.Z)(),c=(0,o.py)({runUsingStatsig:!0}).track,f=d((0,r.useState)([]),2),p=f[0],v=f[1],h=(0,i.O)(),y=h.id,m=h.attributes,b=d((0,l.Z)("hf_selected_meal_types"),1)[0];return(0,r.useEffect)(function(){v(b?JSON.parse(b):[])},[b]),{trackClickContinueMealType:function(){var r=p.map(function(e){var n;return(null===(n=e.questionnaireData)||void 0===n?void 0:n.text)||e.name}).join("|");c({experimentationUserId:y,experimentationUserAttributes:m,eventName:"SelectPlan_ClickContinueMealType",eventTags:{system_country:t,locale:n,squad:"curation",screen:"Meal Type",plan_type:null,brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"MealType",EventLabel:r}}
1),e({event:"gaEventTrigger",system_country:t,locale:n,event_name:"SelectPlan_ClickContinueMealType",brand:"HelloFresh",tribe:"Conversions Journey",squad:"curation",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"MealType",gaEventLabel:r})},trackMealTypePageLoad:function(){c({experimentationUserId:y,experimentationUserAttributes:m,eventName:"SelectPlan_MealTypeDisplay",eventTags:{system_country:t,locale:n,squad:"curation",screen:"Meal Type",plan_type:null,brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"MealTypeDisplay",EventLabel:"-"}}),e({event:"gaEventTrigger",system_country:t,locale:n,event_name:"SelectPlan_MealTypeDisplay",brand:"HelloFresh",tribe:"Conversions Journey",squad:"curation",screen:"Meal Type",gaEventCategory:"funnel",gaEventAction:"MealTypeDisplay",gaEventLabel:"-"})},trackMealTypeSelection:function(r){c({experimentationUserId:y,experimentationUserAttributes:m,eventName:"SelectPlan_ClickMealType",eventTags:{system_country:t,locale:n,squad:"curation",screen:"Meal Type",plan_type:null,brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"ClickMealType",EventLabel:r}}),e({event:"gaEventTrigger",system_country:t,locale:n,event_name:"SelectPlan_ClickMealType",brand:"HelloFresh",tribe:"Conversions Journey",squad:"curation",gaEventCategory:"funnel",gaEventAction:"ClickMealType",gaEventLabel:r})}}}},748130:function(e,n,t){var r=t(827378),o=t(966622),i=t(407792),a=t(887824),l=t(783244),u=t(141897);function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function c(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return s(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(){var e,n=(0,a.Z)().push,t=(0,o.py)({runUsingStatsig:!0}).track,s=(0,u.X)().mealOptionsMapping,d=(0,i.O)(),f=d.id,p=d.attributes,v=c((0,l.Z)("hf_selected_number_of_meals"),1)[0],h=v?null===(e=s.find(function(e){return e.value===v}))||void 0===e?void 0:e.selector:null,y=c((0,l.Z)("hf_selected_number_of_people"),1)[0],m=(0,r.useMemo)(function(){var e;try{e=y?JSON.parse(y):{}}catch(n){e={}}return e},[y]),b=m.kids,g=m.adults,S=m.current,P=c((0,l.Z)("hf_selected_number_of_recipes"),1)[0],O=c((0,l.Z)("hf_selected_number_of_servings"),1)[0];return{trackCookTimesDefault:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_CookTimesDefault",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"cookTimesDefault",EventLabel:"choiceWk: ".concat(s[1].selector)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_CookTimesDefault",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"cookTimesDefault",gaEventLabel:"choiceWk: ".concat(s[1].selector),choiceWk:"".concat(s[1].selector)})},trackCookTimesChange:function(e){var r=e.numberOfMeals;t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_CookTimesChange",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"cookTimesChange",EventLabel:"choiceWk: ".concat(r)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_CookTimesChange",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"cookTimesChange",gaEventLabel:"choiceWk: ".concat(r),choiceWk:"".concat(r)})},trackClickContinueCookTimes:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_ClickContinueCookTimes",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"clickContinueCookTimes",EventLabel:"choiceWk: ".concat(h)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_ClickContinueCookTimes",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"clickContinueCookTimes",gaEventLabel:"choiceWk: ".concat(h),choiceWk:"".concat(h)})},trackAdultKidsDefault:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_AdultKidsDefault",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"adultKidsDefault",EventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_AdultKidsDefault",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"adultKidsDefault",gaEventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S),amount_adults:"".concat(g),amount_kids:"".concat(b),suggested_size:"".concat(S)})},trackAdultKidsDisplay:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_AdultKidsDisplay",eventTags:{brand:"HelloFresh",tribe:"Conversions",EventCategory:"funnel",EventAction:"",EventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S)}}),n({event_name:"SelectPlan_AdultKidsDisplay",event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions",screen:"Plans - Size Step",gaEventCategory:"funnel",gaEventAction:"adultKidsDisplay",gaEventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S),amount_adults:"".concat(g),amount_kids:"".concat(b),suggested_size:"".concat(S)})},trackClickContinueAdultKids:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_ClickContinueAdultKids",eventTags:{brand:"HelloFresh",tribe:"Conversions",EventCategory:"funnel",EventAction:"",EventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S)}}),n({event_name:"SelectPlan_ClickContinueAdultKids",event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions",screen:"Plans - Size Step",gaEventCategory:"funnel",gaEventAction:"clickContinueAdultKids",gaEventLabel:"adults:".concat(g,"|kids:").concat(b,"|suggested_size:").concat(S),amount_kids:"".concat(b),amount_adults:"".concat(g),suggested_size:"".concat(S)})},trackAdultKidsChange:function(e){var r=e.kids,o=e.adults,i=e.current;t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_AdultKidsChange",eventTags:{brand:"HelloFresh",tribe:"Conversions",EventCategory:"funnel",EventAction:"",EventLabel:"adults:".concat(o,"|kids:").concat(r,"|suggested_size:").concat(i)}}),n({event_name:"SelectPlan_AdultKidsChange",event:"gaEventTrigger",brand:"HelloFresh",tribe:"Conversions",screen:"Plans - Size Step",gaEventCategory:"funnel",gaEventAction:"adultKidsChange",gaEventLabel:"adults:".concat(o,"|kids:").concat(r,"|suggested_size:").concat(i),amount_adults:"".concat(o),amount_kids:"".concat(r),suggested_size:"".concat(i)})},trackRecommendedPlanDefault:function(e,r){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_RecPlanDefault",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"recPlanRecipeDefault",EventLabel:"recipes:".concat(e," | servings:").concat(r)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_RecPlanDefault",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"recPlanRecipeDefault",gaEventLabel:"recipes:".concat(e," | servings:").concat(r),recipes:"".concat(e),servings:"".concat(r)})},trackRecommendedPlanChangeRecipe:function(e){var r=e.numberOfRecipes;t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_RecPlanChangeRecipe",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"recPlanRecipeChange",EventLabel:"".concat(r)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_RecPlanChangeRecipe",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"recPlanRecipeChange",gaEventLabel:"".concat(r),recipes:"".concat(r)})},trackRecommendedPlanChangeServing:function(e){var r=e.numberOfServings;t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_RecPlanChangeServing",eventTags:{brand:"HelloFresh",tribe:"Conversions Journey",EventCategory:"funnel",EventAction:"recPlanServingChange",EventLabel:"".concat(r)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_RecPlanChangeServing",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"recPlanServingChange",gaEventLabel:"".concat(r),servings:"".concat(r)})},trackClickContinueRecommendedPlan:function(){t({experimentationUserId:f,experimentationUserAttributes:p,eventName:"SelectPlan_ClickContinueRecPlan",eventTags:{brand:"HelloFresh",tribe:"Conversions",EventCategory:"funnel",EventAction:"",EventLabel:"recipes:".concat(h," | servings:").concat(O)}}),n({event:"gaEventTrigger",event_name:"SelectPlan_ClickContinueRecPlan",brand:"HelloFresh",tribe:"Conversions Journey",screen:"Plan Selection",gaEventCategory:"funnel",gaEventAction:"clickContinueRecPlan",gaEventLabel:"recipes:".concat(P," | servings:").concat(O),recipes:"".concat(P),servings:"".concat(O)})}}}},276312:function(e,n,t){t.d(n,{Z:function(){return A}});var r=t(827378),o=t(567921),i=t.n(o),a=t(718583),l=t(440492),u=t(140224),s=t(141323),c=t(43011),d=t(581340),f=t(66077),p=t(76898),v=t(543790),h=t(396887),y=[{systemCountry:p.Rc[v.Z.factor].US,serverEnv:[h.Xe.local,h.Xe.test,h.Xe.staging],values:{odpVoucherCode:"GC-OC2CC"}}];function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var b=function(e){if(Array.isArray(e))return m(e)}(y)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(y)||function(e,n){if(e){if("string"==typeof e)return m(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,void 0)}}(y)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var S={odpVoucherCode:"",overrides:function(e){if(Array.isArray(e))return g(e)}(b)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(b)||function(e,n){if(e){if("string"==typeof e)return g(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,void 0)}}(b)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},P=(0,f.Z)("hf.single-question-flow.odp-voucher",S).useConfig,O=t(478568),w=t(903194),k=t(682617),x=t(471600);function C(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var A=function(){var e=(0,d.t)().query,n=(0,O.H)(),t=P().odpVoucherCode,o=(0,u.O)().systemCountry,f=(0,x.Z)().products,p=(0,c.Z)(),v=(0,w.q)({queryCode:e.c,contextCode:n.code,isContextCodeValid:n.valid,storedCode:
1a.ZP.getItem(k.gx),cookieCode:i().get(k.Ve)}),h=!1!==n.valid,y=v&&h?t:"",m=(0,s.j)({},{suspense:!1,enabled:!!p}),b=m.data,g=m.isFetched,S=!(0,l.W)({products:f,country:o,code:y,customer_id:Number((null==b?void 0:b.id)||"0")},{suspense:!1,enabled:!!y&&!!(null==f?void 0:f.length)&&(!p||g),useErrorBoundary:!1}).isError;return(0,r.useMemo)(function(){var e;return C(e={},k.hv.subscription,{code:v,isValid:h}),C(e,k.hv.oneTimePurchase,{code:y,isValid:S}),e},[v,h,y,S])}},518113:function(e,n,t){var r=t(827378),o=t(783244),i=t(581340),a=t(497249);function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function u(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(e){var n=e.surveyId,t=e.translationId,l=e.questionId,s=void 0===l?"":l,c=e.answerChoices,d=e.questionType,f=(0,i.t)().asPath,p=(0,a.T)(),v="open"===d||!d&&0===c.length,h="ranking"===d||!d&&c.length>0&&c.some(function(e){return e.answer_handle}),y=(0,r.useMemo)(function(){return new Map(c.map(function(e){return[e.answer_handle||e.text,{id:e.answer_id,text:e.text,handle:e.answer_handle}]}))},[c]),m=u((0,o.Z)("hf_selected_single_questions_survey_responses",{expiresIn:259200}),3),b=m[0],g=m[1],S=m[2],P=(0,r.useMemo)(function(){var e={};try{if((e=JSON.parse(b||"{}")).translation_id&&e.translation_id!==t){var r=p.startSpan("questionnaire.translationId.update");r.setAttributes({storedTranslationId:e.translation_id,newTranslationId:t}),r.end()}if(e.survey_id&&e.survey_id!==n){var o=p.startSpan("questionnaire.surveyId.different");return o.setAttributes({storedSurveyId:e.survey_id,newSurveyId:n}),S(),o.end(),{}}}catch(e){}return e},[b,n,t]),O=(0,r.useMemo)(function(){var e,n=null===(e=P.responses)||void 0===e?void 0:e.find(function(e){return e.question_id===s});return new Set((null==n?void 0:n.answer_ids)||[])},[P,s]),w=(0,r.useMemo)(function(){var e,n=null===(e=P.responses)||void 0===e?void 0:e.find(function(e){return e.question_id===s}),t=null==n?void 0:n.answer_text;return"string"==typeof t?t:""},[P,s]),k=(0,r.useCallback)(function(e){var r,o={survey_id:n,translation_id:t,source_url:f,responses:(null===(r=P.responses)||void 0===r?void 0:r.filter(function(e){return e.question_id!==s}))||[]};e.length>0&&(v?o.responses.push({question_id:s,answer_text:Array.isArray(e)?e.join("|"):e}):o.responses.push({question_id:s,answer_ids:e})),g(JSON.stringify(o))},[s,n,t,f,P,g,v]),x=(0,r.useCallback)(function(e){var n=Array.from(O);if(v)return k(e);O.has(e)?n=n.filter(function(n){return n!==e}):n.push(e),k(n)},[k,O,v]),C=(0,r.useCallback)(function(e){if(e&&0!==e.length){var r,o=!0,i=e.map(function(e){return u(e,1)[0]}),a={survey_id:n,translation_id:t,source_url:f,responses:(null===(r=P.responses)||void 0===r?void 0:r.filter(function(e){var n=e.question_id;return i.includes(n)}))||[]};e.forEach(function(e){var n=u(e,2),t=n[0],r=n[1];t||(o=!1),r.length>0&&(v?a.responses.push({question_id:t,answer_text:r.join("")}):a.responses.push({question_id:t,answer_ids:r}))}),o&&g(JSON.stringify(a))}},[n,t,f,P,g,v]),A=(0,r.useMemo)(function(){var e,n,t=null===(e=P.responses)||void 0===e?void 0:e.find(function(e){return e.question_id===s});if(h&&t&&"ranking_items"in t)return null==t?void 0:null===(n=t.ranking_items)||void 0===n?void 0:n.reduce(function(e,n){var t=Array.from(y.values()).find(function(e){return e.id===n.answer_id});return t&&(e[t.handle||t.text]={like:"like"===n.sentiment,dislike:"dislike"===n.sentiment,neutral:"neutral"===n.sentiment}),e},{});if(v&&w){var r=[];return w.split("|").reduce(function(e,n){var t=u(n.split(":"),2),o=t[0],i=parseInt(t[1],10);return o&&!isNaN(i)?e[o]={like:100===i,dislike:-100===i,neutral:0===i}:r.push(n),e},{})}},[s,P,y,h,v,w]),Z=(0,r.useCallback)(function(e,r){var o=p.startSpan("questionnaire.setRatings");
1o.setAttributes({questionId:s,ratingValue:r,answerKey:Array.isArray(e)?e.join(","):e,isRankingTypeQuestion:h,isOpenTypeQuestion:v});var i=A||{},a=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},i);if((Array.isArray(e)?e:[e]).forEach(function(e){if("like"===r){var n,t=(null===(n=i[e])||void 0===n?void 0:n.like)||!1;a[e]={like:!t,dislike:!1,neutral:!1}}else if("dislike"===r){var o,l=(null===(o=i[e])||void 0===o?void 0:o.dislike)||!1;a[e]={like:!1,dislike:!l,neutral:!1}}else if("neutral"===r){var u,s=(null===(u=i[e])||void 0===u?void 0:u.neutral)||!1;a[e]={like:!1,dislike:!1,neutral:!s}}}),h){var l,c=Object.entries(a).filter(function(e){var n=u(e,2)[1];return n.like||n.dislike||n.neutral}).map(function(e){var n,t=u(e,2),r=t[0],i=t[1],a=y.get(r);return a?(n=i.like?"like":i.dislike?"dislike":"neutral",{answer_id:a.id,sentiment:n}):(o.addEvent("warning: answer handle not found in questionnaire",{answerHandle:r}),null)}).filter(function(e){return null!==e});o.setAttributes({rankingItemsCount:c.length,newRatingsCount:Object.keys(a).length,currentRatingsCount:Object.keys(i).length}),o.end();var d={survey_id:n,translation_id:t,source_url:f,responses:(null===(l=P.responses)||void 0===l?void 0:l.filter(function(e){return e.question_id!==s}))||[]};c.length>0&&d.responses.push({question_id:s,ranking_items:c}),g(JSON.stringify(d));return}if(v){var m=Object.entries(a).filter(function(e){var n=u(e,2)[1];return n.like||n.dislike||n.neutral}).map(function(e){var n=u(e,2),t=n[0],r=n[1];return r.like?"".concat(t,":100"):r.dislike?"".concat(t,":-100"):r.neutral?"".concat(t,":0"):""}).join("|");o.setAttributes({formattedRatings:m,newRatingsCount:Object.keys(a).length,currentRatingsCount:Object.keys(i).length}),o.end(),k(m)}},[h,v,A,s,y,P,n,t,f,g,k]);return{selectedSurveyResponses:O,selectedSurveyResponseText:w,answerIdsFromQuestionnaire:y,setSelectedSurveyResponses:x,replaceSelectedSurveyResponses:k,batchReplaceSelectedSurveyResponses:C,ratings:A,setRatings:Z}}},173745:function(e,n,t){t.d(n,{D:function(){return a}});var r=t(827378),o=t(12939),i=t(518113),a=function(e,n){var t=(0,o.Z)(),a=null==t?void 0:t.questions.find(function(n){return e&&n.question_handle===e}),l=(0,i.Z)({surveyId:(null==t?void 0:t.survey_id)||"",translationId:(null==t?void 0:t.id)||"",questionId:(null==a?void 0:a.question_id)||"",answerChoices:(null==a?void 0:a.answer_choices)||[]}).replaceSelectedSurveyResponses;(0,r.useEffect)(function(){if(a&&t){var e=[];a.answer_choices.forEach(function(t){var r=t.answer_handle,o=t.answer_id;r&&n.includes(r)&&e.push(o)}),l(e)}},[a,n])}},183006:function(e,n,t){t.d(n,{q:function(){return y}});var r=t(827378),o=t(567921),i=t.n(o),a=t(124665),l=t(408558),u=t(306286),s=t(359839),c=t(291059),d=t(394074),f=t(991869),p=t(471600);function v(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return v(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var y=function(e){var n,t,o,v=e.selectedPreferences,y=e.setSelectedPreferences,m=e.setIsDisabled,b=(0,d.D)().isNewHighProteinUIEnabled,g=(0,u.$h)(),S=(0,f.Z)(v).trackPreferenceChange,P=(0,a.Z)(),O=(null===(o=(0,l.iQ)())||void 0===o?void 0:null===(t=o.items)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.sku)||"",w=(0,p.Z)(),k=w.preferences,x=w.multiplePreferences,C=(0,s.r9)(),A=C.selectAtLeastOnePreference,Z=C.isHighProteinEnabled,_=(0,r.useCallback)(function(e){i().set("hf_ssr_stored_presets",e.join(","),{expires:30}),i().set("wl_ssr_stored_presets",e.join(","))},[]),E=(0,r.useCallback)(function(e,n){var t=[];return t=n.includes(e)?n.filter(function(n){return n!==e}):(null==x?void 0:x.enabled)?h(n).concat([e]):[e],Z&&(i().remove(c.mp),0!==t.length||b?t=t.filter(function(e){return e!==c.qN}):(t=["highprotein"],i().set(c.mp,c.qN))),t},[x,Z,b]),j=(0,r.useCallback)(function(e){var n=k.map(function(e){return e.preferenceName}),t=e.some(function(e){var t=e;return"low-calorie"===t&&(t="fit"),"veggie-plant-based"===t&&(t="veggie"),n.includes(t)}),r=A&&!t;null==m||m(r)},[k,A,m]);return{updatePreference:(0,r.useCallback)(function(e){var n=E(e,v);y(n),_(n),j(n),g.product&&S(g.product,e),O&&P(n,O)},[E,v,y,_,j,g.product,S,O,P]),updateHighProteinPreference:(0,r.useCallback)(function(e){var n=i().get(c.mp),t=[e];n?(t=b?[]:["everyday"],i().remove(c.mp)):i().set(c.mp,c.qN),y(t),_(t),null==m||m(!1),g.product&&S(g.product,e)},[b,y,_,m,g.product,S]),batchUpdatePreferences:(0,r.useCallback)(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=h(v);t=t.filter(function(e){return!n.includes(e)}),e.forEach(function(e){t.includes(e)||t.push(e)}),y(t),_(t),j(t),O&&P(t,O)},[v,y,_,j,O,P])}}}
1,806222:function(e,n,t){var r=t(52016),o=t(306286),i=t(142432),a=t(471600);n.Z=function(){var e,n=(0,o.$h)(),t=(0,i.Q)().selectedPreferences,l=(0,a.Z)();if(null===(e=n.product)||void 0===e?void 0:e.handle)return(0,r.Up)({selectedPreferences:t,preferences:l.preferences,multiplePreferences:l.multiplePreferences,productCtx:n,presets:l.presets})}},853834:function(e,n,t){var r=t(827378),o=t(783244),i=t(494467);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function l(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return a(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.defaultPreferences,t=e.isExperiment,a=(0,i.Z)(),u=l((0,o.Z)(void 0!==t&&t?"hf_selected_single_questions_preference_responses_experiment":"hf_selected_single_questions_preference_responses",{defaultValue:JSON.stringify(n||a),expiresIn:604800}),2),s=u[0],c=u[1],d=l((0,o.Z)("hf_protein_exclusion_selections"),2)[1];return{selectedPreferences:(0,r.useMemo)(function(){var e;try{e=JSON.parse(s)}catch(n){e=[]}return e},[s]),setSelectedPreferences:(0,r.useCallback)(function(e){c(JSON.stringify(e)),d(JSON.stringify([]))},[c,d])}}},230145:function(e,n,t){var r=t(827378),o=t(567921),i=t.n(o),a=t(140224),l=t(581340),u=t(341698),s=t(471600);n.Z=function(){var e=(0,l.t)(),n=(0,a.O)().systemCountry,t=(0,s.Z)(),o=t.planFamily,c=t.products,d=t.defaultSku,f="default"===e.query.preferenceStatus,p=e.query.featured,v=p&&":"!==p&&(p.split(":")[1]||p),h=e.query.mealsize,y=(0,r.useMemo)(function(){return i().get("hf_ssr_stored_sku")},[]),m=(0,r.useMemo)(function(){return i().get("hf_ssr_stored_presets")},[]),b=d||"";if(h&&o){var g=h;Array.isArray(h)&&(g=h[0]),b=(0,u.xx)(n,o.prefix,g)}else y&&(null==c?void 0:c.includes(y))&&(b=y);return{visiblePreset:e.query.visible,featuredPreset:v||m,preferenceStatusIsDefault:f,preSelectedSku:b}}},962836:function(e,n,t){var r=t(581340),o=t(695442);function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var a={8:{numberOfMealsPerDay:"justOne",numberOfDaysPerWeek:"everyday"}},l=function(e){if(e<=0||!Number.isInteger(e))return[];for(var n=[],t=Math.sqrt(e),r=1;r<=t;r++)if(e%r==0){var o=e/r;n.push([r,o])}return n},u=function(e,n){return n.reduce(function(n,t){return Math.abs(t-e)<Math.abs(n-e)?t:n})};n.Z=function(){var e=(0,r.t)().query.mealsize,n=0,t=0;if(e){var s,c,d,f,p,v=e;Array.isArray(e)&&(v=e[0]),t=(p=function(e){if(Array.isArray(e))return e}(f=v.split("-").map(Number))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(f,2)||function(e,n){if(e){if("string"==typeof e)return i(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,2)}}(f,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=p[1]}if(n&&t){var h=l(n),y=a[n];if(y)s=y.numberOfMealsPerDay,c=y.numberOfDaysPerWeek;else if(h.length>0){var m=u(h[h.length-1][0],Object.values(o.od)),b=u(h[h.length-1][1],Object.values(o.F9));s=Object.keys(o.od)[m],s=Object.keys(o.od).find(function(e){return o.od[e]===m}),c=Object.keys(o.F9).find(function(e){return o.F9[e]===b})}d=Object.keys(o.b).find(function(e){return o.b[e]===u(t,Object.values(o.b))})}return{preselectedNumberOfPeople:d,preSelectedMealsPerDay:s,preSelectedMealsPerWeek:c}}},991869:function(e,n,t){var r=t(200770),o=t(527157),i=t(887824),a=t(340332),l=t(497249),u=t(529970),s=t(478568),c=t(947998),d=t(83380),f=t(471600),p=t(230145);function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}n.Z=function(e){var n=(0,i.Z)().push,t=(0,a.SX)(),h=(0,f.Z)().planFamily,y=(0,p.Z)().featuredPreset,m=(0,r.Z)(),b=(0,o.Z)(),g=(0,l.T)(),S=(0,d.N)().trackSelectItemSnowplowEvent,P=(0,s.H)(),O=(0,u.Sz)(m),w=(0,c.Z)(void 0,!1);return{trackProductChange:function(r){if(h){var o;n(v({},(0,u.xU)({selectedSku:r.handle,action:"detailProductChange",voucherCode:P.code,productName:r.name,productPrice:null!==(o=null==w?void 0:w.price)&&void 0!==o?o:0,currencyCode:t,preset:e.join(","),planFamilyHandle:h.handle,brand:b}),O)),g.startSpan("select-item-event").setAttributes({event_action:"detailProductChange",product_name:r.name,product_handle:r.handle}).end(),S({productHandle:r.handle,productName:r.name,selectedPreferences:e.join(",")})}},trackPreferenceChange:function(e,r){if(h){var o;n(v({},(0,u.xU)({selectedSku:e.handle,action:"ProductPreferenceChange",voucherCode:P.code,productName:e.name,productPrice:null!==(o=null==w?void 0:w.price)&&void 0!==o?o:0,currencyCode:t,preset:r,planFamilyHandle:h.handle,brand:b}),O)),g.startSpan("select-item-event").setAttributes({event_action:"ProductPreferenceChange",product_name:e.name,product_handle:e.handle,preference:r}).end()}},trackSubmitPlan:function(){n(v({event:"gaEventTrigger",event_name:"SelectPlan_Button_Submit",brand:b,screen:"Plans",elementId:"select-plan-button",gaEventCategory:"funnel",gaEventAction:"multiplePreferenceSelect",gaEventLabel:e.join("|")},O))},trackGoToCart:function(r){if(h&&r){var o;n(v({},(0,u.uB)({selectedSku:r.handle,action:"go to cart",voucherCode:P.code,productName:r.name,productPrice:null!==(o=null==w?void 0:w.price)&&void 0!==o?o:0,currencyCode:t,preset:e.join(","),planFamilyHandle:h.handle,brand:b}),O)),g.startSpan("add-to-cart-event").setAttributes({product_name:r.name,product_handle:r.handle}).end()}},trackDefaultPreference:function(e){if(h){var r,o=y&&y.split(",");n(v({},(0,u.xU)({selectedSku:e.handle,action:"ProductPreferenceDefault",voucherCode:P.code,productName:e.name,productPrice:null!==(r=null==w?void 0:w.price)&&void 0!==r?r:0,currencyCode:t,isNonInteraction:!0,preset
1:o?o[0]:"chefschoice",planFamilyHandle:h.handle,brand:b}),O)),g.startSpan("select-item-event").setAttributes({event_action:"ProductPreferenceDefault",product_name:e.name,product_handle:e.handle,preference:o?o[0]:"chefschoice"}).end()}}}}},12939:function(e,n,t){var r=t(777843),o=t(637357);n.Z=function(){var e=(0,o.ge)(),n=e.surveyId,t=e.version,i=!!n&&!!t,a=(0,r.z)({survey_id:n,version:t},{enabled:i,suspense:!1}).data;return i?a:void 0}},648897:function(e,n,t){t.d(n,{d:function(){return u}});var r=t(527157),o=t(543790),i=t(268481),a=t(235487),l=t(872728),u=function(){var e=(0,l.PJ)(),n=(0,r.Z)(),t=(0,i.Sj)(),u=(0,a.D)().isMobile;return!!e&&(n!==o.Z.youfoodz||!!u||"mobile"===t)}},83380:function(e,n,t){t.d(n,{N:function(){return f}});var r=t(827378),o=t(567921),i=t.n(o),a=t(718583),l=t(221047),u=t(969250),s=t(52130),c=t(581340),d=t(340332),f=function(){var e,n=(0,s.L3)().trackJanusEvent,t=(0,c.t)().query,o=(0,d.SX)(),f=a.ZP.getItem("StoredCouponCode"),p=i().get("STORED_COUPON_CODE"),v=null!==(e=t.c||f||p)&&void 0!==e?e:"";return{trackSelectItemSnowplowEvent:(0,r.useCallback)(function(e){var t=u.cB.ecommerceProduct({productCategory:e.productHandle,productName:e.productName,productPreference:e.selectedPreferences,productSku:e.productHandle}),r=u.cB.uiComponent({uiComponentName:"Plan_Selection",uiComponentLabel:"Select_Plan_Button"}),o=u.cB.voucher({voucherCode:v||""});n(u.cB.janusEvent({ecommerceProductEntities:[t],uiComponent:r,voucher:o}))},[n,v]),trackAddToCartSnowplowEvent:(0,r.useCallback)(function(e){var t=l.wD.ecommercePrice({currency:o,productPrice:e.productPrice,productPriceInclDiscount:e.productPrice-e.couponDiscount,productSku:e.productHandle,shippingPrice:e.shippingPrice,shippingPriceInclDiscount:e.shippingPrice-e.shippingDiscount,totalOrderPrice:Number((e.productPrice+e.shippingPrice).toFixed(2)),totalOrderPriceInclDiscount:Number((e.productPrice-e.couponDiscount+e.shippingPrice-e.shippingDiscount).toFixed(2))}),r=l.wD.ecommerceProduct({productCategory:e.productHandle,productName:e.productName,productPreference:e.selectedPreferences,productSku:e.productHandle}),i=l.wD.voucher({voucherCode:v}),a=l.wD.uiComponent({uiComponentName:"Plan_Recommendation",uiComponentLabel:"Add_to_Cart_Button"});n(l.wD.janusEvent({ecommercePriceEntities:[t],ecommerceProductEntities:[r],voucher:i,uiComponent:a}))},[n,v,o])}}},893423:function(e,n,t){t.d(n,{f:function(){return c}});var r=t(827378),o=t(921318),i=t(518113),a=t(819762),l=t(6471),u=t(12939);function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var c=function(){var e=(0,u.Z)(),n=(0,o.qC)("goals-step-slot"),t=n.isEnabled,c=n.content,d=t&&(null==c?void 0:c.questionHandle)?c.questionHandle:a.GOALS_STEP_ID,f=null==e?void 0:e.questions.find(function(e){return e.question_handle===d}),p=(null==f?void 0:f.answer_choices)||[],v=(null==f?void 0:f.answer_choices)||[],h=(0,i.Z)({surveyId:(null==e?void 0:e.survey_id)||"",translationId:(null==e?void 0:e.id)||"",questionId:(null==f?void 0:f.question_id)||"",answerChoices:v}).selectedSurveyResponses,y=[];p.forEach(function(e){h.has(e.answer_id)&&y.push(e.text)});var m=(0,r.useMemo)(function(){return[l.S.saveMoney,l.S.eatHealthy,l.S.saveTime,l.S.discoverNewRecipes,l.S.wasteLessFood,l.S.easierMealPlanning]},[]),b=((function(e){if(Array.isArray(e))return s(e)})(p)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(p)||function(e,n){if(e){if("string"==typeof e)return s(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,void 0)}}(p)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,n){return m.indexOf(e.answer_handle||e.text||"")-m.indexOf(n.answer_handle||n.text||"")}),g=(0,r.useMemo)(function(){return[]},[]);(null==y?void 0:y.length)&&(g=b.filter(function(e){return y.includes(e.text)}));var S=(0,r.useMemo)(function(){return(null==g?void 0:g.length)?g.slice(0,3):b.slice(0,3)},[g,b]),P=null==S?void 0:S.map(function(e){return e.text||""});return{selectedGoalOptions:S,selectedGoalTexts:P}}},754750:function(e,n,t){t.d(n,{X$:function(){return d}});var r=t(827378),o=t(783244),i=t(64428);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function l(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var u=function(e,n,t){if(!e||0===Object.keys(e).length||!(0,i.j)(e,t))return!1;var r=(0,i.n)(e);if(void 0!==r.householdSize&&void 0!==n.householdSize){var o="number"==typeof r.householdSize?r.householdSize:0,a=n.householdSize;return 1===o?1===a:a>=o}return void 0!==r.householdSizeWithKids&&void 0!==n.hasKids&&"boolean"==typeof r.householdSizeWithKids?r.householdSizeWithKids===n.hasKids:void 0!==r.hasKids&&void 0!==n.hasKids&&"boolean"==typeof r.hasKids&&r.hasKids===n.hasKids},s=function(e,n){if(!Array.isArray(n)||0===n.length)return e;var t=new Map;e.forEach(function(e){e&&(void 0===e?"undefined":l(e))==="object"&&"contentTypeId"in e&&"string"==typeof e.contentTypeId&&t.set(e.contentTypeId,e)});var r=new Map;
1n.forEach(function(e){e&&(void 0===e?"undefined":l(e))==="object"&&"contentTypeId"in e&&"string"==typeof e.contentTypeId&&r.set(e.contentTypeId,e)});var o=[];return e.forEach(function(e){if(e&&(void 0===e?"undefined":l(e))==="object"&&"contentTypeId"in e&&"string"==typeof e.contentTypeId){var n=r.get(e.contentTypeId);n?o.push(n):o.push(e)}else o.push(e)}),n.forEach(function(e){e&&(void 0===e?"undefined":l(e))==="object"&&"contentTypeId"in e&&"string"==typeof e.contentTypeId&&!t.has(e.contentTypeId)&&o.push(e)}),o},c=function(e,n,t){if(n&&e.variations&&e.variations.length>0){var r=e.variations.find(function(e){return u(e.condition,n,t)});if(r&&r.stepContents){var o=s(e.content,r.stepContents);return{name:e.name,type:e.type,subType:e.subType,content:o}}}return e},d=function(e,n){var t,i=(function(e){if(Array.isArray(e))return e}(t=(0,o.Z)("hf_selected_number_of_people"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,1)||function(e,n){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}(t,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useMemo)(function(){var t;if(!e)return null;if(!i)return e;try{t=JSON.parse(i)}catch(n){return e}return c(e,{householdSize:t.total,hasKids:t.kids>0},n)},[e,i,n])}},618213:function(e,n,t){var r=t(687800),o=t(768587),i=t(527157),a=t(543790);n.Z=function(e){var n=e.id,t=e.header,l=e.subtitle,u=e.withHeaderPaddingBottom,s=e.portalTargetId,c=e.maxWidth,d=e.marginX,f=n?"".concat(n,"-header"):"funnel-header",p=n?"".concat(n,"-subtitle"):"funnel-subtitle",v=(0,i.Z)()===a.Z.youfoodz?"none":void 0;return(0,r.BX)(r.HY,{children:[t&&(0,r.BX)(o.xu,{display:"flex",width:"100%",maxWidth:c,marginX:d,alignItems:"center",paddingBottom:void 0===u||u?"global.sm-2":"global.xs",pt:"global.xxs",children:[(0,r.tZ)(o.xu,{width:"100%",children:(0,r.tZ)(o.xv,{id:f,"data-test-id":f,as:"h2",wordBreak:"break-word",textTransform:v,children:t})}),s&&(0,r.tZ)(o.xu,{as:"span",id:s,"data-test-id":s,flexShrink:0})]}),l&&(0,r.tZ)(o.xu,{display:"flex",width:"100%",children:(0,r.tZ)(o.xu,{width:"100%",paddingBottom:"global.sm-2",children:(0,r.tZ)(o.xv,{id:p,"data-test-id":p,type:"body-md-regular",color:"shared-alias.neutral.foreground.default",textTransform:v,children:l})})})]})}},425633:function(e,n,t){t.d(n,{JW:function(){return v},RS:function(){return d},S6:function(){return c},US:function(){return f},fp:function(){return s},mB:function(){return h}});var r=t(687800),o=t(827378),i=t(164528),a=t(854767);function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function u(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s="funnel.plans.single-question-flow",c="funnel.plans.single-question-flow.meal-selection.a11y.edit-mode-announcement",d="funnel.plans.single-question-flow.meal-selection.a11y.browse-mode-announcement",f={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},p=(0,o.createContext)(null),v=function(e){var n=e.children,t=e.isMealSelectionStep,l=(0,a.$)(),v=l.wantsEditView,h=l.setViewInQuery,y=l.clearViewInQuery,m=(0,i.ZP)(s).translateRaw,b=u((0,o.useState)(v?"edit":"browse"),2),g=b[0],S=b[1],P=u((0,o.useState)(""),2),O=P[0],w=P[1],k=(0,o.useRef)(g),x=(0,o.useRef)(!0),C=u((0,o.useState)(!1),2),A=C[0],Z=C[1],_=u((0,o.useState)(!1),2),E=_[0],j=_[1],I=u((0,o.useState)(null),2),T=I[0],D=I[1],F=(0,o.useCallback)(function(e){
1S(e),h(e),D(null)},[h]),R=(0,o.useRef)(t);(0,o.useEffect)(function(){t&&S(v?"edit":"browse")},[t,v]),(0,o.useEffect)(function(){R.current&&!t&&y(),R.current=t},[t,y]),(0,o.useEffect)(function(){if(!t){k.current=g;return}if(x.current){x.current=!1,k.current=g;return}k.current!==g&&w(m("edit"===g?c:d)),k.current=g},[g,t,m]);var M=(0,o.useMemo)(function(){return{view:g,setView:F,openEditView:function(){F("edit")},openSeamlessUpdateDrawer:function(){D(null),Z(!0)},closeSeamlessUpdateDrawer:function(){Z(!1)},isSeamlessUpdateDrawerOpen:A,openUnsupportedSizeDrawer:function(){D(null),j(!0)},closeUnsupportedSizeDrawer:function(){j(!1)},isUnsupportedSizeDrawerOpen:E,planSizeTarget:T,setPlanSizeTarget:D}},[g,F,Z,A,j,E,T,D]);return(0,r.BX)(p.Provider,{value:M,children:[(0,r.tZ)("div",{role:"status","aria-live":"polite","aria-atomic":"true",style:f,children:O}),n]})},h=function(){return(0,o.useContext)(p)}},413411:function(e,n,t){t.d(n,{s:function(){return f}});var r=t(827378),o=t(567921),i=t.n(o),a=t(599506),l=t(306286),u=t(760283),s=t(85221),c=t(425633);function d(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var f=function(){var e,n=(0,l.$h)(),t=(0,l.jy)(),o=(0,u.Z)().setGoalSku,f=(0,c.mB)(),p=(function(e){if(Array.isArray(e))return e}(e=(0,a.Z)())||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,1)||function(e,n){if(e){if("string"==typeof e)return d(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useCallback)(function(e){var r=e.handle;i().set("hf_goals_plan_sku_cookie",r),i().set("hf_ssr_stored_sku",r,{expires:30}),n.setProduct(e),t.setMeals(e.specs.meals),t.setSize(e.specs.size),(0,s.q4)({dinnersPerWeek:e.specs.meals}),o(r),e.specs.meals!==p.totalCount?null==f||f.setPlanSizeTarget(e.specs.meals):null==f||f.setPlanSizeTarget(null)},[n,t,o,f,p.totalCount])}},111109:function(e,n,t){t.d(n,{MH:function(){return l},nS:function(){return u}});var r=t(957711),o=t(898457),i=t(818095),a=t(656573),l=function(){var e,n,t=null===(n=(0,i.z)().contentfulStep)||void 0===n?void 0:null===(e=n.content)||void 0===e?void 0:e.find(function(e){return e.contentTypeId===o.LB});return(null==t?void 0:t.defaultView)==="edit"},u=function(){var e=(0,r.Z)().funnelName;return(0,a.kB)()||"funnel-factor-US-meal-selection-express-test"===e};n.ZP=l},852965:function(e,n,t){t.d(n,{F:function(){return w}});var r=t(827378),o=t(164528),i=t(527157),a=t(543790),l=t(783244),u=t(599506),s=t(872728),c=t(306286),d=t(961081),f=t(471600),p=t(477765),v=t(425633),h=t(729471),y=t(773445),m=t(820612),b=t(566586),g=t(413411),S=t(411218);function P(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function O(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return P(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(){var e,n=O((0,l.Z)("hf_meal-selection-initial-product-saved",{defaultValue:"0"}),2),t=n[0],P=n[1],w=O((0,l.Z)("hf_skipped-meal-selection-cart",{defaultValue:"1"}),2)[1],k=(0,d.sV)().step,x=(0,h.X)(k),C=(0,s.Tb)(x),A=(0,v.mB)(),Z=(0,c.$h)().product,_=(0,b.Z)(),E=null!=Z?Z:_,j=O((0,u.Z)(),1)[0],I=(0,y.E)().seamlessUpdateProduct,T=(0,m.l)().isUnsupported,D=(0,i.Z)()===a.Z.factor,F=(0,o.ZP)("funnel.plans.single-question-flow").translateRaw,R=(0,o.ZP)("funnel.plans.singleQuestionFlow").translateRaw,M=(0,g.s)(),z=(0,f.Z)().planFamily,N=null==z?void 0:z.children.find(function(e){return e.specs.meals===j.totalCount}),L=(0,S.E)().trackSaveMealsClick,q=null==E?void 0:null===(e=E.specs)||void 0===e?void 0:e.meals,G=q&&j.totalCount===q?R("funnel.plans.singleQuestionFlow.cta.continue"):F("funnel.plans.single-question-flow.mealSelection.saveMeals.selectedSize",{mealCount:j.totalCount}),H=(0,r.useCallback)(function(){var e,n,r,o,i,a;if(L({pickedSize:j.totalCount}),D&&!T&&"0"===t&&N){M(N),P(N.handle),null==A||null===(e=A.setView)||void 0===e||e.call(A,"browse"),w("0");return}D&&T?null==A||null===(n=A.openUnsupportedSizeDrawer)||void 0===n||n.call(A):I.shouldDisplayUpgrade?null==A||null===(r=A.openSeamlessUpdateDrawer)||void 0===r||r.call(A):I.shouldDisplayDowngrade?null==A||null===(o=A.openSeamlessUpdateDrawer)||void 0===o||o.call(A):(null==A||null===(i=A.closeSeamlessUpdateDrawer)||void 0===i||i.call(A),null==A||null===(a=A.setView)||void 0===a||a.call(A,"browse"),w("0"))},[A,D,T,I.shouldDisplayUpgrade,I.shouldDisplayDowngrade,t,P,N,M,L,j.totalCount,w]);return{mealSelectionEditSaveSticky:(0,r.useMemo)(function(){if((0,p.R)(C)&&A&&"edit"===A.view
1)return{saveMealsButtonText:G,onSave:function(){H()}}},[C,A,G,H]),setSkipButtonClicked:w}}},566586:function(e,n,t){var r=t(827378),o=t(567921),i=t.n(o),a=t(471600);n.Z=function(){var e,n=(0,r.useMemo)(function(){return i().get("hf_ssr_stored_sku")||i().get("hf_goals_plan_sku_cookie")},[]),t=(0,a.Z)(),o=t.planFamily,l=t.defaultSku;return(0,r.useMemo)(function(){return null==o?void 0:o.children.find(function(e){return e.handle===(n||l)})},[o,n,l])||(null==o?void 0:null===(e=o.children)||void 0===e?void 0:e[0])}},854767:function(e,n,t){t.d(n,{$:function(){return l}});var r=t(827378),o=t(581340),i=t(546145),a=t(111109);function l(){var e=(0,o.t)(),n=(0,a.ZP)(),t=(0,r.useMemo)(function(){return e.isReady?function(e){var n=Array.isArray(e)?e[0]:e;if("edit"===n||"browse"===n)return n}(e.query[i.Yb]):void 0},[e.isReady,e.query]),l=(0,r.useCallback)(function(n){if(e.isReady){var t=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},e.query),r=e.asPath.split("?")[0];"edit"===n?(t[i.Yb]="edit",e.push({pathname:r,query:t},void 0,{shallow:!0})):(delete t[i.Yb],e.replace({pathname:r,query:t},void 0,{shallow:!0}))}},[e]);return{viewFromQuery:t,wantsEditView:n||"edit"===t,setViewInQuery:(0,r.useCallback)(function(e){l("edit"===e?"edit":void 0)},[l]),clearViewInQuery:(0,r.useCallback)(function(){e.isReady&&e.query[i.Yb]&&l(void 0)},[e.isReady,e.query,l])}}},773445:function(e,n,t){t.d(n,{E:function(){return l}});var r=t(599506),o=t(306286),i=t(566586);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var l=function(){var e,n,t,l=(0,o.$h)().product,u=(0,i.Z)(),s=null!=l?l:u,c=(function(e){if(Array.isArray(e))return e}(e=(0,r.Z)())||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,1)||function(e,n){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],d=null!==(t=null==s?void 0:null===(n=s.specs)||void 0===n?void 0:n.meals)&&void 0!==t?t:0;return{seamlessUpdateProduct:{shouldDisplayUpgrade:c.totalCount>d,shouldDisplayDowngrade:c.totalCount<d&&c.totalCount>0}}}},820612:function(e,n,t){t.d(n,{l:function(){return c}});var r=t(827378),o=t(599506),i=t(306286),a=t(511195),l=t(471600);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function s(e,n){if(e){if("string"==typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,n)}}var c=function(){var e,n,t,c=(function(e){if(Array.isArray(e))return e}(e=(0,o.Z)())||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,1)||s(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],d=(0,i.$h)(),f=(0,a.Z)().availableOptions,p=(0,l.Z)().planFamily,v=(0,r.useMemo)(function(){if(f&&f.length>0)return f;var e,n,t,r=null===(n=d.product)||void 0===n?void 0:null===(e=n.specs)||void 0===e?void 0:e.size;return(null!==(t=null==p?void 0:p.children)&&void 0!==t?t:[]).filter(function(e){return!r||e.specs.size===r}).map(function(e){return e.specs.meals})},[f,p,null===(t=d.product)||void 0===t?void 0:null===(n=t.specs)||void 0===n?void 0:n.size]);return(0,r.useMemo)(function(){var e=c.totalCount,n=!v.includes(e),t=((function(e){if(Array.isArray(e))return u(e)})(v)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(v)||s(v)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,n){return e-n}),r=t[0],o=t[t.length-1];return void 0===r||void 0===o?{isUnsupported:n,boundaryKind:null,min:r,max:o,deficit:0}:e<r?{isUnsupported:n,boundaryKind:"below-min",min:r,max:o,deficit:r-e}:e>o?{isUnsupported:n,boundaryKind:"above-max",min:r,max:o,deficit:0}:{isUnsupported:n,boundaryKind:null,min:r,max:o,deficit:0}},[v,c.totalCount])}},729471:function(e,n,t){t.d(n,{X:function(){return r}});function r(e){return parseInt(e,10)-1}},477765:function(e,n,t){t.d(n,{R:function(){return l},j:function(){return a}});var r=t(898457),o=["householdSize","zipCode","planRecommendation","menuAssurance","staticAssurance","conditionalContent","mealSelection","momentsOfAssurance","proteinCalculator","DeliveryDetails","tabbedContent"],i=function(e){return"conditionalContent"===e.contentTypeId&&"quotes"===e.contentType},a=function(e){var n,t,a;if(null==e?void 0:null===(n=e.content)||void 0===n?void 0:n.some(i))return"testimonialsAssurance";return o.find(function(n){var t;return null==e?void 0:null===(t=e.content)||void 0===t?void 0:t.some(function(e){return e.contentTypeId===n})})||((null==e?void 0:null===(t=e.content)||void 0===t?void 0:t.some(function(e){return"animationContent"===e.contentTypeId}))?"momentsOfAssurance":(null==e?void 0:null===(a=e.content)||void 0===a?void 0:a.some(function(e){return e.contentTypeId===r.Id}))?"DeliveryDetails":void 0)},l=function(e){return"mealSelection"===a(e)}},951903:function(e,n,t){t.d(n,{p:function(){return l}});var r=t(827378),o=t(783244),i=t(94297);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var l=function(e){var n,t=(function(e){if(Array.isArray(e))return e}(n=(0,o.Z)(i.Z))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,1)||function(e,n){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}
1(n,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useMemo)(function(){var n,r,o,i,a,l,u={answers:void 0,dynamicTitle:void 0};if(!(null==e?void 0:e.content))return u;var s=e.content.find(function(e){return"conditionalContent"===e.contentTypeId&&"questions"===e.contentType}),c=e.content.find(function(e){return"conditionalContent"===e.contentTypeId&&Array.isArray(e.titleMappings)&&e.titleMappings.length>0}),d=(null==s?void 0:s.linkedQuestionHandle)||(null==c?void 0:c.linkedQuestionHandle);if(!d)return u;var f=[];if(t)try{var p=JSON.parse(t)[d];Array.isArray(p)&&(f=p)}catch(e){}var v=1===f.length?f[0]:void 0,h=null!==(i=null==s?void 0:null===(n=s.answerMappings)||void 0===n?void 0:n.filter(function(e){return e.isDefault}))&&void 0!==i?i:[],y=v&&(null==s?void 0:null===(r=s.answerMappings)||void 0===r?void 0:r.length)?s.answerMappings.filter(function(e){return e.mappedHandles.some(function(e){return e.handle===v})}):[],m=y.length>0?y:h,b=m.length>0?m.map(function(e,n){return{id:e.id||e.handle,handle:e.handle||"conditional-".concat(n),text:e.text,description:e.description||void 0,icon:e.icon||void 0,image:e.image||void 0}}):void 0;if(null==c?void 0:null===(o=c.titleMappings)||void 0===o?void 0:o.length){var g=c.titleMappings.find(function(e){return e.isDefault}),S=v?c.titleMappings.find(function(e){return!e.isDefault&&e.mappedHandles.some(function(e){return e.handle===v})}):void 0;a=(null==S?void 0:S.title)||(null==g?void 0:g.title)||c.title}return{answers:b,dynamicTitle:a=null!==(l=null!=a?a:null==s?void 0:s.title)&&void 0!==l?l:void 0}},[e,t])}},987077:function(e,n,t){t.d(n,{X:function(){return a}});var r=t(827378),o=t(872728),i=t(754750),a=function(e){var n=(0,o.ut)(e),t=(0,i.X$)(n),a=(0,r.useMemo)(function(){if(!(null==t?void 0:null===(e=t.content)||void 0===e?void 0:e.length))return{title:null,subtitle:null,name:null!==(n=null==t?void 0:t.name)&&void 0!==n?n:null};var e,n,r,o,i,a,l,u,s=t.content.find(function(e){return"question"===e.contentTypeId});if(s&&(null!=s.questionText||null!=s.subtitle))return{title:null!==(r=s.questionText)&&void 0!==r?r:null,subtitle:null!==(o=s.subtitle)&&void 0!==o?o:null,name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:null};var c=t.content.find(function(e){return"header"===e.contentTypeId});return(null==c?void 0:c.headerText)!=null?{title:c.headerText,subtitle:null!==(a=c.subtitle)&&void 0!==a?a:null,name:null!==(l=null==t?void 0:t.name)&&void 0!==l?l:null}:{title:null,subtitle:null,name:null!==(u=null==t?void 0:t.name)&&void 0!==u?u:null}},[t]),l=a.title||a.subtitle;return{contentfulHeaderData:a,shouldUseContentfulHeaderSubtitle:!!l}}},829723:function(e,n,t){t.d(n,{c:function(){return l}});var r=t(827378),o=t(277425),i=function(e){if(!e)return null;var n=e.answers;return Array.isArray(n)&&0!==n.length?{question_id:e.id,question_handle:e.handle,selectionHintText:e.selectionHintText,answer_choices:n.map(function(e){return{text:e.text||"",answer_handle:e.handle,answer_id:e.id||e.handle,image_url:e.image?(0,o.Z)(e.image):"",subTitle:e.description||"",hintText:e.hintText}})}:null};function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var l=function(e){var n=e.contentfulStep,t=(0,r.useMemo)(function(){if(n){var e;return null===(e=n.content)||void 0===e?void 0:e.find(function(e){return"question"===e.contentTypeId})}},[n]),o=(0,r.useMemo)(function(){return t&&t.answers?i(t):null},[t]);return{contentfulQuestion:t,normalizedQuestion:o,animationConfig:(0,r.useMemo)(function(){if(null==n?void 0:n.content){var e,t,r,o,i=n.content.find(function(e){return"animationContent"===e.contentTypeId});if(i){var l=i.finalTitle,u=i.pillMessages;if(Array.isArray(i.textMessages))o=i.textMessages;else if(Array.isArray(i.textSequence))o=i.textSequence;else if(i.textMessages&&"object"==((e=i.textMessages)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)&&!Array.isArray(i.textMessages)&&"textMessages"in i.textMessages){var s=i.textMessages;o=Array.isArray(s.textMessages)?s.textMessages:void 0,void 0!==s.finalTitle&&(l=s.finalTitle),void 0!==s.pillMessages&&(u=s.pillMessages)}if(o)return a((t=a({},i),r=r={textMessages:o},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t),void 0!==l&&{finalTitle:l},void 0!==u&&{pillMessages:u})}}},[n])}}},818095:function(e,n,t){t.d(n,{z:function(){return M}});var r=t(827378),o=t(872728),i=t(961081),a=t(754750),l=t(652436);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function s(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var c=function(e){var n=e.contentfulFunnelResponses,t=e.questionId,o=e.replaceSelectedRatingContentfulResponses,i=(0,r.useMemo)(function(){var e=null==n?void 0:n.find(function(e){return e.question_id===t&&"ranking_items"in e}),r=null==e?void 0:e.ranking_items;if(null==r?void 0:r.length)return r.reduce(function(e,n){return e[n.answer_handle]={like:"like"===n.sentiment,dislike:"dislike"===n.sentiment,neutral:"neutral"===n.sentiment},e},{})},[n,t]),a=(0,r.useCallback)(function(e,n){var t,r,a,l=i||{},u=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},l);"like"===n?u[e]={like:!(null===(t=l[e])||void 0===t?void 0:t.like),dislike:!1,neutral:!1}:"dislike"===n?u[e]={like:!1,dislike:!(null===(r=l[e])||void 0===r?void 0:r.dislike),neutral:!1}:u[e]={like:!1,dislike:!1,neutral:!(null===(a=l[e])||void 0===a?void 0:a.neutral)},o(Object.entries(u).filter(function(e){var n=s(e,2)[1];return n.like||n.dislike||n.neutral}).map(function(e){var n=s(e,2),t=n[0],r=n[1],o="neutral";return r.like?o="like":r.dislike&&(o="dislike"),{answerKey:t,sentiment:o}}))},[i,o]);return{contentfulRatings:i,setContentfulRatings:a}},d=t(477765),f=t(64428);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function h(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var y=["mp4","webm","mov","m4v","ogv"],m=function(e){var n,t,r=null!==(t=null===(n=e.split("?")[0].split(".").pop())||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"";return y.includes(r)?"video":"image"},b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,o=(0,r.useMemo)(function(){var n,t=null==e?void 0:null===(n=e.content)||void 0===n?void 0:n.find(function(e){return"header"===e.contentTypeId});return(null==t?void 0:t.headerText)||(null==t?void 0:t.subtitle)||""},[e]),i=(0,r.useMemo)(function(){if(e){var r,o,i=null===(r=e.content)||void 0===r?void 0:r.find(function(e){return"media"===e.contentTypeId});if(i){var a=i;if((null===(o=i.variations)||void 0===o?void 0:o.length)&&Object.keys(n).length>0){var l=i.variations.find(function(e){return!!(e.condition&&(0,f.j)(e.condition,t))&&Object.entries((0,f.n)(e.condition)).every(function(e){var t=function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,n){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],o=t[1];return n[r]===o})});(null==l?void 0:l.content)&&(a=h(v({},i),{id:l.content.id||i.id,type:l.content.type||i.type,mediaLink:l.content.mediaLink||i.mediaLink,desktopMediaLink:l.content.desktopMediaLink||i.desktopMediaLink,altText:l.content.altText||i.altText,poster:l.content.poster||i.poster,aspectRatio:l.content.aspectRatio||i.aspectRatio}))}return h(v({},a),{aspectRatio:a.aspectRatio||"16/9"})}}},[e,n,t]);return(0,r.useMemo)(function(){return i?{id:i.id||"hero-media",type:i.type,src:i.mediaLink,desktopSrc:i.desktopMediaLink||void 0,desktopType:i.desktopMediaLink?m(i.desktopMediaLink):void 0,altText:i.altText||o,poster:i.poster||"",aspectRatio:i.aspectRatio||"16/9",uiVariant:i.uiVariant,targetCoords:i.targetCoords,tags:i.tags,hideOnDesktop:i.hideOnDesktop}:null},[i,o])},g=t(951903),S=t(829723),P=t(783244),O=t(94297);function w(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function k(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return w(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return w(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var x={},C=function(e,n){var t=e.find(function(e){return e.contentTypeId===n});return Array.isArray(null==t?void 0:t.variations)&&t.variations.length>0},A=function(e){var n=(0,r.useMemo)(function(){return null!=e&&!!e.content&&C(e.content,"media")},[e]),t=(0,r.useMemo)(function(){return null!=e&&!!e.content&&C(e.content,"bottomBanner")},[e]),o=(0,r.useMemo)(function(){return null!=e&&!!e.content&&C(e.content,"header")},[e]),i=n||t||o,a=k((0,P.Z)(O.Z),1)[0],l=(0,r.useMemo)(function(){if(!i||!a)return{parsedConditions:null,hasMultiSelection:!1};try{var e=JSON.parse(a);if(!e||(void 0===e?"undefined":e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)!="object")return{parsedConditions:null,hasMultiSelection:!1};var n={},t=!1;return Object.entries(e).forEach(function(e){var r=k(e,2),o=r[0],i=r[1];Array.isArray(i)&&i.length>0&&(n[o]=i[0],i.length>1&&(t=!0))}),{parsedConditions:Object.keys(n).length>0?n:null,hasMultiSelection:t}}catch(e){return{parsedConditions:null,hasMultiSelection:!1}}},[i,a]),u=l.parsedConditions,s=l.hasMultiSelection;return{mediaConditions:(0,r.useMemo)(function(){return n&&u?u:x},[n,u]),bannerSelectionCriteria:(0,r.useMemo)(function(){return t&&u?u:void 0},[t,u]),headerConditions:(0,r.useMemo)(function(){return o&&u&&!s?u:x},[o,u,s])}};function Z(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var _=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return(0,r.useMemo)(function(){if(null==e?void 0:e.content){var r=e.content.find(function(e){return"header"===e.contentTypeId});if(r){if((null===(o=r.variations)||void 0===o?void 0:o.length)&&Object.keys(n).length>0){var o,i,a,l=r.variations.find(function(e){return!!(e.condition&&(0,f.j)(e.condition,t))&&Object.entries((0,f.n)(e.condition)).every(function(e){var t=function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,n){if(e){if("string"==typeof e)return Z(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Z(e,2)}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],o=t[1];return n[r]===o})});if(null==l?void 0:l.content)return{id:null!==(i=l.content.id)&&void 0!==i?i:r.id,headerText:l.content.headerText,subtitle:null!==(a=l.content.subtitle)&&void 0!==a?a:r.subtitle}}return{id:r.id,headerText:r.headerText,subtitle:r.subtitle}}}},[e,n,t])},E=t(60074),j=t(966622),I=t(407792),T=function(e){var n=(0,j.py)({runUsingStatsig:!0}),t=n.decide,o=n.isReady,i=(0,I.O)(),a=i.id,l=i.attributes;return(0,r.useMemo)(function(){if(!e||!o)return null;try{return t({experimentKey:e,experimentationUserId:a,experimentationUserAttributes:function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},l)}).variationKey||null}catch(n){return E.Tb(n,{tags:{experiment_name:e,source:"useExperimentVariation"}}),null}},[e,t,a,l,o])};function D(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function F(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function R(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return F(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return F(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var M=function(){var e,n=parseInt((0,i.sV)().step)-1,t=(0,o.Tb)(n),u=T((0,r.useMemo)(function(){if(t){if(t.variations){var e=!0,n=!1,r=void 0;try{for(var o,i=t.variations[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=o.value;if(a.condition&&"object"===D(a.condition)&&"experiment"in a.condition&&"string"==typeof a.condition.experiment)return a.condition.experiment}}catch(e){n=!0,r=e}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}if(t.content){var l=!0,u=!1,s=void 0;try{for(var c,d=t.content[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var f=c.value;if((void 0===f?"undefined":D(f))==="object"&&null!==f&&"variations"in f&&Array.isArray(f.variations)){var p=!0,v=!1,h=void 0;try{for(var y,m=f.variations[Symbol.iterator]();!(p=(y=m.next()).done);p=!0){var b=y.value;if(b&&(void 0===b?"undefined":D(b))==="object"&&"condition"in b&&b.condition&&"object"===D(b.condition)&&"experiment"in b.condition&&"string"==typeof b.condition.experiment)return b.condition.experiment}}catch(e){v=!0,h=e}finally{try{p||null==m.return||m.return()}finally{if(v)throw h}}}}}catch(e){u=!0,s=e}finally{try{l||null==d.return||d.return()}finally{if(u)throw s}}}}},[t])),s=(0,a.X$)(t,u),f=(0,d.j)(s),p=A(s),v=p.mediaConditions,h=p.bannerSelectionCriteria,y=p.headerConditions,m=R((0,r.useState)(),2),P=m[0],O=m[1],w=(0,r.useCallback)(function(e){return O(e)},[]),k=R((0,r.useState)(!1),2),x=k[0],C=k[1],Z=(0,r.useCallback)(function(e){return C(e)},[]),E=R((0,r.useState)(),2),j=E[0],I=E[1],F=(0,r.useCallback)(function(e){return I(e)},[]);(0,r.useEffect)(function(){C(!1)},[n]);var M=b(s,null!=P?P:v,u),z=_(s,y,u),N=(0,o.PJ)(),L=(0,S.c)({contentfulStep:null!=s?s:null}).contentfulQuestion,q=(0,g.p)(null!=s?s:null).answers,G=null==s?void 0:null===(e=s.content)||void 0===e?void 0:e.find(function(e){return"conditionalContent"===e.contentTypeId&&"questions"===e.contentType}),H=(null==L?void 0:L.handle)||(null==G?void 0:G.handle)||(null==s?void 0:s.name)||"",U=(null==L?void 0:L.id)||(null==G?void 0:G.contentId)||
1(null==s?void 0:s.id)||"",B=(0,l.Z)({funnelId:(null==N?void 0:N.funnelName)||"",questionId:U,questionHandle:H,answerChoices:(null==L?void 0:L.answers)||q||[]}),Q=B.replaceSelectedContentfulResponses,W=B.replaceSelectedRatingContentfulResponses,V=c({contentfulFunnelResponses:B.contentfulFunnelResponses,questionId:U,replaceSelectedRatingContentfulResponses:W});return{contentfulStep:s,matchedSystemContentType:f,mediaProps:M,resolvedHeader:z,bannerSelectionCriteria:null!=j?j:h,experimentVariation:u,headerHidden:x,handleMediaConditionsChange:w,handleHeaderHiddenChange:Z,handleBannerSelectionCriteriaChange:F,replaceSelectedContentfulResponses:Q,replaceSelectedRatingContentfulResponses:W,contentfulRatings:V.contentfulRatings,setContentfulRatings:V.setContentfulRatings}}},64428:function(e,n,t){t.d(n,{j:function(){return r},n:function(){return o}});var r=function(e,n){var t=e.experiment,r=e.variation;return void 0===t||void 0===r||!!n&&n===r},o=function(e){return e.experiment,e.variation,function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,["experiment","variation"])}},85221:function(e,n,t){t.d(n,{Dy:function(){return u},K_:function(){return a},q4:function(){return l}});var r=t(718583);function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}var i="hf_plan_recommendation_manual_override",a=function(){try{var e=r.ZP.getItem(i);if(!e)return{};return JSON.parse(e)}catch(e){return{}}},l=function(e){try{var n=a();r.ZP.setItem(i,JSON.stringify(o({},n,e)))}catch(e){}},u=function(e){try{var n=r.ZP.getItem(i);if(!n)return;var t=JSON.parse(n),a=o({},t);delete a[e],r.ZP.setItem(i,JSON.stringify(a))}catch(e){}}},237369:function(e,n,t){t.d(n,{B:function(){return r},e:function(){return o}});var r=["ready-to-eat","ready-to-eat-v2"],o=function(e){return(null!=e?e:[]).some(function(e){return"planRecommendation"===e.contentTypeId&&r.includes(e.uiVariant)})}},217361:function(e,n,t){t.d(n,{O:function(){return s},n:function(){return c}});var r=t(687800),o=t(827378),i=t(656573);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function l(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return a(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var u=o.createContext(null),s=function(e){var n=e.children,t=l(o.useState([]),2),a=t[0],s=t[1],c=l(o.useState([]),2),d=c[0],f=c[1],p=l(o.useState([]),2),v=p[0],h=p[1],y=l(o.useState([]),2),m=y[0],b=y[1],g=l(o.useState(""),2),S=g[0],P=g[1],O=l((0,i.D6)(),2),w=O[0],k=O[1],x=l(o.useState([]),2),C=x[0],A=x[1],Z=l(o.useState([]),2),_=Z[0],E=Z[1],j=o.useRef([]),I=o.useRef({handle:null,answers:[],positions:[]}),T=o.useMemo(function(){return a},[a]),D=o.useMemo(function(){return d},[d]),F=o.useMemo(function(){return v},[v]),R=o.useMemo(function(){return m},[m]),M=o.useMemo(function(){return C},[C]),z=o.useMemo(function(){return _},[_]);return(0,r.tZ)(u.Provider,{value:{orderType:w,setOrderType:k,selectedGoals:T,selectedAdditionalPreferences:D,setGoals:s,setAdditionalPreferences:f,selectedGoalsIndexList:F,setGoalsIndexList:h,selectedAdditionalPreferencesIndexList:R,setAdditionalPreferencesIndexList:b,zipcode:S,setZipcode:P,selectedGenericStepAnswers:M,setGenericStepAnswers:A,selectedGenericStepIndexList:z,setGenericStepIndexList:E,currentQuestionDefaultRef:j,currentStepAnswersRef:I},children:n})},c=function(){var e=o.useContext(u);if(!e)throw Error("useQuizDataContext must be used within a QuizDataProvider");return e}},857660:function(e,n,t){t.d(n,{t:function(){return d},w:function(){return c}});var r=t(687800),o=t(827378),i=t(581340),a=t(783244);function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function u(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return l(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,n)}}
1(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s=o.createContext(null),c=function(e){var n=e.children,t=(0,i.t)(),l=u((0,a.Z)("hf_prefill_zipcode"),1)[0],c=u(o.useState(),2),d=c[0],f=c[1],p=u(o.useState(!1),2),v=p[0],h=p[1];return(0,r.tZ)(s.Provider,{value:{selectedProgram:d,setSelectedProgram:f,programsRedirectIsLoading:v,redirectUserToFactorProgramsFunnel:function(){h(!0),t.push("/programs-funnel?isFromBAU=true&zipcode=".concat(l))}},children:n})},d=function(){var e=o.useContext(s);if(!e)throw Error("useChooseProgramContext must be used within a ChooseProgramProvider");return e}},448249:function(e,n,t){t.d(n,{n:function(){return b},w:function(){return g}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(962836),s=t(94297),c=["oneTwoDays","threeDays","weekdays","everyday"],d=function(e){return c.includes(e)},f=t(66077),p={questionHandle:"daysPerWeek",overrides:[{systemCountry:t(26730).Z.YE,values:{questionHandle:"food-profile_household-quantity"}}]},v=(0,f.Z)("hf.single-question-flow.days-per-week",p).useConfig;function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var y=(0,o.createContext)({daysPerWeekOptions:c,selectedDaysPerWeek:void 0,setSelectedDaysPerWeek:function(){}}),m="hf_goals_plan_meals_per_week_cookie",b=function(e){var n,t=e.children,i=v().questionHandle,f=(0,u.Z)().preSelectedMealsPerWeek,p=(0,s.C)(i||"").persistedSelections,b=(0,o.useMemo)(function(){var e=a().get(m);return e&&d(e)?e:p.length>0&&d(p[0])?p[0]:f},[f,p]),g=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(b))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),S=g[0],P=g[1],O=(0,o.useMemo)(function(){return S?[S]:[]},[S]);(0,l.D)(i,O),(0,o.useEffect)(function(){S&&a().set(m,S)},[S]),(0,o.useEffect)(function(){p.length>0&&d(p[0])&&P(p[0])},[p]);var w=(0,o.useMemo)(function(){return{daysPerWeekOptions:c,selectedDaysPerWeek:S,setSelectedDaysPerWeek:P}},[S,P]);return(0,r.tZ)(y.Provider,{value:w,children:t})},g=function(){var e=(0,o.useContext)(y);if(!e)throw Error("useDaysPerWeekContext must be used within DaysPerWeekContext");return e}},467841:function(e,n,t){t.d(n,{N:function(){return o},Y:function(){return r}});var r={PORTION_CONTROL:"portionControl",SAVE_TIME:"saveTime",MANAGE_WEIGHT:"manageWeight",EAT_VARIETY:"eatVariety",IMPROVE_HEALTH:"improveHealth",NONE_APPLY:"noneApply",HIGH_PROTEIN:"highProtein",GLP1_JOURNEY:"glp1Journey",GUT_HEALTH:"gutHealth",MENTAL_FOCUS:"mentalFocus"},o=function(e){return Object.values(r).includes(e)}},23470:function(e,n,t){t.d(n,{r:function(){return w},x:function(){return O}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(467841),s=t(55322),c=t(519193),d=t.n(c),f=t(922346),p=t.n(f),v=t(783244);function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function y(e,n){if(e){if("string"==typeof e)return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}}var m=function(e,n){var t,r=function(e){if(Array.isArray(e))return e}(t=(0,v.Z)("hf_goals_quiz_order"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||y(t,2)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=r[0],a=r[1],l=(0,o.useMemo)(function(){if(!e)return[];if(!n)return e;var t=function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();if(i){var r=i.split(",");if(b(r,e))return r}if(e){var o=t.filter(function(e){return e!==u.Y.NONE_APPLY});(t=d()(o)).push(u.Y.NONE_APPLY)}return t},[e,i,n]);return(0,o.useEffect)(function(){a(l.join(","))},[l,a]),l},b=function(e,n){return e.length===n.length&&0===p()(e,n).length};function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var S=(0,o.createContext)({originalGoalsOptions:[],shuffledGoalsOptions:[],selectedGoals:[],setSelectedGoals:function(){}}),P="hf_goals_quiz_cookie",O=function(){var e=(0,o.useContext)(S);if(!e)throw Error("useGoalsContext must be used within GoalsProvider");return e},w=function(e){var n,t=e.children,i=(0,s.j)(),c=i.goalsOptions,d=i.questionHandle,f=m(c,i.shouldShuffleGoalOptions),p=(0,o.useMemo)(function(){return(a().get(P)||"").split(",").filter(u.N)},[]),v=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(p))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return g(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=v[0],y=v[1];(0,l.D)(d,h),(0,o.useEffect)(function(){a().set(P,h.join(","))},[h]);var b=(0,o.useMemo)(function(){return{originalGoalsOptions:c,shuffledGoalsOptions:f,selectedGoals:h,setSelectedGoals:y}},[c,f,h,y]);return(0,r.tZ)(S.Provider,{value:b,children:t})}},55322:function(e,n,t){t.d(n,{j:function(){return u}});var r=t(66077),o=t(26730),i=t(467841),a={shouldShuffleGoalOptions:!0,maxGoalsSelection:3,showGoalOptionIcons:!0,isGoalsSelectionRequired:!0,showGoalsQuizSubtitle:!0,goalsOptions:[i.Y.PORTION_CONTROL,i.Y.SAVE_TIME,i.Y.MANAGE_WEIGHT,i.Y.EAT_VARIETY,i.Y.IMPROVE_HEALTH,i.Y.NONE_APPLY],overrides:[{systemCountry:o.Z.FJ,values:{questionHandle:"goals",shouldShuffleGoalOptions:!1,goalsOptions:[i.Y.IMPROVE_HEALTH,i.Y.HIGH_PROTEIN,i.Y.SAVE_TIME,i.Y.MANAGE_WEIGHT,i.Y.EAT_VARIETY,i.Y.GLP1_JOURNEY]}},{systemCountry:o.Z.YE,values:{questionHandle:"goals",shouldShuffleGoalOptions:!1,goalsOptions:[i.Y.PORTION_CONTROL,i.Y.HIGH_PROTEIN,i.Y.EAT_VARIETY,i.Y.SAVE_TIME,i.Y.MANAGE_WEIGHT,i.Y.NONE_APPLY]}},{systemCountry:[o.Z.TK,o.Z.TO,o.Z.TT,o.Z.TV,o.Z.TZ],values:{questionHandle:"goals",shouldShuffleGoalOptions:!1,maxGoalsSelection:null,showGoalOptionIcons:!1,isGoalsSelectionRequired:!1,showGoalsQuizSubtitle:!1,goalsOptions:[i.Y.MANAGE_WEIGHT,i.Y.HIGH_PROTEIN,i.Y.GUT_HEALTH,i.Y.MENTAL_FOCUS,i.Y.IMPROVE_HEALTH,i.Y.SAVE_TIME]}}]},l=(0,r.Z)("hf.single-question-flow.goals-quiz",a),u=function(){return l.useConfig()}},693961:function(e,n,t){t.d(n,{d:function(){return b},S:function(){return g}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(962836),s=t(94297),c=["justOne","lunchDinner","allMeals"],d=function(e,n){return e.includes(n)},f=t(66077),p={questionHandle:"dailyMealsNumber",mealsPerDayOptions:c,overrides:[{systemCountry:t(26730).Z.YE,values:{mealsPerDayOptions:["justOne","lunchDinner"]}}]},v=(0,f.Z)("hf.single-question-flow.meals-per-day",p).useConfig;function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var y=(0,o.createContext)({mealsPerDayOptions:c,selectedMealsPerDay:void 0,setSelectedMealsPerDay:function(){}}),m="hf_goals_plan_meals_per_day_cookie",b=function(e){var n,t=e.children,i=v(),c=i.questionHandle,f=i.mealsPerDayOptions,p=(0,u.Z)().preSelectedMealsPerDay,b=(0,s.C)(c||"").persistedSelections,g=(0,o.useMemo)(function(){var e=a().get(m);return e&&d(f,e)?e:b.length>0&&d(f,b[0])?b[0]:p},[f,p,b]),S=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(g))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}
1(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),P=S[0],O=S[1],w=(0,o.useMemo)(function(){return P?[P]:[]},[P]);(0,l.D)(c,w),(0,o.useEffect)(function(){P&&a().set(m,P)},[P]),(0,o.useEffect)(function(){b.length>0&&d(f,b[0])&&O(b[0])},[b,f]);var k=(0,o.useMemo)(function(){return{mealsPerDayOptions:f,selectedMealsPerDay:P,setSelectedMealsPerDay:O}},[P,O,f]);return(0,r.tZ)(y.Provider,{value:k,children:t})},g=function(){var e=(0,o.useContext)(y);if(!e)throw Error("useMealsPerDayContext must be used within MealsPerDayProvider");return e}},932023:function(e,n,t){t.d(n,{i:function(){return g},F:function(){return S}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(962836),s=t(94297),c=["justMe","twoOfUs","groupFamily"],d=function(e,n){return e.includes(n)},f=t(66077);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var v={questionHandle:"peopleNumber",numberOfPeopleOptions:c,overrides:[{systemCountry:t(26730).Z.YE,values:{questionHandle:"food-profile_household",numberOfPeopleOptions:((function(e){if(Array.isArray(e))return p(e)})(c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,n){if(e){if("string"==typeof e)return p(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,void 0)}}(c)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["team"])}}]},h=(0,f.Z)("hf.single-question-flow.number-of-people",v).useConfig;function y(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var m=(0,o.createContext)({numberOfPeopleOptions:c,selectedNumberOfPeople:void 0,setSelectedNumberOfPeople:function(){}}),b="hf_goals_plan_number_of_people_cookie",g=function(e){var n,t=e.children,i=h(),c=i.questionHandle,f=i.numberOfPeopleOptions,p=(0,u.Z)().preselectedNumberOfPeople,v=(0,s.C)(c||"").persistedSelections,g=(0,o.useMemo)(function(){var e=a().get(b);return e&&d(f,e)?e:v.length>0&&d(f,v[0])?v[0]:p},[f,p,v]),S=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(g))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return y(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),P=S[0],O=S[1],w=(0,o.useMemo)(function(){return P?[P]:[]},[P]);(0,l.D)(c,w),(0,o.useEffect)(function(){P&&a().set(b,P)},[P]),(0,o.useEffect)(function(){v.length>0&&d(f,v[0])&&O(v[0])},[v,f]);var k=(0,o.useMemo)(function(){return{numberOfPeopleOptions:f,selectedNumberOfPeople:P,setSelectedNumberOfPeople:O}},[P,O,f]);return(0,r.tZ)(m.Provider,{value:k,children:t})},S=function(){var e=(0,o.useContext)(m);if(!e)throw Error("useNumberOfPeopleContext must be used within NumberOfPeopleProvider");return e}},170231:function(e,n,t){t.d(n,{i:function(){return o},k:function(){return r}});var r=["pork","porkfree"],o=function(e){return r.includes(e)}},253977:function(e,n,t){t.d(n,{E:function(){return b},t:function(){return g}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(170231),s=t(66077),c={overrides:[{systemCountry:t(26730).Z.FJ,values:{questionHandle:"porkPersonalization"}}]},d=(0,s.Z)("hf.single-question-flow.pork-preference",c).useConfig,f=t(376099),p=t(806222),v=function(e){var n,t=(0,f.P)(),r=(0,p.Z)(),i=null===(n=t.preferences.find(function(e){return e.handle===r}))||void 0===n?void 0:n.subpreferences;(0,o.useEffect)(function(){r&&e.selectedPorkPreference&&(i&&0!==i.length&&i.some(function(e){return"porkfree"===e.dietType})||e.setPorkPreference(void 0))},[r,i,e])};function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var y=(0,o.createContext)({porkPreferenceOptions:u.k,selectedPorkPreference:void 0,setPorkPreference:function(){}}),m="hf_rte_personalization_is_pork_free_selected",b=function(e){var n,t=e.children,i=d().questionHandle,s=(0,o.useMemo)(function(){var e=a().get(m);
1if(e&&(0,u.i)(e))return e},[]),c=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(s))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=c[0],p=c[1],b=(0,o.useMemo)(function(){return f?[f]:[]},[f]);(0,l.D)(i,b),(0,o.useEffect)(function(){f?a().set(m,f):a().remove(m)},[f]);var g=(0,o.useMemo)(function(){return{porkPreferenceOptions:u.k,selectedPorkPreference:f,setPorkPreference:p}},[f,p]);return v(g),(0,r.tZ)(y.Provider,{value:g,children:t})},g=function(){var e=(0,o.useContext)(y);if(!e)throw Error("usePorkPreferenceContext must be used within PorkPreferenceProvider");return e}},142432:function(e,n,t){t.d(n,{Q:function(){return u},V:function(){return l}});var r=t(687800),o=t(827378),i=t(853834),a=(0,o.createContext)({selectedPreferences:[],setSelectedPreferences:function(){}}),l=function(e){var n=e.children,t=(0,i.Z)({defaultPreferences:void 0}),l=t.selectedPreferences,u=t.setSelectedPreferences,s=(0,o.useMemo)(function(){return{selectedPreferences:l,setSelectedPreferences:u}},[l,u]);return(0,r.tZ)(a.Provider,{value:s,children:n})},u=function(){var e=(0,o.useContext)(a);if(!e)throw Error("useSelectedPreferencesContext must be used within SelectedPreferencesProvider");return e}},959827:function(e,n,t){t.d(n,{A:function(){return r},r:function(){return o}});var r=["spicy","nonspicy"],o=function(e){return r.includes(e)}},380624:function(e,n,t){t.d(n,{g:function(){return g},E:function(){return S}});var r=t(687800),o=t(827378),i=t(567921),a=t.n(i),l=t(173745),u=t(959827),s=t(66077),c={overrides:[{systemCountry:t(26730).Z.FJ,values:{questionHandle:"spicyPersonalization"}}]},d=(0,s.Z)("hf.single-question-flow.spice-preference",c).useConfig,f=t(376099),p=t(253977),v=t(806222),h=function(e){var n,t=(0,f.P)(),r=(0,p.t)().selectedPorkPreference,i=(0,v.Z)(),a=null===(n=t.preferences.find(function(e){return e.handle===i}))||void 0===n?void 0:n.subpreferences;(0,o.useEffect)(function(){i&&e.selectedSpicePreference&&(a&&0!==a.length?"porkfree"===r?e.setSpicePreference(void 0):a.some(function(e){return"nonspicy"===e.dietType})||e.setSpicePreference(void 0):e.setSpicePreference(void 0))},[i,a,e,r])};function y(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var m=(0,o.createContext)({spicePreferenceOptions:u.A,selectedSpicePreference:void 0,setSpicePreference:function(){}}),b="hf_rte_personalization_is_non_spicy_selected",g=function(e){var n,t=e.children,i=d().questionHandle,s=(0,o.useMemo)(function(){var e=a().get(b);if(e&&(0,u.r)(e))return e},[]),c=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)(s))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return y(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=c[0],p=c[1],v=(0,o.useMemo)(function(){return f?[f]:[]},[f]);(0,l.D)(i,v),(0,o.useEffect)(function(){f?a().set(b,f):a().remove(b)},[f]);var g=(0,o.useMemo)(function(){return{spicePreferenceOptions:u.A,selectedSpicePreference:f,setSpicePreference:p}},[f,p]);return h(g),(0,r.tZ)(m.Provider,{value:g,children:t})},S=function(){var e=(0,o.useContext)(m);if(!e)throw Error("useSpicePreferenceContext must be used within SpicePreferenceProvider");return e}},961081:function(e,n,t){t.d(n,{WX:function(){return ec},sV:function(){return ed}});var r,o=t(687800),i=t(827378),a=t(581340),l=t(368058),u=t(783244),s=t(720232);function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return c(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,n)}}
1(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var f=function(){var e=d((0,i.useState)(!1),2),n=e[0],t=e[1],r=(0,a.t)().query,o=(0,s.y)(),l=o.canSkipZipcodeStep,c=o.defaultZipcode,f=d((0,u.Z)("hf_prefill_zipcode"),2),p=f[0],v=f[1],h="zipcode"===(Array.isArray(r.skipStep)?r.skipStep[0]:r.skipStep);return(0,i.useEffect)(function(){l&&h&&c&&(t(!0),p||v(c))},[l,h,v,c,p]),n},p=t(482559),v=t(921318);function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var y=function(){var e,n,t=(0,v.qC)("flow-steps-slot"),r=t.isEnabled,o=t.content;return r&&o?{stepsToRemove:(null===(e=o.stepToRemove)||void 0===e?void 0:e.length)?o.stepToRemove:void 0,stepsWithTargets:(null===(n=o.stepsToInject)||void 0===n?void 0:n.length)?o.stepsToInject.map(function(e){return{step:e.step,next_step:e.next_step}}):void 0}:{}},m=function(e){return Object.values(p.h).find(function(n){return n===e})||("zipcode"===e?p.h.zipCode:"assurance"===e?p.h.assuranceStep:void 0)},b=function(){var e=y(),n=e.stepsToRemove,t=e.stepsWithTargets;return{stepsToRemove:null==n?void 0:n.map(m).filter(Boolean),stepsWithTargets:null==t?void 0:t.map(function(e){var n=m(e.step),t=m(e.next_step);return n&&t?{step:n,next_step:t}:null}).filter(Boolean)}},g=function(e){var n,t=b(),r=t.stepsToRemove,o=void 0===r?[]:r,i=t.stepsWithTargets,a=void 0===i?[]:i,l=a.map(function(e){return e.step}),u=function(e){if(Array.isArray(e))return h(e)}(n=e.filter(function(e){return!o.includes(e)&&!l.includes(e)}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,n){if(e){if("string"==typeof e)return h(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return a.forEach(function(e){var n=e.step,t=e.next_step,r=u.findIndex(function(e){return e===t});-1!==r&&u.splice(r,0,n)}),u},S=t(268481),P=t(612771),O=t(235487),w=t(463171),k=t(359839),x=t(345889),C=t(707866),A=t(523921),Z=t(292362),_=t(396887),E=function(){var e=(0,a.t)(),n=e.query,t=e.isReady;return(0,_.ew)().NEXT_PUBLIC_SERVER_ENV===_.Xe.live?{isEnabled:!1}:t&&"1"===n.sqf?{isEnabled:!0}:{isEnabled:!1}},j=t(917983),I=function(){var e=(0,a.t)(),n=(0,S.Sj)(),t=(0,O.D)().isMobile,r=n===P.P.mobile||t,o=(0,k.r9)(),i=o.flowType,l=o.desktopFlowType,u=(0,x.K)(),s=(0,C.t)().isInExtendedFunnelV2Test,c=(0,A.o)().isExtendedFunnelDesktopEnabled,d=E().isEnabled,f=(0,Z.SL)().isRafFunnelEnabled,p=(0,w.Z)("web_plans_pricing_pcng-1868-zipcode-rollout-ck").isEnabled;return f?r?j.Z.HelloFreshRAFFunnelCA:j.Z.HelloFreshRAFFunnelCADesktop:e.query.isFromPlanRecommendation?j.Z.RoutedFromPlans:p?j.Z.WLMealKitPlanRecommendationWithZipcode:!r&&c?j.Z.ExtendedFunnelDesktop:r&&u&&s?j.Z.ExtendedFunnelMobileV2:r&&u?j.Z.ExtendedFunnelMobile:!r&&i===j.Z.FJExtendedFunnelMobile&&d?j.Z.FJExtendedFunnelMobile:!r&&l?l:i},T=t(872728),D=t(467841),F=function(e){var n=e.personalizationSubpreferences||[];if("FJ"===e.country)return p.h.newExclusionsProteins;if(n.length>0){var t=n.map(function(e){return e.dietType});if(t.includes("porkfree"))return p.h.planPersonalizationPork;if(t.includes("nonspicy"))return p.h.planPersonalizationSpicy}},R=function(e){var n=e.personalizationSubpreferences||[];if(n.length>0&&n.map(function(e){return e.dietType}).includes("nonspicy")&&"porkfree"!==e.selectedPorkPreference)return p.h.planPersonalizationSpicy},M=[[D.Y.EAT_VARIETY,D.Y.MANAGE_WEIGHT,D.Y.SAVE_TIME],[D.Y.MANAGE_WEIGHT,D.Y.SAVE_TIME]],z=function(e,n){var t=n.indexOf(e);return -1===t||t>=n.length-1?null:n[t+1]},N=function(e){var n,t=e.rteFactorProgramsFlagEnabled,r=0!==(n=e.selectedGoals||[]).length&&M.some(function(e){return n.length===e.length&&e.every(function(e){return n.includes(e)})});if(t&&r)return p.h.chooseProgram;if(e.stepOrder){var o=z(p.h.chooseProgram,e.stepOrder);if(o)return o}return p.h.preferences},L={steps:[p.h.zipCode,p.h.goalsQuiz,p.h.chooseProgram,p.h.preferences,p.h.newExclusionsProteins,p.h.newExclusionsIngredients,p.h.goalsPlanNumberOfPeople,p.h.goalsPlanMealsPerDay,p.h.goalsPlanMealsPerWeek,p.h.goalsPlanRecommendation],transitionRules:new Map([[p.h.goalsQuiz,N],[p.h.preferences,function(e){var n;return null!==(n=F(e))&&void 0!==n?n:p.h.goalsPlanNumberOfPeople}],[p.h.planPersonalizationPork,function(e){var n;return null!==(n=R(e))&&void 0!==n?n:p.h.goalsPlanNumberOfPeople}]])};p.h.zipCode,p.h.goalsQuiz,p.h.chooseProgram,p.h.preferences,p.h.newExclusionsProteins,p.h.newExclusionsIngredients,p.h.planSelector,p.h.goalsQuiz,p.h.preferences,p.h.planPersonalizationPork;var q={steps:[p.h.zipCode,p.h.goalsQuiz,p.h.chooseProgram,p.h.preferences,p.h.newExclusionsProteins,p.h.newExclusionsIngredients,p.h.goalsPlanNumberOfPeople,p.h.goalsPlanMealsPerDay,p.h.goalsPlanMealsPerWeek,p.h.goalsPlanRecommendation],transitionRules:new Map([[p.h.goalsQuiz,N],[p.h.preferences,function(e){var n;return null!==(n=F(e))&&void 0!==n?n:p.h.planSelector}],[p.h.planPersonalizationPork,function(e){var n;return null!==(n=R(e))&&void 0!==n?n:p.h.planSelector}]])};function G(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var H=(G(r={},j.Z.Default,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.size,p.h.meals],transitionRules:new Map}),G(r,j.Z.DefaultDesktop,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.size,p.h.meals],transitionRules:new Map}),G(r,j.Z.WLMealKitDefault,{steps:[p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.size,p.h.meals],transitionRules:new Map}),G(r,j.Z.WLMealKitPlanRecommendation,{steps:[p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.WLMealKitPlanRecommendationSQF2,{steps:[p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.WLMealKitPlanRecommendationWithZipcode,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.YoufoodzDefault,{steps:[p.h.zipCode,p.h.goalsQuiz,p.h.preferences,p.h.goalsPlanNumberOfPeople,p.h.goalsPlanMealsPerDay,p.h.goalsPlanMealsPerWeek,p.h.goalsPlanRecommendation],transitionRules:new Map}),G(r,j.Z.FactorPlanRecommendationWithZipcode,{steps:[p.h.zipCode,p.h.goalsQuiz,p.h.preferences,p.h.goalsPlanNumberOfPeople,p.h.goalsPlanMealsPerDay,p.h.goalsPlanMealsPerWeek,p.h.goalsPlanRecommendation],transitionRules:new Map}),G(r,j.Z.FactorUSDefault,L),G(r,j.Z.FactorUSFlowOnDesktopWithRecommender,q),G(r,j.Z.RoutedFromPlans,{steps:[p.h.size,p.h.meals],transitionRules:new Map}),G(r,j.Z.HelloFreshDefaultGlobal,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshDefaultGlobalDesktop,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshDefaultGlobalDesktopSQF2,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.proteinExclusion,p.h.goals,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshDefaultUS,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.mealTypeStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshDefaultDesktopUS,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.mealTypeStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.ProteinExclusionExperimentUS,{steps:[p.h.zipCode,p.h.preferences,p.h.proteinExclusion,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.ProteinExclusionExperimentIntl,{steps:[p.h.preferences,p.h.proteinExclusion,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.GreenChefUS,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.meals,p.h.size,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.ExtendedFunnelMobile,{steps:[p.h.exZipCode,p.h.exHouseholdSize,p.h.exGoalsStep,p.h.exGoalsAssurance,p.h.exMealType,p.h.exDietaryPreferences,p.h.exDietaryRestrictions,p.h.exNutritionPreferences,p.h.exCuisinePreference,p.h.exFlavorPreferences,p.h.exProteinPreferences,p.h.exDinnerPreferences,p.h.exCookingFrequency,p.h.exMomentOfAssurance,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.ExtendedFunnelMobileV2,{steps:[p.h.exZipCode,p.h.exGoalsStep,p.h.exGoalsAssurance,p.h.exMealType,p.h.exDietaryPreferences,p.h.exDietaryRestrictions,p.h.exNutritionPreferences,p.h.exCuisinePreference,p.h.exFlavorPreferences,p.h.exProteinPreferences,p.h.exDinnerPreferences,p.h.exCookingFrequency,p.h.exHouseholdSize,p.h.exMomentOfAssurance,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.ExtendedFunnelDesktop,{steps:[p.h.exDesktopZipCode,p.h.exDesktopHouseholdSize,p.h.exDesktopGoalsStep,p.h.exDesktopGoalsAssurance,p.h.exDesktopMealType,p.h.exDesktopDietaryPreferences,p.h.exDesktopIngredientExclusionsStep,p.h.exDesktopNutritionPreferences,p.h.exDesktopCu
1isine,p.h.exDesktopFlavors,p.h.exDesktopProteins,p.h.exDesktopDinnerType,p.h.exDesktopCookingFrequency,p.h.exDesktopMomentOfAssurance,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.FJExtendedFunnelMobile,{steps:[p.h.exZipCode,p.h.exFJGoalsStep,p.h.exFJIngredientExclusions,p.h.exFJHouseholdSize,p.h.exFJMealsPerDay,p.h.exFJMealsPerWeek,p.h.goalsPlanRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshRAFFunnelUS,{steps:[p.h.exZipCode,p.h.exGoalsStep,p.h.exGoalsAssurance,p.h.exMealType,p.h.exDietaryPreferences,p.h.exDietaryRestrictions,p.h.exNutritionPreferences,p.h.exCuisinePreference,p.h.exFlavorPreferences,p.h.exProteinPreferences,p.h.exDinnerPreferences,p.h.exMomentOfAssurance,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshRAFFunnelUSDesktop,{steps:[p.h.exDesktopZipCode,p.h.exDesktopGoalsStep,p.h.exDesktopGoalsAssurance,p.h.exDesktopMealType,p.h.exDesktopDietaryPreferences,p.h.exDesktopIngredientExclusionsStep,p.h.exDesktopNutritionPreferences,p.h.exDesktopCuisine,p.h.exDesktopFlavors,p.h.exDesktopProteins,p.h.exDesktopDinnerType,p.h.exDesktopMomentOfAssurance,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshRAFFunnelCA,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.assuranceStep,p.h.planRecommendation],transitionRules:new Map}),G(r,j.Z.HelloFreshRAFFunnelCADesktop,{steps:[p.h.zipCode,p.h.preferences,p.h.additionalPreference,p.h.goals,p.h.planRecommendation],transitionRules:new Map}),r),U=t(975453),B=function(){var e=(0,T.KR)(),n=I();if((0,U.R)()&&e){var t=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u,s=(u=a.value,Object.values(p.h).includes(u)?u:null);s&&t.push(s)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return{steps:t,transitionRules:new Map}}return H[n]};function Q(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var W=function(){var e,n=I(),t=B();(function(e){if(Array.isArray(e))return e})(e=(0,u.Z)("hf_flowType",{defaultValue:n}))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),1);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,0)||function(e,n){if(e){if("string"==typeof e)return Q(e,0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q(e,0)}}(e,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var r=f(),o=t.steps;return r&&(o=o.filter(function(e){return e!==p.h.zipCode})),{flowType:n,steps:o=g(o),transitionRules:t.transitionRules}},V=t(200770),J=t(376099),K=t(23470),Y=t(253977),$=t(806222),X=function(e){var n,t=(0,J.P)(),r=(0,Y.t)().selectedPorkPreference,o=(0,$.Z)(),a=(0,K.x)().selectedGoals,l=(0,w.Z)("rte-factor-weight-loss-program-v1.1").isEnabled,u=(0,V.Z)(),s=null===(n=t.preferences.find(function(e){return e.handle===o}))||void 0===n?void 0:n.subpreferences;return(0,i.useMemo)(function(){return{personalizationSubpreferences:s,selectedPorkPreference:r,selectedGoals:a,rteFactorProgramsFlagEnabled:l,country:u,stepOrder:e}},[s,r,a,l,u,e])};function ee(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function en(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function et(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}var er=(0,i.createContext)(null),eo=function(e){return Array.isArray(e.initialStep)?e.initialStep[0]:e.initialStep},ei=function(e){return e.replace(/\s+/g,"").toLowerCase()},ea=function(e,n){if(!n)return -1;var t=ei(e);return n.findIndex(function(e){var n;return ei(null!==(n=e.name)&&void 0!==n?n:"")===t})},el=function(e,n,t){var r=n.indexOf(e);if(-1!==r)return r;var o=ea(e,t);return -1!==o&&o<n.length?o:-1},eu=function(e,n,t){var r=e.query,o=eo(r);if(o){var i=el(o,n,t);if(-1!==i)return(i+1).toString()}return(Array.isArray(r.step)?r.step[0]:r.step)||"1"},es=function(e,n,t){var r=t?e.replace:e.push,o=et(en({},e.query),{step:n});return r({pathname:e.asPath.split("?")[0],query:o},void 0,{shallow:!0})},ec=function(e){var n,t=e.children,r=(0,a.t)(),u=W(),s=u.steps,c=u.flowType,d=u.transitionRules,f=(0,T.PJ)(),p=X(s),v=function(e){if(Array.isArray(e))return e}(n=(0,l.Z)())||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return ee(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ee(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=(v[0],v[1]),y=eu(r,s,null==f?void 0:f.steps),m=parseInt(y)-1,b=s[m];(0,i.useEffect)(function(){if(r.isReady){var e=r.query,n=eo(e);if(n){var t=el(n,s,null==f?void 0:f.steps);if(-1!==t){e.initialStep;var o=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,["initialStep"]);r.replace({pathname:r.asPath.split("?")[0],query:et(en({},o),{step:(t+1).toString()})},void 0,{shallow:!0})}}}},[r,r.isReady,s,null==f?void 0:f.steps]),(0,i.useEffect)(function(){h({type:"SET_CURRENT_FLOW_STEP",currentStepId:b,flowCompletionPercentage:Number(y)/s.length*100})},[b,y]);var g=(0,i.useCallback)(function(e){var n=(Number(y)+1).toString(),t=d.get(b);if(t){var o=t(p);s.includes(o)&&(n=(s.indexOf(o)+1).toString())}return es(r,n,e)},[r,y,b,d,p,s]),S=(0,i.useMemo)(function(){return{step:y,stepName:b,flowType:c,isLastStep:m===s.length-1,isInitialStep:0===m,stepOrder:s,goToNextStep:g}},[y,b,c,s,m,g]);return(0,o.tZ)(er.Provider,{value:S,children:t})},ed=function(){var e=(0,i.useContext)(er);if(!e)throw Error("useStepContext must be used within a StepProvider");return e}},482559:function(e,n,t){var r,o;t.d(n,{h:function(){return r}}),(o=r||(r={})).zipCode="zipcode",o.preferences="preferences",o.additionalPreference="additionalPreference",o.goals="goals",o.chooseProgram="chooseProgram",o.meals="meals",o.size="size",o.goalsQuiz="goalsQuiz",o.goalsPlanNumberOfPeople="goalsPlanNumberOfPeople",o.goalsPlanMealsPerDay="goalsPlanMealsPerDay",o.goalsPlanMealsPerWeek="goalsPlanMealsPerWeek",o.goalsPlanRecommendation="goalsPlanRecommendation",o.planPersonalizationPork="planPersonalizationPork",o.planPersonalizationSpicy="planPersonalizationSpicy",o.planRecommendation="planRecommendation",o.proteinExclusion="proteinExclusion",o.planSelector="planSelector",o.quizIntro="quizIntro",o.loadingStep="loadingStep",o.planRecommendationV2="planRecommendationV2",o.mealTypeStep="mealTypeStep",o.assuranceStep="assuranceStep",o.freeForLifeSelection="freeForLifeSelection",o.assuranceAfterQuiz="assuranceAfterQuiz",o.newExclusionsProteins="newExclusionsProteins",o.newExclusionsIngredients="newExclusionsIngredients",o.default="default",o.exZipCode="exZipCode",o.exPreferences="exPreferences",o.exCuisinePreference="exCuisinePreference",o.exHouseholdSize="exHouseholdSize",o.exGoalsStep="exGoalsStep",o.exGoalsAssurance="exGoalsAssurance",o.exMomentOfAssurance="exMomentOfAssurance",o.exBudget="exBudget",o.exBudgetAssurance="exBudgetAssurance",o.exMealType="exMealType",o.exDietaryRestrictions="exDietaryRestrictions",o.exNutritionPreferences="exNutritionPreferences",o.exFlavorPreferences="exFlavorPreferences",o.exIngredientExclusions="exIngredientExclusions",o.exProteinPreferences="exProteinPreferences",o.exDinnerPreferences="exDinnerPreferences",o.exDietaryPreferences="exDietaryPreferences",o.exCookingFrequency="exCookingFrequency",o.genericStep="genericStep",o.addonsAwareness="addonsAwareness",o.exFJZipCode="exFJZipCode",o.exFJGoalsStep="exFJGoalsStep",o.exFJGoalsAssurance="exFJGoalsAssurance",o.exFJProteinExclusions="exFJProteinExclusions",o.exFJIngredientExclusions="exFJIngredientExclusions",o.exFJMealsPerDay="exFJMealsPerDay",o.exFJMealsPerWeek="exFJMealsPerWeek",o.exFJMomentOfAssurance="exFJMomentOfAssurance",o.exFJHouseholdSize="exFJHouseholdSize",o.exFJFreeForLifeReminder="exFJFreeForLifeReminder",o.exDesktopZipCode="exDesktopZipCode",o.exDesktopGoalsStep="exDesktopGoalsStep",o.exDesktopIngredientExclusionsStep="exDesktopIngredientExclusionsStep",o.exDesktopCu
1isine="exDesktopCuisine",o.exDesktopFlavors="exDesktopFlavors",o.exDesktopProteins="exDesktopProteins",o.exDesktopDinnerType="exDesktopDinnerType",o.exDesktopGoalsAssurance="exDesktopGoalsAssurance",o.exDesktopNutritionPreferences="exDesktopNutritionPreferences",o.exDesktopCookingFrequency="exDesktopCookingFrequency",o.exDesktopHouseholdSize="exDesktopHouseholdSize",o.exDesktopMealType="exDesktopMealType",o.exDesktopDietaryPreferences="exDesktopDietaryPreferences",o.exDesktopMomentOfAssurance="exDesktopMomentOfAssurance",o.onDemandPurchase="onDemandPurchase"},529970:function(e,n,t){function r(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function o(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}t.d(n,{Sz:function(){return a},uB:function(){return u},xU:function(){return l}});var i=function(e,n,t,r,o){return{event:"gaEventTrigger_EE",gaEventAction:e,gaEventCategory:"funnel",gaEventLabel:"".concat(n,"|").concat(t,"|").concat(r?"with-coupon":"no-coupon"),gaEventNonInteraction:o}},a=function(e){var n="US"===e,t=n?"curation":"checkout";return r({tribe:n?"Conversions":"Conversions Journey"},t&&{squad:t})},l=function(e){var n=e.selectedSku,t=e.action,a=e.voucherCode,l=e.productName,u=e.productPrice,s=e.currencyCode,c=e.isNonInteraction,d=e.preset,f=e.planFamilyHandle,p=e.brand;return o(r({},i(t,n,d,a,void 0!==c&&c)),{ecommerce:o(r({},{click:{actionField:{currencyCode:s},products:[{brand:p,category:f,coupon:a,id:n,name:l,price:u,variant:d||"none"}]}}),{planHandle:f,preset:d})})},u=function(e){var n=e.selectedSku,t=e.action,a=e.voucherCode,l=e.productName,u=e.productPrice,s=e.currencyCode,c=e.isNonInteraction,d=e.preset,f=e.planFamilyHandle,p=e.brand;return o(r({},i(t,n,d,a,void 0!==c&&c)),{ecommerce:o(r({},{add:{products:[{brand:p,category:f,coupon:a,id:n,name:l,price:u,variant:d,quantity:1}]}}),{currencyCode:s,planHandle:f,preset:d})})}},22546:function(e,n,t){t.d(n,{S4:function(){return u},Zh:function(){return l},ap:function(){return d},nW:function(){return s}});var r=t(827378),o=t(200770),i=t(26730);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var l={goals:{"save-time":"quick","improve-health":"fit","goal-save-time":"quick","goal-eat-healthy":"fit",glp1Journey:"glp1balance"},"meal-types":{"quick-easy-recipes":"quick","quick-easy":"quick","family-style":"family"},"household-size":{kids:"family"},"dietary-preferences":{flexitarian:"chefschoice","mostly-meat":"chefschoice",vegetarian:"veggie",pescatarian:"pescatarian"},"nutrition-preferences":{"low-calorie":"caloriesmart","low-carb":"carbconscious","high-protein":"proteinplus","high-fibre":"fiberfilled",keto:"keto"}},u=function(e){return e?Array.isArray(e)?e:[e]:[]},s=function(e){var n=(0,o.Z)(),t=n===i.Z.US,u=n===i.Z.FJ;return{applyPreferenceMappingForAnswer:(0,r.useCallback)(function(n,r){if((t||u)&&n&&r){var o=l[r],i=null==o?void 0:o[n];i&&(Array.isArray(i)?e.batchUpdatePreferences(i):e.updatePreference(i))}},[t,u,e]),applyPreferenceMappingForAnswers:(0,r.useCallback)(function(n,r){if((t||u)&&r&&0!==n.length){var o=l[r];if(o){var i=[];n.forEach(function(e){var n=o[e];n&&(Array.isArray(n)?i.push.apply(i,function(e){if(Array.isArray(e))return a(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,n){if(e){if("string"==typeof e)return a(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i.push(n))}),i.length>0&&e.batchUpdatePreferences(i)}}},[t,u,e])}},c=function(e,n,t){if(e&&t&&n){var r=l[n],o=null==r?void 0:r[e];o&&"string"==typeof o&&t(o)}},d=function(){var e=(0,o.Z)()===i.Z.US;return(0,r.useCallback)(function(n,t,r){e&&c(n,t,r)},[e])}},52016:function(e,n,t){t.d(n,{Up:function(){return d},bx:function(){return u},mY:function(){return l}});var r=t(90104),o=t.n(r);function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var a=function(e,n){var t=n?"defaultOnMobile":"default",r=e.find(function(e){return!!e[t]});return null==r?void 0:r.preferenceName},l=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===e.length)return[];if(n){if(t)return[];var o=n.split(",");return e.filter(function(e){return o.includes(e.preferenceName)}).map(function(e){return e.preferenceName})}var i=a(e,r);return i?[i]:[]},u=function(e){var n=e.preferences,t=e.maxNumberOfPreferences,r=e.featuredPreset,i=e.preferenceStatusIsDefault,l=e.presetsCookie,u=e.isMobile,s=e.preferencesFromCartService,c=e.preferenceFromURLSearchParams,d=void 0===l,f=""===l;if(0===n.length||i&&d)return[];if(!d&&!f&&l)return null==l?void 0:l.split(",");var p=o()(s);if(f&&p)return[];if(r&&d){var v=null==r?void 0:r.split(",");return t&&v.length>t?v.slice(0,-1):v}if(!p&&void 0!==s)return s;if("string"==typeof c)return[c];var h=a(n,u);return h?[h]:[]},s=function(e,n){var t,r,o,a=null===(r=e.product)||void 0===r?void 0:r.handle;if(a){var l=(function(e){if(Array.isArray(e))return e}(t=null==a?void 0:a.split("-"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),3!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,3)||function(e,n){if(e){if("string"==typeof e)return i(e,3);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,3)}}
1(t,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[2];return null===(o=n.find(function(e){return e.maxDefault<Number(l)}))||void 0===o?void 0:o.handle}},c=function(e){var n=e.firstPreference,t=e.productCtx,r=e.multiplePreferences;return n===s(t,e.presets)?null==r?void 0:r.maxDefaultFallbackPreference:n},d=function(e){var n=e.selectedPreferences,t=e.preferences,r=e.multiplePreferences,o=e.productCtx,i=e.presets,a=n[0];if(0===n.length)return t[0].preferenceName;if(!(null==r?void 0:r.preferencesPriorities))return c({firstPreference:a,productCtx:o,multiplePreferences:r,presets:i});var l="",u=!0,s=!1,d=void 0;try{for(var f,p=(null==r?void 0:r.preferencesPriorities)[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var v=function(){var e=f.value;if(l=n.find(function(n){return n===e})||"")return"break"}();if("break"===v)break}}catch(e){s=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(s)throw d}}return l||(l=c({firstPreference:a,productCtx:o,multiplePreferences:r,presets:i})),c({firstPreference:l,productCtx:o,multiplePreferences:r,presets:i})}},341698:function(e,n,t){function r(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}t.d(n,{E$:function(){return f},WN:function(){return u},YB:function(){return o},_d:function(){return i},bn:function(){return a},jh:function(){return d},xx:function(){return l}});var o=function(e,n){return(null==e?void 0:e.find(function(e){return e.handle===n}))||null},i=function(e,n,t){var r=e.sort(function(e){return e.specs.size});return r.find(function(e){return e.specs.size===n&&e.specs.meals===t})||r[0]},a=function(e,n){var t=o(e,n);return null==t?void 0:t.specs.meals},l=function(e,n,t){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=function(e){if(Array.isArray(e))return e}(o=t.split("-"))||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),2!==i.length);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(o,2)||function(e,n){if(e){if("string"==typeof e)return r(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,2)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],u=a[1];return"".concat(e.toUpperCase(),"-").concat(n,"-").concat(u,"-").concat(l,"-").concat(i)},u=function(e,n,t){var r=e;return t&&(r=e.filter(function(e){var r="meals"===n?"size":"meals";return e.specs[r]===t[r]})),s(r,n)},s=function(e,n){return e.map(function(e){return e.specs[n]}).sort(function(e,n){return e-n}).filter(c).map(function(e){return{value:e,label:e}})},c=function(e,n,t){return t.indexOf(e)===n},d=function(e,n){return e.reduce(function(e,t){return Math.abs(t.value-n)<Math.abs(e.value-n)?t:e}).value},f=function(e){var n=e.initialProducts,t=e.includeSkus;return t?null==n?void 0:n.filter(function(e){return t.indexOf(e.handle)>-1}):n}},928698:function(e,n,t){t.d(n,{t:function(){return r}});var r=function(e){return e.isValid?e.code:""}},428637:function(e,n,t){var r=t(687800);function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}function i(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}
1)(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}t(827378),n.Z=function(e){var n=e.title,t=e.titleId,a=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(e,["title","titleId"]);return(0,r.BX)("svg",i(o(i(o({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:n?"img":"graphics-symbol",color:"inherit","aria-hidden":!n},!n&&{focusable:!1}),{"aria-labelledby":t}),a),{children:[n?(0,r.tZ)("title",{id:t,children:n}):null,(0,r.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.667 4.06 5.36 12.37 2 9.01l1.06-1.06 2.299 2.298L12.607 3l1.06 1.06Z",fill:"currentColor"})]}))}}}]);

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.