import xt from"./B_aBJuY4.js";import At from"./CBRx5oDe.js";import Tt from"./DxoMRLrD.js";import Pt from"./31SaSoTv.js";import{_ as Nt}from"./4HfP1VOY.js";import{u as wt,e as w,R as Lt,V as ht,d as Ot,ab as St,b as Ct,l as Mt,a as zt,w as _t,j as jt,f as h,x as l,g as a,h as p,i as S,t as $,v as f,z as Bt,A as Wt,C as Et,ac as Rt,a0 as Vt,c as Ht,n as Ut,o as c,B as qt,_ as Gt}from"./BxiWQxwE.js";import Ft from"./DJw3Flj9.js";import{_ as Jt}from"./jE91n9M9.js";import Qt from"./jljV2oWn.js";import{_ as Kt}from"./BaiHEGTg.js";import{_ as Yt}from"./B9Cfjn7S.js";import{u as Xt,D as gt}from"./Dl6s6BfE.js";import{u as Zt}from"./82sW_ACQ.js";import{u as te}from"./C2dOrIeI.js";import"./BiNVmQQE.js";import"./BoIRubSN.js";import"./QMEN6lyk.js";import"./CxeYIrhH.js";import"./BrAEguxC.js";const ee=e=>{const k=ht(),{params:u,path:g}=wt(),C=w(()=>`${e==null?void 0:e.additionalDescription} ${e==null?void 0:e.description}`),v=w(()=>{var y,b,I;if(!((y=e==null?void 0:e.images)!=null&&y.length))return null;const D=((b=e.images.find(x=>x.mainImage))==null?void 0:b.image)??((I=e.images[0])==null?void 0:I.image);return`${k.public.files}${D}?width=500&height=500&mode=crop#primaryimage`}),q=w(()=>{var D,y,b,I,x,N,A,L,T,r,M,z,j,t,B,O;return e?[{type:"application/ld+json",innerHTML:{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.dekamarkt.nl/#organization",name:"DekaMarkt",slogan:"Smakelijk eten!",url:"https://www.dekamarkt.nl/",sameAs:["https://www.facebook.com/dekamarkt/","https://www.instagram.com/dekamarkt/","https://www.youtube.com/channel/UC0f_lB_Vyj4NymoebWJfgBw","https://nl.pinterest.com/DekaMarkt/","https://nl.linkedin.com/company/dekamarkt"],logo:{"@type":"ImageObject","@id":"https://www.dekamarkt.nl/#logo",url:"https://www.dekamarkt.nl/img/logo.png",width:220,height:220,caption:"DekaMarkt logo"}},{"@type":"WebSite","@id":"https://www.dekamarkt.nl/#website",url:"https://www.dekamarkt.nl/",name:"DekaMarkt",description:"Bekijk ons ruime assortiment snel en eenvoudig via DekaMarkt.nl!",publisher:{"@id":"https://www.dekamarkt.nl/#organization"}},{"@type":"ImageObject","@id":`${v.value}#primaryimage`,url:v.value,width:1200,height:1200,caption:e==null?void 0:e.headerText},{"@type":["WebPage","ItemPage"],"@id":`https://www.dekamarkt.nl${g}#webpage`,url:`https://www.dekamarkt.nl${g}`,inLanguage:"nl-NL",name:e==null?void 0:e.headerText,isPartOf:{"@id":"https://www.dekamarkt.nl/#website"},primaryImageOfPage:{"@id":`${v.value}#primaryimage`},description:C.value,breadcrumb:{"@id":`https://www.dekamarkt.nl${g}#breadcrumb`}},{"@type":"BreadcrumbList","@id":`https://www.dekamarkt.nl${g}#breadcrumb`,itemListElement:[{"@type":"ListItem",position:1,item:{"@type":"WebPage","@id":"https://www.dekamarkt.nl/producten",url:"https://www.dekamarkt.nl/producten",name:"Producten"}},{"@type":"ListItem",position:2,item:{"@type":"WebPage","@id":`https://www.dekamarkt.nl/producten/${u.department}`,url:`https://www.dekamarkt.nl/producten/${u.department}`,name:u.department}},{"@type":"ListItem",position:3,item:{"@type":"WebPage","@id":`https://www.dekamarkt.nl/producten/${u.department}/${u.webgroup}`,url:`https://www.dekamarkt.nl/producten/${u.department}/${u.webgroup}`,name:u.webgroup}},{"@type":"ListItem",position:4,item:{"@type":"WebPage","@id":`https://www.dekamarkt.nl${g}`,url:`https://www.dekamarkt.nl${g}`,name:e==null?void 0:e.headerText}}]},{"@type":"Product","@id":`https://www.dekamarkt.nl${g}#product`,mainEntityOfPage:{"@id":`https://www.dekamarkt.nl${g}#webpage`},name:e==null?void 0:e.headerText,mpn:e==null?void 0:e.productId,brand:{"@type":"Brand","@id":`https://www.dekamarkt.nl/zoeken/producten/${(y=(D=e.productAssortment)==null?void 0:D.productInformation)==null?void 0:y.brand}#brand`,name:(I=(b=e.productAssortment)==null?void 0:b.productInformation)==null?void 0:I.brand,url:`https://www.dekamarkt.nl/zoeken/producten/${(N=(x=e.productAssortment)==null?void 0:x.productInformation)==null?void 0:N.brand}`},manufacturer:{"@type":"Organization","@id":`https://www.dekamarkt.nl/zoeken/producten/${(L=(A=e.productAssortment)==null?void 0:A.productInformation)==null?void 0:L.brand}#manufacturer`,name:(r=(T=e.productAssortment)==null?void 0:T.productInformation)==null?void 0:r.brand,url:`https://www.dekamarkt.nl/zoeken/producten/${(z=(M=e.productAssortment)==null?void 0:M.productInformation)==null?void 0:z.brand}`},description:C.value,image:{"@type":"ImageObject","@id":`${v.value}#primaryimage#id=product-image`,url:v.value,width:1200,height:1200,caption:e==null?void 0:e.headerText},offers:{"@type":"Offer",priceCurrency:"EUR",Price:((j=e.productAssortment)==null?void 0:j.offerPrice)||((t=e==null?void 0:e.productAssortment)==null?void 0:t.normalPrice),url:`https://www.dekamarkt.nl${g}`,itemCondition:"http://schema.org/NewCondition",availability:(B=e.productAssortment)!=null&&B.offerPrice||(O=e==null?void 0:e.productAssortment)!=null&&O.normalPrice?"http://schema.org/InStock":"http://schema.org/OutOfStock",businessFunction:"http://purl.org/goodrelations/v1#Sell",seller:{"@id":"https://www.dekamarkt.nl/#organization"}}}]}}]:[]});Lt({script:q})},ae={key:0,class:"container"},oe={class:"detail__page"},ne={class:"product__images"},re={class:"product"},se={class:"product__info"},ie={class:"product__info--meta"},ce={key:0,class:"chip"},me=["aria-label"],de={key:0},le={class:"actions"},pe={key:0,class:"product__details"},ue={key:0,class:"product__details--meta"},_e=["src","alt"],ge=["innerHTML"],we={key:2,class:"offer-runtime"},he={key:1,class:"product__info"},fe={key:2,class:"product__info"},ke=Ot({__name:"[id]",async setup(e){let k,u;const{add:g,remove:C,update:v}=St(),{getProductInformation:q}=Zt(),{mapProductAssortmentToProductCard:D,mapProductCardToGtmItem:y}=Ct(),{openListDialog:b,productForShoppingList:I,productSaved:x}=Mt(),N=ht(),A=wt(),{format:L}=Xt(),{$gtm:T,$messages:r}=zt(),M=async o=>{const n={product:t.value,quantity:o,listName:"",gtmItem:E.value};await g(n)},z=async()=>{const o={product:t.value,quantity:0,listName:"",gtmItem:E.value};await C(o)},j=async o=>{const n={product:o.product,quantity:o.quantity,listName:"",gtmItem:E.value};await v(n)},{data:t,error:B}=([k,u]=_t(async()=>Ht(`product-information-${A.params.id}`,async()=>{var i;const o=await q(+A.params.id);return(i=o.product)!=null&&i.productAssortment?o.product:[]})),k=await k,u(),k);(B.value||!t.value)&&(T("products.notAvailable",{"302Url":A.path}),[k,u]=_t(()=>Ut("/niet-beschikbaar")),await k,u());const O=w(()=>{var o;return((o=t.value.logos)==null?void 0:o.filter(n=>!n.image.startsWith("logos/Planet_")).slice(0,3))??[]}),s=w(()=>{var o;return t!=null&&t.value?D((o=t==null?void 0:t.value)==null?void 0:o.productAssortment):null}),ft=()=>{I.value=s.value,b.value=!0},G=w(()=>{var o;return x((o=s.value)==null?void 0:o.productId)}),kt=w(()=>{var d,m,P,R,V,H,U;if(!((d=s.value)!=null&&d.price.isOffer))return null;const o=((R=(P=(m=t.value)==null?void 0:m.productAssortment)==null?void 0:P.productOffer)==null?void 0:R.disclaimerStartDate)??t.value.productAssortment.startDate,n=((U=(H=(V=t.value)==null?void 0:V.productAssortment)==null?void 0:H.productOffer)==null?void 0:U.disclaimerEndDate)??t.value.productAssortment.endDate,i=L(new Date(String(o)),gt),_=L(new Date(String(n)),gt);return r("products.pdp.offerRuntime",{startDate:i,endDate:_})}),F=w(()=>{var o,n;return(n=(o=s.value)==null?void 0:o.logos)==null?void 0:n.find(i=>i.description.toLowerCase().startsWith("nutri"))}),J=w(()=>{var _;const i=(Array.isArray((_=t.value)==null?void 0:_.images)?t.value.images:[]).map(d=>{var m;return{...d,alt:r("aria.image",{product:(m=s.value)==null?void 0:m.headerText})}}).sort((d,m)=>Number(d.mainImage)+Number(m.mainImage));return i.length>0?i:[{image:"artikelen/noPicture.png",mainImage:!0,rankNumber:-1,alt:"Geen afbeelding"}]}),vt=o=>o.split(" ").filter(n=>!n.startsWith("(")).join("_").replace("/","_").toLowerCase(),yt=(o=[])=>o.reduce((n,i)=>{var d;const _=m=>{const P=vt(m.text);n[P]=Number(m.value)};return _(i),(d=i.nutritionalSubValues)==null||d.forEach(_),n},{}),bt=()=>{var i,_,d;if(!t.value)return;const o=yt(((_=(i=t.value.declarations)==null?void 0:i.nutritionalInformation)==null?void 0:_.nutritionalValues)??[]),n={item_id:t.value.productId,item_mpn:t.value.productNumber,item_name:t.value.headerText,product_description:t.value.CommodityLawName,price:s.value.price.priceToShow,special_offer:s.value.price.isOffer?r("products.seo.yes"):r("products.seo.no"),product_brand:t.value.brand,product_manufacturer:t.value.brand,product_availability:t.value.TemporaryNotAvailable?r("products.seo.out_of_stock"):r("products.seo.available"),product_contents:t.value.commercialContent,item_category:t.value.department,item_category2:t.value.webgroup,ingredienten:((d=t.value.declarations)==null?void 0:d.ingredients)??r("products.seo.no_ingredients_found"),...o};Object.keys(n).forEach(m=>n[m]===void 0||n[m]===null?delete n[m]:{}),T("products.schema_product",{...n})};t.value&&ee(t.value);const W=w(()=>{var o;return(o=s.value)!=null&&o.price.isOffer?{title:"products.seo.offerTitle",description:"products.seo.offerDescription",ogTitle:"products.seo.offerOgTitle",ogDescription:"products.seo.offerOgDescription"}:{title:"products.seo.title",description:"products.seo.description",ogTitle:"products.seo.ogTitle",ogDescription:"products.seo.ogDescription"}});te({title:r(`${W.value.title}`,{product:t.value.headerText}),ogTitle:r(`${W.value.ogTitle}`,{product:t.value.headerText}),description:r(`${W.value.description}`,{product:t.value.headerText}),ogDescription:r(`${W.value.ogDescription}`,{product:t.value.headerText}),ogImage:`${N.public.files}/static-images/deka/web/icons/icon_512x512.png`,twitterCard:"summary_large_image"});const E=w(()=>y(s.value));return jt(()=>{T("products.view_item",{ecommerce:{items:[E.value]}}),bt()}),(o,n)=>{var Q,K,Y,X,Z,tt,et,at,ot,nt,rt,st,it,ct,mt,dt,lt,pt,ut;const i=xt,_=At,d=Tt,m=Pt,P=Nt,R=Rt,V=Vt,H=Ft,U=Jt,It=Qt,$t=Kt,Dt=Yt;return c(),h("section",null,[a(s)?(c(),h("div",ae,[p("div",oe,[p("div",ne,[S(i,{logos:a(O),images:a(J)},null,8,["logos","images"]),S(_,{logos:a(O),images:a(J)},null,8,["logos","images"])]),p("div",re,[p("div",se,[p("div",ie,[a(s).price.textPriceSign?(c(),h("span",ce,f(a(s).price.textPriceSign),1)):l("",!0),p("div",null,[p("button",{type:"button",class:Wt({saved:a(G)}),"aria-label":a(r)("aria.toggleToList"),onClick:Bt(ft,["stop"])},[a(G)?(c(),$(d,{key:0})):(c(),$(m,{key:1}))],10,me)])]),p("h1",null,f((Q=a(s))==null?void 0:Q.headerText),1),a(s).packaging?(c(),h("p",de,f((K=a(s))==null?void 0:K.packaging),1)):l("",!0),p("div",le,[S(P,{product:a(s)},null,8,["product"]),S(R,{"show-large-button":!0,product:a(s),onAdd:M,onUpdate:j,onRemove:z},null,8,["product"])])]),a(F)||(Y=a(t))!=null&&Y.additionalDescription?(c(),h("div",pe,[a(F)?(c(),h("div",ue,[p("img",{src:`${a(N).public.files}/${o.nutriLogo.image}`,alt:o.nutriLogo.description},null,8,_e),S(V,{target:"_blank",to:"/meer/nutriscore"},{default:Et(()=>[qt(f(a(r)("products.pdp.moreAboutNutriScore")),1)]),_:1})])):l("",!0),(X=a(t))!=null&&X.additionalDescription?(c(),h("div",{key:1,innerHTML:a(t).additionalDescription},null,8,ge)):l("",!0),a(s).price.isOffer?(c(),h("span",we,f(a(kt)),1)):l("",!0)])):l("",!0),(Z=a(t))!=null&&Z.description?(c(),h("div",he,[p("h4",null,f(a(r)("products.pdp.description")),1),p("p",null,f(a(t).description),1)])):l("",!0),(et=(tt=a(t))==null?void 0:tt.declarations)!=null&&et.ingredients?(c(),h("div",fe,[p("h4",null,f(a(r)("products.pdp.ingredients")),1),p("p",null,f(a(t).declarations.ingredients),1)])):l("",!0),((ot=(at=a(t).declarations)==null?void 0:at.nutritionalInformation)==null?void 0:ot.nutritionalValues.length)>0?(c(),$(H,{key:3,name:"nutrition",product:a(t)},null,8,["product"])):l("",!0),((rt=(nt=a(t))==null?void 0:nt.declarations)==null?void 0:rt.cookingInstructions.length)>0?(c(),$(U,{key:4,name:"preparation",product:a(t)},null,8,["product"])):l("",!0),((it=(st=a(t))==null?void 0:st.declarations)==null?void 0:it.storageInstructions.length)>0?(c(),$(It,{key:5,name:"storage",product:a(t)},null,8,["product"])):l("",!0),(dt=(mt=(ct=a(t))==null?void 0:ct.declarations)==null?void 0:mt.contactInformation)!=null&&dt.contactName?(c(),$($t,{key:6,name:"contact",product:a(t)},null,8,["product"])):l("",!0),(ut=(pt=(lt=a(t))==null?void 0:lt.declarations)==null?void 0:pt.contactInformation)!=null&&ut.contactName?(c(),$(Dt,{key:7,name:"disclaimer",product:a(t)},null,8,["product"])):l("",!0)])])])):l("",!0)])}}}),We=Gt(ke,[["__scopeId","data-v-d27c8aae"]]);export{We as default};
