/*! * WP Grid Builder Bricks Add-on * * @package WP Grid Builder - Bricks * @author Loïc Blascos * @link https://www.wpgridbuilder.com * @copyright 2019-2023 Loïc Blascos * */ !function(){var e={132:function(){[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(e){e.hasOwnProperty("after")||Object.defineProperty(e,"after",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))})),this.parentNode.insertBefore(t,this.nextSibling)}})}))},345:function(){[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))})),this.appendChild(t)}})}))},965:function(){[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(e){e.hasOwnProperty("before")||Object.defineProperty(e,"before",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))})),this.parentNode.insertBefore(t,this)}})}))},915:function(){Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})},14:function(e,t,n){var i,o,s,a,r,c=n(114);a=void 0!==n.g?n.g:this,r=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,o=-1,s="",a=n.charCodeAt(0);++o=1&&t<=31||127==t||0==o&&t>=48&&t<=57||1==o&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==o&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(o):n.charAt(o):s+="�";return s};return e.CSS||(e.CSS={}),e.CSS.escape=t,t},"object"==c(t)?e.exports=r(a):(o=[],i=r.bind(a,a),void 0===(s="function"==typeof i?i.apply(t,o):i)||(e.exports=s))},334:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector)},358:function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n-1;a--){var r,c;n.children[a].removeAttribute("data-options"),n.children[a].classList.remove("bricks-lazy-hidden"),this.instance.facets.isLoadingMore()||n.children[a].classList.add("wpgb-loading"),null!==(r=n.children[a])&&void 0!==r&&null!==(c=r.classList)&&void 0!==c&&c.contains("brx-query-trail")||o.after(n.children[a])}requestAnimationFrame((function(){return t.loading(!1)})),this.instance.facets.emit("appended",[s,i]),e.posts=""}}},{key:"appended",value:function(){o()}},{key:"loading",value:function(e){if(!this.instance.facets.isLoadingMore())for(var t=e?"add":"remove",n=this.placeholder.nextElementSibling;n&&(n.id===this.className||n.classList.contains(this.className)||n.classList.contains("bricks-posts-nothing-found"));){var i,o;null===(i=(o=n.classList)[t])||void 0===i||i.call(o,"wpgb-loading"),n=n.nextElementSibling}}},{key:"setupPlaceholder",value:function(){this.placeholder=document.createComment(" Gridbuilder ᵂᴾ Plugin (https://wpgridbuilder.com) "),this.instance.element.parentElement.insertBefore(this.placeholder,this.instance.element)}},{key:"changeElement",value:function(){this.instance.element.removeAttribute("data-instance"),this.instance.element.classList.remove("wpgb-enabled"),this.instance.element=this.instance.element.parentElement,this.instance.facets.element=this.instance.element,this.instance.element.classList.add("wpgb-enabled"),this.instance.element.dataset.instance=this.instance.instance}}]),t}();function c(e){if(e.options&&e.options.element&&e.options.isTemplate&&"Bricks"===e.options.isTemplate)switch(e.options.element){case"posts":new s(e);break;case"div":case"block":case"container":new r(e);break;case"woocommerce-products":new a(e)}}function l(){if(WP_Grid_Builder.instances&&Object.keys(WP_Grid_Builder.instances).length)for(var e in WP_Grid_Builder.instances)c(WP_Grid_Builder.instances[e]);else WP_Grid_Builder.on("init",c)}window.WP_Grid_Builder?l():window.addEventListener("wpgb.loaded",(function(){return l()}))}()}();