1import{Q as M,bq as R,br as q,bu as H,b5 as O,ax as V,az as W,H as c,A as u,N as g,aS as f,aZ as J,B as C,E as m,h as Q,aL as Z,as as G,au as K,bm as X,aI as b,y as A,bc as L,p as Y,bo as ee,aA as n,l as te,bD as oe,_ as se,o as re}from"./BPQrZ1XS.js";import{_ as ne}from"./CMm4qzsM.js";import{_ as ae,a as le}from"./CLhVxpSs.js";import"./6YqUFUZu.js";const ce={class:"max-w-3xl mx-auto w-full py-8 px-4"},ie={key:0},ue={class:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg"},de={class:"flex items-center"},pe={class:"font-serif text-4xl mb-4"},me={class:"flex items-center justify-between mb-6"},ve={key:0,class:"text-gray-500"},_e={key:1,class:"text-gray-500"},fe={key:0,class:"flex flex-wrap gap-2 mb-4"},ge={key:1,class:"mb-6"},be={class:"w-full rounded overflow-hidden bg-gray-100 aspect-[2/1]"},ye=["src"],he={key:0,class:"mt-2 text-sm text-gray-500 italic"},xe={class:"space-y-2"},we={class:"font-semibold text-gray-900"},ke={key:0,class:"text-sm text-gray-600 line-clamp-3"},Se={key:0,class:"pt-2 border-t border-gray-100 space-y-1"},Ce={key:0,class:"text-xs text-gray-500"},Ae={key:1,class:"text-xs text-gray-500"},Le={key:1,class:"text-center py-20"},Be={key:2,class:"text-center py-20"},Te=M({__name:"[id]",setup(je){R();const h=q(),B=X();ee(),H();const T=String(B.params.id),o=b(null),x=b(!0),s=b(null),w=b({x:0,y:0}),y=b(null);let i=null;const j=A(()=>!h.value||!o.value?!1:o.value.author_id===h.value.id),k=t=>new Date(t).toLocaleDateString(),E=A(()=>{if(!o.value)return"object-center";switch(o.value.cover_crop){case"top":return"object-top";case"bottom":return"object-bottom";default:return"object-center"}}),$=()=>{s.value&&s.value.url&&(window.open(s.value.url,"_blank","noopener,noreferrer"),s.value=null)},D=()=>{i&&(clearTimeout(i),i=null),s.value=null},N=t=>{const e=t.target;if(e.classList.contains("source-mark")||e.closest(".source-mark")){t.preventDefault();const a=e.classList.contains("source-mark")?e:e.closest(".source-mark");if(a){const r=a.getAttribute("data-source-data");if(r)try{const l=JSON.parse(r);l.url&&window.open(l.url,"_blank","noopener,noreferrer")}catch(l){console.warn("Failed to parse source data:",l)}}return}if(e.classList.contains("citation-ref")){t.preventDefault();const a=e.getAttribute("data-source-id");if(a){const r=document.querySelector(`[data-source-id="${a}"]`);if(r){r.scrollIntoView({behavior:"smooth",block:"center"});const l=r.style.backgroundColor;r.style.backgroundColor="#fef3c7",r.style.transition="background-color 2s ease-out",setTimeout(()=>{r.style.backgroundColor=l},2e3)}}}},P=t=>{const e=t.target;if(e.classList.contains("source-mark")||e.closest(".source-mark")){const a=e.classList.contains("source-mark")?e:e.closest(".source-mark");a&&(i&&clearTimeout(i),i=setTimeout(()=>{const r=a.getAttribute("data-source-data");if(r)try{const l=JSON.parse(r);s.value=l;const d=a.getBoundingClientRect(),v=320;let _=d.left+d.width/2-v/2,p=d.bottom+8;_<10&&(_=10),_>window.innerWidth-v&&(_=window.innerWidth-v),p+200>window.innerHeight&&(p=d.top-200-8),w.value={x:_,y:p}}catch(l){console.warn("Failed to parse source data:",l)}},200))}},U=t=>{t.target;const e=t.relatedTarget;e&&(e.closest(".source-mark")||e===y.value||y.value?.contains(e))||(i&&(clearTimeout(i),i=null),setTimeout(()=>{y.value?.matches(":hover")||(s.value=null)},50))},{getArticleByIdForPreview:z}=O(),I=async()=>{try{x.value=!0;const t=await z(T);if(!t){o.value=null;return}o.value=t,F(t)}catch(t){console.error("Error loading article:",t),o.value=null}finally{x.value=!1}},F=t=>{const e=`${t.title} - Aperçu | Sursaut!`,a=t.description||`Aperçu de "${t.title}" sur Sursaut!, le journal des luttes de Bordeaux.`,r=t.categories?.map(v=>v.name).join(", ")||"",l=t.cover||"https://sursaut-revue.fr/icon-512x512.png",d=`https://sursaut-revue.fr/preview/${t.id}`;L({title:e,meta:[{name:"description",content:a},{name:"keywords",content:`${r}, Bordeaux, luttes sociales, politique, journal, aperçu`},{name:"author",content:"Sursaut!"},{property:"og:title",content:e},{property:"og:description",content:a},{property:"og:image",content:l},{property:"og:url",content:d},{property:"og:type",content:"article"},{property:"og:site_name",content:"Sursaut!"},{property:"og:locale",content:"fr_FR"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:e},{name:"twitter:description",content:a},{name:"twitter:image",content:l},{name:"robots",content:"noindex, nofollow"}]}),L({link:[{rel:"canonical",href:d}],meta:[{name:"robots",content:"noindex, nofollow"}]})},S=()=>{s.value&&(i&&(clearTimeout(i),i=null),s.value=null)};return V(()=>{I(),window.addEventListener("scroll",S,{passive:!0})}),W(()=>{window.removeEventListener("scroll",S),i&&clearTimeout(i)}),(t,e)=>{const a=te,r=Y,l=ne,d=se,v=ae,_=le;return n(),c("div",ce,[o.value?(n(),c("div",ie,[u("div",ue,[u("div",de,[g(a,{name:"mingcute:eye-line",class:"w-5 h-5 text-amber-600 mr-2"}),e[0]||(e[0]=u("span",{class:"text-amber-800 font-medium"},"Aperçu de l'article",-1))]),e[1]||(e[1]=u("p",{class:"text-amber-700 text-sm mt-1"}," Cet article est en cours de rédaction et n'est pas encore publié. ",-1))]),u("h1",pe,f(o.value.title),
11),u("div",me,[o.value.published_at?(n(),c("p",ve,f(k(o.value.published_at)),1)):(n(),c("p",_e,"Brouillon")),J(h)&&j.value?(n(),C(r,{key:2,label:"Modifier l'article",icon:"i-mingcute-edit-line",color:"primary",variant:"outline",size:"sm",to:`/internal/articles/${o.value.id}`},null,8,["to"])):m("",!0)]),o.value.categories&&o.value.categories.length?(n(),c("div",fe,[(n(!0),c(Q,null,Z(o.value.categories,p=>(n(),C(d,{key:p.name,to:`/category/${p.name.toLowerCase().replace(/\s+/g,"-")}`,class:"hover:opacity-80 transition-opacity"},{default:oe(()=>[g(l,{color:"secondary",label:p.name,icon:p.icon?"mingcute:"+p.icon:void 0},null,8,["label","icon"])]),_:2},1032,["to"]))),128))])):m("",!0),o.value.cover?(n(),c("div",ge,[u("div",be,[u("img",{src:o.value.cover,alt:"Cover",class:G(["w-full h-full object-cover",E.value])},null,10,ye)]),o.value.cover_label?(n(),c("p",he,f(o.value.cover_label),1)):m("",!0)])):m("",!0),u("div",{onClick:N,onMouseover:P,onMouseleave:U},[g(v,{content:o.value.content},null,8,["content"])],32),s.value?(n(),c("div",{key:2,ref_key:"sourcePopover",ref:y,class:"source-popover fixed z-50 p-4 max-w-sm space-y-3 bg-white rounded-lg shadow-lg border border-gray-200 cursor-pointer hover:shadow-xl",style:K({left:w.value.x+"px",top:w.value.y+"px"}),onClick:$,onMouseleave:D},[u("div",xe,[u("h4",we,f(s.value.title||"Source"),1),s.value.description?(n(),c("p",ke,f(s.value.description),1)):m("",!0)]),s.value.author||s.value.publishedAt?(n(),c("div",Se,[s.value.author?(n(),c("p",Ce," Par "+f(s.value.author),1)):m("",!0),s.value.publishedAt?(n(),c("p",Ae,f(k(s.value.publishedAt)),1)):m("",!0)])):m("",!0)],36)):m("",!0),g(_,{sources:o.value.sources},null,8,["sources"])])):x.value?(n(),c("div",Le,[...e[2]||(e[2]=[u("p",null,"Chargement...",-1)])])):(n(),c("div",Be,[g(a,{name:"mingcute:file-search-line",class:"w-16 h-16 text-gray-400 mx-auto mb-4 text-4xl"}),e[3]||(e[3]=u("h2",{class:"text-2xl font-semibold text-gray-700 mb-2"},"Article non trouvé",-1)),e[4]||(e[4]=u("p",{class:"text-gray-500 mb-6"},"L'article que vous cherchez n'existe pas ou n'est plus disponible.",-1)),g(r,{label:"Retour à l'accueil",icon:"mingcute:home-3-line",to:"/"})]))])}}}),Pe=re(Te,[["__scopeId","data-v-db7e16b1"]]);export{Pe 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.