function applyFilterDestination(n,t){var i=n.val(),r=n.find(":selected").text(),u={filterKey:t,value:i,label:r};$.ajax({url:"/async/panel/apply",cache:!1,data:u,dataType:"html",type:"POST",success:function(){$.ajax({url:"/partial/cart/changedeliveryarea",cache:!1,dataType:"html",type:"POST",success:function(n){$("body").append(n);$("#changedeliveryareamodal").modal("show");reloadOnChangedeliveryareamodalClose()}})}})}function goToByScroll(n){n=n.replace("link","");$("html,body").animate({scrollTop:$(`#${n}`).offset().top},"slow")}function onRequestInformationsFailure(){$("#request-informations-alert-block .reason").html(reason);$("#request-informations-alert-block .alert-success").slideUp("slow");$("#request-informations-alert-block .alert-danger").slideDown("slow");goToByScroll("request-informations-alert-block")}function onRequestInformationsSuccess(){$("#request-informations-alert-block .alert-danger").slideUp("slow");$("#request-informations-alert-block .alert-success").slideDown("slow");goToByScroll("request-informations-alert-block");$(".request-informations-message").val("")}function onFailure(){$("#reason").html(reason);$("#infobox-success").slideUp("slow");$("#infobox-danger").slideDown("slow");goToByScroll("alert-block")}function onSuccess(){$("#infobox-danger").slideUp("slow");$("#infobox-success").slideDown("slow");goToByScroll("alert-block")}function onSuccessRedirect(n){onSuccess();$("#alert-block").delay(3e3).slideUp("slow",function(){window.location.href=n})}function reloadOnChangedeliveryareamodalClose(){$("#changedeliveryareamodal").on("hidden.bs.modal",function(){window.location.reload()})}function initPopover(){var n=[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')),t=n.map(function(n){return new bootstrap.Popover(n)})}function reloadPage(){window.location.reload()}function changePage(n){location.href=n}function refreshIdentifiedVehicle(n){var t=document.getElementById("identified-vehicle-panel");null!=t&&$.ajax({url:"/partial/auto/identifiedvehicle",cache:!1,data:{isProductPage:n},dataType:"html",type:"POST",success:function(n){$("#identified-vehicle-panel").html(n)}})}function refreshCompatibleVehicule(n){var t=document.getElementById("compatible-vehicle-panel");null!=t&&$.ajax({url:"/partial/auto/compatiblevehicle",data:{isProductPage:n},cache:!1,dataType:"html",type:"POST",success:function(n){$("#compatible-vehicle-panel").html(n)}})}function ajaxModalLoading(){var n=document.getElementsByClassName("spinner");for(let t=0;t<n.length;t++)n[t].classList.remove("hidden")}function ajaxModalComplete(){var n=document.getElementsByClassName("spinner");for(let t=0;t<n.length;t++)n[t].classList.add("hidden")}function showPasswordComplexity(n){$(n).removeClass("d-none")}function togglePassword(n,t){const i=document.getElementById(t);i.type==="password"?(i.type="text",n.removeClass("flaticon-eye"),n.addClass("flaticon-eye-crossed")):(i.type="password",n.removeClass("flaticon-eye-crossed"),n.addClass("flaticon-eye"))}function reloadPasswordComplexity(n){$.ajax({url:"/partial/refresh/passwordcomplexity",data:{password:n.val()},cache:!1,dataType:"html",type:"POST",success:function(n){$("#password-complexity").html(n)}})}function toggleEye(n,t){n.val().trim().length!=0?$(`#${t}`).removeClass("d-none"):$(`#${t}`).addClass("d-none")}$(document).ready(function(){$(window).scroll(function(){$(window).scrollTop()>600?$("#back-top").addClass("visible"):$("#back-top").removeClass("visible")});try{$(window).load(function(){$("#accept_terms").length&&$("#accept_terms").modal("show");$("#changedLanguageModal").length&&$("#changedLanguageModal").modal("show")})}catch(n){}$.ajaxSetup({cache:!1});$(function(){$("#back-top").click(function(){$("html, body").animate({scrollTop:0},"slow")})});initPopover()})