import{r as i,h as t,g as e}from"./p-5308bbce.js";const o=".list-group-notification{width:350px;height:88px;padding:16px;margin-bottom:8px;background-color:#FFFFFF;border:1px solid #EEEDED;font-family:var(--ifx-font-family)}.list-group-notification .description__section{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.list-group-notification.flush{border:none;border-bottom:1px solid #EEEDED}.list-group-notification .heading__section{display:flex;justify-content:space-between;margin-bottom:8px;color:#0A8276}.list-group-notification .heading__section-title{flex:1;margin:0;font-weight:600;line-height:1.2;font-size:1rem;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.list-group-notification .heading__section-time{flex:none;margin-left:2px;font-size:0.875rem;line-height:1.25rem;font-weight:400;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}";const s=class{constructor(t){i(this,t);this.titleText="";this.isFlush=false;this.creationTime=undefined;this.postTime=undefined;this.shownTime=undefined}setDisplayTime(i,t,e,o){if(i<=60){this.shownTime=`Just now`}else if(t<=60){this.shownTime=`${t} min. ago`}else if(e<=24){this.shownTime=e>1?`${e} hr. ago`:`${e} hrs. ago`}else if(o){this.shownTime=e<48?`1 day ago`:`${o} days ago`;if(e>168){this.shownTime=`${(new Date).getDay()}.${(new Date).getMonth()}.${(new Date).getFullYear()}`}}}stringToDate(i){if(!i)return null;let t=i.split("/");if(t[2]){if(t[2].split(" ")[1]){let i=t[2].split(" ")[1].split(":");t[2]=t[2].split(" ")[0];return new Date(+t[2],t[1]-1,+t[0],i[0],i[1],i[2])}}}getElapsedTime(i){let t=this.stringToDate(i);if(t){let i=Date.now()-t.getTime();let e=Math.floor(i/1e3);let o=Math.floor(i/6e4);let s=Math.floor(o/60);let n=Math.floor(s/24);this.setDisplayTime(e,o,s,n)}}setTimeInterval(i){this.postTime=window.setInterval((()=>{this.getElapsedTime(i)}),1e3)}componentWillLoad(){this.getElapsedTime(this.creationTime);this.setTimeInterval(this.creationTime);const i=this.el.closest("ifx-list-group");if(i.flush){this.isFlush=true}else this.isFlush=false}disconnectedCallback(){window.clearInterval(this.postTime)}render(){return t("div",{class:`list-group-notification ${this.isFlush?"flush":""}`},t("div",{class:"heading__section"},t("h6",{class:"heading__section-title"},this.titleText),t("div",{class:"heading__section-time"},this.shownTime)),t("div",{class:"description__section"},t("slot",null)))}get el(){return e(this)}};s.style=o;export{s as ifx_list_notification}; //# sourceMappingURL=p-d524e4be.entry.js.map