1import{_ as ie}from"./TrOMG6Ao.js";import{r as J,v as K,g as ne,u as le,n as ce,h as p,w as ue,i as de,a as me,c as l,k as h,b as o,d as t,e as d,f as m,j as x,t as n,l as D,F,q as A,s as pe,o as r,x as q,y as P,m as W}from"./woluVcg9.js";import{u as _e}from"./BzmrSthG.js";import{u as fe,a as ve}from"./fE74-kRZ.js";import{u as he}from"./DhzWUdnR.js";import{u as ge}from"./RjBw9e47.js";import ye from"./CZRQ088I.js";import xe from"./CePFE8nR.js";import{_ as ke}from"./va3ghEYF.js";import we from"./BOpNst1F.js";import{_ as be}from"./B1cxoaaL.js";import{_ as $e}from"./DRJZ4ykU.js";import{_ as Pe}from"./CueiAwfM.js";import{_ as Ce}from"./4OfaHZAa.js";import{_ as z}from"./CD2w9Kn3.js";import{_ as Se}from"./D-IQAHBq.js";import{_ as G}from"./DUiLPmo3.js";import"./CzmwRRww.js";import"./3RSlX5Xr.js";import"./Cph7zyZ_.js";import"./UKlWExHp.js";import"./t_f2wViY.js";import"./C7kNMr3Z.js";import"./BdKTUhHW.js";import"./CBqcnmsW.js";const De=["short_description","tags","category-recommended"];function Fe(){const{fetchProductBySlug:i}=fe(),c=J({product_id:void 0}),{fetch:g}=_e(c),{fetchDocuments:f,DOCUMENT_TYPES:v}=ve();return{fetchProduct:async E=>{try{const{slug:b,...C}=E,_=await i(b,C);if(!_)return;c.product_id=_.id;const{faqs:y}=await g(),T=await f({product_sku:_.sku},{videos:[v.VIDEOS],manuals:{exclude:[v.SOFTWARE]}});_.faqs=y,_.documents=T;const $=_.content?.filter(({type:k})=>!De.includes(k));return{product:_,productContent:$}}catch(b){console.error("Fetch product failed: ",b);return}}}}const Ie="/api/shops/product/";function Ee(i){return{id:i.id,name:i.name??void 0,image:i.image??void 0,url:i.link??void 0,currency:i.currency??void 0,price:i.price??void 0}}function Te(i){const{baseUrl:c}=K().public.frontkit;return{fetch:async()=>{const{id:f}=i;try{return(await $fetch(`${Ie}${f}`,{baseURL:c})).data?.map(Ee)??[]}catch(v){return console.error("Fetch product shops failed: ",v),[]}}}}const Ae=(i,c)=>c?`${i} - Photo ${c+1}`:i,qe=(i,c)=>i.map((g,f)=>({src:g,alt:Ae(c,f)})),Oe={class:"cn-product-page"},Ve={key:1},Ne={class:"container"},Re={key:0,class:"sm:py-8",itemscope:"",itemtype:"http://schema.org/Product"},Ue={class:"grid gap-x-6 gap-y-8 sm:grid-cols-[minmax(0,452px),minmax(300px,1fr)] xl:grid-cols-[minmax(0,568px),minmax(300px,1fr)]"},je={class:"relative"},Be={key:1,class:"flex h-[20px] items-center px-[3px]"},Me={class:"mt-3 flex gap-5 sm:mt-5"},He={key:0,class:"min-w-0 flex-1"},Le={class:"flex gap-2.5"},Ye={class:"self-center whitespace-nowrap text-lg"},We={key:1,class:"min-w-0 flex-1"},ze={class:"flex gap-2.5"},Ge={class:"self-center whitespace-nowrap text-lg"},Je={class:"flex flex-col gap-6 sm:h-min sm:flex-row sm:flex-wrap sm:gap-8"},Ke={class:"sm:grow-1 flex justify-center gap-4 sm:order-2 sm:items-center sm:justify-start md:grow-0"},Qe={class:"cn-product-page__article hidden text-lg text-gray-dark sm:inline"},Xe={class:"text-lg font-bold leading-snug sm:order-1 sm:w-full sm:text-3xl sm:font-normal xl:text-4xl",itemprop:"name"},Ze={class:"cn-product-page__article sm:grow-1 text-lg text-gray-dark sm:order-3 sm:flex sm:gap-4"},et={class:"cn-product-page__article-value text-xl text-black"},tt={class:"flex flex-col gap-x-6 gap-y-4 sm:order-4 sm:w-full lg:flex-row lg:items-center",itemprop:"offers",itemscope:"",itemtype:"http://schema.org/Offer"},st={key:1,class:"flex flex-col items-start gap-x-5 gap-y-1 sm:flex-row sm:items-center"},ot={class:"text-sm leading-tight text-gray-dark sm:max-w-[120px]"},at={class:"whitespace-nowrap"},rt={itemprop:"price"},it={class:"text-2xl"},nt={class:"text-xl"},lt={class:"text-xl"},ct=["content"],ut={class:"mt-6"},dt={class:"space-y-7"},mt=["href"],pt={class:"flex h-12 w-12 flex-shrink-0 items-center justify-center bg-red text-white"},_t={class:"sm:text-xl"},ft={class:"mt-6"},vt={class:"space-y-7"},ht=["href"],gt={class:"flex h-12 w-12 flex-shrink-0 items-center justify-center bg-red text-white"},yt={class:"sm:text-xl"},xt={key:0,class:"sm:order-6 sm:w-full"},kt={class:"text-lg font-bold"},wt=32,Gt={__name:"[slug]",async setup(i){let c,g;const f=ne(),v=K().public.frontkit,{locale:I}=le(),{$api:{documentService:E}}=ce(),b=p(()=>f.params.slug),C=A(null),_=A(null),y=A(!1),{activeSimilarProduct:T,currentVariation:$,variations:k,similarProducts:O,setVariation:Q,setProduct:X}=he(),{fetchProduct:Z}=Fe(),V=J({id:null}),{fetch:ee}=Te(V),{data:S}=([c,g]=ue(async()=>ge(`product-${f.params.slug}-${I.value}`,async()=>{const e=await Z({slug:b.value,lang:I.value});if(!e?.product)throw pe({statusCode:404,fatal:!0});const{data:a}=await E.getAllDocuments({product_sku:e.product.sku});V.id=e.product.id;const w=e.product.id?await ee():[];return{product:e.product,documents:a??{},shops:w}},{default:()=>({product:null,documents:{},shops:[]})})),c=await c,g(),c),s=p(()=>S.value.product),N=p(()=>S.value.shops);de(s,e=>e&&X(e),{immediate:!0});const R=p(()=>S.value.documents?.Drivers??null),U=p(()=>Object.entries(S.value.documents??{}).filter(([e])=>e!=="Drivers").flatMap(([,e])=>e)),te=p(()=>!!s.value?.content?.find(e=>e.type==="feature-section3d-model")),j=p(()=>({youtube_video:"cn-rich-video","video-section-simple":"video-section","video-section-tabs":"video-tabs-section"})[s.value?.content?.find(a=>a.type==="youtube_video"||a.type==="video-section-simple"||a.type==="video-section-tabs")?.type]),se=p(()=>
1{if(!s.value)return[];const e=[];return[...s.value.category_branch].reverse().forEach((w,u)=>{e.push({title:w.name,link:`${u===0?"/product-category":""}${e[u-1]?e[u-1].link:""}/${w.slug}`})}),e.push({title:s.value.name}),e}),oe=p(()=>k.value&&typeof $.value=="number"&&k.value[$.value]?.images),B=p(()=>{const e=s.value?.name,a=k.value;return a&&e?qe(a[$.value].images,e):[]});me(()=>({title:s.value?.seo_title||s.value?.seo?.page_title,meta:[{key:"description",name:"description",content:s.value?.seo_description||s.value?.seo?.description},{property:"og:title",content:s.value?.seo_og_title||s.value?.seo?.og_title},{property:"og:description",content:s.value?.seo_description||s.value?.seo?.description}]}));const M=p(()=>N.value?.length),H=p(()=>s.value?.content?.find(e=>e.type==="bullets")?.data),L=p(()=>s.value?.feature_groups),Y=e=>{const a=e.getBoundingClientRect().top+window.scrollY-wt;window.scrollTo({top:a,behavior:"smooth"})},ae=()=>{const e=document.querySelector(".feature-3d-model-section");e&&Y(e)},re=()=>{const e=document.querySelector(`.${j.value}`);e&&Y(e)};return(e,a)=>{const w=ie;return r(),l("div",Oe,[s.value?(r(),l("div",Ve,[t("div",Ne,[d(o(Ce),{items:se.value},null,8,["items"]),s.value?(r(),l("section",Re,[t("div",Ue,[t("div",je,[d(w,{product:s.value},null,8,["product"]),oe.value?(r(),h(o(be),{key:0,images:B.value,"thumb-limit":y.value?void 0:10},null,8,["images","thumb-limit"])):m("",!0),B.value.length>10?(r(),l("div",{key:1,class:"mt-5 hidden cursor-pointer items-center xl:flex",onClick:a[0]||(a[0]=u=>y.value=!y.value)},[a[3]||(a[3]=t("div",{class:"h-[1px] w-full border-t-[1px] border-solid border-[#C4C4C433]"},null,-1)),y.value?m("",!0):(r(),h(o(q),{key:0,class:"flex h-[20px] w-[20px] text-gray-dark",name:"chevron-down"})),y.value?(r(),l("div",Be,[d(xe,{class:"text-gray-dark"})])):m("",!0),a[4]||(a[4]=t("div",{class:"h-[1px] w-full border-t-[1px] border-solid border-[#C4C4C433]"},null,-1))])):m("",!0),t("div",Me,[te.value?(r(),l("div",He,[d(o(P),{variant:"red-outlined",class:"w-full",onClick:ae},{default:x(()=>[t("div",Le,[d(ye,{class:"h-[20px] w-[20px] shrink-0 self-center"}),t("p",Ye,n(e.$t("button_to_3d_model")),1)])]),_:1})])):m("",!0),j.value?(r(),l("div",We,[d(o(P),{variant:"red-outlined",class:"w-full",icon:"play",onClick:re},{default:x(()=>[t("div",ze,[t("p",Ge,n(e.$t("button_to_video")),1)])]),_:1})])):m("",!0)])]),t("div",Je,[t("div",Ke,[t("span",Qe,n(`${e.$t("color")}: `),1),o(O)?(r(),h(o(G),{key:1,clickable:"",large:"","active-similar-product":o(T),items:o(O)},null,8,["active-similar-product","items"])):(r(),h(o(G),{key:0,large:"",items:o(k),onInput:o(Q)},null,8,["items","onInput"]))]),t("h1",Xe,n(s.value.name),1),t("p",Ze,[D(n(`${e.$t("article")}: `)+" ",1),t("span",et,n(s.value.sku),1)]),t("div",tt,[M.value?m("",!0):(r(),h(o(P),{key:0,variant:"red",to:"/where-to-buy",class:"shrink-0"},{default:x(()=>[D(n(e.$t("where_to_buy")),1)]),_:1})),s.value.price&&s.value.price.length?(r(),l("div",st,[t("div",ot,n(e.$t("recommended_retail_price")),1),t("div",at,[t("span",rt,[t("span",it,n(s.value.price.split(".")[0])+". ",1),t("span",nt,n(s.value.price.split(".")[1]),1)]),t("span",lt,n(s.value.currency),1),t("meta",{itemprop:"priceCurrency",content:s.value.currency},null,8,ct),a[5]||(a[5]=t("link",{itemprop:"availability",href:"http://schema.org/InStock"},null,-1))])])):m("",!0),R.value?(r(),l(F,{key:2},[d(o(P),{variant:"red-outlined",icon:"download",class:"shrink-0",onClick:a[1]||(a[1]=u=>C.value.open())},{default:x(()=>[D(n(e.$t("driver",2)),1)]),_:1}),d(o(z),{ref_key:"modalDrivers",ref:C,title:e.$t("driver",2),description:s.value.name},{default:x(()=>[t("div",ut,[t("ul",dt,[(r(!0),l(F,null,W(R.value,u=>(r(),l("li",{key:u.id},[t("a",{href:`${o(v).fullPath}${u.file}`,target:"_blank",class:"flex items-center gap-x-4"},[t("span",pt,[d(o(q),{name:"document",class:"h-7 w-7"})]),t("span",_t,n(u.name),1)],8,mt)]))),128))])])]),_:1},8,["title","description"])],64)):m("",!0),U.value?(r(),l(F,{key:3},[d(o(P),{icon:"document",variant:"red-outlined",class:"shrink-0",onClick:a[2]||(a[2]=u=>_.value.open())},{default:x(()=>[D(n(e.$t("documentation")),1)]),_:1}),d(o(z),{ref_key:"modalDocuments",ref:_,title:e.$t("documentation"),description:s.value.name},{default:x(()=>[t("div",ft,[t("ul",vt,[(r(!0),l(F,null,W(U.value,u=>(r(),l("li",{key:u.id},[t("a",{href:`${o(v).fullPath}${u.file}`,target:"_blank",class:"flex items-center gap-x-4"},[t("span",gt,[d(o(q),{name:"document",class:"h-7 w-7"})]),t("span",yt,n(u.name),1)],8,ht)]))),128))])])]),_:1},8,["title","description"])],64)):m("",!0)]),H.value?(r(),l("div",xt,[t("h2",kt,n(e.$t("product_features")),1),d(o(Se),{items:H.value,collapsiable:""},null,8,["items"])])):m("",!0),M.value?(r(),h(o(ke),{key:1,shops:N.value,class:"sm:order-5 sm:w-full"},null,8,["shops"])):m("",!0)])])])):m("",!0)]),d(o(Pe),{blocks:s.value.content,"meta-info":{entityType:s.value.entity_type,entityId:s.value.entity_id}},null,8,["blocks","meta-info"]),L.value?(r(),h(o($e),{key:0,data:{items:L.value}},null,8,["data"])):m("",!0)])):(r(),h(o(we),{key:0}))])}}};export{Gt as default}; 2//# sourceMappingURL=DiTGjfS5.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.