PageSourceSearch

https://mucem.org/_nuxt/T4rFb-Kb.js

js mucem.org collected 2026-09-24 17:39:35 UTC 2,892 bytes, 1 lines download raw bytes

1import{_ as A,a as B}from"./Bj4rBGkq.js";import{_ as R}from"./Br9OsYz6.js";import{k as _,A as i,v as S,a1 as m,m as z,G as w,o as c,e as f,i as o,t as d,F,y as N,b as n,f as C,g as q,T as x,c as E,h as V}from"./CnnHI4eV.js";const D={class:"press-download wrapper is-grid"},L={class:"mb-2"},j={class:"press-download__list py-6"},G={key:0,class:"d-flex align-items-center"},J={class:"h5 filename me-2"},U=["onClick"],H={key:1,class:"d-flex align-items-center"},I={class:"h5 me-2"},K=["href"],Q={class:"text-s font-arial"},Z={__name:"PressDownload",props:{restrictedText:{type:String,required:!1,default:"Restricted"},title:{type:String,required:!1},files:{type:Array,required:!1}},setup(h){const t=h,y=_([]),p=_(!1),u=_({title:i("Connectez-vous pour télécharger les éléments réservés à la presse :"),field:{label:i("Mot de passe"),placeholder:i("Mot de passe")},error:i("Mauvais mot de passe"),cta:{label:i("Connexion")},roles:["presse"]}),b=_({title:i("Ou demandez un accès presse en remplissant ce formulaire :")}),O=async(s,e)=>(await $fetch("/api/validate-token",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+s},body:JSON.stringify({login:e})})).valid,P=async s=>{for(const e of s){const r=m(`${e}_mucem`);if(r.value!==void 0&&r.value!==null&&await O(r.value,`${e}@mucem.org`))return!0}return!1},$=async s=>await P(s),l=async()=>{var s;t.files&&Promise.all((s=t.files)==null?void 0:s.map(e=>$(e.hands__roles))).then(e=>{y.value=e})},M=S(()=>(t.files||[]).flatMap(s=>s.hands__roles).map(s=>m(`${s}_mucem`).value));return z(()=>{t.files&&(t.files.forEach(s=>{s.hands__roles.forEach(e=>{w(()=>m(`${e}_mucem`).value,async()=>{await l()})})}),l())}),w(M,async()=>{await l()}),(s,e)=>{const r=A,k=B,T=R;return c(),f("div",D,[o("h4",L,d(t.title),1),o("div",j,[(c(!0),f(F,null,N(h.files,(a,v)=>{var g;return c(),f("div",{key:v,class:"press-download__list__item d-flex align-items-center mb-2"},[a.is_protected&&!n(y)[v]?(c(),f("div",G,[e[3]||(e[3]=o("span",{class:"h5 icon-lock"},null,-1)),o("span",J,d(a.filename),1),o("span",{class:"text-s cta--secondary",onClick:()=>{n(u).roles=a.hands__roles,p.value=!0}},d(t.restrictedText),9,U)])):(c(),f("div",H,[e[4]||(e[4]=o("span",{class:"h5 icon-download me-1"},null,-1)),o("span",I,[o("a",{class:"cta--secondary",href:a.download_url||a.file.url,target:"_blank",download:""},d(a.filename),9,K)]),o("span",Q,"("+d((g=a.file.subtype)==null?void 0:g.toUpperCase())+","+d(Math.round(a.file.filesize/1e3))+" ko)",1)]))])}),128))]),C(T,{"is-open":n(p),classes:"",onOnClose:e[2]||(e[2]=async()=>{p.value=!1,await l()})},{content:q(({onClick:a})=>[C(r,x(n(u),{onOnClose:e[0]||(e[0]=async()=>{p.value=!1,await l()})}),null,16),!n(u).roles||n(u).roles.indexOf("presse")!==-1?(c(),E(k,x({key:0},n(b),{onOnClose:e[1]||(e[1]=async()=>{p.value=!1,await l()})}),null,16)):V("",!0)]),_:1},8,["is-open"])])}}};export{Z as _};

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.