import{c as P,g as A,D as l,y as f,Q as B,I as u,A as C,z as e,U as a,O as N,S as E,H}from"./EchoChannel-Bg1-kez_.js";import{D as g}from"./dayjs.min-Bx9f1rse.js";import{_ as O}from"./Tape.vue_vue_type_script_setup_true_lang-C9KTCQTt.js";import{A as U}from"./Arrow-Right-CuiMYOZx.js";var S={exports:{}};(function(t,r){(function(o,y){t.exports=y()})(P,function(){return function(o,y,d){o=o||{};var n=y.prototype,q={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function T(s,i,h,b){return n.fromToBase(s,i,h,b)}d.en.relativeTime=q,n.fromToBase=function(s,i,h,b,$){for(var v,p,M,k=h.$locale().relativeTime||q,D=o.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],z=D.length,x=0;x<z;x+=1){var c=D[x];c.d&&(v=b?d(s).diff(h,c.d,!0):h.diff(s,c.d,!0));var m=(o.rounding||Math.round)(Math.abs(v));if(M=v>0,m<=c.r||!c.r){m<=1&&x>0&&(c=D[x-1]);var w=k[c.l];$&&(m=$(""+m)),p=typeof w=="string"?w.replace("%d",m):w(m,i,c.l,M);break}}if(i)return p;var j=M?k.future:k.past;return typeof j=="function"?j(p):j.replace("%s",p)},n.to=function(s,i){return T(s,i,this,!0)},n.from=function(s,i){return T(s,i,this)};var Y=function(s){return s.$u?d.utc():d()};n.toNow=function(s){return this.to(Y(this),s)},n.fromNow=function(s){return this.from(Y(this),s)}}})})(S);var V=S.exports;const I=A(V),L={key:0,class:"w-full flex flex-col gap-y-2"},F={key:0,class:"relative flex items-stretch w-full h-40"},G={class:"text-xl leading-none"},Q={class:"text-xs leading-none uppercase"},R={class:"text-xs font-light leading-none"},W={class:"text-xl leading-none"},J={class:"text-xs leading-none uppercase"},K={class:"text-xs font-light leading-none"},X=["href"],Z=["src"],_={key:0,class:"absolute text-black bg-white rounded-full py-1 px-3 text-2xs font-base uppercase tracking-widest top-6 right-6"},tt={class:"flex justify-between text-qorus-grey-mid text-sm"},et={class:"text-xs"},ot={class:"uppercase text-xs"},st=["href"],at={key:0,class:"text-qorus-purple"},rt={class:"group-hover:underline font-semibold"},nt={class:"text-sm text-qorus-grey-dark hidden md:block"},lt=["href"],it=["innerHTML"],ct={__name:"PostCard",props:{post:{type:Object,required:!0},light:{type:Boolean,required:!1},cta:{type:Object,required:!1}},setup(t){g.extend(I);const r={formatDate(o){return g(o).format("DD/MM/YYYY")},getDay(o){return g(o).format("DD")},getMonth(o){return g(o).format("MMM")},getYear(o){return g(o).format("YYYY")}};return(o,y)=>{var d,n;return t.post.bannerUrl?(l(),f("div",L,[t.light?u("",!0):(l(),f("div",F,[t.post.position_label&&t.post.position_color?(l(),B(O,{key:0,"bg-color":"bg-qorus-purple/5",label:`${t.post.position_label} Winner`,"is-premium":!1,"text-color":t.post.position_color},null,8,["label","text-color"])):t.post.parent_id||t.post.premium?(l(),B(O,{key:1,"bg-color":t.post.primary_color??"bg-qorus-purple",label:(d=t.post.parent)==null?void 0:d.name,"is-premium":t.post.premium??!1,"text-color":t.post.secondary_color??"text-qorus-grey-light"},null,8,["bg-color","label","is-premium","text-color"])):u("",!0),t.post.start_date&&!t.post.without_date?(l(),f("div",{key:2,class:C(["absolute flex items-center ml-8 gap-x-4",{"left-8":t.post.premium||t.post.parent}])},[e("div",{style:N(`background-color: ${t.post.parent&&t.post.parent.primary_color}; color: ${t.post.parent&&t.post.parent.secondary_color}`),class:"flex flex-col justify-center items-center py-1 px-3 bg-qorus-purple text-white font-light"},[e("span",G,a(r.getDay(t.post.start_date)),1),e("span",Q,a(r.getMonth(t.post.start_date)),1),e("span",R,a(r.getYear(t.post.start_date)),1)],4),t.post.end_date&&!t.post.sameDay?(l(),f("div",{key:0,style:N(`background-color: ${t.post.parent&&t.post.parent.primary_color}; color: ${t.post.parent&&t.post.parent.secondary_color}`),class:"flex flex-col justify-center items-center py-1 px-3 bg-qorus-purple text-white font-light"},[e("span",W,a(r.getDay(t.post.end_date)),1),e("span",J,a(r.getMonth(t.post.end_date)),1),e("span",K,a(r.getYear(t.post.end_date)),1)],4)):u("",!0)],2)):u("",!0),e("a",{href:t.post.route,class:"flex-auto"},[e("img",{class:C(["h-full w-full object-cover",[t.post.past?"grayscale":null]]),src:t.post.bannerUrl,alt:""},null,10,Z),t.post.past?(l(),f("span",_,"past")):u("",!0)],8,X)])),e("div",tt,[e("p",et,a((t.post.start_date&&r.formatDate(t.post.start_date))??(t.post.published_at&&r.formatDate(t.post.published_at))),1),e("p",ot,a(t.post.formattedType??t.post.type),1)]),e("a",{href:t.post.route,class:"group"},[t.light&&t.post.account?(l(),f("h4",at,a((n=t.post.account)==null?void 0:n.name),1)):u("",!0),e("h3",rt,a(t.post.name),1)],8,st),e("p",nt,a(t.post.description),1),t.cta&&t.cta.label&&t.cta.url?(l(),f("a",{key:1,href:t.cta.url,class:"flex w-full justify-end items-end text-qorus-purple pb-4 px-2 hover:underline"},[E(a(t.cta.label)+" ",1),e("span",{class:"ml-2 pt-[2px] w-6 h-6",innerHTML:H(U)},null,8,it)],8,lt)):u("",!0)])):u("",!0)}}},ht=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"}));export{ht as P,ct as _,I as r};