1import{e4 as p,bS as a,eY as y,eZ as B}from"./index-B184P8Kx.js";import{_ as S,C as _,u as k}from"./ui-lib-CSML94fI.js";import{ay as d,s as m,o as l,p as f,D as v,a as C,F as O,q as $}from"./vendors-D_z06TSl.js";const g={name:"PromoSlider",components:{BannerSlide:p,CarouselScroll:_},props:{categoryBanners:{type:String,validator(s){return[a.PROMO,a.TOURNAMENTS].includes(s)},default:"slider-tournaments-banners"},ssrSizeCarousel:{type:Object,default:null}},emits:["clickBanner","viewBanner"],data(){return{bannerWasViewed:{},isMounted:!1}},computed:{...d(k,{isMobile:"isMobile"}),...d(B,{banners:"getBannersData"}),bannersByType(){const s=this.banners.filter(e=>e.categories.includes(this.categoryBanners));if(!Array.isArray(s))return[];s.map(e=>{var t;return{...e,tournamentLink:(t=e.button)==null?void 0:t.url,isTournament:this.categoryBanners===a.TOURNAMENTS}});const r=y(s,this.categoryBanners);if(!this.isMounted&&this.ssrSizeCarousel){if(this.isMobile&&this.ssrSizeCarousel.mobile)return r.slice(0,this.ssrSizeCarousel.mobile);if(!this.isMobile&&this.ssrSizeCarousel.desktop)return r.slice(0,this.ssrSizeCarousel.desktop)}return r},keysRefsForObserve(){return this.bannersByType.map((s,r)=>({refKey:`slide--${r}`,item:s}))}},mounted(){this.isMounted=!0,this.setObserve()},beforeUnmount(){this.observer&&this.observer.disconnect()},methods:{setObserve(){const s={rootMargin:"0px",threshold:.5},r=e=>{e.forEach(t=>{if(t.isIntersecting){const n=t.target.dataset.keyItem,o=this.keysRefsForObserve.findIndex(({refKey:i})=>i===n);if(this.bannerWasViewed[n])return;this.$emit("viewBanner",this.keysRefsForObserve[o].item,o),this.bannerWasViewed[n]=!0}})};this.observer=new IntersectionObserver(r,s);for(const{refKey:e}of this.keysRefsForObserve)this.$refs[e]&&this.$refs[e][0]&&(this.$refs[e][0].$el.dataset.keyItem=e,this.observer.observe(this.$refs[e][0].$el))}}};function w(s,r,e,t,n,o){const i=m("BannerSlide"),h=m("CarouselScroll");return l(),f(h,{"allow-children-mismatch":!!e.ssrSizeCarousel,class:"promo-slider"},{default:v(()=>[(l(!0),C(O,null,$(o.bannersByType,(c,u)=>(l(),f(i,{key:c.id,ref_for:!0,ref:"slide--"+u,banner:c,lazy:!0,class:"promo-slider__banner-slide","show-second-button":"",onClickBanner:b=>s.$emit("clickBanner",b,u)},null,8,["banner","onClickBanner"]))),128))]),_:1},8,["allow-children-mismatch"])}const z=S(g,[["render",w],["__scopeId","data-v-659039d9"]]);export{z as default}; 2//# sourceMappingURL=PromoSlider-B86OOoQ2.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.