"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[228],{449225:function(e,t,r){r.d(t,{vr:function(){return w},co:function(){return j},RA:function(){return P}});var n,o,i,u=r(456552),c=r(865051),l=r(74186),a=r(221527),s=r(951730),f=function(e,t){var r=e.productIds,n=e.voucherCode;return{query:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({productIds:Array.isArray(r)?null==r?void 0:r.join(","):r,voucherCode:n||"",hfCountryCode:(null==t?void 0:t.toUpperCase())||""},e.zipCode&&{zipCode:e.zipCode}),parentSpan:e.parentSpan}};function d(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){d(i,n,o,u,c,"next",e)}function c(e){d(i,n,o,u,c,"throw",e)}u(void 0)})}}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function h(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function v(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var m=(n=p(function(e,t){var r,n,o,i=arguments;return v(this,function(u){switch(u.label){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:c.Z,n=e.systemCountry,[4,r("/calculate/batch",t,{method:"POST",data:b(y({},o=h(e,["systemCountry"])),{country:n.toUpperCase()}),parentSpan:o.parentSpan})];case 1:return[2,u.sent().json()]}})}),function(e,t){return n.apply(this,arguments)}),g=(o=p(function(e,t){var r,n,o,i=arguments;return v(this,function(u){switch(u.label){case 0:if(r=i.length>2&&void 0!==i[2]?i[2]:c.Z,n=e.systemCountry,o=h(e,["systemCountry"]),!n||!o.productIds||!o.productIds.length)throw Error("Missing required params");u.label=1;case 1:return u.trys.push([1,3,,4]),[4,r("/calculate/prospect/batch",t,y({},f(o,n)))];case 2:return[2,u.sent().json()];case 3:throw u.sent();case 4:return[2]}})}),function(e,t){return o.apply(this,arguments)}),O=(i=p(function(e,t){var r,n,o,i=arguments;return v(this,function(u){switch(u.label){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:c.Z,n=e.systemCountry,[4,r("/calculate",t,{method:"POST",data:b(y({},o=h(e,["systemCountry"])),{country:n.toUpperCase()}),parentSpan:o.parentSpan})];case 1:return[2,u.sent().json()]}})}),function(e,t){return i.apply(this,arguments)}),w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=(0,a.O)(),o=[s.Z["calculate.calculatePrices"],e];return(0,u.useQuery)(o,function(){return O(y({},e,n),o,r)},t)},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=(0,a.O)(),o=[s.Z["calculate.calculatePrices"],e];return(0,u.useQuery)(o,function(){return m(y({},e,n),o,r)},t)},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=(0,a.O)(),o=[s.Z["calculate.calculatePrices"],e];return(0,u.useQuery)(o,function(){return g(y({},e,n),o,r)},t)}},486570:function(e,t,r){r.d(t,{P:function(){return f}});var n,o,i=r(865051),u=r(74186),c=r(456552),l=r(951730);function a(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}var s=(n=function(e,t){var r,n,o,u=arguments;return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(c){switch(c.label){case 0:if(r=u.length>2&&void 0!==u[2]?u[2]:i.Z,n=e.id,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["id"]),!n)return[2,null];return[4,r("/cart/".concat(n),t,{parentSpan:o.parentSpan})];case 1:return[2,c.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function u(e){a(i,r,o,u,c,"next",e)}function c(e){a(i,r,o,u,c,"throw",e)}u(void 0)})},function(e,t){return o.apply(this,arguments)}),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,u.Z)().fetch,n=[l.Z["cart.byId"],e];return(0,c.useQuery)(n,function(){return s(e,n,r)},t)}},286055:function(e,t,r){r.d(t,{m:function(){return v}});var n,o,i=r(827378),u=r(456552),c=r(566158),l=r(601e3),a=r(865051),s=r(74186),f=r(221527),d=r(951730);function p(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var h=(n=function(e,t){var r,n,o,i,u=arguments;return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(c){switch(c.label){case 0:return r=u.length>2&&void 0!==u[2]?u[2]:a.Z,n=e.systemCountry,o=e.locale,i=e.parentSpan,[4,r("/cart/items",t,{method:"POST",query:{country:n,locale:o},data:b(y({},function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["systemCountry","locale","parentSpan"])),{country:n}),parentSpan:i})];case 1:return[2,c.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function u(e){p(i,r,o,u,c,"next",e)}function c(e){p(i,r,o,u,c,"throw",e)}u(void 0)})},function(e,t){return o.apply(this,arguments)}),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,u.useQueryClient)(),r=(0,f.O)(),n=(0,s.Z)().fetch,o=(0,i.useRef)(),a=(0,c.T)();return(0,u.useMutation)(function(e){var t;if(o.current=a.startSpan("data-access.create-cart"),o.current.setAttribute("voucherCode",e.voucher||"undefined"),null==e?void 0:null===(t=e.items)||void 0===t?void 0:t.length){var i,u,c,l,s=null===(i=e.items)||void 0===i?void 0:i[0],f=(null===(u=s.metadata)||void 0===u?void 0:u.presets)||[];o.current.setAttribute("sku",s.sku),o.current.setAttribute("mealsPreset",(null===(c=s.metadata)||void 0===c?void 0:c.mealsPreset)||"undefined"),o.current.setAttribute("productFamily",(null===(l=s.metadata)||void 0===l?void 0:l.productFamily)||"undefined"),o.current.setAttribute("presets",f.join("|")),o.current.setAttribute("presetsCount",f.length)}return h(y({},e,r),[d.Z["cart.createCart"]],n)},b(y({},e),{onSuccess:function(r,n,i){var u=[d.Z["cart.byId"],{id:r.id}];t.setQueryData(u,r),o.current&&(o.current.setAttribute("cartId",r.id),o.current.end()),"function"==typeof e.onSuccess&&e.onSuccess(r,n,i)},onError:function(t,r,n){o.current&&(o.current.setStatus({message:t.message,code:l.Z.ERROR}),o.current.end()),"function"==typeof e.onError&&e.onError(t,r,n)}}))}},635261:function(e,t,r){r.d(t,{m:function(){return j}});var n,o,i=r(827378),u=r(456552),c=r(567921),l=r.n(c),a=r(686677),s=r(865051),f=r(74186),d=r(254156),p=r(624234),y=r(221527),b=r(951730),h=function(e){var t=e.voucherCode,r=e.productSkus,n=e.locale,o=e.systemCountry,i=e.discountCommunicationId;return[b.Z["price-presentation.discountCommunication"],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({voucherCode:t,productSkus:r,locale:n,systemCountry:o},i&&{discountCommunicationId:i})]};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function m(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var w=(n=function(e,t){var r,n,o,i,u,c,l,a=arguments;return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(f){switch(f.label){case 0:return r=e.voucherCode,n=e.productSkus,o=e.systemCountry,i=e.locale,u=e.parentSpan,c=e.discountCommunicationId,l=e.zipcode,[4,(a.length>2&&void 0!==a[2]?a[2]:s.Z)("/price-presentation/discount_communication/voucher/".concat(r),t,{query:{country:o,locale:i,skus:n.join(","),dc_id:c||"",zipcode:l||""},parentSpan:u,fetchSpanAttributes:{discountCommunicationId:c,voucherCode:r}})];case 1:return[2,f.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function u(e){m(i,r,o,u,c,"next",e)}function c(e){m(i,r,o,u,c,"throw",e)}u(void 0)})},function(e,t){return o.apply(this,arguments)}),j=function(e,t){var r,n,o=(0,a.useRouter)().query.discount_comm_id,c=(0,p.Z)("web_pricing_experience_pass_zipcode"),s=c.isEnabled,b=c.isReady,m=(function(e){if(Array.isArray(e))return e}(r=(0,d.Z)("hf_prefill_zipcode")||[""])||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(r,1)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}(r,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],j=(0,i.useMemo)(function(){return l().get("hf_discount_comm_id")},[]),P=(Array.isArray(o)?o[0]:o)||j||e.discountCommunicationId,S=(0,f.Z)().fetch,k=g(O(g({},e,(0,y.O)()),{discountCommunicationId:P}),s&&m&&{zipcode:m}),x=h(k);return(0,u.useQuery)(x,function(){return w(k,x,S)},O(g({},t),{enabled:b&&(null===(n=null==t?void 0:t.enabled)||void 0===n||n)}))}},152085:function(e,t,r){r.d(t,{D:function(){return d}});var n,o,i=r(456552),u=r(865051),c=r(74186),l=r(221527),a=r(951730);function s(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}var f=(n=function(e,t){var r,n,o,i=arguments;return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(c){switch(c.label){case 0:if(r=i.length>2&&void 0!==i[2]?i[2]:u.Z,n=e.parentSpan,!(o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["parentSpan"])).code)return[2,{}];return[4,r("/vouchers/".concat(o.code),t,{method:"GET",query:{country:o.systemCountry,locale:o.locale},parentSpan:n,fetchSpanAttributes:{voucherCode:o.code}})];case 1:return[2,c.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function u(e){s(i,r,o,u,c,"next",e)}function c(e){s(i,r,o,u,c,"throw",e)}u(void 0)})},function(e,t){return o.apply(this,arguments)}),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,c.Z)().fetch,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,(0,l.O)()),o=[a.Z["voucher.info"],n];return(0,i.useQuery)(o,function(){return f(n,o,r)},t)}},897681:function(e,t,r){r.d(t,{ZP:function(){return Z},iQ:function(){return x}});var n=r(687800),o=r(827378),i=r(567921),u=r.n(i),c=r(486570),l=r(686677),a=r(718583),s=r(566158),f=r(601e3),d=r(286055),p=r(818892),y=r(969860),b=r(449279),h=function(){var e,t,r=(0,l.useRouter)(),n=r.query.isFromPlanRecommendation,o=r.query.preferenceStatus,i=r.query.featured;return{shouldUsePresetFromQuery:"true"===n&&"selected"===o,presetsFromQuery:(null==i?void 0:null===(t=i.split(":"))||void 0===t?void 0:null===(e=t[1])||void 0===e?void 0:e.split(","))||[]}};function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var m=function(){var e,t,r=(0,l.useRouter)(),n=(0,s.T)(),i=(0,y.Sc)(),c=i.defaultMealsPreset,m=i.defaultPresets,g=i.defaultPresetByDiscountCommId,O=(0,d.m)().mutate,w=function(e){if(Array.isArray(e))return e}(e=(0,o.useState)(null))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}(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.")}(),j=w[0],P=w[1],S=null!==(t=(0,o.useMemo)(function(){return a.ZP.getItem("StoredCouponCode")},[]))&&void 0!==t?t:"",k=r.query.c||S,x=g[r.query.discount_comm_id],Z=h(),C=Z.shouldUsePresetFromQuery,_=Z.presetsFromQuery,A=(0,b.r)();return{createCartData:j,createCart:(0,o.useCallback)(function(e,t){var r=n.startSpan("cart-provider.create-cart");e&&t&&O({voucher:k,items:[{quantity:1,sku:e,metadata:{mealsPreset:C?A(_,e):c,timestamp:Date.now(),presets:x||m,productFamily:t||""}}]},{onSuccess:function(t){r.setStatus({message:"cart created",code:f.Z.OK}),r.end(),P(t),u().set(p.Hc,e),u().set(p.KQ,t.id,{expires:30})},onError:function(e){r.setStatus({message:e.message,code:f.Z.ERROR}),r.end()}})},[c,m,O,P,n,k])}},g=r(764688),O=r(546795);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var j=function(e,t){var r,n=function(e){if(Array.isArray(e))return e}(r=(0,o.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(r,2)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(e,t)}}(r,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.")}(),i=n[0],u=n[1];(0,o.useEffect)(function(){var r=function(){"visible"===document.visibilityState&&e&&i?(t(),u(!1)):u(!0)};return document.addEventListener("visibilitychange",r),function(){return document.removeEventListener("visibilitychange",r)}},[e,t,i])};function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}}(e,t)||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 k=(0,o.createContext)({}),x=function(){return(0,o.useContext)(k)},Z=function(e){var t,r,i=e.children,l=(0,g.Z)(),a=l.planFamily,s=l.defaultSku,f=m(),d=f.createCartData,y=f.createCart,b=S((0,o.useState)(null),2),h=b[0],v=b[1],w=S((0,o.useState)(null),2),P=w[0],x=w[1],Z=(0,c.P)({id:h},{suspense:!1,enabled:!!h}),C=Z.data,_=Z.refetch;j(h,_),(0,o.useEffect)(function(){h||v(u().get(p.KQ))},[h]),(0,o.useEffect)(function(){void 0===h&&s&&(null==a?void 0:a.handle)&&y(s,a.handle)},[h,P,s,null==a?void 0:a.handle,y]),(0,o.useEffect)(function(){if(C){if((null==a?void 0:a.children)&&a.children.length>0){var e=a.children.find(function(e){var t,r;return e.handle===(null===(r=C.items)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.sku)});u().set("hf_selected_product_name",(null==e?void 0:e.name)||""),u().set("hf_selected_product_price","".concat((null==e?void 0:e.price)||0))}x(C),v(C.id)}},[C,null==a?void 0:a.children]),(0,o.useEffect)(function(){d&&(x(d),v(d.id))},[d]);var A=S((0,o.useState)(!1),2),E=A[0],I=A[1],D=function(){return I(function(e){return!e})};return(0,n.tZ)(O.Z,{scope:"cartProvider",children:(0,n.tZ)(k.Provider,{value:P?(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},P),r=r={isCartOpen:E,toggleCartOpen:D},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t):{isCartOpen:E,toggleCartOpen:D},children:i})})}},969860:function(e,t,r){function n(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}r.d(t,{Gi:function(){return u},Sc:function(){return c}});var o,i=(0,r(567942).Z)("hf.funnel.cart",(o=function(){return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(e){switch(e.label){case 0:return[4,r.e(21342).then(r.bind(r,921342))];case 1:return[2,e.sent().config]}})},function(){var e=this,t=arguments;return new Promise(function(r,i){var u=o.apply(e,t);function c(e){n(u,r,i,c,l,"next",e)}function l(e){n(u,r,i,c,l,"throw",e)}c(void 0)})})),u=i.ProjectConfigProvider,c=(i.configMiddleware,i.useConfig)},818892:function(e,t,r){r.d(t,{Hc:function(){return o},KQ:function(){return n},Z9:function(){return i}});var n="hf_cart_id",o="hf_ssr_stored_sku",i="thermomixActive"},764688:function(e,t,r){var n=r(827378),o=r(718583),i=r(101518),u=r(479231),c=r(862197),l=r(566158),a=r(625821),s=r(897681),f=r(818892),d=r(967083);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}}(e,t)||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 b=function(e,t){if(t&&(t.config.familyName===e||t.config.thermomixFamilyName===e))return t};t.Z=function(){var e,t,r,p,h,v=(0,c.o)(),m=(0,i.Z)(),g=(0,l.T)(),O=y((0,a.Z)(),1)[0],w=(0,s.iQ)(),j="1"===v.hf_ssr_e_gift_card_checkout,P=m===u.Z.US&&"1"===v.hf_ssr_e_plans_config_is_freebie,S=(0,n.useRef)(g.startSpan("fetch-plans-config-with-product-family-handle")),k=(null==O?void 0:O.familyHandle)||(null==w?void 0:null===(r=w.items)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:null===(e=t.metadata)||void 0===e?void 0:e.productFamily),x=(0,d.Z)(),Z=x.data,C=x.isFetching,_=x.isSuccess,A=(0,n.useMemo)(function(){if(_&&k)return b(k,Z)},[_,k,Z]);(0,n.useEffect)(function(){if(_&&"__NULL__"!==k){var e,t;null===(e=S.current)||void 0===e||e.setAttributes({productFamily:k,plansConfigProductFamilyAvailable:!!A,isGiftCard:j,freebie:P}),null===(t=S.current)||void 0===t||t.end(),S.current=null}},[S,_,P,j,A,k]);var E=null==A?void 0:A.plans,I=null==A?void 0:A.plans[0],D=null==A?void 0:null===(p=A.plans)||void 0===p?void 0:p[1],T=(null==A?void 0:A.config.preferences)||[],F=(null==A?void 0:A.config.defaultSku)||"",R=(null==A?void 0:A.preferences)||[],M=null==A?void 0:A.config.multiplePreferences,z=null==I?void 0:I.children.map(function(e){return e.handle}),q=(null==D?void 0:D.children.map(function(e){return e.handle}))||[],Q=q?null==z?void 0:z.concat(q):z,U=null==A?void 0:A.config.thermomixFamilyName;U&&E&&(h=E.find(function(e){return e.handle===U}));var W=!!U&&"true"===o.ZP.getItem(f.Z9),X=y(null==F?void 0:F.split("-"),4),N=X[2],L=X[3],B=Number(N)||3,G=Number(L)||2,V=(null==M?void 0:M.maxNumberOfPreferences)||6;return{defaultSku:F,defaultMeals:B,defaultSize:G,isFetching:C,isPlansConfigFetched:_,isProductFamilyDone:_&&"__NULL__"!==k,multiplePreferences:M,planFamily:W?h:I,preferences:T,presets:R,products:z,thermomixProducts:q,classicAndThermomixProducts:Q,plansConfigThermomixPlan:h,MAX_NUM_OF_PRESETS:V,plansConfigProductFamily:A,productFamily:k}}},449279:function(e,t,r){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{r:function(){return l}});var o=function(e,t){var r,o,i=(function(e){if(Array.isArray(e))return e}(r=null==e?void 0:e.split("-"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(r,3)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}}(r,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=t.find(function(e){return e.maxDefault<Number(i)}))||void 0===o?void 0:o.handle},i=function(e){var t=e.firstPreference,r=e.sku,n=e.multiplePreferences;return t===o(r,e.presets)?null==n?void 0:n.maxDefaultFallbackPreference:t},u=function(e){var t=e.selectedPreferences,r=e.preferences,n=e.multiplePreferences,o=e.sku,u=e.presets,c=t[0];if(0===t.length)return null==r?void 0:null===(d=r[0])||void 0===d?void 0:d.preferenceName;if(!(null==n?void 0:n.preferencesPriorities))return i({firstPreference:c,sku:o,multiplePreferences:n,presets:u});var l="",a=!0,s=!1,f=void 0;try{for(var d,p,y=(null==n?void 0:n.preferencesPriorities)[Symbol.iterator]();!(a=(p=y.next()).done);a=!0){var b=function(){var e=p.value;if(l=t.find(function(t){return t===e})||"")return"break"}();if("break"===b)break}}catch(e){s=!0,f=e}finally{try{a||null==y.return||y.return()}finally{if(s)throw f}}return l||(l=i({firstPreference:c,sku:o,multiplePreferences:n,presets:u})),i({firstPreference:l,sku:o,multiplePreferences:n,presets:u})},c=r(764688),l=function(){var e=(0,c.Z)(),t=e.preferences,r=e.multiplePreferences,n=e.presets;return function(e,o){return u({selectedPreferences:e,sku:o,preferences:t,multiplePreferences:r,presets:n})}}},868072:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(687800),o=r(827378),i=r(567921),u=r.n(i),c=r(779264),l=r(254725),a=r(308043),s=r(635261),f=r(897681),d=r(661771),p=r(236294),y=r(862197),b=function(e){var t,r,i,b,h,v,m,g,O,w,j=e.voucherCode,P=(0,d.Ds)().isFreeAddonOfferDetailsSecondaryStyle,S=(0,p.Z)({voucherCode:j}),k=S.lifetimeVoucherInfo,x=S.multiWeekVoucherInfo,Z=!!(null==k?void 0:k.isEligible),C=o.useMemo(function(){return"1"===u().get("hf_ssr_e_gift_card_purchase")},[]),_=(0,y.o)().hf_ssr_single_page_checkout,A=null==_?void 0:_.toLowerCase().startsWith("variation"),E=(0,f.iQ)(),I=(null==E?void 0:null===(g=E.items)||void 0===g?void 0:null===(m=g[0])||void 0===m?void 0:m.sku)||"",D=j||(null==E?void 0:E.voucher)||"",T=(0,s.m)({productSkus:[I],voucherCode:D},{enabled:!!D&&!!I,suspense:!1}).data,F=(0,a.ZP)("checkout").translate,R=(null==T?void 0:null===(O=T.presets)||void 0===O?void 0:O[I].funnel_cart_summary_free_addon_title)||"",M=(null==T?void 0:null===(w=T.presets)||void 0===w?void 0:w[I].funnel_cart_summary_free_addon_text)||"",z=(b=(t={isFreeAddonOfferDetailsSecondaryStyle:P,isSinglePageCheckout:A}).isFreeAddonOfferDetailsSecondaryStyle,h=t.isSinglePageCheckout,v={backgroundColor:"primary.200",paddingX:"xs",titleTextType:"body-md-regular",subtitleTextType:"body-sm-regular",subtitleColor:"neutral.700"},b?{backgroundColor:"primary.100",paddingX:"sm-2",titleTextType:"body-md-bold",subtitleTextType:void 0,subtitleColor:"neutral.600"}:h?(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},v),i=i={backgroundColor:"shared-alias.positive.background.light"},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r):v);return C?null:R||M?(0,n.BX)(c.Z,{"data-test-id":"free-add-on-text",display:"flex",flexDirection:"column",backgroundColor:z.backgroundColor,paddingX:z.paddingX,paddingY:"xs",mb:"sm-1",borderRadius:"border-radius-sm",children:[R&&(0,n.BX)(c.Z,{display:"flex",justifyContent:"space-between",mb:"xxs",children:[(0,n.tZ)(l.Z,{type:z.titleTextType,children:R}),(0,n.tZ)(l.Z,{type:"body-md-bold",color:"primary.600",children:F("checkout.summary.freeAddOn-free")})]}),M&&(0,n.tZ)(l.Z,{type:z.subtitleTextType,color:z.subtitleColor,children:M})]}):x.isEligible&&(null==x?void 0:x.numberOfWeeks)?(0,n.BX)(c.Z,{"data-test-id":"free-add-on-text",display:"flex",flexDirection:"column",backgroundColor:z.backgroundColor,paddingX:z.paddingX,paddingY:"xs",mb:"sm-1",borderRadius:"border-radius-sm",children:[(0,n.BX)(c.Z,{display:"flex",justifyContent:"space-between",mb:"xxs",children:[(0,n.tZ)(l.Z,{type:z.titleTextType,children:F("checkout.summary.freeAddOn-title-mwd",{numOfWeeks:null==x?void 0:x.numberOfWeeks})}),(0,n.tZ)(l.Z,{type:"body-md-bold",color:"primary.600",children:F("checkout.summary.freeAddOn-free")})]}),(0,n.tZ)(l.Z,{type:z.subtitleTextType,color:z.subtitleColor,children:F("checkout.summary.freeAddOn-subtitle-mwd",{numOfFreeWeeks:null==x?void 0:x.numberOfWeeks})})]}):Z?(0,n.BX)(c.Z,{"data-test-id":"free-add-on-text",display:"flex",flexDirection:"column",backgroundColor:z.backgroundColor,paddingX:z.paddingX,paddingY:"xs",mb:"sm-1",borderRadius:"border-radius-sm",children:[(0,n.BX)(c.Z,{display:"flex",justifyContent:"space-between",mb:"xxs",children:[(0,n.tZ)(l.Z,{type:z.titleTextType,children:F("checkout.summary.freeAddOn-title")}),(0,n.tZ)(l.Z,{type:"body-md-bold",color:"primary.600",children:F("checkout.summary.freeAddOn-free")})]}),(0,n.tZ)(l.Z,{type:z.subtitleTextType,color:z.subtitleColor,children:F("checkout.summary.freeAddOn-subtitle")})]}):null},h=function(e){var t=e.voucherCode;return(0,n.tZ)(d.a,{children:(0,n.tZ)(b,{voucherCode:t})})}},661771:function(e,t,r){function n(e,t,r,n,o,i,u){try{var c=e[i](u),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}r.d(t,{Ds:function(){return c},a:function(){return u}});var o,i=(0,r(567942).Z)("hf.free-addon",(o=function(){return function(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(e){return[2,r.e(20525).then(r.bind(r,820525))]})},function(){var e=this,t=arguments;return new Promise(function(r,i){var u=o.apply(e,t);function c(e){n(u,r,i,c,l,"next",e)}function l(e){n(u,r,i,c,l,"throw",e)}c(void 0)})})),u=i.ProjectConfigProvider,c=(i.configMiddleware,i.useConfig)},236294:function(e,t,r){var n=r(914043);t.Z=function(e){var t,r=e.voucherCode,o=(0,n.Z)({voucherCode:null!=r?r:""}),i=o.isFreeAddonVoucher,u=o.freeAddonVoucherDetails;if(!i)return{lifetimeVoucherInfo:{isEligible:!1},multiWeekVoucherInfo:{isEligible:!1,numberOfWeeks:0}};var c=!!i&&!!(null==u?void 0:u.isLifetime),l=i&&!c&&!!(null==u?void 0:u.numOfFreeWeeks);return{lifetimeVoucherInfo:{isEligible:!l&&c},multiWeekVoucherInfo:{isEligible:l,numberOfWeeks:null!==(t=null==u?void 0:u.numOfFreeWeeks)&&void 0!==t?t:0}}}},914043:function(e,t,r){var n=r(827378),o=r(686677),i=r(718583),u=r(152085),c=r(589233);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],u=!0,c=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(c)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.Z=function(e){var t,r=e.voucherCode,l=a((0,n.useState)(!1),2),s=l[0],f=l[1],d=a((0,n.useState)({}),2),p=d[0],y=d[1],b=(0,o.useRouter)().query,h=(0,n.useMemo)(function(){return i.ZP.getItem("StoredCouponCode")},[]),v=null!==(t=r||b.c||h)&&void 0!==t?t:"",m=(0,u.D)({code:v},{suspense:!1}),g=m.data,O=m.isFetched;return(0,n.useEffect)(function(){var e,t,r=null==g?void 0:null===(t=g.discount_settings)||void 0===t?void 0:null===(e=t.additional_discounts)||void 0===e?void 0:e.find(function(e){return e.benefit_category===c.xo}),n=Object.keys((null==r?void 0:r.box_rule)||{}).length,o=(null==r?void 0:r.lifetime)===c.mu;f(!!r),y({isLifetime:o,numOfFreeWeeks:n})},[null==g?void 0:g.discount_settings]),{isFreeAddonVoucher:s,freeAddonVoucherDetails:p,voucherInfoFetched:O}}},456409:function(e,t,r){var n=r(687800),o=r(827378),i=r(72344),u=r(727650),c=r(566158),l=r(165218),a=r.n(l)()(function(){return Promise.resolve().then(r.bind(r,72344))},{loadableGenerated:{webpack:()=>[null]},ssr:!1});t.Z=function(e){var t=e.hasMarkdown,r=e.copy,l=e.markdownOptions,s=e.noSSR,f=e.allowedAttrs,d=(0,c.T)(),p=(0,u.sanitize)(r,{ADD_ATTR:void 0===f?[]:f});return((0,o.useEffect)(function(){if(r!==p){var e=d.startSpan("sanitize-content-libray");e.setAttributes({"sanitize-content-libray":!0,"sanitize-error-detected":r!==p,"sanitize-message":"HTML content has been sanitized. Please check the content to ensure it is safe.","sanitize-original-content":r,"sanitize-sanitized-content":p}),e.end()}},[r,p,d]),t)?s?(0,n.tZ)(a,{options:l,children:p}):(0,n.tZ)(i.default,{options:l,children:p}):(0,n.tZ)(n.HY,{children:p})}},74138:function(e,t,r){r.d(t,{ZP:function(){return m}});var n=r(687800);r(827378);var o=r(438579),i=r.n(o),u=r(788141),c=r(38246),l=r(546795),a=r(366416);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}}(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 d=r(566158),p=r(624234);function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var h=function(e){switch(e){case u.Z.hellofresh:return"https://img.hellofresh.com";case u.Z.greenchef:return"https://images.greenchef.com";case u.Z.everyplate:return"https://images.everyplate.com";default:return"https://img.hellofresh.com"}},v=function(e){e.height;var t=e.fetchFormat,r=e.crop,n=e.flags,o=e.root,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["height","fetchFormat","crop","flags","root"]);return function(e){var u,c=e.src,l=e.width,s=e.quality,d=Object.keys(u=b(y({},i),{width:l,quality:s||"auto",fetchFormat:t||"auto",crop:r||"limit",flags:n||"lossy"})).reduce(function(e,t){if(t in a.t){if("flags"===t){var r=a.t.flags,n=Array.isArray(u.flags)?u.flags.map(function(e){return"".concat(r).concat(e)}).join(","):"".concat(r).concat(u.flags);return f(e).concat([n])}return f(e).concat(["".concat(a.t[t]).concat(u[t])])}return e},[]).join(",");return"".concat(o,"/").concat(d).concat(c)}},m=function(e){var t=(0,c.Z)(),r=(0,d.T)(),o=(0,p.Z)("web_all-pages_web-foundation_imagekit-poc").isEnabled,u=!!o||.01>Math.random(),a=o?"https://ik.imagekit.io/greenchef":h(t),s=v(y({root:a},e));return(0,n.tZ)(l.Z,{scope:"next-image",fallback:(0,n.tZ)(n.HY,{}),level:"warning",children:(0,n.tZ)(i(),b(y({loader:s},e),{onError:function(n){var i=e.fallbacksrc;if(i){var c=e.width,l=e.quality,f=s({src:i,width:Number(c),quality:l?Number(l):l});f!==n.currentTarget.src&&(n.currentTarget.srcset="",n.currentTarget.src=f)}if("function"==typeof e.onError&&e.onError(n),u){var d=r.startSpan("libs-image-error"),p="string"==typeof e.src?e.src:"statically imported image";d.setAttributes({root:a,src:p,brand:t,id:e.id,width:e.width,height:e.height,loading:e.loading,provider:o?"imagekit":"cloudinary"}),d.end()}}}))})}},366416:function(e,t,r){r.d(t,{b:function(){return o},t:function(){return i}}),(n=o||(o={})).cloudfront="cloudfront",n.website="website";var n,o,i={width:"w_",height:"h_",crop:"c_",gravity:"g_",background:"b_",x:"x_",y:"y_",aspectRatio:"ar_",radius:"r_",opacity:"o_",effect:"e_",flags:"fl_",overlay:"l_",zoom:"z_",fetchFormat:"f_",quality:"q_",angle:"a_",border:"bo_",color:"co_"}},357933:function(e,t,r){var n=r(366416),o=r(788141),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.b.cloudfront;if(t===n.b.cloudfront){var r=e.split(/\//);return r.splice(0,4),"/hellofresh_s3/".concat(r.join("/"))}var o=e.split(/\//);return o.splice(0,3),"/hellofresh_website/".concat(o.join("/"))};t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.b.cloudfront;if(!RegExp("^http(s)?.").test(e)&&t===n.b.cloudfront)return e.startsWith("/")?"/hellofresh_s3".concat(e):"/hellofresh_s3/".concat(e);try{var r=new URL(e);if(r.hostname.includes("cloudfront"))return i(e,n.b.cloudfront);if(Object.keys(o.Z).some(function(e){return r.hostname.includes("cdn.".concat(e,".com"))})||r.hostname.includes("hf-website-live.s3-eu-west-1.amazonaws.com")||r.hostname.includes("hf-website-live.s3.eu-west-1.amazonaws.com"))return i(e,n.b.website);return r.pathname}catch(t){return e}}},104064:function(e,t,r){var n=r(687800);r(827378),t.Z=function(e){var t,r,o=e.title,i=e.titleId,u=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",color:"inherit","aria-labelledby":i},u),r=r={children:[o?(0,n.tZ)("title",{id:i,children:o}):null,(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm-1.348-3.46 5.48-5.48L11.072 5l-4.42 4.42L5.06 7.827 4 8.89l2.652 2.652Z",fill:"currentColor"})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},499782:function(e,t,r){var n=r(687800);r(827378),t.Z=function(e){var t,r,o=e.title,i=e.titleId,u=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",color:"inherit","aria-labelledby":i},u),r=r={children:[o?(0,n.tZ)("title",{id:i,children:o}):null,(0,n.tZ)("path",{d:"M8 3.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM7.25 12.5v-6h1.5v6h-1.5Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z",fill:"currentColor"})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},565079:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(687800);r(827378);var o=r(84176),i=[{prop:"variant",variants:{horizontal:{borderTopColor:"components.divider.color.border",borderTopWidth:"components.divider.border-width.default",borderTopStyle:"solid"},vertical:{borderRightColor:"components.divider.color.border",borderRightWidth:"components.divider.border-width.default",borderRightStyle:"solid"}}}],u=function(e){var t=e.variant,r=void 0===t?"horizontal":t,u=e.mx,c=e.my;return(0,n.tZ)(o.Z,{as:"hr",role:"separator","aria-orientation":r,border:"none",variant:r,variants:i,mx:void 0===u?"global.xs":u,my:void 0===c?"global.xs":c})}},625821:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(37017),o=(0,n.cn)({}),i=function(){return(0,n.KO)(o)}}}]);