//* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ const theme=localStorage.getItem('theme')||(window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light');document.documentElement.setAttribute('data-theme',theme);; document.addEventListener('DOMContentLoaded',()=>{const buttons=Array.from(document.querySelectorAll('header .menu-top-toggle, header #lang-toggle'));let activeButton=null;function getSubmenu(button){if(!button)return null;const submenuId=button.getAttribute('aria-controls');if(!submenuId)return null;return document.getElementById(submenuId);}function getFocusableElements(container){if(!container)return [];return Array.from(container.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'));}function getIndicator(button){if(!button)return null;return button.querySelector('.menu-top-indicator, .lang-indicator');}function closeMenu(button,restoreFocus=false){if(!button)return;const submenu=getSubmenu(button);const indicator=getIndicator(button);button.setAttribute('aria-expanded','false');button.setAttribute('title','Ouvrir le menu');if(submenu){submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');}if(indicator)indicator.textContent='+';if(activeButton===button)activeButton=null;if(restoreFocus)button.focus();}function openMenu(button){if(!button)return;const submenu=getSubmenu(button);if(!submenu)return;buttons.forEach((otherButton)=>{if(otherButton!==button)closeMenu(otherButton);});const indicator=getIndicator(button);button.setAttribute('aria-expanded','true');button.setAttribute('title','Menu ouvert');submenu.classList.remove('hidden');submenu.setAttribute('aria-hidden','false');if(indicator)indicator.textContent='-';activeButton=button;const focusables=getFocusableElements(submenu);if(focusables.length)focusables[0].focus();}function toggleMenu(button){const isOpen=button.getAttribute('aria-expanded')==='true';if(isOpen)closeMenu(button,true);else openMenu(button);}buttons.forEach((button)=>{button.setAttribute('aria-expanded','false');button.setAttribute('title','Ouvrir le menu');const submenu=getSubmenu(button);if(submenu){submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');}const indicator=getIndicator(button);if(indicator)indicator.textContent='+';button.addEventListener('click',(event)=>{event.preventDefault();toggleMenu(button);});});document.addEventListener('close-header-details',()=>{buttons.forEach((button)=>{closeMenu(button);});});document.addEventListener('click',(event)=>{if(!activeButton)return;const submenu=getSubmenu(activeButton);if(activeButton.contains(event.target)||(submenu&&submenu.contains(event.target)))return;closeMenu(activeButton);});document.addEventListener('keydown',(event)=>{if(event.key==='Escape'&&activeButton){event.preventDefault();const button=activeButton;closeMenu(button,true);}});});; (function(){'use strict';document.addEventListener('DOMContentLoaded',()=>{const drawer=document.getElementById('drawer');const drawerToggle=document.getElementById('menu-drawer');const drawerOpen=document.getElementById('drawer-open');const drawerSide=document.getElementById('drawer-side');const drawerPanel=document.getElementById('drawer-panel');const drawerCloseButtons=document.querySelectorAll('[data-drawer-close]');const menu=document.getElementById('menu');const submenu=document.getElementById('submenu');const FOCUSABLE='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';let keydownHandler=null;function isVisible(el){return !!(el&&(el.offsetWidth||el.offsetHeight||el.getClientRects().length));}function setMenuExpandedState(trigger,isOpen){if(!trigger)return;trigger.setAttribute('aria-expanded',isOpen?'true':'false');trigger.setAttribute('title',isOpen?'Menu ouvert':'Ouvrir le menu');}function getControlledSubmenu(trigger){if(!trigger)return null;const submenuId=trigger.getAttribute('aria-controls');if(!submenuId)return null;return document.getElementById(submenuId);}function getFocusable(container){if(!container)return [];return Array.from(container.querySelectorAll(FOCUSABLE)).filter((el)=>{return (isVisible(el)&&!el.hasAttribute('disabled')&&el.getAttribute('aria-hidden')!=='true');});}function setDrawerState(isOpen,options={}){const restoreFocus=options.restoreFocus!==false;if(!drawerToggle||!drawerOpen||!drawerSide||!drawerPanel)return;drawerToggle.checked=isOpen;drawerOpen.setAttribute('aria-expanded',isOpen?'true':'false');drawerSide.setAttribute('aria-hidden',isOpen?'false':'true');document.documentElement.style.overflow=isOpen?'hidden':'';if(isOpen){document.dispatchEvent(new CustomEvent('close-header-details'));activateTrap();setTimeout(()=>{const closeButton=document.getElementById('drawer-close');const focusables=getFocusable(drawerPanel);if(closeButton&&isVisible(closeButton))closeButton.focus();else if(focusables.length)focusables[0].focus();else drawerPanel.focus();},0);}else{deactivateTrap();if(restoreFocus)drawerOpen.focus();}}function activateTrap(){if(!drawerPanel||keydownHandler)return;keydownHandler=function(e){if(e.key==='Escape'){e.preventDefault();setDrawerState(false);return;}if(e.key!=='Tab')return;const focusables=getFocusable(drawerPanel);if(focusables.length===0){e.preventDefault();drawerPanel.focus();return;}const firstEl=focusables[0];const lastEl=focusables[focusables.length-1];if(e.shiftKey&&document.activeElement===firstEl){e.preventDefault();lastEl.focus();}else{if(!e.shiftKey&&document.activeElement===lastEl){e.preventDefault();firstEl.focus();}}};drawerPanel.addEventListener('keydown',keydownHandler);}function deactivateTrap(){if(!drawerPanel||!keydownHandler)return;drawerPanel.removeEventListener('keydown',keydownHandler);keydownHandler=null;}if(drawerOpen)drawerOpen.addEventListener('click',()=>{setDrawerState(true);});drawerCloseButtons.forEach((button)=>{button.addEventListener('click',()=>{setDrawerState(false);});});if(drawerToggle)drawerToggle.addEventListener('change',()=>{setDrawerState(drawerToggle.checked);});if(drawerSide)drawerSide.addEventListener('click',(e)=>{if(e.target.matches('[data-drawer-close]'))setDrawerState(false);});if(menu&&submenu){menu.querySelectorAll('#menu li li .indicator').forEach((indicator)=>{indicator.remove();});const allUls=menu.querySelectorAll('ul');if(allUls.length>1)allUls.forEach((sub,index)=>{if(index!==0){sub.classList.add('hidden');sub.setAttribute('aria-hidden','true');}});const rootTriggers=menu.querySelectorAll(':scope > ul > li > .menu-root-trigger');rootTriggers.forEach((trigger)=>{const controlledSubmenu=getControlledSubmenu(trigger);if(controlledSubmenu)setMenuExpandedState(trigger,false);trigger.addEventListener('click',(e)=>{const currentTrigger=e.currentTarget;const currentSub=getControlledSubmenu(currentTrigger);const indicator=currentTrigger.querySelector('.indicator');if(!currentSub)return;e.preventDefault();rootTriggers.forEach((otherTrigger)=>{otherTrigger.classList.remove('active-link');if(otherTrigger.hasAttribute('aria-expanded'))setMenuExpandedState(otherTrigger,false);});menu.querySelectorAll(':scope > ul > li > .menu-root-trigger > .indicator').forEach((ind)=>{ind.textContent='+';});currentTrigger.classList.add('active-link');setMenuExpandedState(currentTrigger,true);if(indicator)indicator.textContent='−';let items=[];if(currentSub.matches('ul'))items=Array.from(currentSub.querySelectorAll(':scope > li > a'));else items=Array.from(currentSub.querySelectorAll(':scope > ul > li > a'));const parentTriggerClone=currentTrigger.cloneNode(true);parentTriggerClone.querySelectorAll('.indicator, svg').forEach((el)=>{el.remove();});const parentLabel=parentTriggerClone.textContent.trim();if(items.length)submenu.innerHTML=`

${parentLabel}

`;else submenu.innerHTML=`

Aucun sous-lien disponible.

`;submenu.focus();});});}const mobileMenu=document.querySelector('.mobile-accordion');if(mobileMenu){const rootItems=Array.from(mobileMenu.querySelectorAll(':scope > ul > li'));rootItems.forEach((li)=>{const sub=li.querySelector(':scope > ul');const trigger=li.querySelector(':scope > .menu-root-trigger, :scope > a');const indicator=trigger?trigger.querySelector('.indicator'):null;if(sub){sub.classList.add('hidden');sub.setAttribute('aria-hidden','true');}if(indicator)indicator.textContent='+';if(trigger&&sub)setMenuExpandedState(trigger,false);});rootItems.forEach((li)=>{const trigger=li.querySelector(':scope > .menu-root-trigger, :scope > a');const sub=li.querySelector(':scope > ul');const indicator=trigger?trigger.querySelector('.indicator'):null;if(!trigger||!sub)return;trigger.addEventListener('click',(e)=>{e.preventDefault();rootItems.forEach((other)=>{if(other===li)return;const otherSub=other.querySelector(':scope > ul');const otherTrigger=other.querySelector(':scope > .menu-root-trigger, :scope > a');const otherIndicator=otherTrigger?otherTrigger.querySelector('.indicator'):null;if(otherSub){otherSub.classList.add('hidden');otherSub.setAttribute('aria-hidden','true');}if(otherIndicator)otherIndicator.textContent='+';if(otherTrigger&&otherSub)setMenuExpandedState(otherTrigger,false);});const nowHidden=sub.classList.toggle('hidden');sub.setAttribute('aria-hidden',nowHidden?'true':'false');if(indicator)indicator.textContent=nowHidden?'+':'−';setMenuExpandedState(trigger,!nowHidden);});});}});})();; (function(){'use strict';document.addEventListener('DOMContentLoaded',function(){var params=new URLSearchParams(window.location.search);var val=params.get('search_api_fulltext');if(val!==null){var input=document.querySelector('input[name="search"]');if(input)input.value=val;}});})();; (function(){'use strict';document.addEventListener('DOMContentLoaded',function(){const profileMenu=document.querySelector('.js-menu-profile');const mainMenu=document.querySelector('.js-menu-main');if(profileMenu&&mainMenu){const hasActiveItem=(menu)=>menu.querySelector('.is-active, .has-active, .menu-item--active-trail, [aria-current="page"]');if(hasActiveItem(mainMenu)){mainMenu.classList.remove('hidden');profileMenu.classList.add('hidden');}else if(hasActiveItem(profileMenu)){profileMenu.classList.remove('hidden');mainMenu.classList.add('hidden');}else{mainMenu.classList.add('hidden');profileMenu.classList.add('hidden');}}const aside=document.querySelector('.aside-menu-wrapper');if(!aside)return;let submenuUid=0;function ensureSubmenuId(submenu){if(!submenu)return null;if(!submenu.id){submenuUid+=1;submenu.id=`aside-submenu-${submenuUid}`;}return submenu.id;}function focusFirstSubmenuLink(submenu){if(!submenu)return;const firstLink=submenu.querySelector('a[href]');if(firstLink)firstLink.focus();}function initAsideMenu(context){if(!context)return;if(aside.classList.contains('formation')){aside.querySelectorAll('li').forEach((li)=>{const link=li.querySelector(':scope > a');const indicator=link?link.querySelector('.indicator'):null;const submenu=li.querySelector(':scope > ul');if(!link||!indicator||!submenu)return;const isActive=li.classList.contains('has-active')||li.classList.contains('menu-item--active-trail')||li.querySelector('.is-active, [aria-current="page"]');if(isActive){submenu.classList.remove('hidden');submenu.setAttribute('aria-hidden','false');}else{submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');}indicator.remove();});return;}const rootUl=aside.querySelector('ul');if(!rootUl)return;function closeAllOpenExcept(currentLi){if(!currentLi)return;const keep=new Set();let node=currentLi;while(node&&node!==aside){if(node.tagName==='LI')keep.add(node);node=node.parentElement;}aside.querySelectorAll('li > a[aria-expanded="true"]').forEach((a)=>{const li=a.closest('li');if(!li||keep.has(li))return;const sub=li.querySelector(':scope > ul');const ind=a.querySelector('.indicator');if(!sub||!ind)return;sub.classList.add('hidden');sub.setAttribute('aria-hidden','true');a.setAttribute('aria-expanded','false');ind.textContent='+';});}context.querySelectorAll('li').forEach((li)=>{if(li.dataset.asideMenuInitialized==='true')return;li.dataset.asideMenuInitialized='true';const link=li.querySelector(':scope > a');const indicator=link?link.querySelector('.indicator'):null;const submenu=li.querySelector(':scope > ul');if(!link||!indicator||!submenu)return;const isLevel0=li.parentElement===rootUl;const submenuId=ensureSubmenuId(submenu);indicator.removeAttribute('tabindex');indicator.setAttribute('aria-hidden','true');if(submenuId)link.setAttribute('aria-controls',submenuId);if(isLevel0){submenu.classList.remove('hidden');submenu.setAttribute('aria-hidden','false');indicator.remove();link.removeAttribute('aria-expanded');link.removeAttribute('aria-controls');return;}const isActive=li.classList.contains('has-active')||li.classList.contains('menu-item--active-trail')||li.querySelector('.is-active, [aria-current="page"]');if(isActive){submenu.classList.remove('hidden');submenu.setAttribute('aria-hidden','false');link.setAttribute('aria-expanded','true');indicator.textContent='−';}else{submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');link.setAttribute('aria-expanded','false');indicator.textContent='+';}function closeItem(){submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');link.setAttribute('aria-expanded','false');indicator.textContent='+';}function openItem(){submenu.classList.remove('hidden');submenu.setAttribute('aria-hidden','false');link.setAttribute('aria-expanded','true');indicator.textContent='−';}function toggleItem(options={}){const moveFocusToSubmenu=options.moveFocusToSubmenu===true;const isOpen=link.getAttribute('aria-expanded')==='true';if(isOpen){closeItem();return;}closeAllOpenExcept(li);if(li.dataset.menuLoaded==='false'){const pluginId=li.dataset.menuPlugin;if(!pluginId)return;indicator.textContent='…';fetch(`${window.drupalSettings?.path?.baseUrl||'/'}${window.drupalSettings?.path?.pathPrefix||''}ajax/menu-subtree/${encodeURIComponent(pluginId)}`).then((res)=>res.text()).then((html)=>{submenu.innerHTML=html;li.dataset.menuLoaded='true';if(!submenu.querySelector('li')){indicator.remove();link.removeAttribute('aria-expanded');link.removeAttribute('aria-controls');submenu.classList.add('hidden');submenu.setAttribute('aria-hidden','true');return;}initAsideMenu(submenu);openItem();if(moveFocusToSubmenu)focusFirstSubmenuLink(submenu);}).catch(()=>{indicator.textContent='+';});}else{openItem();if(moveFocusToSubmenu)focusFirstSubmenuLink(submenu);}}indicator.addEventListener('click',function(e){e.preventDefault();e.stopPropagation();toggleItem({moveFocusToSubmenu:false});});link.addEventListener('click',function(e){if(e.target.closest('.indicator')){e.preventDefault();e.stopPropagation();}});link.addEventListener('keydown',function(e){if(e.key===' '){e.preventDefault();toggleItem({moveFocusToSubmenu:true});}if(e.key==='Escape'){e.preventDefault();closeItem();link.focus();}});});}initAsideMenu(aside);});})();; (function(){'use strict';document.addEventListener('DOMContentLoaded',()=>{const panels=document.querySelectorAll('.menu-panel');const menuButtons=document.querySelectorAll('.menu-btn');const closeButtons=document.querySelectorAll('.btn-close');const homeButton=document.getElementById('btn-home');const accordions=document.querySelectorAll('.accordion');let lastTriggerButton=null;const stickyMenu=document.querySelector('.sticky-menu, .footer-mobile-sticky, #sticky-menu');if(!panels.length&&!menuButtons.length&&!accordions.length)return;const footerMenu=document.querySelector('.mobile-accordion');if(footerMenu){const rootUl=footerMenu.querySelector(':scope > ul');footerMenu.querySelectorAll('.indicator').forEach((indicator)=>{const link=indicator.closest('a');const li=indicator.closest('li');if(!link||!li)return;const parentUl=li.parentElement;const isLevel0=parentUl===rootUl;if(!isLevel0){indicator.remove();link.removeAttribute('aria-expanded');}});}function closeAll(){panels.forEach((panel)=>panel.classList.add('hidden'));}function resetButtons(){menuButtons.forEach((btn)=>{btn.classList.remove('text-[#3452FF]');const img=btn.querySelector('img');if(img&&img.dataset.default)img.src=img.dataset.default;});if(homeButton){const isHome=window.location.pathname==='/'||window.location.pathname==='/index.html';const homeImg=homeButton.querySelector('img');if(isHome){homeButton.classList.add('text-[#3452FF]');if(homeImg&&homeImg.dataset.active)homeImg.src=homeImg.dataset.active;}else{homeButton.classList.remove('text-[#3452FF]');if(homeImg&&homeImg.dataset.default)homeImg.src=homeImg.dataset.default;}}}function trapFocus(panel){function getFocusable(){return Array.from(panel.querySelectorAll('a[href], button:not([disabled]), input, [tabindex]:not([tabindex="-1"])')).filter((el)=>el.offsetParent!==null);}function keyHandler(e){if(e.key==='Tab'){const focusables=getFocusable();if(!focusables.length)return;const first=focusables[0];const last=focusables[focusables.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else{if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}}}if(e.key==='Escape'){closeAll();resetButtons();if(lastTriggerButton)lastTriggerButton.focus();panel.removeEventListener('keydown',keyHandler);}}panel.addEventListener('keydown',keyHandler);const focusables=getFocusable();if(focusables.length)focusables[0].focus();}menuButtons.forEach((btn)=>{btn.addEventListener('click',(e)=>{e.preventDefault();const target=document.getElementById(btn.dataset.panel);if(!target)return;lastTriggerButton=btn;const isOpen=!target.classList.contains('hidden');closeAll();resetButtons();if(!isOpen){btn.classList.add('text-[#3452FF]');const img=btn.querySelector('img');if(img&&img.dataset.active)img.src=img.dataset.active;target.classList.remove('hidden');trapFocus(target);}});});closeButtons.forEach((btn)=>{btn.addEventListener('click',()=>{closeAll();resetButtons();if(lastTriggerButton)lastTriggerButton.focus();});});accordions.forEach((acc)=>{const trigger=acc.querySelector('.accordion-trigger');const panel=acc.querySelector('.accordion-content');const icon=acc.querySelector('.accordion-icon');if(!trigger||!panel||!icon)return;function toggleAccordion(){const isOpen=trigger.getAttribute('aria-expanded')==='true';trigger.setAttribute('aria-expanded',String(!isOpen));panel.classList.toggle('hidden',isOpen);icon.textContent=isOpen?'+':'−';trigger.classList.toggle('text-[#3452FF]',!isOpen);icon.classList.toggle('text-[#3452FF]',!isOpen);}trigger.addEventListener('click',toggleAccordion);trigger.addEventListener('keydown',(e)=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();toggleAccordion();}if(e.key==='Escape'){trigger.setAttribute('aria-expanded','false');panel.classList.add('hidden');icon.textContent='+';trigger.classList.remove('text-[#3452FF]');icon.classList.remove('text-[#3452FF]');trigger.focus();}});});resetButtons();});})();;