!function(t){var e={};function s(l){if(e[l])return e[l].exports;var i=e[l]={i:l,l:!1,exports:{}};return t[l].call(i.exports,i,i.exports,s),i.l=!0,i.exports}s.m=t,s.c=e,s.d=function(t,e,l){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:l})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var l=Object.create(null);if(s.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(l,i,function(e){return t[e]}.bind(null,i));return l},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/",s(s.s=2)}({2:function(t,e,s){t.exports=s("jYgJ")},jYgJ:function(t,e){function s(t,e){var s;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(s=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){s&&(t=s);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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 n,a=!0,r=!1;return{s:function(){s=t[Symbol.iterator]()},n:function(){var t=s.next();return a=t.done,t},e:function(t){r=!0,n=t},f:function(){try{a||null==s.return||s.return()}finally{if(r)throw n}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,l=new Array(e);s=0&&s.item(e)!==l;);}while(e<0&&(l=l.parentElement));return l}),"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e){e=e||window;for(var s=0;s>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var l=arguments[1],i=0;i768)&&proxyURL!=window.location.pathname&&(i._bulkUpdate(),i._wishlistFloatingButton()),1==deactivatedStore)return allHulkWishlistButtons.forEach((function(t){t.remove()})),void document.querySelectorAll("[data-hulksaveforlater]").forEach((function(t){t.remove()}));if((null==customerID||null==customerID||customerID.length<=0)&&(customerStatus="Guest"),"Customer"==customerStatus&&i._deleteHulkWishlist(),window.hulkappsWishlist.productJSON&&window.hulkappsWishlist.productJSON.tags){var e=!!window.hulkappsWishlist.generalSettings.is_exclude_enabled&&window.hulkappsWishlist.generalSettings.is_exclude_enabled,s=window.hulkappsWishlist.generalSettings.exclude_product_tags?window.hulkappsWishlist.generalSettings.exclude_product_tags:[];if(void 0!==s){var l=s.some((function(t){return window.hulkappsWishlist.productJSON.tags.includes(t)}));e&&l&&document.body.classList.add("hide-hulk-wishlist")}}var o=document.querySelector(".hulk-header-icon");if("auto_header_icon"===headerIconPosition&&"header_menu"===headerType&&(o&&o.remove(),i._setHeaderIcon()),"main_menu"===headerType&&o&&o.remove(),saveForLaterType=WishlistSettings.style.save_for_later_type?WishlistSettings.style.save_for_later_type:"individual_button",saveForLaterPosition=WishlistSettings.style.individual_button_position?WishlistSettings.style.individual_button_position:"individual_button_manual",saveAllForLaterPosition=WishlistSettings.style.global_button_position?WishlistSettings.style.global_button_position:"global_button_manual",""!=WishlistSettings.general.google_conversion_tracking_code){var n=document.createElement("script");n.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+WishlistSettings.general.google_conversion_tracking_code),n.async=!0;var a=document.createElement("script");a.innerHTML="window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);} \n",a.innerHTML+="gtag('js', new Date()); \n gtag('config', '"+WishlistSettings.general.google_conversion_tracking_code+"');",document.getElementsByTagName("head")[0].appendChild(n),document.getElementsByTagName("head")[0].appendChild(a)}i._manageGuestCookie(),i._getShopSettings(),i._removeMyWishlist(),i._addProductToCart()},_triggerGAEvent:function(t,e,s){var l={type:t,product_id:e,variant_id:s};null!=customerID&&(l.customer_id=customerID);var o=window.hulkappsWishlist.baseURL+"/event_trigger";i._XMLHttpRequest("POST",o,l,(function(t,e){}))},_bulkUpdate:function(){var t=document.getElementsByName("hulk_wl_item");document.getElementById("hulk_select_all").onclick=function(){selectedMyWishlistProductIds=[],selectedMyWishlistVariantIds=[];var e,l=s(t);try{for(l.s();!(e=l.n()).done;){var o=e.value,n=o.getAttribute("data-prod-id"),a=o.getAttribute("data-var-id");if(hulkSelectCheckbox.checked?o.checked=!0:o.checked=!1,o.checked)selectedMyWishlistProductIds.push(n),selectedMyWishlistVariantIds.push(a);else{var r=selectedMyWishlistProductIds.indexOf(n);-1!==r&&selectedMyWishlistProductIds.splice(r,1);var u=selectedMyWishlistVariantIds.indexOf(n);-1!==u&&selectedMyWishlistVariantIds.splice(u,1)}}}catch(t){l.e(t)}finally{l.f()}i._moveCartProductDetails(),hulkSelectCheckbox.checked?(moveMyWishlistVariantIds.length>0&&(hulkMoveAllItems.style.display="inline-block"),hulkDeleteAllItems.style.display="inline-block"):(hulkMoveAllItems.style.display="none",hulkDeleteAllItems.style.display="none")},hulkDeleteAllItems.onclick=function(){hulkDeleteWishlistItemsPrompt.classList.add("open"),document.querySelector("[data-hulkappsdeleteitemsprompt] h4").innerHTML=WishlistSettings.language.title.delete_bulk_product_text?WishlistSettings.language.title.delete_bulk_product_text:"Are you sure you want to delete selected products?",document.querySelectorAll("[data-deleteHulkWishlistItems]")[0].onclick=function(){hulkDeleteWishlistItemsPrompt.classList.remove("open"),"Guest"==customerStatus?i._removeFromGuestWishlist(selectedMyWishlistProductIds,selectedMyWishlistVariantIds):i._removeFromCustomerWishlist(selectedMyWishlistProductIds,selectedMyWishlistVariantIds)}},document.querySelector("[data-closewishlistitemspopup]").addEventListener("click",(function(t){t.target&&1==t.target.hasAttribute("data-hulkdeleteproduct")||hulkDeleteWishlistItemsPrompt.classList.remove("open")})),"undefined"!=typeof hulkCloseDeleteWishlistItems2&&(hulkCloseDeleteWishlistItems2.onclick=function(){hulkDeleteWishlistItemsPrompt.classList.remove("open")});var e=document.querySelector("[data-hulkappsdeleteitemsprompt]");null!=e&&e.addEventListener("click",(function(t){var e;t.target&&1==t.target.hasAttribute("data-hulkdeleteproduct")||null==t.target.closest(".wishlist-modal")&&(null===(e=document.querySelector("[data-closewishlistitemspopup2]"))||void 0===e||e.click())})),document.querySelectorAll("[data-hulkappsMoveItemsCancel] .icon-wishlist-cross").forEach((function(t){t.onclick=function(){hulkMoveWishlistItemsPrompt.classList.remove("open")}}));var l=document.querySelector("[data-hulkquickview]");null!=l&&l.addEventListener("click",(function(t){var e;null==t.target.closest(".wishlist-modal")&&(null===(e=document.querySelector("[data-hulkquickview]"))||void 0===e||e.classList.remove("open"))})),hulkMoveAllItems.onclick=function(){i._moveCartProductDetails(),i._moveProductToCart(moveMyWishlistProductIds,moveMyWishlistVariantIds)},setTimeout((function(){i._selectWishlistProducts()}),3e3)},_moveCartProductDetails:function(){if(moveMyWishlistProductIds=JSON.parse(JSON.stringify(selectedMyWishlistProductIds)),moveMyWishlistVariantIds=JSON.parse(JSON.stringify(selectedMyWishlistVariantIds)),null!=document.querySelectorAll(".hulk_out_of_stock")&&null!=document.querySelectorAll(".hulk_out_of_stock")){var t,e=s(document.querySelectorAll(".hulk_out_of_stock"));try{for(e.s();!(t=e.n()).done;){var l=t.value,i=moveMyWishlistProductIds.indexOf(l.getAttribute("data-prod-id"));-1!==i&&moveMyWishlistProductIds.splice(i,1);var o=moveMyWishlistVariantIds.indexOf(l.getAttribute("data-var-id"));-1!==o&&moveMyWishlistVariantIds.splice(o,1)}}catch(t){e.e(t)}finally{e.f()}}},_removeMyWishlist:function(){document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("data-hulkdeleteproduct")){t.preventDefault(),t.stopImmediatePropagation();var e=t.target.closest(".wishlist-card"),s=[e.getAttribute("data-proid")],l=[e.getAttribute("data-varid")];hulkDeleteWishlistItemsPrompt.classList.add("open"),document.querySelector("[data-hulkappsdeleteitemsprompt] h4").innerHTML=WishlistSettings.language.title.delete_product_text?WishlistSettings.language.title.delete_product_text:"Are you sure you want to delete this product?",hulkDeleteWishlistItems.onclick=function(){hulkDeleteWishlistItemsPrompt.classList.remove("open"),"Guest"==customerStatus?i._removeFromGuestWishlist(s,l,"single"):i._removeFromCustomerWishlist(s,l,"single")}}}))},_removeFromCustomerWishlist:function(t,e){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l={customer_id:customerID,shop:hulkShopDomain,product_ids:t,variant_ids:e,wishlist_ids:[SelectedWishlistID],type:"web"};if("single"===s){var o=selectedMyWishlistProductIds.indexOf(t[0]);-1!==o&&selectedMyWishlistProductIds.splice(o,1)}i._XMLHttpRequest("POST",window.hulkappsWishlist.baseURL+"/wishlist/delete_product",l,(function(t,e){var s=JSON.parse(e);if(200==t){i._getWishlistProducts(SelectedWishlistID,1),wishlistTotal&&i._updateWishlistTotal(),hulkSelectCheckbox.checked=!1,hulkMoveAllItems.style.display="none",hulkDeleteAllItems.style.display="none",selectedMyWishlistProductIds=[],selectedMyWishlistVariantIds=[];var l="Item removed!";s.message&&(l=s.message);var o=s.isLatestNotification||!1;i._messageUpdate(l,s.title,s.image,o)}else{var n="Something went wrong. Please try again later !";s.message&&(n=s.message),i._messageUpdate(n)}}))},_removeFromGuestWishlist:function(t,e){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=window.hulkappsWishlist.baseURL+"/wishlist/delete_product/guest",o={shop:hulkShopDomain,product_ids:t,variant_ids:e,uuid:hulkUserUUID,type:"web"};if("single"===s){var n=selectedMyWishlistProductIds.indexOf(t[0]);-1!==n&&selectedMyWishlistProductIds.splice(n,1)}i._XMLHttpRequest("POST",l,o,(function(t,e){JSON.parse(e);if(200==t)null!=hulkUserUUID&&i._guestWishlistAPI(hulkUserUUID,1),i._updateWishlistTotal(),hulkSelectCheckbox.checked=!1,hulkMoveAllItems.style.display="none",hulkDeleteAllItems.style.display="none",selectedMyWishlistProductIds=[],selectedMyWishlistVariantIds=[];else{var s=JSON.parse(e),l="Something went wrong. Please try again later";e.message&&(l=s.message),i._messageUpdate(l)}}))},_selectWishlistProducts:function(){null!=document.querySelectorAll("[hulk-select-products]")&&null!=document.querySelectorAll("[hulk-select-products]")&&document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("hulk-select-products")){var e=t.target,s=e.getAttribute("data-prod-id"),l=e.getAttribute("data-var-id");if(e.checked)selectedMyWishlistProductIds.push(s),selectedMyWishlistVariantIds.push(l);else{var i=selectedMyWishlistProductIds.indexOf(s);-1!==i&&selectedMyWishlistProductIds.splice(i,1);var o=selectedMyWishlistVariantIds.indexOf(l);-1!==o&&selectedMyWishlistVariantIds.splice(o,1)}selectedMyWishlistProductIds.length>0&&productsCount!=outStockProductsCount?hulkMoveAllItems.style.display="inline-block":hulkMoveAllItems.style.display="none",selectedMyWishlistProductIds.length>0?hulkDeleteAllItems.style.display="inline-block":hulkDeleteAllItems.style.display="none",productsCount==selectedMyWishlistProductIds.length?hulkSelectCheckbox.checked=!0:hulkSelectCheckbox.checked=!1}}))},_addProductToCart:function(){document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("data-addprotocart")){t.preventDefault();var e=[currentParent.getAttribute("data-proid")],s=[currentParent.getAttribute("data-varid")];i._moveProductToCart(e,s,"single")}}))},_loadCustomJs:function(){var t=WishlistSettings.general.custom_js;if(WishlistSettings.general&&t&&""!=t){var e=document.createElement("script");e.type="text/javascript",e.appendChild(document.createTextNode(WishlistSettings.general.custom_js)),document.getElementsByTagName("head")[0].appendChild(e)}},_moveProductToCart:function(t,e){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("single"===s){var l=selectedMyWishlistProductIds.indexOf(t[0]);-1!==l&&selectedMyWishlistProductIds.splice(l,1)}var o=WishlistSettings.general.stay_WL_page_after_add_cart;void 0===WishlistSettings.general.stay_WL_page_after_add_cart&&(o=!0);for(var n=[],a=0;a0&&fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(c)}).then((function(l){if(200===l.status){for(var n=0;n '+e:"text"===WishlistSettings.style.floating_button_type?t+=e:t+='',t+="",document.body.insertAdjacentHTML("beforeend",t);var s=document.querySelector(".hulk-sidebar-widget"),l=s.style.backgroundColor=WishlistSettings.style.floating_button_background_color?WishlistSettings.style.floating_button_background_color:"#5C6AC4",o=s.style.color=WishlistSettings.style.floating_button_text_color?WishlistSettings.style.floating_button_text_color:"right_center";s.style.paddingTop=s.style.paddingBottom=WishlistSettings.style.floating_button_top_bottom_vertical_space?WishlistSettings.style.floating_button_top_bottom_vertical_space+"px":"6px",s.style.paddingLeft=s.style.paddingRight=s.style.paddingRight=WishlistSettings.style.floating_button_left_right_vertical_space?WishlistSettings.style.floating_button_left_right_vertical_space+"px":"8px",s.style.fontSize=WishlistSettings.style.floating_button_font_size?WishlistSettings.style.floating_button_font_size+"px":"14px",s.style.fontWeight=s.style.paddingRight=WishlistSettings.style.floating_button_font_weight?WishlistSettings.style.floating_button_font_weight:"600";var n=WishlistSettings.style.floating_button_position?WishlistSettings.style.floating_button_position:"right_center";s.setAttribute("data-position",n),document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.remove("open");var a=!!WishlistSettings.general.is_my_wishlist_custom_title&&WishlistSettings.general.is_my_wishlist_custom_title,r=WishlistSettings.general.my_wishlist_custom_title?WishlistSettings.general.my_wishlist_custom_title:"Your Wishlist";document.querySelectorAll("[data-sidebarWidgetwishlisttitle]")[0].innerHTML=a?r:WishlistSettings.language.title.guest_wishlist_title,"popup"===WishlistSettings.style.display_my_wishlist_as?(null==document.querySelector("[data-viewMore]")&&null==document.querySelector("[data-viewMore]")||document.querySelector("[data-viewMore]").setAttribute("href",proxyURL),i._openMyWishlistPopup(s)):s.setAttribute("href",proxyURL),document.addEventListener("mouseover",(function(t){t.target&&1==t.target.hasAttribute("hulk-floating-btn")&&(t.target.style.backgroundColor=WishlistSettings.style.hover_floating_button_background_color?WishlistSettings.style.hover_floating_button_background_color:"#5c6ac4",t.target.style.color=WishlistSettings.style.hover_floating_button_text_color?WishlistSettings.style.hover_floating_button_text_color:"#ffffff")})),document.addEventListener("mouseout",(function(t){t.target&&1==t.target.hasAttribute("hulk-floating-btn")&&(t.target.style.backgroundColor=l,t.target.style.color=o)}))},_removeBulkActions:function(){if(void 0!==WishlistSettings.general.bulk_action_enabled&&!1===WishlistSettings.general.bulk_action_enabled){var t=document.querySelector(".bulk_action");t&&(t.style.display="none");var e=document.querySelectorAll("[hulk-select-products]");e.length&&e.forEach((function(t){t.style.display="none"}))}},_openMyWishlistPopup:function(t){t.onclick=function(){if(document.querySelector(".close-btn[data-closemywishlistpopup]").style.marginLeft="15px",document.querySelectorAll("[data-hulkappsmywishlistpopup]")[0].classList.add("open"),document.querySelector("[data-addProductBtn]").style.display="none",hulkSelectAll.style.display="none",DefaultWishlistID=DefaultWishlistID.filter((function(t,e){return DefaultWishlistID.indexOf(t)==e})),SelectedWishlistID=DefaultWishlistID,"Customer"==customerStatus||"Guest"==customerStatus&&1==WishlistSettings.general.is_guest_enabled)if(document.querySelector("[data-loginBtn]").style.display="none",document.querySelector("[data-hulkloginmsg]").style.display="none","Customer"==customerStatus){if(WishlistSettings.general.has_multiple_wishlist){var t=document.querySelector("[data-sidebarWidgetHulkWishlists]");t.style.display="block";var e="";"string"==typeof wishlistsData&&(wishlistsData=JSON.parse(wishlistsData)),wishlistsData.forEach((function(t){e+=' "})),t.innerHTML=e,document.addEventListener("change",(function(t){t.target&&1==t.target.hasAttribute("data-sidebarWidgetHulkWishlists")&&(SelectedWishlistID=t.target.value,i._getWishlistProducts(SelectedWishlistID,1),hulkSelectCheckbox.checked=!1,hulkMoveAllItems.style.display="none",hulkDeleteAllItems.style.display="none",selectedMyWishlistProductIds=[],selectedMyWishlistVariantIds=[])}))}i._getWishlistProducts(SelectedWishlistID,1)}else null!=hulkUserUUID&&i._guestWishlistAPI(hulkUserUUID,1),null==hulkUserUUID&&(hulkWishlistEmptyContainer.style.display="block");else document.querySelector("[data-hulkloginmsg]").style.display="inline-block",document.querySelector("[data-loginBtn]").style.display="inline-block"},"undefined"!=typeof hulkCloseMyWishlistPopup2&&(hulkCloseMyWishlistPopup2.onclick=function(){document.querySelectorAll("[data-hulkappsmywishlistpopup]")[0].classList.remove("open")});var e=document.querySelector("[data-hulkappsmywishlistpopup]");null!=e&&e.addEventListener("click",(function(t){var e;t.target&&1==t.target.hasAttribute("hulk-floating-btn")||null==t.target.closest(".wishlist-modal")&&(null===(e=document.querySelector("[data-closeMyWishlistPopup2]"))||void 0===e||e.click())})),null!=document.querySelectorAll("[data-closemywishlistpopup]")&&null!=document.querySelectorAll("[data-closemywishlistpopup]")&&document.querySelectorAll("[data-closemywishlistpopup]").forEach((function(t){t.onclick=function(t){document.querySelectorAll("[data-hulkappsmywishlistpopup]")[0].classList.remove("open")}}))},_getWishlistProducts:function(t,e){if(null!=customerID&&null!=customerID){var s="",l=window.hulkappsWishlist.baseURL+"/wishlist/products?page="+e+"&customer_id="+customerID+"&shop="+hulkShopDomain+"&wishlist_id="+t;i._XMLHttpRequest("GET",l,"",(function(t,e){var l=JSON.parse(e);if(200==t){var o=l.data;productsCount=l.data.length,o.forEach((function(t){s+='
',s+='',s+='
',null!=t.vendor&&null!=t.vendor&&t.vendor.length>0&&(s+='

'+t.vendor+"

"),s+='

'+t.title+'

'+t.price+"

","Default Title"!=t.variant_options?s+='

'+t.variant_options+"

":s+='

',s+="
",s+='
',1==t.in_stock?s+='":s+='",s+='

'+WishlistSettings.language.date_label+" "+t.added_on+"

",s+="
"})),l.total>0?(document.querySelector("[data-addProductBtn]").style.display="none",document.querySelector("[data-viewMore]").style.display="inline-block",hulkSelectAll.style.display="inline-block",hulkWishlistEmptyContainer.style.display="none"):(hulkSelectAll.style.display="none",hulkWishlistEmptyContainer.style.display="block",document.querySelector("[data-addProductBtn]").style.display="inline-block",document.querySelector("[data-viewMore]").style.display="none"),document.querySelectorAll("[data-hulkMyWishlistItems]")[0].innerHTML=s,window.conversionBearAutoCurrencyConverter&&window.conversionBearAutoCurrencyConverter.convertPricesOnPage(),i._removeBulkActions(),outStockProductsCount=document.querySelectorAll(".hulk_out_of_stock").length}else{var n="Something went wrong. Please try again later !";l.message&&(n=l.message),i._messageUpdate(n)}}))}},_guestWishlistAPI:function(t,e){var s="",l=window.hulkappsWishlist.baseURL+"/wishlist/products/guest?uuid="+t+"&page="+e+"&shop="+hulkShopDomain;i._XMLHttpRequest("GET",l,"",(function(t,e){var l=JSON.parse(e);if(200==t){var o=l.data;productsCount=l.data.length,o.forEach((function(t){s+='
',s+='',s+='
',null!=t.vendor&&null!=t.vendor&&t.vendor.length>0&&(s+='

'+t.vendor+"

"),s+='

'+t.title+'

'+t.price+"

","Default Title"!=t.variant_options?s+='

'+t.variant_options+"

":s+='

',s+="
",s+='
',1==t.in_stock?s+='":s+='",s+='

'+WishlistSettings.language.date_label+" "+t.added_on+"

",s+="
"})),l.total>0?(hulkSelectAll.style.display="inline-block",hulkWishlistEmptyContainer.style.display="none",document.querySelector("[data-addProductBtn]").style.display="none",document.querySelector("[data-viewMore]").style.display="inline-block"):(hulkSelectAll.style.display="none",hulkWishlistEmptyContainer.style.display="block",document.querySelector("[data-addProductBtn]").style.display="inline-block",document.querySelector("[data-viewMore]").style.display="none"),document.querySelectorAll("[data-hulkMyWishlistItems]")[0].innerHTML=s,window.conversionBearAutoCurrencyConverter&&window.conversionBearAutoCurrencyConverter.convertPricesOnPage(),i._removeBulkActions(),outStockProductsCount=document.querySelectorAll(".hulk_out_of_stock").length}else{var n="Something went wrong. Please try again later !";l.message&&(n=l.message),i._messageUpdate(n)}}))},_getShopSettings:function(){wishlistsData=sessionStorage.getItem("wishlistsData")||[],i._allocateStyles(WishlistSettings);var t=window.hulkappsWishlist.baseURL+"/shop/settings?shop="+hulkShopDomain;i._XMLHttpRequest("GET",t,"",(function(t,e){if(200!=t)return allHulkWishlistButtons.forEach((function(t){t.remove()})),void document.querySelectorAll("[data-hulksaveforlater]").forEach((function(t){t.remove()}))})),guestWishlistData=localStorage.getItem("HulkApps-wishlist-guestData")||null,guestWishlistData&&null!=guestWishlistData&&null!=guestWishlistData&&(guestWishlistData=JSON.parse(guestWishlistData),"Customer"!=customerStatus&&guestWishlistData.length>0&&i._addFromGuestTodata(guestWishlistData))},_setHeaderIcon:function(){var t=WishlistSettings.style.header_icon_selector?WishlistSettings.style.header_icon_selector:"a[href='/cart']",e=document.querySelector(t);if(e){var s='",e.insertAdjacentHTML("beforebegin",s)}wishlistTotal=document.querySelector("[data-totalwishlistitems]"),i._updateWishlistTotal()},_allocateStyles:function(t){if(wishlistsData=sessionStorage.getItem("wishlistsData")||[],WishlistSettings=t,appStatus=WishlistSettings.general.frontend_enabled,0==appStatus)return allHulkWishlistButtons.forEach((function(t){t.remove()})),void document.querySelectorAll("[data-hulksaveforlater]").forEach((function(t){t.remove()}));var e=WishlistSettings.general.css_style;if(WishlistSettings.general&&e&&""!=e){var s=document.createElement("style");s.type="text/css",s.id="hulk--global-stylesheet",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(s)}var l=document.getElementsByClassName("hulk-header-icon")[0];if(null!=l){var o=l.firstElementChild;o.style.color=WishlistSettings.style.header_icon_color?WishlistSettings.style.header_icon_color:"#000",o.style.fontSize=WishlistSettings.style.header_icon_size?WishlistSettings.style.header_icon_size+"px":"16px",o.style.fontWeight=WishlistSettings.style.header_icon_weight?WishlistSettings.style.header_icon_weight:500}var n=document.getElementsByClassName("header-count")[0];if(null!=n&&(n.style.backgroundColor=WishlistSettings.general.header_count_background_color?WishlistSettings.general.header_count_background_color:WishlistSettings.style.theme_color,n.style.color=WishlistSettings.general.header_count_color?WishlistSettings.general.header_count_color:"#fff"),"1"===window.hulkappsWishlist.hasAppBlockSupport){var a=document.querySelector(".icon-wishlist-heart-empty.wishlist-btn:not([data-gridhulklist])");if(null!=a&&null!=a&&a.classList.add("hulkapps-wishlist-btn-enabled"),"custom_icon"===WishlistSettings.style.button_icon_type){var r=document.querySelector(".heart-hulk-animation");if(r){var u=document.createElement("div");u.classList.add("wishlist_btn_icon"),u.classList.add("hulk_wl_icon"),u.style.display="initial",u.innerHTML='',r.parentNode.replaceChild(u,r)}}}WishlistSettings&&"style_1"===WishlistSettings.style.button_style&&"1"!==window.hulkappsWishlist.hasAppBlockSupport&&(WishlistSettings.language.button_text="",WishlistSettings.language.success_button_text=""),WishlistSettings&&"custom"!=WishlistSettings.style.position&&"1"!==window.hulkappsWishlist.hasAppBlockSupport&&i._addWishlistButton(),WishlistSettings&&"custom"==WishlistSettings.style.position&&"1"!==window.hulkappsWishlist.hasAppBlockSupport&&i._manageWishlistBtnSettings(),i._updateWishlistButton(),"Customer"==customerStatus&&1==WishlistSettings.general.is_guest_enabled&&null!=hulkUserUUID&&i._addToWishlistFromGuestList(),excludeEnabled=!!window.hulkappsWishlist.generalSettings.is_exclude_enabled&&window.hulkappsWishlist.generalSettings.is_exclude_enabled,excludedProductTags=window.hulkappsWishlist.generalSettings.exclude_product_tags,saveForLaterColor=WishlistSettings.style.individual_save_items_text_color?WishlistSettings.style.individual_save_items_text_color:"#000000",saveForLaterHoverColor=WishlistSettings.style.individual_save_items_text_hover_color?WishlistSettings.style.individual_save_items_text_hover_color:"#000000",saveForLaterFontSize=WishlistSettings.style.individual_save_items_font_size?WishlistSettings.style.individual_save_items_font_size+"px":"16px",saveForLaterFontWeight=WishlistSettings.style.individual_save_items_font_thickness?WishlistSettings.style.individual_save_items_font_thickness:500,saveAllForLaterBtnText=WishlistSettings.language.button.save_all_for_later?WishlistSettings.language.button.save_all_for_later:"Save all for later",saveAllForLaterBtnBackgroundColor=WishlistSettings.style.global_button_bg_color?WishlistSettings.style.global_button_bg_color:"#5c6ac4",saveAllForLaterBorderColor=WishlistSettings.style.global_button_border_color?WishlistSettings.style.global_button_border_color:"#5c6ac4",saveAllForLaterBtnBorder=WishlistSettings.style.global_button_border_width?WishlistSettings.style.global_button_border_width:0,saveAllForLaterBtnBorderRadius=WishlistSettings.style.global_button_border_radius?WishlistSettings.style.global_button_border_radius:0,saveAllForLaterBtnColor=WishlistSettings.style.global_button_text_color?WishlistSettings.style.global_button_text_color:"#ffffff",saveAllForLaterFontSize=WishlistSettings.style.global_button_font_size?WishlistSettings.style.global_button_font_size:16,saveAllForLaterBtnFontWeight=WishlistSettings.style.global_button_font_thickness?WishlistSettings.style.global_button_font_thickness:500,saveAllForLaterBtnVerticalSpace=WishlistSettings.style.global_button_vertical_space?WishlistSettings.style.global_button_vertical_space:7,saveAllForLaterBtnHorizontalSpace=WishlistSettings.style.global_button_horizontal_space?WishlistSettings.style.global_button_horizontal_space:10,saveAllForLaterBtnBackgroundHoverColor=WishlistSettings.style.global_button_bg_hover_color?WishlistSettings.style.global_button_bg_hover_color:"#5c6ac4",saveAllForLaterBtnHoverColor=WishlistSettings.style.global_button_text_hover_color?WishlistSettings.style.global_button_text_hover_color:"#ffffff",showQuantitySection=null!=WishlistSettings.general.show_quantity&&WishlistSettings.general.show_quantity;var c=void 0===WishlistSettings.general.save_for_later_status||WishlistSettings.general.save_for_later_status,d=document.querySelectorAll("[data-hulkSaveForLater]"),h=document.querySelector("[data-hulksaveforlaterallitems]");if((!c||"global_button"!=saveForLaterType&&"individual_button_automatic"===saveForLaterPosition)&&void 0!==d&&null!=d&&d.length>0&&d.forEach((function(t){t.remove()})),(!c||"individual_button"!=saveForLaterType&&"global_button_automatic"===saveAllForLaterPosition)&&void 0!==h&&null!=h&&h.remove(),c){if("global_button"!=saveForLaterType&&"individual_button_automatic"===saveForLaterPosition){var p=WishlistSettings.style.save_for_later_selector?WishlistSettings.style.save_for_later_selector:".list-view-item__title",_=document.querySelectorAll(p);null!=_&&null!=_&&new Promise((function(t,e){t(i._getCartItems())})).then((function(t){new Promise((function(e,s){e(t.json())})).then((function(t){t.items.forEach((function(t,e){var s=document.querySelectorAll(p)[e];if(null!=s&&null!=s){var l=''+WishlistSettings.language.button.save_for_later+"";s.insertAdjacentHTML("afterend",l)}}))}))})).catch((function(t){throw t}))}if(setTimeout((function(){if(null!=(d=document.querySelectorAll("[data-hulkSaveForLater]"))&&null!=d&&d.length>0){var t=[];d.forEach((function(e){t.push(e.getAttribute("data-product-id")),e.addEventListener("mouseover",(function(){e.style.color=saveForLaterHoverColor})),e.addEventListener("mouseout",(function(){e.style.color=saveForLaterColor}))}));var e=window.hulkappsWishlist.baseURL+"/product_tags?shop="+hulkShopDomain+"&product_ids="+t;i._XMLHttpRequest("GET",e,"",(function(t,e){var s,l=JSON.parse(e);200==t&&function(){var t=l.product_tags;for(productTag in t)t[productTag].length>0&&void 0!==excludedProductTags&&(s=excludedProductTags.some((function(e){return t[productTag].includes(e)})),excludeEnabled&&s&&(document.querySelector('[data-product-id="'+productTag+'"]').style.display="none"))}()}))}}),400),i._saveForLater(),"individual_button"!=saveForLaterType&&"global_button_automatic"===saveAllForLaterPosition){var g=WishlistSettings.style.save_all_for_later_selector?WishlistSettings.style.save_all_for_later_selector:"[name='checkout']",y=document.querySelector(g);if(null!=y&&null!=y){var m=''+saveAllForLaterBtnText+"";y.insertAdjacentHTML("beforebegin",m)}}null!=(h=document.querySelector("[data-hulksaveforlaterallitems]"))&&null!=h&&(h.addEventListener("mouseover",(function(){h.style.backgroundColor=saveAllForLaterBtnBackgroundHoverColor,h.style.color=saveAllForLaterBtnHoverColor})),h.addEventListener("mouseout",(function(){h.style.backgroundColor=saveAllForLaterBtnBackgroundColor,h.style.color=saveAllForLaterBtnColor}))),i._saveAllForLater()}var S=allHulkWishlistButtons[0];void 0!==S&&null!=S?(allHulkWishlistButtons.forEach((function(t){"1"!==window.hulkappsWishlist.hasAppBlockSupport&&1!=WishlistSettings.style.button_style&&(t.querySelector("span").innerHTML=WishlistSettings.language.button_text)})),i._checkForProductStatus(allHulkWishlistButtons,"multiple")):i._updateWishlistTotal(),""!=customerID&&null!=customerID&&null!=customerID&&(wishlistsData&&void 0!==wishlistsData&&"undefined"!==wishlistsData&&null!==wishlistsData&&"null"!==wishlistsData?wishlistsData.length>0&&(wishlistsData=JSON.parse(wishlistsData)):wishlistsData=[],proxyURL!=window.location.pathname&&i._searchWishlist(),i._getUserWishlist(),i._updateuserWishlists()),i._manageWishlistButtonAction(),i._someBaseFunction(),i._createNewWishlist(),i._updateButtonStateonVariantChange(),i._updateWishlistText()},_addFromGuestTodata:function(t){var e="";if(t.forEach((function(t){e.indexOf(t.productID)<0&&(e+=""==e?t.productID:","+t.productID)})),e.length>0){var s=window.hulkappsWishlist.baseURL+"/wishlist/products/move_guest_wishlist?shop="+hulkShopDomain+"&product_ids="+e;i._XMLHttpRequest("GET",s,"",(function(e,s){var l=JSON.parse(s);if(200==e)l.data&&l.data.wishlist_uuid&&(hulkUserUUID=l.data.wishlist_uuid,i._setCookie("hulk_wishlist_UserUUID",l.data.wishlist_uuid,15),i._checkForProductStatus(allHulkWishlistButtons,"multiple"),t=[],localStorage.removeItem("HulkApps-wishlist-guestData"));else if(e<300){l.message&&l.message}else;}))}},_updateProductForGuest:function(t,e,s,l,o){var n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a={shop:hulkShopDomain,product_id:parseInt(e),variant_id:parseInt(s),item_qty:parseInt(o),uuid:hulkUserUUID,type:"web",is_save_later:n},r=window.hulkappsWishlist.baseURL+"/wishlist/add_product/guest";"remove"==l&&(a={shop:hulkShopDomain,product_ids:[parseInt(e)],variant_ids:[parseInt(s)],uuid:hulkUserUUID,type:"web"},r=window.hulkappsWishlist.baseURL+"/wishlist/delete_product/guest"),i._XMLHttpRequest("POST",r,a,(function(e,s){var o=JSON.parse(s);if(200==e){var n=o.isLatestNotification||!1;if("remove"==l){var a=WishlistSettings.language.success_message.for_item_removed;n&&(a=o.message),i._buttonUpdate("remove",t,a,o.title,o.image,n)}else{null==hulkUserUUID&&o.data&&o.data.uuid&&i._setCookie("hulk_wishlist_UserUUID",o.data.uuid,15);var r=WishlistSettings.language.success_message.without_login;(n=o.data.isLatestNotification||!1)&&(r=o.message),i._buttonUpdate("added",t,r,o.data.title,o.data.image,n)}i._checkForProductStatus(allHulkWishlistButtons,"multiple")}else{var u="Something went wrong. Please try again later";o.message&&(u=o.message),i._messageUpdate(u)}}))},_addToWishlistFromGuestList:function(){if(!(null==hulkUserUUID||hulkUserUUID.length<=0)){var t=window.hulkappsWishlist.baseURL+"/wishlist/sync_products",e={shop:hulkShopDomain,customer_id:customerID,uuid:hulkUserUUID};i._XMLHttpRequest("POST",t,e,(function(t,e){if(200==t)hulkUserUUID=null,i._setCookie("hulk_wishlist_UserUUID",null,-10),i._checkForProductStatus(allHulkWishlistButtons,"multiple");else{var s=JSON.parse(e),l="Something went wrong. Please try again later !";s.message&&(l=s.message),i._messageUpdate(l)}}))}},_addWishlistButton:function(){if(null==window.hulkappsWishlist.productJSON||null==window.hulkappsWishlist.productJSON)return!1;var t=window.hulkappsWishlist.selectedVariant;if(null!=t&&null!=t||(t=window.hulkappsWishlist.productJSON.variants[0].id),WishlistSettings.general.product_page_tooltip&&"show"===WishlistSettings.general.public_wishlist_count){var e=document.querySelector(".wishlist-btn"),s=WishlistSettings.general.tooltip_message+" 0 "+WishlistSettings.general.tooltip_time_message;e.setAttribute("title",s)}var l='';l+='
',"custom_icon"===WishlistSettings.style.button_icon_type?(l+='
',l+=''+WishlistSettings.language.button_text+""):(l+='
',isCustomizeProductIcon&&"icon_no_background"!==iconBackgroundType?l+='':l+='',l+='
',l+=""+WishlistSettings.language.button_text+""),l+="
","show"===WishlistSettings.general.public_wishlist_count&&(l+='',"multi_color_button"!==buttonLayout||"style_2"!==WishlistSettings.style.button_style&&"style_4"!==WishlistSettings.style.button_style?l+="(0)":l+="0",l+=""),l+="
";var o,n,a=!1;["[action*='/cart/add'] [name='add']","[action*='/cart/add'] [type='submit']","[action*='/cart/add'] [type='button']","#add-to-cart","#AddToCartText","#AddToCart"].forEach((function(t){0==a&&null!=document.querySelectorAll(t)[0]&&null!=document.querySelectorAll(t)[0]&&(a=!0,o=document.querySelectorAll(t)[0],n=o.closest("form"))})),document.querySelectorAll("[data-wishlist]").forEach((function(t){0==t.hasAttribute("data-gridHulkList")&&t.remove()})),null!=n&&null!=n&&null!=n.querySelector("[data-wishlist]")&&null!=n.querySelector("[data-wishlist]")&&n.querySelector("[data-wishlist]").remove(),null!=o&&null!=o&&o.insertAdjacentHTML("afterend",l),i._manageWishlistBtnSettings(),i._updateWishlistButton(),allHulkWishlistButtons=Array.from(document.querySelectorAll("[data-wishlist]")),i._checkForProductStatus(allHulkWishlistButtons,"multiple"),i._updateWishlistText()},_updateWishlistButton:function(){var t,e,s,l=WishlistSettings.style;wishlistBtnStyle=l.button_style,e="background-color: "+WishlistSettings.style.theme_color+"; border: 1px solid "+WishlistSettings.style.theme_color+"; color: white;",s="background-color: white;border: 1px solid "+WishlistSettings.style.theme_color+"; color:"+WishlistSettings.style.theme_color,t=WishlistSettings&&"style_1"==WishlistSettings.style.button_style||"style_3"==WishlistSettings.style.button_style||"style_5"==WishlistSettings.style.button_style?"color: "+WishlistSettings.style.theme_color+";":"border-radius: "+l.button_border_radius+"px; font-size: "+l.button_font_size+"px; font-weight: "+l.button_font_weight+";";for(var i=document.querySelectorAll("[data-wishlist]"),o=0;o20&&(t.style.right="-0.3rem",t.style.bottom="1.5rem",t.style.width="1.8em",t.style.height="1.8em")));var e=i[o];if("show"===WishlistSettings.general.collection_wishlist_count&&i[o].querySelector(".count").classList.add("hulkapps-collection-count"),null!=i[o].querySelector(".heart-hulk-animation")){var s=i[o].querySelector(".heart-hulk-animation");s.classList.add("collection-icon"),isCustomizeCollectionIcon&&(s.setAttribute("data-icon",collectionIconType),i[o].addEventListener("mouseover",(function(t){s.style.color=collectionIconHoverColor})),i[o].addEventListener("mouseout",(function(t){s.style.color="true"==e.getAttribute("data-added")?selectedCollectionIconFillColor:collectionIconFillColor})))}"custom_icon"===WishlistSettings.style.button_icon_type&&(i[o].getElementsByClassName("wishlist_btn_icon")[0].innerHTML=''),i[o].classList.add("style_1"),i[o].setAttribute("style","color: "+WishlistSettings.style.theme_color+";display: inline-block !important;"),WishlistSettings.style.custom_wishlist_icon&&(i[o].setAttribute("data-custom-wishlist-icon",!0),i[o].style.right="10px",i[o].style.left="unset",WishlistSettings.style.custom_wishlist_icon_right&&"false"!=WishlistSettings.style.custom_wishlist_icon_right||(i[o].style.right="unset",i[o].style.left="10px"))}():("show"===WishlistSettings.general.public_wishlist_count&&i[o].querySelector(".count").classList.add("hulkapps-public-count"),"1"!==window.hulkappsWishlist.hasAppBlockSupport&&(i[o].classList.add(l.button_style),i[o].setAttribute("style",t)));document.querySelectorAll(".hulkThemeColor").forEach((function(t){t.setAttribute("style","color: "+WishlistSettings.style.theme_color)})),document.querySelectorAll(".hulkBtnStyle").forEach((function(t){t.setAttribute("style",e)})),document.querySelectorAll("[data-closewishlistpopup].hulkBtnStyle ").forEach((function(t){t.setAttribute("style",s)})),document.querySelectorAll("[data-closewishlistitemspopup].hulkBtnStyle ").forEach((function(t){t.setAttribute("style",s)})),document.querySelectorAll("[data-closemywishlistpopup].hulkBtnStyle ").forEach((function(t){t.setAttribute("style",s)})),document.querySelectorAll("[data-hulkappsmoveitemscancel].hulkBtnStyle ").forEach((function(t){t.setAttribute("style",s)}));var n=document.createElement("style");n.innerHTML=".wishlist-btn.style_1 [hulk-wl-custom-style], .wishlist-btn.style_3 [hulk-wl-custom-style], .wishlist-btn.style_5 [hulk-wl-custom-style]{ color: "+WishlistSettings.style.theme_color+"; }\n",n.innerHTML+=".wishlist-btn.style_2:not([data-gridhulklist]) [hulk-wl-custom-style], .wishlist-btn.style_4:not([data-gridhulklist]) [hulk-wl-custom-style]{ background-color: "+WishlistSettings.style.button_background_color+"; color: "+l.button_text_color+"; border: "+l.button_border+"px solid "+l.button_border_color+"; }\n",document.body.appendChild(n)},_searchWishlist:function(){var t,e=document.querySelectorAll("[data-searchwishlist]")[0].querySelector("input");e.onkeyup=function(){var s=e.value;s=s.trim(),searchWishlist=s,clearTimeout(t),t=setTimeout((function(){i._getUserWishlist(!0)}),1e3)},e.keydown=function(){clearTimeout(t)}},_getUserWishlist:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!=customerID&&null!=customerID&&""!=customerID){var e=window.hulkappsWishlist.baseURL+"/wishlist/lists?customer_id="+customerID+"&shop="+hulkShopDomain+"&search="+searchWishlist;i._XMLHttpRequest("GET",e,"",(function(e,s){var l=JSON.parse(s);if(200==e){wishlistsData=l,sessionStorage.setItem("wishlistsData",JSON.stringify(l));if(wishlistsData.forEach((function(t){if(1==t.is_default)try{return void DefaultWishlistID.push(t.id)}catch(e){return DefaultWishlistID=t.id,void!0}})),i._updateuserWishlists(),t){var o=wishlistButtonTarget.getAttribute("data-proid"),n=wishlistButtonTarget.getAttribute("data-varid");i._updateWishlistSelection(o,n)}}else{var a="Something went wrong. Please try again later !";l.message&&(a=l.message),i._messageUpdate(a)}}))}},_createNewWishlist:function(){document.querySelectorAll("[data-saveNewWishlist]")[0].onclick=function(t){t.preventDefault();t.target;var e=document.querySelectorAll("[data-addNewWishlist]")[0].querySelector("[data-newWishlist]").value;if((e=e.trim()).length>0){var s={customer_id:customerID,shop:hulkShopDomain,name:e},l=new XMLHttpRequest;l.open("POST",window.hulkappsWishlist.baseURL+"/wishlist/create",!0),l.setRequestHeader("Content-type","application/json"),l.send(JSON.stringify(s)),l.onload=function(){if(200==l.status){var t=JSON.parse(this.response);i._getUserWishlist(),setTimeout((function(){document.querySelectorAll("[data-newwishlist]")[0].value="",i._updateuserWishlists(),i._updateWishlistSelection(wishlistButtonTarget.getAttribute("data-proid"),wishlistButtonTarget.getAttribute("data-varid"))}),500);var e="Wishlist Created!";t.message&&(e=t.message),i._messageUpdate(e)}else{var s=JSON.parse(this.response),o="Something went wrong. Please try again later !";s.message&&(o=s.message),i._messageUpdate(o)}}}else document.querySelectorAll("[data-addNewWishlist]")[0].querySelectorAll("[data-newWishlist]")[0].classList.add("error")}},_updateuserWishlists:function(){if(wishlistsData&&null!=wishlistsData&&null!=wishlistsData){var t="";"string"==typeof wishlistsData&&(wishlistsData=JSON.parse(wishlistsData)),wishlistsData.forEach((function(e){t+='
  • ',t+='
    ",0==e.is_default&&(t+='
    '),t+="
    ",t+="
  • "})),null!=document.querySelectorAll("[data-userWishlists]")&&null!=document.querySelectorAll("[data-userWishlists]")&&(document.querySelectorAll("[data-userWishlists]")[0].innerHTML=t),null!=document.querySelectorAll("[data-openCreateSection]")&&null!=document.querySelectorAll("[data-openCreateSection]")&&(document.querySelectorAll("[data-openCreateSection]")[0].style.display="block"),null!=document.querySelectorAll("[data-addNewWishlist]")&&null!=document.querySelectorAll("[data-addNewWishlist]")&&(document.querySelectorAll("[data-addNewWishlist]")[0].style.display="none")}},_deleteHulkWishlist:function(){document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("data-confirmDeleteWishlist")||1==t.target.classList.contains("delete-wishlist")){t.preventDefault();var e=t.target.closest("[data-userhulkwishlist]").getAttribute("data-id");globalHulkDeleteWishlistPrompt.setAttribute("data-wishlist",e),globalHulkDeleteWishlistPrompt.classList.add("open")}})),document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("data-deletehulkwishlist")){t.preventDefault();var e=t.target,s=e.closest("[data-hulkappsdeleteprompt]").getAttribute("data-wishlist"),l={customer_id:customerID,shop:hulkShopDomain,wishlist_id:s};if(null==s||null==s){globalHulkDeleteWishlistPrompt.classList.remove("open"),globalHulkDeleteWishlistPrompt.removeAttribute("data-wishlist");return void i._messageUpdate("Please select wishlist to delete.")}var o=!1;globalSelectedWishlistID==s&&(o=!0),e.classList.add("disabled"),i._XMLHttpRequest("POST",window.hulkappsWishlist.baseURL+"/wishlist/delete",l,(function(t,s){var l=JSON.parse(s);if(200==t){document.querySelectorAll("[data-hulkappsDeletePrompt]")[0].classList.remove("open"),document.querySelectorAll("[data-hulkappsDeletePrompt]")[0].removeAttribute("data-wishlist"),document.querySelector("[data-newWishlist]").value="",e.classList.remove("disabled"),1==o&&document.querySelectorAll('[data-userhulkwishlist][data-id="'+DefaultWishlistID+'"]')&&document.querySelectorAll('[data-userhulkwishlist][data-id="'+DefaultWishlistID+'"]')[0].querySelector("[data-hulkwishlistview]").click(),i._getUserWishlist();var n="Wishlist has been deleted!";l.message&&(n=l.message),i._messageUpdate(n),wishlistTotal&&i._updateWishlistTotal()}else{var a="Something went wrong. Please try again later !";l.message&&(a=l.message),i._messageUpdate(a),document.querySelectorAll("[data-data-hulkappsDeletePrompt]")[0].classList.remove("open"),document.querySelectorAll("[data-data-hulkappsDeletePrompt]")[0].removeAttribute("data-wishlist")}}))}}))},_updateWishlistSelection:function(t,e){var s=[];wishlistProductsData.forEach((function(l){(l.variant_id&&l.variant_id==e||l.product_id==t)&&s.push(l)})),document.querySelectorAll("[data-wishlistitem]").forEach((function(t){t.checked=!1})),s.forEach((function(t){var e=t.wishlist_ids;e.length>0&&e.forEach((function(t){null!=document.querySelectorAll('[data-wishlistitem][value="'+t+'"]')[0]&&(document.querySelectorAll('[data-wishlistitem][value="'+t+'"]')[0].checked=!0)}))}))},_checkForProductStatus:function(t,e){if(void 0===t||null==t||t.length<=0)return!1;var s=[];t.forEach((function(t,e){s.push({product_id:t.getAttribute("data-proid"),variant_id:t.getAttribute("data-varid")})}));var l={shop:hulkShopDomain,ids:s};if("Guest"==customerStatus){l.uuid=hulkUserUUID;var o=window.hulkappsWishlist.baseURL+"/wishlist/product_status/guest";i._XMLHttpRequest("POST",o,l,(function(e,s){var l=JSON.parse(s);if(200==e)1==WishlistSettings.general.is_guest_enabled?i._updateBtnonStatusCheck(t,l,"Guest"):i._updateBtnonStatusCheck(t,l,"Guest_Disabled");else{var o="Something went wrong. Please try again later !";l.message&&(o=l.message),i._messageUpdate(o)}}))}else{l.customer_id=customerID;var n=window.hulkappsWishlist.baseURL+"/wishlist/product_status";i._XMLHttpRequest("POST",n,l,(function(e,s){var l=JSON.parse(s);if(200==e)wishlistProductsData=l,i._updateBtnonStatusCheck(t,l,"Customer");else{var o="Something went wrong. Please try again later !";l.message&&(o=l.message),i._messageUpdate(o)}}))}wishlistTotal&&"variantChange"!=e&&i._updateWishlistTotal()},_manageWishlistButtonAction:function(){document.addEventListener("click",(function(t){if(t.target&&null==t.target.closest(".wishlist-modal")){var e,s,l;if(document.querySelector("[data-hulkappswishlistpopup].open"))null===(e=document.querySelector("[data-closewishlistpopup]"))||void 0===e||e.click();if(document.querySelector("[data-hulkappswishlistpopup].open"))null===(s=document.querySelector("[data-closewishlistpopup]"))||void 0===s||s.click();if(null==t.target.closest("[data-hulkdeleteallitmes]")&&document.querySelector("[data-hulkappsdeleteitemsprompt].open"))null===(l=document.querySelector("[data-closeWishlistItemsPopup]"))||void 0===l||l.click()}if(t.target&&1==t.target.hasAttribute("data-wishList")||t.target.closest("[data-wishList]")&&1==t.target.closest("[data-wishList]").hasAttribute("data-wishList")){var o;t.preventDefault();var n=(o=t.target&&1!=t.target.hasAttribute("data-wishList")?t.target.closest("[data-wishList]"):t.target).getAttribute("data-proid"),a=o.getAttribute("data-varid");if(null==a||null==a||a.length<=0||null==n||null==n||n.length<=0)return;if("Guest"==customerStatus)if(1==WishlistSettings.general.is_guest_enabled)i._addToWishlist(o,n,a,"");else{var r=WishlistSettings.language.success_message.for_guest_login_disabled;i._messageUpdate(r)}else 1==WishlistSettings.general.has_multiple_wishlist?(searchWishlist="",document.querySelector("[data-wishlistsearch]").value="",i._getUserWishlist(!0),wishlistButtonTarget=o,i._updateWishlistSelection(n,a),document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.add("open"),document.body.classList.add("hulkapps__popup__active")):i._addToWishlist(o,n,a,DefaultWishlistID)}})),document.querySelectorAll("[data-AddToWishlist]")[0].onclick=function(t){var e=[];if(Array.from(document.querySelectorAll("[data-wishlistitem]")).forEach((function(t){1==t.checked&&e.push(t.value)})),1==t.target.hasAttribute("hulk_saveAllForLater")){var s=t.target.getAttribute("hulk_saveAllForLater").split(","),l=t.target.getAttribute("hulk_itemQuantities").split(","),o=t.target.getAttribute("hulk_itemExclude").split(","),n=t.target.getAttribute("hulk_itemExcludeTitle"),a=WishlistSettings.language.button.save_all_for_later_excluded_products?WishlistSettings.language.button.save_all_for_later_excluded_products:"All products, except {product-title} have been successfully added to your wishlist.";if(s.forEach((function(t,s){var o=l[s],n=t.split("-")[0],a=t.split("-")[1];0==e.length?i._removeFromWishlist("",n,a,[],0,null):i._addToWishlist("",n,a,e,o,!0)})),o>0&&""!==joinProductTitle&&null!=joinProductTitle){var r=n.join(", ");a=(a=a.replace("{count}",o)).replace("{product-title}",''+r+""),i._messageUpdate(a)}i._clearCartItems()}else{var u=1==t.target.hasAttribute("hulk_saveForLater")?wishlistButtonTarget.getAttribute("data-product-id"):wishlistButtonTarget.getAttribute("data-proid"),c=1==t.target.hasAttribute("hulk_saveForLater")?wishlistButtonTarget.getAttribute("data-variant-id"):wishlistButtonTarget.getAttribute("data-varid"),d=1==t.target.hasAttribute("hulk_saveForLater_itemQty")?t.target.getAttribute("hulk_saveForLater_itemQty"):null,h=1==t.target.hasAttribute("hulk_saveForLater");0==e.length?i._removeFromWishlist(wishlistButtonTarget,u,c,[]):i._addToWishlist(wishlistButtonTarget,u,c,e,d,h)}1==t.target.hasAttribute("hulk_saveForLater")&&(wishlistButtonTarget.setAttribute("class","addtoWishlist"),wishlistButtonTarget.innerHTML=WishlistSettings.language.button.save_for_later,setTimeout((function(){var e={line:t.target.getAttribute("hulk_saveForLater"),quantity:0};fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)}).then((function(t){window.location.href="/cart"})),t.target.removeAttribute("hulk_saveForLater")}),1500))}},_addToWishlist:function(t,e,s,l){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=""!=t?t.getAttribute("data-added"):null;if("true"!=a||0!=WishlistSettings.general.has_multiple_wishlist&&"Guest"!=customerStatus){var r=a?"Guest"==customerStatus?"Guest Wishlist":"Users Wishlist":"Save for later";if(i._triggerGAEvent(r,e,s),"Guest"==customerStatus)i._updateProductForGuest(t,e,s,"add",o,n);else{document.querySelectorAll("[data-addtowishlist]")[0].disabled=!0;var u=window.hulkappsWishlist.baseURL+"/wishlist/add_product",c={customer_id:customerID,shop:hulkShopDomain,product_id:e,variant_id:s,item_qty:parseInt(o),wishlist_ids:l,type:"web",is_save_later:n};i._XMLHttpRequest("POST",u,c,(function(e,s){var l=JSON.parse(s);if(200==e){var o=WishlistSettings.language.success_message.for_login_users,n=l.image,a=l.title,r=l.isLatestNotification||!1;l.message&&(o=l.message),i._buttonUpdate("added",t,o,a,n,r),i._checkForProductStatus(allHulkWishlistButtons,"multiple")}else{var u="Maximum wishlist item limit exceeded!";l.message&&(u=l.message),i._messageUpdate(u)}document.querySelectorAll("[data-addtowishlist]")[0].disabled=!0,document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.remove("open"),document.body.classList.remove("hulkapps__popup__active")}))}}else i._removeFromWishlist(t,e,s,l)},_removeFromWishlist:function(t,e,s,l){if("Guest"==customerStatus)i._updateProductForGuest(t,e,s,"remove");else{var o={customer_id:customerID,shop:hulkShopDomain,product_ids:[e],variant_ids:[s],wishlist_ids:l,type:"web"};document.querySelectorAll("[data-addtowishlist]")[0].disabled=!0;var n=window.hulkappsWishlist.baseURL+"/wishlist/delete_product";i._XMLHttpRequest("POST",n,o,(function(e,s){var l=JSON.parse(s);if(200==e){var o="Removed From Wishlist!",n=l.isLatestNotification||!1;l.message&&(o=l.message),i._buttonUpdate("remove",t,o,l.title,l.image,n),i._checkForProductStatus(allHulkWishlistButtons,"multiple")}else{var a="Something went wrong. Please try again later !";l.message&&(a=l.message),i._messageUpdate(a)}document.querySelectorAll("[data-addtowishlist]")[0].disabled=!0,document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.remove("open"),document.body.classList.remove("hulkapps__popup__active")}))}},_getCartItems:function(){return fetch("/cart.js",{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"},dataType:"json"})},_clearCartItems:function(){setTimeout((function(){fetch("/cart/clear.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((function(t){window.location.href="/cart"}))}),1500)},_saveAllForLater:function(){document.addEventListener("click",(function(t){t.target&&1==t.target.hasAttribute("data-hulkSaveForLaterallItems")&&new Promise((function(t,e){t(i._getCartItems())})).then((function(t){new Promise((function(e,s){e(t.json())})).then((function(t){var e=[];t.items.forEach((function(t){e.push(t.product_id)}));var s=null;if(e.length>0){var l=window.hulkappsWishlist.baseURL+"/product_tags?shop="+hulkShopDomain+"&product_ids="+e;i._XMLHttpRequest("GET",l,"",(function(t,e){var l=JSON.parse(e);200==t&&(s=l.product_tags)}))}var o=WishlistSettings.language.button.save_all_for_later_excluded_products?WishlistSettings.language.button.save_all_for_later_excluded_products:"All products, except {product-title} have been successfully added to your wishlist.";setTimeout((function(){if("Customer"==customerStatus&&1==WishlistSettings.general.has_multiple_wishlist){var e=[],l=[],n=0,a=[],r=[];t.items.forEach((function(t,o){var u=t.product_id,c=!1;if(a.push(t.quantity),null!=s&&s[u].length>0&&void 0!==excludedProductTags){var d=excludedProductTags.some((function(t){return s[u].includes(t)}));excludeEnabled&&d&&(c=!0,n+=1,r.push(t.title))}var h=t.variant_id;0==c&&(e.push(u+"-"+h),l.push(o+1),i._updateWishlistSelection(u,h))})),setTimeout((function(){searchWishlist="",document.querySelector("[data-wishlistsearch]").value="",i._getUserWishlist(!0),document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.add("open"),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_saveAllForLater",e),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_itemExclude",n),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_itemQuantities",a),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_itemExcludeTitle",r.join(", ")),document.body.classList.add("hulkapps__popup__active")}),300)}else{var u=0,c=[];t.items.forEach((function(t,e){var l=t.product_id,o=!1;if(null!=s&&s[l].length>0&&void 0!==excludedProductTags){var n=excludedProductTags.some((function(t){return s[l].includes(t)}));excludeEnabled&&n&&(o=!0,u+=1,c.push(t.title))}var a=t.variant_id;0==o&&i._addToWishlist("",l,a,DefaultWishlistID,t.quantity,!0)}));var d=c.join(", ");o=(o=o.replace("{count}",u)).replace("{product-title}",''+d+""),u>0&&""!==d&&null!=d&&i._messageUpdate(o),i._clearCartItems()}}),2e3)}))})).catch((function(t){throw t}))}))},_saveForLater:function(){isRemoving=!1,document.addEventListener("click",(function(t){if(t.target&&1==t.target.hasAttribute("data-hulksaveforlater")){t.preventDefault();var e=t.target,s=e.getAttribute("data-product-id"),l=e.getAttribute("data-variant-id"),o=e.getAttribute("data-line"),n=e.parentElement.parentElement,a=showQuantitySection&&null!=n.querySelector('input[name="updates[]"]')?n.querySelector('input[name="updates[]"]').value:null;"Customer"==customerStatus&&1==WishlistSettings.general.has_multiple_wishlist?(i._updateWishlistSelection(s,l),setTimeout((function(){searchWishlist="",document.querySelector("[data-wishlistsearch]").value="",i._getUserWishlist(!0),document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.add("open"),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_saveForLater",o),document.querySelectorAll("[data-addtowishlist]")[0].setAttribute("hulk_saveForLater_itemQty",a),wishlistButtonTarget=e,document.body.classList.add("hulkapps__popup__active")}),300)):(i._addToWishlist(e,s,l,DefaultWishlistID,a,!0),e.setAttribute("class","addtoWishlist"),e.innerHTML=WishlistSettings.language.button.save_for_later,setTimeout((function(){var t={line:o,quantity:0};fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)}).then((function(t){window.location.href="/cart"}))}),1500))}}))},_updateWishlistTotal:function(){if(wishlistTotal&&null!=wishlistTotal&&("Guest"!=customerStatus||0!=WishlistSettings.general.is_guest_enabled)){var t=window.hulkappsWishlist.baseURL+"/wishlist/count?customer_id="+customerID+"&shop="+hulkShopDomain;if("Guest"==customerStatus){if(null==hulkUserUUID||null==hulkUserUUID)return;t=window.hulkappsWishlist.baseURL+"/wishlist/count/guest?uuid="+hulkUserUUID+"&shop="+hulkShopDomain}i._XMLHttpRequest("GET",t,"",(function(t,e){if(200==t){var s=JSON.parse(e),l=document.getElementsByClassName("header-count")[0],i=document.querySelector(".hulk-header-icon .icon-wishlist-heart-empty"),o=WishlistSettings.style.filled_icon;void 0!==o&&o&&null!=i&&(0==s.wishlist_count?i.dataset.fill="false":i.dataset.fill="true"),null!=l&&(WishlistSettings.general.display_zero_counter||0!=s.wishlist_count?l.style.display="flex":l.style.display="none"),wishlistTotal.innerHTML=s.wishlist_count}}))}},_someBaseFunction:function(){document.querySelectorAll("[data-closeWishlistPopup]")[0]&&(document.querySelectorAll("[data-closeWishlistPopup]")[0].onclick=function(){document.querySelectorAll("[data-hulkappsWishlistPopup]")[0].classList.remove("open"),document.body.classList.remove("hulkapps__popup__active"),document.querySelectorAll("[data-openCreateSection]")[0].style.display="block",document.querySelectorAll("[data-addNewWishlist]")[0].style.display="none",document.querySelectorAll("[data-newwishlist]")[0].value="",document.querySelectorAll("[data-addtowishlist]")[0].disabled=!0}),document.querySelectorAll("[data-closeWishlistPopup]")[7]&&(document.querySelectorAll("[data-closeWishlistPopup]")[7].onclick=function(){document.querySelectorAll("[data-hulkappsDeletePrompt]")[0].classList.remove("open")}),document.querySelectorAll("[data-openCreateSection]")[0]&&(document.querySelectorAll("[data-openCreateSection]")[0].onclick=function(t){t.preventDefault(),document.querySelectorAll("[data-addNewWishlist]")[0].style.display="block",document.querySelectorAll("[data-openCreateSection]")[0].style.display="none"}),document.addEventListener("change",(function(t){t.target&&1==t.target.hasAttribute("data-wishlistitem")&&(document.querySelectorAll("[data-addtowishlist]")[0].disabled=!1)})),null!=document.querySelectorAll("[data-closenewwishlistinput]")[0]&&null!=document.querySelectorAll("[data-closenewwishlistinput]")[0]&&(document.querySelectorAll("[data-closenewwishlistinput]")[0].onclick=function(t){t.preventDefault(),document.querySelectorAll("[data-addNewWishlist]")[0].style.display="none",document.querySelectorAll("[data-openCreateSection]")[0].style.display="block"});var t=document.querySelector("[data-myWishlistAccountText]");null!=t&&null!=t&&WishlistSettings.general.account_page_link&&(t.innerHTML=WishlistSettings.language.action_button.account_page||"My wishlist",t.style.margin="0 20px 0 0;",t.classList.remove("accountWishlistButton"))},_updateWishlistText:function(){void 0!==document.querySelectorAll("[data-wishlistSearch]")[0]&&(document.querySelectorAll("[data-wishlistSearch]")[0].placeholder=void 0!==WishlistSettings.language.placeholder__wishlistsearchbox?WishlistSettings.language.placeholder__wishlistsearchbox:"Search wishlist"),document.querySelectorAll("[data-hulkWishlistHeading]")[0].innerHTML=WishlistSettings.language.heading_text,document.querySelectorAll("[data-createWishlistText]")[0].innerHTML=WishlistSettings.language.wishlist.create,document.querySelectorAll("[data-myWishlistText]")[0].innerHTML=WishlistSettings.language.wishlist.my,document.querySelectorAll("[data-addtowishlist]")[0].innerHTML=void 0===WishlistSettings.language.save_button_text?"Save":WishlistSettings.language.save_button_text,document.querySelectorAll("[data-savenewwishlist]")[0].innerHTML=void 0===WishlistSettings.language.create_wishlist_button?"Save":WishlistSettings.language.create_wishlist_button,document.querySelectorAll("[data-newwishlist]")[0].placeholder=void 0===WishlistSettings.language.wishlist.placeholder?"Ex. Watch":WishlistSettings.language.wishlist.placeholder,document.querySelectorAll("[data-HulkEmptyWishlist] span")[0].innerHTML=WishlistSettings.language.title.empty_wishlist,document.querySelectorAll("[data-HulkLoginMsg] span")[0].innerHTML=WishlistSettings.language.title.login,document.querySelector("[data-deleteHulkWishlist]").innerHTML=WishlistSettings.language.button.delete_yes,document.querySelector("[data-deletehulkwishlistitems]").innerHTML=WishlistSettings.language.button.delete_yes,document.querySelector("[data-hulkappsmoveitemsok]").innerHTML=WishlistSettings.language.button.delete_yes,document.querySelector("[data-hulkappsDeletePrompt] [data-closewishlistpopup]:not(.close-popup)").innerHTML=WishlistSettings.language.button.delete_no,document.querySelector("[data-closewishlistitemspopup]:not(.close-popup)").innerHTML=WishlistSettings.language.button.delete_no,document.querySelector("[data-hulkappsmoveitemscancel]:not(.close-popup)").innerHTML=WishlistSettings.language.button.delete_no,hulkSelectAll.querySelector("span").innerHTML=WishlistSettings.language.title.select_all_text?WishlistSettings.language.title.select_all_text:"Select All",hulkMoveAllItems.querySelector("a").innerHTML=WishlistSettings.language.title.move_to_cart_text?WishlistSettings.language.title.move_to_cart_text:"Move to cart",hulkDeleteAllItems.querySelector("a").innerHTML=WishlistSettings.language.title.delete_text?WishlistSettings.language.title.delete_text:"Delete",document.querySelector("[data-closemywishlistpopup]").innerHTML=WishlistSettings.style.floating_close_button_text?WishlistSettings.style.floating_close_button_text:"Close",document.querySelector("[data-viewmore]").innerHTML=WishlistSettings.style.floating_explore_more_products_button_text?WishlistSettings.style.floating_explore_more_products_button_text:"Explore more products"},_checkFOrInactiveStore:function(){var t=document.querySelectorAll("[data-wishlist-wrapper]")[0];if(null!=t&&null!=t){var e=t.getAttribute("data-time");if(null!=e&&null!=e&&""!=e){e=new Date(t.getAttribute("data-time"));var s=new Date,l=Math.abs(s-e);Math.ceil(l/864e5)>=30&&(deactivatedStore=!0)}}},_updateButtonStateonVariantChange:function(){document.querySelectorAll("[name='id'], .single-option-selector, .single-option-selector__radio, select[data-option='option1'], select[data-option='option1'], select[data-option='option2'], select[data-option='option1'], select[data-option='option3'], select[data-option='option3'], select[data-index='option1'], select[data-index='option1'], select[data-index='option2'], select[data-index='option1'], select[data-index='option3'], select[data-index='option3'], .product-single__variants, #Option-product-0, #Option-product-1, #Option-product-2").forEach((function(t){t.addEventListener("change",(function(t){var e=t.currentTarget;setTimeout((function(){var t=parseInt(i._getSelectedVariant(e)),s=document.querySelector("[data-wishlist]");null!=(t=parseInt(t))&&null!=t&&0==isNaN(t)&&""!=t&&s&&(allHulkWishlistButtons=Array.from(document.querySelectorAll("[data-wishlist]")),s.setAttribute("data-varID",t),i._checkForProductStatus(allHulkWishlistButtons,"variantChange"))}),1e3)})),"great-deal-furniture.myshopify.com"!==hulkShopDomain&&"skintwo-com.myshopify.com"!==hulkShopDomain||t.addEventListener("click",(function(t){var e=t.currentTarget;setTimeout((function(){var t=parseInt(i._getSelectedVariant(e)),s=document.querySelector("[data-wishlist]");null!=(t=parseInt(t))&&null!=t&&0==isNaN(t)&&""!=t&&s&&(allHulkWishlistButtons=Array.from(document.querySelectorAll("[data-wishlist]")),s.setAttribute("data-varID",t),i._checkForProductStatus(allHulkWishlistButtons,"variantChange"))}),1e3)}))}))},_manageWishlistBtnSettings:function(){var t=document.querySelector("[data-wishlist]");if(t){if(null==t.querySelector(".hulk_wl_icon-text")&&null==t.querySelector(".hulk_wl_icon-text")||t.querySelector(".hulk_wl_icon-text").setAttribute("style",btnExtraStyle),setTimeout((function(){null==t.querySelector(".hulkapps-public-count")&&null==t.querySelector(".hulkapps-public-count")||t.querySelector(".hulkapps-public-count").setAttribute("style",countExtraStyle)}),500),isCustomizeProductIcon&&t.getElementsByClassName("hulk_wl_icon")[0]){t.getElementsByClassName("hulk_wl_icon")[0].setAttribute("data-icon",iconType),t.getElementsByClassName("hulk_wl_icon")[0].setAttribute("data-icon-bg",iconBackgroundType);var e=t.getElementsByClassName("product-icon")[0];e&&(e.addEventListener("mouseover",(function(t){e.style.color=iconHoverColor})),e.addEventListener("mouseout",(function(s){e.style.color="true"===t.getAttribute("data-added")?selectedIconFillColor:iconFillColor})))}t.addEventListener("mouseover",(function(t){var e=document.getElementsByClassName("hulk_wl_icon-text")[0],s=document.getElementsByClassName("hulkapps-public-count")[0];"style_2"!==WishlistSettings.style.button_style&&"style_4"!==WishlistSettings.style.button_style||(null!=e&&null!=e&&(e.style.backgroundColor=WishlistSettings.style.hover_button_background_color,e.style.border=WishlistSettings.style.button_border+"px solid "+WishlistSettings.style.hover_button_border_color,"show"===WishlistSettings.general.public_wishlist_count&&(e.style.borderRight=0)),null!=s&&null!=s&&(s.style.backgroundColor=WishlistSettings.style.hover_button_background_color,s.style.border=WishlistSettings.style.button_border+"px solid "+WishlistSettings.style.hover_button_border_color,"show"===WishlistSettings.general.public_wishlist_count&&(s.style.borderLeft=0))),null!=e&&null!=e&&(e.style.color=WishlistSettings.style.hover_button_text_color),null!=s&&null!=s&&(s.style.color=WishlistSettings.style.hover_button_text_color)})),t.addEventListener("mouseout",(function(t){var e=document.getElementsByClassName("hulk_wl_icon-text")[0],s=document.getElementsByClassName("hulkapps-public-count")[0];"style_2"===WishlistSettings.style.button_style||"style_4"===WishlistSettings.style.button_style?(null!=e&&null!=e&&(e.style.backgroundColor=WishlistSettings.style.button_background_color,e.style.border=WishlistSettings.style.button_border+"px solid "+WishlistSettings.style.button_border_color,e.style.color=WishlistSettings.style.button_text_color,"show"===WishlistSettings.general.public_wishlist_count&&(e.style.borderRight=0)),null!=s&&null!=s&&(s.style.backgroundColor=WishlistSettings.style.button_background_color,s.style.border=WishlistSettings.style.button_border+"px solid "+WishlistSettings.style.button_border_color,s.style.color=WishlistSettings.style.button_text_color,"show"===WishlistSettings.general.public_wishlist_count&&(s.style.borderLeft=0))):(null!=e&&null!=e&&(e.style.color=WishlistSettings.style.theme_color),null!=s&&null!=s&&(s.style.color=WishlistSettings.style.theme_color))}))}},_updateBtnonStatusCheck:function(t,e,s){t.forEach((function(t){var l,o,n,a,r,u,c,d=parseInt(t.getAttribute("data-varid")),h=e.find((function(t){if(parseInt(t.variant_id)===d)return t}));if(h.product_tags&&void 0!==excludedProductTags){var p=excludedProductTags.some((function(t){return h.product_tags.includes(t)}));if(h&&excludeEnabled&&p){var _=document.querySelector('.wishlist-btn[data-proid="'+h.product_id+'"]');setTimeout((function(){_.classList.add("hide-hulk-product-wishlist"),_.style.display=null}),200)}}null!=h&&"Guest"==s&&1==h.is_exist||"Customer"==s&&h.wishlist_ids&&h.wishlist_ids.length>0?(l=!0,o="icon-wishlist-heart "+wishlistBtnStyle+" wishlist-btn heart-wishlist-animation",a=WishlistSettings.language.success_button_text,n=h.wishlist_count,r=WishlistSettings.style.filled_set_custom_icon,u=fillIconStyle,c=fillCollectionIconStyle):(l=!1,o="icon-wishlist-heart-empty "+wishlistBtnStyle+" wishlist-btn heart-wishlist-animation",a=WishlistSettings.language.button_text,n=h&&h.wishlist_count>0?h.wishlist_count:0,r=WishlistSettings.style.empty_set_custom_icon,u=emptyIconStyle,c=emptyCollectionIconStyle);var g=i._compactNumbers(n),y=0,m=0;if(y=WishlistSettings.general.product_compact_numbers?g:n,m=WishlistSettings.general.collection_compact_numbers?g:n,"1"!==window.hulkappsWishlist.hasAppBlockSupport&&t.setAttribute("class",o),null==t.querySelector(".hulk_wl_icon")&&null==t.querySelector(".hulk_wl_icon")||t.querySelector(".hulk_wl_icon").setAttribute("style",u),null==t.querySelector(".collection-icon")&&null==t.querySelector(".collection-icon")||t.querySelector(".collection-icon").setAttribute("style",c),void 0!==t.getElementsByClassName("hulk-wishlist-custom-icon")[0]&&t.getElementsByClassName("hulk-wishlist-custom-icon")[0].setAttribute("src",r),t.setAttribute("data-added",l),t.querySelector("span")&&(t.querySelector("span").innerHTML=a),t.querySelector(".count")&&("show"===WishlistSettings.general.public_wishlist_count&&(t.querySelector(".count").style.display="none"),null!==t.querySelector(".hulkapps-collection-count")&&("top_count"===collectionCountLayout?t.querySelector(".hulkapps-collection-count").innerHTML=m:t.querySelector(".hulkapps-collection-count").innerHTML="("+m+")"),null!==t.querySelector(".hulkapps-public-count")&&("multi_color_button"!==buttonLayout||"style_2"!==WishlistSettings.style.button_style&&"style_4"!==WishlistSettings.style.button_style?t.querySelector(".hulkapps-public-count").innerHTML="("+y+")":t.querySelector(".hulkapps-public-count").innerHTML=y)),WishlistSettings.general.product_page_tooltip&&"show"===WishlistSettings.general.public_wishlist_count){var S=WishlistSettings.general.tooltip_message+" "+y+" "+WishlistSettings.general.tooltip_time_message;t.setAttribute("title",S)}}))},_getSelectedVariant:function(t){var e=null;if(null==t||null==t)return null;var s=t.closest("form");if(null==s||null==s)return"vermontfarmtable.myshopify.com"===hulkShopDomain||"skintwo-com.myshopify.com"===hulkShopDomain?window.location.search.split("=")[1]:null;if(s.querySelectorAll('[name="id"]'))e=s.querySelectorAll('[name="id"]')[0];else{var l=!1;[".single-option-selector,.single-option-selector__radio:checked, select[data-option='option1'], select[data-option='option1']:checked, select[data-option='option2'], select[data-option='option1']:checked, select[data-option='option3'], select[data-option='option3']:checked, select[data-index='option1'], select[data-index='option1']:checked, select[data-index='option2'], select[data-index='option1']:checked, select[data-index='option3'], select[data-index='option3']:checked"].forEach((function(t){0==l&&null!=document.querySelectorAll(t)[0]&&null!=document.querySelectorAll(t)[0]&&(l=!0,document.querySelectorAll(t)[0])}))}return e&&e.value?e.value:window.location.search.split("=")[1]},_XMLHttpRequest:function(t,e,s,l){var i=new XMLHttpRequest;i.open(t,e,!0),i.setRequestHeader("Accept","application/json"),i.setRequestHeader("Content-Type","application/json"),i.onload=function(){l(i.status,this.response)},"GET"==t?i.send():i.send(JSON.stringify(s))},_setCookie:function(t,e,s){var l=new Date;l.setTime(l.getTime()+24*s*60*60*1e3);var i="expires="+l.toUTCString();document.cookie=t+"="+e+";"+i+";path=/","hulk_wishlist_UserUUID"==t&&(hulkUserUUID=e)},_getCookie:function(t){for(var e=t+"=",s=decodeURIComponent(document.cookie).split(";"),l=0;l=1e3){for(var s=Math.floor((""+t).length/3),l="",i=2;i>=1;i--){if(((l=parseFloat((0!=s?t/Math.pow(1e3,s):t).toPrecision(i)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}l%1!=0&&(l=l.toFixed(1)),e=l+["","k","m","b","t"][s]}return e},_messageUpdate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=void 0===WishlistSettings.general.wishlist_notifications||WishlistSettings.general.wishlist_notifications,o=document.querySelectorAll(".wishlistError")[0],n=void 0!==WishlistSettings.general.popup_delay?WishlistSettings.general.popup_delay:"5";if(null!=o&&null!=o&&i){if(l){var a=t.replace("{Product}","".concat(e,"")),r='
    ';r+='
    ',r+='wishlist product'),r+='
    '.concat(a,"
    "),r+="
    ",o.innerHTML=r}else o.innerHTML=t;o.classList.add("hulkActive"),setTimeout((function(){o.classList.remove("hulkActive")}),1e3*parseInt(n))}},_buttonUpdate:function(t,e,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",n=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if("added"==t){if(""!==e){void 0!==e.getElementsByClassName("hulk-wishlist-custom-icon")[0]&&e.getElementsByClassName("hulk-wishlist-custom-icon")[0].setAttribute("src",WishlistSettings.style.filled_set_custom_icon),e.querySelector(".hulk_wl_icon")&&e.querySelector(".hulk_wl_icon").setAttribute("style",fillIconStyle),e.querySelector(".collection-icon")&&e.querySelector(".collection-icon").setAttribute("style",fillCollectionIconStyle);var a=void 0!==WishlistSettings.style.show_icon_animation?WishlistSettings.style.show_icon_animation:"true";if("true"===a){var r=e.querySelector(".heart-hulk-animation");null!=r&&null!=r&&r.setAttribute("style",iconAnimationStyles)}e.setAttribute("data-added",!0),"1"!==window.hulkappsWishlist.hasAppBlockSupport&&(e.setAttribute("class","icon-wishlist-heart "+wishlistBtnStyle+" wishlist-btn heart-wishlist-animation"),e.querySelector("span")&&(e.querySelector("span").innerHTML=WishlistSettings.language.success_button_text))}}else""!==e&&(void 0!==e.getElementsByClassName("hulk-wishlist-custom-icon")[0]&&e.getElementsByClassName("hulk-wishlist-custom-icon")[0].setAttribute("src",WishlistSettings.style.empty_set_custom_icon),null==e.querySelector(".hulk_wl_icon")&&null==e.querySelector(".hulk_wl_icon")||e.querySelector(".hulk_wl_icon").setAttribute("style",emptyIconStyle),e.querySelector(".collection-icon")&&e.querySelector(".collection-icon").setAttribute("style",emptyCollectionIconStyle),e.setAttribute("data-added",!1),"1"!==window.hulkappsWishlist.hasAppBlockSupport&&(e.setAttribute("class","icon-wishlist-heart-empty "+wishlistBtnStyle+" wishlist-btn heart-wishlist-animation"),e.querySelector("span")&&(e.querySelector("span").innerHTML=WishlistSettings.language.button_text)));document.querySelectorAll("[data-hulksaveforlater]")&&document.querySelectorAll("[data-hulksaveforlater]").forEach((function(t){t.setAttribute("class","addToWishlist")})),i._messageUpdate(s,l,o,n)}};window.addEventListener("load",(function(t){i.init(),setTimeout((function(){i._loadCustomJs()}),2e3)}))}});