1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1844],{16265:function(e,t,i){"use strict";var a,n=i(52983);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}t.Z=function(e){return n.createElement("svg",r({viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=n.createElement("path",{d:"m10.862 10.659-.772.772-2.878-2.878a4.35 4.35 0 0 1-2.748.944 4.479 4.479 0 0 1-1.71-.335 4.55 4.55 0 0 1-1.448-.971c-.42-.42-.743-.9-.971-1.442A4.496 4.496 0 0 1 0 5.033c0-.597.112-1.167.335-1.71A4.452 4.452 0 0 1 2.755.912 4.4 4.4 0 0 1 4.464.569c.597 0 1.167.114 1.709.342.547.223 1.03.544 1.45.964.423.419.746.902.97 1.449.228.542.342 1.112.342 1.709a4.35 4.35 0 0 1-.95 2.748l2.877 2.878Zm-8.79-3.24a3.26 3.26 0 0 0 2.392.99 3.26 3.26 0 0 0 2.392-.99 3.249 3.249 0 0 0 .985-2.386c0-.93-.328-1.728-.985-2.393a3.286 3.286 0 0 0-2.392-.984c-.934 0-1.73.328-2.386.984a3.26 3.26 0 0 0-.991 2.393c0 .934.328 1.73.984 2.385Z",fill:"currentColor"})))}},21535:function(e,t,i){"use strict";var a,n=i(52983);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}t.Z=function(e){return n.createElement("svg",r({viewBox:"0 0 9 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=n.createElement("path",{d:"m.5 1 4.033 4 4.033-4",stroke:"currentColor"})))}},88403:function(e,t,i){"use strict";i.d(t,{o:function(){return l}});var a=i(97458);i(52983);var n=i(14517),r=i(35031),s=i(15783);function l(e){let{children:t,variant:i="solid",primaryColor:l}=e,o=(0,n.Z)("border-t border-opacity-40",(0,r.M)("border",null!=l?l:s.bG.CulinistaBlack),{"border-dotted":"dotted"===i});return t?(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:(0,n.Z)("flex-grow",o)}),(0,a.jsx)("div",{className:"helvetica-10-500 mx-1.5 uppercase opacity-40",children:t}),(0,a.jsx)("div",{className:(0,n.Z)("flex-grow",o)})]}):(0,a.jsx)("hr",{className:o})}},10846:function(e,t,i){"use strict";i.d(t,{V:function(){return o}});var a=i(97458),n=i(52983),r=i(55462),s=i(61954),l=i(48095);let o=(0,n.forwardRef)((e,t)=>{let{actionText:i,actionDisabled:n,onActionClick:o,actionClassName:d,loading:c=!1,...u}=e;return(0,a.jsx)(s.j,{ref:t,rightAdornment:(0,a.jsx)("button",{type:"button",disabled:n,className:(0,r.cn)("helvetica-14-500 z-50 px-6 text-ar-culinista-black lg:px-4",{"text-opacity-40":n},d),onClick:o,children:c?(0,a.jsx)(l.U,{}):i}),...u})})},18367:function(e,t,i){"use strict";i.d(t,{F:function(){return g}});var a,n,r,s,l=i(97458),o=i(52983),d=i(55462),c=i(35031),u=i(15783);function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}var m=function(e){return o.createElement("svg",h({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=o.createElement("path",{d:"M15.84 8.191a10 10 0 0 0-.139-1.62H8.154v3.084h4.323a3.636 3.636 0 0 1-1.604 2.423l2.58 2.004c1.516-1.412 2.388-3.468 2.388-5.89Z",fill:"#4280EF"})),n||(n=o.createElement("path",{d:"M8.155 16c2.16 0 3.974-.715 5.298-1.935l-2.58-1.987c-.714.488-1.638.767-2.718.767-2.092 0-3.852-1.412-4.497-3.294l-2.65 2.039A7.992 7.992 0 0 0 8.156 16Z",fill:"#34A353"})),r||(r=o.createElement("path",{d:"M3.658 9.534a4.86 4.86 0 0 1 0-3.067L1.008 4.41a8.01 8.01 0 0 0 0 7.181l2.65-2.057Z",fill:"#F6B704"})),s||(s=o.createElement("path",{d:"M8.155 3.172a4.365 4.365 0 0 1 3.067 1.203l2.284-2.3A7.7 7.7 0 0 0 8.154 0a7.992 7.992 0 0 0-7.146 4.41l2.649 2.057c.645-1.9 2.405-3.295 4.497-3.295Z",fill:"#E54335"})))},p=i(48095),f=i(39957);let g=(0,o.forwardRef)((e,t)=>{let{children:i,className:a,disabled:n,loading:r,primaryColor:s,...o}=e;return(0,l.jsx)("button",{ref:t,type:"button",disabled:n||r,className:(0,d.cn)("helvetica-14-400 inline-flex h-[54px] items-center justify-center border border-opacity-40",(0,c.M)("border",null!=s?s:u.bG.CulinistaBlack),a),...o,children:r?(0,l.jsx)(p.U,{size:"small",primaryColor:s}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(f.k,{icon:(0,l.jsx)(m,{}),size:16,className:"mr-5"}),"Continue with Google"]})})})},30361:function(e,t,i){"use strict";var a,n,r,s,l,o;i.d(t,{$e:function(){return a},Bq:function(){return r},Ym:function(){return n}}),(s=a||(a={})).Payment="payment",s.Confirmation="confirmation",s.GatheringMenuSelection="gathering-menu-selection",s.CookingClassesMenuSelection="cooking-classes-menu-selection",s.MenuCustomization="menu-customization",s.CookingClassesMenuCustomization="cooking-classes-menu-customization",s.GatheringDetails="gathering-service-details",s.CookingClassesDetails="cooking-classes-service-details",s.GatheringServiceSettings="gathering-service-sett
1ings",s.CookingClassesServiceSettings="cooking-classes-service-settings",s.GatheringPaymentLoggedIn="gathering-payment-logged-in",s.CookingClassesPaymentLoggedIn="cooking-classes-payment-logged-in",s.MealPrepServiceSettings="meal-prep-service-settings",s.DishSelection="dish-selection",s.MealPrepDetails="meal-prep-details",s.MealPrepPaymentLoggedIn="meal-prep-payment-logged-in",s.MealPrepPaymentLoggedInUpdate="meal-prep-payment-logged-in-update",s.MealPrepConfirmation="meal-prep-confirmation",s.MealPrepConfirmationLoggedIn="meal-prep-confirmation-logged-in",(l=n||(n={})).DetailsHeading="details-heading",l.DetailsDescription="details-description",l.PaymentHeading="payment-heading",l.PaymentDescription="payment-description",l.PaymentLoggedInHeading="payment-logged-in-heading",l.GatheringPaymentLoggedInDescription="gathering-payment-logged-in-description",l.MealPrepPaymentLoggedInDescription="meal-prep-payment-logged-in-description",l.HouseholdPreferencesHeading="household-preferences-heading",l.HouseholdPreferencesDescription="household-preferences-description",l.ServiceSettingsHeading="service-settings-heading",l.ServiceSettingsDescription="service-settings-description",l.MenuSelectionHeadingGathering="menu-selection-heading-gathering",l.MenuSelectionDescriptionGathering="menu-selection-description-gathering",l.MenuSelectionHeadingCookingClasses="menu-selection-heading-cooking-classes",l.MenuSelectionDescriptionCookingClasses="menu-selection-description-cooking-classes",l.DishSelectionHeading="dish-selection-heading",l.DishSelectionDescription="dish-selection-description",l.MenuCustomizationHeading="menu-customization-heading",l.MenuCustomizationDescription="menu-customization-description",l.ConfirmationHeading="confirmation-heading",l.ConfirmationDescription="confirmation-description",l.ConfirmationHeadingMealPrep="confirmation-heading-meal-prep",l.ConfirmationDescriptionMealPrep="confirmation-description-meal-prep",l.ConfirmationLoggedInDescriptionMealPrep="confirmation-logged-in-description-meal-prep",(o=r||(r={})).MealPrepServiceSettings="meal-prep-service-settings",o.MealPrepDishes="meal-prep-dishes",o.MealPrepServiceDetails="meal-prep-service-details",o.GatheringMenuAndDishes="gathering-menu-and-dishes",o.GatheringServiceDetails="gathering-service-details",o.GatheringServiceSettings="gathering-service-settings"},26155:function(e,t,i){"use strict";i.d(t,{Y:function(){return Z}});var a=i(97458),n=i(52983),r=i(79904),s=i(34376),l=i(19882),o=i(20683),d=i(1137),c=i(78778),u=i(39957),h=i(85517),m=i(83679);function p(){return(0,a.jsx)(c.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,delay:.2},className:"fixed inset-0 z-50 flex items-center justify-center bg-ar-beige-light",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-5",children:[(0,a.jsx)(c.E.div,{transition:{duration:2,ease:"easeInOut",times:[0,.2,.5,.8,1],repeat:1/0,repeatDelay:.5},animate:{scale:[1,1.2,1.2,1,1],rotate:[0,0,270,270,0],color:[m.COLORS.NavyLight,m.COLORS.GreenLight,m.COLORS.RedLight,m.COLORS.GreenLight,m.COLORS.NavyLight]},children:(0,a.jsx)(u.k,{className:"",icon:(0,a.jsx)(h.Z,{}),size:60})}),(0,a.jsx)("p",{className:"editorial-20 text-ar-culinista-black opacity-30",children:"Loading Booking Service"})]})})}var f=i(25489),g=i(70967),v=i(6241);async function y(e,t,i){let{data:a}=await e.query({query:g.$KG,variables:{slug:t.slug}}),{classPost:n,menuPost:r}=a;if((null==n?void 0:n.length)>0&&(null==r?void 0:r.length)>0){var s,l,o;if((null===(s=r[0])||void 0===s?void 0:s._id)===(null===(o=n[0])||void 0===o?void 0:null===(l=o.menu)||void 0===l?void 0:l._id))return(0,v.tj)((0,v.s9)(n[0]))}return r[0]?(0,v.d6)((0,v.s9)(r[0],i)):(0,v.tj)((0,v.s9)(n[0]))}var x=i(8431),b=i(49658),j=i(77413),w=i(7279),C=i(91541);function N(){let{selectMenu:e}=(0,x.p)(),{goToNextStep:t}=(0,b.V)(),i=(0,C.U)(),r=(0,s.useSearchParams)(),l=(0,j.useRouter)(),[o,d]=(0,n.useState)(),{getService:c}=(0,w.o)(),{primaryColor:u}=c();return(0,n.useEffect)(()=>{let e=r.get("post"),t=async()=>{d(await y(i,{slug:e}))};e&&e!==(null==o?void 0:o.slug)?t():d(void 0)},[i,r,null==o?void 0:o.slug]),(0,a.jsx)(f._,{themeColor:u,post:o,onSelect:()=>{e({isExtendedMenu:!1,referenceId:o.id}),t({paramsToRemove:["post"]})},onClose:()=>{let e=Object.fromEntries(r);delete e.post,l.push({query:{...e}},void 0,{shallow:!0,scroll:!1})}})}var k=i(73309),S=i(74870),I=i(15219),P=i(49122),M=i(30361);let D={[M.Ym.ServiceSettingsHeading]:"Service Settings",[M.Ym.ServiceSettingsDescription]:"Your Culinista chef will use the information below to customize your service. You can modify these settings any time through your client dashboard.",[M.Ym.DetailsHeading]:"Complete Your Booking",[M.Ym.DetailsDescription]:null,[M.Ym.PaymentHeading]:"Complete Your Booking",[M.Ym.PaymentDescription]:"",[M.Ym.PaymentLoggedInHeading]:"Complete Your Booking",[M.Ym.MenuSelectionHeadingGathering]:"Browse Sample Menus",[M.Ym.MenuSelectionDescriptionGathering]:"Select a menu, then customize it with dishes of your choice. All dishes can be modified to meet dietary restrictions and preferences.",[M.Ym.GatheringPaymentLoggedInDescription]:"Our flexible booking policy allows you to adjust these details until 48 hours prior to service. Guest count or zip code updates may result in changes to your service fee.",[M.Ym.HouseholdPreferencesHeading]:"Service Settings",[M.Ym.HouseholdPreferencesDescription]:"",[M.Ym.MenuSelectionHeadingCookingClasses]:"Select Your Menu",[M.Ym.MenuSelectionDescriptionCookingClasses]:"Select a menu, then customize it to fit your preferences and needs.",[M.Ym.DishSelectionHeading]:"Dish Selection",[M.Ym.DishSelectionDescription]:'Choose up to six dishes from our culinary library. For a balanced meal prep, we suggest choosing two proteins, two light vegetables, and two hearty vegetables or grains. Dishes marked "($)" contain ingredients that are more costly than average. Selecting these dishes will not impact your service fee but will increase your grocery total.',[M.Ym.MenuCustomizationHeading]:"Great choice. Now let's create your menu.",[M.Ym.MenuCustomizationDescription]:"Please choose your menu size (Standard or Extended), then select your dishes and note any modifications you'd like.",[M.Ym.ConfirmationHeading]:"Your booking is confirmed.",[M.Ym.ConfirmationDescription]:"Weâre working on matching you with a chef and will follow up in 24-48 hours to confirm your match.",[M.Ym.ConfirmationHeadingMealPrep]:"Your service is confirmed.",[M.Ym.ConfirmationDescriptionMealPrep]:"Welcome to The Culinistas. Weâve sent you an email with the details below. Weâre working on matching you with a chef and will send you a confirmation email at least 24 hours before your service date. In the meantime, log into your account to see future bookings and dish selections.",[M.Ym.ConfirmationLoggedInDescriptionMealPrep]:"",[M.Ym.MealPrepPaymentLoggedInDescription]:""};async function O(e){return await new Promise(e=>{setTimeout(()=>e(!0),1e3)}),D}var E=i(21967),T=i(35871);let A=()=>{let e=(0,I.u)(),{user:t}=(0,E.jJ)(),[i]=(0,P.F$f)({fetchPolicy:"network-only"}),[a]=(0,P.GLJ)({fetchPolicy:"network-only"}),[n]=(0,P.y5R)({fetchPolicy:"network-only"}),[r]=(0,g.trH)();return{getBookingOrderInitialState:async s=>{var d,c,u,h,m,p,f,g,v,y,x,b,j,w,C,N,k,I,M,D,E,A,F,Z,_,R,L,B,H;let q,U;if(s.serviceId)q=await a({variables:{input:{serviceId:s.serviceId}}});else{let e=function(){if("undefined"==typeof sessionStorage)return;let e=sessionStorage.getItem(S.CZ);if(e){let t=JSON.parse(e);return{...t,selectedMenus:new Map(Object.entries(t.selectedMenus)),selectedItems:new Map(Object.entries(t.selectedItems)),menuToItemMap:new Map(Object.entries(t.menuToItemMap))}}}();if(e&&e.settings.activeStep===s.activeStep)return s.returnFromLogin?(U=await i(),s.serviceType===P.UW4.MealPrep)?{...e,serviceAndHouseholdSettings:{...e.serviceAndHouseholdSettings,householdRules:(null==U?void 0:null===(M=U.data)||void 0===M?void 0:null===(I=M.customer.householdSettings)||void 0===I?void 0:I.basicHouseholdNotes)||[],householdNotes:null==U?void 0:null===(E=U.data)||void 0===E?void 0:null===(D=E.customer.householdSettings)||void 0===D?void 0:D.householdNotes}}:{...e,serviceAndHouseholdSettings:{...e.serviceAndHouseholdSettings,culinaryPreferences:(null==U?void 0:null===(x=U.data)||void 0===x?void 0:null===(y=x.customer.culinarySettings)||void 0===y?void 0:y.culinaryPreferences)||[],culinaryPreferencesNote:null==U?void 0:null===(j=U.data)||void 0===j?void 0:null===(b=j.customer.culinarySettings)||void 0===b?void 0:b.otherCulinaryPreferences,householdRules:(null==U?void 0:null===(C=U.data)||void 0===C?void 0:null===(w=C.customer.householdSettings)||void 0===w?void 0:w.basicHouseholdNotes)||[],householdNotes:null==U?void 0:null===(k=U.data)||void 0===k?void 0:null===(N=k.customer.householdSettings)||void 0===N?void 0:N.householdNotes}}:e}if(t.isLoggedIn&&(U=await i(),s.addressId&&!s.zipCode)){let{data:e}=await n(),t=null==e?void 0:null===(F=e.customer)||void 0===F?void 0:null===(A=F.addresses)||void 0===A?void 0:A.find(e=>e.id===s.addressId);(null==t?void 0:t.zipCode)&&(s.zipCode=t.zipCode)}let W=(0,l.S)({serviceType:(null==q?void 0:null===(d=q.data)||void 0===d?void 0:d.service.serviceType)||s.serviceType}),G=await O({serviceType:(null==q?void 0:null===(c=q.data)||void 0===c?void 0:c.service.serviceType)||s.serviceType}),z=function(e){let{activeStepIndex:t,orderId:i,reorderId:a,peopleCount:n}=e;return{...o.BOOKING_ORDER_DEFAULT_STATE.settings,activeStep:t||1,orderId:i||void 0,reorderId:a||void 0,isSidebarOpen:!1,isItemToEditForced:!1,itemToEditId:void 0,numberOfPeople:n||void 0}}({activeStepIndex:s.activeStep,orderId:s.isDishSelection?s.serviceId:void 0,reorderId:s.isDishSelection?void 0:s.serviceId,peopleCount:(null==q?void 0:null===(u=q.data)||void 0===u?void 0:u.service.peopleCount)||parseInt(s.numberOfPeople||"0",10)}),$=(H=(null==q?void 0:null===(h=q.data)||void 0===h?void 0:h.service.address)||{id:s.addressId,zipCode:s.zipCode},{...o.BOOKING_ORDER_DEFAULT_STATE.address,id:null==H?void 0:H.id,additionalComments:(null==H?void 0:H.additionalComments)||void 0,city:null==H?void 0:H.city,nickname:(null==H?void 0:H.nickname)||void 0,state:null==H?void 0:H.state,streetAddress:null==H?void 0:H.streetAddress,streetAddress2:(null==H?void 0:H.streetAddress2)||void 0,zipCode:null==H?void 0:H.zipCode}),Y=function(e){let{householdSettings:t,culinarySettings:i,allergens:a}=e;return{...o.BOOKING_ORDER_DEFAULT_STATE.serviceAndHouseholdSettings,culinaryPreferences:(null==i?void 0:i.culinaryPreferences)||[],culinaryPreferencesNote:null==i?void 0:i.otherCulinaryPreferences,ingredientFlags:(null==i?void 0:i.ingredientRestrictions.map(e=>{let t=null==a?void 0:a.find(t=>{var i;return(null===(i=t.smlenum)||void 0===i?void 0:i.toUpperCase())===e});
1if(t)return{title:null==t?void 0:t.title,id:null==t?void 0:t._id}}).filter(e=>!!(null==e?void 0:e.title)))||[],householdRules:(null==t?void 0:t.basicHouseholdNotes)||[],householdNotes:null==t?void 0:t.householdNotes}}({householdSettings:(null==U?void 0:null===(m=U.data)||void 0===m?void 0:m.customer.householdSettings)||void 0,culinarySettings:(null==U?void 0:null===(p=U.data)||void 0===p?void 0:p.customer.culinarySettings)||void 0,allergens:e});(null==q?void 0:null===(f=q.data)||void 0===f?void 0:f.service.peopleCount)&&(Y.portion=(0,T.w)(q.data.service.peopleCount));let{calculation:V}=o.BOOKING_ORDER_DEFAULT_STATE,J=(null==q?void 0:null===(g=q.data)||void 0===g?void 0:g.service.menuRefId)||s.selectedMenuId,K=new Map,Q=new Map,X=[];return J&&(K.set(J,{isExtendedMenu:!!(null==q?void 0:null===(Z=q.data)||void 0===Z?void 0:Z.service.menuIsExtended),referenceId:J}),null===(B=(await r({variables:{id:J}})).data)||void 0===B||null===(L=B.menu)||void 0===L||null===(R=L[0])||void 0===R||null===(_=R.courses)||void 0===_||_.forEach(e=>{(null==e?void 0:e.dishes)&&e.dishes.forEach(t=>{var i;(null==t?void 0:null===(i=t.dish)||void 0===i?void 0:i._id)&&X.push({id:t.dish._id,courseName:e.title,courseId:e._key,ingredientList:t.dish.ingredientList||""})})}),Q.set(J,X.map(e=>e.id))),{settings:z,address:$,serviceAndHouseholdSettings:Y,calculation:V,dictionary:G,service:W,selectedItems:(null==q?void 0:null===(v=q.data)||void 0===v?void 0:v.service.dishes.reduce((t,i)=>{var a,n,r;return i.dishRefId&&t.set(i.dishRefId,{title:i.dishName,subtitle:(null===(a=X.find(e=>e.id===i.dishRefId))||void 0===a?void 0:a.ingredientList)||"",courseName:(null===(n=X.find(e=>e.id===i.dishRefId))||void 0===n?void 0:n.courseName)||void 0,courseId:(null===(r=X.find(e=>e.id===i.dishRefId))||void 0===r?void 0:r.courseId)||void 0,referenceId:i.dishRefId,modifyNote:i.customInstructions||"",recipeCardUrl:i.dishRecipeCardUrl||void 0,allergens:i.dishIngredientRestrictionTags.map(t=>{let i=e.find(e=>{var i;return(null===(i=e.smlenum)||void 0===i?void 0:i.toUpperCase())===t});if(i)return{id:i._id,title:i.title}}).filter(e=>!!e),portion:i.customServings?(0,T.w)(i.customServings):void 0}),t},new Map))||new Map,selectedMenus:K,menuToItemMap:Q}}}};function F(){if("undefined"==typeof sessionStorage)return;let e=sessionStorage.getItem(S.CZ);if(e){let t=JSON.parse(e);return{...t,selectedMenus:new Map(Object.entries(t.selectedMenus)),selectedItems:new Map(Object.entries(t.selectedItems)),menuToItemMap:new Map(Object.entries(t.menuToItemMap))}}}function Z(e){let{children:t}
1=e,[i,u]=(0,n.useState)(!0),h=(0,s.usePathname)(),m=(0,j.useRouter)(),f=(0,s.useSearchParams)(),g=f.get("service"),v=f.get("step"),y=f.get("id"),x=f.get("orderId"),b=f.get("reorderId"),w=f.get("numberOfPeople"),C=f.get("zipCode"),I=f.get("addressId"),P=f.get("returnFromLogin"),M=f.get("selectedMenuId"),{user:D}=(0,E.jJ)(),{getBookingOrderInitialState:O}=A(),[T,Z]=(0,n.useState)(o.BOOKING_ORDER_DEFAULT_STATE);g&&(v||(0,k.sZ)(h));let _=function(e){let t=Object.entries(l.c).find(t=>{let[i,a]=t;return a===e});if(t)return t[0];throw Error("Service type ".concat(e," not found"))}(g),R=v?parseInt(v,10):void 0,L=(0,n.useCallback)(()=>{var e;let t=F();(null==t?void 0:null===(e=t.service)||void 0===e?void 0:e.type)!==_&&sessionStorage.removeItem(S.CZ)},[_]),B=(0,n.useCallback)(async()=>{u(!0),L(),Z(await O({activeStep:R||1,serviceId:x||b||y||void 0,serviceType:_,numberOfPeople:w||void 0,zipCode:C||void 0,addressId:I||void 0,returnFromLogin:"true"===P,selectedMenuId:M||void 0,isDishSelection:!!x})),u(!1)},[R,I,L,O,y,w,x,b,P,M,_,C]);return(0,n.useEffect)(()=>{D.isReady&&(h.includes("confirmation")?B():setTimeout(()=>{B()},500))},[D.isReady]),(0,n.useEffect)(()=>{let e=F();R&&R>1&&!e&&!M&&m.push({pathname:m.pathname,query:{...m.query,step:1}})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.M,{initial:!1,children:i&&(0,a.jsx)(p,{})}),!i&&t&&(0,a.jsxs)(r.$S,{initialState:T,children:[(0,a.jsx)(N,{}),(0,a.jsx)(d.M,{mode:"wait",children:(0,a.jsx)(c.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:t},t.key)})]})]})}},13966:function(e,t,i){"use strict";i.d(t,{J:function(){return h}});var a=i(97458),n=i(52983),r=i(14517),s=i(35031),l=i(7279),o=i(78778);function d(e){let{layout:t,children:i}=e,n=(0,r.Z)({"max-w-[792px]":"default"===t,"max-w-[1140px]":"full"===t});return(0,a.jsx)("div",{className:(0,r.Z)("flex w-full justify-center",n),children:i})}function c(e){let{heading:t,description:i,layout:n}=e,{getService:o}=(0,l.o)(),{primaryColor:c}=o(),u=(0,s.M)("border",c);return(0,a.jsx)("header",{className:(0,r.Z)(u,"flex w-full justify-center px-7 md:px-8",{"border-b border-opacity-40 pb-14":"full"===n||"full-header-without-content-container"===n}),children:(0,a.jsx)(d,{layout:"full-header-without-content-container"===n?"full":n,children:(0,a.jsxs)("div",{className:"flex w-full flex-col gap-5",children:[t&&(0,a.jsx)("h1",{className:"editorial-48",children:t}),i&&(0,a.jsx)("p",{className:"garamond-18",children:i})]})})})}function u(e){let{layout:t,children:i}=e;return(0,a.jsx)("div",{className:(0,r.Z)("flex w-full justify-center",{"px-7 md:px-8":"full-header-without-content-container"!==t}),children:(0,a.jsx)(d,{layout:t,children:(0,a.jsx)("main",{className:"flex w-full flex-col gap-8",children:n.cloneElement(i,{containerClassName:"flex w-full flex-col gap-8"})})})})}function h(e){let{className:t,heading:i,description:n,layout:d,children:h}=e,{getService:m}=(0,l.o)(),{primaryColor:p}=m(),f=(0,s.M)("text",p);return(0,a.jsxs)(o.E.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.3},className:(0,r.Z)(f,t,"relative flex w-full flex-1 flex-col items-center",{"gap-y-16 py-16":"default"===d,"gap-y-6 py-10":"full"===d,"py-10":"full-header-without-content-container"===d}),children:[(i||n)&&(0,a.jsx)(c,{heading:i,description:n,layout:d}),(0,a.jsx)(u,{layout:d,children:h})]})}},7776:function(e,t,i){"use strict";i.d(t,{a:function(){return B}});var a=i(97458),n=i(52983),r=i(35031),s=i(14517),l=i(53460),o=i(43359),d=i(10846),c=i(49122),u=i(76102),h=i(99672);function m(e){let{primaryColor:t,primaryColorAlternative:i}=e,m=(0,n.useRef)(null),p=(0,n.useRef)(null),f=(0,o.a)(o.j.md),{data:g}=(0,c.giI)(),[v,{loading:y,data:x}]=(0,c.U7k)(),[b,j]=(0,n.useState)(!1),[w,C]=(0,n.useState)("Copy"),[N,k]=(0,n.useState)(),S=async()=>{try{var e,t;(null===(e=p.current)||void 0===e?void 0:e.value)&&await v({variables:{input:{sendToEmail:(null===(t=p.current)||void 0===t?void 0:t.value)||""}}}),k(void 0),j(!1)}catch(e){k((e?(0,u.i)(e):"")||"An error occurred, please try again later")}};return(0,a.jsxs)("div",{className:(0,s.Z)("p-7 md:p-10",(0,r.M)("text",t),(0,r.M)("bg",i)),children:[(0,a.jsxs)("h2",{className:"editorial-22 md:editorial-32 inline-flex flex-col uppercase",children:["Give 100$"," ",(0,a.jsxs)("span",{className:"ml-5 md:ml-7",children:[(0,a.jsx)("svg",{width:f?18:26,height:f?18:26,className:"mb-1 mr-1.5 inline-block md:mb-2 md:mr-2",children:(0,a.jsx)("path",{className:(0,r.M)("fill",t),d:l.a.sustainability,transform:f?"scale(0.18, 0.18)":"scale(0.26, 0.26)"})}),"Get 100$"]})]}),(0,a.jsxs)("form",{className:"mt-7 flex flex-col gap-y-2.5 md:mt-10",children:[(0,a.jsx)(d.V,{ref:p,variant:"basic",placeholder:"Refer a friend via email",actionText:(null==x?void 0:x.customer.sendReferral.success)?"Sent!":"Send",actionDisabled:!b,onActionClick:S,onChange:()=>{k(void 0),p.current&&j((0,h.o)(p.current.value))},primaryColor:t,loading:y,disabled:!!(null==x?void 0:x.customer.sendReferral.success),error:N}),(null==g?void 0:g.customer.referral)&&(0,a.jsx)(d.V,{variant:"basic",actionText:w,inputClassName:"text-center lg:text-left",onActionClick:()=>{var e;navigator.clipboard.writeText((null===(e=m.current)||void 0===e?void 0:e.value)||""),C("Copied!"),setTimeout(()=>{C("Copy")},2e3)},ref:m,value:"".concat(window.location.origin,"/referrals?value=").concat(g.customer.referral),primaryColor:t})]}),(0,a.jsx)("p",{className:"mt-2.5",children:"The recipient's gift is valid for gatherings only. Your reward is valid toward any service."})]})}var p=i(18844),f=i(92156),g=i(42424),v=i.n(g);let y={[c.UW4.Gathering]:["Empty the dishwasher, clear out the sink, and make room in the fridge before the chef arrives.",(0,a.jsxs)(a.Fragment,{children:["Double check our"," ",(0,a.jsx)(v(),{href:f.y.bestPractices(),className:"underline",target:"_blank",rel:"noopener noreferrer",children:"Equipment List"})," ","and make sure your kitchen is stocked."]}),"Purchase alcohol: If you ordered cocktails, the chef will purchase all ingredients except alcohol. Let us know if we can support with wine pairings or if you want to add beverages and bartenders."],[c.UW4.MealPrep]:[(0,a.jsxs)(a.Fragment,{children:["Read our"," ",(0,a.jsx)(v(),{href:f.y.bestPractices(),className:"underline",target:"_blank",rel:"noopener noreferrer",children:"Best Practices & Equipment page"}),", and make sure your kitchen is stocked."," ",(0,a.jsx)("a",{className:"underline",href:"mailto:[email protected]",children:"Reach out"})," ","with any questions ahead of time."]}),"Empty the dishwasher and clear out the sink before the chef arrives.","Set aside clean food storage containers: 6 for a small meal prep, 8-12 for a medium meal prep, and 14-18 for a large meal prep."],[c.UW4.CookingClass]:["Empty the dishwasher, clear out the sink, and make room in the fridge before the chef arrives.",(0,a.jsxs)(a.Fragment,{children:["Double check our"," ",(0,a.jsx)(v(),{href:f.y.bestPractices(),className:"underline",target:"_blank",rel:"noopener noreferrer",children:"Equipment List"})," ","and make sure your kitchen is stocked."]}),"Purchase alcohol: If you ordered cocktails, the chef will purchase all ingredients except alcohol. Let us know if we can support with wine pairings or if you want to add beverages and bartenders."]};function x(e){let{primaryColor:t,primaryColorAlternative:i,serviceType:n}=e,d=(0,o.a)(o.j.md);return(0,a.jsxs)("div",{className:(0,s.Z)("p-7 md:p-10",(0,r.M)("text",t),(0,r.M)("bg",i)),children:[(0,a.jsxs)("h2",{className:"editorial-22 md:editorial-32 inline-flex flex-col up
1percase",children:["Get Ready for"," ",(0,a.jsxs)("span",{className:"ml-5 md:ml-7",children:[(0,a.jsx)("svg",{width:d?18:26,height:d?18:26,className:"mb-1 mr-1.5 inline-block md:mb-2 md:mr-2",children:(0,a.jsx)("path",{className:(0,r.M)("fill",t),d:l.a.hospitality,transform:d?"scale(0.18, 0.18)":"scale(0.26, 0.26)"})}),"Your Service"]})]}),(0,a.jsx)("ol",{className:"helvetica-14-400 mt-4 md:mt-10",children:y[n].map((e,i)=>(0,a.jsxs)("li",{className:(0,s.Z)("inline-flex","border-t border-opacity-40 py-5",(0,r.M)("border-t",t),2===i&&"border-b",2===i&&(0,r.M)("border-b",t)),children:[(0,a.jsxs)("span",{children:[i+1,".\xa0"]}),(0,a.jsx)("span",{children:e})]},i))}),(0,a.jsx)(p.k,{href:f.y.bestPractices(),rel:"noopener noreferrer",target:"_blank",backgroundColor:t,textColor:i,className:"mt-10 max-w-[245px] md:max-w-[275px]",children:"See All Best Practices & Equipment"})]})}var b=i(1440),j=i(88403),w=i(7279),C=i(34376),N=i(79096),k=i(6597),S=i(34737),I=i(8431),P=i(52682),M=i(71977),D=i(6241),O=i(54100),E=i.n(O);function T(e){let{items:t,primaryColor:i,hideLastDivider:n=!1}=e;return(0,a.jsx)("ul",{children:t.map((e,r)=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"py-4",children:[(0,a.jsx)("p",{className:"editorial-16",children:e.title}),e.modifyNote&&(0,a.jsx)("p",{className:"helvetica-12-400 mt-2.5 opacity-40",children:e.modifyNote})]}),(!n||r+1!==t.length)&&(0,a.jsx)(j.o,{primaryColor:i,variant:"dotted"})]},e.referenceId))})}function A(e){let{className:t,title:i,children:n}=e;return(0,a.jsxs)("div",{className:(0,s.Z)("flex flex-col gap-y-4",t),children:[(0,a.jsx)("p",{className:"helvetica-9-400 uppercase tracking-widest",children:i}),n]})}function F(){var e,t,i,n;let{getService:r}=(0,w.o)(),{getSelectedItems:s,getActiveMenuData:l}=(0,I.p)(),{primaryColorAlternative:d}=r(),c=s(),u=l(),h=(0,o.a)(o.j.md),{mobileImage:m,image:p}=(0,D.d6)(u)||{},f=c.reduce((e,t)=>(t.courseName&&(e[t.courseName]=e[t.courseName]||{id:t.courseId,title:t.courseName,dishes:[]},e[t.courseName].dishes.push(t)),e),{});return(0,a.jsxs)("div",{children:[(0,a.jsxs)("header",{className:"mb-10 flex items-center gap-x-4",children:[(null==p?void 0:p.url)&&(0,a.jsx)(E(),{priority:!0,className:"aspect-[80/60] w-20 object-cover object-center",placeholder:"blur",src:h&&(null==m?void 0:m.url)?m.url:p.url,alt:h&&(null==m?void 0:m.alt)?m.alt:null!==(e=p.alt)&&void 0!==e?e:"",width:h&&(null==m?void 0:m.metadata.width)?m.metadata.width:null!==(t=p.metadata.width)&&void 0!==t?t:void 0,height:h&&(null==m?void 0:m.metadata.height)?m.metadata.height:null!==(i=p.metadata.height)&&void 0!==i?i:void 0,blurDataURL:h&&(null==m?void 0:m.metadata.lqip)?m.metadata.lqip:null!==(n=p.metadata.lqip)&&void 0!==n?n:void 0}),(0,a.jsx)("div",{className:"editorial-18 uppercase",children:null==u?void 0:u.title})]}),Object.keys(f).map((e,t)=>{let i=f[e];return(0,a.jsx)(A,{title:i.title,className:Object.keys(f).length!==t+1?"mb-10":void 0,children:(0,a.jsx)(T,{items:i.dishes,primaryColor:d,hideLastDivider:Object.keys(f).length===t+1})},i.id)})]})}function Z(){let{getService:e}=(0,w.o)(),{getSelectedItems:t}=(0,I.p)(),{primaryColorAlternative:i}=e(),n=t();return(0,a.jsx)(T,{items:null!=n?n:[],primaryColor:i,hideLastDivider:!0})}function _(e){let{children:t}=e;return(0,a.jsx)("div",{className:"flex flex-col gap-y-2.5 pb-4",children:t})}function R(e){let{label:t,value:i}=e;return(0,a.jsxs)("div",{className:"helvetica-14-400 flex items-start justify-between gap-x-2.5",children:[(0,a.jsx)("p",{className:"opacity-60",children:t}),(0,a.jsx)("div",{className:"flex flex-col items-end gap-x-2.5",children:Array.isArray(i)?i.filter(e=>!!e).map((e,t)=>(0,a.jsx)("p",{children:e},t)):(0,a.jsx)("p",{children:i})})]})}function L(){var e;let t=(0,C.useSearchParams)().get("payment"),{data:i}=(0,c.giI)({fetchPolicy:"network-only"}),{data:n}=(0,c.LCX)({fetchPolicy:"network-only"}),r=null==n?void 0:null===(e=n.paymentMethods.items)||void 0===e?void 0:e.find(e=>(null==e?void 0:e.id)===t),{getAddress:s,getServiceAndHouseholdSettings:l,getSettings:o}=(0,N.b)(),{getService:d}=(0,w.o)(),{getFormatted:u}=(0,k._)(),{getSelectedItems:h}=(0,I.p)(),{type:m,primaryColorAlternative:p}=d(),f=s(),g=u(),{ingredientFlags:v,householdRules:y,culinaryPreferences:x,culinaryPreferencesNote:D}=l(),O=o(),E=h(),T=null==i?void 0:i.customer,A=(null==T?void 0:T.firstName)||(null==T?void 0:T.lastName)?"".concat(null==T?void 0:T.firstName," ").concat(null==T?void 0:T.lastName):void 0,L=null==y?void 0:y.filter(e=>"string"==typeof e),B=null==y?void 0:y.filter(e=>"string"!=typeof e),H={culinarySettings:{label:"Culinary Settings",value:[(null==x?void 0:x.map(e=>S.e[e]).join(" | "))||"",D||""]},ingredientFlags:{label:"Ingredient Flags",value:null==v?void 0:v.map(e=>e.title).join(", ")},householdSettings:{label:"Household Settings",value:[L.map(e=>S.c[e]).join(" | ")||"",(null==B?void 0:B.map(e=>"".concat(S.c[e.rule],": ").concat(e.note)).join(" | "))||""]}}
1,q=r?[r.streetAddress,r.city,r.state,r.zipCode].filter(Boolean).join(", "):void 0,U=m===c.UW4.MealPrep&&0===E.length;return(0,a.jsxs)("div",{className:"container",children:[m===c.UW4.MealPrep?E.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Your Dishes"}),children:(0,a.jsx)(Z,{})}),(0,a.jsx)(j.o,{primaryColor:p})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Your Menu"}),children:(0,a.jsx)(F,{})}),(0,a.jsx)(j.o,{primaryColor:p})]}),(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Payment Estimate"}),children:(0,a.jsxs)(_,{children:[g.serviceCost&&(0,a.jsx)(R,{label:"Service",value:g.serviceCost}),g.groceryCost&&(0,a.jsx)(R,{label:"Est. Groceries",value:U?"TBD":g.groceryCost}),g.tips&&(0,a.jsx)(R,{label:"Tip",value:g.tips}),g.travelCost&&(0,a.jsx)(R,{label:"Travel",value:g.travelCost}),g.tax&&(0,a.jsx)(R,{label:"Tax",value:g.tax}),g.total&&(0,a.jsx)(R,{label:"Total",value:U?"TBD":g.total}),U&&(0,a.jsx)("p",{className:"helvetica-14-400 mt-4",children:"Your payment estimate will update once you select dishes."})]})}),(0,a.jsx)(j.o,{primaryColor:p}),(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Service Details"}),children:(0,a.jsxs)(_,{children:[(null==O?void 0:O.day)&&(0,a.jsx)(R,{label:"Service Day",value:(0,M.$G)(+O.day)}),(null==O?void 0:O.time)&&(0,a.jsx)(R,{label:"Service Time",value:(0,M.Os)(+O.time)}),(null==O?void 0:O.numberOfPeople)&&(0,a.jsx)(R,{label:"Number of Guests",value:null==O?void 0:O.numberOfPeople.toString()}),O.date&&(0,a.jsx)(R,{label:"Start Date",value:(0,P.Z)(new Date(O.date),"MMMM d, yyyy")}),O.arrivalTime&&(0,a.jsx)(R,{label:"Guest Arrival Time",value:(0,M.hK)(new Date(O.arrivalTime))}),O.dinnerTime&&(0,a.jsx)(R,{label:"Table Time",value:(0,M.hK)(new Date(O.dinnerTime))}),f&&(0,a.jsx)(R,{label:"Address",value:"".concat(f.streetAddress,", ").concat(f.city,", ").concat(f.state," ").concat(f.zipCode)})]})}),(0,a.jsx)(j.o,{primaryColor:p}),(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Service Settings"}),children:(0,a.jsxs)(_,{children:[(0,a.jsx)(R,{label:"Household Settings",value:H.householdSettings.value||"Not provided"}),(0,a.jsx)(R,{label:"Culinary Settings",value:H.culinarySettings.value||"Not provided"})]})}),(0,a.jsx)(j.o,{primaryColor:p}),(0,a.jsx)(b.y,{item:(0,a.jsx)("p",{className:"helvetica-14-500 py-6",children:"Client Information"}),children:(0,a.jsxs)(_,{children:[A&&(0,a.jsx)(R,{label:"Name",value:"".concat(A)}),(null==T?void 0:T.email)&&(0,a.jsx)(R,{label:"Email",value:T.email}),(null==T?void 0:T.email)&&(0,a.jsx)(R,{label:"Phone",value:T.phoneNumber}),r&&(0,a.jsx)(R,{label:"Payment",value:"".concat(r.nickname?"".concat(r.nickname," "):"").concat(r.brand," (").concat(null==r?void 0:r.last4,")")}),q&&(0,a.jsx)(R,{label:"Billing Address",value:q})]})})]})}function B(e){let{getService:t}=(0,w.o)(),{type:i,primaryColor:n,primaryColorAlternative:l,secondaryColor:o,secondaryColorAlternative:d}=t();return(0,a.jsxs)("div",{className:"mx-auto grid max-w-[1200px] grid-cols-1 gap-5 md:grid-cols-2 md:gap-7 md:px-7",children:[(0,a.jsx)("section",{className:"mx-7 md:mx-0",children:(0,a.jsx)("div",{className:(0,s.Z)("border border-opacity-40 p-5",(0,r.M)("border",l)),children:(0,a.jsx)(L,{})})}),(0,a.jsxs)("section",{className:"flex flex-col md:gap-y-7",children:[(0,a.jsx)(x,{primaryColor:i===c.UW4.CookingClass?l:n,primaryColorAlternative:i===c.UW4.CookingClass?n:l,serviceType:i}),(0,a.jsx)(m,{primaryColor:i===c.UW4.CookingClass?n:o,primaryColorAlternative:i===c.UW4.CookingClass?l:d})]})]})}},51023:function(e,t,i){"use strict";i.d(t,{I7:function(){return s},R8:function(){return o},mc:function(){return l},xF:function(){return r}});var a=i(33392),n=i(49122);let r="postpartumMeals",s="mealsForMyself",l="mealsForMyFamily";function o(){return{serviceUsage:[{id:"serviceUsage.mealsForMyself",type:"radio",name:"serviceUsage",label:"Meals for myself",value:s},{id:"serviceUsage.mealsForMyFamily",type:"radio",name:"serviceUsage",label:"Meals for my family",value:l},{id:"serviceUsage.postpartumMeals",type:"radio",name:"serviceUsage",label:"Postpartum meals",value:r},{id:"serviceUsage.other",type:"radio",name:"serviceUsage",label:"Other",value:"other"}],...a.sW,portion:[{id:"portion.small",type:"radio",name:"portion",label:"Small (1-2 mouths)",value:n.YtR.Small},{id:"portion.medium",type:"radio",name:"portion",label:"Medium (3-4 mouths)",value:n.YtR.Medium},{id:"portion.large",type:"radio",name:"portion",label:"Large (5-6 mouths)",value:n.YtR.Large}]}}},67410:function(e,t,i){"use strict";i.d(t,{s:function(){return iS},T:function(){return ik}});var a,n=i(97458),r=i(49122),s=i(30361),l=i(52983),o=i(96978),d=i(38156),c=i(98680),u=i(1834),h=i(57399),m=i(76102);function p(e){let{children:t,className:i,formId:a,onSubmit:r,defaultValues:s,formSchema:o,errors:d}=e,{setFormState:p}=(0,u.P)(),f=(0,c.cI)({defaultValues:s,...o?{resolver:(0,h.X)(o)}:{}}),{defaultValues:g,dirtyFields:v,errors:y,isDirty:x,isLoading:b,isSubmitSuccessful:j,isSubmitted:w,isSubmitting:C,isValid:N,isValidating:k,submitCount:S,touchedFields:I}=f.formState,P=async(e,t)=>{try{await r(e,t)}catch(e){f.setError("submit",{message:(0,m.i)(e)})}};return(0,l.useEffect)(()=>
1{d&&Object.keys(d).forEach(e=>{f.setError(e,{message:d[e]})})},[d,f]),(0,l.useEffect)(()=>{p({defaultValues:g,dirtyFields:v,errors:y,isDirty:x,isLoading:b,isSubmitSuccessful:j,isSubmitted:w,isSubmitting:C,isValid:N,isValidating:k,submitCount:S,touchedFields:I})},[g,v,y,x,b,j,w,C,N,k,p,S,I]),(0,n.jsx)("form",{className:i,id:a,onSubmit:f.handleSubmit(P),children:t(f)})}var f=i(99099),g=i(79096),v=i(49658),y=i(21967),x=i(99068),b=i(92058),j=i(77245),w=i(66045);function C(e){var t;let{children:i,inputs:a,watch:r,resetField:s}=e,{getAddress:o}=(0,g.b)(),{zipCode:d}=o(),{zipCode:c}=null!==(t=r("address"))&&void 0!==t?t:{},u=r("dateTime.day"),h=r("dateTime.time"),m=r("dateTime.startDate"),{availableDays:p,selectDaysOptions:f,timesOptions:v}=(0,j.f)({serviceType:"mealPrep",selectDay:u,time:h,date:m,zipCode:c||d});return(0,l.useEffect)(()=>{u&&!f.some(e=>e.value===u)&&s("dateTime.day")},[s,f]),(0,l.useEffect)(()=>{m&&!p.some(e=>(0,w.Z)(e).toString()===m.toString())&&s("dateTime.startDate")},[p,s]),(0,n.jsx)(n.Fragment,{children:i({inputs:a.map(e=>"dateTime.day"===e.name?{...e,options:f}:"dateTime.time"===e.name?{...e,disabled:!u,options:v}:"dateTime.startDate"===e.name?{...e,disabled:!u||!h,availableDates:p}:e)})})}var N=i(33392);let k={address:(0,x.Ry)().shape({streetAddress:(0,x.Z_)().required("Street address is required"),streetAddress2:(0,x.Z_)().nullable(),city:(0,x.Z_)().required("City is required"),state:(0,x.Z_)().required("State is required"),zipCode:(0,x.Z_)().required("Zip code is required"),nickname:(0,x.Z_)(),additionalComments:(0,x.Z_)()})},S={billingAddressSource:[{id:"billingAddressSource.serviceAddress",type:"radio",name:"billingAddressSource",label:"Same as service address",value:"serviceAddress"},{id:"billingAddressSource.newAddress",type:"radio",name:"billingAddressSource",label:"Different billing address",value:"newAddress"}]},I={billingAddress:(0,x.Ry)().when("billingAddressSource",{is:"newAddress",then:(0,x.Ry)({streetAddress:(0,x.Z_)().required("Street address is required"),streetAddress2:(0,x.Z_)().nullable(),city:(0,x.Z_)().required("City is required"),state:(0,x.Z_)().required("State is required"),zipCode:(0,x.Z_)().required("Zip code is required")}),otherwise:(0,x.Ry)({streetAddress:(0,x.Z_)(),streetAddress2:(0,x.Z_)().nullable(),city:(0,x.Z_)(),state:(0,x.Z_)(),zipCode:(0,x.Z_)()})})};var P=i(19821),M=i(7279),D=i(79904),O=i(6597),E=i(94959),T=i(85189),A=i(19685),F=i(51023),Z=i(18844),_=i(88403),R=i(18367),L=i(19218),B=i(1137),H=i(78778),q=i(14517);function U(e){let{className:t,errorMessage:i,theme:a="primary"}=e;return(0,n.jsx)(B.M,{children:i&&(0,n.jsx)(H.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:(0,q.Z)(t,"helvetica-14-400 flex w-full p-2 text-ar-beige-light",{"bg-ar-red":"primary"===a,"bg-ar-culinista-black":"secondary"===a}),children:i})})}var W=i(77413),G=i(45606),z=i(64385),$=i(42424),Y=i.n($),V=i(92156);function J(){return{user:[{id:"user.email",type:"text",name:"user.email",label:"Email"}],loginData:[{id:"loginData.email",type:"text",name:"loginData.email",label:"Email"},{id:"loginData.password",type:"password",name:"loginData.password",label:"Password"}],consent:[{id:"consent.newsletter",type:"checkbox",name:"consent.newsletter",label:"Get the keys to hosting with ease. Subscribe to our newsletter.",variant:"squared-checkmark"}]}}let K=(0,x.Ry)().shape({loginData:(0,x.Ry)().shape({email:(0,x.Z_)().required("Email is required").email(b.Om[b.c8.EmailInvalid]),password:(0,x.Z_)().required("Password is required")})});function Q(e){let{containerClassName:t,onComplete:i,returnToCreateAnAccountView:a}=e,{getService:r}=(0,M.o)(),{primaryColor:s,primaryColorAlternative:c}=r(),{registerFormUserData:u}=(0,y.jJ)(),h=J(),[m,f]=(0,l.useState)(null),{loginWithEmailAndPassword:g}=(0,A.a)(),v=async e=>{try{await g(e.loginData.email,e.loginData.password),await i()}catch(e){e instanceof L.U?f((0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("span",{children:[e.getErrorMessage()," "]}),(0,n.jsx)("p",{children:(0,n.jsx)(Y(),{className:"underline",href:V.y.signIn({backToOrder:"true"}),children:"Reset your password here"})})]})):f((0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("span",{children:[e.message," "]}),(0,n.jsx)("p",{children:(0,n.jsx)(Y(),{className:"underline",href:V.y.signIn({backToOrder:"true"}),children:"Reset your password here"})})]}))}};return(0,n.jsx)(p,{className:t,onSubmit:v,defaultValues:{loginData:{email:null==u?void 0:u.email}},formSchema:K,children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.f,{heading:"Welcome back",description:(0,n.jsxs)(n.Fragment,{children:["Not you?"," ",(0,n.jsx)("button",{type:"button",className:"underline",onClick:a,children:"Log in with a different email"}),"."]}),children:[(0,n.jsx)(d.Z,{className:"flex w-full flex-col gap-y-10 md:max-w-[420px]",inputs:h.loginData,...e}),m&&(0,n.jsx)(U,{errorMessage:m})]}),(0,n.jsx)(o.f,{disableBorderAndPadding:!0,children:(0,n.jsx)(Z.k,{className:"w-full md:w-[285px]",type:"submit",textColor:s,backgroundColor:c,loading:e.formState.isSubmitting,children:"Log in"})})]})})}let X=(0,x.Ry)().shape({user:(0,x.Ry)().shape({email:(0,x.Z_)().required("Email is required").email(b.Om[b.c8.EmailInvalid])}),consent:(0,x.Ry)().shape({newsletter:(0,x.O7)()})});function ee(e){let{containerClassName:t,onComplete:i,goToLoginByEmailView:a}=e,{getService:r}=(0,M.o)(),{primaryColor:s,primaryColorAlternative:c}=r(),{setRegisterFormUserData:u}=(0,y.BJ)(),h=J(),[m,f]=(0,l.useState)(!1),[g,v]=(0,l.useState)(null),{loginWithGoogle:x,checkIfAccountExists:b}=(0,A.a)(),j=async e=>{var t;if(!(null==e?void 0:null===(t=e.user)||void 0===t?void 0:t.email))throw Error("Email is required");u({email:e.user.email});try{await b(e.user.email)?a():(e.consent.newsletter&&await (0,z.N)(e.user.email),await i())}catch(e){e instanceof L.U?v(e.getErrorMessage()):v(e.message)}},w=async e=>{f(!0);try{let{email:t}=await x();(null==e?void 0:e.newsletter)&&t&&await (0,z.N)(t),await i()}catch(e){e instanceof L.U?v(e.getErrorMessage()):v(e.message)}finally{f(!1)}};return(0,n.jsx)(p,{className:t,onSubmit:j,formSchema:X,defaultValues:{consent:{newsletter:!0}},children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:"Create an Account",description:(0,n.jsxs)(n.Fragment,{children:["Already have an account?"," ",(0,n.jsx)("button",{type:"button",className:"underline",onClick:a,children:"Log in"}),"."]}),descriptionTransparent:!0,children:(0,n.jsxs)("div",{className:"flex flex-col gap-y-10",children:[(0,n.jsxs)("div",{className:"flex w-full flex-col gap-y-10 md:max-w-[420px]",children:[(0,n.jsx)(R.F,{primaryColor:s,onClick:()=>{w({newsletter:e.getValues("consent.newsletter")})},loading:m}),(0,n.jsx)(_.o,{primaryColor:s,children:"or"}),(0,n.jsx)(d.Z,{inputs:h.user,...e})]}),g&&(0,n.jsx)(U,{errorMessage:g})]})}),(0,n.jsxs)(o.f,{disableBorderAndPadding:!0,children:[(0,n.jsx)(Z.k,{className:"w-full md:w-[285px]",type:"submit",textColor:s,backgroundColor:c,disabled:m,loading:e.formState.isSubmitting,children:"Next"}),(0,n.jsx)(d.Z,{inputs:h.consent,...e})]})]})})}function et(e){let{onComplete:t}=e,i=(0,W.useRouter)(),[a,s]=(0,l.useState)(!1),{setRegisterFormUserData:o,refreshUserToken:d}=(0,y.BJ)(),{getService:c}=(0,M.o)(),{type:u}=c(),[h]=(0,r.F$f)({fetchPolicy:"network-only"}),[m]=(0,r.dv4)({fetchPolicy:"network-only"}),{setServiceAndHouseholdSettings:p}=(0,g.b)(),f=async()=>{await d();try{var e,a,n,s,l,o;if(u===r.UW4.MealPrep){let{data:e}=await m({variables:{input:{serviceType:u}}});(null==e?void 0:e.seriesList.items)&&(null==e?void 0:e.seriesList.items.length)>0&&i.push(G.Z.services(u))}let{data:t}=await h();u===r.UW4.MealPrep?p({householdRules:(null==t?void 0:null===(e=t.customer.householdSettings)||void 0===e?void 0:e.basicHouseholdNotes)||[],householdNotes:null==t?void 0:null===(a=t.customer.householdSettings)||void 0===a?void 0:a.householdNotes}):p({culinaryPreferences:(null==t?void 0:null===(n=t.customer.culinarySettings)||void 0===n?void 0:n.culinaryPreferences)||[],culinaryPreferencesNote:null==t?void 0:null===(s=t.customer.culinarySettings)||void 0===s?void 0:s.otherCulinaryPreferences,householdRules:(null==t?void 0:null===(l=t.customer.householdSettings)||void 0===l?void 0:l.basicHouseholdNotes)||[],householdNotes:null==t?void 0:null===(o=t.customer.householdSettings)||void 0===o?void 0:o.householdNotes})}catch(e){}t()};return a?(0,n.jsx)(Q,{...e,returnToCreateAnAccountView:()=>{s(!1),o(null)},onComplete:f}
1):(0,n.jsx)(ee,{...e,goToLoginByEmailView:()=>{s(!0)},onComplete:f})}let ei=(0,x.Ry)().shape({...k,...N.tj}),ea=(0,x.Ry)().shape({dateTime:(0,x.Ry)().shape({day:(0,x.Z_)().required("Please select a day of the week."),time:(0,x.Z_)().required("Please select a time."),startDate:(0,x.Z_)().required("Please select a start date.")})}),en=(0,x.Ry)().shape({postnatalModule:(0,x.Ry)().shape({isFourthTrimester:(0,x.O7)(),dueDate:(0,x.Z_)().when("isFourthTrimester",{is:!0,then:(0,x.Z_)(),otherwise:(0,x.Z_)().required("Please select your due date.")})}),dateTime:(0,x.Ry)().when("postnatalModule.isFourthTrimester",{is:!0,then:(0,x.Ry)({day:(0,x.Z_)().required("Please select a day of the week."),time:(0,x.Z_)().required("Please select a time."),startDate:(0,x.Z_)().required("Please select a start date.")})})}),er=(0,x.Ry)().shape({account:(0,x.Ry)().shape({email:(0,x.Z_)().required("Please enter your email address.").email(b.Om[b.c8.EmailInvalid]),password:(0,x.Z_)().required("Please enter a password."),confirmPassword:(0,x.Z_)().required("Please confirm your password.").oneOf([(0,x.iH)("password"),null],b.Om[b.c8.PasswordsMustMatch])})});function es(e){var t,i;let a;let{containerClassName:r,stepConfig:s}=e,{user:c,registerFormUserData:u}=(0,y.jJ)(),{setRegisterFormUserData:h}=(0,y.BJ)(),{calculateServiceEstimate:m}=(0,O._)(),x={account:[{id:"account.email",type:"text",name:"account.email",label:"Email",disabled:!0},{id:"account.password",type:"password",name:"account.password",label:"Password"},{id:"account.confirmPassword",type:"password",name:"account.confirmPassword",label:"Confirm Password"}],postnatalModule:[{id:"postnatalModule.dueDate",type:"date",name:"postnatalModule.dueDate",label:"Due Date"},{id:"postnatalModule.isFourthTrimester",type:"checkbox",name:"postnatalModule.isFourthTrimester",label:"Iâm already in my fourth trimester"}],dateTime:[{id:"dateTime.day",type:"select",name:"dateTime.day",label:"Day",options:[]},{id:"dateTime.time",type:"select",name:"dateTime.time",label:"Time",options:[]},{id:"dateTime.startDate",type:"date",name:"dateTime.startDate",label:"Start Date"}],...N.vK},{getSettings:b,setAddress:j,setServiceAndHouseholdSettings:w,setSettings:k,getServiceAndHouseholdSettings:S,getAddress:I}=(0,g.b)(),{goToNextStep:Z}=(0,v.V)(),{getService:_}=(0,M.o)(),{primaryColor:R}=_(),{updateBookingOrderSteps:L}=(0,D.FP)(),{checkIfAccountExists:B}=(0,A.a)(),[H,q]=(0,l.useState)(!c.isLoggedIn&&!u),[U,W]=(0,l.useState)({}),G=(0,l.useCallback)(async()=>{setTimeout(()=>{L.current(),q(!1)},0)},[L]),z=!c.isLoggedIn||c.isLoggedIn&&!c.isAccountCreated&&c.isSignInWithEmailAndPassword,{serviceUsage:$}=S(),Y=$===F.xF,V=async e=>{let{account:t,dateTime:i,address:a,household:n,householdWithAdditionalNotes:r,postnatalModule:s}=e;if(z){let{isValid:e,meetsMinPasswordLength:i,containsLowercaseLetter:a,containsNonAlphanumericCharacter:n,containsNumericCharacter:r,containsUppercaseLetter:s,meetsMaxPasswordLength:l}=await (0,E.uo)(T.I,t.password);if(!e){i?a?n?r?s?l?W({"account.password":"Password is invalid."}):W({"account.password":"Password must be at most 128 characters long."}):W({"account.password":"Password must contain at least one uppercase letter."}):W({"account.password":"Password must contain at least one numeric character."}):W({"account.password":"Password must contain at least one non-alphanumeric character."}):W({"account.password":"Password must contain at least one lowercase letter."}):W({"account.password":"Password must be at least 8 characters long."});return}if(await B(t.email)){W({"account.email":"Account with this email already exists."});return}h({email:t.email,password:t.password})}j(a),w({householdRules:(0,P.UA)({household:n,householdWithAdditionalNotes:r}),householdNotes:r.other||void 0}),Y&&!s.isFourthTrimester?k({startDate:new Date(s.dueDate),time:"600",day:new Date(s.dueDate).getDay().toString()}):k({day:i.day,startDate:i.startDate,time:i.time}),Z()},J=(a=(a=ei).concat(Y?en:ea),z&&(a=a.concat(er)),a),K=S(),Q=b(),X=I();return((0,l.useEffect)(()=>{m()},[m]),(0,l.useEffect)(()=>(H?k({disableSubmitFormButton:!0}):k({disableSubmitFormButton:!1}),()=>{k({disableSubmitFormButton:!1})}),[k,H]),H)?(0,n.jsx)(et,{containerClassName:r,onComplete:G}):(0,n.jsx)(p,{errors:U,className:r,formId:s.id,onSubmit:V,formSchema:J,defaultValues:{...z?{account:{email:null==u?void 0:u.email}}:{},dateTime:{day:Q.day,startDate:Q.startDate,time:Q.time},address:X,household:null===(t=K.householdRules)||void 0===t?void 0:t.filter(e=>"string"==typeof e).reduce((e,t)=>
1(e[t]=!0,e),{}),householdWithAdditionalNotes:null===(i=K.householdRules)||void 0===i?void 0:i.filter(e=>"string"!=typeof e).reduce((e,t)=>((null==t?void 0:t.note)&&(e[t.rule]=t.note),e),{...K.householdNotes?{other:K.householdNotes}:{}})},children:e=>{let{watch:t}=e,i=t("postnatalModule"),a=!!(null==i?void 0:i.isFourthTrimester);return(0,n.jsxs)(n.Fragment,{children:[z&&(0,n.jsxs)(o.f,{heading:"Create Your Account",description:"You'll log into your account to select your dishes each week and modify your service if needed.",children:[(0,n.jsx)(d.Z,{className:"grid gap-7 md:grid-cols-2 md:[&>div:first-child]:col-span-2",inputs:x.account,...e}),(0,n.jsxs)("p",{className:"helvetica-14-400 -mt-6 opacity-70",children:["Password requirements:",(0,n.jsx)("br",{}),"Minimum 6 characters",(0,n.jsx)("br",{}),"Must include 1 lowercase character, 1 uppercase character, number, and 1 non-alphanumeric character.",(0,n.jsx)("br",{})]}),(0,n.jsxs)("p",{className:"helvetica-12-500 -mt-6",children:["Do you want to use a different email address?"," ",(0,n.jsx)("button",{type:"button",className:"underline",onClick:()=>{q(!0),h(null)},children:"Click here"})]})]}),(0,n.jsxs)(o.f,{heading:"When would you like your Culinista chef to arrive each week?",description:"Our meal prep service recurs weekly. Sunday, Monday, and Tuesday slots are in high demand and may have limited availability. We will do our best to find a time that works for you. The chef will be in your home for 3-4 hours during each service. Table service is not includedâplease reach out for a custom quote or to adjust the frequency of your meal prep.",children:[Y&&(0,n.jsx)(d.Z,{className:"grid grid-cols-2 items-center gap-7 md:grid-cols-3 md:[&>div:nth-child(2)]:col-span-2",inputs:x.postnatalModule.map(e=>({...e,disabled:a})),...e}),(!Y||Y&&a)&&(0,n.jsx)(C,{inputs:x.dateTime,...e,children:t=>{let{inputs:i}=t;return(0,n.jsx)(d.Z,{className:"grid grid-cols-2 gap-7 md:grid-cols-3 [&>div:nth-child(3)]:col-span-2 md:[&>div:nth-child(3)]:col-span-1",inputs:i,...e})}})]}),(0,n.jsx)(o.f,{heading:"What is your address?",children:(0,n.jsx)(f.j,{className:"grid grid-cols-3 gap-x-7 gap-y-7 [&>div:nth-child(-n+2)]:col-span-3 [&>div:nth-child(n+6)]:col-span-3",...e,primaryColor:R,updateBookingOrderDetails:!0})}),(0,n.jsx)(o.f,{heading:"What should we know about your household?",description:"These settings will be saved to your account for future bookings.",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{className:"mb-5 grid gap-5",inputs:x.household,...e}),(0,n.jsx)(d.Z,{className:"grid gap-5",inputs:x.householdWithAdditionalNotes,...e})]})})]})}})}var el=i(61954),eo=i(25527),ed=i(9957),ec=i(39957),eu=i(26488),eh=i(78857),em=i(35031),ep=i(15783),ef=i(83679);function eg(e){let{label:t,primaryColor:i,StripeElement:a,icon:r,error:s,onChange:o}=e,[d,c]=(0,l.useState)(null!=s?s:null);return(0,l.useEffect)(()=>{c(null!=s?s:null)},[s]),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("span",{className:(0,q.Z)("helvetica-10-400 block",{"text-ar-red-warning":d}),children:t}),(0,n.jsx)(a,{id:"payment-card-number",className:(0,q.Z)("h-8 overflow-hidden rounded-t border-b border-opacity-40 !bg-transparent",(0,em.M)("border",i||ep.bG.CulinistaBlack),{"border-ar-red-warning border-opacity-100":d}),onChange:e=>{e.error?(c(e.error.message),null==o||o("invalid")):e.empty?null==o||o(""):(e.complete?null==o||o("done"):null==o||o("invalid"),c(null))},options:{style:{base:{lineHeight:"31px",color:ef.COLORS[i||ep.bG.CulinistaBlack],fontWeight:"400",fontFamily:"Helvetica Neue",":-webkit-autofill":{backgroundColor:"transparent"},"::placeholder":{color:ef.COLORS[i||ep.bG.CulinistaBlack]}},invalid:{color:ef.COLORS[ep.bG.RedWarning]},complete:{":-webkit-autofill":{backgroundColor:"transparent"}}}}}),r&&(0,n.jsx)("span",{className:"absolute right-0 top-4",children:r}),d&&(0,n.jsx)(eh.P,{error:d})]})}function ev(e){var t,i,a,r;let{className:s,primaryColor:l,register:o,setValue:d,fieldNames:c,formState:{errors:u}}=e;return(0,n.jsxs)("div",{className:s,children:[(0,n.jsx)(el.j,{containerClassName:"col-span-2",label:"Name on Card",variant:"underlined",...o(c.cardName),error:null===(t=(0,eu.W)(u,c.cardName))||void 0===t?void 0:t.message,primaryColor:l}),(0,n.jsx)(eg,{label:"Credit Card Number",StripeElement:eo.CardNumberElement,icon:(0,n.jsx)(ec.k,{icon:(0,n.jsx)(ed.Z,{}),width:9,height:12}),onChange:e=>d(c.cardNumber,e),error:null===(i=(0,eu.W)(u,c.cardNumber))||void 0===i?void 0:i.message,primaryColor:l}),(0,n.jsx)(eg,{label:"Exp. date",StripeElement:eo.CardExpiryElement,onChange:e=>d(c.expirationDate,e),error:null===(a=(0,eu.W)(u,c.expirationDate))||void 0===a?void 0:a.message,primaryColor:l}),(0,n.jsx)(eg,{label:"CVC",StripeElement:eo.CardCvcElement,onChange:e=>d(c.securityCode,e),error:null===(r=(0,eu.W)(u,c.securityCode))||void 0===r?void 0:r.message,primaryColor:l})]})}var ey=i(52682),ex=i(70967),eb=i(86133),ej=i(74297),ew=i(8431),eC=i(15219);let eN=e=>
1new Date(0,0,parseInt(e,10)).toLocaleString("en-us",{weekday:"long"}).toLocaleLowerCase();function ek(e){let{numberOfPeople:t,portion:i}=e;if(t)return t;if(i)switch(i){case r.YtR.Small:return 2;case r.YtR.Medium:break;case r.YtR.Large:return 6}return 4}function eS(){let{user:e}=(0,y.jJ)(),{getService:t}=(0,M.o)(),{getAddress:i,getSettings:a,getServiceAndHouseholdSettings:n}=(0,g.b)(),{getActiveMenu:s,getSelectedItems:o}=(0,ew.p)(),{registerFormUserData:d,referralValue:c}=(0,y.jJ)(),{refreshUserToken:u}=(0,y.BJ)(),{signUpWithCredentials:h}=(0,A.a)(),[p]=(0,r.NvL)({fetchPolicy:"network-only"}),[f]=(0,r.sHt)({fetchPolicy:"network-only"}),[v]=(0,r.y5R)({fetchPolicy:"network-only"}),[x]=(0,r.ctD)({fetchPolicy:"network-only"}),[b]=(0,r.oCe)({fetchPolicy:"network-only"}),[j]=(0,r.MDt)({fetchPolicy:"network-only"}),[w]=(0,r.AQp)({fetchPolicy:"network-only"}),[C]=(0,r.cY5)({fetchPolicy:"network-only"}),[N]=(0,r.$Hb)({fetchPolicy:"network-only"}),[k]=(0,r.fXT)({fetchPolicy:"network-only"}),[S]=(0,r.DJI)({fetchPolicy:"network-only"}),[I]=(0,r.ez4)({fetchPolicy:"network-only"}),[P]=(0,r.Kqv)({fetchPolicy:"network-only"}),[D]=(0,r.SrD)({fetchPolicy:"network-only"}),[E]=(0,r.GLJ)({fetchPolicy:"network-only"}),[T]=(0,r.AD8)({fetchPolicy:"network-only"}),{getRawCalculation:F}=(0,O._)(),[Z]=(0,r.onq)({fetchPolicy:"network-only"}),{data:_}=(0,r.HQO)({skip:!("isEmailVerified"in e)||e.isEmailVerified}),[R]=(0,r.kO9)({fetchPolicy:"network-only"}),[L]=(0,ex.moU)(),B=(0,eC.u)(),H=(0,W.useRouter)(),q=(0,eo.useStripe)(),U=(0,eo.useElements)(),G=e=>e?(0,ey.Z)(new Date(0,0,0,0,Number(e)),"HH:mm"):"",z=(0,l.useCallback)(async(e,t)=>{let{ingredientFlags:i}=n(),a=e=>e.map(e=>{var t,a;return null===(a=i||[])||void 0===a?void 0:null===(t=a.find(t=>t.id===e.id))||void 0===t?void 0:t.id}).map(e=>{var t,i;return null===(i=B.find(t=>t._id===e))||void 0===i?void 0:null===(t=i.smlenum)||void 0===t?void 0:t.toUpperCase()}).filter(e=>!!e);return e.map(e=>({customInstructions:e.modifyNote,customServings:!e.portion||(null==t?void 0:t.globalPortion)&&e.portion===t.globalPortion?null:ek({portion:e.portion}),dishIngredientRestrictionTags:a(e.allergens||[]),dishName:e.title,dishRefId:e.referenceId,dishRecipeCardUrl:e.recipeCardUrl||"",courseId:e.courseId}))},[B,n]);return{checkoutServiceAsNewCustomer:(0,l.useCallback)(async l=>{var g,y,I;let{customer:P,payment:M,billingAddress:D,howDidYouHearAboutUs:O,otherNotes:E}=l;if(!e.isLoggedIn&&d){if(!(null==d?void 0:d.email)||!(null==d?void 0:d.password))throw Error("Email and password are required");await h(d.email,d.password)}let{data:T}=await C(),A=(null==T?void 0:T.customer)||null,_="",B="";try{let e,l;A?await N({variables:{input:{firstName:P.firstName,lastName:P.lastName,phoneNumber:P.phoneNumber.toString(),dateOfBirth:P.dateOfBirth?(0,ey.Z)(P.dateOfBirth,"yyyy-MM-dd"):void 0,pronouns:r.y1L.NotSpecified,notificationMethods:[]}}}):await p({variables:{input:{firstName:P.firstName,lastName:P.lastName,phoneNumber:P.phoneNumber.toString(),dateOfBirth:P.dateOfBirth?(0,ey.Z)(P.dateOfBirth,"yyyy-MM-dd"):void 0,referralSource:O||null,referralValue:c||null}}});let d=i(),u=a(),h=s(),m=o(),v=t(),x=n(),{data:C}=await f({variables:{input:{additionalComments:d.additionalComments,city:d.city,isDefault:!0,nickname:d.nickname||null,state:d.state,streetAddress:d.streetAddress,streetAddress2:d.streetAddress2||null,zipCode:d.zipCode}}});if(null==C?void 0:C.customer.addAddress.addressId)B=C.customer.addAddress.addressId;else throw Error("Cannot create address");let I=null==U?void 0:U.getElement(eo.CardNumberElement);if(!q||!I)throw Error("Stripe is not initialized. Please try again or contact support if the problem persists.");let T=await q.createToken(I,{name:P.firstName});if(T.error)throw Error(T.error.message);let{data:Z}=await b({variables:{input:{sourceId:T.token.id,nickname:M.cardName||d.nickname||null,setDefault:!0}}});if(await k({variables:{input:{cardId:null==Z?void 0:Z.customer.addPaymentMethod.paymentMethodId,city:(null==D?void 0:D.city)||d.city,state:(null==D?void 0:D.state)||d.state,streetAddress:(null==D?void 0:D.streetAddress)||d.streetAddress,streetAddress2:(null==D?void 0:D.streetAddress2)||d.streetAddress2||null,zipCode:(null==D?void 0:D.zipCode)||d.zipCode}}
1}),null==Z?void 0:Z.customer.addPaymentMethod.paymentMethodId)_=Z.customer.addPaymentMethod.paymentMethodId;else throw Error("Payment method creation failed");let R=await z(m);if(v.type===r.UW4.MealPrep){await new Promise(e=>{setTimeout(()=>e(!0),2e3)});let{data:t}=await w({variables:{input:{dishes:R,addressId:B,arrivalTime:u.arrivalTime?(0,ey.Z)(new Date(u.arrivalTime),"HH:mm"):G(u.time)||null,startTime:u.dinnerTime?(0,ey.Z)(new Date(u.dinnerTime),"HH:mm"):G(u.time)||"00:00",endTime:u.endDate?(0,ey.Z)(new Date(u.endDate),"HH:mm"):null,intendedPaymentMethodId:_,menuIsExtended:!!(null==h?void 0:h.isExtendedMenu),menuSelectionType:r.Q3U.Custom,peopleCount:ek({numberOfPeople:u.numberOfPeople,portion:x.portion}),fixedDates:null,weeklyRepeatMaxOccurrences:null,weeklyRepeatEndDate:null,weeklyRepeatStartDate:u.startDate?(0,ey.Z)(new Date(u.startDate),"yyyy-MM-dd"):"",weeklyRepeatWeekdays:u.day?[eN(u.day)]:[],serviceNotes:E||x.otherNotes||null}}});l=(null==t?void 0:t.series.create.firstServiceId)||"",e=(null==t?void 0:t.series.create.seriesId)||""}else{let t;if((null==h?void 0:h.referenceId)&&v.type===r.UW4.CookingClass){let{data:e}=await L({variables:{id:null==h?void 0:h.referenceId}});t=(null==e?void 0:null===(y=e.cookingClass[0])||void 0===y?void 0:null===(g=y.menu)||void 0===g?void 0:g._id)||null}await new Promise(e=>{setTimeout(()=>e(!0),2e3)});let{data:i}=await j({variables:{input:{addressId:B,intendedPaymentMethodId:_,dishes:R,serviceDate:u.date?(0,ey.Z)(new Date(u.date||u.startDate),"yyyy-MM-dd"):"",arrivalTime:u.arrivalTime?(0,ey.Z)(new Date(u.arrivalTime),"HH:mm"):G(u.time)||null,startTime:u.dinnerTime?(0,ey.Z)(new Date(u.dinnerTime),"HH:mm"):G(u.time)||"",endTime:u.endDate?(0,ey.Z)(new Date(u.endDate),"HH:mm"):void 0,peopleCount:ek({numberOfPeople:u.numberOfPeople,portion:x.portion}),serviceType:v.type,menuIsExtended:!!(null==h?void 0:h.isExtendedMenu),menuRefId:v.type===r.UW4.CookingClass?t:(null==h?void 0:h.referenceId)||null,menuSelectionType:r.Q3U.Culinistas,serviceNotes:x.otherNotes||null}}});l=null==i?void 0:i.service.create.serviceId,e=(null==i?void 0:i.service.create.serviceId)||""}if(l&&_){if(u.promoCodeValue&&await S({variables:{input:{serviceId:l,code:u.promoCodeValue}}}),"undefined"!=typeof fbq){let{total:e}=F();fbq("track","Purchase",{value:e/100,currency:"USD"})}return{newServiceOrSeriesId:e,paymentId:_}}throw Error("Service creation failed")}catch(e){try{if(B){let e=await v();e.data&&await x({variables:{input:{addressId:null===(I=e.data.customer.addresses.find(e=>e.id===B))||void 0===I?void 0:I.id}}})}}catch(e){}try{if(_){let e=await Z();e.data&&await R({variables:{input:{cardId:e.data.paymentMethods.items.find(e=>e.id===_).id}}})}}catch(e){}throw"ACCESS_TOKEN_EXPIRED"===(0,eb.z)(e)&&await u(),Error((0,m.i)(e))}},[f,b,S,p,w,j,x,R,U,s,i,C,v,z,L,Z,F,o,t,n,a,c,u,d,h,q,N,k,e.isLoggedIn]),checkoutServiceAsExistingCustomer:(0,l.useCallback)(async e=>{let{items:t,paymentId:i,billingAddress:a,addressId:s,settings:l,portion:o,serviceType:d,serviceSlug:c,menuIsExtended:h,menuReferenceId:p,creditsAmount:f,otherNotes:g}=e;await (0,ej.JD)();try{let e,u;let m=await z(t);a&&await k({variables:{input:{cardId:i,city:null==a?void 0:a.city,state:null==a?void 0:a.state,streetAddress:null==a?void 0:a.streetAddress,streetAddress2:(null==a?void 0:a.streetAddress2)||null,zipCode:null==a?void 0:a.zipCode}}});let x=n();if(d===r.UW4.MealPrep){await new Promise(e=>{setTimeout(()=>e(!0),2e3)});let{data:t}=await w({variables:{input:{dishes:m,addressId:s,arrivalTime:l.arrivalTime?(0,ey.Z)(new Date(l.arrivalTime),"HH:mm"):G(l.time)||"",startTime:l.dinnerTime?(0,ey.Z)(new Date(l.dinnerTime),"HH:mm"):G(l.time)||"",endTime:l.endDate?(0,ey.Z)(new Date(l.endDate),"HH:mm"):G(l.time)||"",intendedPaymentMethodId:i,menuSelectionType:r.Q3U.Custom,peopleCount:ek({numberOfPeople:l.numberOfPeople,portion:x.portion}),fixedDates:null,weeklyRepeatMaxOccurrences:null,weeklyRepeatEndDate:null,weeklyRepeatStartDate:l.startDate?(0,ey.Z)(new Date(l.startDate),"yyyy-MM-dd"):"",weeklyRepeatWeekdays:l.day?[eN(l.day)]:[],serviceNotes:g||x.otherNotes||null}}});e=(null==t?void 0:t.series.create.firstServiceId)||"",u=(null==t?void 0:t.series.create.seriesId)||""}else{let t;if(p&&d===r.UW4.CookingClass){var v,y;let{data:e}=await L({variables:{id:p}});t=(null==e?void 0:null===(y=e.cookingClass[0])||void 0===y?void 0:null===(v=y.menu)||void 0===v?void 0:v._id)||null}await new Promise(e=>{setTimeout(()=>e(!0),2e3)});let{data:a}=await j({variables:{input:{addressId:s,intendedPaymentMethodId:i,dishes:m,serviceDate:l.date?(0,ey.Z)(new Date(l.date),"yyyy-MM-dd"):"",arrivalTime:l.arrivalTime?(0,ey.Z)(new Date(l.arrivalTime),"HH:mm"):void 0,startTime:l.dinnerTime?(0,ey.Z)(new Date(l.dinnerTime),"HH:mm"):"",endTime:l.endDate?(0,ey.Z)(new Date(l.endDate),"HH:mm"):void 0,peopleCount:ek({numberOfPeople:l.numberOfPeople,portion:o}),serviceType:d,menuIsExtended:!!h,menuRefId:d===r.UW4.CookingClass?t:p||null,menuSelectionType:r.Q3U.Culinistas,serviceNotes:g||x.otherNotes||null}}});e=null==a?void 0:a.service.create.serviceId,u=null==a?void 0:a.service.create.serviceId}if(u&&e&&i){if(l.promoCodeValue&&await S({variables:{input:{serviceId:e,code:l.promoCodeValue}}}),f){let t=(null==_?void 0:_.creditBalance.totalRemainingBalance)===parseFloat(f);await I({variables:{input:{serviceId:e,creditAutoApply:t||null,creditFixedAmount:t?null:parseFloat(f)}}})}if("undefined"!=typeof fbq){let{total:e}=F();fbq("track","Purchase",{value:e/100,currency:"USD"})}H.push(V.y.bookingOrderConfirmation({service:c,id:u,payment:i}))}else throw Error("Service creation failed")}catch(e){throw"ACCESS_TOKEN_EXPIRED"===(0,eb.z)(e)&&await u(),Error((0,m.i)(e))}},[z,n,k,w,j,L,H,S,null==_?void 0:_.creditBalance.totalRemainingBalance,I,F,u]),updateMealPrepService:(0,l.useCallback)(async e=>{let{items:i,serviceId:a,paymentId:n,creditsAmount:r,menuCustomInstru
1ctions:s}=e;try{let e=t(),{data:l}=await E({variables:{input:{serviceId:a}}});await D({variables:{input:{serviceId:a}}});let o=await z(i);if((null==o?void 0:o.length)>0&&await P({variables:{input:{dishes:o,serviceId:a}}}),((null==l?void 0:l.service.intendedPaymentMethodId)!==n||s)&&await T({variables:{input:{serviceId:a,intendedPaymentMethodId:(null==l?void 0:l.service.intendedPaymentMethodId)!==n?n:null,serviceNotes:s||null}}}),r&&(null==l?void 0:l.service.customerCreditApplications.length)===0){let e=(null==_?void 0:_.creditBalance.totalRemainingBalance)===parseFloat(r);await I({variables:{input:{serviceId:a,creditAutoApply:e,creditFixedAmount:e?null:parseFloat(r)}}})}if("undefined"!=typeof fbq){let{total:e}=F();fbq("track","Purchase",{value:e/100,currency:"USD"})}H.push(V.y.bookingOrderConfirmation({service:e.slug,id:a,payment:n}))}catch(e){throw Error((0,m.i)(e))}},[t,E,D,z,H,P,T,null==_?void 0:_.creditBalance.totalRemainingBalance,I,F])}}var eI=i(75738);function eP(){let e=(0,eC.u)(),[t]=(0,r.JzX)(),[i]=(0,r.mEZ)(),a=t=>t.map(t=>{var i,a;return null===(a=e.find(e=>e._id===t.id))||void 0===a?void 0:null===(i=a.smlenum)||void 0===i?void 0:i.toUpperCase()}).filter(e=>!!e);return{updateCulinaryAndHousehold:async e=>{var n;await t({variables:{input:{culinaryPreferences:(0,P.bh)({culinaryPreferences:e.culinaryPreferences})||[],otherCulinaryPreferences:(null===(n=e.culinaryPreferences)||void 0===n?void 0:n.other)||"",ingredientRestrictions:e.ingredientFlags?a(e.ingredientFlags):[]}}});let r={basicHouseholdNotes:Object.keys(e.household).filter(t=>e.household[t]),householdNotesWithAdditionalInfo:Object.keys(e.householdWithAdditionalNotes).filter(t=>"other"!==t&&e.householdWithAdditionalNotes[t]&&e.householdWithAdditionalNotes[t]!==eI.W).map(t=>({additionalInfo:e.householdWithAdditionalNotes[t],extendedHouseholdNote:t})),householdNotes:e.householdWithAdditionalNotes.other&&e.householdWithAdditionalNotes.other!==eI.W&&e.householdWithAdditionalNotes.other||""};await i({variables:{input:{...r}}})},updateCulinaryAndHouseholdSettings:async e=>{var n,r;let s={basicHouseholdNotes:null===(n=e.householdRules)||void 0===n?void 0:n.filter(e=>"string"==typeof e),householdNotesWithAdditionalInfo:null===(r=e.householdRules)||void 0===r?void 0:r.filter(e=>"string"!=typeof e).map(e=>"object"==typeof e?{additionalInfo:(null==e?void 0:e.note)||"",extendedHouseholdNote:e.rule||""}:null).filter(e=>!!e),householdNotes:e.householdNotes||""};await i({variables:{input:s}});let l={culinaryPreferences:e.culinaryPreferences||[],otherCulinaryPreferences:e.culinaryPreferencesNote||"",ingredientRestrictions:e.ingredientFlags?a(e.ingredientFlags):[]};await t({variables:{input:l}})}}}var eM=i(46543),eD=i(23739);let eO={cardName:"paymentDetails.cardName",cardNumber:"paymentDetails.cardNumber",expirationDate:"paymentDetails.expirationDate",securityCode:"paymentDetails.securityCode"},eE=(0,x.Ry)().shape({clientInformation:(0,x.Ry)().shape({firstName:(0,x.Z_)().required("First name is required"),lastName:(0,x.Z_)().required("Last name is required"),phoneNumber:(0,x.Rx)().required("Phone number is required").typeError(b.Om[b.c8.PhoneInvalid]).test("len",b.Om[b.c8.PhoneInvalid],e=>(null==e?void 0:e.toString().length)===10),dateOfBirth:(0,x.Z_)().nullable().test("is-date","Please enter valid date of birth",e=>{if(!e)return!0;if(10!==e.trim().length)return!1;let t=(0,eM.Z)(e,"MM/dd/yyyy",new Date);return(0,eD.Z)(t)})}),paymentDetails:(0,x.Ry)().shape({cardName:(0,x.Z_)().required("Cardholder's name is required"),cardNumber:(0,x.Z_)().required("Card number is required"),expirationDate:(0,x.Z_)().required("Expiration date is required"),securityCode:(0,x.Z_)().required("Security code is required")}),howDidYouHearAboutUs:(0,x.Z_)(),consent:(0,x.Ry)().shape({termsOfService:(0,x.O7)().required("You must agree to the terms of service").oneOf([!0],"You must agree to the terms of service")}),...I});function eT(e){let{containerClassName:t,stepConfig:i}=e,a=(0,W.useRouter)(),{calculateServiceEstimate:s}=(0,O._)(),c={clientInformation:[{id:"clientInformation.firstName",type:"text",name:"clientInformation.firstName",label:"First Name"},{id:"clientInformation.lastName",type:"text",name:"clientInformation.lastName",label:"Last Name"},{id:"clientInformation.phoneNumber",type:"text",name:"clientInformation.phoneNumber",label:"Phone Number"},{id:"clientInformation.dateOfBirth",type:"dateString",name:"clientInformation.dateOfBirth",label:"Date of Birth (optional)",maxDate:new Date}],...S,orderAdditionalNotes:[{id:"orderAdditionalNotes.note",type:"textarea",
1name:"orderAdditionalNotes.note",rows:6}],howDidYouHearAboutUs:[{id:"howDidYouHearAboutUs",type:"select",name:"howDidYouHearAboutUs",placeholder:"Select One",options:[{label:"Google Search",value:"google"},{label:"Word of Mouth",value:"wordOfMouth"},{label:"Chef Referral",value:"chefReferral"},{label:"Culinistas Event",value:"culinistasEvent"},{label:"Article / Publication",value:"articlePublication"},{label:"Instagram",value:"instagram"},{label:"Facebook",value:"facebook"}]}],consent:[{id:"consent.termsOfService",type:"checkbox",name:"consent.termsOfService",label:(0,n.jsxs)(n.Fragment,{children:["I agree to the"," ",(0,n.jsx)(Y(),{href:V.y.termsOfService(),className:"underline",target:"_blank",children:"Terms of Service"})]}),variant:"squared-checkmark"}]},{getService:u}=(0,M.o)(),{primaryColor:h,slug:m,type:v}=u(),[y,x]=(0,l.useState)(null),{checkoutServiceAsNewCustomer:b}=eS(),{getServiceAndHouseholdSettings:j}=(0,g.b)(),{updateCulinaryAndHouseholdSettings:w}=eP(),C=j(),N=async e=>{let{clientInformation:t,paymentDetails:i,howDidYouHearAboutUs:n,billingAddressSource:r,billingAddress:s,orderAdditionalNotes:l}=e,{newServiceOrSeriesId:o,paymentId:d}=await b({customer:{firstName:t.firstName,lastName:t.lastName,phoneNumber:t.phoneNumber,dateOfBirth:t.dateOfBirth?(0,eM.Z)(t.dateOfBirth,"MM/dd/yyyy",new Date):void 0},payment:{cardName:i.cardName},billingAddress:"newAddress"===r?s:void 0,howDidYouHearAboutUs:n,otherNotes:(null==l?void 0:l.note)||(null==C?void 0:C.otherNotes)||void 0});try{await w(C)}catch(e){x(e.message)}finally{o&&d&&a.push(V.y.bookingOrderConfirmation({service:m,id:o,payment:d}))}};return(0,l.useEffect)(()=>{s()},[s]),(0,n.jsx)(p,{className:t,formId:i.id,onSubmit:N,defaultValues:{billingAddressSource:"serviceAddress"},formSchema:eE,children:e=>{let{watch:t}=e,a=t("billingAddressSource");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:"Client Information",children:(0,n.jsx)(d.Z,{className:"grid gap-7 md:grid-cols-2",inputs:c.clientInformation,...e})}),(0,n.jsxs)(o.f,{heading:"Payment Details",description:(0,n.jsxs)(n.Fragment,{children:["Your credit card will be authorized upon checkout, and you will be charged 2-3 business days after your service date. You are able to cancel your service at any time prior to 48 hours before your service time free of charge. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{href:V.y.faqBilling(),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]}),children:[(0,n.jsx)(ev,{className:"grid grid-cols-2 gap-7 [&>div:first-child]:col-span-2 [&>div:nth-child(2)]:col-span-2",fieldNames:eO,...e,primaryColor:h}),(0,n.jsxs)(o.f,{heading:"Billing Address",disableBorderAndPadding:!0,children:[(0,n.jsx)(d.Z,{className:(0,q.Z)("flex flex-col gap-5 [&>div:first-child]:border-b [&>div:first-child]:border-opacity-40 [&>div:first-child]:pb-5",(0,em.M)("[&>div:first-child]:border",h)),inputs:c.billingAddressSource,...e}),"newAddress"===a&&(0,n.jsx)(f.j,{className:"grid grid-cols-3 gap-x-7 gap-y-7 [&>div:nth-child(-n+2)]:col-span-3 [&>div:nth-child(n+6)]:col-span-3",variant:"simple",fieldName:"billingAddress",...e,primaryColor:h,disableZipCodeValidation:!0})]})]}),(0,n.jsx)(o.f,{heading:"How did you hear about us?",children:(0,n.jsx)(d.Z,{className:"grid gap-7 md:grid-cols-2",inputs:c.howDidYouHearAboutUs,...e})}),v===r.UW4.MealPrep&&(0,n.jsx)(o.f,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"helvetica-14-500 mb-5",children:i.dictionary.orderAdditionalNotesHeading}),(0,n.jsx)(d.Z,{...e,inputs:c.orderAdditionalNotes})]})}),(0,n.jsx)(o.f,{disableBorderAndPadding:!0,children:(0,n.jsx)(d.Z,{inputs:c.consent,...e})}),y&&(0,n.jsx)(U,{errorMessage:y}),(0,n.jsx)(o.f,{className:"mt-7",heading:"Billing & Cancellation",descriptionTransparent:!0,disableBorderAndPadding:!0,description:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:"All services are billed with 20% gratuity included, 100% of which will go to your Culinista\xae chef. While there is no expectation to do so, you are welcome to provide an additional cash tip for extraordinary service."}),(0,n.jsx)("li",{children:"Your credit card will be authorized upon checkout and you will be charged 2-3 business days after your service date."}),(0,n.jsxs)("li",{children:["You are able to cancel your service at any time prior to 48 hours before your service time free of charge. If you cancel for any reason between 48 hours and 24 hours before your service time, you will be charged 50% of the service fee to partially compensate your chef. If you cancel within 24 hours of your service, you will be charged the full service fee plus any charges incurred by the chef, inclusive of groceries and travel at the companyâs discretion. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{href:V.y.faqBilling(),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]})]})})]})}})}var eA=i(48095),eF=i(77837),eZ=i.n(eF),e_=i(43359),eR=i(89663),eL=i(93427);function eB(e){let{selectedValues:t,searchValue:i,onValueChange:a}=e;return(0,n.jsxs)("div",{className:"my-7 flex flex-col gap-y-7 px-8",children:[i&&(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("span",{className:"helvetica-12-400",children:"Search results for"}),(0,n.jsxs)("p",{className:"flex gap-1",children:[(0,n.jsx)("span",{className:"helvetica-18",children:i}),(0,n.jsx)("button",{type:"button",onClick:()=>a({name:"search",value:""}),className:"p-1",children:(0,n.jsx)(ec.k,{width:11,height:11,icon:(0,n.jsx)(eL.Z,{})})})]})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-4",children:t.map(e=>{let{type:t,name:i,label:r}=e;return(0,n.jsxs)("button",{type:"button",onClick:()=>a({name:i,value:!1}),className:(0,q.Z)("helvetica-12-500 flex h-6 shrink-0 items-center gap-2.5 px-1.5",{"bg-ar-brown bg-opacity-10":"season"===t||"category"===t,"bg-ar-navy-light bg-opacity-50":"format"===t||"cuisine"===t,"bg-ar-green-light bg-opacity-50":"collection"===t}),children:[r,(0,n.jsx)(ec.k,{icon:(0,n.jsx)(eR.Z,{}),size:8})]},i)})})]})}var eH=i(27623),eq=i(2059);function eU(e){let{filters:t,isSearchFocused:i,activeFilterName:a,showDropdown:r,onFilterBoxClick:s,containerComponent:l}=e,{watch:o,getValues:d}=(0,c.Gc)(),u=o();return(0,n.jsx)(n.Fragment,{children:t.map(e=>{let t=u[e.name]&&Object.keys(u[e.name]).filter(t=>u[e.name][t]).length;return(0,n.jsxs)(l,{className:(0,q.Z)("flex max-w-[264px]",{"!w-0":i,"[&>div]:justify-center":e.centerBoxContent}),onClick:s(e.name),children:[(0,n.jsxs)("div",{className:(0,q.Z)("flex items-center gap-2"),children:[e.additionalLabelIcon&&(0,n.jsx)(ec.k,{icon:e.additionalLabelIcon,size:14}),(0,n.jsxs)("p",{children:[e.label,t?" (".concat(t,")"):""]})]}),!e.hideDropdownArrow&&(0,n.jsx)(ec.k,{className:(0,q.Z)("transition",{"rotate-180":a===e.name&&r}),icon:(0,n.jsx)(eq.Z,{}),size:10})]},e.name+d(e.name))})})}var eW=i(16265);function eG(){return(eG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e}).apply(this,arguments)}var ez=function(e){return l.createElement("svg",eG({viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=l.createElement("path",{d:"M11 1 1 11M11 11 1 1",stroke:"currentColor"})))};let e$={isFiltersDropdownOpen:!1,searchResultLoading:!1,searchResults:[],handleSearchResultClick:()=>{},handleGridCardClick:()=>{},setIsFiltersDropdownOpen:()=>{},handleSearchValueChange:()=>{}},eY=(0,l.createContext)(e$);function eV(e){let{onFocusChange:t,setActiveFilterName:i}=e,[a,r]=(0,l.useState)(!1),{watch:s,register:o,getValues:d,setValue:u}=(0,c.Gc)(),{setIsFiltersDropdownOpen:h,handleSearchValueChange:m}=(0,l.useContext)(eY),p=(0,l.useRef)(null),f=s("search")||"";(0,l.useEffect)(()=>{let e=e=>{if("Enter"===e.key){var t;e.preventDefault();let i=document.getElementById("selection-module-filters-with-search");i&&("function"==typeof i.requestSubmit?i.requestSubmit():i.dispatchEvent(new Event("submit",{cancelable:!0}))),h(!1),null===(t=p.current)||void 0===t||t.blur()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[h]),(0,l.useEffect)(()=>{t(a)},[a,t]);let{onChange:g,onBlur:v,name:y,ref:x}=o("search",{onBlur:()=>{r(!1)},onChange:e=>{m({...d(),search:e.target.value})}});return(0,n.jsxs)("label",{htmlFor:"filters-bar-search",className:"relative flex h-full w-full items-center px-8",children:[(0,n.jsx)("input",{id:"filters-bar-search",className:"peer absolute left-12 right-0 top-1/2 ml-4 h-full -translate-y-1/2 border-0 bg-transparent pr-8 !outline-none focus-visible:!right-0 focus-visible:outline-none",type:"text",autoComplete:"one-time-code",onFocus:e=>{m({...d(),search:e.target.value}),r(!0),h(!0),i("search")},onChange:g,onBlur:v,name:y,ref:e=>{x(e),p.current=e}}),(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(eW.Z,{}),size:16}),(0,n.jsx)("p",{className:(0,q.Z)("helvetica-14-500 ml-4 mr-2 opacity-100 peer-focus:hidden",{"!hidden":f.length}),children:"Search"}),(0,n.jsx)("p",{className:(0,q.Z)("helvetica-14-500 ml-4 mr-2 hidden whitespace-nowrap opacity-100 peer-focus:block",{"!hidden":f.length}),children:"Search by ingredient or by dish"}),(0,n.jsx)("p",{className:(0,q.Z)("truncate opacity-40 peer-focus:hidden",{"!hidden":f.length}),children:"salmon, Passover, Greek, gluten free"}),(0,n.jsx)("p",{className:(0,q.Z)("hidden truncate whitespace-nowrap opacity-40 peer-focus:block",{"!hidden":f.length}),children:"ex: salmon, oats, pasta, zucchini nuggets"}),(0,n.jsx)("button",{type:"submit",className:"absolute right-4 top-1/2 z-10 -translate-y-1/2",onClick:()=>{m({search:""}),u("search",""),h(!1)},children:(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(ez,{}),size:16})})]})}var eJ=i(78807);let eK=(0,l.forwardRef)((e,t)=>{let{activeFilter:i}=e,{register:a}
1=(0,c.Gc)(),{getService:r}=(0,M.o)(),{primaryColor:s,primaryColorAlternative:o}=r(),{searchResults:d,searchResultLoading:u,handleSearchResultClick:h,isFiltersDropdownOpen:m,setIsFiltersDropdownOpen:p}=(0,l.useContext)(eY),f=(0,em.M)("text",s),g=(0,em.M)("hover:bg",o),v=(null==i?void 0:i.options)||[];return(0,n.jsxs)("div",{ref:t,className:"absolute top-full z-40 w-full overflow-hidden bg-ar-beige-light shadow-dropdown transition-all duration-200",style:{maxHeight:m?"500px":"0px"},children:[!i&&(0,n.jsxs)("div",{className:"flex w-full flex-col items-start justify-start py-8",children:[!d.length&&(0,n.jsx)("p",{className:"self-center",children:"Can't find what you're looking for? Try a different search term."}),d.slice(0,5).map(e=>(0,n.jsx)("button",{type:"button",className:(0,q.Z)("helvetica-14-400 h-9 w-full px-8 text-left hover:bg-opacity-20",f,g),onClick:()=>h(e.id),children:e.title},e.id)),(0,n.jsxs)("div",{className:"mt-10 flex items-center gap-4 px-8",children:[(0,n.jsxs)(Z.k,{type:"submit",variant:Z.$.ServiceCard,className:"w-[312px]",backgroundColor:o,textColor:s,onClick:()=>{p(!1)},children:["See ",d.length," Results"]}),u&&(0,n.jsx)(eA.U,{className:"opacity-40"})]})]}),(null==i?void 0:i.name)&&(0,n.jsxs)("div",{className:"m-8 flex flex-col gap-10",children:[(null==i?void 0:i.heading)&&(0,n.jsx)("h2",{className:(0,q.Z)("editorial-24",f),children:i.heading}),(0,n.jsx)("div",{className:(0,q.Z)((()=>{switch(null==i?void 0:i.layout){case"two-columns":return"grid grid-cols-2 gap-4 w-1/2";case"three-columns":return"grid grid-cols-3 gap-4 w-full";case"row":return"w-full flex gap-x-10 gap-y-4 flex-wrap";default:return"flex gap-4"}})()),children:v.map(e=>(0,n.jsx)(eJ.E,{id:"cb-".concat(e.name),primaryColor:s,label:e.label,...a(e.name)},(e.id||e.name)+i.name))}),(0,n.jsxs)("div",{className:"flex justify-start gap-4",children:[(0,n.jsx)(Z.k,{type:"submit",variant:Z.$.ServiceCard,className:"w-[312px]",backgroundColor:o,textColor:s,onClick:()=>{p(!1)},children:(null==i?void 0:i.submitButtonTitle)||"See Results"}),!(null==i?void 0:i.hideClearAllButton)&&(0,n.jsx)("button",{id:"form-reset-button-".concat(i.name),type:"submit",className:(0,q.Z)("helvetica-14-400",f),onClick:()=>{p(!1)},children:"Clear All"})]})]})]})});function eQ(e){let{children:t,className:i,onClick:a,component:r="button"}=e,{getService:s}=(0,M.o)(),{primaryColor:l}=s(),o=(0,em.M)("border",l);return(0,n.jsx)(r,{type:"button"===r?"button":void 0,onClick:a,className:(0,q.Z)("h-16 w-full overflow-hidden border-opacity-40 transition-all duration-200",o,i),children:(0,n.jsx)("div",{className:"helvetica-14-400 relative flex h-full w-full items-center justify-between px-8",children:t})})}function eX(e){let{filters:t}=e,[i,a]=(0,l.useState)(!1),[r,s]=(0,l.useState)(),{isFiltersDropdownOpen:o,setIsFiltersDropdownOpen:d}=(0,l.useContext)(eY),c=r?t.find(e=>e.name===r):void 0,u=(0,l.useRef)(null),h=(0,l.useRef)(null),m=(0,l.useRef)(null),{getService:p}=(0,M.o)(),{primaryColor:f}=p(),g=(0,em.M)("border",f);return(0,eH.t)(u,()=>{d(!1)}),(0,l.useLayoutEffect)(()=>{let e=h.current,t=m.current;e&&t&&(t.style.top="".concat(e.getBoundingClientRect().top,"px"))},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"relative w-full bg-ar-beige-light",ref:u,children:[(0,n.jsxs)("div",{className:(0,q.Z)("flex w-full border-b border-opacity-40 [&>*:not(:last-child)]:border-r",g),children:[(0,n.jsx)(eU,{filters:t,isSearchFocused:i,activeFilterName:r,showDropdown:o,onFilterBoxClick:e=>()=>{s(e),e===r&&o?d(!1):d(!0)},containerComponent:eQ}),(0,n.jsx)(eQ,{component:"div",className:(0,q.Z)("[&>*]:px-0",{"w-full":i}),children:(0,n.jsx)(eV,{onFocusChange:a,setActiveFilterName:s})})]}),(0,n.jsx)(eK,{ref:h,activeFilter:c})]})})}var e0=i(19563);function e1(e){let{closeModal:t,filters:i,itemsCount:a}=e,{watch:r,register:s}=(0,c.Gc)(),{getService:o}=(0,M.o)(),{primaryColor:d,primaryColorAlternative:u}=o(),h=(0,em.M)("border-b",d),m=(0,em.M)("text",d),[p,f]=(0,l.useState)([]),g=r(),v=e=>()=>{f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},y=e=>g[e]&&Object.keys(g[e]).filter(t=>g[e][t]).length;return(0,n.jsxs)(H.E.div,{className:"fixed inset-0 z-60 flex flex-col overflow-y-auto bg-ar-beige-light pb-[60px]",initial:{opacity:0,scale:.95}
1,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2},children:[(0,n.jsxs)("header",{className:(0,q.Z)("editorial-24 flex justify-between border-b border-opacity-40 p-5",h),children:["Filters",(0,n.jsx)("button",{className:"flex h-6 w-6 items-center justify-center",title:"Close",type:"button",onClick:t,children:(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(ez,{}),size:16})})]}),(0,n.jsx)("div",{className:"px-5 pb-5",children:i.map(e=>(0,n.jsxs)("div",{className:(0,q.Z)("border-b border-opacity-40",h,{"pb-5":p.includes(e.name)}),children:[(0,n.jsxs)("button",{type:"button",className:(0,q.Z)("helvetica-14-500 flex h-16 w-full items-center justify-between"),onClick:v(e.name),children:[(0,n.jsxs)("span",{children:[e.label," ",y(e.name)?"(".concat(y(e.name),")"):""]}),(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(e0.Z,{}),size:14})]}),(0,n.jsx)(B.M,{children:p.includes(e.name)&&(0,n.jsx)(H.E.div,{className:"grid grid-cols-2 gap-x-10 gap-y-2.5 overflow-hidden",initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:e.options.map(e=>(0,n.jsx)("div",{className:"",children:(0,n.jsx)(eJ.E,{primaryColor:d,label:e.label,...s(e.name)},e.label)}))})})]},e.name))}),(0,n.jsxs)("footer",{className:(0,q.Z)("sticky bottom-0 flex h-20 w-full items-center justify-between gap-5 border-t border-opacity-40 bg-ar-beige-light px-5 py-3",h),children:[(0,n.jsx)("button",{type:"submit",id:"form-reset-button",className:(0,q.Z)("helvetica-14-400",m),onClick:()=>{t()},children:"Clear All"}),(0,n.jsxs)(Z.k,{type:"submit",variant:Z.$.ServiceCard,className:"flex-1",backgroundColor:u,textColor:d,onClick:()=>{t()},children:["See ",a," Results"]})]})]})}var e4=i(71434);function e2(e){let{closeModal:t}=e,i=(0,l.useRef)(null),{register:a,setValue:r}=(0,c.Gc)(),{getService:s}=(0,M.o)(),{primaryColor:o,primaryColorAlternative:d}=s(),u=(0,em.M)("border-b",o),h=(0,em.M)("text",o),{searchResults:m,searchResultLoading:p,handleSearchResultClick:f,handleSearchValueChange:g,setIsFiltersDropdownOpen:v}=(0,l.useContext)(eY),y=e=>{f(e.id),t()};return(0,l.useEffect)(()=>(i.current&&(0,e4.dR)(i.current),()=>{(0,e4.Un)()}),[]),(0,n.jsxs)(H.E.div,{ref:i,className:"fixed left-0 top-0 z-60 flex h-[calc(100dvh-60px)] w-screen flex-col justify-start overflow-y-auto bg-ar-beige-light",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2},children:[(0,n.jsxs)("header",{className:(0,q.Z)("flex justify-between gap-4 p-5"),children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("h4",{className:"editorial-24",children:"Search"}),(0,n.jsx)("p",{children:"Don't see what you want? Choose something else from our curated dish library."})]}),(0,n.jsx)("button",{className:"flex h-6 w-6 items-center justify-center",title:"Close",type:"button",onClick:t,children:(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(ez,{}),size:16})})]}),(0,n.jsxs)("div",{className:"flex flex-col px-8",children:[(0,n.jsxs)("label",{htmlFor:"filters-bar-search",className:(0,q.Z)("relative flex w-full items-center border-b border-opacity-60",u),children:[(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(eW.Z,{}),size:16}),(0,n.jsx)("input",{id:"filters-bar-search",className:(0,q.Z)("helvetica-14-500 peer ml-4 flex-1 border-0 bg-transparent py-2.5 !outline-none focus-visible:!right-0 focus-visible:outline-none",h),type:"text",placeholder:"Search by ingredient or dish",autoComplete:"one-time-code",...a("search")}),(0,n.jsx)("button",{type:"submit",className:"absolute right-4 top-1/2 z-10 -translate-y-1/2",onClick:()=>{g({search:""}),r("search",""),v(!1)},children:(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(ez,{}),size:16})})]}),!m.length&&(0,n.jsx)("p",{className:(0,q.Z)("helvetica-10-400 mt-2.5 opacity-60",h),children:"ex: salmon, oats, pasta, zucchini nuggets"}),!p&&!m.length&&(0,n.jsx)("p",{className:"mt-8 self-center",children:"Can't find what you're looking for? Try a different search term."}),(0,n.jsx)("div",{className:"mt-8 flex flex-col",children:m.slice(0,5).map(e=>(0,n.jsx)("button",{type:"submit",className:(0,q.Z)("helvetica-14-400 h-9 w-full text-left",h),onClick:()=>y(e),children:e.title}))}
1),p&&(0,n.jsx)(eA.U,{className:"mt-4 shrink-0 self-center opacity-40"})]}),(0,n.jsx)("footer",{className:(0,q.Z)("absolute bottom-0 flex h-20 w-full items-center justify-between gap-5 border-t border-opacity-40 px-5",u),children:(0,n.jsxs)(Z.k,{type:"submit",variant:Z.$.ServiceCard,className:"flex-1",backgroundColor:d,textColor:o,onClick:()=>{t()},children:["See ",m.length," Results"]})})]})}function e3(e){let{filters:t,itemsCount:i}=e,[a,r]=(0,l.useState)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"relative w-full bg-ar-beige-light",children:(0,n.jsxs)("div",{className:"flex h-12 w-full border-b [&>*:not(:last-child)]:border-r",children:[(0,n.jsx)("button",{title:"Filters",type:"button",className:"helvetica-13-500 flex flex-1 items-center justify-start px-5",onClick:()=>r("filters"),children:"Filters"}),(0,n.jsx)("button",{title:"Search",type:"button",className:"flex w-14 items-center justify-center",onClick:()=>r("search"),children:(0,n.jsx)(ec.k,{className:"shrink-0",icon:(0,n.jsx)(eW.Z,{}),size:16})})]})}),(0,n.jsxs)(B.M,{children:["filters"===a&&(0,n.jsx)(e1,{filters:t,itemsCount:i,closeModal:()=>r(void 0)}),"search"===a&&(0,n.jsx)(e2,{itemsCount:i,closeModal:()=>r(void 0)})]})]})}function e5(e){let{filters:t,onSubmit:i,itemsCount:a,initialFormValues:r}=e,s=(0,e_.a)(1240),l=(0,c.cI)({defaultValues:r}),o=l.watch(),d=(e,t)=>{var a,n,r,s;if(null==t?void 0:null===(n=t.nativeEvent)||void 0===n?void 0:null===(a=n.submitter)||void 0===a?void 0:a.id.startsWith("form-reset-button")){let i=null==t?void 0:null===(s=t.nativeEvent)||void 0===s?void 0:null===(r=s.submitter)||void 0===r?void 0:r.id.split("form-reset-button-")[1];e=i?{...e,[i]:Object.keys(e[i]).reduce((e,t)=>(e[t]=!1,e),{})}:Object.keys(e).reduce((t,i)=>("object"==typeof e[i]?t[i]=Object.keys(e[i]).reduce((e,t)=>(e[t]=!1,e),{}):t[i]=e[i],t),{}),l.reset(e)}let o=Object.entries(e).reduce((e,t)=>{let[i,a]=t;return"object"==typeof a&&null!==a?Object.keys(a).forEach(t=>{a&&a[t]&&(e[i]||(e[i]={}),e[i][t]=a[t].toString())}):e[i]=a,e},{});null==i||i(o)},u=t.reduce((e,t)=>(t.doNotDisplayOnSelectedFiltersList||t.options.forEach(i=>{var a;(null===(a=o[t.name])||void 0===a?void 0:a[i.name.split(".")[1]])&&e.push({type:t.name,...i})}),e),[]);return(0,n.jsx)(c.RV,{...l,children:(0,n.jsxs)("form",{id:"selection-module-filters-with-search",className:"sticky top-[56px] z-40 bg-ar-beige-light",onSubmit:l.handleSubmit(d),children:[!s&&(0,n.jsx)(eX,{filters:t,itemsCount:a}),s&&(0,n.jsx)(e3,{filters:t,itemsCount:a}),(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsx)(eB,{selectedValues:u,searchValue:o.search,onValueChange:e=>{let{value:t,name:i}=e;l.setValue(i,t),l.handleSubmit(d)()}}),(0,n.jsxs)("span",{className:"helvetica-12-400 mr-8 mt-8 shrink-0",children:[a," Results"]})]})]})})}var e7=i(13966),e8=i(54100),e6=i.n(e8),e9=i(15913),te=i(34408),tt=i(69416),ti=i.n(tt);function ta(e){let{imageAlt:t,imageUrl:i,title:a,slug:r,id:s,onClick:l,...o}=e,d="";return"qualifier"in o&&(d=o.qualifier),(0,n.jsxs)(H.E.div,{className:"flex w-full cursor-pointer flex-col bg-white",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:l,children:[i&&(0,n.jsx)("figure",{className:"relative h-[330px] w-full",children:(0,n.jsx)(e6(),{src:i,alt:t,objectFit:"cover",fill:!0})}),!i&&(0,n.jsx)("div",{className:"flex h-[330px] w-full items-center justify-center bg-ar-green-light",children:(0,n.jsx)("span",{className:"helvetica-10-400 text-ar-green opacity-40",children:"No Image"})}),(0,n.jsxs)("div",{className:"px-5 py-8",children:[(0,n.jsxs)("header",{className:"flex gap-7",children:[(0,n.jsx)("span",{className:"helvetica-10-500",children:"Menu"}),(0,n.jsx)("span",{className:"helvetica-10-400",children:d})]}),(0,n.jsx)("h2",{className:"editorial-28 mb-8 mt-24",children:a})]})]})}function tn(e){let{imageAlt:t,imageUrl:i,title:a,slug:r,id:s,onClick:o,...d}=e,[c,u]=(0,l.useState)(),{getSelectedItemsLimit:h,getSelectedItems:m}=(0,ew.p)(),{getService:p}=(0,M.o)(),{setSettings:f,getServiceAndHouseholdSettings:v}=(0,g.b)(),y=h(),x=m(),{ingredientFlags:b}=v(),{primaryColor:j}=p(),w=m().some(e=>e.referenceId===s),C=(0,em.M)("border",j),N="",k=[];return"ingredientList"in d&&(N=d.ingredientList),"allergens"in d&&(k=d.allergens.filter(e=>b&&b.find(t=>t.id===e.id))),(0,n.jsx)(H.E.div,{className:(0,q.Z)(ti().DishTile,"relative w-full cursor-pointer border-l border-opacity-40 px-7",C),initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:()=>{x.some(e=>e.referenceId===s)?o():x.length<y?o():(u("You've reached the maximum number of items"),setTimeout(()=>{u(void 0)},3e3))},children:(0,n.jsxs)("div",{className:"relative flex flex-col",children:[i&&(0,n.jsx)("figure",{className:"relative h-[370px] w-full",children:(0,n.jsx)(e6(),{src:i,alt:t,objectFit:"cover",fill:!0})}),!i&&(0,n.jsx)("div",{className:"flex h-[370px] w-full items-center justify-center bg-ar-green",children:(0,n.jsx)("span",{className:"helvetica-10-400 text-ar-green-light opacity-40",children:"No Image"})}),(0,n.jsxs)("div",{className:"absolute top-[320px] flex w-full gap-2.5 px-2.5",children:[(0,n.jsx)("button",{type:"button",title:"Add",className:(0,q.Z)("flex h-8 w-8 items-center justify-center ",{"bg-ar-green text-ar-green-light":!w,"bg-ar-green-light text-ar-green":w}),children:(0,n.jsx)(ec.k,{icon:w?(0,n.jsx)(te.Z,{}):(0,n.jsx)(e0.Z,{}),size:14})}),w&&(0,n.jsxs)("button",{type:"button",title:"Add",className:(0,q.Z)("helvetica-10-400 flex h-8 w-full items-center justify-start gap-2 px-2.5 uppercase",{"bg-ar-green text-ar-green-light":!w,"bg-ar-green-light text-ar-green":w}),onClick:e=>{e.stopPropagation(),f({itemToEditId:s})},children:["Customize",(0,n.jsx)(ec.k,{icon:(0,n.jsx)(e0.Z,{}),size:6})]}),(0,n.jsx)(B.M,{children:!w&&c&&(0,n.jsx)(H.E.p,{className:"helvetica-10-400 flex items-center justify-center bg-ar-red px-4 text-white",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},children:c})})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2.5 py-5",children:[(0,n.jsx)("h2",{className:"editorial-24",children:a}),(0,n.jsx)("p",{className:"garamond-14",children:N})]}),(0,n.jsx)("div",{className:"helvetica-14-400 flex flex-1 items-end text-ar-red-warning",children:(0,n.jsxs)("p",{className:"flex items-center gap-2",children:[k.length>0&&(0,n.jsx)(ec.k,{icon:(0,n.jsx)(e9.Z,{}),size:14}),k.map(e=>e.title).join(", ")]})})]})})}function tr(e){var t;let{items:i=[]}=e,{handleGridCardClick:a}=(0,l.useContext)(eY),r=e=>()=>a(e),s=(null===(t=i[0])||void 0===t?void 0:t.type)==="menu";return i.length?(0,n.jsx)("div",{className:(0,q.Z)("grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3",{"gap-4":s,"gap-y-16":!s}),children:(0,n.jsx)(B.M,{children:i.map(e=>{switch(e.type){case"menu":return(0,n.jsx)(ta,{onClick:r(e.id),...e},e.id);case"dish":return(0,n.jsx)(tn,{onClick:r(e.id),...e},e.id);default:return null}})})}):(0,n.jsx)("p",{children:'e.g. "salad," "fish," or "Pork & Peaches," or try removing filters.'})}function ts(e){let{filters:t,onFiltersFormSubmit:i,items:a=[],loading:r,initialFormValues:s,notification:o,onSubmit:d,formId:c,formSchema:u,inputSearchFunction:h,searchResultClickFunction:m,onFiltersDropdownToggle:f,gridCardClickFunction:g}=e,[v,y]=(0,l.useState)(!1),[x,b]=(0,l.useState)([]),[j,w]=(0,l.useState)(!1),[C,N]=(0,l.useState)(),{getService:k}=(0,M.o)(),{primaryColor:S,primaryColorAlternative:I}=k(),P=(0,l.useCallback)(eZ()(async e=>{if(y(!0),h){let t=await h(e);y(!1),b(t)}},300),[h]),D=(0,l.useCallback)(e=>{let t=!1;f&&(t=f(e).blockProcess),t||w(e)},[f]),O=(0,l.useMemo)(()=>({isFiltersDropdownOpen:j,searchResultLoading:v,searchResults:x,handleSearchResultClick:m||e$.handleSearchResultClick,handleGridCardClick:g,setIsFiltersDropdownOpen:D,handleSearchValueChange:P}),[j,v,x,m,g,D,P]);(0,l.useEffect)(()=>{if(o){N(o);let e=setTimeout(()=>{N(void 0)},2e3);return()=>clearTimeout(e)}return()=>{}},[o]);let E=(0,em.M)("bg",I),T=(0,em.M)("text",S);return(0,n.jsx)(eY.Provider,{value:O,children:(0,n.jsxs)("div",{className:"relative flex w-full flex-col",children:[t&&(0,n.jsx)(e5,{filters:t,onSubmit:i,itemsCount:a.length,initialFormValues:s}),(0,n.jsx)(p,{onSubmit:d,formId:c,formSchema:u,children:()=>(0,n.jsx)(e7.J,{layout:"full",className:"flex-1",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA.U,{size:"medium",className:(0,q.Z)("!absolute left-1/2 -translate-x-1/2 transition duration-300",{"opacity-0":!r,"opacity-40":r,"top-28":0===a.length,"top-2":a.length>0})}),(0,n.jsx)(tr,{items:a})]})})}),(0,n.jsx)(B.M,{children:C&&(0,n.jsx)(H.E.div,{initial:{opacity:0,y:60}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:60},transition:{duration:.3},className:(0,q.Z)(E,T,"helvetica-12-500 fixed bottom-[60px] left-0 z-40 flex h-[60px] w-screen items-center justify-center shadow-md md:hidden",{"text-red-500":"error"===C.type,"text-green-500":"success"===C.type}),children:C.message})}),(0,n.jsx)("div",{className:(0,q.Z)("inset-0 z-30 hidden bg-black transition-all duration-200 xl:absolute xl:block",{"invisible opacity-0":!j||0===a.length,"visible opacity-20":j&&a.length>0})})]})})}var tl=i(31791),to=i(62785),td=i(31165),tc=i(90675),tu=i(65413),th=i(97407),tm=i(99436);function tp(){return["winter","winter","spring","spring","spring","summer","summer","summer","autumn","autumn","autumn","winter"][new Date().getMonth()]}var tf=i(34480);function tg(){let e=(0,tl._)(["","{\n courses[]{\n title,\n dishes[]{\n dish->{\n title,\n qualifier,\n 'id': _id,\n 'slug': slug.current,\n 'imageUrl': mainImage.image.asset->url,\n 'imageAlt': mainImage.alt,\n ingredientList,\n recipeCardUrl,\n \"allergens\": allergens[]-> {\n _id,\n title,\n }\n }\n }\n }\n }"]);return tg=function(){return e},e}function tv(){let e=(0,tl._)(["","{\n title,\n qualifier,\n 'id': _id,\n 'slug': slug.current,\n 'imageUrl': mainImage.image.asset->url,\n 'imageAlt': mainImage.alt,\n ingredientList,\n recipeCardUrl, \n \"allergens\": allergens[]-> {\n _id,\n title,\n },\n order\n }|order(order asc)"]);return tv=function(){return e},e}function ty(){let e=(0,tl._)(["","{\n title,\n qualifier,\n 'id': _id,\n 'slug': slug.current,\n 'imageUrl': mainImage.image.asset->url,\n 'imageAlt': mainImage.alt,\n ingredientList,\n recipeCardUrl, \n \"allergens\": allergens[]-> {\n _id,\n title,\n },\n order\n }|order(order asc)"]);return ty=function(){return e},e}async function tx(e,t){let i,{apolloClient:a}=t,n={};if(e.collection){if(e.collection["my-favorites"]){let{data:e}=await a.query({query:r.VO6,fetchPolicy:"network-only"}),t=null==e?void 0:e.customer.favoriteDishes.map(e=>e.dishId);i=t.length?t:["non-existent-id"]}e.collection["most-ordered"],Object.keys(e.collection).filter(t=>e.collection[t]&&"my-favorites"!==t&&"most-ordered"!==t&&"weekly-specials"!==t).forEach(t=>{e.collection[t]&&(n.collection||(n.collection=[]),n.collection.push('collections[]->slug.current match "'.concat(t,'"')))})}return i&&(n.collection||(n.collection=[]),n.collection.push("_id in $includeIds")),e.cuisine&&Object.keys(e.cuisine).forEach(t=>{e.cuisine[t]&&(n.cuisine||(n.cuisine=[]),n.cuisine.push('cuisine[] match "'.concat(t,'"')))}),e.category&&Object.keys(e.category).forEach(t=>{e.category[t]&&(n.category||(n.category=[]),n.category.push('categories[]->slug.current match "'.concat(t,'"')))}),e.seasonality&&Object.keys(e.seasonality).forEach(t=>{e.seasonality[t]&&(n.seasons||(n.seasons=[]),n.seasons.push('seasonality[] match "'.concat(t,'"')))}),{query:Object.values(n).map(e=>"(".concat(e.join(" || "),")")).join(" && "),favoriteDishIds:i}}function tb(){let e=(0,td.Q)(),[t,i]=(0,l.useState)([]),[a,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(null);return{search:(0,l.useCallback)(async(t,a)=>{let r=[];try{var l,o,d,c,u;(null==a?void 0:a.withoutUpdates)||n(!0);let s=[],h=function(e){if(!e)return"";let t=e.toLowerCase(),i=[];return i.push('title match "'.concat(t,'*"')),i.push('courses[].dishes[].dish->title match "'.concat(t,'*"')),i.push('ingredientList match "'.concat(t,'*"')),i.join(" || ")}(t.search),{query:m,favoriteDishIds:p}=await tx(t,{apolloClient:e});h&&s.push("(".concat(h,")")),m&&s.push("(".concat(m,")")),t.excludeIds&&s.push("!(_id in $excludeIds)");let f="";if(!t.seasonality&&!(null===(l=t.collection)||void 0===l?void 0:l["weekly-specials"])){let e=tp();("autumn"===e||"winter"===e)&&(e="fall--winter"),f='&& (seasonality[] match "evergreen" || seasonality[] match "'.concat(e,'")')}let g='*[_type == "dish" && format[] match "weekly" '.concat(f).concat(s.length?" && ":"").concat(s.join(" && "),"]"),v="";if(null==t?void 0:null===(o=t.collection)||void 0===o?void 0:o["weekly-specials"]){let e=new Date,t=function(e,t){(0,th.Z)(1,arguments);var i,a,n,r,s,l,o,d,c=(0,tm.j)(),u=(0,tu.Z)(null!==(i=null!==(a=null!==(n=null!==(r=null==t?void 0:t.weekStartsOn)&&void 0!==r?r:null==t?void 0:null===(s=t.locale)||void 0===s?void 0:null===(l=s.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:c.weekStartsOn)&&void 0!==a?a:null===(o=c.locale)||void 0===o?void 0:null===(d=o.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==i?i:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=(0,tc.Z)(e),m=h.getDay();return h.setDate(h.getDate()-((m<u?7:0)+m-u)),h.setHours(0,0,0,0),h}(e,{weekStartsOn:0}),i=(0,ey.Z)(t,"M.d.yyyy");v='*[_type == "menu" && title match "Week*('.concat(i,')"]')}(null==a?void 0:a.limit)&&(g+="[0...".concat(a.limit,"]"));let y={};p&&(y.includeIds=p),t.excludeIds&&(y.excludeIds=t.excludeIds);let x=[];if(null==t?void 0:null===(d=t.collection)||void 0===d?void 0:d["weekly-specials"]){let e=await tf.L.fetch((0,to.Z)(tg(),v),y),t=await tf.L.fetch((0,to.Z)(tv(),g),y),i=e[0].courses.flatMap(e=>e.dishes.map(e=>e.dish.id));x=null!==(u=null===(c=i.map(e=>t.find(t=>
1t.id===e)))||void 0===c?void 0:c.filter(Boolean))&&void 0!==u?u:[]}else x=await tf.L.fetch((0,to.Z)(ty(),g),y);x.forEach(e=>{if("allergens"in e){var t;e.allergens=(null===(t=e.allergens)||void 0===t?void 0:t.map(e=>{let{title:t,_id:i}=e;return{title:t,id:i}}))||[]}}),r=x.map(e=>({...e,type:"dish"})),t.search&&r.sort((e,i)=>{let a=e.title.toLowerCase(),n=i.title.toLowerCase(),r=t.search.toLowerCase();return a.startsWith(r)&&!n.startsWith(r)?-1:!a.startsWith(r)&&n.startsWith(r)?1:a.localeCompare(n)}),(null==a?void 0:a.withoutUpdates)||i(r)}catch(e){(null==a?void 0:a.withoutUpdates)||s(e.message)}finally{(null==a?void 0:a.withoutUpdates)||n(!1)}return r},[e]),data:t,loading:a,error:r}}let tj=[{label:"Collection",name:"collection",layout:"two-columns",options:[]},{label:"Cuisine",name:"cuisine",layout:"three-columns",options:[]},{label:"Category",name:"category",layout:"three-columns",options:[]},{label:"Ingredients Flags",name:"ingredientFlags",layout:"row",heading:"What ingredients should we flag so you can easily customize your dishes?",submitButtonTitle:"Save",additionalLabelIcon:(0,n.jsx)(e9.Z,{}),hideClearAllButton:!0,hideDropdownArrow:!0,centerBoxContent:!0,doNotDisplayOnSelectedFiltersList:!0,options:[]}];function tw(e){let{stepConfig:t}=e,[i,a]=(0,l.useState)(tj),[s,o]=(0,l.useState)(),{getServiceAndHouseholdSettings:d,setSettings:c,setServiceAndHouseholdSettings:u,getSettings:h}=(0,g.b)(),{calculateServiceEstimate:m}=(0,O._)(),{serviceUsage:p,ingredientFlags:f=[]}=d(),{goToNextStep:b}=(0,v.V)(),j=(0,eC.u)(),{getSelectedItemsLimit:w,selectItem:C,getSelectedItems:N,removeItem:k}=(0,ew.p)(),S=w(),I=N(),{user:P}=(0,y.jJ)(),M=P.isLoggedIn&&P.isAuthorized,[D]=(0,r.QxX)(),{search:E,data:T,loading:A}=tb(),{orderId:Z}=h(),_=async e=>{await E(e),e.ingredientFlags?u({ingredientFlags:Object.keys(e.ingredientFlags).map(e=>{var t;return{id:e,title:null===(t=j.find(t=>t._id===e))||void 0===t?void 0:t.title}})}):u({ingredientFlags:[]})},R=async e=>E(e,{withoutUpdates:!0}),L=e=>{let t=null==T?void 0:T.find(t=>t.id===e);if(t&&"dish"===t.type){if(I.some(e=>e.referenceId===t.id)){k(e),o({message:"Dish Removed from Meal Prep",type:"success"});return}C({title:t.title,referenceId:t.id,allergens:t.allergens,modifyNote:"",portion:null,subtitle:"dish"===t.type?t.ingredientList:void 0,recipeCardUrl:t.recipeCardUrl}),o({message:"Dish Added to Meal Prep",type:"success"}),t.allergens.filter(e=>f.find(t=>t.id===e.id)).length>0&&c({itemToEditId:t.id,isItemToEditForced:!0})}},B=(e,t)=>a(i=>{let a=t.map(t=>{let i=t.slug?t.slug.current.toLowerCase():t._id||t.title.toLowerCase();return{id:t._id,label:t.title,name:"".concat(e,".").concat(i)}}).filter((e,t,i)=>i.findIndex(t=>t.label===e.label)===t),n=[...i],r=n.find(t=>t.name===e);return r&&(r.options=a),n}),H=(0,l.useMemo)(()=>(0,x.Ry)().test("minimalAmountNotSelected","Please add the required number of dishes.",()=>!!Z||!!M||"number"!=typeof S||I.length>=S),[M,Z,I.length,S]),q=(0,l.useMemo)(()=>{let e=f.reduce((e,t)=>(e[t.id]=!0,e),{});return p===F.I7||p===F.mc?{collection:{"weekly-specials":!0},ingredientFlags:e}:p===F.xF?{collection:{postpartum:!0},ingredientFlags:e}:{ingredientFlags:e}},[f,p]);return(0,l.useEffect)(()=>{P.isLoggedIn||c({disableSubmitFormButton:I.length<S})},[I.length,S,c,P.isLoggedIn]),(0,ex.gL8)({onCompleted:e=>{B("collection",e.allDishCollection)}}),(0,ex.yRI)({onCompleted:e=>{let t=["southeast-asian","holiday"];B("cuisine",e.allCuisine.filter(e=>{var i;return!t.includes(null===(i=e.slug)||void 0===i?void 0:i.current)}).sort((e,t)=>e.title.localeCompare(t.title)))}}),(0,ex.I9Q)({onCompleted:e=>{let t=["special-party-format","appetizer-passed-stationary","accompaniments","sweet-bites"];B("category",e.allCategory.filter(e=>{var i;return!t.includes(null===(i=e.slug)||void 0===i?void 0:i.current)}).sort((e,t)=>e.title.localeCompare(t.title)))}}),(0,l.useEffect)(()=>{B("ingredientFlags",j)},[j]),(0,l.useEffect)(()=>{(async()=>{if(M){let{data:e}=await D();if((null==e?void 0:e.customer.favoriteDishes.length)===0)return;let t=i.find(e=>"collection"===e.name);t&&a(e=>(t.options.find(e=>"collection.my-favorites"===e.name)||(t.options.push({id:"",label:"My Favorites",name:"collection.my-favorites"}),e[0]=t),e))}})()},[i,D,M]),(0,l.useEffect)(()=>{E(q)},[]),(0,l.useEffect)(()=>{m()},[m]),(0,n.jsx)(ts,{initialFormValues:q,items:T,filters:i,onFiltersFormSubmit:_,loading:A,inputSearchFunction:R,gridCardClickFunction:L,searchResultClickFunction:L,notification:s,onSubmit:b,formId:t.id,formSchema:H})}var tC=i(6241),tN=i(13916);function tk(){let e=(0,tl._)(['*[_type == "menu" && _id == $id][0].extendedOnly']);return tk=function(){return e},e}var tS=i(87054);function tI(e){let{onSubmit:t,selectedAllergens:i}=e,[a,r]=(0,l.useState)(i),s=(0,eC.u)(),{getService:o}=(0,M.o)(),{primaryColor:d,primaryColorAlternative:c}=o(),u=(0,em.M)("border",d),h=(0,em.M)("text",d);return(0,n.jsx)(H.E.div,{className:(0,q.Z)("absolute left-0 top-[50px] z-[11] w-full overflow-hidden border-y border-opacity-40 bg-ar-beige-light",u),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.2},children:(0,n.jsxs)("div",{className:"flex flex-col items-start p-7",children:[(0,n.jsx)("h2",{className:(0,q.Z)("editorial-24 mb-3.5",h),children:"What ingredients should we flag so you can easily customize your dishes?"}),(0,n.jsx)("p",{className:"mb-10",children:"You'll be able to specify more culinary preferences later."}),(0,n.jsx)("div",{className:"mb-10 flex w-full flex-wrap gap-x-10 gap-y-4",children:s.map(e=>(0,n.jsx)(eJ.E,{id:e._id,primaryColor:d,label:e.title,name:e._id,onChange:t=>{t.target.checked?r(t=>t.find(t=>{let{id:i}=t;return i===e._id})?t:[...t,{id:e._id,title:e.title}]):r(t=>t.filter(t=>{let{id:i}=t;return i!==e._id}))},checked:!!a.find(t=>{let{id:i}=t;return i===e._id})},e._id))}),(0,n.jsx)(Z.k,{type:"button",variant:Z.$.ServiceCard,className:"w-[312px] !self-start",backgroundColor:c,textColor:d,onClick:()=>t(a),children:"Save"})]})})}function tP(e){let{onSubmit:t,selectedAllergens:i,setSelectedAllergens:a,setShowDropdown:r}=e,[s,o]=(0,l.useState)(i),d=(0,eC.u)(),{getService:c}=(0,M.o)(),{primaryColor:u,primaryColorAlternative:h}=c(),m=(0,em.M)("border",u),p=(0,em.M)("text",u),f=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=window.requestAnimationFrame;return f.current&&(window.requestAnimationFrame=()=>0,(0,tS.Qp)(f.current),window.requestAnimationFrame=e),()=>{(0,tS.tP)()}},[]),(0,n.jsx)(H.E.div,{ref:f,className:"fixed inset-0 z-[90] overflow-auto bg-ar-beige-light",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,n.jsxs)("div",{className:"flex h-full flex-col items-start",children:[(0,n.jsxs)("header",{className:(0,q.Z)("sticky top-0 z-10 flex h-16 w-full items-center justify-between border-b border-opacity-40 bg-ar-beige-light p-5",m),children:[(0,n.jsx)("h2",{className:(0,q.Z)("editorial-24",p),children:"Ingredient Flags"}),(0,n.jsx)("button",{title:"Close",type:"button",className:"p-3",onClick:()=>r(!1),children:(0,n.jsx)(ec.k,{icon:(0,n.jsx)(eR.Z,{}),size:20})})]}),(0,n.jsx)("p",{className:"helvetica-14-500 p-7",children:"What ingredients should we flag so you can easily customize your dishes?"}),(0,n.jsx)("div",{className:"flex-1 px-7",children:(0,n.jsx)("div",{className:"flex w-full flex-col gap-y-6 pb-6",children:d.map(e=>(0,n.jsx)(eJ.E,{id:e._id,primaryColor:u,label:e.title,name:e._id,onChange:t=>{t.target.checked?o(t=>t.find(t=>{let{id:i}=t;return i===e._id})?t:[...t,{id:e._id,title:e.title}]):o(t=>t.filter(t=>{let{id:i}=t;return i!==e._id}))},checked:!!s.find(t=>{let{id:i}=t;return i===e._id})},e._id))})}),(0,n.jsxs)("footer",{className:(0,q.Z)("flex h-16 w-full shrink-0 items-center justify-between gap-7 border-t border-opacity-40 px-7",m),children:[(0,n.jsx)("button",{type:"button",className:"helvetica-14-500 shrink-0 underline",onClick:()=>{o([]),a([]),r(!1)},children:"Clear all"}),(0,n.jsx)(Z.k,{type:"button",variant:Z.$.ServiceCard,className:"w-full",backgroundColor:h,textColor:u,onClick:()=>t(s),children:"Save"})]})]})})}function tM(e){return(0,e_.a)(768)?(0,n.jsx)(tP,{...e}):(0,n.jsx)(tI,{...e})}function tD(e){let{Container:t,hideExtendedMenu:i}=e,{getActiveMenu:a,updateMenu:r}=(0,ew.p)(),{setServiceAndHouseholdSettings:s,getServiceAndHouseholdSettings:o}=(0,g.b)(),{getService:d}=(0,M.o)(),{primaryColor:c}=d(),{referenceId:u,isExtendedMenu:h}=a(),[m,p]=(0,l.useState)(()=>o().ingredientFlags||[]),[f,v]=(0,l.useState)(!1),y=e=>{r(u,{isExtendedMenu:e})},x=(0,em.M)("border",c),b=(0,em.M)("bg",c);return(0,n.jsx)("header",{className:(0,q.Z)("relative border-b border-opacity-40",x),children:(0,n.jsxs)(t,{className:"flex h-[50px] items-center justify-between gap-3 px-4",children:[(0,n.jsxs)("button",{type:"button",className:(0,q.Z)("flex h-full shrink-0 items-center gap-2.5 text-left",x,{"w-[105px] border-r border-opacity-40 md:w-[205px]":!i,"w-full":i}),onClick:()=>v(e=>!e),children:[(0,n.jsx)(ec.k,{icon:(0,n.jsx)(e9.Z,{}),size:14}),(0,n.jsxs)("p",{className:"flex gap-1",children:[(0,n.jsx)("span",{className:"hidden md:block",children:"Ingredient"})," Flags"," ",m.length?"(".concat(m.length,")"):""]})]}),(0,n.jsx)(B.M,{children:f&&(0,n.jsx)(tM,{onSubmit:e=>{p(e),s({ingredientFlags:e}),v(!1)},setShowDropdown:v,selectedAllergens:m,setSelectedAllergens:p})}),!i&&(0,n.jsxs)("div",{className:"helvetica-12-500 relative z-10 flex h-8 w-full",children:[(0,n.jsx)("div",{className:(0,q.Z)("absolute h-full w-1/2 overflow-hidden text-ar-beige-light transition",b,{"translate-x-full":h,"bg-opacity-60":f}),children:(0,n.jsxs)("div",{className:(0,q.Z)("flex h-full w-[200%] transition",{"-translate-x-1/2":h}),children:[(0,n.jsx)("button",{type:"button",className:"flex-1",disabled:f,onClick:()=>y(!1),children:"Standard Menu"}),(0,n.jsx)("button",{type:"button",className:"flex-1",disabled:f,onClick:()=>y(!0),children:"Extended Menu"})]})}),(0,n.jsx)("button",{type:"button",className:(0,q.Z)("flex-1",{"opacity-60":f}),disabled:f,onClick:()=>y(!1),children:"Standard Menu"}),(0,n.jsx)("button",{type:"button",className:(0,q.Z)("flex-1",{"opacity-60":f}),disabled:f,onClick:()=>y(!0),children:"Extended Menu"})]})]})})}var tO=i(878),tE=i(45826);function tT(e){let{item:t,formMethods:i,onItemSelect:a,isOffMenu:r,isDisabled:s,message:l}=e,{getService:o}=(0,M.o)(),{primaryColor:d}=o();return(0,n.jsxs)("div",{className:(0,q.Z)("flex gap-4 border-b py-6 transition-opacity",{"flex-col":r,"opacity-60":s}),children:[(0,n.jsx)("div",{children:(0,n.jsx)(eJ.E,{id:"".concat(t.courseId,".").concat(t.id),variant:"squared-checkmark",label:r?"Added Dish":void 0,className:"!ring-0",primaryColor:d,...i.register("".concat(t.courseId,".").concat(t.id),{onChange:()=>a(t,r),disabled:s})})}),(0,n.jsxs)("div",{children:[l&&(0,n.jsxs)("p",{className:"garamond-14 mb-1 flex items-center gap-2 text-ar-red-warning",children:[(0,n.jsx)(ec.k,{icon:(0,n.jsx)(e9.Z,{}),size:14,className:"-translate-y-[1px]"}),l]}),(0,n.jsx)("h2",{className:"editorial-18 md:editorial-22",children:t.title}),(0,n.jsx)("p",{className:"mt-1.5",children:t.subtitle}),!!t.allergens.length&&(0,n.jsxs)("div",{className:"items-top mt-3 flex gap-1.5 text-ar-red-warning md:mt-6",children:[(0,n.jsx)(ec.k,{icon:(0,n.jsx)(e9.Z,{}),size:14,className:"translate-y-[1px] transform md:translate-y-1"}),(0,n.jsx)("p",{className:"garamond-14 md:garamond-16",children:t.allergens.map(e=>{let{title:t}=e;return t}).join(", ")})]})]})]})}function tA(e){let{id:t,title:i,items:a,isOptional:r,description:s,maxSelectedItems:o,expandedOnStart:d,formMethods:c,offMenuDis
1h:u,onItemSelect:h}=e,[m,p]=(0,l.useState)(d),{getService:f}=(0,M.o)(),{primaryColor:g}=f(),{openModal:v}=(0,tE.vR)(),{getSelectedItems:y}=(0,ew.p)(),x=(0,em.M)("text",g),b=(0,em.M)("border",g),j=y(),w=null==j?void 0:j.filter(e=>e.courseId===t),C=null==j?void 0:j.filter(e=>e.courseId!==t),N=e=>!!C.find(t=>t.referenceId===e.id),k=e=>w.some(t=>t.referenceId===e.id),S=e=>!k(e)&&(w.length>=o||N(e)),{errors:I}=c.formState,P=I[t];return(0,l.useEffect)(()=>{null==a||a.forEach(e=>{c.setValue("".concat(e.courseId,".").concat(e.id),!!(null==j?void 0:j.find(t=>t.referenceId===e.id)))}),u&&c.setValue("".concat(u.courseId,".").concat(u.id),!!(null==j?void 0:j.find(e=>e.referenceId===u.id)))},[c,a,u,j]),(0,n.jsxs)("div",{className:(0,q.Z)("flex w-full flex-col border border-opacity-40",x,b),children:[(0,n.jsxs)("button",{type:"button",className:"flex items-center justify-between gap-2.5 px-6 py-5",onClick:()=>p(e=>!e),children:[(0,n.jsx)("h5",{className:"helvetica-14-500",children:i}),(0,n.jsxs)("p",{className:"helvetica-12-400 flex gap-1 opacity-50",children:[o&&(0,n.jsxs)("span",{children:[w.length,"/",o]}),r&&(0,n.jsx)("span",{children:"Optional"})]}),(0,n.jsxs)("div",{className:"flex flex-1 items-center justify-end gap-4",children:[(null==P?void 0:P.message)&&(0,n.jsx)("span",{className:"helvetica-12-400 text-ar-red-warning",children:P.message.toString()}),(0,n.jsx)(ec.k,{icon:m?(0,n.jsx)(tO.Z,{}):(0,n.jsx)(e0.Z,{}),size:10})]})]}),(0,n.jsx)("div",{className:"flex flex-col px-6",children:(0,n.jsx)(H.E.div,{variants:{hidden:{opacity:0,height:0},visible:{opacity:1,height:"auto"}},className:"overflow-hidden",animate:m?"visible":"hidden",initial:!1,children:(0,n.jsxs)(n.Fragment,{children:[s||null,a.map(e=>(0,n.jsx)(H.E.label,{htmlFor:"".concat(e.courseId,".").concat(e.id),className:(0,q.Z)("overflow-hidden",{"hover:cursor-pointer":!S(e)}),initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:(0,n.jsx)(tT,{item:e,formMethods:c,onItemSelect:h,isDisabled:S(e),message:N(e)?"You have already selected this dish in another course":void 0})},e.id)),(0,n.jsx)(H.E.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:(0,n.jsx)(B.M,{mode:"sync",children:(0,n.jsxs)(H.E.div,{initial:{y:-20,opacity:0,height:0},animate:{y:0,opacity:1,height:"auto"},exit:{y:-20,opacity:0,height:0},children:[(!u||u&&!(null==j?void 0:j.find(e=>e.referenceId===u.id)))&&(0,n.jsxs)("button",{type:"button",className:(0,q.Z)("flex w-full flex-col gap-2.5 pb-7 pt-3 transition-opacity",{"opacity-60":w.length>=o}),onClick:()=>{w.length<o&&v(tE.Ti.BookingOrderOffMenuDish,{courseName:i,courseId:t,courseDishes:a})},disabled:w.length>=o,children:[(0,n.jsx)("p",{className:"editorial-18 md:editorial-22",children:"Select from off menu dishes"}),(0,n.jsx)("p",{className:"helvetica-12-500",children:"Browse our culinary library +"})]}),u&&!!(null==j?void 0:j.find(e=>e.referenceId===u.id))&&(0,n.jsx)("label",{htmlFor:"".concat(u.courseId,".").concat(u.id),className:"overflow-hidden hover:cursor-pointer",children:(0,n.jsx)(tT,{item:u,formMethods:c,onItemSelect:h,isDisabled:S(u),isOffMenu:!0})},u.id)]},null==u?void 0:u.id)})})]})})})]})}var tF=i(66467),tZ=i(46027);function t_(e){let{dish:t,onSelect:i}=e,{getService:a}=(0,M.o)(),{primaryColor:r,primaryColorAlternative:s}=a(),l=(0,em.M)("bg",s),o=(0,em.M)("hover:bg",r),d=(0,em.M)("border",r),c=(0,em.M)("hover:text",s);return"dish"!==t.type?null:(0,n.jsxs)("div",{className:(0,q.Z)("group flex w-full justify-between gap-3 border-b border-opacity-40 py-6",d),children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("p",{className:"helvetica-14-500",children:t.title}),(0,n.jsx)("p",{className:"opacity-90",children:t.ingredientList}),t.allergens&&(0,n.jsx)("p",{className:"block md:hidden",children:t.allergens.map(e=>{let{title:t}=e;return t}).join(", ")})]}),(0,n.jsxs)("div",{className:"relative flex md:min-w-32 md:justify-end",children:[t.allergens&&(0,n.jsx)("p",{className:"hidden md:block",children:t.allergens.map(e=>{let{title:t}=e;return t}).join(", ")}),(0,n.jsxs)("button",{type:"button",onClick:()=>i({id:t.id,title:t.title,subtitle:t.ingredientList,allergens:t.allergens||[],recipeCardUrl:t.recipeCardUrl,isOffMenuDis
1h:!0}),className:(0,q.Z)("helvetica-12-500 flex h-7 items-center justify-center border px-5 text-center transition-opacity","md:absolute md:right-0 md:top-0 md:h-10 md:w-full md:p-0 md:opacity-0 md:group-hover:opacity-100",l,o,d,c),children:["Add ",(0,n.jsx)("span",{className:"ml-1 hidden md:block",children:"Dish"})]})]})]})}function tR(e){var t;let{onDishSelect:i}=e,a=(0,e_.a)(768),[r,s]=(0,l.useState)(""),{getService:o}=(0,M.o)(),{primaryColor:d,primaryColorAlternative:c}=o(),{closeModal:u,modalData:h,openedModals:m}=(0,tE.vR)(),p=m.includes(tE.Ti.BookingOrderOffMenuDish),f=(0,em.M)("text",d),g=(0,em.M)("border",d),v=(0,em.M)("bg",c),y=(0,em.M)("placeholder:text",d),{getSelectedItems:x,getActiveMenuData:b}=(0,ew.p)(),j=x().map(e=>e.referenceId),{search:w,data:C,loading:N}=tb(),k=b(),S=(null==k?void 0:null===(t=k.courses)||void 0===t?void 0:t.map(e=>{var t;return null==e?void 0:null===(t=e.dishes)||void 0===t?void 0:t.map(e=>{var t;return null==e?void 0:null===(t=e.dish)||void 0===t?void 0:t._id})}).flat().filter(Boolean))||[],I=(0,l.useMemo)(()=>{var e;return null==k?void 0:null===(e=k.cuisine)||void 0===e?void 0:e.reduce((e,t)=>((null==t?void 0:t.title)&&(e[t.title]=!0),e),{})},[k]),P=(0,l.useMemo)(()=>{var e;return null==k?void 0:null===(e=k.seasonality)||void 0===e?void 0:e.reduce((e,t)=>((null==t?void 0:t.title)&&(e[t.title]=!0),e),{})},[k]),D=(0,tZ.H)({selectedItemsIds:j,dishesIds:S}),O=(0,l.useMemo)(()=>eZ()(e=>{w({search:e,excludeIds:Array.from(new Set([...D.current.selectedItemsIds,...D.current.dishesIds])),cuisine:I,seasonality:P},{limit:30})},500),[w,D,I,P]),E=e=>{i({...e,courseName:h.courseName,courseId:h.courseId}),u(tE.Ti.BookingOrderOffMenuDish)};(0,l.useEffect)(()=>{p&&w({search:"",excludeIds:Array.from(new Set([...D.current.selectedItemsIds,...D.current.dishesIds])),cuisine:I,seasonality:P},{limit:30})},[I,D,p,w,P]);let T=C.sort((e,t)=>{let i=e.title.toLowerCase(),a=t.title.toLowerCase(),n=r.toLowerCase();return i.startsWith(n)&&!a.startsWith(n)?-1:!i.startsWith(n)&&a.startsWith(n)?1:i.localeCompare(a)});return(0,n.jsx)(tF.k,{modalId:tE.Ti.BookingOrderOffMenuDish,className:"bg-black bg-opacity-40",children:(0,n.jsxs)(H.E.div,{className:(0,q.Z)("relative h-full w-full overflow-auto p-8 pt-24 md:w-3/4 md:pt-32",f,v),initial:{x:"-100%"},animate:{x:"0"},exit:{x:"-100%"},transition:{ease:"easeOut"},children:[(0,n.jsx)("button",{title:"Close",type:"button",className:"absolute right-0 top-0 px-8 py-6",onClick:()=>u(tE.Ti.BookingOrderOffMenuDish),children:(0,n.jsx)(ec.k,{width:a?10:14,height:a?10:14,icon:(0,n.jsx)(eL.Z,{})})}),(0,n.jsxs)("div",{className:"mx-auto w-full max-w-[675px] flex-col",children:[(0,n.jsxs)("header",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("p",{className:"editorial-32",children:"Select from off menu dishes"}),(0,n.jsx)("p",{className:"garamond-16",children:"Don't see what you want? Choose something else from our curated dish library."}),(0,n.jsxs)("label",{htmlFor:"off-dish-search-form",className:(0,q.Z)("mt-8 flex items-center gap-2.5 border-b",g),children:[(0,n.jsx)(ec.k,{width:a?10:14,height:a?10:14,icon:(0,n.jsx)(eW.Z,{})}),(0,n.jsx)("input",{name:"off-dish-search-form",onChange:e=>{let{value:t}=e.target;s(t),O(t)},placeholder:"Search by ingredient or dish",className:(0,q.Z)("helvetica-14-500 w-full bg-transparent py-2.5 outline-none",y)})]})]}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(B.M,{children:N&&(0,n.jsx)(H.E.div,{className:"flex items-center justify-center overflow-hidden",initial:{height:0,opacity:0},animate:{height:100,opacity:1},exit:{height:0,opacity:0},children:(0,n.jsx)(eA.U,{})})}),T.map(e=>(0,n.jsx)(t_,{dish:e,onSelect:E},e.id))]})]})]})})}let tL=e=>t=>(t.items=t.items.map(t=>({...t,isExtendedMenu:e})),{...t});function tB(e){let{className:t,children:i}=e;return(0,n.jsx)("div",{className:(0,q.Z)(t,"mx-auto w-full max-w-[792px]"),children:i})}function tH(e){let{formMethods:t,hideExtendedMenu:i}=e,[a,s]=(0,l.useState)(""),{setSettings:o,getServiceAndHouseholdSettings:d}=(0,g.b)(),{calculateCustomServiceEstimate:c,calculateServiceEstimate:u}=(0,O._)(),{getActiveMenuData:h,getActiveMenu:m,getSelectedItems:p,selectItem:f,removeItem:v,updateMenu:y}
1=(0,ew.p)(),{getService:x}=(0,M.o)(),{referenceId:b,isExtendedMenu:j}=m(),{type:w}=x(),C=h(),N=function(e){let[t,i]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!e){i(!1);return}let t=!0;return tf.L.fetch((0,to.Z)(tk()),{id:e}).then(e=>{t&&i(!!e)}).catch(()=>{t&&i(!1)}),()=>{t=!1}},[e]),t}(w===r.UW4.Gathering?b:void 0),k=i||N,S=p(),I=d().ingredientFlags||[],[P,D]=(0,l.useState)(0),[E,T]=(0,l.useState)(S.reduce((e,t)=>(t.courseId&&t.courseName&&t.referenceId&&t.isOffMenuDish&&(e[t.courseId]={id:t.referenceId,title:t.title,subtitle:t.subtitle||"",courseName:t.courseName,allergens:t.allergens||[],courseId:t.courseId,recipeCardUrl:t.recipeCardUrl,isOffMenuDish:!0}),e),{})),A=(null==C?void 0:C.__typename)==="CookingClass"?function(e,t,i){var a;if(!e)return[];let n=[];return null===(a=e.sections)||void 0===a||a.forEach(e=>{e&&n.push({id:e._key,title:e.title||"",numberOfDishes:Number(e.numberOfDishes),numberOfDishesExt:Number(e.numberOfDishesExt),isOptional:!1,isDrinkSection:!1,offMenuDish:t[e._key]||void 0,items:e.dishes.reduce((t,a)=>{var n;if(!a||!a.dish||!a.dish._id||!(0,tC.s9)(a.dish))return t;let r=(null===(n=a.dish.allergens)||void 0===n?void 0:n.filter(e=>e&&i.find(t=>t.id===e._id)).map(e=>({title:e.title,id:e._id})))||[];return t.push({id:a.dish._id,title:a.marketingTitle||a.dish.title||"",subtitle:a.dish.ingredientList||"",allergens:r,courseName:e.title||"",courseId:e._key,recipeCardUrl:a.dish.recipeCardUrl||void 0}),t},[]).filter(Boolean)})}),n}(C,E,I):function(e,t,i){var a;if(!e)return[];let n=[];return null===(a=e.courses)||void 0===a||a.forEach(e=>{e&&n.push({id:e._key,title:e.title||"",numberOfDishes:Number(e.numberOfDishes),numberOfDishesExt:Number(e.numberOfDishesExt),isOptional:!!e.isOptional,isDrinkSection:!!e.isDrinkSection,offMenuDish:t[e._key]||void 0,items:e.dishes.reduce((t,a)=>{var n;if(!a||!a.dish||!a.dish._id||!(0,tC.s9)(a.dish))return t;let r=(null===(n=a.dish.allergens)||void 0===n?void 0:n.filter(e=>e&&i.find(t=>t.id===e._id)).map(e=>({title:e.title,id:e._id})))||[];return t.push({id:a.dish._id,title:a.marketingTitle||a.dish.title||"",subtitle:a.dish.ingredientList||"",allergens:r,courseName:e.title||"",courseId:e._key,recipeCardUrl:a.dish.recipeCardUrl||void 0}),t},[]).filter(Boolean)})}),n}(C,E,I),F=e=>{T(t=>{let i={...t};return delete i[e],i})},Z=async(e,i)=>{var a,n;let r=(null==C?void 0:C.__typename)==="Menu"?null==C?void 0:null===(a=C.courses)||void 0===a?void 0:a.find(t=>t._key===e.courseId):(null==C?void 0:C.__typename)==="CookingClass"?null==C?void 0:null===(n=C.sections)||void 0===n?void 0:n.find(t=>t._key===e.courseId):void 0,s=null==S?void 0:S.filter(e=>e.courseId===r._key),l=null==s?void 0:s.some(t=>t.referenceId===e.id),d=j?r.numberOfDishesExt:r.numberOfDishes;if(null==S?void 0:S.some(t=>t.referenceId===e.id&&t.courseId!==e.courseId)){t.setError(e.courseId,{message:"Dish already selected"});return}l?(v(e.id,b),i&&F(e.courseId)):s.length<d&&(f({title:e.title,subtitle:e.subtitle,courseName:e.courseName,courseId:e.courseId,referenceId:e.id,modifyNote:"",allergens:e.allergens,portion:null,recipeCardUrl:e.recipeCardUrl,isOffMenuDish:i},b),e.allergens.length>0&&o({itemToEditId:e.id,isItemToEditForced:!0})),t.clearErrors()},_=(0,l.useMemo)(()=>{if(w===r.UW4.CookingClass)return"";let e=A.map((e,t)=>{let i=e.title.replace(/\s+$/,""),a="".concat(e.numberOfDishesExt," ").concat(i).concat(e.numberOfDishesExt>1&&"s"!==i[i.length-1]?"s":"");return 0===t?a:t<A.length-1?", ".concat(a):" and ".concat(a)});return e&&a?"An extended menu allows you to select ".concat(e.join(""),", for an additional cost of ").concat(a):""},[w,A,a]),R=(0,l.useCallback)(async()=>{let e=A.reduce((e,t)=>(t.isDrinkSection&&t.items.forEach(t=>{e.push(t)}),e),[]);return(await c({cartSummaryModifier:t=>(t.items[0].selectedItems=e.map(e=>({title:e.title,subtitle:e.subtitle,courseName:e.courseName,courseId:e.courseId,referenceId:e.id,modifyNote:"",allergens:e.allergens,portion:null,recipeCardUrl:e.recipeCardUrl,isOffMenuDish:!1})),t)})).additionalDrinkServiceCost},[c,A]);return(0,l.useEffect)(()=>{(async()=>{D(await R());
1let e=await c({cartSummaryModifier:tL(!1)}),t=await c({cartSummaryModifier:tL(!0)});e&&t&&s((0,tN.T)(Math.abs(e.serviceCost-t.serviceCost)||0,void 0,0))})()},[]),(0,l.useEffect)(()=>{N&&!j&&y(b,{isExtendedMenu:!0})},[N,j,b,y]),(0,l.useEffect)(()=>{j||A.forEach(e=>{let i=S.filter(t=>t.courseId===e.id),a=e.numberOfDishes;i.length>a&&(i.slice(a).forEach(i=>{v(i.referenceId,b),t.setValue("".concat(e.title,".").concat(i.referenceId),!1)}),t.clearErrors())})},[t,j,b,v,A,S]),(0,l.useEffect)(()=>{let e=S.map(e=>e.referenceId);Object.entries(t.getValues()).forEach(i=>{let[a,n]=i;Object.keys(n).forEach(i=>{if(-1===e.indexOf(i)&&!0===n[i]){var r;t.setValue("".concat(a,".").concat(i),!1),(null==E?void 0:null===(r=E[a])||void 0===r?void 0:r.id)===i&&F(a),t.clearErrors()}})})},[t,E,S]),(0,l.useEffect)(()=>{u()},[u]),(0,l.useEffect)(()=>{t.reset()},[t,j]),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(tR,{onDishSelect:e=>{f({title:e.title,subtitle:e.subtitle,courseName:e.courseName,courseId:e.courseId,referenceId:e.id,modifyNote:"",allergens:e.allergens,portion:null,recipeCardUrl:e.recipeCardUrl,isOffMenuDish:!0},b),T(t=>({...t,[e.courseId]:e})),setTimeout(()=>{t.setValue("".concat(e.courseId,".").concat(e.id),!0)},0),e.allergens.filter(e=>I.find(t=>t.id===e.id)).length>0&&o({itemToEditId:e.id,isItemToEditForced:!0}),t.clearErrors()}}),(0,n.jsx)(tD,{Container:tB,hideExtendedMenu:k}),(0,n.jsxs)(tB,{children:[(0,n.jsx)(H.E.div,{className:"overflow-hidden",variants:{hidden:{opacity:0,height:0},visible:{opacity:1,height:"auto"}},animate:_&&j&&!N?"visible":"hidden",initial:!1,children:(0,n.jsx)("p",{className:"max-w-[420px] px-7 pt-8 md:px-0",children:_})}),(0,n.jsx)("div",{className:"mt-8 flex flex-col gap-3.5 px-7 md:px-0",children:A.map((e,i)=>{let a=j?e.numberOfDishesExt:e.numberOfDishes;return(0,n.jsx)(tA,{id:e.id,title:e.title,items:e.items,description:e.isDrinkSection?(0,n.jsxs)("div",{children:[!!P&&(0,n.jsx)(n.Fragment,{}),(0,n.jsxs)("p",{className:"helvetica-12-400",children:["Our optional drinks service includes up to ",a," drinks and one bartender."," ","All waitstaff are billed by the hour starting at ",(0,n.jsx)("span",{className:"helvetica-12-500",children:"$60/hr"}),". They will arrive 1 hour before guests and provide minimum 4 hours of service."," ","The Culinistas will provide non-alcoholic ingredients (mixers, garnish, etc)."," ",(0,n.jsx)("span",{className:"helvetica-12-500",children:"You are responsible for providing alcohol, ice, glassware & bar equipment (shaker, jiggers, etc)."})]})]}):void 0,maxSelectedItems:a,onItemSelect:Z,expandedOnStart:0===i,formMethods:t,isOptional:e.isOptional,offMenuDish:e.offMenuDish},e.id||i)})})]})]})}function tq(e){let{stepConfig:t}=e,{getActiveMenuData:i,getActiveMenu:a,getSelectedItems:r}=(0,ew.p)(),{goToNextStep:s}=(0,v.V)(),{isExtendedMenu:o}=a(),d=i(),c=(null==d?void 0:d.__typename)==="Menu"&&(null==d?void 0:d.courses)||void 0,u=(0,l.useMemo)(()=>(0,x.Ry)({...(null==c?void 0:c.reduce((e,t)=>{let i=null==t?void 0:t.isDrinkSection;return e[t._key]=(0,x.Ry)().test("minimalAmountNotSelected","Please add the required number of ".concat(i?"drinks":"dishes"),e=>{let i=Object.values(e||{}).filter(Boolean);return!!t.isOptional||!((null==i?void 0:i.length)<(o?t.numberOfDishesExt:t.numberOfDishes))}),e},{}))||{}}),[c,o]),h=(0,l.useMemo)(()=>r().reduce((e,t)=>(e[t.courseName]?e[t.courseName][t.referenceId]=!0:e[t.courseName]={[t.referenceId]:!0},e),{}),[r]);return(0,n.jsx)(p,{onSubmit:s,formId:t.id,formSchema:u,defaultValues:h,children:e=>(0,n.jsx)(tH,{formMethods:e})})}var tU=i(7776);function tW(e){let{className:t,allergens:i,...a}=e,r=(0,l.useMemo)(()=>(null==i?void 0:i.map(e=>({id:"ingredientFlags.".concat(e.id),type:"checkbox",name:"ingredientFlags.".concat(e.id),label:e.title})))||[],[i]);return(0,n.jsx)(d.Z,{className:t,inputs:r,...a})}function tG(e){var t;let{containerClassName:i,stepConfig:a}=e,{calculateServiceEstimate:r}=(0,O._)(),{goToNextStep:s,goToStepIndex:c}=(0,v.V)(),{setServiceAndHouseholdSettings:u,getServiceAndHouseholdSettings:h}=(0,g.b)(),m=h(),{removeAllItems:f}=(0,ew.p)(),y=(0,F.R8)(),{getService:b}=(0,M.o)(),{primaryColor:j}=b(),w=(0,eC.u)().map(tC.Y).filter(e=>!!e&&!!e.id&&!!e.title)||[],C=async(e,t)=>{var i;let a=null==t?void 0:t.nativeEvent,{serviceUsage:n,portion:r,culinaryPreferences:l,ingredientFlags:o}=e;u({serviceUsage:n,portion:r,culinaryPreferences:(0,P.bh)({culinaryPreferences:l}),culinaryPreferencesNote:l.other||void 0,ingredientFlags:(0,P.aQ)({ingredientFlags:o},w)}),(null==a?void 0:null===(i=a.submitter)||void 0===i?void 0:i.id)==="select-dishes-later"?(f(),c(3)):s()},N="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-5 [&>div]:flex";(0,l.useEffect)(()=>{r()},[r]);let k=(0,x.Ry)().shape({portion:(0,x.Z_)().nullable().required("Please select a size for your weekly meal prep.")});return(0,n.jsx)(p,{className:i,formId:a.id,onSubmit:C,formSchema:k,defaultValues:{serviceUsage:null==m?void 0:m.serviceUsage,portion:void 0,culinaryPreferences:{...(0,P.aj)(m.culinaryPreferences||[],""),other:m.culinaryPreferencesNote||void 0},ingredientFlags:(null===(t=m.ingredientFlags)||void 0===t?void 0:t.reduce((e,t)=>
1(e[t.id]=!0,e),{}))||{}},children:e=>{var t,i;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:"How are you using your service?",children:(0,n.jsx)(d.Z,{className:N,inputs:y.serviceUsage,...e})}),(0,n.jsx)(o.f,{heading:"How many people will this meal prep serve?",description:(0,n.jsxs)("p",{children:["Your Culinista chef will use this information to guide their shopping and cooking for your household. Your service fee will not change based on your selection, but the cost of groceries will adjust accordingly. You may request a larger or smaller portion of any dish, regardless of your selection here.",(null===(i=e.formState.errors)||void 0===i?void 0:null===(t=i.portion)||void 0===t?void 0:t.message)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),(0,n.jsx)(eh.P,{error:e.formState.errors.portion.message})]})]}),children:(0,n.jsx)(d.Z,{className:N,inputs:y.portion,...e})}),(0,n.jsx)(o.f,{heading:"Household Culinary Preferences",description:"Check all that apply.",descriptionTransparent:!0,children:(0,n.jsx)(d.Z,{className:N,inputs:y.culinaryPreferences,...e})}),(0,n.jsx)(o.f,{heading:"What ingredients should we flag during dish selection so you can easily customize your dishes?",description:"Check all that apply.",children:(0,n.jsx)(tW,{className:N,allergens:w,...e})}),(0,n.jsxs)("div",{className:"flex flex-col justify-start gap-4 md:flex-row md:gap-8",children:[(0,n.jsx)(Z.k,{type:"submit",id:"select-dishes-now",variant:Z.$.BookingOrderForm,backgroundColor:j,textColor:ep.bG.White,children:"Select My Dishes Now"}),(0,n.jsx)(Z.k,{type:"submit",id:"select-dishes-later",variant:Z.$.BookingOrderFormWithBorder,textColor:j,children:"Select My Dishes Later"})]})]})}})}var tz=i(83745);function t$(e){let{address:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:"".concat(null==t?void 0:t.streetAddress).concat((null==t?void 0:t.streetAddress2)?", ".concat(null==t?void 0:t.streetAddress2):"")}),(0,n.jsx)("p",{className:"opacity-40",children:"".concat(null==t?void 0:t.city," ").concat(null==t?void 0:t.state," ").concat(null==t?void 0:t.zipCode)})]})}function tY(e){let{loading:t,customerData:i,setValue:a}=e,r=null==i?void 0:i.addresses,{setAddress:s}=(0,g.b)(),{getService:d}=(0,M.o)(),{primaryColor:c}=d(),[u,h]=(0,l.useState)(null),m=null==r?void 0:r.find(e=>(null==e?void 0:e.id)===u),p=(0,tZ.H)({addresses:r});(0,l.useEffect)(()=>{if(!u||!p.current.addresses)return;let e=p.current.addresses.find(e=>(null==e?void 0:e.id)===u);if(e){var t,i;let n={...e,streetAddress2:e.streetAddress2,nickname:null!==(t=e.nickname)&&void 0!==t?t:void 0,additionalComments:null!==(i=e.additionalComments)&&void 0!==i?i:void 0};a("address",n),s(n)}},[u,a,p,s]);let f=null==i?void 0:i.defaultAddressId;(0,l.useEffect)(()=>{h(f)},[f]);let v=e=>{h(e.target.value)},{openModal:y}=(0,tE.vR)();return(0,n.jsx)(o.f.Li,{heading:"Service Address",loading:t,children:(0,n.jsx)(o.f.EditBox,{content:m&&(0,n.jsx)(t$,{address:m}),editModeContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ul",{className:"flex flex-col gap-y-5",children:null==r?void 0:r.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)(tz._,{id:"address.".concat(e.id),label:(0,n.jsx)(t$,{address:e}),name:"address",value:e.id,variant:"squared",alignItems:"start",primaryColor:c,defaultChecked:e.id===u,onChange:v})},e.id))}),(0,n.jsx)("button",{type:"button",className:"helvetica-14-500 mt-10",onClick:()=>{y(tE.Ti.AddCustomerAddress)},children:"Use a different address +"})]})})})}var tV=i(94314),tJ=i(52243);function tK(e){let{items:t}=e,{getService:i}=(0,M.o)(),{primaryColor:a}=i();return(0,n.jsx)(tJ.f,{items:t,primaryColor:a})}var tQ=i(34737);function tX(e){var t,i;let{loading:a,formConfig:r,...s}=e,{setServiceAndHouseholdSettings:l}=(0,g.b)(),{watch:c,trigger:u}=s,h=null!==(t=c("household"))&&void 0!==t?t:{},m=null!==(i=c("householdWithAdditionalNotes"))&&void 0!==i?i:{},p=async()=>u("householdWithAdditionalNotes");return(0,n.jsx)(o.f.Li,{heading:"Household",loading:a,children:(0,n.jsx)(o.f.EditBox,{content:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tK,{items:Object.keys(h).filter(e=>h[e]).map(e=>tQ.c[e])}),Object.keys(m).filter(e=>m[e]).length>0&&(0,n.jsx)("ul",{children:Object.keys(m).filter(e=>m[e]&&m[e]!==eI.W).map(e=>(0,n.jsxs)("li",{className:"mt-2.5",children:[(0,n.jsx)("span",{className:"font-medium",children:"".concat(tQ.c[e],": ")}),m[e]]},e))})]}),editModeContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{className:"mb-5 grid gap-5",inputs:r.household,...s}),(0,n.jsx)(d.Z,{className:"grid gap-5",inputs:r.householdWithAdditionalNotes,...s})]}),showSaveBtn:!0,validateBeforeSave:p,onSaveClick:()=>{l({householdRules:(0,P.UA)({household:h,householdWithAdditionalNotes:m}),householdNotes:m.other||void 0})}})})}function t0(e){var t;let{loading:i,formConfig:a,...r}=e,{setServiceAndHouseholdSettings:s}=(0,g.b)(),{watch:l}=r,c=null!==(t=l("culinaryPreferences"))&&void 0!==t?t:{};return(0,n.jsx)(o.f.Li,{heading:"Culinary",loading:i,children:(0,n.jsx)(o.f.EditBox,{content:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tK,{items:Object.keys(c).filter(e=>"other"!==e&&c[e]).map(e=>tQ.e[e])}),c.other&&(0,n.jsxs)("p",{className:"mt-2.5",children:[(0,n.jsx)("span",{className:"font-medium",children:"Notes: "}),c.other]})]}),editModeContent:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(d.Z,{className:"grid grid-cols-1 gap-5 md:grid-cols-2",inputs:a.culinaryPreferences,...r})}),showSaveBtn:!0,onSaveClick:()=>{s({culinaryPreferences:(0,P.bh)({culinaryPreferences:c}),culinaryPreferencesNote:c.other||void 0})}})})}function t1(e){let{formConfig:t,totalBalance:i,...a}=e,{setSettings:r}=(0,g.b)(),{watch:s,trigger:c,formState:{isSubmitted:u}}=a,h=s("credits"),m=s("creditsAmount");return(0,l.useEffect)(()=>{"useCredits"===h&&(null==m?void 0:m.value)&&(null==m?void 0:m.value)<=i?r({creditsToApply:parseFloat(null==m?void 0:m.value)}):r({creditsToApply:void 0})},[h,null==m?void 0:m.value,r,i]),(0,l.useEffect)(()=>{h&&u&&c("creditsAmount")},[c,h,u]),(0,n.jsx)(o.f.Li,{heading:"Culinista Credits",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{className:"flex flex-col gap-y-5",...a,inputs:t.credits}),(0,n.jsxs)("div",{className:"ml-[26px] mt-1 flex items-center gap-x-4",children:[(0,n.jsx)(d.Z,{className:"w-[80px]",inputs:t.creditsAmount.map(e=>({...e,disabled:"doNotUseCredits"===h})),...a}
1),(0,n.jsxs)("p",{className:"opacity-60",children:["(total balance ",(0,n.jsxs)("span",{className:"font-medium",children:["$",i]}),")"]})]}),(0,n.jsx)("p",{className:"ml-[26px] mt-5 max-w-[315px] opacity-60",children:"If selected, Culinista Credits will be applied to your final bill. Credit card authorization is necessary regardless of Culinista Credit usage."})]})})}function t4(e){return(0,x.Ry)().shape({creditsAmount:(0,x.Ry)().when("credits",{is:"useCredits",then:(0,x.Ry)({value:(0,x.Rx)().required("Please enter the amount of credits you'd like to use").max(e,b.Om[b.c8.CreditsAmountInvalid]).typeError(b.Om[b.c8.InvalidValue])}),otherwise:(0,x.Ry)({value:(0,x.Z_)()})})})}let t2={credits:[{id:"credits.doNotUseCredits",type:"radio",name:"credits",label:"Donât use my credits",value:"doNotUseCredits"},{id:"credits.useCredits",type:"radio",name:"credits",label:"Apply credits to my total",value:"useCredits"}],creditsAmount:[{id:"creditsAmount.value",type:"money",name:"creditsAmount.value"}]},t3=(0,x.Ry)().shape({dateTime:(0,x.Ry)().shape({day:(0,x.Z_)().required("Please select a day of the week."),time:(0,x.Z_)().required("Please select a time."),startDate:(0,x.Z_)().required("Please select a start date.")})}),t5=(0,x.Ry)().shape({postnatalModule:(0,x.Ry)().shape({isFourthTrimester:(0,x.O7)(),dueDate:(0,x.Z_)().when("isFourthTrimester",{is:!0,then:(0,x.Z_)(),otherwise:(0,x.Z_)().required("Please select a due date.")})}),dateTime:(0,x.Ry)().when("postnatalModule.isFourthTrimester",{is:!0,then:(0,x.Ry)({day:(0,x.Z_)().required("Please select a day of the week."),time:(0,x.Z_)().required("Please select a time."),startDate:(0,x.Z_)().required("Please select a start date.")})})}),t7=(0,x.Ry)().shape({paymentMethodId:(0,x.Z_)().required("Please select a payment method."),...I,...k,...N.tj,orderAdditionalNotes:(0,x.Ry)().shape({note:(0,x.Z_)()})});function t8(e){var t,i;let{containerClassName:a,stepConfig:s}=e,{data:c,loading:u}=(0,r.EB8)(),h=null==c?void 0:c.customer,{getService:m}=(0,M.o)(),{getSelectedItems:v,getActiveMenu:y}=(0,ew.p)(),{calculateServiceEstimate:x}=(0,O._)(),{checkoutServiceAsExistingCustomer:b}=eS(),[j,w]=(0,l.useState)(null),{getServiceAndHouseholdSettings:k,setSettings:I,setServiceAndHouseholdSettings:D,setAddress:E}=(0,g.b)(),{data:T}=(0,r.HQO)({}),A={postnatalModule:[{id:"postnatalModule.dueDate",type:"date",name:"postnatalModule.dueDate",label:"Due Date"},{id:"postnatalModule.isFourthTrimester",type:"checkbox",name:"postnatalModule.isFourthTrimester",label:"Iâm already in my fourth trimester"}],dateTime:[{id:"dateTime.day",type:"select",name:"dateTime.day",label:"Day",options:[]},{id:"dateTime.time",type:"select",name:"dateTime.time",label:"Time",options:[]},{id:"dateTime.startDate",type:"date",name:"dateTime.startDate",label:"Start Date"}],orderAdditionalNotes:[{id:"orderAdditionalNotes.note",type:"textarea",name:"orderAdditionalNotes.note",rows:6}],...S,...t2,...N.vK,...N.sW},Z=v(),_=y(),{updateCulinaryAndHousehold:R}=eP(),{primaryColor:L,type:B,slug:H}=m(),{serviceUsage:q,portion:W,ingredientFlags:G}=k(),z=q===F.xF,$=(0,l.useMemo)(()=>{let e=t7;return(e=e.concat(z?t5:t3)).concat(t4((null==T?void 0:T.creditBalance.totalRemainingBalance)||0))},[null==T?void 0:T.creditBalance.totalRemainingBalance,z]),J=async e=>{try{let t;let{postnatalModule:i,household:a,householdWithAdditionalNotes:n,culinaryPreferences:r,dateTime:s,paymentMethodId:l,address:o,billingAddressSource:d,billingAddress:c,creditsAmount:u,credits:h,orderAdditionalNotes:m}=e;t=z&&!i.isFourthTrimester?{startDate:new Date(i.dueDate),time:"600",day:new Date(i.dueDate).getDay().toString()}:{day:s.day,startDate:s.startDate,time:s.time},I(t),D({culinaryPreferences:r?(0,P.bh)({culinaryPreferences:r}):void 0,culinaryPreferencesNote:(null==r?void 0:r.other)||void 0,householdRules:(0,P.UA)({household:a,householdWithAdditionalNotes:n}),householdNotes:(null==n?void 0:n.other)||void 0,otherNotes:(null==m?void 0:m.note)||void 0}),E(o),await R({culinaryPreferences:r,ingredientFlags:G||[],household:a,householdWithAdditionalNotes:n}),await b({items:Z,paymentId:l,billingAddress:"newAddress"===d?c:void 0,addressId:null==o?void 0:o.id,settings:t,menuIsExtended:!!(null==_?void 0:_.isExtendedMenu),menuReferenceId:null==_?void 0:_.referenceId,portion:W,serviceType:B,serviceSlug:H,creditsAmount:"useCredits"===h?u.value:"",otherNotes:(null==m?void 0:m.note)||void 0})}catch(e){w(e.message)}};(0,l.useEffect)(()=>{x()},[x]);let K=k();return(0,n.jsx)(p,{className:a,formId:s.id,onSubmit:J,defaultValues:{credits:"doNotUseCredits",billingAddressSource:"serviceAddress",culinaryPreferences:{...(0,P.aj)(K.culinaryPreferences||[],""),other:K.culinaryPreferencesNote||void 0},household:null===(t=K.householdRules)||void 0===t?void 0:t.filter(e=>"string"==typeof e).reduce((e,t)=>
1(e[t]=!0,e),{}),householdWithAdditionalNotes:null===(i=K.householdRules)||void 0===i?void 0:i.filter(e=>"string"!=typeof e).reduce((e,t)=>((null==t?void 0:t.note)&&(e[t.rule]=t.note),e),{...K.householdNotes?{other:K.householdNotes}:{}})},formSchema:$,children:e=>{let{watch:t}=e,i=t("postnatalModule"),a=!!(null==i?void 0:i.isFourthTrimester),r=t("billingAddressSource");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.f,{heading:"When would you like your Culinista chef to arrive each week?",description:"Our meal prep service recurs weekly. Sunday, Monday, and Tuesday slots are in high demand and may have limited availability. We will do our best to find a time that works for you. The chef will be in your home for 3-4 hours during each service. Table service is not includedâplease reach out for a custom quote or to adjust the frequency of your meal prep.",children:[z&&(0,n.jsx)(d.Z,{className:"grid grid-cols-2 items-center gap-7 md:grid-cols-3 md:[&>div:nth-child(2)]:col-span-2",inputs:A.postnatalModule.map(e=>({...e,disabled:a})),...e}),(!z||z&&a)&&(0,n.jsx)(C,{inputs:A.dateTime,...e,children:t=>{let{inputs:i}=t;return(0,n.jsx)(d.Z,{className:"grid grid-cols-2 gap-7 md:grid-cols-3 [&>div:nth-child(3)]:col-span-2 md:[&>div:nth-child(3)]:col-span-1",inputs:i,...e})}})]}),(0,n.jsx)(o.f,{children:(0,n.jsx)(o.f.Ul,{children:(0,n.jsx)(tY,{loading:u,customerData:h,...e})})}),(0,n.jsx)(o.f,{heading:"Payment Details",description:(0,n.jsxs)(n.Fragment,{children:["Your credit card will be authorized upon checkout, and you will be charged 2-3 business days after your service date. You are able to cancel your service at any time prior to 48 hours before your service time free of charge. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{className:"underline",href:V.y.faqBilling(),rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]}),children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tV.z,{...e}),(0,n.jsxs)(o.f.Li,{heading:"Billing Address",children:[(0,n.jsx)(d.Z,{className:"flex flex-col gap-5",inputs:A.billingAddressSource,...e}),"newAddress"===r&&(0,n.jsx)(f.j,{className:"mt-7 grid grid-cols-3 gap-x-7 gap-y-7 [&>div:nth-child(-n+2)]:col-span-3 [&>div:nth-child(n+6)]:col-span-3",variant:"simple",fieldName:"billingAddress",...e,primaryColor:L,disableZipCodeValidation:!0})]}),(0,n.jsx)(t1,{totalBalance:(null==T?void 0:T.creditBalance.totalRemainingBalance)||0,formConfig:A,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsx)(o.f.Ul,{children:(0,n.jsxs)(o.f.Li,{heading:"Client Information",loading:u,children:[(0,n.jsx)("p",{children:"".concat(null==h?void 0:h.firstName," ").concat(null==h?void 0:h.lastName)}),(0,n.jsx)("p",{children:null==h?void 0:h.email}),(0,n.jsx)("p",{children:null==h?void 0:h.phoneNumber})]})})}),(0,n.jsx)(o.f,{heading:"Service Settings",description:"Your Culinista chef will use the information below to customize your service. You can edit these settings below or any time through your client dashboard.",children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tX,{loading:u,formConfig:A,...e}),(0,n.jsx)(t0,{loading:u,formConfig:A,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"helvetica-14-500 mb-5",children:s.dictionary.orderAdditionalNotesHeading}),(0,n.jsx)(d.Z,{...e,inputs:A.orderAdditionalNotes})]})}),j&&(0,n.jsx)(U,{errorMessage:j}),(0,n.jsx)(o.f,{className:"mt-7",heading:"Billing & Cancellation",descriptionTransparent:!0,disableBorderAndPadding:!0,description:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:"All services are billed with 20% gratuity included, 100% of which will go to your Culinista\xae chef. While there is no expectation to do so, you are welcome to provide an additional cash tip for extraordinary service."}),(0,n.jsx)("li",{children:"Your credit card will be authorized upon checkout and you will be charged 2-3 business days after your service date."}),(0,n.jsxs)("li",{children:["You are able to cancel your service at any time prior to 48 hours before your service time free of charge. If you cancel for any reason between 48 hours and 24 hours before your service time, you will be charged 50% of the service fee to partially compensate your chef. If you cancel within 24 hours of your service, you will be charged the full service fee plus any charges incurred by the chef, inclusive of groceries and travel at the companyâs discretion. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{href:V.y.faqBilling(),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]})]})})]})}})}function t6(e){let{className:t,note:i}=e,{getService:a}=(0,M.o)(),{secondaryColorAlternative:r}=a();return(0,n.jsx)("div",{className:(0,q.Z)(t,"helvetica-14-400 flex w-full p-2 text-ar-culinista-black",(0,em.M)("bg",r)),children:i})}var t9=i(84922),ie=i(97405);function it(e){var t;let{timeOutOfRangeNoteMessage:i,children:a,inputs:r,watch:s,resetField:o}=e,{getAddress:d}=(0,g.b)(),{zipCode:c}=d(),{zipCode:u}=null!==(t=s("address"))&&void 0!==t?t:{},h=s("location.date"),m=s("location.arrivalTime"),p=s("location.tableTime"),f=(0,ie.ri)(m)||(0,ie.ri)(p),{availableDays:v,startTimesOptions:y,isHoliday:x}=(0,j.f)({serviceType:"gatherings",date:h,zipCode:u||c}),b=f||x?(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Please note: "}),f&&i,x&&"The date you're booking is a high-volume business day. Prices are higher to ensure chef availability and compensate chefs for their time especially on holiday dates."]}):null;return(0,l.useEffect)(()=>{h&&!v.some(e=>(0,w.Z)(e).toString()===h.toString())&&o("location.date")},[v,o]),(0,n.jsx)(n.Fragment,{children:a({inputs:r.map(e=>"location.date"===e.name?{...e,availableDates:v}:"location.arrivalTime"===e.name?{...e,disabled:!h,options:y}:"location.tableTime"===e.name?{...e,disabled:!m||!h,options:y.filter(e=>!(0,t9.Z)(new Date(e.value),new Date(m)))}:e),note:b})})}let ii={[r.UW4.Gathering]:30,[r.UW4.CookingClass]:12};var ia=i(26903);let ir=(0,x.Ry)().shape({location:(0,x.Ry)().shape({date:(0,x.Z_)().required("Date is required"),arrivalTime:(0,x.Z_)().required("Arrival time is required"),tableTime:(0,x.Z_)().required("Table time is required")}),...k}),is=(0,x.Ry)().shape({account:(0,x.Ry)().shape({email:(0,x.Z_)().required("Email is required").email(b.Om[b.c8.EmailInvalid]),password:(0,x.Z_)().required("Password is required"),
1confirmPassword:(0,x.Z_)().required("Confirm password is required").oneOf([(0,x.iH)("password"),null],b.Om[b.c8.PasswordsMustMatch])})});function il(e){var t;let{containerClassName:i,stepConfig:a}=e,{user:r,registerFormUserData:s}=(0,y.jJ)(),{setRegisterFormUserData:c}=(0,y.BJ)(),{setAddress:u,setSettings:h,getAddress:m}=(0,g.b)(),{goToNextStep:j}=(0,v.V)(),{getSettings:w}=(0,g.b)(),{updateBookingOrderSteps:C}=(0,D.FP)(),{calculateServiceEstimate:N}=(0,O._)(),{dictionary:k}=a,{getService:S}=(0,M.o)(),I=S(),{checkIfAccountExists:P}=(0,A.a)(),F=null==I?void 0:I.type,[Z,_]=(0,l.useState)({}),R=!r.isLoggedIn||r.isLoggedIn&&!r.isAccountCreated&&r.isSignInWithEmailAndPassword,L=(0,l.useMemo)(()=>{let e=ir;return R&&(e=e.concat(is)),e=e.concat((0,x.Ry)().shape({guests:(0,x.Ry)().shape({numberOfGuests:(0,x.Rx)().required("Number of guests can't be empty").min(2,"".concat(b.Om[b.c8.MinNumberOfGuests]," 2")).max(ii[F],"")})}))},[R,F]),[B,H]=(0,l.useState)(!r.isLoggedIn&&!s),q=(0,l.useCallback)(async()=>{setTimeout(()=>{C.current(),H(!1)},0)},[C]),U={account:[{id:"account.email",type:"text",name:"account.email",label:"Email",disabled:!0},{id:"account.password",type:"password",name:"account.password",label:"Password"},{id:"account.confirmPassword",type:"password",name:"account.confirmPassword",label:"Confirm Password"}],guests:[{id:"guests.numberOfGuests",type:"counter",name:"guests.numberOfGuests",maxValue:ii[F]}],location:[{id:"location.date",type:"date",name:"location.date",label:"Select Date"},{id:"location.arrivalTime",type:"select",name:"location.arrivalTime",label:"Guest Arrival Time",options:[]},{id:"location.tableTime",type:"select",name:"location.tableTime",label:"Table Time",options:[]}]},W=async e=>{let{account:t,address:i,guests:a,location:n}=e;if(R){let{isValid:e,meetsMinPasswordLength:i,containsLowercaseLetter:a,containsNonAlphanumericCharacter:n,containsNumericCharacter:r,containsUppercaseLetter:s,meetsMaxPasswordLength:l}=await (0,E.uo)(T.I,t.password);if(!e){i?a?n?r?s?l?_({"account.password":"Password is invalid."}):_({"account.password":"Password must be at most 128 characters long."}):_({"account.password":"Password must contain at least one uppercase letter."}):_({"account.password":"Password must contain at least one numeric character."}):_({"account.password":"Password must contain at least one non-alphanumeric character."}):_({"account.password":"Password must contain at least one lowercase letter."}):_({"account.password":"Password must be at least 8 characters long."});return}if(await P(t.email)){_({"account.email":"Account with this email already exists."});return}c({email:t.email,password:t.password})}u(i),h({numberOfPeople:a.numberOfGuests,date:n.date,arrivalTime:n.arrivalTime,dinnerTime:n.tableTime}),j()},G=w(),z=m();return((0,l.useEffect)(()=>{N()},[N]),(0,l.useEffect)(()=>(B?h({disableSubmitFormButton:!0}):h({disableSubmitFormButton:!1}),()=>{h({disableSubmitFormButton:!1})}),[h,B]),B)?(0,n.jsx)(et,{containerClassName:i,onComplete:q}):(0,n.jsx)(p,{errors:Z,className:i,formId:a.id,onSubmit:W,formSchema:L,defaultValues:{...R?{account:{email:null==s?void 0:s.email}}:{},guests:{numberOfGuests:null!==(t=G.numberOfPeople)&&void 0!==t?t:2},location:{date:G.date,arrivalTime:G.arrivalTime,tableTime:G.dinnerTime},address:z},children:e=>{let{watch:t}=e,i=t("guests.numberOfGuests");return(0,n.jsxs)(n.Fragment,{children:[R&&(0,n.jsxs)(o.f,{heading:"Create Your Account",description:"We'll securely store your information, including culinary and household settings, so you don't have to enter them every time.",children:[(0,n.jsx)(d.Z,{className:"grid gap-7 md:grid-cols-2 md:[&>div:first-child]:col-span-2",inputs:U.account,...e}),(0,n.jsxs)("p",{className:"helvetica-14-400 -mt-6 opacity-70",children:["Password requirements:",(0,n.jsx)("br",{}),"Minimum 6 characters",(0,n.jsx)("br",{}),"Must include 1 lowercase character, 1 uppercase character, number, and 1 non-alphanumeric character."]}),(0,n.jsxs)("p",{className:"helvetica-12-500 -mt-6",children:["Do you want to use a different email address?"," ",(0,n.jsx)("button",{type:"button",className:"underline",onClick:()=>{H(!0),c(null)},children:"Click here"})]})]}),(0,n.jsxs)(o.f,{heading:"How many guests?",children:[(0,n.jsx)(d.Z,{inputs:U.guests,...e,updateNumberOfPeople:!0}),i>ii[F]&&(0,n.jsx)(t6,{note:(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Please note:"})," For parties larger than"," ",ii[F],", please fill out our"," ",(0,n.jsx)(Y(),{className:"underline",href:V.y.inquiry(V.y.bookingOrder(),{service:(0,ia.u)(F),numberOfPeople:i.toString()}),children:"custom inquiry here"}),"."]})})]}
1),(0,n.jsx)(o.f,{heading:k.locationHeading,description:k.locationDescription,headingTooltip:k.locationHeadingTooltip,children:(0,n.jsx)(it,{timeOutOfRangeNoteMessage:k.dateTimeOutOfRangeNote,inputs:U.location,...e,children:t=>{let{inputs:i,note:a}=t;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{className:"grid grid-cols-2 gap-7 md:grid-cols-3 [&>div:nth-child(3)]:col-span-2 md:[&>div:nth-child(3)]:col-span-1",inputs:i,...e}),a&&(0,n.jsx)(t6,{note:a})]})}})}),(0,n.jsx)(o.f,{heading:"What is your address?",children:(0,n.jsx)(f.j,{className:"grid grid-cols-3 gap-x-7 gap-y-7 [&>div:nth-child(-n+2)]:col-span-3 [&>div:nth-child(n+6)]:col-span-3",...e,primaryColor:I.primaryColor,updateBookingOrderDetails:!0})})]})}})}function io(e){let{inputs:t,...i}=e,{watch:a,trigger:r}=i,s=a("guests.numberOfGuests"),{setSettings:l}=(0,g.b)(),{getService:c}=(0,M.o)(),u=c(),h=null==u?void 0:u.type,m=async()=>r("guests.numberOfGuests");return(0,n.jsx)(o.f.Li,{heading:"Guest Count",children:(0,n.jsx)(o.f.EditBox,{content:"".concat(s," ").concat(1===s?"guest":"guests"),editModeContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{inputs:t,...i}),s>ii[h]&&(0,n.jsx)(t6,{note:(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Please note:"})," For parties larger than"," ",ii[h],", please fill out our"," ",(0,n.jsx)(Y(),{className:"underline",href:V.y.inquiry(V.y.bookingOrder(),{service:(0,ia.u)(h),numberOfPeople:s.toString()}),children:"custom inquiry here"}),"."]})})]}),showSaveBtn:!0,validateBeforeSave:m,onSaveClick:()=>l({numberOfPeople:s})})})}let id=(0,x.Ry)().shape({location:(0,x.Ry)().shape({date:(0,x.Z_)().required("Please select a date"),arrivalTime:(0,x.Z_)().required("Please select an arrival time"),tableTime:(0,x.Z_)().required("Please select a dinner time")}),paymentMethodId:(0,x.Z_)().required("Please select a payment method"),...I,...k,...N.tj,orderAdditionalNotes:(0,x.Ry)().shape({note:(0,x.Z_)()})});function ic(e){var t,i,a;let{containerClassName:s,stepConfig:c}=e,{data:u,loading:h}=(0,r.EB8)(),m=null==u?void 0:u.customer,{getService:v}=(0,M.o)(),{checkoutServiceAsExistingCustomer:y}=eS(),{updateCulinaryAndHousehold:j}=eP(),{calculateServiceEstimate:w}=(0,O._)(),{getSettings:C,getServiceAndHouseholdSettings:k,setSettings:I,setServiceAndHouseholdSettings:D,setAddress:E}=(0,g.b)(),{data:T}=(0,r.HQO)(),{numberOfPeople:A}=C(),{getActiveMenu:F,getSelectedItems:Z}=(0,ew.p)(),_=k(),R=v(),L=Z(),B=F(),H=(a=R.type,{location:[{id:"location.date",type:"date",name:"location.date",label:"Select Date"},{id:"location.arrivalTime",type:"select",name:"location.arrivalTime",label:"Guest Arrival Time",options:[]},{id:"location.tableTime",type:"select",name:"location.tableTime",label:"Table Time",options:[]}],...S,...t2,guests:[{id:"guests.numberOfGuests",type:"counter",name:"guests.numberOfGuests",maxValue:a===r.UW4.Gathering||a===r.UW4.CookingClass?ii[a]:void 0}],...N.vK,...N.sW,orderAdditionalNotes:[{id:"orderAdditionalNotes.note",type:"textarea",name:"orderAdditionalNotes.note",rows:6}]}),[q,W]=(0,l.useState)(null),G=(0,l.useMemo)(()=>{let e=id;return(e=e.concat((0,x.Ry)().shape({guests:(0,x.Ry)().shape({numberOfGuests:(0,x.Rx)().required("Please select the number of guests").min(2,"".concat(b.Om[b.c8.MinNumberOfGuests]," 2")).max(ii[R.type],"")})}))).concat(t4((null==T?void 0:T.creditBalance.totalRemainingBalance)||0))},[null==T?void 0:T.creditBalance.totalRemainingBalance,R.type]),z=async e=>{try{let{location:t,guests:i,orderAdditionalNotes:a,household:n,householdWithAdditionalNotes:r,culinaryPreferences:s,paymentMethodId:l,address:o,billingAddressSource:d,billingAddress:c,creditsAmount:u,credits:h}=e,m={numberOfPeople:i.numberOfGuests,date:new Date(t.date),arrivalTime:t.arrivalTime,dinnerTime:t.tableTime,creditsToApply:"useCredits"===h&&u.value?parseFloat(u.value):void 0};I(m),D({culinaryPreferences:s?(0,P.bh)({culinaryPreferences:s}):void 0,culinaryPreferencesNote:(null==s?void 0:s.other)||void 0,householdRules:(0,P.UA)({household:n,householdWithAdditionalNotes:r}),householdNotes:r.other||void 0,otherNotes:(null==a?void 0:a.note)||void 0}),E(o),await j({culinaryPreferences:s,ingredientFlags:_.ingredientFlags||[],household:n,householdWithAdditionalNotes:r}),await y({items:L,paymentId:l,billingAddress:"newAddress"===d?c:void 0,addressId:null==o?void 0:o.id,settings:m,portion:_.portion,serviceType:R.type,menuIsExtended:B.isExtendedMenu,menuReferenceId:B.referenceId,serviceSlug:R.slug,creditsAmount:"useCredits"===h?u.value:"",otherNotes:null==a?void 0:a.note})}catch(e){W(e.message)}};(0,l.useEffect)(()=>{w()},[w]);let $=k();return(0,n.jsx)(p,{className:s,formId:c.id,onSubmit:z,defaultValues:{credits:"doNotUseCredits",billingAddressSource:"serviceAddress",guests:{numberOfGuests:null!=A?A:2},culinaryPreferences:{...(0,P.aj)($.culinaryPreferences||[],""),other:$.culinaryPreferencesNote||void 0},household:null===(t=$.householdRules)||void 0===t?void 0:t.filter(e=>"string"==typeof e).reduce((e,t)=>
1(e[t]=!0,e),{}),householdWithAdditionalNotes:null===(i=$.householdRules)||void 0===i?void 0:i.filter(e=>"string"!=typeof e).reduce((e,t)=>((null==t?void 0:t.note)&&(e[t.rule]=t.note),e),{...$.householdNotes?{other:$.householdNotes}:{}})},formSchema:G,children:e=>{let{watch:t}=e,i=t("billingAddressSource");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:c.dictionary.locationHeading,description:c.dictionary.locationDescription,headingTooltip:c.dictionary.locationHeadingTooltip,children:(0,n.jsx)(it,{timeOutOfRangeNoteMessage:c.dictionary.dateTimeOutOfRangeNote,inputs:H.location,...e,children:t=>{let{inputs:i,note:a}=t;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{className:"grid grid-cols-2 gap-7 md:grid-cols-3 [&>div:nth-child(3)]:col-span-2 md:[&>div:nth-child(3)]:col-span-1",inputs:i,...e}),a&&(0,n.jsx)(t6,{note:a})]})}})}),(0,n.jsx)(o.f,{heading:"Payment Details",description:(0,n.jsxs)(n.Fragment,{children:["Your credit card will be authorized upon checkout, and you will be charged 2-3 business days after your service date. You are able to cancel your service at any time prior to 48 hours before your service time free of charge. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{className:"underline",href:V.y.faqBilling(),rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]}),children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tV.z,{...e}),(0,n.jsxs)(o.f.Li,{heading:"Billing Address",children:[(0,n.jsx)(d.Z,{className:"flex flex-col gap-5",inputs:H.billingAddressSource,...e}),"newAddress"===i&&(0,n.jsx)(f.j,{className:"mt-7 grid grid-cols-3 gap-x-7 gap-y-7 [&>div:nth-child(-n+2)]:col-span-3 [&>div:nth-child(n+6)]:col-span-3",variant:"simple",fieldName:"billingAddress",...e,primaryColor:R.primaryColor,disableZipCodeValidation:!0})]}),(0,n.jsx)(t1,{totalBalance:(null==T?void 0:T.creditBalance.totalRemainingBalance)||0,formConfig:H,...e})]})}),(0,n.jsx)(o.f,{heading:"Service Details",description:"Please confirm the details below or adjust as needed. Guest count and zip code updates may result in changes to your service fee.",children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsxs)(o.f.Li,{heading:"Client Information",loading:h,children:[(0,n.jsx)("p",{children:"".concat(null==m?void 0:m.firstName," ").concat(null==m?void 0:m.lastName)}),(0,n.jsx)("p",{children:null==m?void 0:m.email}
1),(0,n.jsx)("p",{children:null==m?void 0:m.phoneNumber})]}),(0,n.jsx)(tY,{loading:h,customerData:m,...e}),(0,n.jsx)(io,{inputs:H.guests,...e})]})}),(0,n.jsx)(o.f,{heading:"Service Settings",description:"Please confirm the details below or adjust as needed.",children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tX,{loading:h,formConfig:H,...e}),(0,n.jsx)(t0,{loading:h,formConfig:H,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"helvetica-14-500 mb-5",children:c.dictionary.orderAdditionalNotesHeading}),(0,n.jsx)(d.Z,{...e,inputs:H.orderAdditionalNotes})]})}),q&&(0,n.jsx)(U,{errorMessage:q}),(0,n.jsx)(o.f,{className:"mt-7",heading:"Billing & Cancellation",descriptionTransparent:!0,disableBorderAndPadding:!0,description:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:"All services are billed with 20% gratuity included, 100% of which will go to your Culinista\xae chef. While there is no expectation to do so, you are welcome to provide an additional cash tip for extraordinary service."}),(0,n.jsx)("li",{children:"Your credit card will be authorized upon checkout and you will be charged 2-3 business days after your service date."}),(0,n.jsxs)("li",{children:["You are able to cancel your service at any time prior to 48 hours before your service time free of charge. If you cancel for any reason between 48 hours and 24 hours before your service time, you will be charged 50% of the service fee to partially compensate your chef. If you cancel within 24 hours of your service, you will be charged the full service fee plus any charges incurred by the chef, inclusive of groceries and travel at the companyâs discretion. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{href:V.y.faqBilling(),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]})]})})]})}})}let iu=(0,x.Ry)().shape({...N.tj});function ih(e){var t,i,a;let{containerClassName:r,stepConfig:s}=e,l={...N.sW,...N.vK,orderAdditionalNotes:[{id:"orderAdditionalNotes.note",type:"textarea",name:"orderAdditionalNotes.note",rows:6}]}
1,{setServiceAndHouseholdSettings:c,getServiceAndHouseholdSettings:u}=(0,g.b)(),{goToNextStep:h}=(0,v.V)(),{dictionary:m}=s,f=(0,eC.u)().map(tC.Y).filter(e=>!!e&&!!e.id&&!!e.title)||[],y=async e=>{let{culinaryPreferences:t,household:i,householdWithAdditionalNotes:a,orderAdditionalNotes:n,ingredientFlags:r}=e;c({culinaryPreferences:(0,P.bh)({culinaryPreferences:t}),culinaryPreferencesNote:t.other||void 0,ingredientFlags:(0,P.aQ)({ingredientFlags:r},f),householdRules:(0,P.UA)({household:i,householdWithAdditionalNotes:a}),householdNotes:a.other||void 0,otherNotes:(null==n?void 0:n.note)||void 0}),h()},x="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-5 [&>div]:flex",b=u();return(0,n.jsx)(p,{className:r,formId:s.id,onSubmit:y,formSchema:iu,defaultValues:{culinaryPreferences:{...(0,P.aj)(b.culinaryPreferences||[],""),other:b.culinaryPreferencesNote||void 0},ingredientFlags:(null===(t=b.ingredientFlags)||void 0===t?void 0:t.reduce((e,t)=>(e[t.id]=!0,e),{}))||{},household:null===(i=b.householdRules)||void 0===i?void 0:i.filter(e=>"string"==typeof e).reduce((e,t)=>(e[t]=!0,e),{}),householdWithAdditionalNotes:null===(a=b.householdRules)||void 0===a?void 0:a.filter(e=>"string"!=typeof e).reduce((e,t)=>((null==t?void 0:t.note)&&(e[t.rule]=t.note),e),{...b.householdNotes?{other:b.householdNotes}:{}}),orderAdditionalNotes:{note:b.otherNotes}},children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:"Tell us about your culinary preferences.",description:"These settings will be saved to your account for future bookings.",children:(0,n.jsx)(d.Z,{className:x,inputs:l.culinaryPreferences,...e})}),(0,n.jsx)(o.f,{heading:m.ingredientFlagsHeading,description:"Check all that apply.",children:(0,n.jsx)(tW,{className:x,allergens:f,...e})}),(0,n.jsx)(o.f,{heading:"What should we know about your household?",description:"These settings will be saved to your account for future bookings.",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{className:"mb-5 grid gap-5",inputs:l.household,...e}),(0,n.jsx)(d.Z,{className:"grid gap-5",inputs:l.householdWithAdditionalNotes,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"helvetica-14-500 mb-5",children:m.orderAdditionalNotesHeading}),(0,n.jsx)(d.Z,{...e,inputs:l.orderAdditionalNotes})]})})]})})}var im=i(34376);function ip(){let e=(0,tl._)(["","{\n title,\n qualifier,\n 'id': _id,\n 'slug': slug.current,\n 'imageUrl': mainImage.image.asset->url,\n 'imageAlt': mainImage.alt,\n }"]);return ip=function(){return e},e}function ig(e){let{stepConfig:t}=e,i=(0,W.useRouter)(),a=(0,im.useSearchParams)(),{removeMenu:r,getActiveMenu:s,removeAllItems:o}=(0,ew.p)(),{goToNextStep:d}=(0,v.V)(),{data:c,loading:u}=function(){let[e,t]=(0,l.useState)([]),[i,a]=(0,l.useState)(!1),[n,r]=(0,l.useState)(null),s=(0,l.useCallback)(async()=>{let e=[];try{a(!0),e=(await tf.L.fetch((0,to.Z)(ip(),'*[_type == "cookingClass" && isArchive != true]'))).map(e=>({...e,type:"menu"})),t(e)}catch(e){r(e.message)}finally{a(!1)}return e},[]);return(0,l.useEffect)(()=>{s()},[s]),{data:e,loading:i,error:n}}();return(0,l.useEffect)(()=>{let e=s();e&&r(e.referenceId),o()},[]),(0,n.jsx)(ts,{items:c,loading:u,gridCardClickFunction:e=>{let t=Object.fromEntries(a),n=null==c?void 0:c.find(t=>t.id===e);n&&i.push({query:{...t,post:n.slug}},void 0,{shallow:!0,scroll:!1})},onSubmit:d,formId:t.id})}async function iv(e,t){let{apolloClient:i}=t,a={},n=[];if(e.collection){if(e.collection["my-favorites"]){var s,l;let{data:e}=await i.query({query:r.HT8,fetchPolicy:"network-only"}),t=null==e?void 0:null===(l=e.customer)||void 0===l?void 0:null===(s=l.favoriteMenus)||void 0===s?void 0:s.map(e=>e.menuId);t.length?n.push(...t):n.push("non-existent-id")}n&&(a.collection||(a.collection=[]),a.collection.push("_id in $favoriteMenuIds")),Object.keys(e.collection).filter(t=>e.collection[t]&&"my-favorites"!==t).forEach(t=>{e.collection[t]&&(a.collection||(a.collection=[]),a.collection.push('collections[]->slug.current match "'.concat(t,'"')))})}return e.format&&Object.keys(e.format).forEach(t=>
1{e.format[t]&&(a.format||(a.format=[]),a.format.push('format[]->slug.current match "'.concat(t,'"')))}),e.season&&Object.keys(e.season).forEach(t=>{e.season[t]&&(a.season||(a.season=[]),a.season.push('seasonality[]->slug.current match "'.concat(t,'"')))}),{query:Object.values(a).map(e=>"(".concat(e.join(" || "),")")).join(" && "),favoriteMenuIds:n}}let iy=[{label:"Collection",name:"collection",layout:"two-columns",options:[]},{label:"Format",name:"format",layout:"two-columns",options:[]},{label:"Season",name:"season",layout:"two-columns",options:[]}];function ix(e){let{stepConfig:t}=e,[i,a]=(0,l.useState)(iy),{search:s,data:o,loading:d}=function(){let e=(0,td.Q)(),[t,i]=(0,l.useState)([]),[a,n]=(0,l.useState)(!1),[r,s]=(0,l.useState)(null);return{search:(0,l.useCallback)(async(t,a)=>{let r=[];try{(null==a?void 0:a.withoutUpdates)||n(!0);let s=[],l=function(e){if(!e)return"";let t=e.toLowerCase(),i=[];return i.push('title match "'.concat(t,'*"')),i.push('courses[].dishes[].dish->title match "'.concat(t,'*"')),i.push('courses[].dishes[].dish->ingredientList match "'.concat(t,'*"')),i.push('cuisine[]->title match "'.concat(t,'*"')),i.join(" || ")}(t.search),{query:o,favoriteMenuIds:d}=await iv(t,{apolloClient:e});l&&s.push("(".concat(l,")")),o&&s.push("(".concat(o,")"));let c='*[_type == "menu" && !defined(cookingClass->_id) && isArchive != true && occurrence != "weekly"'.concat(s.length?" && ":"").concat(s.join(" && "),"]|order(orderRank)");(null==a?void 0:a.limit)&&(c+="[0...".concat(a.limit,"]"));let u=await fetch("api/get-menus",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:c,favoriteMenuIds:d})}),{menus:h}=await u.json()||{menus:[]};r=h.map(e=>({...e,type:"menu"})),t.search&&r.sort((e,i)=>{let a=e.title.toLowerCase().includes(t.search.toLowerCase()),n=i.title.toLowerCase().includes(t.search.toLowerCase());return a&&!n?-1:!a&&n?1:0}),(null==a?void 0:a.withoutUpdates)||i(r)}catch(e){(null==a?void 0:a.withoutUpdates)||s(e.message)}finally{(null==a?void 0:a.withoutUpdates)||n(!1)}return r},[e]),data:t,loading:a,error:r}}(),{removeMenu:c,getActiveMenu:u,removeAllItems:h}=(0,ew.p)(),[m]=(0,r.mw0)(),{goToNextStep:p}=(0,v.V)(),f=(0,im.useSearchParams)(),g=(0,W.useRouter)(),{user:x}=(0,y.jJ)(),b=x.isLoggedIn&&x.isAuthorized,j=async e=>{await s(e)},w=e=>{let t=Object.fromEntries(f),i=null==o?void 0:o.find(t=>t.id===e);i&&g.push({query:{...t,post:i.slug}},void 0,{shallow:!0,scroll:!1})},C=(e,t)=>a(i=>{let a=t.map(t=>({id:t._id,label:t.title,name:"".concat(e,".").concat(t.slug.current.toLowerCase()),order:t.order||0})).filter((e,t,i)=>t===i.findIndex(t=>t.name===e.name&&t.label===e.label)).sort((e,t)=>e.order-t.order),n=[...i],r=n.find(t=>t.name===e);return r&&(r.options=a),n});(0,ex.T3g)({onCompleted:e=>{C("collection",e.allMenuCollection)}}),(0,ex.uwr)({onCompleted:e=>{C("format",e.allMenuFormat)}}),(0,ex.DwT)({onCompleted:e=>{C("season",e.allSeasonality)}});let N=tp();("autumn"===N||"winter"===N)&&(N="fall--winter");let k={season:{evergreen:!0,[N]:!0}};return(0,l.useEffect)(()=>{(async()=>{if(b){let{data:e}=await m();if((null==e?void 0:e.customer.favoriteMenus.length)===0)return;let t=i.find(e=>"collection"===e.name);t&&a(e=>(t.options.find(e=>"collection.my-favorites"===e.name)||(t.options.push({id:"",label:"My Favorites",name:"collection.my-favorites"}),e[0]=t),e))}})()},[i,m,b]),(0,l.useEffect)(()=>{let e=u();e&&c(e.referenceId),h(),s(k)},[]),(0,n.jsx)(ts,{items:o,filters:i,loading:d,onFiltersFormSubmit:j,inputSearchFunction:e=>s(e,{withoutUpdates:!0}),gridCardClickFunction:w,searchResultClickFunction:w,onSubmit:p,initialFormValues:k,formId:t.id,onFiltersDropdownToggle:()=>f.get("post")?{blockProcess:!0}:{blockProcess:!1}})}function ib(e){let{stepConfig:t}=e,{getActiveMenuData:i,getSelectedItems:a}=(0,ew.p)(),{goToNextStep:r}=(0,v.V)(),s=i(),o=(null==s?void 0:s.__typename)==="CookingClass"&&(null==s?void 0:s.sections)||void 0,d=(0,l.useMemo)(()=>(0,x.Ry)({...(null==o?void 0:o.reduce((e,t)=>{let i=(null==t?void 0:t.title)==="Drinks";return e[t._key]=(0,x.Ry)().test("minimalAmountNotSelected","Please add the required number of ".concat(i?"drinks":"dishes"),e=>{let i=Object.values(e||{}
1).filter(Boolean);return!((null==i?void 0:i.length)<t.numberOfDishes)}),e},{}))||{}}),[o]),c=(0,l.useMemo)(()=>a().reduce((e,t)=>(e[t.courseName]?e[t.courseName][t.referenceId]=!0:e[t.courseName]={[t.referenceId]:!0},e),{}),[a]);return(0,n.jsx)(p,{onSubmit:r,formId:t.id,formSchema:d,defaultValues:c,children:e=>(0,n.jsx)(tH,{formMethods:e,hideExtendedMenu:!0})})}var ij=i(71977);let iw=(0,x.Ry)().shape({paymentMethodId:(0,x.Z_)().required("Please select a payment method"),...N.tj,orderAdditionalNotes:(0,x.Ry)().shape({note:(0,x.Z_)()})});function iC(e){var t,i;let{containerClassName:a,stepConfig:s}=e,{data:c,loading:u}=(0,r.EB8)(),h=null==c?void 0:c.customer,[m,f]=(0,l.useState)(null),{getSelectedItems:v}=(0,ew.p)(),{calculateServiceEstimate:y}=(0,O._)(),{updateMealPrepService:x}=eS(),{updateCulinaryAndHousehold:b}=eP(),{setServiceAndHouseholdSettings:j,getServiceAndHouseholdSettings:w,getSettings:C}=(0,g.b)(),k=w(),{orderId:I}=C(),{data:M}=(0,r.E7r)({variables:{input:{serviceId:I}}}),{data:D}=(0,r.HQO)(),E={...S,...t2,...N.vK,...N.sW,orderAdditionalNotes:[{id:"orderAdditionalNotes.note",type:"textarea",name:"orderAdditionalNotes.note",rows:6}]},T=v(),A=(0,l.useMemo)(()=>iw.concat(t4((null==D?void 0:D.creditBalance.totalRemainingBalance)||0)),[null==D?void 0:D.creditBalance.totalRemainingBalance]),F=async e=>{let{household:t,householdWithAdditionalNotes:i,culinaryPreferences:a,paymentMethodId:n,creditsAmount:r,orderAdditionalNotes:s}=e;j({culinaryPreferences:a?(0,P.bh)({culinaryPreferences:a}):void 0,culinaryPreferencesNote:(null==a?void 0:a.other)||void 0,householdRules:(0,P.UA)({household:t,householdWithAdditionalNotes:i}),householdNotes:(null==i?void 0:i.other)||void 0});try{await b({culinaryPreferences:a,ingredientFlags:k.ingredientFlags||[],household:t,householdWithAdditionalNotes:i}),await x({serviceId:I,items:T,paymentId:n,creditsAmount:r.value,menuCustomInstructions:null==s?void 0:s.note})}catch(e){f(e.message)}};(0,l.useEffect)(()=>{y()},[y]);let Z=w();return(0,n.jsx)(p,{className:a,formId:s.id,onSubmit:F,defaultValues:{credits:"doNotUseCredits",billingAddressSource:"serviceAddress",culinaryPreferences:{...(0,P.aj)(Z.culinaryPreferences||[],""),other:Z.culinaryPreferencesNote||void 0},household:null===(t=Z.householdRules)||void 0===t?void 0:t.filter(e=>"string"==typeof e).reduce((e,t)=>(e[t]=!0,e),{}),householdWithAdditionalNotes:null===(i=Z.householdRules)||void 0===i?void 0:i.filter(e=>"string"!=typeof e).reduce((e,t)=>((null==t?void 0:t.note)&&(e[t.rule]=t.note),e),{...Z.householdNotes?{other:Z.householdNotes}:{}})},formSchema:A,children:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.f,{heading:"Payment Details",description:(0,n.jsxs)(n.Fragment,{children:["Your credit card will be authorized upon checkout, and you will be charged 2-3 business days after your service date. You are able to cancel your service at any time prior to 48 hours before your service time free of charge. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{className:"underline",href:V.y.faqBilling(),rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]}),children:(null==M?void 0:M.service.customerCreditApplications.length)===0&&(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tV.z,{...e}),(0,n.jsx)(t1,{totalBalance:(null==D?void 0:D.creditBalance.totalRemainingBalance)||0,formConfig:E,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsx)(o.f.Ul,{children:(0,n.jsxs)(o.f.Li,{heading:"Client Information",loading:u,children:[(0,n.jsx)("p",{children:"".concat(null==h?void 0:h.firstName," ").concat(null==h?void 0:h.lastName)}),(0,n.jsx)("p",{children:null==h?void 0:h.email}),(0,n.jsx)("p",{children:null==h?void 0:h.phoneNumber})]})})}),(0,n.jsx)(o.f,{children:(0,n.jsx)(o.f.Ul,{children:(0,n.jsxs)(o.f.Li,{heading:"Service Details",loading:u,children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{className:"helvetica-14-500",children:"Service Day: "}),(null==M?void 0:M.service.serviceDate)?(0,ey.Z)((0,ij.EM)(null==M?void 0:M.service.serviceDate),"EEEE, MMMM d, yyyy"):""]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{className:"helvetica-14-500",children:"Service Time: "}),(null==M?void 0:M.service.startTime)?(0,ij.mr)(null==M?void 0:M.service.startTime):""]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{className:"helvetica-14-500",children:"Address:"})," ",null==M?void 0:M.service.address.streetAddress," ",null==M?void 0:M.service.address.city," ",null==M?void 0:M.service.address.state," ",null==M?void 0:M.service.address.zipCode]})]})})}),(0,n.jsx)(o.f,{heading:"Service Settings",description:"Your Culinista chef will use the information below to customize your service. You can edit these settings below or any time through your client dashboard.",children:(0,n.jsxs)(o.f.Ul,{children:[(0,n.jsx)(tX,{loading:u,formConfig:E,...e}),(0,n.jsx)(t0,{loading:u,formConfig:E,...e})]})}),(0,n.jsx)(o.f,{children:(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"helvetica-14-500 mb-5",children:s.dictionary.orderAdditionalNotesHeading}),(0,n.jsx)(d.Z,{...e,inputs:E.orderAdditionalNotes})]})}),m&&(0,n.jsx)(U,{errorMessage:m}),(0,n.jsx)(o.f,{className:"mt-7",heading:"Billing & Cancellation",descriptionTransparent:!0,disableBorderAndPadding:!0,description:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:"All services are billed with 20% gratuity included, 100% of which will go to your Culinista\xae chef. While there is no expectation to do so, you are welcome to provide an additional cash tip for extraordinary service."}),(0,n.jsx)("li",{children:"Your credit card will be authorized upon checkout and you will be charged 2-3 business days after your service date."}),(0,n.jsxs)("li",{children:["You are able to cancel your service at any time prior to 48 hours before your service time free of charge. If you cancel for any reason between 48 hours and 24 hours before your service time, you will be charged 50% of the service fee to partially compensate your chef. If you cancel within 24 hours of your service, you will be charged the full service fee plus any charges incurred by the chef, inclusive of groceries and travel at the companyâs discretion. Please review our full cancellation policy"," ",(0,n.jsx)(Y(),{href:V.y.faqBilling(),className:"underline",rel:"noopener noreferrer",target:"_blank",children:"here"}),"."]})]})})]})})}let iN={[s.$e.MealPrepServiceSettings]:{id:s.$e.MealPrepServiceSettings,layout:"default",component:e=>(0,n.jsx)(tG,{...e})},[s.$e.GatheringDetails]:{id:s.$e.GatheringDetails,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(il,{...e})},[s.$e.CookingClassesDetails]:{id:s.$e.CookingClassesDetails,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(il,{...e})},[s.$e.MealPrepDetails]:{id:s.$e.MealPrepDetails,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(es,{...e})},[s.$e.Payment]:{id:s.$e.Payment,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(eT,{...e})},[s.$e.GatheringPaymentLoggedIn]:{id:s.$e.GatheringPaymentLoggedIn,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(ic,{...e})},[s.$e.CookingClassesPaymentLoggedIn]:{id:s.$e.CookingClassesPaymentLoggedIn,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(ic,{...e})},[s.$e.MealPrepPaymentLoggedIn]:{id:s.$e.MealPrepPaymentLoggedIn,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(t8,{...e})},[s.$e.MealPrepPaymentLoggedInUpdate]:{id:s.$e.MealPrepPaymentLoggedInUpdate,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(iC,{...e})},[s.$e.GatheringServiceSettings]:{id:s.$e.GatheringServiceSettings,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(ih,{...e})},[s.$e.CookingClassesServiceSettings]:{id:s.$e.CookingClassesServiceSettings,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(ih,{...e})},[s.$e.GatheringMenuSelection]:{id:s.$e.GatheringMenuSelection,layout:"full-header-without-content-container",component:e=>(0,n.jsx)(ix,{...e}),hideSidebar:!0},[s.$e.CookingClassesMenuSelection]:{id:s.$e.CookingClassesMenuSelection,layout:"full-header-without-content-container",component:e=>(0,n.jsx)(ig,{...e}),hideSidebar:!0},[s.$e.DishSelection]:{id:s.$e.DishSelection,layout:"full-header-without-content-container",component:e=>(0,n.jsx)(tw,{...e})},[s.$e.MenuCustomization]:{id:s.$e.MenuCustomization,layout:"full-header-without-content-container",component:e=>(0,n.jsx)(tq,{...e})},[s.$e.CookingClassesMenuCustomization]:{id:s.$e.CookingClassesMenuCustomization,layout:"full-header-without-content-container",component:e=>(0,n.jsx)(ib,{...e})},[s.$e.Confirmation]:{id:s.$e.Confirmation,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(tU.a,{...e})},[s.$e.MealPrepConfirmation]:{id:s.$e.MealPrepConfirmation,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(tU.a,{...e})},[s.$e.MealPrepConfirmationLoggedIn]:{id:s.$e.MealPrepConfirmationLoggedIn,layout:"default",hideLoginButton:!0,component:e=>(0,n.jsx)(tU.a,{...e})}};function ik(e,t){let i=function(e){switch(e){case s.$e.MealPrepDetails:return{title:"Details",heading:s.Ym.DetailsHeading,de
1scription:s.Ym.DetailsDescription,submitBtnTitle:"Checkout"};case s.$e.GatheringDetails:return{title:"Details",heading:s.Ym.DetailsHeading,description:s.Ym.DetailsDescription,locationHeading:"When is your gathering?",locationHeadingTooltip:"Gatherings on Sunday-Wednesday can be booked up to 8 hours in advance.<br />Gatherings on Thursday-Saturday can be booked up to 36 hours advance.",locationDescription:"For gatherings of 12 or fewer, your Culinista\xae chef will arrive 3-4 hours before your guest arrival time. For gatherings over 12, your chef will arrive 4-6 hours before your guest arrival time. Your chef will serve your meal and clean up.",dateTimeOutOfRangeNote:"Your gathering is outside our primary business hours, of 8am to 9am. While we cannot guarantee we will find a chef, we will do our best.",submitBtnTitle:"Checkout"};case s.$e.CookingClassesDetails:return{title:"Details",heading:s.Ym.DetailsHeading,description:s.Ym.DetailsDescription,locationHeading:"When is your cooking class?",locationHeadingTooltip:"Gatherings on Sundays-Wednesdays must be booked at least 24 hours in advance.<br />Gatherings on Thursdays-Saturdays must be booked at least 36 hours in advance.",locationDescription:"For cooking classes of 12 or fewer, your Culinista\xae chef will arrive 3-4 hours before your guest arrival time. For cooking classes over 12, your chef will arrive 4-6 hours before your guest arrival time. Your chef will serve your meal and clean up.",dateTimeOutOfRangeNote:"Your cooking class is outside our primary business hours, of 8am to 9am. While we cannot guarantee we will find a chef, we will do our best.",submitBtnTitle:"Checkout"};case s.$e.MealPrepServiceSettings:return{title:"Service Settings",heading:s.Ym.ServiceSettingsHeading,description:s.Ym.ServiceSettingsDescription,submitBtnTitle:"Checkout"};case s.$e.GatheringServiceSettings:return{title:"Settings",heading:s.Ym.HouseholdPreferencesHeading,description:s.Ym.HouseholdPreferencesDescription,ingredientFlagsHeading:"Ingredients you flagged are shown below. Select which ingredient flags you want to save to your account for future bookings.",orderAdditionalNotesHeading:"Anything else we should know about your gathering?"};case s.$e.CookingClassesServiceSettings:return{title:"Settings",heading:s.Ym.HouseholdPreferencesHeading,description:s.Ym.HouseholdPreferencesDescription,ingredientFlagsHeading:"Ingredients you flagged are shown below. Select which ingredient flags you want to save to your account for future bookings. ",orderAdditionalNotesHeading:"Anything else we should know about your cooking class?"};case s.$e.Payment:return{title:"Payment",heading:s.Ym.PaymentHeading,description:s.Ym.PaymentDescription,submitBtnTitle:"Checkout",orderAdditionalNotesHeading:"Anything else we should know?"};case s.$e.GatheringPaymentLoggedIn:return{title:"Payment",heading:s.Ym.PaymentLoggedInHeading,description:s.Ym.GatheringPaymentLoggedInDescription,submitBtnTitle:"Checkout",locationHeading:"When is your gathering?",locationHeadingTooltip:"Gatherings on Sunday-Wednesday can be booked up to 8 hours in advance.<br />Gatherings on Thursday-Saturday can be booked up to 36 hours advance.",locationDescription:"For gatherings of 12 or fewer, your Culinista\xae chef will arrive 3-4 hours before your guest arrival time. For gatherings over 12, your chef will arrive 4-6 hours before your guest arrival time. Your chef will serve your meal and clean up.",dateTimeOutOfRangeNote:"Your gathering is outside our primary business hours, of 8am to 9am. While we cannot guarantee we will find a chef, we will do our best.",orderAdditionalNotesHeading:"Anything else we should know about your gathering?"};case s.$e.CookingClassesPaymentLoggedIn:return{title:"Payment",heading:s.Ym.PaymentLoggedInHeading,description:s.Ym.GatheringPaymentLoggedInDescription,submitBtnTitle:"Checkout",locationHeading:"When is your cooking class?",locationHeadingTooltip:"Gatherings on Sundays-Wednesdays must be booked at least 24 hours in advance.<br />Gatherings on Thursdays-Saturdays must be booked at least 36 hours in advance.",locationDescription:"For cooking classes of 12 or fewer, your Culinista\xae chef will arrive 3-4 hours before your guest arrival time. For cooking classes over 12, your chef will arrive 4-6 hours before your guest arrival time. Your chef will serve your meal and clean up.",dateTimeOutOfRangeNote:"Your cooking class is outside our primary business hours, of 8am to 9am. While we cannot guarantee we will find a chef, we will do our best.",orderAdditionalNotesHeading:"Anything else we should know about your cooking class?"};case s.$e.MealPrepPaymentLoggedIn:case s.$e.MealPrepPaymentLoggedInUpdate:return{title:"Payment",heading:s.Ym.PaymentLoggedInHeading,de
1scription:s.Ym.MealPrepPaymentLoggedInDescription,submitBtnTitle:"Checkout",orderAdditionalNotesHeading:"Anything else we should know?"};case s.$e.GatheringMenuSelection:return{title:"Menu",heading:s.Ym.MenuSelectionHeadingGathering,description:s.Ym.MenuSelectionDescriptionGathering};case s.$e.CookingClassesMenuSelection:return{title:"Menu",heading:s.Ym.MenuSelectionHeadingCookingClasses,description:s.Ym.MenuSelectionDescriptionCookingClasses};case s.$e.DishSelection:return{title:"Dishes",heading:s.Ym.DishSelectionHeading,description:s.Ym.DishSelectionDescription};case s.$e.MenuCustomization:case s.$e.CookingClassesMenuCustomization:return{title:"Dishes",heading:s.Ym.MenuCustomizationHeading,description:s.Ym.MenuCustomizationDescription};case s.$e.Confirmation:return{title:"Confirmation",heading:s.Ym.ConfirmationHeading,description:s.Ym.ConfirmationDescription};case s.$e.MealPrepConfirmation:return{title:"Confirmation",heading:s.Ym.ConfirmationHeadingMealPrep,description:s.Ym.ConfirmationDescriptionMealPrep};case s.$e.MealPrepConfirmationLoggedIn:return{title:"Confirmation",heading:s.Ym.ConfirmationHeadingMealPrep,description:s.Ym.ConfirmationLoggedInDescriptionMealPrep};default:throw Error("Unknown step: ".concat(e))}}(e),a=function(e,t){switch(e){case s.$e.GatheringMenuSelection:case s.$e.CookingClassesMenuSelection:return[];case s.$e.GatheringDetails:case s.$e.CookingClassesDetails:case s.$e.MenuCustomization:case s.$e.CookingClassesMenuCustomization:return[s.Bq.GatheringMenuAndDishes];case s.$e.GatheringServiceSettings:case s.$e.CookingClassesServiceSettings:return[s.Bq.GatheringMenuAndDishes,s.Bq.GatheringServiceDetails];case s.$e.MealPrepDetails:case s.$e.DishSelection:return[s.Bq.MealPrepServiceSettings,s.Bq.MealPrepDishes];case s.$e.Payment:if(t===r.UW4.Gathering||t===r.UW4.CookingClass)return[s.Bq.GatheringMenuAndDishes,s.Bq.GatheringServiceDetails,s.Bq.GatheringServiceSettings];return[s.Bq.MealPrepServiceSettings,s.Bq.MealPrepDishes,s.Bq.MealPrepServiceDetails];case s.$e.GatheringPaymentLoggedIn:case s.$e.CookingClassesPaymentLoggedIn:return[s.Bq.GatheringMenuAndDishes];case s.$e.MealPrepPaymentLoggedIn:case s.$e.MealPrepPaymentLoggedInUpdate:return[s.Bq.MealPrepServiceSettings,s.Bq.MealPrepDishes];case s.$e.MealPrepServiceSettings:case s.$e.Confirmation:case s.$e.MealPrepConfirmation:case s.$e.MealPrepConfirmationLoggedIn:return[];default:throw Error("Unknown step: ".concat(e))}}(e,t);return{...iN[e],dictionary:i,sidebarComponents:a}}function iS(e){let{serviceType:t,isAccountCreated:i,orderId:a,reorderId:n}=e;if(t===r.UW4.MealPrep)return i?n?[ik(s.$e.DishSelection,t),ik(s.$e.MealPrepPaymentLoggedIn,t)]:a?[ik(s.$e.DishSelection,t),ik(s.$e.MealPrepPaymentLoggedInUpdate,t)]:[ik(s.$e.MealPrepServiceSettings,t),ik(s.$e.DishSelection,t),ik(s.$e.MealPrepPaymentLoggedIn,t)]:[ik(s.$e.MealPrepServiceSettings,t),ik(s.$e.DishSelection,t),ik(s.$e.MealPrepDetails,t),ik(s.$e.Payment,t)];if(t===r.UW4.Gathering)return i?n?[ik(s.$e.MenuCustomization,t),ik(s.$e.GatheringPaymentLoggedIn,t)]:[ik(s.$e.GatheringMenuSelection,t),ik(s.$e.MenuCustomization,t),ik(s.$e.GatheringPaymentLoggedIn,t)]:[ik(s.$e.GatheringMenuSelection,t),ik(s.$e.MenuCustomization,t),ik(s.$e.GatheringDetails,t),ik(s.$e.GatheringServiceSettings,t),ik(s.$e.Payment,t)];if(t===r.UW4.CookingClass)return i?n?[ik(s.$e.CookingClassesMenuCustomization,t),ik(s.$e.CookingClassesPaymentLoggedIn,t)]:[ik(s.$e.CookingClassesMenuSelection,t),ik(s.$e.CookingClassesMenuCustomization,t),ik(s.$e.CookingClassesPaymentLoggedIn,t)]:[ik(s.$e.CookingClassesMenuSelection,t),ik(s.$e.CookingClassesMenuCustomization,t),ik(s.$e.CookingClassesDetails,t),ik(s.$e.CookingClassesServiceSettings,t),ik(s.$e.Payment,t)];throw Error("Service type ".concat(t," not found"))}},34737:function(e,t,i){"use strict";i.d(t,{c:function(){return n},e:function(){return r}});var a=i(49122);let n={[a.w_F.Compost]:"Compost",[a.w_F.NoOutsideShoes]:"No outside shoes",[a.w_F.Recycle]:"Recycle",[a.w_F.SensitiveSmokeAlarm]:"Sensitive smoke alarm",[a.kmE.SensitiveSurfaces]:"Sensitive surfaces",[a.kmE.HandWashCertainItems]:"Hand-wash certain items",[a.kmE.StaffOnPremises]:"Staff on premises",[a.kmE.VentilationPreferences]:"Ventilation preferences",other:"Other"},r={[a.IFv.EasyOnTheSpices]:"Easy on the spices",[a.IFv.GrassFedMeat]:"Grass-fed meat",[a.IFv.HighHeatExtraSpicy]:"High heat/extra spicy",[a.IFv.LowHeatMildSpicy]:"Low heat/Mildly spicy",[a.IFv.LowOil]:"Less oil",[a.IFv.LowSalt]:"Low salt",[a.IFv.MediumHeatMediumSpicy]:"Medium heat/medium spicy",[a.IFv.NoCanolaVegetableOil]:"No vegetable oil",[a.IFv.NonGmo]:"Non-GMO",[a.IFv.Organic]:"Organic",[a.IFv.SauceOnTheSide]:"Sauce on the side",[a.IFv.WildCaughtSeaFood]:"Wild-caught seafood"}},33392:function(e,t,i){"use strict";i.d(t,{sW:function(){return d},tj:function(){return o},vK:function(){return l}});var a=i(49122),n=i(99068),r=i(99672),s=i(34737);let l={household:[{id:"household.".concat(a.w_F.NoOutsideShoes),type:"checkbox",name:"household.".concat(a.w_F.NoOutsideShoes),label:s.c[a.w_F.NoOutsideShoes]},{id:"household.".concat(a.w_F.Compost),type:"checkbox",name:"household.".concat(a.w_F.Compost),label:s.c[a.w_F.Compost]},{id:"household.".concat(a.w_F.Recycle),type:"checkbox",name:"household.".concat(a.w_F.Recycle),label:s.c[a.w_F.Recycle]},{id:"household.".concat(a.w_F.SensitiveSmokeAlarm),type:"checkbox",name:"household.".concat(a.w_F.SensitiveSmokeAlarm),label:s.c[a.w_F.SensitiveSmokeAlarm]}],householdWithAdditionalNotes:[{id:"householdWithAdditionalNotes.".concat(a.kmE.SensitiveSurfaces),type:"checkbox-with-textarea",
1name:"householdWithAdditionalNotes.".concat(a.kmE.SensitiveSurfaces),label:s.c[a.kmE.SensitiveSurfaces]},{id:"householdWithAdditionalNotes.".concat(a.kmE.StaffOnPremises),type:"checkbox-with-textarea",name:"householdWithAdditionalNotes.".concat(a.kmE.StaffOnPremises),placeholder:"Enter the name of any support staff with whom the chef may interact.",label:s.c[a.kmE.StaffOnPremises]},{id:"householdWithAdditionalNotes.".concat(a.kmE.VentilationPreferences),type:"checkbox-with-textarea",name:"householdWithAdditionalNotes.".concat(a.kmE.VentilationPreferences),placeholder:"E.g. open kitchen window in addition to running ventilation hood.",label:s.c[a.kmE.VentilationPreferences]},{id:"householdWithAdditionalNotes.".concat(a.kmE.HandWashCertainItems),type:"checkbox-with-textarea",name:"householdWithAdditionalNotes.".concat(a.kmE.HandWashCertainItems),placeholder:"List any items that must be handwashed, e.g. china, utensils, or servingware.",label:s.c[a.kmE.HandWashCertainItems]},{id:"householdWithAdditionalNotes.other",type:"checkbox-with-textarea",name:"householdWithAdditionalNotes.other",placeholder:"Anything else we should know about your home?",label:"Other"}]},o={householdWithAdditionalNotes:(0,n.Ry)().shape({[a.kmE.SensitiveSurfaces]:(0,n.Z_)().test("reqWhenChecked","Sensitive surfaces note is required when checked.",r.k),[a.kmE.StaffOnPremises]:(0,n.Z_)().test("reqWhenChecked","Staff on premises note is required when checked.",r.k),[a.kmE.VentilationPreferences]:(0,n.Z_)().test("reqWhenChecked","Ventilation preferences note is required when checked.",r.k),[a.kmE.HandWashCertainItems]:(0,n.Z_)().test("reqWhenChecked","Handwash certain items note is required when checked.",r.k),other:(0,n.Z_)().test("reqWhenChecked","Other note is required when checked.",r.k)})},d={culinaryPreferences:[{id:"culinaryPreferences.".concat(a.IFv.Organic),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.Organic),label:s.e[a.IFv.Organic]},{id:"culinaryPreferences.".concat(a.IFv.LowOil),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.LowOil),label:s.e[a.IFv.LowOil]},{id:"culinaryPreferences.".concat(a.IFv.NonGmo),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.NonGmo),label:s.e[a.IFv.NonGmo]},{id:"culinaryPreferences.".concat(a.IFv.NoCanolaVegetableOil),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.NoCanolaVegetableOil),label:s.e[a.IFv.NoCanolaVegetableOil]},{id:"culinaryPreferences.".concat(a.IFv.LowSalt),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.LowSalt),label:s.e[a.IFv.LowSalt]},{id:"culinaryPreferences.".concat(a.IFv.EasyOnTheSpices),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.EasyOnTheSpices),label:s.e[a.IFv.EasyOnTheSpices]},{id:"culinaryPreferences.".concat(a.IFv.GrassFedMeat),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.GrassFedMeat),label:s.e[a.IFv.GrassFedMeat]},{id:"culinaryPreferences.".concat(a.IFv.LowHeatMildSpicy),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.LowHeatMildSpicy),label:s.e[a.IFv.LowHeatMildSpicy]},{id:"culinaryPreferences.".concat(a.IFv.WildCaughtSeaFood),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.WildCaughtSeaFood),label:s.e[a.IFv.WildCaughtSeaFood]},{id:"culinaryPreferences.".concat(a.IFv.MediumHeatMediumSpicy),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.MediumHeatMediumSpicy),label:s.e[a.IFv.MediumHeatMediumSpicy]},{id:"culinaryPreferences.".concat(a.IFv.SauceOnTheSide),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.SauceOnTheSide),label:s.e[a.IFv.SauceOnTheSide]},{id:"culinaryPreferences.".concat(a.IFv.HighHeatExtraSpicy),type:"checkbox",name:"culinaryPreferences.".concat(a.IFv.HighHeatExtraSpicy),label:s.e[a.IFv.HighHeatExtraSpicy]},{id:"culinaryPreferences.other",type:"checkbox-with-input-field",name:"culinaryPreferences.other",label:"Other"}]}},99672:function(e,t,i){"use strict";i.d(t,{k:function(){return n},o:function(){return r}});var a=i(75738);function n(e){return void 0===e||"string"==typeof e&&e===a.W||"string"==typeof e&&!!e}let r=e=>/\S+@\S+\.\S+/.test(String(e).toLowerCase())},19821:function(e,t,i){"use strict";i.d(t,{I5:function(){return l},UA:function(){return r},Xh:function(){return s},aQ:function(){return c},aj:function(){return d},bh:function(){return o},p$:function(){return u}});var a=i(75738),n=i(49122);function r(e){let{household:t,householdWithAdditionalNotes:i}=e,a=t?Object.keys(t):[],n=i?Object.keys(i):[];return[...a.filter(e=>t[e]),...n.filter(e=>i[e]&&"NOT_CHECKED"!==i[e]).map(e=>({rule:e,note:i[e]}))]}function s(e){return e.reduce((e,t)=>
1(e[t]=!0,e),{[n.w_F.NoOutsideShoes]:!1,[n.w_F.Compost]:!1,[n.w_F.Recycle]:!1,[n.w_F.SensitiveSmokeAlarm]:!1})}function l(e,t){return e.reduce((e,t)=>(e[t.extendedHouseholdNote]=t.additionalInfo||a.W,e),{[n.kmE.StaffOnPremises]:a.W,[n.kmE.VentilationPreferences]:a.W,[n.kmE.HandWashCertainItems]:a.W,[n.kmE.SensitiveSurfaces]:a.W,other:t||a.W})}function o(e){let{culinaryPreferences:t}=e;return t?Object.keys(t).filter(e=>"other"!==e&&t[e]):[]}function d(e,t){return{...e.reduce((e,t)=>(e[t]=!0,e),{[n.IFv.EasyOnTheSpices]:!1,[n.IFv.GrassFedMeat]:!1,[n.IFv.HighHeatExtraSpicy]:!1,[n.IFv.LowHeatMildSpicy]:!1,[n.IFv.LowOil]:!1,[n.IFv.LowSalt]:!1,[n.IFv.MediumHeatMediumSpicy]:!1,[n.IFv.NoCanolaVegetableOil]:!1,[n.IFv.NonGmo]:!1,[n.IFv.Organic]:!1,[n.IFv.SauceOnTheSide]:!1,[n.IFv.WildCaughtSeaFood]:!1}),other:t||""}}function c(e,t){let{ingredientFlags:i}=e;return Object.keys(i||{}).filter(e=>i[e]&&t.find(t=>t.id===e)).map(e=>t.find(t=>t.id===e))}function u(e,t){return{...e.reduce((e,i)=>{var a;return e[i.id]=t.includes(null===(a=i.smlenum)||void 0===a?void 0:a.toUpperCase()),e},{})}}},15219:function(e,t,i){"use strict";i.d(t,{u:function(){return r}});var a=i(70967),n=i(52983);function r(){let{data:e}=(0,a.NTg)();return(0,n.useMemo)(()=>(null==e?void 0:e.allAllergen.filter(e=>!!e.smlenum))||[],[e])}},6597:function(e,t,i){"use strict";i.d(t,{_:function(){return m}});var a=i(31165),n=i(79904),r=i(20683),s=i(52983),l=i(13916),o=i(21967),d=i(36405),c=i(8431),u=i(79096),h=i(7279);function m(){let e=(0,a.Q)(),{getCartSummary:t}=(0,c.p)(),{getAddress:i,getServiceAndHouseholdSettings:m,getSettings:p}=(0,u.b)(),{getService:f}=(0,h.o)(),{calculation:g}=(0,n.FP)(),{dispatch:v}=(0,n.cN)(),{referralValue:y}=(0,o.jJ)(),x=(0,s.useMemo)(()=>{let{numberOfPeople:e,date:a,promoCodeValue:n,creditsToApply:r}=p();return{serviceType:f().type,zipCode:i().zipCode,numberOfPeople:e,portion:m().portion,date:a,cartSummary:t(),creditsToApply:r,promoCodeValue:n,referralValue:y||null}},[p,f,i,m,t,y]),b=(0,s.useCallback)(async()=>{try{let t=await (0,d._)({apolloClient:e,payload:x});v({type:"setCalculation",payload:t})}catch(e){}},[e,v,x]),j=(0,s.useCallback)(async a=>{let{cartSummaryModifier:n}=a;return await (0,d._)({apolloClient:e,payload:{serviceType:f().type,zipCode:i().zipCode,numberOfPeople:p().numberOfPeople,portion:m().portion,date:p().date,cartSummary:n(t()),referralValue:y||null}})},[e,i,t,f,m,p,y]);return{calculateServiceEstimate:b,calculateCustomServiceEstimate:j,getRawCalculation:(0,s.useCallback)(()=>g,[g]),getFormatted:(0,s.useCallback)(()=>({groceryCost:(0,l.T)(g.groceryCost),serviceCost:(0,l.T)(g.serviceCost),tax:(0,l.T)(g.tax),tips:(0,l.T)(g.tips),total:(0,l.T)(g.total),travelCost:(0,l.T)(g.travelCost),referralCredits:(0,l.T)(-1*(g.referralCredits||0)),serviceCostOffAmount:(0,l.T)(g.serviceCostOffAmount),appliedPromoCodePercentage:g.appliedPromoCodePercentage,appliedPromoCodeAmount:(0,l.T)(g.appliedPromoCodeAmount)}),[g]),clearCalculation:(0,s.useCallback)(()=>{v({type:"setCalculation",payload:r.BOOKING_ORDER_DEFAULT_STATE.calculation})},[v])}}},8431:function(e,t,i){"use strict";i.d(t,{p:function(){return o}});var a=i(79904),n=i(52983),r=i(49122),s=i(70967),l=i(7279);function o(){let{dispatch:e}=(0,a.cN)(),{selectedMenus:t,selectedItems:i,menuToItemMap:o}=(0,a.FP)(),{getService:d}=(0,l.o)(),{type:c}=d(),u=Array.from(t.values())[0],{data:h}=(0,s.TvZ)({skip:!(null==u?void 0:u.referenceId)||c!==r.UW4.Gathering,variables:{id:null==u?void 0:u.referenceId}}),{data:m}=(0,s.KQ6)({skip:!(null==u?void 0:u.referenceId)||c!==r.UW4.CookingClass,variables:{id:null==u?void 0:u.referenceId}}),p=(0,n.useMemo)(()=>h?null==h?void 0:h.menu.find(e=>e._id===(null==u?void 0:u.referenceId)):m?null==m?void 0:m.cookingClasses.find(e=>e._id===(null==u?void 0:u.referenceId)):void 0,[u,h,m]),f=(0,n.useCallback)(()=>u,[u]),g=(0,n.useCallback)(()=>p,[p]),v=(0,n.useCallback)(()=>{if(c===r.UW4.Gathering||c===r.UW4.CookingClass){if(u&&p){if("Menu"===p.__typename)return p.courses.reduce((e,t)=>{let i=null==t?void 0:t.title,a=null==t?void 0:t.numberOfDishesExt,n=null==t?void 0:t.numberOfDishes;return i&&a&&n?{...e,[i]:u.isExtendedMenu?a:n}:e},{});if("CookingClass"===p.__typename)return p.sections.reduce((e,t)=>
1{let i=null==t?void 0:t.title,a=null==t?void 0:t.numberOfDishes;return i&&a?{...e,[i]:a}:e},{})}return{}}return 6},[u,p,c]),y=(0,n.useCallback)(i=>{let a=new Map(t);a.has(i.referenceId)||(a.set(i.referenceId,i),e({type:"setSelectedMenus",payload:a}))},[e,t]),x=(0,n.useCallback)(i=>{let a=new Map(t);if(!a.has(i))return;a.delete(i),e({type:"setSelectedMenus",payload:a});let n=new Map(o),r=n.get(i);r&&(r.forEach(e=>{n.delete(e)}),n.delete(i)),e({type:"setMenuToItemMap",payload:n})},[e,o,t]),b=(0,n.useCallback)(async(t,a)=>{let n=new Map(i),r=v();if(("number"!=typeof r||!(n.size>=r))&&(n.has(t.referenceId)||(n.set(t.referenceId,t),e({type:"setSelectedItems",payload:n})),a)){let i=new Map(o),n=i.get(a);n&&!n.includes(t.referenceId)?(n.push(t.referenceId),i.set(a,[...n])):i.set(a,[t.referenceId]),e({type:"setMenuToItemMap",payload:i})}},[e,v,o,i]),j=(0,n.useCallback)((t,a)=>{let n=new Map(i);if(n.has(t)&&(n.delete(t),e({type:"setSelectedItems",payload:n})),a){let i=new Map(o),n=i.get(a);if(n&&n.includes(t)){let e=n.indexOf(t);e>-1&&n.splice(e,1)}e({type:"setMenuToItemMap",payload:i})}},[e,o,i]),w=(0,n.useCallback)(()=>{let t=new Map(i);t.clear(),e({type:"setSelectedItems",payload:t})},[e,i]),C=(0,n.useCallback)(()=>Array.from(t.values()),[t]),N=(0,n.useCallback)(()=>Array.from(i.values()),[i]),k=(0,n.useCallback)(()=>{let e={items:[]},t=N();return e.items.push({...u,selectedItems:t.filter(e=>!!e)}),e},[u,N]),S=(0,n.useCallback)((t,a)=>{let n=i.get(t);if(!n)return;let r=new Map(i);r.set(t,{...n,...a}),e({type:"setSelectedItems",payload:r})},[e,i]);return{selectMenu:y,removeMenu:x,selectItem:b,removeItem:j,removeAllItems:w,updateItem:S,updateMenu:(0,n.useCallback)((i,a)=>{let n=t.get(i);if(!n)return;let r=new Map(t);r.set(i,{...n,...a}),e({type:"setSelectedMenus",payload:r})},[e,t]),findItemById:(0,n.useCallback)(e=>i.get(e),[i]),getSelectedMenus:C,getSelectedItems:N,getCartSummary:k,clear:(0,n.useCallback)(()=>{e({type:"setSelectedMenus",payload:new Map}),e({type:"setSelectedItems",payload:new Map}),e({type:"setMenuToItemMap",payload:new Map})},[e]),getSelectedItemsLimit:v,getActiveMenuData:g,getActiveMenu:f}}},46464:function(e,t,i){"use strict";i.d(t,{f:function(){return r}});var a=i(79904),n=i(52983);function r(){let{dictionary:e}=(0,a.FP)(),{dispatch:t}=(0,a.cN)();return{getDictionaryValue:(0,n.useCallback)(t=>e[t],[e]),setDictionary:(0,n.useCallback)(e=>{t({type:"setDictionary",payload:e})},[t]),getDictionary:(0,n.useCallback)(()=>e,[e])}}},1834:function(e,t,i){"use strict";i.d(t,{P:function(){return r}});var a=i(79904),n=i(52983);function r(){let{dispatch:e}=(0,a.cN)(),{formState:t}=(0,a.FP)();return{setFormState:(0,n.useCallback)(t=>{e({type:"setFormState",payload:t})},[e]),getFormState:(0,n.useCallback)(()=>t,[t])}}},49658:function(e,t,i){"use strict";i.d(t,{V:function(){return o}});var a=i(77413),n=i(20683),r=i(34376),s=i(79096),l=i(1834);function o(){let{setFormState:e}=(0,l.P)(),{getSettings:t}=(0,s.b)(),{activeStep:i}=t(),o=(0,a.useRouter)(),d=(0,r.useSearchParams)(),c=(e,t)=>{let i=Object.fromEntries(d);return(null==t?void 0:t.paramsToRemove)&&t.paramsToRemove.forEach(e=>{delete i[e]}),{pathname:o.pathname,query:{...i,step:e}}};return{goToNextStep:t=>{e(n.BOOKING_ORDER_DEFAULT_STATE.formState);let a=c(i+1,t);o.push(a)},goToPreviousStep:()=>{e(n.BOOKING_ORDER_DEFAULT_STATE.formState);let t=c(i-1);o.push(t)},goToStepIndex:t=>{e(n.BOOKING_ORDER_DEFAULT_STATE.formState);let i=c(t);o.push(i)},getStepLinkConfig:c}}},1440:function(e,t,i){"use strict";i.d(t,{y:function(){return d}});var a=i(97458),n=i(52983),r=i(78778),s=i(1137),l=i(39957),o=i(21535);function d(e){let{item:t,children:i}=e,[d,c]=(0,n.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between py-4",onClick:()=>c(e=>!e),children:[(0,a.jsx)("div",{children:t}),(0,a.jsx)(r.E.div,{animate:{rotate:d?180:0},transition:{duration:.3},children:(0,a.jsx)(l.k,{size:12,icon:(0,a.jsx)(o.Z,{})})})]}),(0,a.jsx)(s.M,{children:d&&(0,a.jsx)(r.E.div,{initial:"collapsed",animate:"expanded",exit:"collapsed",transition:{duration:.3},variants:{expanded:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},className:"overflow-hidden",children:(0,a.jsx)("div",{className:"pt-2 pb-4",children:i})},"expanded-content")})]})}},52243:function(e,t,i){"use strict";i.d(t,{f:function(){return l}});var a=i(97458);i(52983);var n=i(15783),r=i(35031),s=i(14517);function l(e){let{items:t,primaryColor:i=n.bG.CulinistaBlack}=e;return(0,a.jsx)("ul",{className:"flex flex-wrap",children:t.map(e=>(0,a.jsx)("li",{className:(0,s.Z)("mr-[10px] border-r border-opacity-40 pr-[10px] last:mr-0 last:border-r-0 last:pr-0",(0,r.M)("border",i)),children:e},e))})}},35871:function(e,t,i){"use strict";i.d(t,{w:function(){return n}});var a=i(49122);function n(e){switch(e){case 2:return a.YtR.Small;case 4:default:return a.YtR.Medium;case 6:return a.YtR.Large}}},86133:function(e,t,i){"use strict";i.d(t,{z:function(){return r}});var a=i(87933),n=i(19218);let r=e=>{let t="";if(e instanceof a.c){var i,r,s,l,o;t=null===(o=e.networkError)||void 0===o?void 0:null===(l=o.result)||void 0===l?void 0:null===(s=l.errors)||void 0===s?void 0:null===(r=s[0])||void 0===r?void 0:null===(i=r.extensions)||void 0===i?void 0:i.errorSlug}else t=e instanceof n.U?e.getErrorMessage():e.message;return t}},69416:function(e){e.exports={DishTile:"ArSelectionModuleGrid_DishTile__aWwns"}}}]);
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.