1import{d as re,b as ce,v as de,bg as ue,Z as pe,bh as ge,M as D,w as ee,u as fe,e as a,o as p,c as g,i as c,n as k,J as C,D as v,F as me,y as he,t as S,a as O,j as W,bi as xe,R as _e,l as ve,m as R,bj as we,z as E,bk as be,B as ye}from"./eFdCCj3t.js";import{_ as ke}from"./CcU9WZRu.js";import{a as Ce,b as Ie}from"./CprriFlA.js";import{u as Me}from"./B2lZMuGL.js";import"./Bfd5Thr0.js";import"./C_YC4gad.js";const Se={key:0,class:"flex min-h-screen w-full items-center justify-center bg-black"},Ee={key:1,class:"min-h-screen w-full bg-[#082619]"},Te={class:"rounded-[36px] bg-[#125337] p-1"},He={class:"relative flex flex-col"},Le={key:0,class:"absolute inset-0"},Ne=["src","alt"],Re={key:1,class:"absolute inset-0 rounded-[32px] bg-gradient-to-b from-transparent from-[70%] to-black"},Pe={key:0,class:"min-h-[150px] flex-1 tablet:min-h-[200px] desktop:min-h-[296px]"},Ae={class:"mb-0 font-national2Narrow text-[16px] font-medium tablet:text-[20px] desktop:text-[24px]"},Ve={class:"rounded-[36px] bg-[#125337] p-1"},ze={class:"flex flex-col gap-6 overflow-hidden py-16 laptop:gap-12"},je={class:"mx-auto w-full min-w-[348px] max-w-4xl"},$e={class:"flex flex-col gap-6 laptop:gap-12"},Be={key:0,class:"my-8 w-full"},Fe={class:"relative aspect-[4/3] w-full overflow-hidden rounded-[24px] bg-black/20"},Oe=["src","alt"],We={key:1,class:"relative w-full",style:{"padding-bottom":"56.25%"}},Ue=["src"],qe=["src"],Ge=["innerHTML"],Je={key:2,class:"flex min-h-screen w-full items-center justify-center bg-black"},Ke={class:"flex flex-col items-center gap-4"},Xe={class:"font-sans text-xl text-white"},Ze={class:"font-sans text-sm text-gray-400"},Qe="/images/centros-visitantes-card.png",Ye=re({__name:"[slug]",setup(De){const{t:P}=ce(),te=Me("slug"),A=R(()=>{const e=te.value,i=Array.isArray(e)?e[0]||"":e||"";return we(i)}),V=E(null),_=E("pending"),T=E(null);de(async()=>{if(!A.value){_.value="error",T.value={statusCode:400,message:"Slug requerido"};return}try{_.value="pending";const e=await ue(A.value,{_embed:"author,wp:featuredmedia"});if(e){if(e.type==="page"){await pe(ge({slug:A.value,link:e.data.link}),{external:!0,replace:!0});return}V.value=e,_.value="success",await D()}else _.value="error",T.value={statusCode:404,message:"Contenido no encontrado"}}catch(e){_.value="error",T.value=e}});const d=R(()=>V.value?.data),h=E(null),f=E(!1),se=e=>new Promise(i=>{if(typeof window>"u"){i(!0);return}try{const n=new Image;n.onload=()=>i(!0),n.onerror=()=>i(!1),n.src=e}catch{i(!1)}});ee(d,async e=>{if(!e){h.value=null,f.value=!1;return}if(!e._embedded?.["wp:featuredmedia"]?.[0]?.source_url){h.value=null,f.value=!1;return}const i=e._embedded["wp:featuredmedia"][0].source_url.trim();if(!i){h.value=null,f.value=!1;return}h.value=i,f.value=!1;const n=await se(i);h.value===i&&(f.value=n)},{immediate:!0}),ee(()=>V.value,async e=>{e?.data&&await D()},{immediate:!0});const ae=R(()=>f.value&&h.value?h.value:Qe);fe({title:()=>d.value?`${C(d.value.title.rendered)} - Para la Naturaleza`:"Contenido - Para la Naturaleza",description:()=>d.value?C(d.value.excerpt?.rendered||d.value.content.rendered).substring(0,160):"",ogTitle:()=>d.value?`${C(d.value.title.rendered)} - Para la Naturaleza`:"Contenido - Para la Naturaleza",ogImage:()=>ae.value});function ne(e){const i=e.split(" "),n=[];let u="";for(const o of i)(u+o).length>50&&u?(n.push(u.trim()),u=o+" "):u+=o+" ";return u.trim()&&n.push(u.trim()),n.length>0?n:[e]}function le(e){if(!e)return{processedContent:"",visuals:[]};const i=[];let n=e;const u=[],o=/<img[^>]+src=["']([^"']+)["'][^>]*>/gi;let x;const U=[];for(o.lastIndex=0;(x=o.exec(e))!==null;)U.push({tag:x[0],src:x[1],position:x.index});U.forEach(({tag:t,src:s,position:l})=>{const m=e.substring(0,l),b=/<div[^>]*class=["'][^"']*elementor-widget-image[^"']*["'][^>]*>/gi;b.lastIndex=0;let j,$=-1;for(;(j=b.exec(m))!==null;)$=j.index;if($!==-1){const I=$,Z=e.substring(I);let B=0,F=-1,y=0;for(;y<Z.length;){const M=Z.substring(y);if(M.match(/^<div[^>]*>/)){B++;const Y=M.indexOf(">");Y!==-1?y+=Y+1:y++}else if(M.startsWith("</div>")){if(B--,B===0){F=I+y+6;break}y+=6}else y++}const ie=F!==-1?e.substring(I,F):e.substring(I,Math.min(I+5e3,e.length)),Q=t.match(/alt=["']([^"']*)["']/i);u.some(M=>M.src===s)||u.push({match:t,container:ie,src:s,alt:Q?Q[1]:""})}});const q=/<img[^>]+src=["']([^"']+)["'][^>]*>/gi;q.lastIndex=0;let r;for(;(r=q.exec(e))!==null;){const t=r[0],s=r[1];if(!u.some(m=>m.src===s)){const m=t.match(/alt=["']([^"']*)["']/i);u.push({match:t,container:t,src:s,alt:m?m[1]:""})}}const w=[],G=/<video[^>]*>[\s\S]*?<source[^>]+src=["']([^"']+)["'][^>]*>[\s\S]*?<\/video>/gi;for(G.lastIndex=0,r=null;(r=G.exec(e))!==null;){const t=r[0],s=r[1];s&&w.push({match:t,src:s})}const J=/<video[^>]+src=["']([^"']+)["'][^>]*>/gi;for(J.lastIndex=0,r=null;(r=J.exec(e))!==null;){const t=r[0],s=r[1];s&&!w.some(l=>l.match.includes(t))&&w.push({match:t,src:s})}const K=/<video[^>]+src=["']([^"']+)["'][^>]*\/>/gi;for(K.lastIndex=0,r=null;(r=K.exec(e))!==null;){const t=r[0],s=r[1];s&&!w.some(l=>l.match.includes(t))&&w.push({match:t,src:s})}const X=/<iframe[^>]+src=["']([^"']*(?:youtube|youtu\.be|vimeo)[^"']*)["'][^>]*>/gi;for(X.lastIndex=0,r=null;(r=X.exec(e))!==null;){const t=r[0],s=r[1];s&&w.push({match:t,src:s})}const H=[];u.forEach(t=>{const s=t.container||t.match,l=e.indexOf(s);l!==-1&&H.push({type:"image",src:t.src,alt:t.alt,originalHtml:s,position:l})}
1),w.forEach(t=>{const s=e.indexOf(t.match);s!==-1&&H.push({type:"video",src:t.src,alt:"",originalHtml:t.match,position:s})}),H.sort((t,s)=>t.position-s.position);const L=[],oe=500;H.forEach(t=>{const s={type:t.type,src:t.src,alt:t.alt,originalHtml:t.originalHtml},l=L[L.length-1];if(l&&l.length>0){const m=l[l.length-1];if(t.position-(m.position+(m.visual.originalHtml?.length||0))<=oe){l.push({visual:s,position:t.position});return}}L.push([{visual:s,position:t.position}])});const N=[];if(L.forEach(t=>{t.length>1&&N.push(...t.map(s=>s.visual))}),i.push(...N),N.length>0){const t=new Set;N.forEach(l=>{t.add(l.originalHtml)}),Array.from(t).sort((l,m)=>{const b=e.indexOf(l);return e.indexOf(m)-b}).forEach(l=>{const m=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*"),b=new RegExp(m,"gis");n=n.replace(b,"")}),n=n.replace(/<p>\s*<\/p>/gi,""),n=n.replace(/<p><\/p>/gi,""),n=n.replace(/<p[^>]*>\s*<\/p>/gi,""),n=n.replace(/<div[^>]*>\s*<\/div>/gi,""),n=n.replace(/<figure[^>]*>\s*<\/figure>/gi,"")}return{processedContent:n,visuals:i}}const z=R(()=>{if(!d.value?.content?.rendered)return{processedContent:"",visuals:[]};const e=be(d.value.content.rendered);return le(e)});return(e,i)=>{const n=xe,u=ve;return a(_)==="pending"?(p(),g("div",Se,[...i[0]||(i[0]=[c("span",{class:"loading loading-ring loading-lg"},null,-1)])])):a(_)==="success"&&a(d)?(p(),g("div",Ee,[c("div",{class:k([a(Ie),"p-1 pt-20"])},[c("div",Te,[c("div",He,[c("div",{class:k(["relative min-h-[300px] overflow-hidden rounded-[36px] tablet:min-h-[400px] desktop:min-h-[592px]",!a(f)&&"bg-white"])},[a(f)&&a(h)?(p(),g("div",Le,[c("img",{src:a(h),alt:a(C)(a(d).title.rendered),class:"absolute inset-0 h-full w-full object-cover"},null,8,Ne)])):v("",!0),a(f)?(p(),g("div",Re)):v("",!0),c("div",{class:k(["relative z-10 flex min-h-[300px] flex-col tablet:min-h-[400px] desktop:min-h-[592px]",a(f)?"":"justify-center"])},[a(f)?(p(),g("div",Pe)):v("",!0),c("div",{class:k(["w-full",a(Ce)])},[c("div",{class:k(["flex w-full flex-col gap-6 tablet:w-[80%]",a(f)?"text-white":"text-[#469270]"])},[c("h1",{class:k(["min-w-[320px] text-[32px] font-medium leading-none tracking-[-1.6px] tablet:text-[48px] desktop:text-[80px]",a(f)&&"[text-shadow:rgba(0,0,0,0.1)_0px_4px_6px,rgba(0,0,0,0.5)_0px_2px_4px]"])},[(p(!0),g(me,null,he(ne(a(C)(a(d).title.rendered)),(o,x)=>(p(),g("p",{key:x,class:"mb-0 font-national2Narrow text-[32px] tablet:text-[48px] desktop:text-[80px]"},S(o),1))),128))],2),a(d).excerpt?.rendered?(p(),g("h2",{key:0,class:k(["min-w-[320px] font-medium leading-[1.15] tracking-[-0.32px]",a(f)&&"[text-shadow:rgba(0,0,0,0.1)_0px_4px_6px,rgba(0,0,0,0.5)_0px_2px_4px]"])},[c("p",Ae,S(a(C)(a(d).excerpt.rendered)),1)],2)):v("",!0)],2)],2)],2)],2)])])],2),O(ke,{tag:"div",class:"bg-[#082619] !pb-16"},{default:W(()=>[c("div",Ve,[c("div",ze,[c("div",je,[c("div",$e,[a(z).visuals.length>1?(p(),g("div",Be,[O(n,{items:a(z).visuals.map((o,x)=>({name:`imagen-${x}`,title:`Imagen ${x+1}`,link:"#",...o})),showIndicators:""},{default:W(({item:o})=>[c("div",Fe,[o.type==="image"?(p(),g("img",{key:0,src:o.src,alt:o.alt||"Imagen de la galerÃa",class:"absolute inset-0 h-full w-full object-cover"},null,8,Oe)):o.type==="video"?(p(),g("div",We,[!o.src.includes("youtube")&&!o.src.includes("youtu.be")&&!o.src.includes("vimeo")?(p(),g("video",{key:0,src:o.src,controls:"",class:"absolute inset-0 h-full w-full rounded-[24px] object-cover"},null,8,Ue)):(p(),g("iframe",{key:1,src:o.src,frameborder:"0",allow:` 2 accelerometer; 3 autoplay; 4 clipboard-write; 5 encrypted-media; 6 gyroscope; 7 picture-in-picture; 8 `,allowfullscreen:"",class:"absolute inset-0 h-full w-full rounded-[24px]"},null,8,qe))])):v("",!0)])]),_:1},8,["items"])])):v("",!0),a(d).content?.rendered?(p(),g("div",{key:1,class:"prose-invert prose w-full min-w-[312px] max-w-none",innerHTML:a(z).processedContent},null,8,Ge)):v("",!0)])])])])]),_:1})])):a(_)==="error"||a(T)?(p(),g("div",Je,[c("div",Ke,[c("p",Xe,S(a(P)("paginas_not_found","Página no encontrada")),1),c("p",Ze,S(a(P)("paginas_not_found_hint","La página que buscas no existe o no está disponible.")),1),O(u,{to:"/",class:"btn btn-secondary"},{default:W(()=>[_e(S(a(P)("paginas_back","Volver al inicio")),1)]),_:1})])])):v("",!0)}}}),ot=ye(Ye,[["__scopeId","data-v-76da8924"]]);export{ot 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.