/*! * DisqusJS | v0.2.5 * Author: SukkaW * Link: https://github.com/SukkaW/DisqusJS * License: GPL-3.0 */"use strict";!function(){var n=new XMLHttpRequest;function d(s,e){try{localStorage.setItem(s,e)}catch(s){console.log("Failed to set localStorage item")}}function e(){var e=new Image,t=setTimeout(function(){e.onerror=e.onload=null,d("disqusjs_mode","dsqjs"),r()},2e3);e.onerror=function(){clearTimeout(t),d("disqusjs_mode","dsqjs"),r()},e.onload=function(){clearTimeout(t);var s=setTimeout(function(){e.onerror=e.onload=null,d("disqusjs_mode","dsqjs"),r()},2e3);e.onerror=function(){clearTimeout(s),d("disqusjs_mode","dsqjs"),r()},e.onload=function(){clearTimeout(s),d("disqusjs_mode","disqus"),r()},e.src="https://".concat(disqusjs.config.shortname,".disqus.com/favicon.ico?").concat(+new Date)},e.src="https://disqus.com/favicon.ico?".concat(+new Date)}function t(){d("disqusjs_mode","dsqjs"),r()}function o(){d("disqusjs_mode","disqus"),r()}function i(){document.getElementById("dsqjs-loading-dsqjs").classList.remove("dsqjs-hide"),document.getElementById("dsqjs-load-error").classList.add("dsqjs-hide"),document.getElementById("dsqjs-force-disqus").addEventListener("click",o),document.getElementById("dsqjs-reload-disqus").addEventListener("click",e);var s="".concat(disqusjs.config.api,"3.0/threads/list.json?forum=").concat(disqusjs.config.shortname,"&thread=ident:").concat(disqusjs.config.identifier,"&api_key=").concat(disqusjs.config.apikey);n.open("GET",s,!0),n.timeout=4e3,n.send(),n.onload=function(){if(200===this.status||304===this.status){var s=JSON.parse(this.responseText).response;if(1===s.length){var e=s[0];disqusjs.page={id:e.id,title:e.title,isClosed:e.isClosed,length:e.posts},function e(s){s=s?"&cursor=".concat(s):"";var t="".concat(disqusjs.config.api,"3.0/posts/list.json?forum=").concat(disqusjs.config.shortname,"&thread=").concat(disqusjs.page.id).concat(s,"&api_key=").concat(disqusjs.config.apikey);n.open("GET",t,!0);n.timeout=4e3;n.send();n.onload=function(){if(200===this.status||304===this.status){var s=JSON.parse(this.responseText);0===s.code&&0'),s.comment.authorEl='').concat(s.comment.author.name,"")):(s.comment.avatarEl=''),s.comment.authorEl="".concat(s.comment.author.name)),s.isPrimary&&(s.comment.authorEl+=''.concat(disqusjs.config.adminLabel,"")),s.children&&(s.nesting=1),s}function i(s){var e='
'.concat(s.avatarEl,'
').concat(s.authorEl,'
').concat(s.message,"
");return e}s.map(function(s){s=o(s);var e='
  • ').concat(i(s.comment)).concat(function e(s){var t=s.nesting,n=s.children||[];if(!n)return;var d=t<4?'