1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="627c5d37-0bec-4db7-96ad-ffaf7be593cc",e._sentryDebugIdIdentifier="sentry-dbid-627c5d37-0bec-4db7-96ad-ffaf7be593cc")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"d9f2524b01d9b4b1f11ad0665b6e90406108a90f"},(self.webpackChunkevery_headless=self.webpackChunkevery_headless||[]).push([[596],{18169:function(e,t,a){a.r(t),a.d(t,{Head:function(){return O},default:function(){return B}});var l=a(96540),n=a(57332),i=a(42888),r=a(54506),s=a(89539),o=a(43389),c=a(45566),d=a(55710),u=a(50203),m=a(92385),p=a(13561),v=a(53572),f=a(66057),g=a(44590),E=a(12196),b=a(48900),y=a(47198),h=a(10519),w=a(25115),x=a(2389);var A=e=>{var t,a,n,i,r,A,N,k,C,T;let{product:_}=e;const{accordions:S=[],nutrients:j={},tags:P=[],description:I=[],collaboration:D,products:R=[],total_bundle_products:F=0}=null!==(t=_.details)&&void 0!==t?t:{},{translation:O}=(0,f.S)(),{activeBox:B}=(0,p.d4)(e=>e.cart),{subscriptionId:L,draftChanges:M}=(0,p.d4)(e=>e.account.subscription),{0:U,1:V}=(0,l.useState)([]);let Y=null==_||null===(a=_.variant)||void 0===a?void 0:a.price;return null!=_&&null!==(n=_.variant)&&void 0!==n&&n.weight&&(null==B?void 0:B.discount)>0&&(Y-=B.discount),(0,l.useEffect)(()=>{(async()=>{const e=await(0,x.Y)((0,g.A)(null==_?void 0:_.id));V(e)})()},[null==_?void 0:_.id]),l.createElement("div",{className:"md:px-14"},l.createElement("div",{className:"flex flex-col mt-10"},l.createElement("h1",{className:"text-h2-xs md:text-h2 font-heading"},_.title),l.createElement(u.A,{sku:null==_||null===(i=_.variant)||void 0===i?void 0:i.sku,position:"left"}),l.createElement("div",{className:"text-left my-6"},l.createElement(s.A,{value:I})),l.createElement("div",{className:"flex gap-2 items-center text-lg"},l.createElement(v.A,{variant:_.variant,className:"text-lg font-black"}),null!==(r=_.details)&&void 0!==r&&r.weight?" / "+(null===(A=_.details)||void 0===A?void 0:A.weight)+"g":""),l.createElement(y.A,{price:Y,weight:null===(N=_.details)||void 0===N?void 0:N.weight})),l.createElement("div",{className:(0,b.A)("flex justify-start mb-10 mt-5",M.isSyncing&&"ml-4")},L?0===Y?l.createElement(l.Fragment,null):l.createElement(E.A,{productVariantId:(0,g.A)(null==_||null===(k=_.variant)||void 0===k?void 0:k.id),stock:null==_||null===(C=_.variant)||void 0===C?void 0:C.stock,product:_,addClassName:"!w-fit px-8 !py-4 !btn-primary",containerClass:"!mx-0"}):l.createElement(c.A,{product:_,openCart:!0,showLoader:!0,className:"w-3/4 md:w-1/2"})),l.createElement("div",{className:"hidden md:block"},l.createElement(w.A,{upsellProducts:U,customUpsellTitle:null==_?void 0:_.upsellTitle})),l.createElement("h2",{className:"text-xl"},null==O||null===(T=O.product)||void 0===T?void 0:T.aboutTheProduct),P.length>0&&l.createElement("div",{className:"flex flex-row justify-start py-2.5 flex-wrap my-5"},P.map((e,t)=>l.createElement("span",{className:"tag",key:t},e))),D&&l.createElement(d.A,{collaboration:D}),l.createElement("div",{className:"flex flex-row justify-between md:pt-6 pb-4 px-4"},Object.keys(j).filter(e=>"_type"!==e).map(e=>l.createElement("div",{key:e,className:"flex flex-col text-center w-[22%]"},l.createElement("span",{className:"text-small uppercase text-secondary-darker tracking-widest"},e),l.createElement("span",{className:"text-body mt-1.5"},j[e])))),(null==_?void 0:_.type)===h.q$&&F>0&&l.createElement(m.A,{products:R,total:F}),l.createElement("div",{className:"pb-10 pt-2.5"},l.createElement(o.A,{accordions:S})),l.createElement("div",{className:"block md:hidden"},l.createElement(w.A,{upsellProducts:U,customUpsellTitle:null==_?void 0:_.upsellTitle}
1)))},N=a(556),k=a(86133),C=a(92231),T=a(88231),_=a(43092),S=a.n(_);var j=async e=>{try{const t=await S()("https://api.reviews.io/product/review?store=every-foods.com&sku="+e),a=await t.json(),{average:l,count:n}=a.stats;return{average:+l,count:n}}catch(t){return console.error(t),null}},P=a(64810);var I=e=>{let{product:t}=e;const{0:a,1:n}=(0,l.useState)(null);return(0,l.useEffect)(()=>{(async()=>{const e=await j(t.variant.sku);if(e){const a={"@context":"https://schema.org/","@type":"Product",name:t.title,image:t.image,description:t.shortDescription,sku:t.variant.sku,brand:{"@type":"Brand",name:"Every"},aggregateRating:{"@type":"AggregateRating",ratingValue:e.average,reviewCount:e.count}};n(a)}})()},[]),l.createElement(l.Fragment,null,a&&l.createElement(P.eF,{type:"application/ld+json"},JSON.stringify(a)))},D=a(59285);var R=e=>{let{pageContext:t,path:a}=e;const{pdpSettings:n={},product:i={},header:s,footer:o,breadcrumbs:c,pageSettings:d}=t;(0,l.useEffect)(()=>{(0,T.AS)({title:null==i?void 0:i.title,type:null==i?void 0:i.type,variant:null==i?void 0:i.variant})},[]);const u=[].concat((0,r.A)(t.modules||[]),(0,r.A)(n.modules||[]));return l.createElement(k.A,{path:a,header:s,footer:o,breadcrumbs:c,title:null==i?void 0:i.title,pageSettings:d},l.createElement("div",{className:"w-90 m-auto flex flex-col lg:flex-row justify-between my-10 gap-x-10 hd-screen-max-width"},l.createElement("div",{className:"w-full my-2"},l.createElement(C.A,{images:null==i?void 0:i.images})),l.createElement("div",{className:"w-full my-2 md:sticky md:top-20 md:h-full"},console.log("Rendering ProductPageDetails with product:",i),l.createElement(A,{product:i}))),l.createElement("div",{className:"m-auto my-10"},l.createElement(N.A,{modules:u,sku:i.variant.sku})),l.createElement(I,{product:i}))},F=a(76326);const O=e=>{let{location:t,pageContext:a}=e;return l.createElement(D.p,{location:t,pageContext:Object.assign({},a,{meta:Object.assign({},a.meta,{title:a.meta.title||a.product.title})})})};var B=e=>{var t,a,r,s;let{pageContext:o,location:c}=e;const{isModal:d,closeTo:u}=(0,l.useContext)(F.A),{product:m={},language:p}=o;return d?l.createElement(l.Fragment,null,l.createElement(i.A,{images:m.images}),l.createElement(n.A,{hideATCPrice:{hidePrice:null!==(t=null===(a=c.state)||void 0===a?void 0:a.hidePrice)&&void 0!==t&&t,hideATC:null!==(r=null===(s=c.state)||void 0===s?void 0:s.hideATC)&&void 0!==r&&r},product:m,closeModal:u,lang:p})):l.createElement(R,{pageContext:o,path:c.pathname})}}}]); 2//# sourceMappingURL=component---src-templates-product-index-js-e9faaecddcf33fa0ca96.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.