TP_JO2024/home/dist/analytics/analytics.module.min.js

4 lines
68 KiB
JavaScript
Raw Permalink Normal View History

2024-03-27 17:19:37 +01:00
/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
const t=window.dsfr,e="a4e35ba2a938ba9d007689dbf3f46acbb9807869",s={MANUAL:"manual",LOAD:"load",FULL:"full",HASH:"hash"},i="_EA_",n=`${i}disabled`,r=`${i}toggle`;const a=new class{constructor(){this._configure()}_configure(){const t=this;window[n]=()=>t.isDisabled,window[r]=this.toggle.bind(this)}get isDisabled(){return localStorage.getItem(i)}toggle(){this.isDisabled?this.enable():this.disable()}enable(){localStorage.getItem(i)&&localStorage.removeItem(i)}disable(){localStorage.setItem(i,"1")}},o="EA_push";class l{constructor(t){this._domain=t,this._isLoaded=!1,this._promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}get id(){return this._id}get store(){return this._store}configure(){return this.init(),this._promise}init(){let e=5381;for(let t=this._domain.length-1;t>0;t--)e=33*e^this._domain.charCodeAt(t);e>>>=0,this._id=`_EA_${e}`,this._store=[],this._store.eah=this._domain,window[this._id]=this._store,window[o]||(window[o]=(...t)=>this.store.push(t)),a.isDisabled?(t.inspector.warn("User opted out, eulerian is disabled"),this._reject("User opted out, eulerian is disabled")):this.load()}load(){const t=new Date/1e7|0,e=t%26,s=String.fromCharCode(97+e,122-e,65+e)+t%1e3;this._script=document.createElement("script"),this._script.ea=this.id,this._script.async=!0,this._script.addEventListener("load",this.loaded.bind(this)),this._script.addEventListener("error",this.error.bind(this)),this._script.src=`//${this._domain}/${s}.js?2`;const i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(this._script,i)}error(){t.inspector.error("unable to load Eulerian script file. the domain declared in your configuration must match the domain provided by the Eulerian interface (tag creation)"),this._reject("eulerian script loading error")}loaded(){this._isLoaded||(this._isLoaded=!0,this._resolve())}}const c=-1,h=0,u=1,g=2,d=3;class _{constructor(t){this._config=t,this._state=c,this._promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}configure(){if(this._state>=u)return this._promise;this._state===c&&(t.inspector.info("analytics configures tarteaucitron"),this._state=h);const e=window.tarteaucitron;if(!e||!e.services)return void window.requestAnimationFrame(this.configure.bind(this));this._state=u;const s={key:"eulerian",type:"analytic",name:"Eulerian Analytics",needConsent:!0,cookies:["etuix"],uri:"https://eulerian.com/vie-privee",js:this.init.bind(this),fallback:()=>{e.services.eulerian.js()}};return e.services.eulerian=s,e.job||(e.job=[]),e.job.push("eulerian"),this._promise}init(){if(this._state>=g)return;this._state=g,window.__eaGenericCmpApi=this.integrate.bind(this);const t=this.update.bind(this);window.addEventListener("tac.close_alert",t),window.addEventListener("tac.close_panel",t)}integrate(e){this._state>=d||(this._state=d,this._cmpApi=e,t.inspector.info("analytics has integrated tarteaucitron"),this._resolve(),this.update())}update(){this._state<d||this._cmpApi("tac",window.tarteaucitron,1)}}class p{constructor(t){if(this._config=t,t&&"tarteaucitron"===t.id)this.integrateTarteAuCitron()}integrateTarteAuCitron(){return this._tac=new _(this._config),this._tac.configure()}optin(){}}const m=(e,s)=>{"function"==typeof window.EA_push?(t.inspector.info("analytics",e,s),window.EA_push(e,s)):t.inspector.warn("Analytics datalayer not sent, Eulerian API isn't yet avalaible")},b={COLLECTOR:"collector",ACTION:"action",ACTION_PARAMETER:"actionparam"};const f=new class{constructor(){this._renderables=[],this._rendering=this.render.bind(this),requestAnimationFrame(this._rendering)}add(t){-1===this._renderables.indexOf(t)&&this._renderables.push(t)}remove(t){const e=this._renderables.indexOf(t);e>-1&&this._renderables.splice(e,1)}render(){this._renderables.forEach((t=>t.render())),requestAnimationFrame(this._rendering)}};class y{constructor(t,e){this._action=t,this._data=e}test(t){return this._action===t}start(){return this._action.start(this._data)}end(){return this._action.end(this._data)}}const v=new class{constructor(){this._startingActions=[],this._endingActions=[],this._handlingVisibilityChange=t
//# sourceMappingURL=analytics.module.min.js.map