const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/ProductGrid.CPPRoqqw.js","_astro/jsx-runtime.D_zvdyIk.js","_astro/config.MP0qMYzO.js","_astro/js.cookie.C0BS3qSL.js","_astro/index.2yJIXLcc.js","_astro/index.D9qG4eP_.js","_astro/iconBase.Blz05Vck.js","_astro/AddToCart.CVJQz0Jd.js","_astro/cartStore.DQm8CpS2.js","_astro/ProductList.CdYjX5v9.js"])))=>i.map(i=>d[i]);
import{j as e}from"./jsx-runtime.D_zvdyIk.js";import{l as v}from"./cartStore.DQm8CpS2.js";import{u as g}from"./index.CfnX_YjH.js";import{r as m}from"./index.2yJIXLcc.js";import"./js.cookie.C0BS3qSL.js";const E="modulepreload",y=function(o){return"/"+o},f={},p=function(l,c,u){let a=Promise.resolve();if(c&&c.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),t=n?.nonce||n?.getAttribute("nonce");a=Promise.allSettled(c.map(r=>{if(r=y(r),r in f)return;f[r]=!0;const d=r.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${h}`))return;const s=document.createElement("link");if(s.rel=d?"stylesheet":E,d||(s.as="script"),s.crossOrigin="",s.href=r,t&&s.setAttribute("nonce",t),document.head.appendChild(s),d)return new Promise((x,j)=>{s.addEventListener("load",x),s.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${r}`)))})}))}function i(n){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=n,window.dispatchEvent(t),!t.defaultPrevented)throw n}return a.then(n=>{for(const t of n||[])t.status==="rejected"&&i(t.reason);return l().catch(i)})},_=()=>e.jsx("section",{children:e.jsx("div",{className:"container",children:e.jsx("div",{className:"row gy-4",children:e.jsx("div",{className:"col-12 mx-auto",children:e.jsx("div",{children:e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array(9).fill(0).map((o,l)=>e.jsxs("div",{children:[e.jsx("div",{className:"h-[200px] md:h-[269px] rounded-md animate-pulse bg-neutral-200 dark:bg-neutral-700"}),e.jsxs("div",{className:"flex flex-col justify-center items-center",children:[e.jsx("div",{className:"mt-4 w-24 h-3 rounded-full animate-pulse bg-neutral-200 dark:bg-neutral-700"}),e.jsx("div",{className:"mt-2 w-16 h-2 rounded-full animate-pulse bg-neutral-200 dark:bg-neutral-700"})]})]},l))})})})})})}),N=m.lazy(()=>p(()=>import("./ProductGrid.CPPRoqqw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),b=m.lazy(()=>p(()=>import("./ProductList.CdYjX5v9.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8]))),A=({initialProducts:o,initialPageInfo:l,sortKey:c,reverse:u,searchValue:a})=>{const i=g(v);return e.jsx("div",{className:"col-12 lg:col-9",children:e.jsx(m.Suspense,{fallback:e.jsx(_,{}),children:i==="list"?e.jsx(b,{initialProducts:o,initialPageInfo:l,sortKey:c,reverse:u,searchValue:a}):e.jsx(N,{initialProducts:o,initialPageInfo:l,sortKey:c,reverse:u,searchValue:a})})})};export{A as default};
