PageSourceSearch

https://flex-lovable-landing-pages.lovable.app/lp/assets/MarketCarousel-CZGY_3Nc.js

js flex-lovable-landing-pages.lovable.app collected 2026-10-03 03:32:01 UTC 3,697 bytes, 1 lines download raw bytes

1import{aa as E,r as c,j as o}from"./index-BuZskSCt.js";const M=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],k=E("chevron-left",M);const $=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],P=E("chevron-right",$);function S({photos:n,captions:d,cardId:j,alt:L}){const[s,b]=c.useState(0),[p,r]=c.useState(!1),m=c.useRef(null);c.useEffect(()=>{if(p||n.length<=1||typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const e=window.setInterval(()=>{document.hidden||b(t=>(t+1)%n.length)},5200);return()=>window.clearInterval(e)},[p,n.length]);const i=c.useCallback(e=>b((e%n.length+n.length)%n.length),[n.length]);return c.useEffect(()=>{const e=m.current;if(!e||n.length<=1)return;let t=0,u=0,f=!1,l=null;const x=8,N=40,w=a=>{a.touches.length===1&&(f=!0,l=null,t=a.touches[0].clientX,u=a.touches[0].clientY,r(!0))},y=a=>{if(!f||a.touches.length!==1)return;const g=a.touches[0].clientX-t,h=a.touches[0].clientY-u;if(l===null){if(Math.abs(g)<x&&Math.abs(h)<x)return;l=Math.abs(g)>Math.abs(h)?"h":"v"}l==="h"&&a.preventDefault()},v=a=>{if(!f)return;const h=a.changedTouches[0].clientX-t;l==="h"&&Math.abs(h)>N&&(h<0?i(s+1):i(s-1)),f=!1,l=null,r(!1)};return e.addEventListener("touchstart",w,{passive:!0}),e.addEventListener("touchmove",y,{passive:!1}),e.addEventListener("touchend",v,{passive:!0}),e.addEventListener("touchcancel",v,{passive:!0}),()=>{e.removeEventListener("touchstart",w),e.removeEventListener("touchmove",y),e.removeEventListener("touchend",v),e.removeEventListener("touchcancel",v)}},[i,s,n.length]),o.jsxs("div",{ref:m,className:"group relative aspect-[16/9] overflow-hidden bg-neutral-100",style:{touchAction:"pan-y"},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),children:[n.map((e,t)=>o.jsx("img",{src:e,alt:t===s?`${L}${d[t]?` — ${d[t]}`:""}`:"",loading:t===0?"eager":"lazy",decoding:"async",fetchPriority:t===0?"high":"auto",width:1600,height:900,"aria-hidden":t!==s,draggable:!1,className:`absolute inset-0 h-full w-full select-none object-cover transition-opacity duration-500 ${t===s?"opacity-100":"opacity-0"}`},`${j}-${t}`)),d[s]&&o.jsx("span",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md bg-black/45 px-2 py-1 text-[11px] font-medium text-white/90 backdrop-blur-sm",children:d[s]}),n.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(s-1)},"aria-label":"Previous photo",className:"absolute left-3 top-1/2 z-20 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full bg-white/95 opacity-0 shadow-md transition group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#3A00E5]",children:o.jsx(k,{className:"h-4 w-4 text-neutral-900"})}),o.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),i(s+1)},"aria-label":"Next photo",className:"absolute right-3 top-1/2 z-20 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full bg-white/95 opacity-0 shadow-md transition group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#3A00E5]",children:o.jsx(P,{className:"h-4 w-4 text-neutral-900"})}),o.jsx("div",{className:"absolute bottom-3.5 right-3.5 z-20 flex gap-1.5",children:n.map((e,t)=>o.jsx("button",{type:"button","aria-label":`Show photo ${t+1}`,"aria-current":t===s,onClick:u=>{u.preventDefault(),u.stopPropagation(),i(t)},className:`h-2 w-2 rounded-full border border-white/30 transition ${t===s?"bg-white":"bg-white/40"} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#3A00E5]`},t))})]})]})}export{S as M};

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.