/*! * infinite scroll packaged v4.0.1 * automatically add next page * * licensed gplv3 for open source use * or infinite scroll commercial license for commercial use * * https://infinite-scroll.com * copyright 2018-2020 metafizzy */ !function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jquerybridget=e(t,t.jquery)}(window,(function(t,e){let i=t.console,n=void 0===i?function(){}:function(t){i.error(t)};return function(i,o,s){(s=s||e||t.jquery)&&(o.prototype.option||(o.prototype.option=function(t){t&&(this.options=object.assign(this.options||{},t))}),s.fn[i]=function(t,...e){return"string"==typeof t?function(t,e,o){let r,l=`$().${i}("${e}")`;return t.each((function(t,h){let a=s.data(h,i);if(!a)return void n(`${i} not initialized. cannot call method ${l}`);let c=a[e];if(!c||"_"==e.charat(0))return void n(`${l} is not a valid method`);let u=c.apply(a,o);r=void 0===r?u:r})),void 0!==r?r:t}(this,t,e):(r=t,this.each((function(t,e){let n=s.data(e,i);n?(n.option(r),n._init()):(n=new o(e,r),s.data(e,i,n))})),this);var r})}})),function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.evemitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},n=i[t]=i[t]||[];return n.includes(e)||n.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceevents=this._onceevents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let n=i.indexof(e);return-1!=n&&i.splice(n,1),this},e.emitevent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let n=this._onceevents&&this._onceevents[t];for(let o of i){n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,e)}return this},e.alloff=function(){return delete this._events,delete this._onceevents,this},t})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t):t.fizzyuiutils=e(t)}(this,(function(t){let e={extend:function(t,e){return object.assign(t,e)},modulo:function(t,e){return(t%e+e)%e},makearray:function(t){if(array.isarray(t))return t;if(null==t)return[];return"object"==typeof t&&"number"==typeof t.length?[...t]:[t]},removefrom:function(t,e){let i=t.indexof(e);-1!=i&&t.splice(i,1)},getparent:function(t,e){for(;t.parentnode&&t!=document.body;)if((t=t.parentnode).matches(e))return t},getqueryelement:function(t){return"string"==typeof t?document.queryselector(t):t},handleevent:function(t){let e="on"+t.type;this[e]&&this[e](t)},filterfindelements:function(t,i){return(t=e.makearray(t)).filter((t=>t instanceof htmlelement)).reduce(((t,e)=>{if(!i)return t.push(e),t;e.matches(i)&&t.push(e);let n=e.queryselectorall(i);return t=t.concat(...n)}),[])},debouncemethod:function(t,e,i){i=i||100;let n=t.prototype[e],o=e+"timeout";t.prototype[e]=function(){cleartimeout(this[o]);let t=arguments;this[o]=settimeout((()=>{n.apply(this,t),delete this[o]}),i)}},docready:function(t){let e=document.readystate;"complete"==e||"interactive"==e?settimeout(t):document.addeventlistener("domcontentloaded",t)},todashed:function(t){return t.replace(/(.)([a-z])/g,(function(t,e,i){return e+"-"+i})).tolowercase()}},i=t.console;return e.htmlinit=function(n,o){e.docready((function(){let s="data-"+e.todashed(o),r=document.queryselectorall(`[${s}]`),l=t.jquery;[...r].foreach((t=>{let e,r=t.getattribute(s);try{e=r&&json.parse(r)}catch(e){return void(i&&i.error(`error parsing ${s} on ${t.classname}: ${e}`))}let h=new n(t,e);l&&l.data(t,o,h)}))}))},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("fizzy-ui-utils")):t.infinitescroll=e(t,t.evemitter,t.fizzyuiutils)}(window,(function(t,e,i){let n=t.jquery,o={};function s(t,e){let r=i.getqueryelement(t);if(r){if((t=r).infinitescrollguid){let i=o[t.infinitescrollguid];return i.option(e),i}this.element=t,this.options={...s.defaults},this.option(e),n&&(this.$element=n(this.element)),this.create()}else console.error("bad element for infinitescroll: "+(r||t))}s.defaults={},s.create={},s.destroy={};let r=s.prototype;object.assign(r,e.prototype);let l=0;r.create=function(){let t=this.guid=++l;if(this.element.infinitescrollguid=t,o[t]=this,this.pageindex=1,this.loadcount=0,this.updategetpath(),this.getpath&&this.getpath()){this.updategetabsolutepath(),this.log("initialized",[this.element.classname]),this.calloninit();for(let t in s.create)s.create[t].call(this)}else console.error("disabling infinitescroll")},r.option=function(t){object.assign(this.options,t)},r.calloninit=function(){let t=this.options.oninit;t&&t.call(this,this)},r.dispatchevent=function(t,e,i){this.log(t,i);let o=e?[e].concat(i):i;if(this.emitevent(t,o),!n||!this.$element)return;let s=t+=".infinitescroll";if(e){let i=n.event(e);i.type=t,s=i}this.$element.trigger(s,i)};let h={initialized:t=>`on ${t}`,request:t=>`url: ${t}`,load:(t,e)=>`${t.title||""}. url: ${e}`,error:(t,e)=>`${t}. url: ${e}`,append:(t,e,i)=>`${i.length} items. url: ${e}`,last:(t,e)=>`url: ${e}`,history:(t,e)=>`url: ${e}`,pageindex:function(t,e){return`current page determined to be: ${t} from ${e}`}};r.log=function(t,e){if(!this.options.debug)return;let i=`[infinitescroll] ${t}`,n=h[t];n&&(i+=". "+n.apply(this,e)),console.log(i)},r.updatemeasurements=function(){this.windowheight=t.innerheight;let e=this.element.getboundingclientrect();this.top=e.top+t.scrolly},r.updatescroller=function(){let e=this.options.elementscroll;if(e){if(this.scroller=!0===e?this.element:i.getqueryelement(e),!this.scroller)throw new error(`unable to find elementscroll: ${e}`)}else this.scroller=t},r.updategetpath=function(){let t=this.options.path;if(!t)return void console.error(`infinitescroll path option required. set as: ${t}`);let e=typeof t;"function"!=e?"string"==e&&t.match("{{#}}")?this.updategetpathtemplate(t):this.updategetpathselector(t):this.getpath=t},r.updategetpathtemplate=function(t){this.getpath=()=>{let e=this.pageindex+1;return t.replace("{{#}}",e)};let e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new regexp(e),n=location.href.match(i);n&&(this.pageindex=parseint(n[1],10),this.log("pageindex",[this.pageindex,"template string"]))};let a=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/],c=s.getpathparts=function(t){if(t)for(let e of a){let i=t.match(e);if(i){let[,t,e,n]=i;return{begin:t,index:e,end:n}}}};r.updategetpathselector=function(t){let e=document.queryselector(t);if(!e)return void console.error(`bad infinitescroll path option. next link not found: ${t}`);let i=e.getattribute("href"),n=c(i);if(!n)return void console.error(`infinitescroll unable to parse next link href: ${i}`);let{begin:o,index:s,end:r}=n;this.ispathselector=!0,this.getpath=()=>o+(this.pageindex+1)+r,this.pageindex=parseint(s,10)-1,this.log("pageindex",[this.pageindex,"next link"])},r.updategetabsolutepath=function(){let t=this.getpath();if(t.match(/^http/)||t.match(/^\//))return void(this.getabsolutepath=this.getpath);let{pathname:e}=location,i=t.match(/^\?/),n=e.substring(0,e.lastindexof("/")),o=i?e:n+"/";this.getabsolutepath=()=>o+this.getpath()},s.create.hidenav=function(){let t=i.getqueryelement(this.options.hidenav);t&&(t.style.display="none",this.nav=t)},s.destroy.hidenav=function(){this.nav&&(this.nav.style.display="")},r.destroy=function(){this.alloff();for(let t in s.destroy)s.destroy[t].call(this);delete this.element.infinitescrollguid,delete o[this.guid],n&&this.$element&&n.removedata(this.element,"infinitescroll")},s.throttle=function(t,e){let i,n;return e=e||200,function(){let o=+new date,s=arguments,r=()=>{i=o,t.apply(this,s)};i&&o{if(!i.ok){let t=new error(i.statustext);return this.onpageerror(t,o,i),{response:i}}return i[t]().then((s=>("text"==t&&e&&(s=n.parsefromstring(s,"text/html")),204==i.status?(this.lastpagereached(s,o),{body:s,response:i}):this.onpageload(s,o,i))))})).catch((t=>{this.onpageerror(t,o)}));return this.dispatchevent("request",null,[o,s]),s},i.onpageload=function(t,e,i){return this.options.append||(this.isloading=!1),this.pageindex++,this.loadcount++,this.dispatchevent("load",null,[t,e,i]),this.appendnextpage(t,e,i)},i.appendnextpage=function(t,e,i){let{append:n,responsebody:s,domparseresponse:r}=this.options;if(!("text"==s&&r)||!n)return{body:t,response:i};let l=t.queryselectorall(n),h={body:t,response:i,items:l};if(!l||!l.length)return this.lastpagereached(t,e),h;let a=o(l),c=()=>(this.appenditems(l,a),this.isloading=!1,this.dispatchevent("append",null,[t,e,l,i]),h);return this.options.outlayer?this.appendoutlayeritems(a,c):c()},i.appenditems=function(t,e){t&&t.length&&(function(t){let e=t.queryselectorall("script");for(let t of e){let e=document.createelement("script"),i=t.attributes;for(let t of i)e.setattribute(t.name,t.value);e.innerhtml=t.innerhtml,t.parentnode.replacechild(e,t)}}(e=e||o(t)),this.element.appendchild(e))},i.appendoutlayeritems=function(i,n){let o=e.imagesloaded||t.imagesloaded;return o?new promise((function(t){o(i,(function(){let e=n();t(e)}))})):(console.error("[infinitescroll] imagesloaded required for outlayer option"),void(this.isloading=!1))},i.onappendoutlayer=function(t,e,i){this.options.outlayer.appended(i)},i.checklastpage=function(t,e){let i,{checklastpage:n,path:o}=this.options;if(n){if("function"==typeof o){if(!this.getpath())return void this.lastpagereached(t,e)}"string"==typeof n?i=n:this.ispathselector&&(i=o),i&&t.queryselector&&(t.queryselector(i)||this.lastpagereached(t,e))}},i.lastpagereached=function(t,e){this.canload=!1,this.dispatchevent("last",null,[t,e])},i.onpageerror=function(t,e,i){return this.isloading=!1,this.canload=!1,this.dispatchevent("error",null,[t,e,i]),t},e.create.prefill=function(){if(!this.options.prefill)return;let t=this.options.append;t?(this.updatemeasurements(),this.updatescroller(),this.isprefilling=!0,this.on("append",this.prefill),this.once("error",this.stopprefill),this.once("last",this.stopprefill),this.prefill()):console.error(`append option required for prefill. set as :${t}`)},i.prefill=function(){let t=this.getprefilldistance();this.isprefilling=t>=0,this.isprefilling?(this.log("prefill"),this.loadnextpage()):this.stopprefill()},i.getprefilldistance=function(){return this.options.elementscroll?this.scroller.clientheight-this.scroller.scrollheight:this.windowheight-this.element.clientheight},i.stopprefill=function(){this.log("stopprefill"),this.off("append",this.prefill)},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.infinitescroll,t.fizzyuiutils)}(window,(function(t,e,i){let n=e.prototype;return object.assign(e.defaults,{scrollthreshold:400}),e.create.scrollwatch=function(){this.pagescrollhandler=this.onpagescroll.bind(this),this.resizehandler=this.onresize.bind(this);let t=this.options.scrollthreshold;(t||0===t)&&this.enablescrollwatch()},e.destroy.scrollwatch=function(){this.disablescrollwatch()},n.enablescrollwatch=function(){this.isscrollwatching||(this.isscrollwatching=!0,this.updatemeasurements(),this.updatescroller(),this.on("last",this.disablescrollwatch),this.bindscrollwatchevents(!0))},n.disablescrollwatch=function(){this.isscrollwatching&&(this.bindscrollwatchevents(!1),delete this.isscrollwatching)},n.bindscrollwatchevents=function(e){let i=e?"addeventlistener":"removeeventlistener";this.scroller[i]("scroll",this.pagescrollhandler),t[i]("resize",this.resizehandler)},n.onpagescroll=e.throttle((function(){this.getbottomdistance()<=this.options.scrollthreshold&&this.dispatchevent("scrollthreshold")})),n.getbottomdistance=function(){let e,i;return this.options.elementscroll?(e=this.scroller.scrollheight,i=this.scroller.scrolltop+this.scroller.clientheight):(e=this.top+this.element.clientheight,i=t.scrolly+this.windowheight),e-i},n.onresize=function(){this.updatemeasurements()},i.debouncemethod(e,"onresize",150),e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.infinitescroll,t.fizzyuiutils)}(window,(function(t,e,i){let n=e.prototype;object.assign(e.defaults,{history:"replace"});let o=document.createelement("a");return e.create.history=function(){if(!this.options.history)return;o.href=this.getabsolutepath(),(o.origin||o.protocol+"//"+o.host)==location.origin?this.options.append?this.createhistoryappend():this.createhistorypageload():console.error(`[infinitescroll] cannot set history with different origin: ${o.origin} on ${location.origin} . history behavior disabled.`)},n.createhistoryappend=function(){this.updatemeasurements(),this.updatescroller(),this.scrollpages=[{top:0,path:location.href,title:document.title}],this.scrollpage=this.scrollpages[0],this.scrollhistoryhandler=this.onscrollhistory.bind(this),this.unloadhandler=this.onunload.bind(this),this.scroller.addeventlistener("scroll",this.scrollhistoryhandler),this.on("append",this.onappendhistory),this.bindhistoryappendevents(!0)},n.bindhistoryappendevents=function(e){let i=e?"addeventlistener":"removeeventlistener";this.scroller[i]("scroll",this.scrollhistoryhandler),t[i]("unload",this.unloadhandler)},n.createhistorypageload=function(){this.on("load",this.onpageloadhistory)},e.destroy.history=n.destroyhistory=function(){this.options.history&&this.options.append&&this.bindhistoryappendevents(!1)},n.onappendhistory=function(t,e,i){if(!i||!i.length)return;let n=i[0],s=this.getelementscrolly(n);o.href=e,this.scrollpages.push({top:s,path:o.href,title:t.title})},n.getelementscrolly=function(e){if(this.options.elementscroll)return e.offsettop-this.top;return e.getboundingclientrect().top+t.scrolly},n.onscrollhistory=function(){let t=this.getclosestscrollpage();t!=this.scrollpage&&(this.scrollpage=t,this.sethistory(t.title,t.path))},i.debouncemethod(e,"onscrollhistory",150),n.getclosestscrollpage=function(){let e,i;e=this.options.elementscroll?this.scroller.scrolltop+this.scroller.clientheight/2:t.scrolly+this.windowheight/2;for(let t of this.scrollpages){if(t.top>=e)break;i=t}return i},n.sethistory=function(t,e){let i=this.options.history;i&&history[i+"state"]&&(history[i+"state"](null,t,e),this.options.historytitle&&(document.title=t),this.dispatchevent("history",null,[t,e]))},n.onunload=function(){if(0===this.scrollpage.top)return;let e=t.scrolly-this.scrollpage.top+this.top;this.destroyhistory(),scrollto(0,e)},n.onpageloadhistory=function(t,e){this.sethistory(t.title,e)},e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.infinitescroll,t.fizzyuiutils)}(window,(function(t,e,i){class n{constructor(t,e){this.element=t,this.infscroll=e,this.clickhandler=this.onclick.bind(this),this.element.addeventlistener("click",this.clickhandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}onclick(t){t.preventdefault(),this.infscroll.loadnextpage()}enable(){this.element.removeattribute("disabled")}disable(){this.element.disabled="disabled"}hide(){this.element.style.display="none"}destroy(){this.element.removeeventlistener("click",this.clickhandler)}}return e.create.button=function(){let t=i.getqueryelement(this.options.button);t&&(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},e.button=n,e})),function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.infinitescroll,t.fizzyuiutils)}(window,(function(t,e,i){let n=e.prototype;function o(t){r(t,"none")}function s(t){r(t,"block")}function r(t,e){t&&(t.style.display=e)}return e.create.status=function(){let t=i.getqueryelement(this.options.status);t&&(this.statuselement=t,this.statuseventelements={request:t.queryselector(".infinite-scroll-request"),error:t.queryselector(".infinite-scroll-error"),last:t.queryselector(".infinite-scroll-last")},this.on("request",this.showrequeststatus),this.on("error",this.showerrorstatus),this.on("last",this.showlaststatus),this.bindhidestatus("on"))},n.bindhidestatus=function(t){let e=this.options.append?"append":"load";this[t](e,this.hideallstatus)},n.showrequeststatus=function(){this.showstatus("request")},n.showerrorstatus=function(){this.showstatus("error")},n.showlaststatus=function(){this.showstatus("last"),this.bindhidestatus("off")},n.showstatus=function(t){s(this.statuselement),this.hidestatuseventelements(),s(this.statuseventelements[t])},n.hideallstatus=function(){o(this.statuselement),this.hidestatuseventelements()},n.hidestatuseventelements=function(){for(let t in this.statuseventelements){o(this.statuseventelements[t])}},e})), /*! * imagesloaded v4.1.4 * javascript is all like "you images are done yet or what?" * mit license */ function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesloaded=e(t,t.evemitter)}("undefined"!=typeof window?window:this,(function(t,e){"use strict";var i=t.jquery,n=t.console;function o(t,e){for(var i in e)t[i]=e[i];return t}var s=array.prototype.slice;function r(t,e,l){if(!(this instanceof r))return new r(t,e,l);var h,a=t;("string"==typeof t&&(a=document.queryselectorall(t)),a)?(this.elements=(h=a,array.isarray(h)?h:"object"==typeof h&&"number"==typeof h.length?s.call(h):[h]),this.options=o({},this.options),"function"==typeof e?l=e:o(this.options,e),l&&this.on("always",l),this.getimages(),i&&(this.jqdeferred=new i.deferred),settimeout(this.check.bind(this))):n.error("bad element for imagesloaded "+(a||t))}r.prototype=object.create(e.prototype),r.prototype.options={},r.prototype.getimages=function(){this.images=[],this.elements.foreach(this.addelementimages,this)},r.prototype.addelementimages=function(t){"img"==t.nodename&&this.addimage(t),!0===this.options.background&&this.addelementbackgroundimages(t);var e=t.nodetype;if(e&&l[e]){for(var i=t.queryselectorall("img"),n=0;n