'use strict';function marketDropDown(){if(document.getElementById("OwMarketSelection")){var a=document.querySelector(".dropdown-locale-value").value;if("ru ar en fr es de-de ru-ru pt-pt da-dk de-ch fr-be nl-nl ro-ro sv-se zh-hk it-it nb-no".split(" ").includes(a.toLowerCase())){document.getElementById("OwMarketSelection-trigger").innerHTML=document.getElementsByClassName("selected")[0].childNodes[1].innerHTML;if(getMarketCookieValue("MSCOMMarketCk"))updateUrl(),optionSelected();else if(!hasRequiredQueryParams(window.location.href)){a= document.querySelector(".selected").getAttribute("value");if(hasQueryParams(window.location.href)){var e=window.location.href.split("?");a=e[0]+"?market\x3d"+a+"\x26"+e[1]}else a=window.location.href+"?market\x3d"+a;window.location.href=a}document.querySelector(".dropdown-load-default").classList.remove("dropdown-load-default")}else document.getElementById("OwMarketSelection").style.display="none";var l=$(".dropdown-selector-button"),m=$(".dropdown-unordered-list");l.click(function(u){l.toggleClass("active"); m.slideToggle(200);u.stopPropagation()});m.click(function(u){l.click();u.stopPropagation()});window.addEventListener("click",function(u){document.querySelector(".dropdown-selector-button").classList.contains("active")&&(l.toggleClass("active"),m.slideToggle(200))})}} function optionSelected(){var a=getMarketCookieValue("MSCOMMarketCk");document.querySelector(".selected").classList.remove("selected");$("span[ value\x3d"+a+"]").addClass("selected");document.getElementById("OwMarketSelection-trigger").innerHTML=document.getElementsByClassName("selected")[0].childNodes[1].innerHTML;var e=a="";if(0!y.includes(x));0e.length)e=getMarketCookieValue("MSCOMMarketCk")?"en-"+getMarketCookieValue("MSCOMMarketCk"):"en-"+document.querySelector(".selected").getAttribute("value");else if(getMarketCookieValue("MSCOMMarketCk")){var l=e.substring(0,3);e=l+getMarketCookieValue("MSCOMMarketCk")}else e=l+document.querySelector(".selected").getAttribute("value"); l=a.split("?")[1].split("\x26")[0].split("\x3d")[1];e!==l&&(e="locale\x3d"+e,a=a.replace(a.split("?")[1].split("\x26")[0],e));a.includes("isM365Page\x3dtrue")||(a+="\x26isM365Page\x3dtrue");return a}function hasQueryParams(a){return a.includes("?")}function updateProductPrice(a,e,l){document.querySelector('[href*\x3d"'+a+'"]').parentElement.parentElement.previousElementSibling.children[1]} function updateUrl(){var a=window.location.href,e={id:"100"};if(getMarketCookieValue("MSCOMMarketCk")&&!hasRequiredQueryParams(a))hasQueryParams(a)?(e=a.split("?"),a=e[0]+"?market\x3d"+getMarketCookieValue("MSCOMMarketCk")+"\x26"+e[1]):a=a+"?market\x3d"+getMarketCookieValue("MSCOMMarketCk"),window.location.href=a;else if(getMarketCookieValue("MSCOMMarketCk")&&hasRequiredQueryParams(a)){var l=a.includes("\x26")?a.split("?")[1].split("\x26"):a.split("?")[1];getMarketCookieValue("MSCOMMarketCk")!=l[0].split("\x3d")[1]&& (a=a.split("market\x3d"),a=a[1].includes("\x26")?a[0]+"market\x3d"+getMarketCookieValue("MSCOMMarketCk")+"\x26"+a[1].split("\x26")[1]:a[0]+"market\x3d"+getMarketCookieValue("MSCOMMarketCk"),a=a.replace(window.location.origin,""),window.history.pushState(e,document.title,a))}}function hasRequiredQueryParams(a){return a.includes("market\x3d")} function getMarketCookieValue(a){var e=document.cookie;e.split(";");a+="\x3d";var l=e.indexOf("; "+a);if(-1==l){if(l=e.indexOf(a),0!=l)return null}else{l+=2;var m=document.cookie.indexOf(";",l);-1==m&&(m=e.length)}return e.substring(l+a.length,m).split(";")[0]} function checkNullDynamicFeature(){"placeholder"==$(".dynamic-feature-sku1Price")[0].value?$(".c-paragraph .dynamic-feature-sku1Price-anchor").hasClass("hide-content")||$(".c-paragraph .dynamic-feature-sku1Price-anchor").addClass("hide-content"):$(".dynamic-feature-component-v1 .dynamic-feature-component .c-paragraph a").hasClass("hide-content")&&$(".dynamic-feature-component-v1 .dynamic-feature-component .c-paragraph a").removeClass("hide-content")} function getLocalUserValue(){var a=document.querySelector(".dropdown-locale-value").value;"fr"==a?a="fr-fr":"en"==a?a="en-us":"ar"==a?a="ar-sa":"es"==a?a="es-us":"ru"==a&&(a="ru-kz");if(0<$("li.market-user-locale-value[value\x3d"+a+"]").length){$("li.market-user-locale-value[value\x3d"+a+"]");var e=$(".dropdown-item.selected").attr("value").toString();a=a.slice(0,-2)+e;a=$("li.market-user-locale-value[value\x3d"+a+"]")[0].innerHTML.toString()}else a="novalue";return a} $(function(){marketDropDown();var a=document.querySelector("ul.dropdown-unordered-list"),e=document.querySelectorAll("li.dropdown-no-bullets span.dropdown-item"),l=0;if(0!=$("#dropdown-list").length){const m=document.getElementById("dropdown-list");(new MutationObserver((f,c)=>{for(const k of f)"attributes"===k.type&&("display: none;"==$("#dropdown-list").attr("style")?u():$(".dropdown-selector-button")[0].classList.contains("active")&&w({savePosition:!0}))})).observe(m,{attributes:!0});function u(){if("complete"=== document.readyState){if(document.body.style.position="",document.body.style.overflowY="",document.body.style.marginTop){const f=-parseInt(document.body.style.marginTop,10);document.body.style.marginTop="";window.scrollTo(window.pageXOffset,f)}}else window.addEventListener("load",u)}function w({savePosition:f=!1}={}){"complete"===document.readyState?document.body.scrollHeight>window.innerHeight&&(f&&(document.body.style.marginTop=`-${window.pageYOffset}px`),document.body.style.overflowY="scroll"): window.addEventListener("load",()=>w({savePosition:f}))}[].forEach.call(e,function(f){f.addEventListener("click",function(){y(this)})});document.addEventListener("keydown",function(f){38===f.keyCode&&y(e[l-1]);40===f.keyCode&&y(e[l+1]);if(13===f.keyCode){var c=document.getElementsByClassName("dropdown-item selected")[0].attributes[0].value;document.cookie="MSCOMMarketCk\x3d"+c;updateUrl();optionSelected()}32===f.keyCode&&(c=document.getElementsByClassName("dropdown-item selected")[0].attributes[0].value, document.cookie="MSCOMMarketCk\x3d"+c,updateUrl(),optionSelected())});function y(f){var c=[].indexOf.call(e,f);-1!==c&&(l=c,c=$(f).height(),c+=24,$(a).scrollTop(),$(a).height(),c*=l,$(a).scrollTop(c),document.querySelector("li.dropdown-no-bullets span.dropdown-item.selected").classList.remove("selected"),f.classList.add("selected"))}}$("span.dropdown-item").click(function(){var m=this.getAttribute("value");document.cookie="MSCOMMarketCk\x3d"+m;document.querySelector(".selected").classList.remove("selected"); this.classList.add("selected");updateUrl();optionSelected()})});