1__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){const[t,h]=(0,n.useState)(""),I=N(t,j),_=(0,y.isSearchQuery)(I),{data:S,isLoading:D,isError:L,refetch:T,isFetching:C}=(0,f.useIngredientList)(I),H=(0,n.useMemo)(()=>S?.results??[],[S]);(0,n.useEffect)(()=>{b.analytics.track("ingredient_lookup_opened",{source:"profile_menu"})},[]);const P=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!_||C)return;const t=I.trim();0===H.length&&null!=S?P.current!==t&&(P.current=t,b.analytics.track("ingredient_search_no_match",{query_length:t.length})):P.current=null},[_,C,I,H.length,S]);const R=_&&!D&&!C&&0===H.length;return(0,k.jsxs)(x.default,{className:"flex-1 bg-bg-app dark:bg-bg-app-dark",children:[(0,k.jsxs)(x.default,{className:"flex-row items-center gap-3 px-5 pt-16 pb-3",children:[(0,k.jsx)(c.default,{onPress:()=>p.router.canGoBack()?p.router.back():p.router.replace("/app"),accessibilityRole:"button",accessibilityLabel:"Go back",testID:"ingredient-lookup-back",style:{minHeight:44,minWidth:44},className:"items-center justify-center",children:(0,k.jsx)(o.default,{className:"text-[22px] text-text-primary dark:text-white",children:"\u2190"})}),(0,k.jsx)(o.default,{className:"text-2xl font-bold text-text-primary dark:text-white",children:"Look up an ingredient"})]}),(0,k.jsx)(x.default,{className:"px-5 pb-3",children:(0,k.jsx)(u.default,{value:t,onChangeText:h,placeholder:"Search by name \u2014 e.g. retinol, fragrance",placeholderTextColor:"#9CA3AF",autoCorrect:!1,autoCapitalize:"none",returnKeyType:"search",accessibilityLabel:"Search ingredients",testID:"ingredient-lookup-search-input",className:"rounded-2xl border border-neutral-200 bg-white px-4 py-3 text-[16px] text-text-primary dark:border-line-dark dark:bg-bg-card-dark dark:text-white",style:{minHeight:48}})}),L?(0,k.jsxs)(x.default,{className:"flex-1 items-center justify-center px-8",testID:"ingredient-lookup-error",children:[(0,k.jsx)(o.default,{className:"text-center text-[16px] text-text-secondary dark:text-neutral-300",children:"We couldn't load ingredients just now."}),(0,k.jsx)(c.default,{onPress:()=>T(),accessibilityRole:"button",accessibilityLabel:"Try again",testID:"ingredient-lookup-retry",style:{minHeight:44},className:"mt-4 items-center justify-center rounded-xl bg-brand-cta px-5 py-3",children:(0,k.jsx)(o.default,{className:"text-[15px] font-bold text-white",children:"Try again"})})]}):D?(0,k.jsx)(x.default,{className:"flex-1 items-center justify-center",testID:"ingredient-lookup-loading",children:(0,k.jsx)(s.default,{size:"large",color:"#3F8C8A"})}):R?(0,k.jsxs)(x.default,{className:"flex-1 items-center px-8 pt-12",testID:"ingredient-lookup-empty",children:[(0,k.jsx)(o.default,{className:"text-4xl",children:"\ud83d\udd0d"}),(0,k.jsx)(o.default,{className:"mt-4 text-center text-lg font-bold text-text-primary dark:text-white",children:"We don't have this ingredient yet"}),(0,k.jsxs)(o.default,{className:"mt-2 text-center text-[15px] text-text-secondary dark:text-neutral-300",style:{lineHeight:23},children:["We couldn't find \u2018",I.trim(),"\u2019 in our database. Check the spelling, or scan the product's label \u2014 we're adding new ingredients all the time."]}),(0,k.jsx)(c.default,{onPress:()=>p.router.push("/app/ocr-scan"),accessibilityRole:"button",accessibilityLabel:"Scan a label",testID:"ingredient-lookup-scan-cta",style:{minHeight:52},className:"mt-6 items-center justify-center rounded-2xl bg-brand-cta px-6 py-4",children:(0,k.jsx)(o.default,{className:"text-base font-bold text-white",children:"Scan a label"})})]}):(0,k.jsx)(l.default,{data:H,keyExtractor:t=>t.slug,renderItem:({item:t})=>(0,k.jsx)(w,{item:t}),keyboardShouldPersistTaps:"handled",testID:"ingredient-lookup-list",contentContainerStyle:{paddingBottom:32}})]})};var n=r(d[1]),s=t(r(d[2])),l=t(r(d[3])),c=t(r(d[4])),o=t(r(d[5])),u=t(r(d[6])),x=t(r(d[7])),p=r(d[8]),h=r(d[9]),f=r(d[10]),b=r(d[11]),y=r(d[12]),k=r(d[13]);const j=250;function N(t,s){const[l,c]=(0,n.useState)(t);return(0,n.useEffect)(()=>{const n=setTimeout(()=>c(t),s);return()=>clearTimeout(n)},[t,s]),l}function w({item:t}){return(0,k.jsxs)(c.default,{onPress:()=>p.router.push({pathname:"/app/ingredient-lookup/[slug]",params:{slug:t.slug}}),accessibilityRole:"button",accessibilityLabel:`${t.name} \u2014 see safety by life stage`,testID:`ingredient-lookup-row-${t.slug}`,style:{minHeight:60},className:"flex-row items-center justify-between gap-3 border-b border-neutral-100 bg-white px-5 py-3.5 dar
1k:border-line-dark dark:bg-bg-card-dark",children:[(0,k.jsx)(o.default,{className:"flex-1 text-[16px] font-medium text-text-primary dark:text-white",numberOfLines:2,maxFontSizeMultiplier:1.6,children:t.name}),(0,k.jsx)(h.MiniGlance,{ingredient:(0,y.liteRowToIngredient)(t)})]})}},1133,[17,4,229,109,244,190,254,111,483,833,1130,748,1131,2]);
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.