1import{j as s,T as e,L as a,W as l}from"./vendor-DKpN-gn6.js";import{u as r}from"./useStoreProducts-DL3eRgzF.js";import{a as t,B as c}from"./index-CjqWG2Gu.js";import{C as i,b as o,c as d,d as n,a as m,e as x}from"./card-C0twyzQf.js";import{A as h}from"./aspect-ratio-DnbkXac_.js";import{B as j}from"./badge-BupusfKi.js";import{S as p}from"./skeleton-CQZJIIqz.js";import"./auth-D0Oxv0aP.js";import"./ui-DbiJ6HOd.js";const g=({product:r})=>{const{addToCart:p}=t(),g=r.name.includes("Workbook")||"prod_Pl13XbhPRV4hQf"===r.id||"prod_RoyXELQdr5qnSb"===r.id;return s.jsxs(i,{className:"flex flex-col",children:[s.jsxs("div",{className:"overflow-hidden relative",children:[s.jsx(h,{ratio:4/3,children:g?s.jsx("div",{className:"bg-white h-full w-full p-4",children:s.jsx("img",{src:"/images/frontCover-workSheets.jpg",alt:r.name,className:"h-full w-full object-contain"})}):r.image_url?s.jsx("div",{className:"h-full w-full",children:s.jsx("img",{src:r.image_url,alt:r.name,className:"h-full w-full object-cover"})}):s.jsx("div",{className:"h-full w-full bg-gray-100 flex items-center justify-center",children:s.jsx("p",{className:"text-gray-400",children:"No image available"})})}),r.price_id&&s.jsxs(j,{variant:"secondary",className:"absolute top-2 right-2 flex items-center gap-1",children:[s.jsx(e,{className:"h-3 w-3"})," Stripe"]})]}),s.jsxs(o,{className:"pb-2",children:[s.jsx(d,{children:r.name}),s.jsx(n,{className:"line-clamp-2",children:((s,e=60)=>s?s.length<=e?s:`${s.substring(0,e)}...`:"")(r.description||"")})]}),s.jsxs(m,{className:"mt-auto",children:[s.jsxs("p",{className:"text-2xl font-bold",children:["$",Number(r.price).toFixed(2)]}),s.jsx("p",{className:"text-sm text-gray-500",children:0===r.stock_level?"Out of Stock":r.stock_level<=10?`Only ${r.stock_level} left!`:"In Stock"})]}),s.jsxs(x,{className:"flex gap-2",children:[s.jsx(c,{className:"flex-1",disabled:0===r.stock_level,onClick:()=>{p(r)},children:"Add to Cart"}),s.jsx(a,{to:`/store/${r.id}`,children:s.jsxs(c,{variant:"outline",className:"flex items-center gap-1",children:[s.jsx(l,{className:"h-4 w-4"})," Details"]})})]})]},r.id)},u=()=>s.jsxs(i,{className:"flex flex-col",children:[s.jsx("div",{className:"bg-gray-200",children:s.jsx(h,{ratio:4/3,children:s.jsx(p,{className:"h-full w-full"})})}),s.jsxs(o,{className:"pb-2",children:[s.jsx(p,{className:"h-6 w-3/4 mb-2"}),s.jsx(p,{className:"h-4 w-full"})]}),s.jsxs(m,{className:"mt-auto",children:[s.jsx(p,{className:"h-8 w-1/3 mb-2"}),s.jsx(p,{className:"h-4 w-1/2"})]}),s.jsx(x,{children:s.jsx(p,{className:"h-10 w-full"})})]}),N=({products:e,isLoading:a})=>a?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:Array(4).fill(0).map(((e,a)=>s.jsx(u,{},a)))}):0===e.length?s.jsx("div",{className:"col-span-4 text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-500",children:"No products available at this time."})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:e.map((e=>s.jsx(g,{product:e},e.id)))}),f=()=>{const{products:e,isLoading:a,error:l,refetch:t}=r();return s.jsxs("div",{children:[s.jsx("section",{className:"bg-navy text-white py-16",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("h1",{className:"text-4xl md:text-6xl font-bold mb-6 text-center uppercase",children:["The ",s.jsx("span",{className:"text-brand-orange",children:"BrandJitsuâ¢"})," Store"]}),s.jsx("p",{className:"text-xl text-center max-w-2xl mx-auto",children:"Grab the book, get the workbook, and start moving your brand from 'meh' to memorable."})]})}),s.jsx("section",{className:"py-12 md:py-16",children:s.jsx("div",{className:"container mx-auto px-4",children:l?s.jsxs("div",{className:"text-center py-16",children:[s.jsx("p",{className:"text-lg text-gray-700 mb-4",children:"We couldn't load the store right now. Please try again."}),s.jsx(c,{onClick:()=>t(),children:"Retry"})]}):s.jsx(N,{products:e,isLoading:a})})})]})};export{f 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.