var DownloadableProductsHelper=function(){var i=this;this.downloadUrl="";this.downloadTitle="vue.downloadnotification.title";this.maxConcurrencyDownloads=1;var n={downloadCheckbox:".downloadCheckbox",downloadButton:".download-btn"};this.setSelectors=function(t){n=t};var t,f=function(){$(n.downloadCheckbox).change(function(){$(n.downloadCheckbox+":checked").length>0?$(n.downloadButton).show():$(n.downloadButton).hide()})},a=function(){$(n.downloadButton).click(function(){for(var f=$(n.downloadCheckbox+":checked"),e=[],o=[],t=0;t=i.maxConcurrencyDownloads?r(!0):setTimeout(()=>{r(!1)},1e3)},u=function(n,r){(!t||t.isDestroyed)&&(t=cfVue.immediateAction.open({position:"is-bottom-right",title:i.downloadTitle,onStatusChanged:s,onClose:o}));var u=null;r&&(u=h(r));t.insert(n,u);window.immediateActionData=t},h=function(n){var t=l(n),i=c(t,3);return t.length>3?i.join(", ")+"...":t.join(", ")};function c(n,t){return n.slice(0,Math.min(n.length,t))}var l=function(n){return n.filter(function(n,t,i){return i.indexOf(n)==t})};this.init=function(n){i.downloadUrl=n;e()};this.setDialogTitle=function(n){i.downloadTitle=n}};function CartInit(n){const{downloadNotificationTitle:r,downloadUrl:i,errors:u}=n;var t=new DownloadableProductsHelper;t.setDialogTitle(r);t.init(i);$(".downloadCheckbox").removeAttr("disabled");$(".download-btn").click(function(){for(var r=$(".downloadCheckbox:checked"),u=[],f=[],n=0;n<\/option>").val(i.id).html(i.name))});n.hide()},error:function(){alert("Failed to retrieve states.");n.hide()}})})}window._SizeInfoPopupInit=function(){window.showWindow=function(n,t,i){let u=$("#"+n);if(i=u.height(),self.innerWidth)var f=self.innerWidth,e=self.innerHeight;else if(document.documentElement&&document.documentElement.clientWidth)var f=document.documentElement.clientWidth,e=document.documentElement.clientHeight,s=document.documentElement.scrollTop;else if(document.body)var f=document.body.clientWidth,e=document.body.clientHeight,s=document.body.scrollTop;if(document.documentElement){var s=document.documentElement.scrollTop;if(document.body.scrollTop>0)var s=document.body.scrollTop}var o=(f-t)/2,r=(e-i)/2;r<0&&(r=$(window).scrollTop()+15,$("#"+n).css("position","absolute"));u.css("left",o).css("top",r).width(t).height(i).css("visibility","visible");$("#fader").css("opacity","0.1")};window.closeWindow=function(n){$("#"+n).css("visibility","hidden");$("#fader").css("opacity","1")}};function CheckoutCompletedInit(){$("html").addClass("CheckoutCompleted")}(function(n){n.cookie=function(t,i,r){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(i))||i===null||i===undefined)){if(r=n.extend({},r),(i===null||i===undefined)&&(r.expires=-1),typeof r.expires=="number"){var h=r.expires,e=r.expires=new Date;e.setDate(e.getDate()+h)}return i=String(i),document.cookie=[encodeURIComponent(t),"=",r.raw?i:encodeURIComponent(i),r.expires?"; expires="+r.expires.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}r=i||{};for(var o=r.raw?function(n){return n}:decodeURIComponent,s=document.cookie.split("; "),u=0,f;f=s[u]&&s[u].split("=");u++)if(o(f[0])===t)return o(f[1]||"");return null}})(jQuery);function CrossSellProductsInit(n){const{isPopup:i,totalProducts:r,title:u}=n,f=$.cookie("showCrossSellPopup");function e(){const n=$("#footerContent"),t=n[0].innerHTML;return n.remove(),t}function t(n){n.close()}function o(n){const i=e();n.setCloseCallback(function(){t(n)});n.setTitle(u);n.setFooterContent(i)}function s(n){o(n);setTimeout(()=>a(n))}function h(){const t=$.cookie("showCrossSellPopup"),n=$("#checkboxNotShow");if(t){n.attr("checked","checked");return}n.removeAttr("checked")}function c(n){$("#closeButton").click(function(){t(n)})}function l(){$("#checkboxNotShow").click(function(){if($("#checkboxNotShow").is(":checked")){$.cookie("showCrossSellPopup",!0);return}$.cookie("showCrossSellPopup",null)})}function a(n){h();c(n);l()}function v(){$("#cross-sell-btn-trigger").removeClass("is-hidden")}(function(){if(r&&i){v();const n=window.getVueInstanceByName("cross-sell-window",window.App).$children[0];f||setTimeout(function(){$(document).trigger("cross-sell-builder.show")});const t=$("#cross-sell-popup");$(document).on("cross-sell-builder.show",()=>{$(t).show(),n.open(),setTimeout(()=>s(n))})}})();$(document).on("cross-sell-builder.show",()=>{const n=()=>{const n=$("#cross-sell-popup .modal-card");if($("#cross-sell-list .listItem")){const t=$("#cross-sell-list .listItem").length-$("#cross-sell-list .listItem.is-hidden").length;if(n){let i="";i=window.innerWidth<1450?"90%":t*312+"px";$(n).css({"max-width":i})}}};n();$("#cross-sell-popup").on("DOMNodeInserted","div",()=>{n()})})}function _LoadStateProvinceInit(n){const{countryInputId:t,stateProvinceInputId:u,getStatesByCountryIdUrl:f}=n;window.LoadCounties=function(n){var r=$(t).val();if(r){var e=$(u),i=$("#states-loading-progress");i.show();$.ajax({cache:!1,type:"GET",url:f,data:{countryId:r},success:function(t){e.html("");$.each(t,function(n,t){var i=$("