1import{c as j,r as p,d as q,f as E,w as Q,b as t,t as c,u as o,o as r,a as l,k as d,p as U,q as $,s as A,v as G,n as T,F as z,i as V}from"./inertia-C4NloYwc.js";import{_ as P}from"./AppLayout.vue_vue_type_script_setup_true_lang-BPPWMOnY.js";/* empty css *//* empty css */import"./_commonjsHelpers-CmZmv3Qo.js";import"./index-BvSoWoVY.js";function R(i={}){const u=i.locale||"it",k=s=>s?typeof s=="string"?s:s[u]||s.it||Object.values(s)[0]||"":"",C=j(()=>k(i.page?.title)),M=j(()=>k(i.page?.description)),B=j(()=>k(i.page?.content)),S=j(()=>C.value),L=j(()=>M.value),_=!!(i.news&&i.news.data),h=p(_?i.news.data||[]:i.news||[]),f=p([]),b=p(_?i.news:null);function x(s){return s?typeof s=="string"?s:s[u]||s.it||Object.values(s)[0]||"":""}function m(s){const n={...s};return n.title=x(s.title),n.excerpt_or_description=x(s.excerpt_or_description),s.category&&typeof s.category=="object"?n.category=x(s.category.name||s.category):n.category=s.category||null,n}const N=p(h.value.map(m));f.value=N.value.slice();const D=p(i.featuredNews||[]),F=p(i.categories||[]),v=p(""),y=p(null),H=p(!1);function a(s){if(!s)return"";try{return new Date(s).toLocaleDateString()}catch{return String(s)}}function e(s){return s?`/storage/${s}`:""}function g(s,n=120){return s?s.length>n?s.slice(0,n).trim()+"â¦":s:""}function I(){const s=v.value.trim().toLowerCase();let n=h.value||[];s&&(n=n.filter(w=>(w.title||"").toLowerCase().includes(s)||(w.excerpt_or_description||"").toLowerCase().includes(s))),y.value&&(n=n.filter(w=>w.category===y.value)),H.value&&(n=n.filter(w=>w.featured)),f.value=n}function O(){v.value="",y.value=null,H.value=!1,f.value=h.value.slice()}return{title:C,description:M,content:B,metaTitle:S,metaDescription:L,news:f,featuredNews:D,categories:F,searchQuery:v,activeCategory:y,showOnlyFeatured:H,onSearch:I,clearFilters:O,formatDate:a,getImageUrl:e,limit:g,pagination:b}}const J={class:"news"},K={class:"content"},W={class:"container page-container mx-auto px-4 py-8"},X={class:"text-center mb-12"},Y={class:"text-4xl font-bold mb-4 text-black"},Z={key:0,class:"text-xl text-gray-600 max-w-2xl mx-auto"},ee={class:"mb-8"},te={class:"flex flex-col md:flex-row gap-4 justify-between items-center"},se={class:"w-full md:w-auto"},oe={class:"flex gap-2 items-center"},re={key:0,class:"news-gallery-grid",id:"newsGrid"},le={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},ae=["data-category"],ne={key:0,class:"absolute top-4 left-4 z-10"},ie={key:1,class:"h-48 relative"},ce=["src","alt"],de={key:2,class:"h-48 bg-gradient-to-br from-blue-500 to-purple-600 relative"},ue={class:"p-6 flex flex-col gap-4"},ge={class:"flex items-center justify-between text-sm text-gray-600"},pe={key:0,class:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs font-medium"},fe={class:"text-lg font-semibold mb-3 hover:text-blue-600 transition-colors"},xe=["href"],ye={key:0,class:"text-gray-600 text-sm leading-relaxed"},he={key:1,class:"flex flex-wrap gap-1"},_e=["href"],be={class:"flex justify-center"},me={key:0,class:"inline-flex rounded-md shadow"},ve=["href","innerHTML"],we={key:1,class:"text-center py-12"},ke={key:2,class:"featured-news mb-12"},Ce={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Ne={key:0,class:"aspect-video"},je=["src","alt"],ze={class:"p-4"},Ve={class:"flex items-center gap-2 text-sm text-gray-600 mb-2"},Me={key:0,class:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs"},Le={class:"text-lg font-semibold text-gray-900 mb-2"},De=["href"],Fe={key:0,class:"text-gray-600 text-sm leading-relaxed"},He={key:3,class:"mb-8"},Te={class:"flex flex-wrap gap-2 justify-center"},Be=["onClick"],Qe=q({__name:"News",props:{news:{},years:{},featuredNews:{},categories:{},page:{},locale:{}},setup(i){const u=i,{title:k,description:C,content:M,metaTitle:B,metaDescription:S,news:L,featuredNews:_,categories:h,searchQuery:f,activeCategory:b,showOnlyFeatured:x,onSearch:m,clearFilters:N,formatDate:D,getImageUrl:F,limit:v,pagination:y}=R({page:u.page,news:u.news,featuredNews:u.featuredNews,categories:u.categories,locale:u.locale});return(H,a)=>(r(),E(P,{page:{title:o(B),description:o(S),content:o(M),banner:!1,locale:u.locale}},{default:Q(()=>[t("div",J,[t("main",K,[t("div",W,[t("div",X,[t("h1",Y,c(o(k)),1),o(C)?(r(),l("p",Z,c(o(C)),1)):d("",!0)]),t("div",ee,[t("div",te,[t("div",se,[t("form",{onSubmit:a[1]||(a[1]=U((...e)=>o(m)&&o(m)(...e),["prevent"])),class:"flex gap-2"},[$(t("input",{"onUpdate:modelValue":a[0]||(a[0]=e=>A(f)?f.value=e:null),type:"text",placeholder:"Cerca nelle news...",class:"flex-1 md:w-64 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"},null,512),[[G,o(f)]]),a[5]||(a[5]=t("button",{type:"submit",class:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"},"Cerca",-1))],32)]),t("div",oe,[a[6]||(a[6]=t("span",{class:"text-sm text-gray-600"},"Filtra per:",-1)),t("button",{onClick:a[2]||(a[2]=(...e)=>o(N)&&o(N)(...e)),class:T(["px-3 py-1 text-sm rounded-full",!o(b)&&!o(x)?"bg-blue-600 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},"Tutte",2),t("button",{onClick:a[3]||(a[3]=()=>{x.value=!o(x),o(m)()}),class:T(["px-3 py-1 text-sm rounded-full",o(x)?"bg-yellow-500 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"])},"â In evidenza",2)])])]),o(L).length>0?(r(),l("div",re,[t("div",le,[(r(!0),l(z,null,V(o(L),(e,g)=>(r(),l("article",{key:e.id||g,class:"news-card bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300","data-category":e.category||""},[e.featured?(r(),l("div",ne,[...a[7]||(a[7]=[t("span",{class:"bg-yellow-500 text-white text-xs font-bold px-2 py-1 rounded-full"},"â In evidenza",-1)])])):d("",!0),e.excerpt_image?(r(),l("div",ie,[t("img",{src:o(F)(e.excerpt_image),alt:e.title,class:"w-full h-full object-cover",loading:"lazy"},null,8,ce)])):(r(),l("div",de,[...a[8]||(a[8]=[t("div",{class:"absolute inset-0 flex items-center justify-center"},[t("svg",{class:"w-12 h-12 text-white opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})])],-1)])])),t("div",ue,[t("div",ge,[e.category?(r(),l("span",pe,c(e.category),1)):d("",!0),t("time",null,c(o(D)(e.published_at)),1)]),t("h6",fe,[t("a",{href:e.url||"/news/"+e.slug,class:"text-black"},c(e.title),9,xe)]),e.description?(r(),l("p",ye,c(o(v)(e.description,120)),1)):d("",!0),e.tags_array&&e.tags_array.length?(r(),l("div",he,[(r(!0),l(z,null,V(e.tags_array.slice(0,3),(I,O)=>(r(),l("span",{key:O,class:"bg-gray-100 text-gray-600 px-2 py-1 rounded text-xs"},c(I),1))),128))])):d("",!0),t("a",{href:e.url||"/news/"+e.slug,class:"text-blue-600 hover:text-blue-800 font-medium text-sm transition-colors"},"Leggi di più â",8,_e)])],8,ae))),128))]),t("div",be,[o(y)&&o(y).links?(r(),l("nav",me,[(r(!0),l(z,null,V(o(y).links,(e,g)=>(r(),l("a",{key:g,href:e.url||"javascript:void(0)",class:T(["px-3 py-2 border text-sm",e.active?"bg-blue-600 text-white":"bg-white text-gray-700"]),innerHTML:e.label},null,10,ve))),128))])):d("",!0)])])):(r(),l("div",we,[...a[9]||(a[9]=[t("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"})],-1),t("h3",{class:"mt-2 text-sm font-medium text-gray-900"},"Nessuna news disponibile",-1),t("p",{class:"mt-1 text-sm text-gray-500"},"Non ci sono ancora news pubblicate. Torna a trovarci presto!",-1)])])),o(_)&&o(_).length>0?(r(),l("section",ke,[a[10]||(a[10]=t("h2",{class:"text-2xl font-bold text-gray-900 mb-6 text-center"},"News in Evidenza",-1)),t("div",Ce,[(r(!0),l(z,null,V(o(_),(e,g)=>(r(),l("article",{key:e.id||g,class:"bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow"},[e.excerpt_image?(r(),l("div",Ne,[t("img",{src:o(F)(e.excerpt_image),alt:e.title,class:"w-full h-full object-cover",loading:"lazy"},null,8,je)])):d("",!0),t("div",ze,[t("div",Ve,[e.category?(r(),l("span",Me,c(e.category),1)):d("",!0),t("time",null,c(o(D)(e.published_at)),1)]),t("h3",Le,[t("a",{href:e.url||"/news/"+e.slug,class:"hover:text-blue-600 transition-colors"},c(e.title),9,De)]),e.description?(r(),l("p",Fe,c(o(v)(e.description,120)),1)):d("",!0)])]))),128))])])):d("",!0),o(h)&&o(h).length>0?(r(),l("div",He,[t("div",Te,[t("button",{onClick:a[4]||(a[4]=U(()=>{b.value=null,o(N)()},["prevent"])),class:T(["category-filter px-4 py-2 rounded-full text-sm font-medium",o(b)?"bg-gray-200 text-gray-700 hover:bg-gray-300":"bg-blue-600 text-white"])},"Tutte le News",2),(r(!0),l(z,null,V(o(h),(e,g)=>(r(),l("button",{key:g,onClick:U(()=>{b.value=e,o(m)()},["prevent"]),class:"category-filter px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-gray-300 text-sm font-medium transition-colors"},c(e.charAt(0).toUpperCase()+e.slice(1)),9,Be))),128))])])):d("",!0)])])])]),_:1},8,["page"]))}});
1export{Qe 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.