1import{t as Y}from"./BQ-_32WO.js";import{L as W,M as Z,N as ee,P as l,T as P,U as te,c as V,d as $,f as r,g as k,l as I,lt as n,nt as c,r as O,u as A}from"./C89sYm7w.js";import{a as R}from"./B1NkGjfw.js";import{t as oe}from"./BN9Ca40y.js";import{n as se}from"./BhiMqKcJ.js";import{t as ae}from"./md4qxx4U.js";import{r as ne}from"./CGp8Lqbk.js";import{t as le}from"./K9rsuiWd.js";import{t as ie}from"./iX6r1FaY2.js";import{t as re}from"./X1scBJmB2.js";var De=Y({default:()=>he}),ce={class:"grid-page"},ue={key:0,class:"carousel-external-layout group"},de={class:"nav-side"},me={class:"nav-side"},ve={key:1,class:"grid-static"},fe=Object.assign({name:"ViewItems"},{__name:"ViewItems",props:{items:{type:Array,default:()=>[]},hasMore:{type:Boolean,default:!1},mode:{type:String,default:"slider",validator:v=>["slider","grid"].includes(v)}},emits:["load-more"],setup(v,{emit:E}){const u=v,G=E,j=R("chevronLeft"),z=R("chevron"),h=ae(),U=h.value.typename,C=V(()=>ne(u.items,U,!1)),s=c(null),b=c(!0),y=c(!1),q=V(()=>!y.value||u.hasMore),p=c(0),_=c(0),x=()=>{if(!s.value)return;const e=s.value.querySelector(".grid-item");e&&(p.value=e.getBoundingClientRect().width),_.value=s.value.getBoundingClientRect().width};let g=null;Z(()=>{g=new ResizeObserver(x),s.value&&g.observe(s.value),P(x)}),ee(()=>g?.disconnect());const F=()=>{if(!p.value||!_.value)return null;const e=p.value+24,o=Math.floor(_.value/e);return{itemWithGap:e,visibleItems:Math.max(1,o)}},D=async e=>{if(!s.value)return;const o=F();if(!o)return;const{itemWithGap:a,visibleItems:i}=o,{scrollLeft:f,scrollWidth:t,clientWidth:m}=s.value,K=f+m>=t-20;if(e==="right"&&K&&u.hasMore){const M=u.items.length;G("load-more"),await new Promise(S=>{const T=te(()=>u.items.length,X=>{X>M&&(T(),P().then(S))},{immediate:!0});setTimeout(()=>{T(),S()},3e3)}),s.value.scrollTo({left:M*a,behavior:"smooth"});return}const L=Math.round(f/a),Q=e==="left"?Math.max(0,L-i):L+i;s.value.scrollTo({left:Q*a,behavior:"smooth"})},H=()=>{if(!s.value)return;const{scrollLeft:e,scrollWidth:o,clientWidth:a}=s.value;b.value=e<=10,y.value=e+a>=o-10},d=c(null),w=c(!1),B=e=>{const o=e?.["Download Button"]?.downloadNick||e?.Logo?.downloadNick||"",a=e?.["Download Button"]?.software||e?.Logo?.software||"";if(!(!o&&!a)&&h.value){const{lead:i}=se(h);i(o,a)}},N=e=>{d.value=e,w.value=!0},J=()=>{w.value=!1,setTimeout(()=>{d.value=null},300)};return(e,o)=>{const a=oe,i=ie,f=re;return l(),r("div",ce,[v.mode==="slider"?(l(),r("div",ue,[I("div",de,[n(b)?$("",!0):(l(),r("button",{key:0,class:"outside-nav-btn","aria-label":"Previous",onClick:o[0]||(o[0]=t=>D("left"))},[k(a,{name:n(j),class:"h-8 w-8"},null,8,["name"])]))]),I("div",{ref_key:"scrollContainer",ref:s,class:"grid-slider carousel-track",onScroll:H},[(l(!0),r(O,null,W(n(C),t=>(l(),A(i,{key:t.id,item:t,"is-active":n(d)?.id===t.id,onClick:m=>B(t),onShowDetails:m=>N(t)},null,8,["item","is-active","onClick","onShowDetails"]))),128))],544),I("div",me,[n(q)?(l(),r("button",{key:0,class:"outside-nav-btn","aria-label":"Next",onClick:o[1]||(o[1]=t=>D("right"))},[k(a,{name:n(z),class:"h-8 w-8"},null,8,["name"])])):$("",!0)])])):(l(),r("div",ve,[(l(!0),r(O,null,W(n(C),t=>(l(),A(i,{key:t.id,item:t,"is-active":n(d)?.id===t.id,onClick:m=>B(t),onShowDetails:m=>N(t)},null,8,["item","is-active","onClick","onShowDetails"]))),128))])),k(f,{item:n(d),"is-open":n(w),onClose:J},null,8,["item","is-open"])])}}}),he=le(fe,[["__scopeId","data-v-984c02d2"]]);export{De as n,he as t};
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.