1import{u as P,_ as le}from"./D0m7jLQU.js";import{u as ce,a as ie,b as ue,w as j,c as l,d as b,e as pe,h as R,l as me,g as w,F as M,r as D,n as de,o as d,i as ge,j as ye,t as ve,k as he}from"./D47VxUa9.js";import{u as fe,a as be}from"./vt3tH73T.js";import{u as we}from"./DDLJmQTj.js";import"./e5MQyn4B.js";const ke=["innerHTML"],Le={__name:"[...slug]",async setup(Ae){let c,p;const{locale:O}=ce(),S=we(),k=`${S.protocol}//${S.host}`,B=ue(),A=ie(),$=B.public.siteId,y=A.params.slug,H=Array.isArray(y)?y:typeof y=="string"?y.split("/"):[],L=H[H.length-1]||"",{data:n,status:He,error:_e}=([c,p]=j(()=>fe($,L)),c=await c,p(),c),V=!!n.value?.article,I=!!n.value?.redirect?.to,W=A.fullPath||A.path||"/";if(H.length>0&&!V&&!I){const e=([c,p]=j(()=>be({siteId:$,requestedPath:W,fallbackPath:"/"})),c=await c,p(),c);e&&([c,p]=j(()=>de(e.to,{redirectCode:e.code})),await c,p())}const i=l(()=>n.value?.head||{}),_=l(()=>n.value?.lang||"en"),T=l(()=>n.value?.domain||k),x=l(()=>n.value?.slug||L||""),q=B.public.globalHead,C={link:(q||[]).filter(e=>e.startsWith("<link")).map(e=>Object.fromEntries(Array.from(e.matchAll(/(\w+)=["'](.*?)["']/g)).map(([t,s,a])=>[s,a]))),meta:(q||[]).filter(e=>e.startsWith("<meta")).map(e=>Object.fromEntries(Array.from(e.matchAll(/(\w+)=["'](.*?)["']/g)).map(([t,s,a])=>[s,a])))},F=l(()=>{const e=[{name:"description",content:i.value.description},{name:"keywords",content:i.value.keywords},{property:"og:title",content:i.value.title},{property:"og:description",content:i.value.description},{property:"og:image",content:n.value?.article?.introImage?.[0]?.path},{property:"og:url",content:`${T.value}/${x.value}`},{property:"og:type",content:"article"},{property:"og:locale",content:_.value},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:i.value.title},{name:"twitter:description",content:i.value.description},{name:"twitter:image",content:n.value?.article?.introImage?.[0]?.path}],t=Array.isArray(i.value.meta)?i.value.meta:[],s=C.meta||[],a=Array.isArray(n.value?.robots?.metaTags)?n.value.robots.metaTags:[];let o=t.find(r=>r.key==="robots"&&r.type==="name")||a.find(r=>r.name==="robots");const u=t.filter(r=>r.key!=="robots"),f=a.filter(r=>r.name!=="robots"),re=new Set([...u.map(r=>r.key),...s.map(r=>r.name).filter(Boolean)]),se=f.filter(r=>!re.has(r.name));return[...e,...u.map(r=>{const oe=r?.type==="property"?"property":r?.type==="httpEquiv"?"httpEquiv":"name",E=r?.key!=null?String(r.key):"";return E?{[oe]:E,content:r?.content!=null?String(r.content):void 0}:null}).filter(Boolean),...o?[{name:"robots",content:o.content||o.value}]:[],...se.map(r=>({name:r?.name!=null?String(r.name):"",content:r?.content!=null?String(r.content):void 0})).filter(r=>r.name),...s]}),J=l(()=>[{rel:"canonical",href:`${T.value}/${x.value}`},{rel:"alternate",hreflang:_.value,href:`${k}/${x.value}`},...Array.isArray(n.value?.alters)?n.value.alters.map(e=>({rel:"alternate",hreflang:e.hreflang,href:`${k}/${e.slug}/`})):[],...C.link||[]]),U=l(()=>[...Array.isArray(n.value?.pixel)&&n.value.pixel.length>0?[{innerHTML:` 2 !function(f,b,e,v,n,t,s) 3 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 4 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 5 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 6 n.queue=[];t=b.createElement(e);t.async=!0; 7 t.src=v;s=b.getElementsByTagName(e)[0]; 8 s.parentNode.insertBefore(t,s)}(window, document,'script', 9 'https://connect.facebook.net/en_US/fbevents.js'); 10 ${n.value.pixel.map(e=>`fbq('init', '${e}');`).join(` 11`)} 12 fbq('track', 'PageView'); 13 `,type:"text/javascript"}]:[],...Array.isArray(n.value?.gtm)?n.value.gtm.map((e,t)=>({key:`gtm-script-${t}`,innerHTML:` 14 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 15 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 16 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
17 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 18 })(window,document,'script','dataLayer','${e}'); 19 `})):[]]),z=l(()=>[...Array.isArray(n.value?.pixel)?n.value.pixel.map(e=>({innerHTML:` 20 <img height="1" width="1" style="display:none" 21 src="https://www.facebook.com/tr?id=${e}&ev=PageView&noscript=1"/> 22 `})):[],...Array.isArray(n.value?.gtm)?n.value.gtm.map((e,t)=>({key:`gtm-noscript-${t}`,innerHTML:` 23 <iframe src="https://www.googletagmanager.com/ns.html?id=${e}" 24 height="0" width="0" style="display:none;visibility:hidden"></iframe> 25 `})):[]]);P({htmlAttrs:{lang:_.value},title:i.value.title||"Website",meta:F.value,link:J.value,script:U.value,noscript:z.value}),n.value?.lang&&(O.value=n.value.lang);const v=l(()=>Array.isArray(n.value?.headCodeBlocks)?n.value.headCodeBlocks:[]),N=l(()=>Array.isArray(n.value?.bodyCodeBlocks)?n.value.bodyCodeBlocks:[]),m=e=>{if(!e)return"";let t=String(e);const s=t.match(/<pre[^>]*><code[^>]*>([\s\S]*?)<\/code><\/pre>/i);return s&&(t=s[1]),/<|>|&|"|'/.test(t)&&(t=t.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")),t},G=l(()=>v.value.filter(e=>e?.type==="js").map((e,t)=>({key:`head-js-${t}`,innerHTML:m(e.content),type:"text/javascript"}))),K=l(()=>v.value.filter(e=>e?.type==="css").map((e,t)=>({key:`head-css-${t}`,children:m(e.content)}))),Q=l(()=>v.value.filter(e=>e?.type==="blocks").map((e,t)=>({key:`head-ld-${t}`,type:"application/ld+json",children:m(e.content)}))),g=l(()=>v.value.filter(e=>e?.type==="html").map(e=>m(e.content))),h=(e="")=>{const t={},s=/(\w[\w:-]*)\s*=\s*("([^"]*)"|'([^']*)'|([^\s>]+))/g;let a;for(;a=s.exec(e);){const o=a[1],u=a[3]??a[4]??a[5]??"";t[o]=u}return t},X=l(()=>{const e=[],t=/<script([^>]*)>([\s\S]*?)<\/script>/gi;for(const s of g.value){let a;for(;a=t.exec(s);){const o=h(a[1]||""),u=(a[2]||"").trim(),f={...o};u&&(f.innerHTML=u),e.push(f)}}return e}),Y=l(()=>{const e=[],t=/<style([^>]*)>([\s\S]*?)<\/style>/gi;for(const s of g.value){let a;for(;a=t.exec(s);){const o=h(a[1]||""),u=(a[2]||"").trim();e.push({...o,children:u})}}return e}),Z=l(()=>{const e=[],t=/<meta([^>]*)>/gi;for(const s of g.value){let a;for(;a=t.exec(s);){const o=h(a[1]||"");Object.keys(o).length&&e.push(o)}}return e}),ee=l(()=>{const e=[],t=/<link([^>]*)>/gi;for(const s of g.value){let a;for(;a=t.exec(s);){const o=h(a[1]||"");Object.keys(o).length&&e.push(o)}}return e}),te=l(()=>{const e=[],t=/<noscript>([\s\S]*?)<\/noscript>/gi;for(const s of g.value){let a;for(;a=t.exec(s);){const o=(a[1]||"").trim();o&&e.push({innerHTML:o})}}return e});P({meta:Z.value,link:ee.value,script:[...G.value,...Q.value,...X.value],style:[...K.value,...Y.value],noscript:te.value});const ae=l(()=>N.value.filter(e=>["html","text","universal"].includes(e?.type)).map(e=>m(e.content))),ne=l(()=>N.value.filter(e=>e?.type==="js").map(e=>m(e.content)));return n.value?.redirect?.to,(e,t)=>{const s=le;return d(),b(M,null,[pe("main",null,[w(n)?.type?(d(),R(s,{key:0,data:w(n)},null,8,["data"])):me("",!0)]),(d(!0),b(M,null,D(w(ae),(a,o)=>(d(),b("div",{key:"bh-"+o,innerHTML:a},null,8,ke))),128)),(d(!0),b(M,null,D(w(ne),(a,o)=>(d(),R(he("script"),{key:"bjs-"+o,type:"text/javascript"},{default:ge(()=>[ye(ve(a),1)]),_:2},1024))),128))],64)}}};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.