"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _createForOfIteratorHelper(e,o){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=_unsupportedIterableToArray(e))||o&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return r=e.done,e},e:function(e){a=!0,i=e},f:function(){try{r||null==t.return||t.return()}finally{if(a)throw i}}}}function _unsupportedIterableToArray(e,o){if(e){if("string"==typeof e)return _arrayLikeToArray(e,o);var t=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(t="Object"===t&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,o):void 0}}function _arrayLikeToArray(e,o){(null==o||o>e.length)&&(o=e.length);for(var t=0,n=new Array(o);t'+_.label+"")}}catch(e){a.e(e)}finally{a.f()}}else t.append('

'+botiga_hfb.i18n.elementsMessage+"

");if(o.mobile="mobile_offcanvas"!==e?o.mobile.filter(function(e){return"mobile_offcanvas_menu"!==e.id}):o.mobile.filter(function(e){return"secondary_menu"!==e.id&&"mobile_hamburger"!==e.id}),o.mobile.length){var c,s=_createForOfIteratorHelper(o.mobile);try{for(s.s();!(c=s.n()).done;){var l=c.value;n.append('
'+l.label+"
")}}catch(e){s.e(e)}finally{s.f()}}else n.append('

'+botiga_hfb.i18n.elementsMessage+"

");this.addUpsellComponents()},updateAvailableComponents:function(){"header"===this.currentBuilderType&&(O(".botiga-header-builder-available-components").html(""),O(".botiga-header-builder-available-components").html(O(".botiga-bhfb-header .botiga-bhfb-elements-desktop").html()),O(".botiga-header-builder-available-mobile-components").html(""),O(".botiga-header-builder-available-mobile-components").html(O(".botiga-bhfb-header .botiga-bhfb-elements-mobile").html())),"footer"===this.currentBuilderType&&(O(".botiga-footer-builder-available-footer-components").html(""),O(".botiga-footer-builder-available-footer-components").html(O(".botiga-bhfb-footer .botiga-bhfb-elements-desktop").html()))},addUpsellComponents:function(){if(!botiga_hfb.upsell_components.enable)return!1;var e,o="",t=_createForOfIteratorHelper("header"===this.currentBuilderType?botiga_hfb.upsell_components.header:botiga_hfb.upsell_components.footer);try{for(t.s();!(e=t.n()).done;){var n=e.value;o+='\n
\n '.concat(n.label," \n
\n ")}}catch(e){t.e(e)}finally{t.f()}var i='\n
\n

'.concat(botiga_hfb.upsell_components.title,'

\n
').concat(o,"
\n

").concat(botiga_hfb.upsell_components.total,'

\n ').concat(botiga_hfb.upsell_components.button,"\n
\n ");O("#botiga-bhfb-elements .botiga-bhfb-elements-wrapper .botiga-bhfb-upsell-components-wrapper").remove(),O("#botiga-bhfb-elements .botiga-bhfb-elements-wrapper").append(i)},elementsButton:function(){var n=this;O(document).on("click",".botiga-bhfb-element > a",function(e){e.preventDefault(),e.stopPropagation();var o=O(this).data("bhfb-id"),t=O(this).data("bhfb-focus-section");if(O(this).closest("#botiga-bhfb-elements").length)n.elementsButtonAdd(o),n.currentBuilder.find("#botiga-bhfb-elements").removeClass("show");else if(e.target.classList.contains("bhfb-remove-element"))return n.elementsButtonRemove(o),!1;setTimeout(function(){wp.customize.section(t).focus()},n.updateGridDelay)})},elementsButtonAdd:function(e){var o=1 .bhfb-button").data("bhfb-id"),n=o.item.closest(".botiga-bhfb-area").data("bhfb-row"),i=o.item.closest(".botiga-bhfb-area").index()-1,r=null!==o.sender?o.sender.data("bhfb-row"):null,a=null!==o.sender?o.sender.index()-1:null;if(null===o.sender)return _.elementsButtonAdd("",!0),!1;o.sender.hasClass("bhfb-available-components")||(_.currentRowInput=O("#_customize-input-botiga_"+_.currentBuilderType+"_row__"+r)),_.currentColumnPos=a,_.elementsButtonRemove(t,!0),o.sender.hasClass("bhfb-available-components")||(_.currentRowInput=O("#_customize-input-botiga_"+_.currentBuilderType+"_row__"+n)),_.currentColumnPos=i,_.elementsButtonAdd(t,!0)}}}),O(this).disableSelection()})},builderGridContent:function(){var k=this,B=["#_customize-input-botiga_header_row__above_header_row","#_customize-input-botiga_header_row__main_header_row","#_customize-input-botiga_header_row__below_header_row","#_customize-input-botiga_header_row__mobile_offcanvas"],T="hb";if(k.currentBuilderType&&"footer"===k.currentBuilderType&&(B=["#_customize-input-botiga_footer_row__above_footer_row","#_customize-input-botiga_footer_row__main_footer_row","#_customize-input-botiga_footer_row__below_footer_row"],T="fb"),k.builderGridContentFlag)return!1;k.builderGridContentFlag=!0,setTimeout(function(){for(var e=0,o=B;e');var s=O(".botiga-bhfb-"+i+"-row").find(".botiga-bhfb-area:last-child");if(c.length){var l,b=_createForOfIteratorHelper(c);try{for(b.s();!(l=b.n()).done;){var u=l.value;"object"===_typeof(u=k.getElementData(u))&&s.append('')}}catch(e){b.e(e)}finally{b.f()}}a++}}catch(e){_.e(e)}finally{_.f()}}if("mobile"===k.currentDevice){var d,h=1,m=_createForOfIteratorHelper(n.mobile);try{for(m.s();!(d=m.n()).done;){var f=d.value;O(".botiga-bhfb-"+i+"-row").append('
');var p=O(".botiga-bhfb-"+i+"-row").find(".botiga-bhfb-area:last-child");if(f.length){var g,w=_createForOfIteratorHelper(f);try{for(w.s();!(g=w.n()).done;){var v=g.value;"object"===_typeof(v=k.getElementData(v))&&p.append('')}}catch(e){w.e(e)}finally{w.f()}}h++}}catch(e){m.e(e)}finally{m.f()}if(-1!==t.indexOf("mobile_offcanvas")&&(O(".botiga-bhfb-area-offcanvas").html(""),n.mobile_offcanvas.length)){var y,z=_createForOfIteratorHelper(n.mobile_offcanvas[0]);try{for(z.s();!(y=z.n()).done;){var C=y.value;"object"===_typeof(C=k.getElementData(C))&&O(".botiga-bhfb-area-offcanvas").append('')}}catch(e){z.e(e)}finally{z.f()}}}}if(!k.currentBuilder)return k.builderGridContentFlag=!1;k.currentBuilder.hasClass("show")&&!k.currentBuilder.hasClass("show-bottom")?(O(".botiga-bhfb").css("height",0),k.currentBuilder.css("height",k.currentBuilder.find(".botiga-bhfb-top").outerHeight()+47)):k.currentBuilder.css("height",0),k.updateAvailableComponents(),k.elementsSortable(),O(window).trigger("bhfb.grid.ready"),k.builderGridContentFlag=!1},k.updateGridDelay)},getElementData:function(e){var o,t=[].concat(_toConsumableArray(botiga_hfb.components.desktop),_toConsumableArray(botiga_hfb.components.mobile)),n=_createForOfIteratorHelper(t="footer"===this.currentBuilderType?botiga_hfb.components.footer:t);try{for(n.s();!(o=n.n()).done;){var i=o.value;if(i.id===e)return i}}catch(e){n.e(e)}finally{n.f()}return""},showHideBuilder:function(){for(var t=this,e=["botiga_section_hb_wrapper","botiga_section_hb_presets","botiga_section_hb_above_header_row","botiga_section_hb_main_header_row","botiga_section_hb_below_header_row","botiga_section_hb_mobile_offcanvas","header_image","botiga_section_hb_component__logo","botiga_section_hb_component__search","botiga_section_hb_component__social","botiga_section_hb_component__menu","botiga_section_hb_component__secondary_menu","botiga_section_hb_component__contact_info","botiga_section_hb_component__button","botiga_section_hb_component__button2","botiga_section_hb_component__html","botiga_section_hb_component__html2","botiga_section_hb_component__shortcode","botiga_section_hb_component__shortcode2","botiga_section_hb_component__shortcode3","botiga_section_hb_component__login_register","botiga_section_hb_component__woo_icons","botiga_section_hb_component__pll_switcher","botiga_section_hb_component__wpml_switcher","botiga_section_hb_component__mobile_offcanvas_menu","botiga_section_hb_component__mobile_hamburger","botiga_section_fb_wrapper","botiga_section_fb_above_footer_row","botiga_section_fb_main_footer_row","botiga_section_fb_below_footer_row","botiga_section_fb_component__social","botiga_section_fb_component__footer_menu","botiga_section_fb_component__copyright","botiga_section_fb_component__button","botiga_section_fb_component__button2","botiga_section_fb_component__html","botiga_section_fb_component__html2","botiga_section_fb_component__shortcode","botiga_section_fb_component__widget1","botiga_section_fb_component__widget2","botiga_section_fb_component__widget3","botiga_section_fb_component__widget4"],o=0,n=["above","main","below"];o iframe"),o=e?e.contentWindow.document.getElementsByTagName("html")[0]:null,e="header"===this.currentBuilderType?0:99999;if(null===o)return!1;O(o).animate({scrollTop:e},"fast")},getCurrentBuilderByComponent:function(e){return-1!==e.indexOf("_hb_")||-1!==e.indexOf("_header_")||-1!==e.indexOf("header_image")?O(".botiga-bhfb-header"):(-1!==e.indexOf("_fb_")||-1!==e.indexOf("_footer_"))&&O(".botiga-bhfb-footer")},showHideBuilderTop:function(){var o=this;O(".botiga-bhfb-bottom-display").on("click",function(e){e.preventDefault(),O("body").toggleClass("bhfb-active-bottom"),O(this).toggleClass("show"),O(".botiga-bhfb-top").toggleClass("show"),O(".botiga-bhfb").toggleClass("show-bottom"),o.builderGridContent()})},builderCustomColumns:function(){var b=this;["botiga_header_row__above_header_row_columns","botiga_header_row__main_header_row_columns","botiga_header_row__below_header_row_columns","botiga_footer_row__above_footer_row_columns_desktop","botiga_footer_row__main_footer_row_columns_desktop","botiga_footer_row__below_footer_row_columns_desktop"].forEach(function(l){if(void 0!==wp.customize.control(l))for(var e=-1!==l.indexOf("header")?["desktop","tablet"]:["desktop"],o=0,t=e;oe;)c[b.currentDevice].pop();else if(e>c[b.currentDevice].length)for(;c[b.currentDevice].length