1import{a as G,e as $,c as j,d as B,as as a,at as E,au as g,av as _,g as V,aw as x,ax as t,ay as f,az as D,v,aA as F,aB as J,w as k,aC as K}from"./DbrOJSRA.js";import{u as W}from"./FsiGkqYA.js";import{t as H}from"./C9HqmeuD.js";const q=()=>{const n=G("useProductReviewAverage",()=>({data:{},loading:!1}));return{fetchProductReviewAverage:async m=>{n.value.loading=!0;const{data:p,error:d}=await $(()=>j().plentysystems.getReviewAverage({itemId:m}),"$kKNK11vNIA");return B(d.value??null),n.value.data=p?.value?.data??n.value.data,n.value.loading=!1,n.value.data},...H(n.value)}},te=()=>{const n=G("useMeta",()=>({loading:!1}));return{setLogoMeta:()=>{n.value.loading=!0;const e=k(),r=x(e.public.domain),s={"@context":"https://schema.org","@type":"Organization","@id":`${r}/#organization`,name:J,url:r,logo:`${r}/_nuxt-plenty/images/logo.png`};g({script:[{type:"application/ld+json",innerHTML:JSON.stringify(s)}]}),n.value.loading=!1},setProductMetaData:e=>{n.value.loading=!0;const r=V(),s=k(),l=x(s.public.domain),{price:c,crossedPrice:u}=K(e),L=Number(t.getItemId(e)),T=t.getName(e),y=f(r.fullPath,l),R=[...new Set(t.getGallery(e).map(o=>D.getImageUrl(o)||D.getImageUrlMiddle(o)).filter(Boolean).map(o=>f(o,l)))],{data:z}=W(L),{data:b}=q(),P=v.getReviewItems(z.value).map(o=>({"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:v.getReviewRating(o),bestRating:t.getMaxRating(e)||5,worstRating:1},author:{"@type":"Person",name:v.getReviewAuthor(o)}})),i={"@context":"https://schema.org","@type":"Product","@id":`${y}#product`,name:T,category:t.getCategoryName(e),image:R.length?R:[f(t.getCoverImage(e),l)],identifier:t.getId(e),description:F(t.getDescription(e)||e.texts.description),offers:{"@type":"Offer",priceCurrency:t.getSpecialPriceCurrency(e),price:Number(c.value),url:y,priceSpecification:[{"@type":"UnitPriceSpecification",price:Number(c.value),priceCurrency:t.getSpecialPriceCurrency(e),priceType:"SalePrice",referenceQuantity:{"@type":"QuantitativeValue"}}],availability:a.getMappedAvailability(e),itemCondition:a.getConditionOfItem(e),seller:{"@id":`${l}/#organization`}},depth:{"@type":"QuantitativeValue",value:t.getLengthMM(e)},width:{"@type":"QuantitativeValue",value:t.getWidthMM(e)},height:{"@type":"QuantitativeValue",value:t.getHeightMM(e)},weight:{"@type":"QuantitativeValue",value:t.getWeightG(e)}};P.length&&(i.review=P);const h=t.getTotalReviews(e),w=b.value?.counts?v.getAverageRating(b.value.counts):t.getAverageRating(e);h>0&&w>0&&(i.aggregateRating={"@type":"AggregateRating",ratingValue:w,reviewCount:h,bestRating:t.getMaxRating(e)||5,worstRating:1});const M=a.getSeoManufacturer(e);M!==""&&(i.manufacturer={"@type":"Organization",name:M});const S=a.getBrand(e);S!==""&&(i.brand={"@type":"Brand",name:S});const C=a.getSku(e);C!==""&&(i.sku=C);const A=a.getGtin(e);A!==""&&(i.gtin=A);const I=a.getGtin8(e);I!==""&&(i.gtin8=I);const N=a.getGtin13(e);N!==""&&(i.gtin13=N),a.getIsbn(e)!==""&&(i.isbn=a.getIsbn(e));const U=a.getMpn(e);U!==""&&(i.mpn=U);const O=a.getPriceValidUntil(e);O!==""&&(i.offers.priceValidUntil=O),e.prices?.rrp&&i.offers.priceSpecification.push({"@type":"UnitPriceSpecification",price:Number(u.value),priceCurrency:t.getRegularPriceCurrency(e),priceType:"ListPrice",referenceQuantity:{"@type":"QuantitativeValue"}}),g({script:[{type:"application/ld+json",innerHTML:JSON.stringify(i,null,4)}]}),n.value.loading=!1},setProductRobotsMetaData:e=>{n.value.loading=!0;const r=V();let s=e.seoSettings?.robots||"";(!e.seoSettings?.forceRobotsValue&&Object.keys(r.query).length>0||e.seoSettings?.forceNoIndex)&&(s="noindex"),g({meta:[{name:"robots",content:s}]}),n.value.loading=!1},setProductCanonicalMetaData:e=>{n.value.loading=!0;const r=a.getCanonical(e);if(r){const s=E(a.getCanonicalHref(r));g({link:[{rel:"canonical",href:s}]});const c=a.getCanonicalAlternate(r).map(u=>({rel:"alternate",hreflang:a.getCanonicalAlternateHreflang(u),href:a.getCanonicalAlternateHref(u)}));g({link:c}),_({ogUrl:s})}n.value.loading=!1},...H(n.value)}};export{te as u};
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.