1class CookiesCheckbox{constructor(settings){const defaultSettings={formSelector:'.wpcf7',clientNodeSelector:'.wpcf7-checkbox .wpcf7-list-item',elementToHideSelector:'.wpcf7-checkbox label',clientCheckboxSelector:'input[name="rgpd"]',cookiesSpanId:'span-axeptio',cookiesService:'processings',cookiesIdentifier:'',cookiesFormerLabelWrapper:'span',cookiesConsentCheckboxClass:'.AxeptioConsentCheckbox',cookiesCheckboxDetailsText:'En savoir plus',cookiesConsentDetailsTextClass:'.AxeptioConsentDetailsText',cookiesConsentDetailsLinkClass:'.AxeptioConsentDetailsLink',cookiesConsentRequired:true,cookiesConsentCheckboxAttributes:[],cookiesHideConsentDetailsLink:true,} 2this.settings={...defaultSettings,...settings};if(!this.settings.formSelector||!this.settings.cookiesIdentifier)return console.log('Missing formSelector or cookies manager ID');if(!document.querySelector(this.settings.formSelector))return;this.clientNode=document.querySelector(this.settings.formSelector+' '+this.settings.clientNodeSelector);this.elementToHide=document.querySelector(this.settings.formSelector+' '+this.settings.elementToHideSelector);this.clientCheckbox=document.querySelector(this.settings.formSelector+' '+this.settings.clientCheckboxSelector);if(!this.clientNode||!this.elementToHide||!this.clientCheckbox)return console.log('clientNode, elementToHide or clientCheckbox is missing');this.create();} 3create(){void 0===window._axcb&&(window._axcb=[]);window._axcb.push((axeptio)=>{this.checkIfAlreadyChecked();this.addPlaceholder();this.addCheckbox(axeptio);});} 4checkIfAlreadyChecked(){setTimeout(()=>{const checkbox=document.querySelector(this.settings.formSelector+' '+this.settings.cookiesConsentCheckboxClass);if(checkbox&&checkbox.classList.contains('accept')){this.clientCheckbox.click();}},1500);} 5addPlaceholder(){const axeptioSpanContact=document.createElement('span');axeptioSpanContact.id=this.settings.cookiesSpanId;this.clientNode.appendChild(axeptioSpanContact);} 6addCheckbox(axeptio){const checkboxArgs={service:this.settings.cookiesService,identifier:this.settings.cookiesIdentifier,node:document.getElementById(this.settings.cookiesSpanId),embed:{checkboxDetailsText:this.settings.cookiesCheckboxDetailsText,onChange:()=>{this.clientCheckbox.click();},}};axeptio.createConsentCheckbox(checkboxArgs);this.elementToHide.style.display="none";const checkboxLabel=document.querySelector(this.settings.formSelector+' '+this.settings.cookiesConsentDetailsTextClass);if(this.settings.cookiesFormerLabelWrapper===''){var formerLabel=document.querySelector(this.settings.formSelector+' '+this.settings.elementToHideSelector);}else{var formerLabel=document.querySelector(this.settings.formSelector+' '+this.settings.elementToHideSelector+' > '+this.settings.cookiesFormerLabelWrapper);} 7if(checkboxLabel&&formerLabel){checkboxLabel.innerHTML=formerLabel.innerHTML;} 8const checkboxInput=document.querySelector('#'+this.settings.cookiesSpanId+' > div > label > input');if(this.settings.cookiesConsentRequired&&checkboxInput){checkboxInput.setAttribute('required','required');} 9if(this.settings.cookiesConsentCheckboxAttributes){this.settings.cookiesConsentCheckboxAttributes.forEach(attribute=>{checkboxInput.setAttribute(attribute[0],attribute[1])});} 10if(this.settings.cookiesHideConsentDetailsLink){const detailsLink=document.querySelector(this.settings.formSelector+' '+this.settings.cookiesConsentDetailsLinkClass);if(detailsLink)detailsLink.remove();}}};class CookiesCheckboxCreate{constructor(settings){const defaultSettings={formSelector:'.wpcf7',clientNodeSelector:'.wpcf7-checkbox .wpcf7-list-item',cookiesSpanId:'span-axeptio',cookiesService:'processings',cookiesIdentifier:'',cookiesConsentCheckboxClass:'.AxeptioConsentCheckbox',cookiesCheckboxDetailsText:'En savoir plus',cookiesCheckboxText:'J\'accepte de recevoir la newsletter',cookiesConsentDetailsTextClass:'.AxeptioConsentDetailsText',cookiesConsentDetailsLinkClass:'.AxeptioConsentDetailsLink',cookiesConsentRequired:true,cookiesHideConsentDetailsLink:true,} 11this.settings={...defaultSettings,...settings};if(!this.settings.formSelector||!this.settings.cookiesIdentifier)return console.log('Missing formSelector or cookies manager ID');if(!document.querySelector(this.settings.formSelector))return;this.clientNode=document.querySelector(this.settings.formSelector+' '+this.settings.clientNodeSelector);if(!this.clientNode)return console.log('clientNode is missing');this.create();} 12create(){void 0===window._axcb&&(window._axcb=[]);window._axcb.push((axeptio)=>{this.addPlaceholder();this.addCheckbox(axeptio);});} 13addPlaceholder(){const axeptioSpanContact=document.createElement('span');axeptioSpanContact.id=this.settings.cookiesSpanId;this.clientNode.appendChild(axeptioSpanContact);} 14addCheckbox(axeptio){const checkboxArgs={service:this.settings.cookiesService,identifier:this.settings.cookiesIdentifier,node:document.getElementById(this.settings.cookiesSpanId),embed:{checkboxDetailsText:this.settings.cookiesCheckboxDetailsText,checkboxText:this.settings.cookiesCheckboxText}};axeptio.createConsentCheckbox(checkboxArgs);const requiredInput=document.querySelector('#'+this.settings.cookiesSpanId+' > div > label > input');if(this.settings.cookiesConsentRequired&&requiredInput){requiredInput.setAttribute('required','required');} 15if(this.settings.cookiesHideConsentDetailsLink){const detailsLink=document.querySelector(this.settings.formSelector+' '+this.settings.cookiesConsentDetailsLinkClass);if(detailsLink)detailsLink.remove();}}};window.addEventListener("load",function(){var getTokenButtons=document.querySelectorAll('.cookies_get_token');if(getTokenButtons.length){getTokenButtons.forEach(getTokenButton=>{getTokenButton?.addEventListener('click',function(event){event.preventDefault();
15if(typeof axeptioSDK!==undefined){window.alert('Token : '+axeptioSDK.settings.token);}},false);});} 16var openPopinButtons=document.querySelectorAll('.cookies_open_popin_button');if(openPopinButtons.length){openPopinButtons.forEach(openPopinButton=>{openPopinButton?.addEventListener('click',function(event){event.preventDefault();if(typeof showAxeptioButton!==undefined){showAxeptioButton();}},false);});} 17var openPopins=document.querySelectorAll('.cookies_open_popin');if(openPopins.length){openPopins.forEach(openPopin=>{openPopin?.addEventListener('click',function(event){event.preventDefault();if(typeof axeptioSDK!==undefined){axeptioSDK.openCookies();}},false);});} 18document.querySelectorAll('[data-vendor-consent]').forEach(element=>{element.addEventListener('click',function(event){event.preventDefault();const authorizeVendorElement=event.target.closest('[data-vendor-consent]');const vendor=authorizeVendorElement.getAttribute('data-vendor-consent');const reloadAfter=authorizeVendorElement.getAttribute('data-reload')||false;if(typeof axeptioSDK!==undefined&&vendor){axeptioSDK.requestConsent(vendor);if(reloadAfter){void 0===window._axcb&&(window._axcb=[]);window._axcb.push(function(axeptio){axeptio.on("cookies:complete",function(choices){if(typeof choices[vendor]!==undefined&&choices[vendor]){window.location.reload();}});});}}});});});;class CheckboxAxeptio{settings={};clientId=null;userToken=null;consentCheckboxID=null;triggerElement=null;checkboxElement=null;urlGet=null;urlPost=null;eventName='click';constructor(settings){if(!settings.checkboxElement||!settings.triggerElement||!settings.consentCheckboxID){console.error('Missing settings to instanciate axeptio',settings);return false;} 19this.settings=settings;this.init=this.init.bind(this);void 0===window._axcb&&(window._axcb=[]);window._axcb.push(this.init);} 20init(axeptio){this.checkboxElement=this.settings.checkboxElement;this.triggerElement=this.settings.triggerElement;this.consentCheckboxID=this.settings.consentCheckboxID;this.clientId=axeptio.settings.clientId;this.userToken=axeptio.settings.tokenInstance.value;if(this.settings.eventName)this.eventName=this.settings.eventName;this.urlPost="https://api.axept.io/v1/app/consents/"+this.clientId+"/consentCheckbox/"+this.consentCheckboxID;this.urlGet="https://api.axept.io/v1/app/consent/"+this.clientId+"/fr/consentCheckbox/"+this.consentCheckboxID+"?token="+this.userToken;this.setEvents();} 21setEvents(){this.uncheckConsent();this.postConsent=this.postConsent.bind(this);this.triggerElement.addEventListener(this.eventName,this.postConsent);} 22postConsent(){const data='{"accept":'+this.checkboxElement.checked+',"preferences":{"vendors":{}},"token":"'+this.userToken+'"}';const xhr=new XMLHttpRequest();xhr.open("POST",this.urlPost);xhr.setRequestHeader("Accept","application/json");xhr.setRequestHeader("Content-Type","application/json");xhr.onreadystatechange=e=>{if(xhr.readyState===4){const response=JSON.parse(xhr.responseText);this.isConsentSaved(response);}};xhr.send(data);} 23getConsent(){const xhr=new XMLHttpRequest();xhr.open("GET",this.urlGet);xhr.setRequestHeader("Accept","application/json");xhr.onreadystatechange=()=>{if(xhr.readyState===4){const response=JSON.parse(xhr.responseText);this.checkboxElement.checked=response.accept;}};xhr.send();} 24uncheckConsent(){this.checkboxElement.checked=false;} 25isConsentSaved(axeptioResponse){if(axeptioResponse.accept){this.checkboxElement.dispatchEvent(new Event('axeptio.consent.accepted'));}else{this.checkboxElement.dispatchEvent(new Event('axeptio.consent.rejected'));} 26if(!axeptioResponse.accept){this.checkboxElement.dispatchEvent(new Event('axeptio.on.consent'));}}}
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.