function searchMessages(){var t,s=document.getElementById("searchMessage").value.toUpperCase(),e=document.getElementById("users-conversation").getElementsByTagName("li");Array.from(e).forEach(function(e){t=e.getElementsByTagName("p")[0]?e.getElementsByTagName("p")[0]:"",-1<(t.textContent||t.innerText?t.textContent||t.innerText:"").toUpperCase().indexOf(s)?e.style.display="":e.style.display="none"})}!function(){var r="assets/images/users/user-dummy-img.jpg",n="assets/images/users/multi-user.jpg",o=!1;function s(){var s=document.querySelectorAll(".user-chat");Array.from(document.querySelectorAll(".chat-user-list li a")).forEach(function(e){e.addEventListener("click",function(e){s.forEach(function(e){e.classList.add("user-chat-show")});var t=document.querySelector(".chat-user-list li.active");t&&t.classList.remove("active"),this.parentNode.classList.add("active")})}),document.querySelectorAll(".user-chat-remove").forEach(function(e){e.addEventListener("click",function(e){s.forEach(function(e){e.classList.remove("user-chat-show")})})})}document.querySelectorAll(".favourite-btn").forEach(function(e){e.addEventListener("click",function(e){this.classList.toggle("active")})});function e(e,t){var s=new XMLHttpRequest;s.open("GET",l+e,!0),s.responseType="json",s.onload=function(){var e=s.status;t(200===e?null:e,s.response)},s.send()}var a="users-chat",c="users",l="assets/json/",d="",m=1;v(a);function u(e,t,s,n,a){var r='
';if(null!=t)r+='

'+t+"

";else if(s&&0',i=0;i
';r+=""}else 0
design-phase-1-approved.pdf

12.5 MB

');return!0===a&&(r+=''),r+=""}function p(){"users"==c?(document.getElementById("channel-chat").style.display="none",document.getElementById("users-chat").style.display="block"):(document.getElementById("channel-chat").style.display="block",document.getElementById("users-chat").style.display="none"),t(l+"chats.json")}function t(e){var t,s;e=e,t=function(e,t){var a,r,s,n,l,i;null!==e?console.log("Something went wrong: "+e):(a="users"==c?t[0].chats:t[0].channel_chat,document.getElementById(c+"-conversation").innerHTML="",r=0,a.forEach(function(t,e){var s,n;0
',m!=t.from_id&&(n+='
'),n=(n+='
')+u(t.id,t.msg,t.has_images,t.has_files,t.has_dropDown),a[e+1]&&t.from_id==a[e+1].from_id&&(r=function(e,t,s){for(var n=0;e[t]&&e[t+1]&&e[t+1].from_id==s;)n++,t++;return n}(a,e,t.from_id),n+=function(e,t,s){for(var n=0;e[t]&&e[t+1]&&e[t+1].from_id==s;)n=u(e[t+1].id,e[t+1].msg,e[t+1].has_images,e[t+1].has_files,e[t+1].has_dropDown),t++;return n}(a,e,t.from_id)),n=n+('
'+s.name+''+t.datetime)+'
',document.getElementById(c+"-conversation").innerHTML+=n)})),b.querySelectorAll(".delete-item").forEach(function(e){e.addEventListener("click",function(){(2==e.closest(".user-chat-content").childElementCount?e.closest(".chat-list"):e.closest(".ctext-wrap")).remove()})}),S(),w(),e=b.querySelectorAll(".reply-message"),s=document.querySelector(".replyCard"),n=document.querySelector("#close_toggle"),e.forEach(function(t){t.addEventListener("click",function(){o=!0,s.classList.add("show"),n.addEventListener("click",function(){s.classList.remove("show")});var e=t.closest(".ctext-wrap").children[0].children[0].innerText,e=(document.querySelector(".replyCard .replymessage-block .flex-grow-1 .mb-0").innerText=e,document.querySelector(".user-chat-topbar .text-truncate .username").innerHTML),e=!t.closest(".chat-list")||t.closest(".chat-list").classList.contains("left")?e:"You";document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerText=e})}),t=E.querySelectorAll(".reply-message"),l=document.querySelector(".replyCard"),i=document.querySelector("#close_toggle"),t.forEach(function(t){t.addEventListener("click",function(){o=!0,l.classList.add("show"),i.addEventListener("click",function(){l.classList.remove("show")});var e=t.closest(".ctext-wrap").children[0].children[0].innerText,e=(document.querySelector(".replyCard .replymessage-block .flex-grow-1 .mb-0").innerText=e,t.closest(".user-chat-content").querySelector(".conversation-name .name").innerText),e=!t.closest(".chat-list")||t.closest(".chat-list").classList.contains("left")?e:"You";document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerText=e})}),b.querySelectorAll(".copy-message").forEach(function(t){t.addEventListener("click",function(){var e=t.closest(".ctext-wrap").children[0]?t.closest(".ctext-wrap").children[0].children[0].innerText:"";navigator.clipboard.writeText(e)})}),E.querySelectorAll(".copy-message").forEach(function(t){t.addEventListener("click",function(){var e=t.closest(".ctext-wrap").children[0]?t.closest(".ctext-wrap").children[0].children[0].innerText:"";navigator.clipboard.writeText(e)})}),document.querySelectorAll(".copy-message").forEach(function(e){e.addEventListener("click",function(){document.getElementById("copyClipBoard").style.display="block",document.getElementById("copyClipBoardChannel").style.display="block",setTimeout(function(){document.getElementById("copyClipBoard").style.display="none",document.getElementById("copyClipBoardChannel").style.display="none"},1e3)})}),v("users-chat"),GLightbox({selector:".popup-img",title:!1})},(s=new XMLHttpRequest).open("GET",e,!0),s.responseType="json",s.onload=function(){var e=s.status;200===e?(document.getElementById("elmLoader").innerHTML="",t(null,s.response)):t(e,s.response)},s.send()}function v(s){setTimeout(function(){var e=document.getElementById(s).querySelector("#chat-conversation .simplebar-content-wrapper")?document.getElementById(s).querySelector("#chat-conversation .simplebar-content-wrapper"):"",t=document.getElementsByClassName("chat-conversation-list")[0]?document.getElementById(s).getElementsByClassName("chat-conversation-list")[0].scrollHeight-window.innerHeight+335:0;t&&e.scrollTo({top:t,behavior:"smooth"})},100)}e("chat-users-list.json",function(e,t){null!==e?console.log("Something went wrong: "+e):(t[0].users.forEach(function(e,t){var s=e.profile?'':'
'+e.nickname+'
',n=e.messagecount?'
'+e.messagecount+"
":"",a=e.messagecount?'':'',r=1===e.id?"active":"";document.getElementById("userList").innerHTML+='
  • '+a+'
    '+s+'

    '+e.name+"

    "+n+"
  • "}),t[0].channels.forEach(function(e,t){var s=e.messagecount?'
    '+e.messagecount+"
    ":"",n=(e.messagecount&&e.messagecount,e.messagecount?'':'');document.getElementById("channelList").innerHTML+='
  • '+n+'
    #

    '+e.name+"

    "+s+"
  • "})),s(),document.querySelectorAll("#userList li").forEach(function(n){n.addEventListener("click",function(){c="users",p(),a="users-chat";var t,e=n.getAttribute("id"),s=n.querySelector(".text-truncate").innerHTML;document.querySelector(".user-chat-topbar .text-truncate .username").innerHTML=s,document.querySelector(".profile-offcanvas .username").innerHTML=s,1==o&&(o=!1,document.querySelector(".replyCard").classList.remove("show")),document.getElementById(e).querySelector(".userprofile")?(t=document.getElementById(e).querySelector(".userprofile").getAttribute("src"),document.querySelector(".user-chat-topbar .avatar-xs").setAttribute("src",t),document.querySelector(".profile-offcanvas .avatar-lg").setAttribute("src",t)):(document.querySelector(".user-chat-topbar .avatar-xs").setAttribute("src",r),document.querySelector(".profile-offcanvas .avatar-lg").setAttribute("src",r)),document.getElementById("users-conversation").querySelectorAll(".left .chat-avatar").forEach(function(e){t?e.querySelector("img").setAttribute("src",t):e.querySelector("img").setAttribute("src",r)}),window.stop()})}),document.querySelectorAll("#channelList li").forEach(function(s){s.addEventListener("click",function(){a="channel-chat",c="channel",p();var e=s.querySelector(".text-truncate").innerHTML,t=document.getElementById("channel-chat");t.querySelector(".user-chat-topbar .text-truncate .username").innerHTML=e,document.querySelector(".profile-offcanvas .username").innerHTML=e,t.querySelector(".user-chat-topbar .avatar-xs").setAttribute("src",n),document.querySelector(".profile-offcanvas .avatar-lg").setAttribute("src",n),1==o&&(o=!1,document.querySelector(".replyCard").classList.remove("show"))})})}),e("chat-contacts-list.json",function(e,t){var n,a;null!==e?console.log("Something went wrong: "+e):((d=t).sort(function(e,t){return e.name.localeCompare(t.name)}),a=n="",d.forEach(function(e,t){var s=e.profile?'':''+e.nickname+"",s=(n='
  • '+s+'

    '+e.name+'

  • ','
    '+e.name.charAt(0).toUpperCase()+'
      ');a!=e.name.charAt(0)&&(document.getElementsByClassName("sort-contact")[0].innerHTML+=s),document.getElementById("contact-sort-"+e.name.charAt(0)).innerHTML=document.getElementById("contact-sort-"+e.name.charAt(0)).innerHTML+n,a=e.name.charAt(0)})),document.querySelectorAll(".sort-contact ul li").forEach(function(n){n.addEventListener("click",function(e){c="users",p();var t,s=n.querySelector("li .contactlist-name").innerHTML;document.querySelector(".user-chat-topbar .text-truncate .username").innerHTML=s,document.querySelector(".profile-offcanvas .username").innerHTML=s,1==o&&(o=!1,document.querySelector(".replyCard").classList.remove("show")),n.querySelector(".align-items-center").querySelector(".avatar-xxs img")?(t=n.querySelector(".align-items-center").querySelector(".avatar-xxs .rounded-circle").getAttribute("src"),document.querySelector(".user-own-img .avatar-xs").setAttribute("src",t),document.querySelector(".profile-offcanvas .profile-img").setAttribute("src",t)):(document.querySelector(".user-own-img .avatar-xs").setAttribute("src",r),document.querySelector(".profile-offcanvas .profile-img").setAttribute("src",r)),document.getElementById("users-conversation").querySelectorAll(".left .chat-avatar").forEach(function(e){t?e.querySelector("img").setAttribute("src",t):e.querySelector("img").setAttribute("src",r)}),window.stop()})}),s()}),p();var f=document.querySelector("#chatinput-form"),g=document.querySelector("#chat-input"),h=document.querySelector(".chat-input-feedback");function y(){var e=12<=(new Date).getHours()?"pm":"am",t=12<(new Date).getHours()?(new Date).getHours()%12:(new Date).getHours(),s=(new Date).getMinutes()<10?"0"+(new Date).getMinutes():(new Date).getMinutes();return t<10?"0"+t+":"+s+" "+e:t+":"+s+" "+e}setInterval(y,1e3);var x=0;f&&f.addEventListener("submit",function(e){e.preventDefault();var e=a,t=a,s=g.value;0===s.length?(h.classList.add("show"),setTimeout(function(){h.classList.remove("show")},2e3)):(1==o?(k(t,s),o=!1):q(e,s),v(e||t)),g.value="",document.getElementById("close_toggle").click()});var b=document.querySelector(".chat-conversation-list");function w(){b.querySelectorAll(".chat-conversation-list .chat-list").forEach(function(e){e.querySelectorAll(".delete-image").forEach(function(e){e.addEventListener("click",function(){(1==e.closest(".message-img").childElementCount?e.closest(".chat-list"):e.closest(".message-img-list")).remove()})})})}w();var E=document.querySelector("#channel-conversation");function S(){(channelChatList=E.querySelectorAll(".delete-item")).forEach(function(e){e.addEventListener("click",function(){(2==e.closest(".user-chat-content").childElementCount?e.closest(".chat-list"):e.closest(".ctext-wrap")).remove()})})}S();var q=function(e,t){x++;var s=document.getElementById(e).querySelector(".chat-conversation-list"),n=(null!=t&&s.insertAdjacentHTML("beforeend",'
    • '),document.getElementById("chat-list-"+x));n.querySelectorAll(".delete-item").forEach(function(e){e.addEventListener("click",function(){s.removeChild(n)})}),n.querySelectorAll(".copy-message").forEach(function(e){e.addEventListener("click",function(){var e=n.childNodes[1].firstElementChild.firstElementChild.firstElementChild.firstElementChild.innerText;navigator.clipboard.writeText(e)})}),n.querySelectorAll(".copy-message").forEach(function(e){e.addEventListener("click",function(){document.getElementById("copyClipBoard").style.display="block",setTimeout(function(){document.getElementById("copyClipBoard").style.display="none"},1e3)})}),n.querySelectorAll(".reply-message").forEach(function(a){a.addEventListener("click",function(){var e=document.querySelector(".replyCard"),t=document.querySelector("#close_toggle"),s=a.closest(".ctext-wrap").children[0].children[0].innerText,n=document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerHTML,t=(o=!0,e.classList.add("show"),t.addEventListener("click",function(){e.classList.remove("show")}),!a.closest(".chat-list")||a.closest(".chat-list").classList.contains("left")?n:"You");document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerText=t,document.querySelector(".replyCard .replymessage-block .flex-grow-1 .mb-0").innerText=s})})},k=function(e,t){var s=document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerHTML,n=document.querySelector(".replyCard .replymessage-block .flex-grow-1 .mb-0").innerText;x++;var e=document.getElementById(e).querySelector(".chat-conversation-list"),a=(null!=t&&(e.insertAdjacentHTML("beforeend",'
    • '+s+'

      '+n+'

      '+t+'

      '+y()+'
    • '),0),document.getElementById("chat-list-"+x));a.querySelectorAll(".delete-item").forEach(function(e){e.addEventListener("click",function(){b.removeChild(a)})}),a.querySelectorAll(".copy-message").forEach(function(e){e.addEventListener("click",function(){document.getElementById("copyClipBoard").style.display="block",document.getElementById("copyClipBoardChannel").style.display="block",setTimeout(function(){document.getElementById("copyClipBoard").style.display="none",document.getElementById("copyClipBoardChannel").style.display="none"},1e3)})}),a.querySelectorAll(".reply-message").forEach(function(s){s.addEventListener("click",function(){var e=s.closest(".ctext-wrap").children[0].children[0].innerText,t=document.querySelector(".user-chat-topbar .text-truncate .username").innerHTML,e=(document.querySelector(".replyCard .replymessage-block .flex-grow-1 .mb-0").innerText=e,!s.closest(".chat-list")||s.closest(".chat-list").classList.contains("left")?t:"You");document.querySelector(".replyCard .replymessage-block .flex-grow-1 .conversation-name").innerText=e})}),a.querySelectorAll(".copy-message").forEach(function(e){e.addEventListener("click",function(){a.childNodes[1].children[1].firstElementChild.firstElementChild.getAttribute("id"),isText=a.childNodes[1].children[1].firstElementChild.firstElementChild.innerText,navigator.clipboard.writeText(isText)})})};new FgEmojiPicker({trigger:[".emoji-btn"],removeOnSelection:!1,closeButton:!0,position:["top","right"],preFetch:!0,dir:"assets/js/pages/plugins/json",insertInto:document.querySelector(".chat-input")});document.getElementById("emoji-btn").addEventListener("click",function(){setTimeout(function(){var e,t=document.getElementsByClassName("fg-emoji-picker")[0];t&&(e=window.getComputedStyle(t)?window.getComputedStyle(t).getPropertyValue("left"):"")&&(e=e.replace("px",""),t.style.left=e=e-40+"px")},0)})}();var scrollEl=new SimpleBar(document.getElementById("chat-conversation"));scrollEl.getScrollElement().scrollTop=document.getElementById("users-conversation").scrollHeight;