/*!
* Valine v1.1.9
* (c) 2017-2018 xCss
* Released under the GPL-2.0 License.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Valine=t():e.Valine=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(1),a=r(o),s=n(2),l=r(s),c={cdn:"https://gravatar.cat.net/avatar/",ds:["mm","identicon","monsterid","wavatar","retro",""],params:"?s=40",hide:!1},u={comment:"",rid:"",nick:"Guest",mail:"",link:"",ua:navigator.userAgent,url:"",pin:0,like:0},p=["nick","mail","link"],h=localStorage,d=function(){function e(t){i(this,e);var n=this;n.version="1.1.8-beta",n.md5=a.default,!!t&&n.init(t)}return e.prototype.init=function(e){var t=this;try{var n="[object HTMLDivElement]"==={}.toString.call(e.el)?e.el:document.querySelectorAll(e.el)[0];if("[object HTMLDivElement]"!={}.toString.call(n))throw"The target element was not found.";t.el=n,t.el.classList.add("valine");var r=e.guest_info||p,i=r.map(function(e){switch(e){case"nick":return'';case"mail":return'';case"link":return'';default:return""}}),o=e.placeholder||"",a='
";t.el.innerHTML=a;var s=t.el.querySelector(".vempty");t.nodata={show:function(e){s.innerHTML=e||"还没有评论哦,快来抢沙发吧!",s.setAttribute("style","display:block;")},hide:function(){s.setAttribute("style","display:none;")}};var l=t.el.querySelector(".vloading");l.innerHTML='',t.loading={show:function(){l.setAttribute("style","display:block;"),t.nodata.hide()},hide:function(){l.setAttribute("style","display:none;"),0===t.el.querySelectorAll(".vcard").length&&t.nodata.show()}},t.notify=e.notify||!1,t.verify=e.verify||!1,c.params="?d="+(c.ds.indexOf(e.avatar)>-1?e.avatar:"mm"),c.hide="hide"===e.avatar;var h=e.av||AV,d=e.app_id||e.appId,v=e.app_key||e.appKey;if(!d||!v)throw t.loading.hide(),"初始化失败,请检查你的appid或者appkey.";h.applicationId=null,h.init({appId:d,appKey:v}),t.v=h,u.url=(e.path||location.pathname).replace(/index\.(html|htm)/,"")}catch(e){var g="https://github.com/xCss/Valine/issues";return void(t.el?t.nodata.show(''+e+"
Valine:"+t.version+"
反馈:"+g+"
"):console)}var m=t.el.querySelector(".vmark");t.alert={show:function(e){m.innerHTML='';var n=m.querySelector(".vbtns"),r='",i='";if(n.innerHTML=""+r+(e.type&&i),m.querySelector(".vcancel").addEventListener("click",function(e){t.alert.hide()}),m.setAttribute("style","display:block;"),e&&e.type){var o=m.querySelector(".vsure");f.on("click",o,function(n){t.alert.hide(),e.cb&&e.cb()})}},hide:function(){m.setAttribute("style","display:none;")}},t.bind(e)},e.prototype.bind=function(e){var t=this,n=(e.guest_info||p).filter(function(e){return p.indexOf(e)>-1}),r=function(e){e.offsetHeight>180&&(e.classList.add("expand"),f.on("click",e,function(t){e.setAttribute("class","vcontent")}))},i=function(e){var n=new t.v.Query("Comment");return n.equalTo("url",u.url),n.descending("createdAt"),n};!function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.loading.show();var e=i();e.limit("1000"),e.find().then(function(e){var n=e.length;if(n){t.el.querySelector(".vlist").innerHTML="";for(var r=0;r'+n+")"}t.loading.hide()}).catch(function(e){t.loading.hide()})}();for(var o=function(e,n){var i=document.createElement("li");i.setAttribute("class","vcard"),i.setAttribute("id",e.id);var o=c.hide?"":'
";i.innerHTML=o+'