PageSourceSearch

https://www.imperfectfoods.com/assets/WhatDoYouBuy-d_-sUFkM.js

js imperfectfoods.com collected 2026-09-24 17:13:36 UTC 4,352 bytes, 2 lines download raw bytes

1import{dd as C,E as k,h6 as D,h7 as F,gV as O,gW as x,fC as S,l as R,bk as P,ec as Y,r as w,j as t,bq as B,gZ as L,M as U,I as z,h8 as W,c as V,L as q,t as G,aL as H,fN as _}from"./index-CVUXbWDK.js";import{u as Q}from"./useSignupQuizQuery-C5j4IPk7.js";import{C as K}from"./CardInput-DkGw6bng.js";import{u as X}from"./useSignupRedirect-BFkkcDvb.js";import{F as E}from"./constants-DGT9GzuU.js";import{S as Z}from"./SignupFooter-PIGK3vCC.js";import"./ChevronDownIcon-DxIiIRv9.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="e1f2c757-0b25-46d0-8c72-964e5118dfb7",n._sentryDebugIdIdentifier="sentry-dbid-e1f2c757-0b25-46d0-8c72-964e5118dfb7")}catch{}})();(function(){var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n._sentryModuleMetadata=n._sentryModuleMetadata||{},(function(){var o,d=new n.Error().stack,c=n._sentryModuleMetadata[d]||{},u={"_sentryBundlerPluginAppKey:mm-sentry-boysenberry":!0},h={};for(o in c)c.hasOwnProperty(o)&&(h[o]=c[o]);for(o in u)u.hasOwnProperty(o)&&(h[o]=u[o]);n._sentryModuleMetadata[d]=h})()})();function oe(){const{handleContinueClick:n}=C(),o=k(),{experimentClientIsReady:d,getFeatureFlagVariant:c}=D(),u=F(),h=O(x.WHAT_DO_YOU_BUY),l=S(),m=l==null?void 0:l.whatDoYouBuy,{isMisfitsTheme:b}=R(),{pathname:j}=P();X({allowedPaths:h}),Y("signup quiz page view");const[r,g]=w.useState((m==null?void 0:m.planIDs)??[]),[N,A]=w.useState(!1),{data:p={}}=Q({funnelType:b?"misfits":"imperfect",quizResults:{dietaryPreference:l.dietaryPreference,household:l.whoAreYouShoppingFor,percentOrganic:l.percentOrganic}}),s=p==null?void 0:p.plans,I=(s==null?void 0:s.length)>0?s.length%3===1:!1,f=e=>{var a,i;_({whatDoYouBuy:{planIDs:e,planNames:s?s.filter(y=>e.includes(y.id)).map(y=>y.name):(i=(a=S())==null?void 0:a.whatDoYouBuy)==null?void 0:i.planNames}})},M=e=>{let a=[];r.includes(e)?a=r.filter(i=>i!==e):a=[...r,e],g(a),f(a)},T=e=>{e.preventDefault(),G("quiz step complete",{pathname:j,question:x.WHAT_DO_YOU_BUY,response:r}),f(r);const a=d&&!u?c(H.FUNNEL_REGISTRATION_TEST_V2,"control"):void 0;if(a===E.OLD_SUMMARY_NEW_FORMS||a===E.NEW_SUMMARY_NEW_FORMS){_({path:"/join/registration"}),o("/join/registration");return}n()},v=e=>{const a=e?s.filter(i=>i.active).map(i=>i.id):[];g(a),A(e),f(a)};return t.jsxs("form",{onSubmit:T,children:[t.jsxs("div",{className:"mx-auto max-w-[600px] px-25 pt-25 pb-[273px] sm:pb-[249px]",children:[t.jsx("h1",{className:"text-heading-sm md:text-center","data-optimizely-id":"what-do-you-buy-header",children:"What do you buy each week?"}),(s==null?void 0:s.length)>0?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-body-lg my-20 md:text-center","data-optimizely-id":"what-do-you-buy-sub-header",children:"Select all that apply"}),t.jsx("div",{className:"mb-15 rounded-md border border-grey-light bg-white p-5 md:flex md:justify-center",children:t.jsx(B,{checked:N,id:"all-plans",label:"A bit of everything",name:"all",labelStyle:"bold",onCheckedChange:v})}),t.jsx("div",{className:"grid grid-cols-3 gap-10",children:s.map((e,a)=>t.jsx(K,{as:"checkbox",inputAttributes:{name:`plan-${e.id}`,value:e.id||"0",handleChange:M},disabled:!e.active,checked:r.includes(e.id),extendedStyles:{wrapper:V({"col-start-2":I&&a===s.length-1})},children:t.jsxs("div",{className:"flex flex-col items-center gap-5 text-center",children:[t.jsx(L,{aisleIconName:W(e.name),isActive:e.active,width:50,brand:b?U:z}),t.jsx("p",{className:"font-grotesk-bold text-body-mobile-md",children:e.name})]})},e.id))})]}):t.jsx("div",{className:"mt-40 flex justify-center",children:t.jsx(q,{})})]}),t.jsx(Z,{isSubmitButtonDisabled:!(s!=null&&s.length)||r.length===0,infoBubbleTitle:t.jsx("span",{"data-optimizely-id":"what-do-you-buy-title",children:"SERIOUSLY FLEXIBLE"}),infoBubbleDescription:t.jsxs("span",{"data-optimizely-id":"what-do-you-buy-description",children:[t.jsxs("span",{className:"font-grotesk-bold",children:["You'll always have access to our entire assortment."," "]}),"Your selections here just help us recommend personalized items for your cart!"]}),hideInfoBubble:!1,showScrollDownButton:!1})]})}export{oe as Component};
2//# sourceMappingURL=WhatDoYouBuy-d_-sUFkM.js.map

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.