PageSourceSearch

https://comandogeek.com.br/assets/Index-CUCxneo_.js

js comandogeek.com.br collected 2026-10-05 20:07:45 UTC 11,515 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomeProductSections-Da-BsVy4.js","assets/index-C0deiITV.js","assets/index-Bse9Qln_.css","assets/dropdown-menu-DaW5vuhq.js","assets/arrow-left-yYjbKkOP.js","assets/check-CZw1JqxH.js","assets/mail-DKwSZPbq.js","assets/eye-D3dWQZVP.js","assets/user-C9dzg9DV.js","assets/ProductCard-tqHgSnfv.js","assets/types-3c7sL9OC.js","assets/use-swipe-Ds23DhH2.js","assets/interests-DaYEtGtB.js","assets/experiment-COcu7zGU.js","assets/HomeBlogSection-FU_gc5tZ.js","assets/card-BKJrXS9Y.js","assets/badge-DRx8zKZ9.js","assets/blogImage-CA-uXziI.js","assets/Footer-DIFGMFkr.js"])))=>i.map(i=>d[i]);
2import{r as t,j as e,L as j,A as T,_ as w,s as u}from"./index-C0deiITV.js";import{u as I,C as E,a as z,L as b}from"./dropdown-menu-DaW5vuhq.js";import{N as q}from"./Navbar-CtXUytX6.js";import A from"./QuickAccessCards-D7xgzYbI.js";import{u as P}from"./use-swipe-Ds23DhH2.js";import"./arrow-left-yYjbKkOP.js";import"./check-CZw1JqxH.js";import"./mail-DKwSZPbq.js";import"./eye-D3dWQZVP.js";import"./user-C9dzg9DV.js";import"./use-mobile-B7GhMO31.js";const O=t.lazy(()=>w(()=>import("./HomeProductSections-Da-BsVy4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),M=t.lazy(()=>w(()=>import("./HomeBlogSection-FU_gc5tZ.js"),__vite__mapDeps([14,1,2,15,16,17,3,4,5,6,7,8]))),F=t.lazy(()=>w(()=>import("./Footer-DIFGMFkr.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]))),R=l=>{if(!l.image_url)return"";const n=l.image_url.includes("?")?"&":"?";return`${l.image_url}${n}v=${encodeURIComponent(l.updated_at??l.id)}`};function Z(){const[l,n]=t.useState(0),d=t.useRef(null),x=t.useRef(null),{data:i}=I({queryKey:["home-shell-data"],queryFn:async()=>{const[s,r,a]=await Promise.all([u.from("categories").select("id, name, slug, icon").eq("show_in_homepage",!0).order("sort_order",{ascending:!0}),u.from("subcategories").select("id, category_id, name, slug, icon, sort_order").eq("is_active",!0).order("sort_order",{ascending:!0}),u.from("trust_items").select("*").eq("is_active",!0).order("sort_order",{ascending:!0})]);return{categories:s.data??[],subcategories:r.data??[],trustItems:a.data??[]}},staleTime:1e3*60*10}),{data:c=[],refetch:f}=I({queryKey:["home-banners"],queryFn:async()=>{const{data:s,error:r}=await u.from("home_banners").select("*").eq("is_active",!0).order("sort_order",{ascending:!0});if(r)throw r;return s??[]},staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!0}),h=(i==null?void 0:i.categories)??[],L=(i==null?void 0:i.subcategories)??[],p=(i==null?void 0:i.trustItems)??[];t.useEffect(()=>{const s=typeof BroadcastChannel<"u"?new BroadcastChannel("home-banners"):null,r=()=>{f()};s==null||s.addEventListener("message",r);const a=$=>{$.key==="home-banners-refresh"&&f()};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a),s==null||s.close()}},[f]);const[g,y]=t.useState(()=>typeof window<"u"&&window.innerWidth<768);t.useEffect(()=>{const s=window.matchMedia("(max-width: 767px)"),r=a=>y(a.matches);return y(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[]);const m=g?1:2,o=Math.max(0,c.length-m);t.useEffect(()=>{n(s=>Math.min(s,o))},[o]),t.useEffect(()=>{if(!(o<=0))return d.current=setInterval(()=>n(s=>s>=o?0:s+1),5e3),()=>{d.current&&clearInterval(d.current)}},[c.length,o,m]);const v=()=>{d.current&&clearInterval(d.current)},N=()=>{v(),n(s=>s<=0?o:s-1)},_=()=>{v(),n(s=>s>=o?0:s+1)},{dragOffset:k,containerRef:S,...B}=P({onSwipeLeft:_,onSwipeRight:N}),C=l*(100/m);return e.jsxs("div",{className:"min-h-screen bg-[#f4f4f8]",children:[e.jsx(q,{}),c.length>0&&e.jsx("section",{className:"bg-white py-3",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:N,className:"flex-shrink-0 w-9 h-9 rounded-full bg-white border border-gray-200 shadow-md hover:shadow-lg hover:border-purple-300 flex items-center justify-center transition-all",children:e.jsx(E,{size:18,className:"text-gray-600"})}),e.jsx("div",{ref:S,className:"flex-1 overflow-hidden rounded-2xl select-none",...B,onDragStart:s=>s.preventDefault(),style:{cursor:"grab",touchAction:"pan-y"},children:e.jsx("div",{className:"flex transition-transform duration-500 ease-in-out",style:{transform:`translateX(calc(-${C}% + ${k}
2px))`,transition:k!==0?"none":"transform 0.5s ease-in-out"},children:c.map((s,r)=>e.jsx("div",{className:"flex-shrink-0 px-1.5",style:{width:g?"100%":"50%"},children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gray-900 w-full",style:{height:g?180:220,backgroundImage:`url(${R(s)})`,backgroundSize:"cover",backgroundPosition:"center"},children:[e.jsx("img",{src:R(s),alt:s.title,className:"absolute inset-0 w-full h-full object-cover",loading:r<2?"eager":"lazy",...r<2?{fetchpriority:"high"}:{},decoding:"async",onError:a=>{a.currentTarget.style.display="none"}}),e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.12) 55%, transparent 100%)"}}),e.jsxs("div",{className:"absolute inset-0 flex flex-col justify-center pl-7 pr-4 z-10",children:[s.label&&e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest mb-1.5 inline-block",style:{color:s.accent_color??"#7b2ff7"},children:s.label}),e.jsx("h2",{className:"text-white font-black text-xl leading-tight drop-shadow mb-1",children:s.title}),s.subtitle&&e.jsx("p",{className:"text-white/80 text-sm mb-3 leading-snug line-clamp-2",children:s.subtitle}),s.cta_text&&s.cta_href&&e.jsxs(j,{to:s.cta_href,className:"inline-flex items-center gap-1.5 text-white text-xs font-bold px-4 py-2 rounded-full w-fit transition-opacity hover:opacity-90",style:{background:s.accent_color??"#7b2ff7"},children:[s.cta_text," ",e.jsx(T,{size:13})]})]})]})},s.id))})}),e.jsx("button",{onClick:_,className:"flex-shrink-0 w-9 h-9 rounded-full bg-white border border-gray-200 shadow-md hover:shadow-lg hover:border-purple-300 flex items-center justify-center transition-all",children:e.jsx(z,{size:18,className:"text-gray-600"})})]}),c.length>m&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 mt-3",children:Array.from({length:c.length-m+1}).map((s,r)=>e.jsx("button",{onClick:()=>{n(r),v()},className:"rounded-full transition-all",style:{width:r===l?"20px":"6px",height:"6px",background:r===l?"#7b2ff7":"#d1d5db"}},r))})]})}),e.jsx(A,{}),p.length>0&&e.jsx("section",{className:"hidden md:block bg-white border-b border-gray-100 shadow-sm",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4",children:e.jsx("div",{className:"divide-x divide-gray-100",style:{display:"grid",gridTemplateColumns:`repeat(${p.length}, 1fr)`},children:p.map(s=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-4",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:s.color+"18"},children:e.jsx(b,{name:s.icon,size:20,color:s.color})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[13px] font-bold text-gray-800 leading-tight",children:s.title}),s.description&&e.jsx("p",{className:"text-[11px] text-gray-500",children:s.description})]})]},s.id))})})}),h.length>0&&e.jsx("section",{className:"bg-white border-b border-gray-100",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 py-5",children:e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>{var s;return(s=x.current)==null?void 0:s.scrollBy({left:-300,behavior:"smooth"})},className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full bg-white border border-gray-200 shadow-md flex items-center justify-center text-gray-500 hover:text-purple-700 hover:border-purple-300 transition-all -ml-2",children:e.jsx(E,{size:16})}),e.jsxs("div",{ref:x,className:"flex gap-5 overflow-x-auto scrollbar-hide px-8 py-2",style:{scrollbarWidth:"none"},children:[h.map(s=>e.jsxs(j,{to:`/produtos?categoria=${s.slug}`,className:"flex flex-col items-center gap-1.5 flex-shrink-0 group",children:[e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center transition-all duration-200 group-hover:scale-110 group-hover:shadow-lg border-2 border-transparent group-hover:border-purple-200",style:{background:"linear-gradient(135deg,#f3f0ff,#e9e3fc)"},children:e.jsx(b,{name:s.icon||"Tag",size:24,className:"text-primary"})}),e.jsx("span",{className:"text-[11px] font-semibold text-gray-700 text-center whitespace-nowrap group-hover:text-purple-700 transition-colors max-w-[72px] truncate",children:s.name})]},`cat-${s.id}`)),L.map(s=>{const r=h.find(a=>a.id===s.category_id);return e.jsxs(j,{to:`/produtos?categoria=${(r==null?void 0:r.slug)??""}&sub=${s.slug}`,className:"flex flex-col items-center gap-1.5 flex-shrink-0 group",children:[e.jsx("div",{className:"w-14 h-14 roun
2ded-full flex items-center justify-center transition-all duration-200 group-hover:scale-110 group-hover:shadow-lg border-2 border-transparent group-hover:border-purple-200",style:{background:"linear-gradient(135deg,#f3f0ff,#e9e3fc)"},children:e.jsx(b,{name:s.icon||"Tag",size:22,className:"text-primary/80"})}),e.jsx("span",{className:"text-[11px] font-semibold text-gray-600 text-center whitespace-nowrap group-hover:text-purple-700 transition-colors max-w-[72px] truncate",children:s.name})]},`sub-${s.id}`)})]}),e.jsx("button",{onClick:()=>{var s;return(s=x.current)==null?void 0:s.scrollBy({left:300,behavior:"smooth"})},className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 w-8 h-8 rounded-full bg-white border border-gray-200 shadow-md flex items-center justify-center text-gray-500 hover:text-purple-700 hover:border-purple-300 transition-all -mr-2",children:e.jsx(z,{size:16})})]})})}),e.jsx(t.Suspense,{fallback:e.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[[0,1,2].map(s=>e.jsxs("div",{className:"py-10",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-1 h-6 rounded-full shimmer"}),e.jsx("div",{className:"w-5 h-5 rounded-full shimmer"}),e.jsx("div",{className:"h-5 w-40 shimmer rounded-lg"})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-5 overflow-hidden",children:[e.jsx("div",{className:"w-7 h-7 rounded-full shimmer flex-shrink-0"}),e.jsx("div",{className:"flex gap-2 flex-1",children:[0,1,2,3,4].map(r=>e.jsx("div",{className:"h-7 w-20 shimmer rounded-full flex-shrink-0"},r))}),e.jsx("div",{className:"w-7 h-7 rounded-full shimmer flex-shrink-0"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4",children:[0,1,2,3].map(r=>e.jsxs("div",{className:"rounded-xl bg-white border border-gray-100 overflow-hidden",children:[e.jsx("div",{className:"aspect-square shimmer"}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsx("div",{className:"h-3 shimmer rounded-lg w-3/4"}),e.jsx("div",{className:"h-3 shimmer rounded-lg w-1/2"}),e.jsx("div",{className:"h-8 shimmer rounded-xl"})]})]},r))}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-5",children:[e.jsx("div",{className:"w-6 h-2 shimmer rounded-full"}),e.jsx("div",{className:"w-2 h-2 shimmer rounded-full"}),e.jsx("div",{className:"w-2 h-2 shimmer rounded-full"})]})]},s)),e.jsx("div",{className:"pb-12",children:e.jsx("div",{className:"rounded-3xl h-64 md:h-80 shimmer"})})]}),children:e.jsx(O,{categories:h})}),e.jsx(t.Suspense,{fallback:e.jsx("div",{className:"h-32"}),children:e.jsx(M,{})}),e.jsx(t.Suspense,{fallback:e.jsx("div",{className:"h-32"}),children:e.jsx(F,{})})]})}export{Z 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.