import{d as _,l as B,r as P,H as V,c as m,o as u,b as s,A as n,n as y,F as w,p as v,a as C,t as L,u as S,P as z}from"./app-DJb_CRLj.js";import"./swiper-bundle-D10wXgdm.js";import{S as M}from"./swiper-core-BbUUCioi.js";const E=["id"],I={class:"row"},N={class:"col-12"},F={id:"swiper-categories-slider-header",class:"d-flex align-items-center justify-content-between swiper-categories-slider--header mb-2"},H=["innerHTML"],j={class:"swiper-wrapper"},A=["src","alt"],T={class:"product-simple--title lts-05"},D=["src"],G=_({__name:"CategoryList1",props:{status:{},component_id:{},data:{}},setup(k){const o=k;function f(e){var a,l;const t=e.wrapperEl;if(!t)return;const d=e.slides.length;typeof e.params.slidesPerView=="number"?e.params.slidesPerView:e.activeIndex;const i=e.params.slidesPerView;typeof i=="number"&&i>=d?(t.classList.add("centered"),(a=document.getElementById("swiper-categories-slider-header"))==null||a.classList.add("centered")):(t.classList.remove("centered"),(l=document.getElementById("swiper-categories-slider-header"))==null||l.classList.remove("centered"))}const h=()=>{var e;new M(".swiper-categories-slider-"+o.component_id,{slidesPerView:3,spaceBetween:10,centeredSlides:!1,direction:"horizontal",autoplay:{delay:1e4},loop:!1,breakpoints:{120:{slidesPerView:2,spaceBetween:5},320:{slidesPerView:4,spaceBetween:8},540:{slidesPerView:5,spaceBetween:10},768:{slidesPerView:6,spaceBetween:10},992:{slidesPerView:7,spaceBetween:15},1200:{slidesPerView:9,spaceBetween:15},1250:{slidesPerView:Number(((e=o.data.style)==null?void 0:e.item_count)??10),spaceBetween:15}},pagination:{el:".swiper-pagination-categories-"+o.component_id,type:"bullets",clickable:!0,dynamicBullets:!0,dynamicMainBullets:2},on:{afterInit:t=>{t.update(),f(t),t.isLocked||(t.params.loop=!0,t.loopCreate(),t.pagination&&(t.pagination.render(),t.pagination.update()),t.update())},resize:t=>{f(t)}},observer:!0})};B(()=>{h()});const b=P(V().props.dark);return typeof window<"u"&&$(()=>{let e={attributes:!0,attributeFilter:["id"]},t=function(i,g){for(let a of i)a.type==="attributes"&&a.attributeName==="id"&&(document.body.id=="dark"?b.value=!0:b.value=!1)};new MutationObserver(t).observe(document.body,e)}),(e,t)=>{var d,i,g,a,l;return u(),m("div",{id:"component-"+e.component_id,class:y({container:!0,readonly:e.status=="dev"}),style:n("margin-top:"+((d=e.data.style)==null?void 0:d.margin.top)+"px; margin-bottom:"+(((i=e.data.style)==null?void 0:i.margin.bottom)!=null?(g=e.data.style)==null?void 0:g.margin.bottom:20)+"px;")},[s("div",I,[s("div",N,[s("div",{class:"swiper-categories-slider-container",style:n(((a=o.data.style)==null?void 0:a.main_background)=="gradient"?"padding: 20px 20px 5px 20px !important;":((l=o.data.style)==null?void 0:l.main_background)=="solid"?"background: "+(b.value?"#353542":"#ffffff")+" !important; border-radius: 20px !important; padding: 20px 20px 5px 20px !important;":"background: none !important; padding: 0 !important")},[s("div",F,[s("span",{class:"align-items-center lts-05",innerHTML:e.data.category_list.category.title!=null?e.data.category_list.category.title:e.$t("messages.sentence.not_set")},null,8,H),s("div",{class:y("swiper-paginations swiper-pagination-categories-"+e.component_id)},null,2)]),s("div",{class:y("swiper swiper-categories-slider swiper-categories-slider-"+e.component_id)},[s("div",j,[e.data.category_list.categories!=null&&e.data.category_list.categories.length>0?(u(!0),m(w,{key:0},v(e.data.category_list.categories,r=>{var p,c;return u(),m("div",{key:r.id,class:"swiper-slide"},[s("div",{class:"card",style:n((p=e.data.style)!=null&&p.items_background?"border: none !important":"background: none !important; border: none !important")},[s("div",{class:"card-body el-center",style:n((c=e.data.style)!=null&&c.items_background?"":"padding: 15px !important")},[s("img",{class:"product-simple--img",src:r.get_image,alt:r.title,loading:"lazy"},null,8,A),s("h3",T,L(r.title),1),C(S(z),{class:"product-simple--link",href:e.route("main.products.index",{cat:r.slug})},null,8,["href"])],4)],4)])}),128)):(u(!0),m(w,{key:1},v(new Array(15),r=>{var p,c;return u(),m("div",{class:y({"swiper-slide":!0,readonly:e.status=="dev"})},[s("div",{class:"card",style:n((p=e.data.style)!=null&&p.items_background?"border: none !important":"background: none !important; border: none !important")},[s("div",{class:"card-body el-center",style:n((c=e.data.style)!=null&&c.items_background?"":"padding: 15px !important")},[s("img",{class:"product-simple--img",src:e.$page.props.appUrl+"/img/temp/pre-load-category.png",alt:"دسته بندی",loading:"lazy"},null,8,D),t[0]||(t[0]=s("h3",{class:"product-simple--title sk sk-text-sm"},"نام دسته",-1)),t[1]||(t[1]=s("a",{class:"product-simple--link",href:"javascript:void(0)"},null,-1))],4)],4)],2)}),256))])],2)],4)])])],14,E)}}});export{G as default};
