(window.blocksyJsonP=window.blocksyJsonP||[]).push([[8],{11:function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};if((t=s({el:null,action:null},t)).el&&t.action&&!t.el.classList.contains("ct-loading")){var e=parseInt(t.el.dataset.page,10);if(("prev"!==t.action||1!==e)&&!(t.el.querySelectorAll(".ct-container > a").length<4&&1===e||t.el.dataset.page.indexOf("last")>-1&&"next"===t.action)){t.el.classList.add("ct-loading");var r="prev"===t.action?e-1:e+1;Promise.all([new Promise((function(e){t.el.classList.add("ct-leave-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-leave-active"),t.el.classList.add("ct-leave"),setTimeout((function(){return e()}),650)}))})),y("".concat(ct_localizations.ajax_url,"?action=blocksy_get_trending_posts&page=").concat(r)).then((function(t){return t.json()}))]).then((function(e){var c=a(e,2),i=(c[0],c[1]),l=i.success,s=i.data;if(l){var u=s.posts,f=u.is_last_page,y=u.posts;t.el.dataset.page="".concat(r).concat(f?":last":""),o(t.el.querySelectorAll("a")).map((function(t){return t.remove()})),y.map((function(e){return t.el.insertAdjacentHTML("beforeend",'\n ').concat(e.image,'\n \n ').concat(e.title,"\n \n "))})),setTimeout((function(){t.el.classList.remove("ct-leave"),t.el.classList.add("ct-enter-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-enter-active"),t.el.classList.add("ct-active"),setTimeout((function(){t.el.classList.remove("ct-active"),t.el.classList.remove("ct-loading")}),650)}))}),50),Object(n.a)(t.el)}}))}}},d=function(t){t.hasListeners||(t.hasListeners=!0,t.querySelector(".ct-arrow-left").addEventListener("click",(function(e){e.preventDefault(),m({el:t,action:"prev"})})),t.querySelector(".ct-arrow-right").addEventListener("click",(function(e){e.preventDefault(),m({el:t,action:"next"})})))}}}]);