1import{d as t}from"./Cm2J8wJT.js";import{ah as e,J as a,L as l,M as r,V as i,U as s,S as n}from"./Cw52Jb_b.js";import"./oPzPbeIq.js";import"./Dv5-W7ly.js";const c=t({name:"PromoArticle",props:{fetchUrl:{type:String,required:!0}},data:()=>({imageUrl:"#",title:"ArtykuÅ",category:"GÅówna",description:"",redirectUrl:"#"}),async mounted(){var t,e,a,l,r,i,s,n;try{let c=this.extractRegex(this.fetchUrl,"uuid"),o=this.extractRegex(this.fetchUrl,"portalUrl");if(c&&20===c.length&&o&&o.length>0){const h=await $fetch(`/api/article/ecosystem/${c}/${o}`);void 0!==window&&window.console.log(h);let p=(null==h?void 0:h.article)??"";this.imageUrl=Array.isArray(null==p?void 0:p.attachments)?((null==(e=null==(t=p.attachments[0])?void 0:t.thumbnail)?void 0:e.startsWith("https://"))?p.attachments[0].thumbnail:null)??((null==(l=null==(a=p.attachments[0])?void 0:a["365x225px"])?void 0:l.startsWith("https://"))?p.attachments[0]["365x225px"]:null):((null==(i=null==(r=p.attachments)?void 0:r.thumbnail)?void 0:i.startsWith("https://"))?p.attachments.thumbnail:null)??((null==(n=null==(s=p.attachments)?void 0:s["365x225px"])?void 0:n.startsWith("https://"))?p.attachments["365x225px"]:null)??"#",this.title=null==p?void 0:p.title,this.category=this.replaceHyphensWithSpaces((null==p?void 0:p.category_name)??"GÅówna"),this.description=this.extractParagraphText((null==p?void 0:p.content)??"")??"",this.redirectUrl=this.fetchUrl??"#"}}catch(c){}},methods:{extractRegex(t,e){let a=/^/;if("uuid"===e)a=/^https:\/\/[\w.-]+(?:\/[\w-]+)*\/([\w]+)$/;else a=/^https?:\/\/([^\/?#]+)(?:[\/?#]|$)/i;let l=t.match(a);return!!l&&l[1]},extractParagraphText(t){if(!t)return"...";const e=t.replace(/<[^>]*>/g,"").trim();return e.length>90?e.substring(0,90)+"...":e+"..."},replaceHyphensWithSpaces:t=>t.replace(/-/g," ")}},"$P5gTL2vO5T"),o=["href"],h={class:"promo-article__container"},p={class:"promo-article__image"},u=["src","alt"],m={class:"promo-article__content"},d={class:"promo-article__headline"};const g=e(c,[["render",function(t,e,c,g,v,x){return a(),l(n,null,[e[1]||(e[1]=r("hr",null,null,-1)),r("a",{href:t.redirectUrl,class:"promo-article__wrapper"},[r("div",h,[r("div",p,["#"!==t.imageUrl?(a(),l("img",{key:0,src:t.imageUrl,alt:t.title},null,8,u)):i("",!0)]),r("div",m,[e[0]||(e[0]=r("span",{class:"promo-article__category"},"ZOBACZ TAKÅ»E",-1)),r("h2",d,s(t.title),1)])])],8,o),e[2]||(e[2]=r("hr",null,null,-1))],64)}],["__scopeId","data-v-9f6994c0"]]);export{g 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.