/g,">").replace(/"/g,""").replace(/'/g,"'")}function emojify(a,b){let c=a;b.forEach(d=>{let e=document.createElement("picture");let f=document.createElement("source");f.setAttribute("srcset",escapeHtml(d.url));f.setAttribute("media","(prefers-reduced-motion: no-preference)");let g=document.createElement("img");g.className="emoji";g.setAttribute("src",escapeHtml(d.static_url));g.setAttribute("alt",`:${d.shortcode}:`);g.setAttribute("title",`:${d.shortcode}:`);g.setAttribute("width","20");g.setAttribute("height","20");e.appendChild(f);e.appendChild(g);c=c.replace(`:${d.shortcode}:`,e.outerHTML)});return c}function loadComments(){let a=document.getElementById("comments-wrapper");document.getElementById("load-comments").innerHTML="Loading…";fetch("https://toot.community/api/v1/statuses/111784580759701190/context").then(function(b){return b.json()}).then(function(b){let c=b["descendants"];if(c&&Array.isArray(c)&&c.length>0){a.innerHTML="";c.forEach(function(e){console.log(c);if(e.account.display_name.length>0){e.account.display_name=escapeHtml(e.account.display_name);e.account.display_name=emojify(e.account.display_name,e.account.emojis)}else{e.account.display_name=e.account.username};let f="";if(e.account.acct.includes("@")){f=e.account.acct.split("@")[1]}else{f="toot.community"};const g=e.in_reply_to_id!=="111784580759701190";let h=false;if(e.account.acct=="sungsphinx"){h=true};e.content=emojify(e.content,e.emojis);let i=document.createElement("source");i.setAttribute("srcset",escapeHtml(e.account.avatar));i.setAttribute("media","(prefers-reduced-motion: no-preference)");let j=document.createElement("img");j.className="avatar";j.setAttribute("src",escapeHtml(e.account.avatar_static));j.setAttribute("alt",`@${e.account.username}@${f} avatar`);let k=document.createElement("picture");k.appendChild(i);k.appendChild(j);let l=document.createElement("a");l.className="avatar-link";l.setAttribute("href",e.account.url);l.setAttribute("rel","external nofollow");l.setAttribute("title",`View profile at @${e.account.username}@${f}`);l.appendChild(k);let m=document.createElement("a");m.className="instance";m.setAttribute("href",e.account.url);m.setAttribute("title",`@${e.account.username}@${f}`);m.setAttribute("rel","external nofollow");m.textContent=f;let n=document.createElement("span");n.className="display";n.setAttribute("itemprop","author");n.setAttribute("itemtype","http://schema.org/Person");n.innerHTML=e.account.display_name;let o=document.createElement("header");o.className="author";o.appendChild(n);o.appendChild(m);let p=document.createElement("a");p.setAttribute("href",e.url);p.setAttribute("itemprop","url");p.setAttribute("title",`View comment at ${f}`);p.setAttribute("rel","external nofollow");p.textContent=new Date(e.created_at).toLocaleString("en-IE",{dateStyle:"long",timeStyle:"short"});let q=document.createElement("time");q.setAttribute("datetime",e.created_at);q.appendChild(p);let r=document.createElement("main");r.setAttribute("itemprop","text");r.innerHTML=e.content;let s=document.createElement("footer");let t=document.createElement("a");t.className="boosts";t.setAttribute("href",`${e.url}/reblogs`);t.setAttribute("title",`Favorites from ${f}`);let u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("xmlns","http://www.w3.org/2000/svg");u.setAttribute("width","16");u.setAttribute("height","16");u.setAttribute("viewBox","0 0 16 16");let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("fill","currentColor");v.setAttribute("d","M8 1v2H4C1.8 3 0 4.8 0 7v2a4 4 0 0 0 1.02 2.672 1 1 0 1 0 1.488-1.336A1.97 1.97 0 0 1 2 9V7c0-1.125.875-2 2-2h4v2h1v-.008a1 1 0 0 0 .707-.285l2-2a1 1 0 0 0 0-1.414l-2-2A1 1 0 0 0 9 1.008V1zm6.29 3a1 1 0 0 0-.72.258.993.993 0 0 0-.078 1.41c.317.355.508.816.508 1.34v2c0 1.125-.875 2-2 2H8V9H7v.008a1 1 0 0 0-.707.285l-2 2a1 1 0 0 0 0 1.414l2 2c.187.184.441.29.707.285V15h1v-1.992h4c2.2 0 4-1.805 4-4v-2a4 4 0 0 0-1.02-2.676A1 1 0 0 0 14.29 4m0 0");u.appendChild(v);t.appendChild(u);t.insertAdjacentHTML('beforeend',` ${e.reblogs_count}`);s.appendChild(t);let w=document.createElement("a");w.className="faves";w.setAttribute("href",`${e.url}/favourites`);w.setAttribute("title",`Favorites from ${f}`);let x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg");x.setAttribute("width","16");x.setAttribute("height","16");x.setAttribute("viewBox","0 0 16 16");let y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("fill","currentColor");y.setAttribute("d","M8 0a1 1 0 0 0-.95.684l-1.448 4.34-4.59-.016C.032 5.004-.371 6.266.43 6.828l3.625 2.555-1.5 4.285c-.317.902.687 1.691 1.492 1.172l4.004-2.594 3.894 2.586c.801.531 1.817-.258 1.5-1.16l-1.504-4.29 3.645-2.577c.789-.563.394-1.809-.574-1.813l-4.66-.015L8.949.69A1 1 0 0 0 8 0m0 0");x.appendChild(y);w.appendChild(x);w.insertAdjacentHTML('beforeend',` ${e.favourites_count}`);s.appendChild(w);let z=document.createElement("article");z.id=`comment-${e.id}`;z.className=g?"comment comment-reply":"comment";z.setAttribute("itemprop","comment");z.setAttribute("itemtype","http://schema.org/Comment");z.appendChild(l);z.appendChild(o);z.appendChild(q);z.appendChild(r);z.appendChild(s);if(h===true){z.classList.add("op");l.classList.add("op");l.setAttribute("title","Blog post author; "+ l.getAttribute("title"));m.classList.add("op");m.setAttribute("title","Blog post author: "+ m.getAttribute("title"))};a.innerHTML+=z.outerHTML})};let d=document.getElementById("load-comments");d.remove()})}