1import{r as c,W as O,j as e,b7 as D,ak as v,C as l,a as t,p as n,am as $,I as K,B as x,K as R,O as h,N as U,aa as W,S as Y}from"./index-tc5-nNLC.js";import{S as u,a as j,b as g,c as b,d as p}from"./select-Bsa-6vNv.js";import{S as f,e as w,d as y}from"./index-CA8G2zMx.js";import{C as N}from"./crown-BaX0qJx5.js";import{F as q}from"./filter-DmG6gd0Q.js";import{I as k}from"./instagram-1o4cdpgt.js";import{E as S}from"./eye-7YOw3q0i.js";import"./index-C-y5wYFI.js";import"./chevron-down-DOFZ7rzv.js";import"./chevron-up-1gTexUQn.js";function le(){const[d,C]=c.useState("all"),[m,P]=c.useState("all"),[o,T]=c.useState("all"),[r,F]=c.useState(!1),{data:a,isLoading:I}=O({queryKey:["/api/templates",{category:d!=="all"?d:void 0,platform:m!=="all"?m:void 0,style:o!=="all"?o:void 0,isPremium:r?"true":void 0}]}),_=[{value:"all",label:"All Categories"},{value:"itinerary_carousel",label:"Itinerary Carousels"},{value:"packing_list",label:"Packing Lists"},{value:"budget_breakdown",label:"Budget Breakdowns"},{value:"destination_comparison",label:"Destination Comparisons"},{value:"travel_tips",label:"Travel Tips"},{value:"food_guide",label:"Food Guides"},{value:"photo_dump",label:"Photo Dumps"}],A=[{value:"all",label:"All Platforms",icon:null},{value:"instagram",label:"Instagram",icon:k},{value:"tiktok",label:"TikTok",icon:f},{value:"youtube",label:"YouTube",icon:w},{value:"facebook",label:"Facebook",icon:y},{value:"multi",label:"Multi-Platform",icon:n}],L=[{value:"all",label:"All Styles"},{value:"minimalist",label:"Minimalist"},{value:"luxury",label:"Luxury"},{value:"adventure",label:"Adventure"},{value:"vintage",label:"Vintage"},{value:"modern",label:"Modern"},{value:"playful",label:"Playful"}],B=s=>{switch(s){case"instagram":return e.jsx(k,{className:"w-4 h-4"});case"tiktok":return e.jsx(f,{className:"w-4 h-4"});case"youtube":return e.jsx(w,{className:"w-4 h-4"});case"facebook":return e.jsx(y,{className:"w-4 h-4"});case"multi":return e.jsx(n,{className:"w-4 h-4"});default:return null}},V=s=>{switch(s){case"minimalist":return"bg-slate-600";case"luxury":return"bg-yellow-600";case"adventure":return"bg-orange-600";case"vintage":return"bg-amber-700";case"modern":return"bg-blue-600";case"playful":return"bg-pink-600";default:return"bg-gray-600"}};return e.jsx(D,{children:e.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl flex items-center justify-center",children:e.jsx(v,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-4xl font-bold text-white",children:"Template Library"}),e.jsx("p",{className:"text-gray-400",children:"Professional templates to create stunning travel content in minutes"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mt-6",children:[e.jsx(l,{className:"glass-card border-white/10",children:e.jsx(t,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Total Templates"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:(a==null?void 0:a.length)||0})]}),e.jsx(n,{className:"w-8 h-8 text-purple-400"})]})})}),e.jsx(l,{className:"glass-card border-white/10",children:e.jsx(t,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Premium"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:(a==null?void 0:a.filter(s=>s.isPremium).length)||0})]}),e.jsx(N,{className:"w-8 h-8 text-yellow-400"})]})})}),e.jsx(l,{className:"glass-card border-white/10",children:e.jsx(t,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"Most Popular"}),e.jsx("p",{className:"text-sm font-medium text-white",children:"Itinerary Carousels"})]}),e.jsx($,{className:"w-8 h-8 text-green-400"})]})})}),e.jsx(l,{className:"glass-card border-white/10",children:e.jsx(t,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-400",children:"New This Week"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:"3"})]}),e.jsx(K,{className:"w-8 h-8 text-blue-400"})]})})})]})]}),e.jsx(l,{className:"glass-card border-white/10 mb-6",children:e.jsxs(t,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(q,{className:"w-5 h-5 text-purple-400"}),e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Filters"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Category"}),e.jsxs(u,{value:d,onValueChange:C,children:[e.jsx(j,{className:"bg-slate-800 border-slate-700 text-white","data-testid":"filter-category",children:e.jsx(g,{placeholder:"Select category"})}),e.jsx(b,{className:"bg-slate-800 border-slate-700",children:_.map(s=>e.jsx(p,{value:s.value,className:"text-white",children:s.label},s.value))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Platform"}),e.jsxs(u,{value:m,onValueChange:P,children:[e.jsx(j,{className:"bg-slate-800 border-slate-700 text-white","data-testid":"filter-platform",children:e.jsx(g,{placeholder:"Select platform"})}),e.jsx(b,{className:"bg-slate-800 border-slate-700",children:A.map(s=>e.jsx(p,{value:s.value,className:"text-white",children:s.label},s.value))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Style"}),e.jsxs(u,{value:o,onValueChange:T,children:[e.jsx(j,{className:"bg-slate-800 border-slate-700 text-white","data-testid":"filter-style",children:e.jsx(g,{placeholder:"Select style"})}),e.jsx(b,{className:"bg-slate-800 border-slate-700",children:L.map(s=>e.jsx(p,{value:s.value,className:"text-white",children:s.label},s.value))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Access Level"}),e.jsx(x,{variant:r?"default":"outline",onClick:()=>F(!r),className:"w-full","data-testid":"filter-premium",children:r?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-4 h-4 mr-2"}),"Premium Only"]}):"All Templates"})]})]})]})}),I?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((s,i)=>e.jsx(l,{className:"glass-card border-white/10 animate-pulse",children:e.jsxs(t,{className:"p-6",children:[e.jsx("div",{className:"h-48 bg-slate-700 rounded-lg mb-4"}),e.jsx("div",{className:"h-4 bg-slate-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-slate-700 rounded w-1/2"})]})},i))}):a&&a.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:a.map(s=>{var i;return e.jsxs(l,{className:"glass-card border-white/10 hover:border-white/30 transition-all group","data-testid":`template-card-${s.id}`,children:[e.jsxs(R,{children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[B(s.platform),e.jsx(h,{className:V(s.style),children:s.style})]}),s.isPremium&&e.jsxs(h,{className:"bg-yellow-600 text-white",children:[e.jsx(N,{className:"w-3 h-3 mr-1"}),"Premium"]})]}),e.jsx(U,{className:"text-white text-lg",children:s.title}),e.jsx(W,{className:"text-gray-400 text-sm",children:s.description})]}),e.jsxs(t,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:(i=s.tags)==null?void 0:i.slice(0,3).map((E,M)=>e.jsx(h,{variant:"outline",className:"text-xs border-purple-500/30 text-purple-300",children:E},M))}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"w-4 h-4"}),e.jsxs("span",{children:[s.usageCount||0," uses"]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Y,{className:"w-4 h-4 text-yellow-400"}),e.jsx("span",{children:s.averageRating||"0.00"})]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(x,{variant:"outline",className:"flex-1 group-hover:border-purple-500 transition-colors","data-testid":`button-preview-${s.id}`,children:[e.jsx(S,{className:"w-4 h-4 mr-2"}),"Preview"]}),e.jsxs(x,{className:"flex-1 bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600","data-testid":`button-use-${s.id}`,children:[e.jsx(n,{className:"w-4 h-4 mr-2"}),"Use Template"]})]})]})]},s.id)})}):e.jsx(l,{className:"glass-card border-white/10",children:e.jsxs(t,{className:"p-12 text-center",children:[e.jsx(v,{className:"w-16 h-16 text-gray-500 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No templates found"}),e.jsx("p",{className:"text-gray-400",children:"Try adjusting your filters to
1see more templates."})]})})]})})}export{le 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.