function getCookie(e){let t=e+"=",s=document.cookie.split(";");for(let e=0;e<s.length;e++){let o=s[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}!function(e){var t=multi_inventory_popup.show_in_popup,s=multi_inventory_popup.force_to_select;function o(){var t=e("#set-def-store .rlist_location");t.length&&(t.is(":hidden")||t.hasClass("wcmlim-hidden")||"none"===t.css("display")?t.addClass("wcmlim-suppress-empty"):t.removeClass("wcmlim-suppress-empty"))}e(".set-def-store-popup-btn").click((function(s){s.preventDefault(),function(){switch(t){case"select":e("#set-def-store .rlist_location, #set-def-store .postcode-checker").hide(),e("#set-def-store .rlist_location").addClass("wcmlim-hidden"),e("#set-def-store #wcmlim-change-lc-select").is(":visible")||(e("#set-def-store #wcmlim-change-lc-select").removeAttr("style"),jQuery("#set-def-store #wcmlim-change-lc-select").css("display","block"));break;case"input":e("#set-def-store .rlist_location").hide(),e("#set-def-store .rlist_location").addClass("wcmlim-hidden"),e("#set-def-store .wcmlim_sel_location").hide(),e("#set-def-store .postcode-checker").show();break;case"list":e("#set-def-store .postcode-checker, #wcmlim-change-lc-select").hide(),e("#set-def-store .rlist_location").show(),e("#set-def-store .rlist_location").removeClass("wcmlim-hidden")}setTimeout(o,50)}()})),e(".set-def-store-popup-btn").magnificPopup({type:"inline",fixedContentPos:!1,fixedBgPos:!0,overflowY:"auto",closeBtnInside:!0,closeOnBgClick:!1,enableEscapeKey:!1,preloader:!1,midClick:!0,removalDelay:300}),e(document).on("mfpOpen",(function(){setTimeout(o,100)})),setTimeout(o,200);var i=multi_inventory_popup.selected_location_termid,l=multi_inventory_popup.selected_location;i&&"undefined"!==i&&null!==i||(i=getCookie("wcmlim_selected_location_termid")),l&&"undefined"!==l&&null!==l||(l=getCookie("wcmlim_selected_location")),"on"!=s||null!=i&&""!==i&&"-1"!==i&&null!=l&&""!==l&&"-1"!==l||(jQuery(".mfp-close").hide(),e(".set-def-store-popup-btn").click())}(jQuery);