1import{i as z,A as O}from"#entry";const u="Collection de l'Art Brut",I="https://www.artbrut.ch",x="/img/og-image.png",j=p=>{const C=O(),L=z(),a=String(C.public.siteUrl||I).replace(/\/$/,""),c=`${a}/#museum`,f=`${a}/#website`,d=e=>{if(e)return/^https?:\/\//i.test(e)?e:`${a}${e.startsWith("/")?"":"/"}${e}`},h=e=>d(e?.url),l=()=>d(L.path)??a,g=e=>e.map(i=>i.type==="text"?i.text:i.type==="link"?g(i.children??[]):"").join(""),E=e=>e?.length?e.flatMap(i=>{if("children"in i&&Array.isArray(i.children)){const t=g(i.children).trim();return t?[t]:[]}return[]}):[],M=e=>{const i=E(e);if(!i.length)return;const t=i.flatMap(n=>n.split(",").map(o=>o.trim()).filter(Boolean)),r={"@type":"PostalAddress"},s=t.findIndex(n=>/\b\d{4}\b/.test(n));if(s>=0){const o=(t[s]??"").match(/\b(\d{4})\b\s*(.*)/);o&&(r.postalCode=o[1]??"",o[2]&&(r.addressLocality=o[2].trim()));const P=t.slice(0,s);P.length&&(r.streetAddress=P.join(", "));const m=t.slice(s+1).join(", ").trim();m&&/suisse|switzerland|schweiz|svizzera/i.test(m)?r.addressCountry="CH":m?r.addressCountry=m:r.addressCountry="CH"}else r.streetAddress=t.join(", "),r.addressCountry="CH";return r},_=e=>{const i={"@type":"Museum","@id":c,name:u,url:a,logo:d(x),image:d(x),sameAs:[]},t=M(e?.addressBlocks);return t&&(i.address=t),Array.isArray(i.sameAs)&&i.sameAs.length===0&&delete i.sameAs,i},w=()=>({"@type":"WebSite","@id":f,name:u,url:a,inLanguage:p.value,publisher:{"@type":"Museum","@id":c}}),y=e=>{const i={"@context":"https://schema.org","@type":"Person",name:e.name,url:l()};e.birthdate&&(i.birthDate=e.birthdate),e.nationality&&(i.nationality=e.nationality),e.head&&(i.description=e.head);const r=(e.thumb??e.lead_resource)?.medias?.[0]?.url;return r&&(i.image=d(r)),i},b=e=>{const t={"@context":"https://schema.org","@type":e.isExpo?"ExhibitionEvent":"Event",name:e.name,url:l()};e.start&&(t.startDate=e.start),e.end&&(t.endDate=e.end);const r=e.lead||e.summary;r&&(t.description=r);const s=h(e.cover??e.thumbnail);if(s&&(t.image=s),e.place&&(t.location={"@type":"Place",name:e.place}),t.organizer={"@type":"Museum","@id":c,name:u,url:a},e.tickets||typeof e.price=="number"){const n={"@type":"Offer",availability:e.sold_out?"https://schema.org/SoldOut":"https://schema.org/InStock"};e.tickets&&(n.url=e.tickets),typeof e.price=="number"?(n.price=e.price,n.priceCurrency="CHF"):(n.price=0,n.priceCurrency="CHF"),e.start&&(n.validFrom=e.start),t.offers=n}return e.artists?.length&&(t.performer=e.artists.map(n=>({"@type":"Person",name:n.name}))),e.sold_out&&(t.eventStatus="https://schema.org/EventScheduled"),t.eventAttendanceMode="https://schema.org/OfflineEventAttendanceMode",t},A=e=>{const t={"@context":"https://schema.org","@type":e.post_type?.slug==="actualites"?"NewsArticle":"Article",headline:e.title,url:l(),inLanguage:p.value,publisher:{"@type":"Museum","@id":c,name:u}};e.date&&(t.datePublished=e.date,t.dateModified=e.updatedAt||e.date);const r=h(e.cover);return r&&(t.image=r),e.description&&(t.description=e.description),e.auteurs?.length?t.author=e.auteurs.map(s=>({"@type":"Person",name:s.name})):e.author&&(t.author={"@type":"Person",name:e.author}),e.tags?.length&&(t.keywords=e.tags.map(s=>s.name).join(", ")),t},S=e=>{const i=e,t={"@context":"https://schema.org","@type":"WebPage",name:i.title||i.name||u,url:l(),inLanguage:p.value,isPartOf:{"@type":"WebSite","@id":f}},r=i.description||i.lead||i.head;r&&(t.description=r);const s=i.cover,n=h(s);return n&&(t.primaryImageOfPage={"@type":"ImageObject",url:n}),t};return{buildMuseumSchema:_,buildWebSiteSchema:w,buildPersonSchema:y,buildEventSchema:b,buildArticleSchema:A,buildWebPageSchema:S,buildFromSource:e=>{if(e){if("start"in e&&e.start&&"event_type"in e)return b(e);if("birthdate"in e&&"name"in e&&e.name)return y(e);if("post_type"in e&&e.post_type)return A(e);if("title"in e||"name"in e)return S(e)}},serialize:e=>(Array.isArray(e)||e["@context"]||(e={"@context":"https://schema.org",...e}),JSON.stringify(e)),siteUrl:a,museumId:c,websiteId:f}};export{j as u};
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.