1import{j as e,d as n,P as o,B as d,aq as u,bc as p,bd as g,ao as j,a as f,bD as b,r as m,S as c,s as N,b1 as v,b2 as w,b3 as y,b4 as k}from"./index-DPD08fmB.js";import{A as C}from"./aspect-ratio-Cojdj9Ce.js";import{c as V}from"./cdn-image-lYML7jRR.js";import"./purify.es-D6gMnemd.js";import"./CTABlock-D_pqh6gj.js";import"./accordion-DQY27T9j.js";import"./cms-url-Dtu2A4mR.js";import"./arrow-right-B63gF5sE.js";function P(s){if(s===null)return"";const l=Math.floor(s/60),i=s%60;return`${l}:${i.toString().padStart(2,"0")}`}function E(s){switch(s.toUpperCase()){case"YOUTUBE":return{label:"YouTube",variant:"default"};case"VIMEO":return{label:"Vimeo",variant:"secondary"};default:return{label:"Video",variant:"outline"}}}function B({video:s,onClick:l}){const i=E(s.videoProvider),a=P(s.durationSeconds),t=()=>{l&&l(s)};return e.jsx("div",{onClick:t,className:f("group",l&&"cursor-pointer"),children:e.jsxs(n,{className:"h-full overflow-hidden transition-all hover:shadow-lg hover:scale-[1.02]",children:[e.jsxs("div",{className:"relative min-h-[120px]",children:[e.jsxs(C,{ratio:16/9,children:[s.thumbnailUrl?e.jsx("img",{src:s.thumbnailUrl,alt:V(s.title,"Video kapak görseli"),className:"object-cover w-full h-full",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:e.jsx(o,{className:"w-12 h-12 text-muted-foreground"})}),e.jsx("div",{className:"absolute inset-0 bg-black/30 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-white/90 flex items-center justify-center",children:e.jsx(o,{className:"w-8 h-8 text-primary fill-current ml-1"})})})]}),a&&e.jsx("div",{className:"absolute bottom-2 right-2",children:e.jsxs(d,{variant:"secondary",className:"gap-1 bg-black/70 text-white border-0",children:[e.jsx(u,{className:"w-3 h-3"}),a]})}),e.jsx("div",{className:"absolute top-2 left-2",children:e.jsx(d,{variant:i.variant,children:i.label})})]}),e.jsx(p,{children:e.jsx(g,{className:"text-xl line-clamp-2 group-hover:text-primary transition-colors",children:s.title})}),s.description&&e.jsx(j,{children:e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:s.description})})]})})}function S(s,l){if(!l)return s;const i=l.toUpperCase();if(i==="YOUTUBE"){const a=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,t=s.match(a);if(t&&t[1])return`https://www.youtube.com/embed/${t[1]}`}if(i==="VIMEO"){const a=/vimeo\.com\/(?:video\/)?(\d+)/,t=s.match(a);if(t&&t[1])return`https://player.vimeo.com/video/${t[1]}`}return s}function z(){const{data:s,isLoading:l,error:i}=b(),[a,t]=m.useState(null);m.useEffect(()=>{document.title="Video Blog | Oniki"},[]);const x=r=>{t(r)},h=()=>{t(null)};return l?e.jsxs("div",{className:"min-h-screen",children:[e.jsx("section",{className:"bg-primary-dark pt-12 pb-16",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4",children:[e.jsx(c,{className:"h-12 w-48 mb-4 bg-white/10"}),e.jsx(c,{className:"h-6 w-96 bg-white/10"})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 py-12",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(r=>e.jsxs(n,{className:"overflow-hidden",children:[e.jsx(c,{className:"w-full h-48"}),e.jsxs("div",{className:"p-6 space-y-3",children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-full"}),e.jsx(c,{className:"h-4 w-2/3"})]})]},r))})})]}):i?e.jsx("div",{className:"min-h-screen",children:e.jsx("div",{className:"container mx-auto px-4 py-16",children:e.jsxs(n,{className:"max-w-2xl mx-auto border-destructive/50 p-12 text-center",children:[e.jsx(N,{className:"w-16 h-16 mx-auto mb-4 text-destructive"}),e.jsx("h2",{className:"text-2xl font-bold text-destructive mb-2",children:"Failed to Load Videos"}),e.jsx("p",{className:"text-muted-foreground",children:"Unable to load videos at this time. Please try again later."})]})})}):!s||s.length===0?e.jsxs("div",{className:"min-h-screen",children:[e.jsx("section",{className:"bg-primary-dark pt-12 pb-16",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4",children:[e.jsx("h1",{className:"font-display text-4xl lg:text-5xl font-extrabold text-white leading-snug lg:leading-tight mb-3",children:"Video Blog"}),e.jsx("p",{className:"text-lg text-white/80",children:"Etkinliklerimizden öne çıkan anlar ve kayıtlar"})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 py-12",children:e.jsxs(n,{className:"p-12 text-center",children:[e.jsx(o,{className:"w-16 h-16 mx-auto mb-4 text-muted-foreground opacity-50"}),e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"No Videos Available"}),e.jsx("p",{className:"text-muted-foreground",children:"Check back soon for new video content!"})]})})]}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx("section",{className:"bg-primary-dark pt-12 pb-16",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4",children:[e.jsx("h1",{className:"font-display text-4xl lg:text-5xl font-extrabold text-white leading-snug lg:leading-tight mb-3",children:"Video Blog"}),e.jsx("p",{className:"text-lg text-white/80",children:"Etkinliklerimizden öne çıkan anlar ve kayıtlar"})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 py-12",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map(r=>e.jsx(B,{video:r,onClick:x},r.id))})}),e.jsx(v,{open:a!==null,onOpenChange:h,children:e.jsxs(w,{className:"max-w-4xl",children:[e.jsx(y,{children:e.jsx(k,{children:a==null?void 0:a.title})}),a&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"relative w-full",style:{paddingBottom:"56.25%"},children:e.jsx("iframe",{src:S(a.videoUrl,a.videoProvider),title:a.title,className:"absolute top-0 left-0 w-full h-full rounded-lg",allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"})}),a.description&&e.jsx("div",{className:"pt-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})})]})]})})]})}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.