BC.fix=function(n){n.onerror=null;n.src="/UI/img/blank.gif";n.style.display="none"};BC.supportPassive=function(){var t=!1,n;try{n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,n);window.removeEventListener("testPassive",null,n)}catch(i){}return t}();BC.uniq=function(n){return n.filter(function(n,t,i){return i.indexOf(n)===t})};BC.throttle=function(n,t){var r=!1,i;const u=function(){i?(n(...i),i=null,setTimeout(u,t)):r=!1};return function(...f){if(r){i=f;return}n(...f);r=!0;setTimeout(u,t)}};BC.AJAX.initTradingPage=function(){BC.AJAX.InitOnglets.call(this);BC.adjustResponsiveCharts(500)};BC.initHeader=function(){$("#box-connection .connected").length?($("html").removeClass("not-logged"),$("html").addClass("logged")):($("html").removeClass("logged"),$("html").addClass("not-logged"))};BC.initToggle=function(){const n=Array.from(document.getElementsByClassName("toggle-button"));n.forEach(function(n){n.addEventListener("click",function(n){const i=this.getAttribute("data-toggle-element"),r=i.split(" "),u=this.getAttribute("data-toggle-class"),t=this.getAttribute("data-flip");r.forEach(function(n){var i=document.querySelector(n);if(i&&(i.classList.toggle(u),t!==null)){const n=document.querySelectorAll(t)[0],i=n.querySelector("form");n.style.minHeight=i.clientHeight+"px"}});n.preventDefault()},!1)})};BC.AJAX.initHeaderConnection=function(){var u=document.getElementById("user-menu"),o=document.getElementById("m-infos");u&&o.appendChild(u);BC.initHeader();BC.initToggle();var f=document.getElementById("form-search__toggle"),e=document.getElementById("connection__toggle"),i=document.getElementById("form-search"),r=document.getElementById("box-connection").querySelectorAll(".inner")[0],n=document.getElementById("search-overlay"),t=document.getElementById("connection-overlay");f&&f.addEventListener("click",function(u){i.classList.toggle("visible");n.classList.toggle("visible");r.classList.remove("visible");t.classList.remove("visible");u.preventDefault()},!1);e&&e.addEventListener("click",function(u){r.classList.toggle("visible");t.classList.toggle("visible");i.classList.remove("visible");n.classList.remove("visible");u.preventDefault()},!1);n.addEventListener("click",function(t){i.classList.remove("visible");n.classList.remove("visible");t.preventDefault()},!1);t.addEventListener("click",function(n){r.classList.remove("visible");t.classList.remove("visible");n.preventDefault()},!1)};BC.applyConnection=function(){var n=Array.prototype.slice.call(arguments,0);$("#"+n.join(",#")).on("click",function(){var n=$("#connect-me");if(n.length)return n.click(),!1})};BC.AJAX.handlePostComment=function(){var n=document.forms.formCommentaires,t=document.forms.formReplyComment,i="/comments/refresh/"+n.FRelatedArticle.value+"?group="+n.FRelatedType.value;$.get(i,null,function(i){t&&(n.parentNode.appendChild(t),t.style.display="");$("#comments-wrapper").html(i);BC.updateComments()})};BC.AJAX.InitOnglets=function(){var n=$(this);$(".tabs",n).each(function(){var t=$(this),c=$("> .tab",t),r=t.next("div.tabs-content:eq(0)"),f=this.id||null,o=$.cookie(f),i=t.attr("data-script")?nw.tools.paramToObj(t.attr("data-script")):{},n={currentClass:"on",disabledClass:"off",nbTabs:c.length,url:"",index:0,defaut:i.defaut===0?0:i.defaut||"undefined",mode:i.mode||"none",event:i.event||"click",autoSize:i.autosize?!0:!1},u=function(t){r.find("> div:eq("+t+") div").data("ajax-href")&&setTimeout(function(){window.dispatchEvent(new CustomEvent("scroll"))},0);c.filter("."+n.currentClass).removeClass(n.currentClass).end().filter(":eq("+t+")").addClass(n.currentClass)},e=function(t){n.mode==="async"&&t.url!==""?(r.empty(),$.ajax({url:t.url,success:function(t){r.removeClass("box b-error").html(t);u(n.index)},error:function(){r.addClass("box b-error").html(" D&eacute;sol&eacute;, une erreur est survenue.")}})):n.mode==="sync"?r.children("div:not(.tabs-content-visible)").css({visibility:"hidden",height:0}).filter(":eq("+t.index+")").css({visibility:"visible",height:""}):n.mode==="img"&&BC.adjustChartUrl(r.find("img")[0],t.url)};if(i.start=i.start|0,o&&(n.defaut=Math.max(0,o-i.start)),typeof n.defaut!="undefined"&&n.defaut>-1&&u(n.defaut),n.mode==="async")t.on(n.event,".tab",function(){if(!this.classList.contains(n.disabledClass)){var i=$(this);n.index=t.find(".tab").index(i);n.url=nw.tools.paramToObj(i.find("a").attr("data-script")).url;u(n.index);e({url:n.url})}return!1});else if(n.mode==="sync"){typeof n.defaut!="undefined"&&n.defaut>-1&&e({index:n.defaut});t.on(n.event,".tab",function(){if(!this.classList.contains(n.disabledClass)){var i=$(this);n.index=t.find(".tab").index(i);u(n.index);e({index:n.index});f&&$.cookie(f,n.index,{expires:365,path:"/"})}return!1})}else if(n.mode==="img"){o||n.defaut!=="undefined"||(n.defaut=0,u(n.defaut));typeof n.defaut!="undefined"&&n.defaut>-1&&(n.url=nw.tools.paramToObj(t.find("> .tab:eq("+n.defaut+")").find("a").attr("data-script")).url,e({url:n.url}));t.on(n.event,".tab",function(){if(!this.classList.contains(n.disabledClass)){var r=$(this),o=r.find("a");n.index=t.find(".tab").index(r);n.url=nw.tools.paramToObj(o.attr("data-script")).url;u(n.index);e({url:n.url});f&&$.cookie(f,n.index+i.start,{expires:365,path:"/"})}return!1})}else if(n.mode.substring(0,4)==="form"){var l=n.mode.split(":"),s=l.length===2?$("#"+l[1]):t.parents("form:eq(0)"),h=nw.tools.paramToObj(t.attr("data-script")).name;t.on(n.event,".tab:not(.link)",function(){if(!this.classList.contains(n.disabledClass)){var i=$(this),r=i.find("a"),t=nw.tools.paramToObj(r.attr("data-script")).val;$('input[name="'+h+'"]',s).length||s.append('<input type="hidden" name="'+h+'" value="'+t+'" />');s.find('input[name="'+h+'"]').val(t).end().submit()}return!1})}})};BC.adjustChartUrl=function(n,t){var s=t||n.src,f=/(.+?&d=)(\d+,\d+(,\d+)?)(.+)/,r=f.exec(s),h=$("#tabs-mini-graph .tab .title"),o;if(h.each(function(){var e=$(this),s=e.attr("data-script"),r=f.exec(s),o;if(r){var u=$(n).width()|0,i=r[2].split(","),h=i[0]/i[1],c=u/h|0;u!=i[0]&&u>0&&(i[0]=u,i[1]=c,o=r[1]+i.join(",")+r[4],e.attr("data-script",o),t=null)}}),r){var e=$(n),u=e.parent().width()|0,i=r[2].split(","),c=i[0]/i[1],l=e.data("height")||u/c|0;u!=i[0]&&u>0?(i[0]=u,i[1]=l,o=r[1]+i.join(",")+r[4],n.src=o,n.onload=function(){this.style.visibility="visible"},t=null):n.style.visibility="visible"}t&&(n.src=t)};BC.adjustResponsiveChartsTimer=-1;BC.adjustResponsiveCharts=function(n){clearTimeout(BC.adjustResponsiveChartsTimer);BC.adjustResponsiveChartsTimer=setTimeout(function(){$(".adjustable img").each(function(){BC.adjustChartUrl(this)});BC.adjustResponsiveChartsTimer=-1},n||0)};BC.AJAX.initConnection=function(){$("#mConnection").modal("toggle");$("#modals .close").on("click",function(){$("#modals form").find("input, textarea").val("");$("#modals form").find("input").removeClass("input-validation-error");$("span.myerror").html("");$("#modals").empty();$(".modal-backdrop").remove()});document.querySelector("#mConnection.in .modal_overlay").addEventListener("click",function(n){n.preventDefault();$(this).parent().removeClass("in")},!1);window.__initPrivacy&&__initPrivacy()}