1import{n as e}from"./chunks/helpers-bHWQF4Um.js";import{t}from"./chunks/Breakpoints-BGIbcD_k.js";import{r as n}from"./chunks/Tools-CeKNIRWc.js";import{n as r}from"./chunks/SensoryMode-BLYWH4Yi.js";var i=class{attach(e){this.io=new IntersectionObserver(this.onIntersect),e.querySelectorAll(`[data-video-title]`).forEach(e=>{this.io.observe(e)})}onIntersect(e){e.forEach(e=>{let t=e.target;t.tagName===`VIDEO`&&e.isIntersecting&&t.dataset.isVisible!==`true`&&(t.dataset.isVisible=`true`,t.play())})}detach(){}},a=class{attach(e){this.onIntersect=this.onIntersect.bind(this),e.querySelectorAll(`[data-scroll-reveal]`).forEach(e=>{let t=e.dataset.scrollRevealOffset||.3;this.io=new IntersectionObserver(this.onIntersect,{root:document.getElementById(`smooth-wrapper`),rootMargin:`-${innerHeight*t}px 0px -${innerHeight*t}px 0px`}),this.io.observe(e)})}onIntersect(e){e.forEach(e=>{e.isIntersecting&&e.target.classList.add(`visible`)})}detach(){}},o=class{constructor(e){this.elem=document.querySelector(e),this.isUnderLimit=window.scrollY>=window.innerHeight,this.elem&&(this.enabled=this.elem.dataset.enabled,this.elem.addEventListener(`click`,e=>{if(e.target.nodeName===`LABEL`){e.stopPropagation();return}this.elem.classList.toggle(`expand`),e.stopPropagation(),document.querySelector(`body`).addEventListener(`click`,e=>{this.elem.classList.remove(`expand`)})}),this.elem.querySelector(`[type=checkbox]`).addEventListener(`click`,e=>{jQuery.getJSON(drupalSettings.ecomode_url),this.enabled=this.enabled===`1`?`0`:`1`,this.elem.dataset.enabled=this.enabled,this.addNotification(),e.stopPropagation()}),this.bindEvents())}bindEvents(){window.addEventListener(`scroll`,this.onScroll.bind(this)),this.elem.addEventListener(`pointerenter`,this.onPointerEnter.bind(this))}onPointerEnter(){this.elem.classList.remove(`small`),this.isUnderLimit=!1}onScroll(){let e=window.scrollY>=window.innerHeight;this.elem.classList.remove(`expand`),e?e!==this.isUnderLimit&&(this.elem.classList.add(`small`),this.isUnderLimit=e):e!==this.isUnderLimit&&(this.elem.classList.remove(`small`),this.isUnderLimit=e)}addNotification(){let e=jQuery(`<div />`,{class:`alert-notification`,text:Drupal.t(`Les changements seront effectifs au prochain chargement de page.`)}).appendTo(`body`).get(0);setTimeout(()=>{e.remove()},5e3)}},s=class t{static get CONTACT_FORM_AJAX_RESPONSE_EVENT(){return`CustomGTMData.contact_form_ajax_response`}attach(t){window.dataLayer=window.dataLayer||[],e(t)&&(this.init(t),this.initContactForm(t),this.bindEvents())}init(e){this.handleData(),this.ecomodeToggle=e.getElementById(`ecomode-toggle`),this.videoHeaderToggle=e.querySelector(`.js-gtm-link-homepage-header-sound`),this.sensoryModeSoundsButtons=Array.from(e.querySelectorAll(`[data-sensory-mode-element="sound_button"]`)),this.sensoryModePauseBtn=e.querySelector(`[data-sensory-mode-element="pause_button"]`),this.nextLowSeasonForm=e.querySelector(`.webform-submission-form-basse-saison-form`),this.nextLowSeasonForm&&(this.nextLowSeasonButton=this.nextLowSeasonForm.querySelector(`.webform-button--next`))}initContactForm(e){this.contactFormWrapper=e.querySelector(`[data-contact-form-element="container"]`),this.contactFormWrapper&&(this.contactForm=this.contactFormWrapper.querySelector(`form`),this.contactForm&&(this.contactFormInputs=this.contactForm.querySelectorAll(`input`)))}bindEvents(){this.ecomodeToggle&&this.ecomodeToggle.addEventListener(`change`,this.onEcomodeToggleChange.bind(this)),this.videoHeaderToggle&&this.videoHeaderToggle.addEventListener(`change`,this.onVideoHeaderSoundChange.bind(this)),this.sensoryModeSoundsButtons.length&&this.sensoryModeSoundsButtons.forEach(e=>{e.addEventListener(`click`,this.onSensoryModeSoundsButtonClick.bind(this))}),this.sensoryModePauseBtn&&this.sensoryModePauseBtn.addEventListener(`click`,()=>{window.dataLayer.push({sensoryModeStatus:{isPlaying:!1,whichSoundIsPlaying:null}})}),this.contactFormInputs&&this.contactFormInputs.forEach(e=>{e.addEventListener(`focusin`,this.onInputFocusIn.bind(this))}),this.contactFormWrapper&&(window._mtm.push({event:`form_start`,form_name:`contact`}),this.contactFormWrapper.addEventListener(t.CONTACT_FORM_AJAX_RESPONSE_EVENT,this.onContactFormAjaxResponse.bind(this))),this.nextLowSeasonButton&&this.nextLowSeasonButton.addEventListener(`submit`,()=>{window.dataLayer.push({event:`low-season-form-next-step`})})}onContactFormAjaxResponse(e){window.dataLayer.push({event:`contact-form-submit`,...e.detail}),window._mtm.push({event:`form_submit`,form_name:`contact`,...e.detail}),console.log(`Send MTM event form_submit with form_name value contact and more parameters`)}onInputFocusIn(e){this.formHasBeenFocused||(this.formHasBeenFocused=!0,window.dataLayer.push({event:`contact-form-start`,target:e.currentTarget.name.value}))}
1onSensoryModeSoundsButtonClick(e){let t=e.currentTarget.classList.contains(`is_playing`);window.dataLayer.push({event:`sensory-mode-status-change`,sensoryModeStatus:{isPlaying:!t,whichSoundIsPlaying:t?null:e.currentTarget.dataset.soundId}})}onVideoHeaderSoundChange(e){window.dataLayer.push({event:`header-sound-change`,videoHeaderSoundStatus:e.currentTarget.checked?`on`:`off`})}onEcomodeToggleChange(e){window.dataLayer.push({event:`ecomode-change`,ecomodeStatus:e.currentTarget.checked?`on`:`off`})}handleData(){let e=drupalSettings.custom_data_gtm,t;e!==void 0&&(t=e.override?{nav:{...e.breadcrumb,...e.override}}:{nav:{...e.breadcrumb}},window.dataLayer.push(t))}};(function(e){e.fn.dispatchAjaxContactFormResponse=function(e){document.querySelector(`[data-contact-form-element="container"]`).dispatchEvent(new CustomEvent(s.CONTACT_FORM_AJAX_RESPONSE_EVENT,{detail:{...e}}))}})(jQuery);var c=new s,l=class{attach(n){if(e(n)){let e=localStorage.getItem(`onsitemode_popin`);t.isMobile&&!e&&(this.loadOnSiteModePopin(),localStorage.setItem(`onsitemode_popin`,1))}}loadOnSiteModePopin(){let e=`/${drupalSettings.langcode}/on-site-mode/popin`;jQuery.get(e,e=>{jQuery(`body`).append(e)})}detach(){}},u=class{attach(e){this.onFormSubmit=this.onFormSubmit.bind(this),this.form=e.querySelector(`[data-search-element="form"]`),this.form&&this.form.addEventListener(`submit`,this.onFormSubmit)}onFormSubmit(e){let t=e.currentTarget,n=new FormData(t),r={};for(let e of n.keys())[`form_id`,`form_build_id`].includes(e)||(r[e]=n.get(e));window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:`submit-header-search-form`,data:r})}detach(e){}};Drupal.behaviors.custom_gtm_data=c,Drupal.behaviors.sensory_mode=r,Drupal.behaviors.video_title=new i,Drupal.behaviors.scroll_reveal=new a,Drupal.behaviors.on_site_mode=new l,Drupal.behaviors.global_search_form=new u,new n,new o(`.EcoMode-button`);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.