/home/silvwabw/public_html/wp-content/plugins/gutenverse/assets/js/frontend/postlist.js
(()=>{var t={77(t,e,r){var n=r(5364),o=r(6615),a=r(3676),i=r(2489),c=r(2039),u=r(6624),s=r(1513),l="[object Map]",p="[object Promise]",f="[object Set]",b="[object WeakMap]",d="[object DataView]",y=s(n),g=s(o),v=s(a),m=s(i),j=s(c),h=u;(n&&h(new n(new ArrayBuffer(1)))!=d||o&&h(new o)!=l||a&&h(a.resolve())!=p||i&&h(new i)!=f||c&&h(new c)!=b)&&(h=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,n=r?s(r):"";if(n)switch(n){case y:return d;case g:return l;case v:return p;case m:return f;case j:return b}return e}),t.exports=h},951(t){t.exports=function(t,e){return function(r){return t(e(r))}}},1187(t,e,r){var n=r(1330),o=r(1992),a=r(7717),i=r(1513),c=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,l=u.toString,p=s.hasOwnProperty,f=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||o(t))&&(n(t)?f:c).test(i(t))}},1327(t){var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},1330(t,e,r){var n=r(6624),o=r(7717);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1513(t){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},1992(t,e,r){var n,o=r(2353),a=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!a&&a in t}},2039(t,e,r){var n=r(2310)(r(8453),"WeakMap");t.exports=n},2050(t){t.exports=function(t){return null!=t&&"object"==typeof t}},2055(t){t.exports=function(){return!1}},2310(t,e,r){var n=r(1187),o=r(3584);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},2353(t,e,r){var n=r(8453)["__core-js_shared__"];t.exports=n},2489(t,e,r){var n=r(2310)(r(8453),"Set");t.exports=n},3584(t){t.exports=function(t,e){return null==t?void 0:t[e]}},3676(t,e,r){var n=r(2310)(r(8453),"Promise");t.exports=n},4061(t,e,r){var n=r(6624),o=r(9358),a=r(2050),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(t){return a(t)&&o(t.length)&&!!i[n(t)]}},4073(t,e,r){var n=r(8453).Symbol;t.exports=n},4167(t,e,r){var n=r(4061),o=r(8877),a=r(6273),i=a&&a.isTypedArray,c=i?o(i):n;t.exports=c},4478(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},4633(t,e,r){var n=r(5152),o=r(77),a=r(6356),i=r(6521),c=r(8710),u=r(9232),s=r(1327),l=r(4167),p=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(c(t)&&(i(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||l(t)||a(t)))return!t.length;var e=o(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(s(t))return!n(t).length;for(var r in t)if(p.call(t,r))return!1;return!0}},5152(t,e,r){var n=r(1327),o=r(5450),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))a.call(t,r)&&"constructor"!=r&&e.push(r);return e}},5364(t,e,r){var n=r(2310)(r(8453),"DataView");t.exports=n},5450(t,e,r){var n=r(951)(Object.keys,Object);t.exports=n},6273(t,e,r){t=r.nmd(t);var n=r(8928),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,c=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=c},6356(t,e,r){var n=r(7382),o=r(2050),a=Object.prototype,i=a.hasOwnProperty,c=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return o(t)&&i.call(t,"callee")&&!c.call(t,"callee")};t.exports=u},6521(t){var e=Array.isArray;t.exports=e},6615(t,e,r){var n=r(2310)(r(8453),"Map");t.exports=n},6624(t,e,r){var n=r(4073),o=r(7915),a=r(4478),i=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):a(t)}},7382(t,e,r){var n=r(6624),o=r(2050);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},7717(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7915(t,e,r){var n=r(4073),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=i.call(t);return n&&(e?t[c]=r:delete t[c]),o}},8453(t,e,r){var n=r(8928),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},8710(t,e,r){var n=r(1330),o=r(9358);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},8877(t){t.exports=function(t){return function(e){return t(e)}}},8928(t,e,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},9232(t,e,r){t=r.nmd(t);var n=r(8453),o=r(2055),a=e&&!e.nodeType&&e,i=a&&t&&!t.nodeType&&t,c=i&&i.exports===a?n.Buffer:void 0,u=(c?c.isBuffer:void 0)||o;t.exports=u},9358(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={id:n,loaded:!1,exports:{}};return t[n](a,a.exports,r),a.loaded=!0,a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function n(t,r,n){return(r=e(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function o(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}const c=gutenverseCoreFrontend;var u=r(4633),s=r.n(u);const l=window.wp.apiFetch;var p=r.n(l);const f=window.wp.url;function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}var g=function(e){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),e=this,o=arguments,n=a(n=r),function(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,y()?Reflect.construct(n,o||[],a(e).constructor):n.apply(e,o));var e,n,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(r,e),n=r,(u=[{key:"init",value:function(){var t=this;this._elements.map(function(e){t._tabItems(e)})}},{key:"_loadMore",value:function(t,e){var r=this,n=t.find(".guten-postlist").data("id"),o=e.postId,a=e.inheritQuery,i=e.postType,u=e.postOffset,l=e.numberPost,b=e.includePost,d=e.excludePost,y=e.includeCategory,g=e.excludeCategory,v=e.includeAuthor,m=e.includeTag,j=e.excludeTag,h=e.sortBy,w=e.layout,O=e.imageEnabled,x=e.backgroundImageEnabled,P=e.iconEnabled,_=e.icon,I=e.metaEnabled,D=e.metaDateEnabled,S=e.metaDateType,T=e.metaDateFormat,A=e.metaDateFormatCustom,E=e.metaDateIcon,k=e.metaDateIconPosition,q=e.metaCategoryEnabled,C=e.metaCategoryIcon,F=e.metaPosition,M=e.paginationMode,B=e.paginationLoadmoreText,L=e.paginationLoadingText,N=e.paginationNumberPost,G=e.paginationScrollLimit,R=e.paginationIcon,$=e.paginationIconPosition,U=null,Q=!1;window.GutenverseData&&!s()(window.GutenverseData.query)&&(U=window.GutenverseData.query,Q=!0),t.find(".guten-block-loadmore").html("<span>".concat(L,"</span>")),p()({path:(0,f.addQueryArgs)("/gutenverse-client/v1/postlist/data",{context:"edit",attributes:{elementId:n,postId:o,inheritQuery:a,postType:i,postOffset:u,numberPost:parseInt(l)+parseInt(N),includePost:b,excludePost:d,includeCategory:y,excludeCategory:g,includeAuthor:v,includeTag:m,excludeTag:j,sortBy:h,layout:w,imageEnabled:O,backgroundImageEnabled:x,iconEnabled:P,icon:_,metaEnabled:I,metaDateEnabled:D,metaDateType:S,metaDateFormat:T,metaDateFormatCustom:A,metaDateIcon:E,metaDateIconPosition:k,metaCategoryEnabled:q,metaCategoryIcon:C,metaPosition:F,paginationMode:M,paginationLoadmoreText:B,paginationLoadingText:L,paginationNumberPost:N,paginationScrollLimit:G,paginationIcon:R,paginationIconPosition:$,qApi:Q,qSearch:U&&U.q_search,qCategory:U&&U.q_category_name,qTag:U&&U.q_tag,qAuthor:U&&U.q_author}})}).then(function(o){if(t.replace(o.rendered),t.find(".guten-block-loadmore").text(B),"scrollload"===M&&r._shouldItBeLoading(t,e)){var a=(0,c.u)(".".concat(n,".guten-post-list")),i=JSON.parse(a.find(".guten-postlist").data("settings"));r._loadMore(a,i)}else r._tabItems(".".concat(n,".guten-post-list"))}).catch(function(){})}},{key:"_shouldItBeLoading",value:function(t,e){var r=e.numberPost,n=e.paginationScrollLimit,o=t.find(".guten-block-loadmore");return o.length>0&&o.first().getBoundingClientRect().y<window.screen.height/2&&(parseInt(n)>=parseInt(r)||0===parseInt(n))}},{key:"_paginatePosts",value:function(t,e,r){var n=this,o=t.find(".guten-postlist").data("id"),a=parseInt(t.find(".guten_block_nav").data("page")||1),i=parseInt(e.numberPost,10);isNaN(r)?"next"===r?a+=1:"prev"===r&&a>1&&(a-=1):a=r;var c=null,u=!1;window.GutenverseData&&!s()(window.GutenverseData.query)&&(c=window.GutenverseData.query,u=!0),p()({path:(0,f.addQueryArgs)("/gutenverse-client/v1/postlist/data",{attributes:d(d({},e),{},{paged:a,numberPost:i,paginationNumberPost:i,qApi:u,qSearch:c&&c.q_search,qCategory:c&&c.q_category_name,qTag:c&&c.q_tag,qAuthor:c&&c.q_author})})}).then(function(e){t.html(e.rendered),n._tabItems(".".concat(o,".guten-post-list"))}).catch(function(){})}},{key:"_tabItems",value:function(t){var e=this,r=(0,c.u)(t),n=JSON.parse(r.find(".guten-postlist").data("settings")),o=n.paginationMode;if("scrollload"===o){var a,i=function(){clearTimeout(a),a=setTimeout(function(){e._shouldItBeLoading(r,n)&&e._loadMore(r,n)},500)};window.removeEventListener("scroll",i),window.addEventListener("scroll",i)}if("prevnext"===o||"number"===o){var u=r.find(".guten_block_nav .prev"),s=r.find(".guten_block_nav .next");u.on("click",function(t){t.preventDefault(),u.hasClass("disabled")||e._paginatePosts(r,n,"prev")}),s.on("click",function(t){t.preventDefault(),s.hasClass("disabled")||e._paginatePosts(r,n,"next")}),"number"===o&&"number"===o&&document.querySelectorAll(".guten_block_nav .btn-pagination").forEach(function(t){var o=t.getAttribute("data-page");o&&!isNaN(o)&&t.addEventListener("click",function(t){t.preventDefault(),e._paginatePosts(r,n,o)})})}r.find(".guten-block-loadmore").on("click",function(){e._loadMore(r,n)})}}])&&o(n.prototype,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,u}(c.Default),v=(0,c.u)(".guten-post-list");v&&new g(v)})()})();