1import{k as D,K as E,e as m,d as x,f as F,H as q,x as R,r as W,o as c,c as _,a as t,u as a,b as r,n as V,j as T,F as j,q as K,g as J,w,t as b,m as O,z as H}from"./app-9980a2a5.js";import{_ as I}from"./Button.vue_vue_type_script_setup_true_lang-9c48ae6f.js";import{u as Q}from"./translations-09552a92.js";import z from"./Arrow-3f750313.js";import{_ as k}from"./GridSelect.vue_vue_type_script_setup_true_lang-79f3028e.js";import X from"./EmptyList-faeb4291.js";/* empty css */import"./actions-254dea5b.js";import"./video-c1fbc9c0.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./SelectArrow-89b505cf.js";const Y={class:"products__grid"},Z={class:"grid__header"},G={class:"header"},ee=["lang","innerHTML"],te={class:"header__result"},se={class:"flex space-x-2 2xl:space-x-4 4xl:space-x-5 pl-4 2xl:pl-8"},ae={class:"grid__content"},oe={class:"grid__filters"},le=["innerHTML"],ne=["innerHTML"],ie={class:"pr-4"},re={key:0,class:"w-full flex flex-col gap-y-4 pb-4 lg:hidden"},ce={class:"products__links"},de={class:"image__container"},ue=["src","alt","fetchpriority","onLoad"],_e={class:"link__text"},me=["innerHTML"],pe=["innerHTML"],ve={class:"link__button"},ge={class:"button__button"},he={key:0,class:"products__pagination"},fe={key:1,class:"grid__searching"},ke={class:"searching__icon border-red-500 border searching__icon--empty"},xe={class:"searching__info"},we=["innerHTML"],be={class:"info__text--2"},ye=["innerHTML"],Ue=D({__name:"CablesGrid",props:{items:{},title:{},content:{},filters:{},pagination:{},sorting:{},component:{}},setup(P){const n=P;E();const o=Q();m(null);const p=m(!1),v=m(null),A=typeof window<"u"?window.innerWidth:0,d=m(n.pagination.current),g=m(n.sorting.current),i=m(1),y=x(()=>{if(!n.items)return[];const l=[...n.items];switch(g.value){case"name-asc":return l.sort((s,u)=>s.name.localeCompare(u.name));case"name-desc":return l.sort((s,u)=>u.name.localeCompare(s.name));default:return l}}),h=x(()=>Math.max(1,Math.ceil(y.value.length/d.value))),B=x(()=>{const l=(i.value-1)*d.value,s=l+d.value;return y.value.slice(l,s)}),S=()=>{i.value<h.value&&i.value++,i.value===h.value&&v.value&&v.value.scrollIntoView({behavior:"smooth"})},U=()=>{i.value>1&&i.value--},f=m([]),L=l=>f.value.includes(l);function N(l){f.value.includes(l)||f.value.push(l)}return F(()=>{var l;A>=1280&&(p.value=!0),v.value!=null&&v.value&&((l=n.items)==null||l.forEach(s=>{const u=new Image;u.src=s.photo.src,u.onload=()=>{f.value=[...f.value,s.photo]}}))}),q(()=>{v.value!=null}),R([d,g],()=>{i.value=1}),(l,s)=>{var M,C;const u=W("Arrow");return c(),_("section",Y,[t("div",Z,[t("h1",G,[t("span",{lang:a(o).getLocale(),innerHTML:(M=n.title)!=null&&M.length?n.title:a(o).get("Products")},null,8,ee)]),t("div",te,[t("div",se,[r(k,{closeAfterClick:!0,class:"z-10",prefix:a(o).get("Show")+":",items:n.pagination.options,"mutate-label-callback":e=>e+" "+a(o).get("products"),modelValue:d.value,"onUpdate:modelValue":s[0]||(s[0]=e=>d.value=e)},null,8,["prefix","items","mutate-label-callback","modelValue"]),r(k,{closeAfterClick:!0,class:"z-10",prefix:a(o).get("Sort by")+":","mutate-label-callback":e=>a(o).get("sort."+e),items:n.sorting.options,modelValue:g.value,"onUpdate:modelValue":s[1]||(s[1]=e=>g.value=e)},null,8,["prefix","mutate-label-callback","items","modelValue"])])])]),t("div",ae,[t("div",oe,[t("div",{class:"filters__header--mobile",onClick:s[2]||(s[2]=e=>p.value=!p.value)},[t("div",null,[p.value?(c(),_("p",{key:1,innerHTML:a(o).get("hide sorting options")},null,8,ne)):(c(),_("p",{key:0,innerHTML:a(o).get("show sorting options")},null,8,le))]),t("div",ie,[r(u,{class:V({"rotate-180":p.value})},null,8,["class"])])]),p.value?(c(),_("div",re,[r(k,{class:"z-30",prefix:a(o).get("Show")+":",items:n.pagination.options,"mutate-label-callback":e=>e+" "+a(o).get("products"),modelValue:d.value,"onUpdate:modelValue":s[3]||(s[3]=e=>d.value=e)},null,8,["prefix","items","mutate-label-callback","modelValue"]),r(k,{class:"z-30",prefix:a(o).get("Sort by")+":","mutate-label-callback":e=>a(o).get("sort."+e),items:n.sorting.options,modelValue:g.value,"onUpdate:modelValue":s[4]||(s[4]=e=>g.value=e)},null,8,["prefix","mutate-label-callback","items","modelValue"])])):T("",!0)]),(C=n.items)!=null&&C.length?(c(),_("div",{key:0,class:"grid__products",ref_key:"productsContainerRef",ref:v},[t("div",ce,[(c(!0),_(j,null,K(B.value,(e,$)=>
1(c(),J(a(O),{href:e==null?void 0:e.url,class:"links__link group lg:hover:shadow-md"},{default:w(()=>[t("div",de,[t("img",{src:e.photo.src,alt:e.name,width:500,height:500,class:V({"opacity-0":!L(e.photo),"opacity-100":L(e.photo)}),fetchpriority:$===0?"high":"auto",decoding:"async",onLoad:Le=>N(e.photo)},null,42,ue)]),t("div",_e,[t("h3",{class:"break-words",innerHTML:e.name},null,8,me),t("p",{class:"truncate",innerHTML:e==null?void 0:e.shortDescription},null,8,pe)]),t("div",ve,[t("div",ge,b(a(o).get("Detail view")),1)])]),_:2},1032,["href"]))),256))]),h.value>1?(c(),_("div",he,[r(I,{onClick:H(U,["prevent"]),disabled:i.value===1,classes:["icon"],arialabel:a(o).get("Go to previous page")},{default:w(()=>[r(z,{class:"rotate-180"})]),_:1},8,["onClick","disabled","arialabel"]),t("span",null,b(i.value)+" / "+b(h.value),1),r(I,{onClick:H(S,["prevent"]),disabled:i.value===h.value,classes:["icon"],arialabel:a(o).get("Go to next page")},{default:w(()=>[r(z)]),_:1},8,["onClick","disabled","arialabel"])])):T("",!0)],512)):(c(),_("div",fe,[t("div",ke,[r(X)]),t("div",xe,[t("p",{innerHTML:a(o).get("No products found."),class:"info__text"},null,8,we),t("div",be,[t("p",{innerHTML:a(o).get("Try to change filters or change search query.")},null,8,ye)])])]))])])}}});export{Ue as default};
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.