PageSourceSearch

https://www.mairie-saint-quentin-sur-nohain.fr/tarteaucitron/tarteaucitron.js

js mairie-saint-quentin-sur-nohain.fr collected 2026-10-03 02:46:50 UTC 125,803 bytes, 2,368 lines download raw bytes

1/*jslint browser: true, evil: true */
2/* min ready */
3
4var scripts = document.getElementsByTagName('script'),
5    tarteaucitronPath = (document.currentScript || scripts[scripts.length - 1]).src.split('?')[0],
6    tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
7    tarteaucitronUseMin = (tarteaucitronUseMin === undefined) ? '' : tarteaucitronUseMin,
8    cdn = (tarteaucitronForceCDN === '') ? tarteaucitronPath.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
9    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
10    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
11    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
12    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
13    // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
14    tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay,
15    timeExpire = 31536000000,
16    tarteaucitronProLoadServices,
17    tarteaucitronNoAdBlocker = false,
18    tarteaucitronIsLoaded = false;
19
20
21
22var tarteaucitron = {
23    "version": 1.19,
24    "cdn": cdn,
25    "user": {},
26    "lang": {},
27    "services": {},
28    "added": [],
29    "idprocessed": [],
30    "state": {},
31    "launch": [],
32    "parameters": {},
33    "isAjax": false,
34    "reloadThePage": false,
35    "events": {
36        "init": function () {},
37        "load": function () {},
38    },
39    "init": function (params) {
40        "use strict";
41        var origOpen;
42
43        tarteaucitron.parameters = params;
44        if (alreadyLaunch === 0) {
45            alreadyLaunch = 1;
46            if (window.addEventListener) {
47                window.addEventListener("load", function () {
48                    tarteaucitron.initEvents.loadEvent(false);
49                }, false);
50                window.addEventListener("scroll", function () {
51                    tarteaucitron.initEvents.scrollEvent();
52                }, false);
53
54                window.addEventListener("keydown", function (evt) {
55                    tarteaucitron.initEvents.keydownEvent(false, evt);
56                }, false);
57                window.addEventListener("hashchange", function () {
58                    tarteaucitron.initEvents.hashchangeEvent();
59                }, false);
60                window.addEventListener("resize", function () {
61                    tarteaucitron.initEvents.resizeEvent();
62                }, false);
63            } else {
64                window.attachEvent("onload", function () {
65                    tarteaucitron.initEvents.loadEvent(true);
66                });
vendor: 5,793 bytes, lines 66-203
66
67                window.attachEvent("onscroll", function () {
68                    tarteaucitron.initEvents.scrollEvent();
69                });
70                window.attachEvent("onkeydown", function (evt) {
71                    tarteaucitron.initEvents.keydownEvent(true, evt);
72
73                });
74                window.attachEvent("onhashchange", function () {
75                    tarteaucitron.initEvents.hashchangeEvent();
76                });
77                window.attachEvent("onresize", function () {
78                    tarteaucitron.initEvents.resizeEvent();
79                });
80            }
81
82            if (typeof XMLHttpRequest !== 'undefined') {
83                origOpen = XMLHttpRequest.prototype.open;
84                XMLHttpRequest.prototype.open = function () {
85
86                    if (window.addEventListener) {
87                        this.addEventListener("load", function () {
88                            if (typeof tarteaucitronProLoadServices === 'function') {
89                                tarteaucitronProLoadServices();
90                            }
91                        }, false);
92                    } else if (typeof this.attachEvent !== 'undefined') {
93                        this.attachEvent("onload", function () {
94                            if (typeof tarteaucitronProLoadServices === 'function') {
95                                tarteaucitronProLoadServices();
96                            }
97                        });
98                    } else {
99                        if (typeof tarteaucitronProLoadServices === 'function') {
100                            setTimeout(tarteaucitronProLoadServices, 1000);
101                        }
102                    }
103
104                    try {
105                        origOpen.apply(this, arguments);
106                    } catch (err) {}
107                };
108            }
109        }
110
111        if(tarteaucitron.events.init) {
112            tarteaucitron.events.init();
113        }
114    },
115    "initEvents": {
116        "loadEvent": function (isOldBrowser) {
117            tarteaucitron.load();
118            tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
119                if (isOldBrowser) {
120                    elem.attachEvent("onclick", function (event) {
121                        tarteaucitron.userInterface.openPanel();
122                        event.preventDefault();
123                    });
124                } else {
125                    elem.addEventListener("click", function (event) {
126                        tarteaucitron.userInterface.openPanel();
127                        event.preventDefault();
128                    }, false);
129                }
130            }, true);
131        },
132        "keydownEvent": function (isOldBrowser, evt) {
133            if (evt.keyCode === 27) {
134                tarteaucitron.userInterface.closePanel();
135            }
136
137            if (isOldBrowser) {
138                if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
139                    if ( evt.shiftKey ) /* shift + tab */ {
140                        if (document.activeElement === firstFocusableEl) {
141                            lastFocusableEl.focus();
142                            evt.preventDefault();
143                        }
144                    } else /* tab */ {
145                        if (document.activeElement === lastFocusableEl) {
146                            firstFocusableEl.focus();
147                            evt.preventDefault();
148                        }
149                    }
150                }
151            }
152        },
153        "hashchangeEvent": function () {
154            if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
155                tarteaucitron.userInterface.openPanel();
156            }
157        },
158        "resizeEvent": function () {
159            var tacElem = document.getElementById('tarteaucitron');
160            var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer');
161
162            if (tacElem && tacElem.style.display === 'block') {
163                tarteaucitron.userInterface.jsSizing('main');
164            }
165
166            if (tacCookieContainer && tacCookieContainer.style.display === 'block') {
167                tarteaucitron.userInterface.jsSizing('cookie');
168            }
169        },
170        "scrollEvent": function () {
171            var scrollPos = window.pageYOffset || document.documentElement.scrollTop;
172            var heightPosition;
173            var tacPercentage = document.getElementById('tarteaucitronPercentage');
174            var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
175
176            if (tacAlertBig && !tarteaucitron.highPrivacy) {
177                if (tacAlertBig.style.display === 'block') {
178                    heightPosition = tacAlertBig.offsetHeight + 'px';
179
180                    if (scrollPos > (screen.height * 2)) {
181                        tarteaucitron.userInterface.respondAll(true);
182                    } else if (scrollPos > (screen.height / 2)) {
183                        document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
184                    }
185
186                    if (tacPercentage) {
187                        if (tarteaucitron.orientation === 'top') {
188                            tacPercentage.style.top = heightPosition;
189                        } else {
190                            tacPercentage.style.bottom = heightPosition;
191                        }
192                        tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
193                    }
194                }
195            }
196        },
197    },
198    "load": function () {
199        "use strict";
200
201        if (tarteaucitronIsLoaded === true) {
202            return;
203        }
vendor: 10,025 bytes, lines 204-422
204        var cdn = tarteaucitron.cdn,
205            language = tarteaucitron.getLanguage(),
206            useMinifiedJS = ((cdn.indexOf('cdn.jsdelivr.net') >= 0) || (tarteaucitronPath.indexOf('.min.') >= 0) || (tarteaucitronUseMin !== '')),
207            pathToLang = cdn + 'lang/tarteaucitron.' + language + (useMinifiedJS ? '.min' : '') + '.js',
208            pathToServices = cdn + 'tarteaucitron.services' + (useMinifiedJS ? '.min' : '') + '.js',
209            linkElement = document.createElement('link'),
210            defaults = {
211                "adblocker": false,
212                "hashtag": '#tarteaucitron',
213                "cookieName": 'tarteaucitron',
214                "highPrivacy": true,
215                "orientation": "middle",
216                "bodyPosition": "bottom",
217                "removeCredit": false,
218                "showAlertSmall": false,
219                "showDetailsOnClick": true,
220                "showIcon": true,
221                "iconPosition": "BottomRight",
222                "cookieslist": false,
223                "handleBrowserDNTRequest": false,
224                "DenyAllCta": true,
225                "AcceptAllCta" : true,
226                "moreInfoLink": true,
227                "privacyUrl": "",
228                "useExternalCss": false,
229                "useExternalJs": false,
230                "mandatory": true,
231                "mandatoryCta": true,
232                "closePopup": false,
233                "groupServices": false,
234                "serviceDefaultState": 'wait',
235                "googleConsentMode": true,
236                "partnersList": false,
237                "alwaysNeedConsent": false
238            },
239            params = tarteaucitron.parameters;
240
241        // flag the tac load
242        tarteaucitronIsLoaded = true;
243
244        // Don't show the middle bar if we are on the privacy policy or more page
245        if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") {
246            tarteaucitron.parameters.orientation = "bottom";
247        }
248
249        // Step -1
250        if (typeof tarteaucitronCustomPremium !== 'undefined') {
251            tarteaucitronCustomPremium();
252        }
253
254        // Step 0: get params
255        if (params !== undefined) {
256
257            for (var k in defaults) {
258                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
259                    tarteaucitron.parameters[k] = defaults[k];
260                }
261            }
262        }
263
264        // global
265        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
266        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
267        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
268        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;
269        tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId;
270
271        // google consent mode
272        if (tarteaucitron.parameters.googleConsentMode === true) {
273
274            // set the dataLayer and a function to update
275            window.dataLayer = window.dataLayer || [];
276            window.tac_gtag = function tac_gtag() {
277                dataLayer.push(arguments);
278            };
279
280            // default consent to denied
281            window.tac_gtag('consent', 'default', {
282                ad_storage: 'denied',
283                analytics_storage: 'denied',
284                ad_user_data: 'denied',
285                ad_personalization: 'denied',
286                wait_for_update: 800
287            });
288
289            // if google ads, add a service for personalized ads
290            document.addEventListener('googleads_added', function() {
291
292                // skip if already added
293                if (tarteaucitron.added["gcmads"] === true) {
294                    return;
295                }
296
297                // simple service to control gcm with event
298                tarteaucitron.services.gcmads = {
299                    "key": "gcmads",
300                    "type": "ads",
301                    "name": "Google Ads (personalized ads)",
302                    "uri": "https://support.google.com/analytics/answer/9976101",
303                    "needConsent": true,
304                    "cookies": [],
305                    "js": function() {},
306                    "fallback": function() {}
307                };
308                tarteaucitron.job.push('gcmads');
309
310                // fix the event handler on the buttons
311                var i,
312                    allowBtns = document.getElementsByClassName("tarteaucitronAllow"),
313                    denyBtns = document.getElementsByClassName("tarteaucitronDeny");
314                for (i = 0; i < allowBtns.length; i++) {
315                    tarteaucitron.addClickEventToElement(allowBtns[i], function() {
316                        tarteaucitron.userInterface.respond(this, true);
317                    });
318                }
319                for (i = 0; i < denyBtns.length; i++) {
320                    tarteaucitron.addClickEventToElement(denyBtns[i], function() {
321                        tarteaucitron.userInterface.respond(this, false);
322                    });
323                }
324            });
325
326            // when personalized ads are accepted, accept googleads
327            document.addEventListener('gcmads_allowed', function() {
328                tarteaucitron.setConsent('googleads', true);
329            });
330
331            // personalized ads loaded/allowed, set gcm to granted
332            document.addEventListener('gcmads_loaded', function() {
333                window.tac_gtag('consent', 'update', {
334                    ad_user_data: 'granted',
335                    ad_personalization: 'granted'
336                });
337            });
338            document.addEventListener('gcmads_allowed', function() {
339                window.tac_gtag('consent', 'update', {
340                    ad_user_data: 'granted',
341                    ad_personalization: 'granted'
342                });
343            });
344
345            // personalized ads disallowed, set gcm to denied
346            document.addEventListener('gcmads_disallowed', function() {
347                window.tac_gtag('consent', 'update', {
348                    ad_user_data: 'denied',
349                    ad_personalization: 'denied'
350                });
351            });
352
353            // google ads loaded/allowed, set gcm to granted
354            document.addEventListener('googleads_loaded', function() {
355                window.tac_gtag('consent', 'update', {
356                    ad_storage: 'granted'
357                });
358            });
359            document.addEventListener('googleads_allowed', function() {
360                window.tac_gtag('consent', 'update', {
361                    ad_storage: 'granted'
362                });
363            });
364
365            // google ads disallowed, disable personalized ads and update gcm
366            document.addEventListener('googleads_disallowed', function() {
367                tarteaucitron.setConsent('gcmads', false);
368                window.tac_gtag('consent', 'update', {
369                    ad_storage: 'denied'
370                });
371            });
372
373            // ga4 loaded/allowed, set gcm to granted
374            document.addEventListener('gtag_loaded', function() {
375                window.tac_gtag('consent', 'update', {
376                    analytics_storage: 'granted'
377                });
378            });
379            document.addEventListener('gtag_allowed', function() {
380                window.tac_gtag('consent', 'update', {
381                    analytics_storage: 'granted'
382                });
383            });
384
385            // ga4 disallowed, update gcm
386            document.addEventListener('gtag_disallowed', function() {
387                window.tac_gtag('consent', 'update', {
388                    analytics_storage: 'denied'
389                });
390            });
391
392            // allow gtag/googleads by default if consent mode is on
393            window.addEventListener('tac.root_available', function() {
394                if (typeof tarteaucitron_block !== 'undefined') {
395                    tarteaucitron_block.unblock(/www\.googletagmanager\.com\/gtag\/js/);
396                    tarteaucitron_block.unblock(/www\.googleadservices\.com\/pagead\/conversion/);
397                    tarteaucitron_block.unblock(/AW-/);
398                    tarteaucitron_block.unblock(/google-analytics\.com\/analytics\.js/);
399                    tarteaucitron_block.unblock(/google-analytics\.com\/ga\.js/);
400                }
401            });
402        }
403
404        // Step 1: load css
405        if ( !tarteaucitron.parameters.useExternalCss ) {
406            linkElement.rel = 'stylesheet';
407            linkElement.type = 'text/css';
408            linkElement.href = cdn + 'css/tarteaucitron' + (useMinifiedJS ? '.min' : '') + '.css';
409            document.getElementsByTagName('head')[0].appendChild(linkElement);
410        }
411        // Step 2: load language and services
412        tarteaucitron.addInternalScript(pathToLang, '', function () {
413
414          if(tarteaucitronCustomText !== ''){
415            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
416          }
417            tarteaucitron.addInternalScript(pathToServices, '', function () {
418
419                // css for the middle bar TODO: add it on the css file
420                if (tarteaucitron.orientation === 'middle') {
421                    var customThemeMiddle = document.createElement('style'),
422                        cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}
422span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}';
423
424                    customThemeMiddle.type = 'text/css';
425                    if (customThemeMiddle.styleSheet) {
426                        customThemeMiddle.styleSheet.cssText = cssRuleMiddle;
427                    } else {
428                        customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle));
429                    }
430                    document.getElementsByTagName('head')[0].appendChild(customThemeMiddle);
431                }
432
433                // disable the expand option if services grouped by category
434                if (tarteaucitron.parameters.groupServices == true) {
435                    tarteaucitron.parameters.showDetailsOnClick = true;
436                }
437
438                // css for the popup bar TODO: add it on the css file
439                if (tarteaucitron.orientation === 'popup') {
440                    var customThemePopup = document.createElement('style'),
441                        cssRulePopup = 'div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 22px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {bottom: 0;top: auto!important;left: 8px!important;right: auto!important;transform: initial!important;border-radius: 5px 5px 0 0!important;max-width: 250px!important;width: calc(100% - 16px)!important;min-width: 0!important;padding: 25px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;font-size: 15px!important;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;width: calc(100% - 60px);box-sizing: border-box;}';
442
443                    customThemePopup.type = 'text/css';
444                    if (customThemePopup.styleSheet) {
445                        customThemePopup.styleSheet.cssText = cssRulePopup;
446                    } else {
447                        customThemePopup.appendChild(document.createTextNode(cssRulePopup));
448                    }
449                    document.getElementsByTagName('head')[0].appendChild(customThemePopup);
450                }
451
452                var body = document.body,
453                    div = document.createElement('div'),
454                    html = '',
455                    index,
456                    orientation = 'Top',
457                    modalAttrs = '',
458                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other', 'google'],
459                    i;
460
461                cat = cat.sort(function (a, b) {
462                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
463                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
464                    return 0;
465                });
466
467                // Step 3: prepare the html
468                html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
469                html += '<div id="tarteaucitronPremium"></div>';
470                if (tarteaucitron.reloadThePage) {
471                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')"></button>';
472                } else {
473                    html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '"></button>';
474                }
475                html += '<div id="tarteaucitron" role="dialog" aria-modal="true" aria-labelledby="dialogTitle" tabindex="-1">';
476                if (tarteaucitron.reloadThePage) {
477                    html += '   <button type="button" id="tarteaucitronClosePanel" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
478                } else {
479                    html += '   <button type="button" id="tarteaucitronClosePanel" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '">';
480                }
481                html += '       ' + tarteaucitron.lang.close;
482                html += '   </button>';
483                html += '   <div id="tarteaucitronServices">';
484                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
vendor: 13,400 bytes, lines 485-645
485                html += '         <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
486                html += '         <div id="tarteaucitronInfo">';
487                html += '         <p>';
488                html += '         ' + tarteaucitron.lang.disclaimer;
489                html += '         </p>';
490                if (tarteaucitron.parameters.privacyUrl !== "") {
491                    html += '   <br/><br/>';
492                    html += '   <button type="button" id="tarteaucitronPrivacyUrlDialog" role="link">';
493                    html += '       ' + tarteaucitron.lang.privacyUrl;
494                    html += '   </button>';
495                }
496                html += '         </div>';
497                html += '         <div class="tarteaucitronName">';
498                html += '            <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>';
499                html += '         </div>';
500                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
501                html += '            <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow" aria-label="' + tarteaucitron.lang.allowAll + '">';
502                html += '               <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allowAll;
503                html += '            </button> ';
504                html += '            <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny" aria-label="' + tarteaucitron.lang.denyAll + '">';
505                html += '               <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
506                html += '            </button>';
507                html += '         </div>';
508                html += '      </div>';
509                html += '      <div class="tarteaucitronBorder">';
510                html += '         <div class="clear"></div><ul>';
511
512
513                if (tarteaucitron.parameters.mandatory == true) {
514                   html += '<li id="tarteaucitronServicesTitle_mandatory">';
515                   html += '<div class="tarteaucitronTitle">';
516                    if(tarteaucitron.parameters.showDetailsOnClick){
517                        html += '   <button type="button" tabindex="-1"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang.mandatoryTitle + '</button>';
518                    }else{
519                        html += '   <span class="asCatToggleBtn">' + tarteaucitron.lang.mandatoryTitle + '</span>';
520                    }
521                   html += '</div>';
522                   html += '<ul id="tarteaucitronServices_mandatory">';
523                   html += '<li class="tarteaucitronLine">';
524                   html += '   <div class="tarteaucitronName">';
525                   html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>';
526                   html += '       <span class="tarteaucitronListCookies" aria-hidden="true"></span><br/>';
527                   html += '   </div>';
528                   if (tarteaucitron.parameters.mandatoryCta == true) {
529                       html += '   <div class="tarteaucitronAsk">';
530                       html += '       <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>';
531                       html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
532                       html += '       </button> ';
533                       html += '       <button type="button" class="tarteaucitronDeny" tabindex="-1">';
534                       html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
535                       html += '       </button> ';
536                       html += '   </div>';
537                   }
538                   html += '</li>';
539                   html += '</ul></li>';
540                }
541
542                for (i = 0; i < cat.length; i += 1) {
543                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
544                    html += '            <div class="tarteaucitronTitle" role="heading" aria-level="2">';
545                    if(tarteaucitron.parameters.showDetailsOnClick)
546                    {
547                        html += '               <button type="button" class="catToggleBtn" aria-expanded="false" data-cat="tarteaucitronDetails' + cat[i] + '" aria-label="' + 'Plus d\'informations sur' + tarteaucitron.lang[cat[i]].title +'"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang[cat[i]].title + '</button>';
548                    }else{
549                        html += '               <span class="asCatToggleBtn" data-cat="tarteaucitronInlineDetails' + cat[i] + '">' + tarteaucitron.lang[cat[i]].title + '</span>';
550                    }
551                    html += '            </div>';
552                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails '+ (tarteaucitron.parameters.showDetailsOnClick ? 'tarteaucitronInfoBox' : 'tarteaucitronDetailsInline')+'">';
553                    html += '               <p>';
554                    html += '               ' + tarteaucitron.lang[cat[i]].details;
555                    html += '               </p>';
556                    html += '            </div>';
557                    html += '         <div id="tarteaucitronServices_' + cat[i] + '"></div></li>';
558                }
559                html += '             <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>';
560                html += '         </ul>';
561                html += '         <div class="tarteaucitronHidden tarteaucitron-spacer-20" id="tarteaucitronScrollbarChild"></div>';
562                if (tarteaucitron.parameters.removeCredit === false) {
563                    html += '     <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAAeCAYAAAAWwoEYAAADl0lEQVRoge1Y0W3bQAx9CjKARlC+9GVUmqDJBHEmiDyB6wkcTxBngtgTxJ0gzgQW4C/9aYOmE6g4lTQo+k6y3Rb94QOERNQd+cjj8XiGwWAwGAwGg8FgMBgMBoPB8F8RNRXe+whEKe7c36ZCAeCRxC9Rig2PUd8kPgAsoxSfQ3YAzAA8D/HwYYCb05kBKKO0teFkmbC1jlKsAnq/Abjn+QBqAIsoRS30ttwG/HNz1wH/XIxWTicLdvtW7xTAGEAMtP685CNsBTe2d/BLydfXAG57SEnMAST0zgYZSUCPk02bCvkJduIzuJzDLfPolbY+tLKmar+/8+IRePy4qdpE03qHuH8fipFb4N2+XdA3AJ/0vaQxt7s9FvkIS2XvtqnwM0rxpOQfbnE5G2LhTCmUO2fHIngOmcv+KG3HafDchB6ntwjYqenR2PqC7sOZ3E7FXHB0vqxoFyUyLh7OEH7LOGouvhhN3eIBeKXv0n5MsufdHqXcwYR5U2EbpV35lSspVPJmQj4TcgRK7jTg5IzmPUhhwM5a2WHUFCx+NgiDucmgh7idikLovHFlL0pxQ9xzX+IIP9Y6FrJsqhjlQpZRAkFVDCjZfcCHt6bqJDmuh5ylCWx0RVnk3oumaknqTH5sqrY0fBWyULaHUIgAgxb46MxV3DbieAhxOxUxjSuljig9lMQ/Bcfoi9BTEv9aLORSndVxYOH525sUDC6u2gWxcNzBNRxPanyh3ktKinOgy3WoxPbtUM0t6RkbQnzBnFPgi9GCOEubY9UffIryz9iKRe8s/FUfEWosJJGxagp85bpUO3VywQ46lOtAWfNxKwa4JXQ+628+bpxYGXXMzp5rXH401VEyXwIdowXFaKWSMFHvMTVmGnc+P3oXV2QOiBCfgex8QtcQCbcQE/H+eoHzrkFo1KM7zVO4jVVj5s6lRiWF7zyXyfRMc97J3tzj87mYqZ7E2YjzUct9GUi4tjHLR8dVkBLjQcuHFleWvQfRNEhFR7uX7pkctOwvZXsft7sAtyldEUIN2UTeLxnEfxKYswzdi88BdbZ8hifUoSMftQvP+muRwN6+Q3DeqqRExP9QmTtcheiHh0Ot1x2i2km1bP9pbufw5zZdyWsOrh7vQae5OZWbsMv30pi7cd/CKj3coPEVaCP4Zhx4eQWhOZ1Y9MTXGyP8/iGjEyfa1T4fO/4Lea9vBoPBYDAYDAaDwWAwGAwGwz8GgF8siXCCbrSRhgAAAABJRU5ErkJggg==" alt="tarteaucitron.io" /></a>';
564                }
565                html += '       </div>';
566                html += '   </div>';
567                html += '</div>';
568
569                if (tarteaucitron.parameters.orientation === 'bottom') {
570                    orientation = 'Bottom';
571                }
572
573                if (tarteaucitron.parameters.orientation === 'middle' || tarteaucitron.parameters.orientation === 'popup') {
574                    modalAttrs = ' role="dialog" aria-modal="true" aria-label="' + tarteaucitron.lang.title + '"';
575                }
576
577                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
578                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
579                    //html += '<div class="tarteaucitronAlertBigWrapper">';
580                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
581                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
582                    html += '   </span>';
583                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
584                    html += '   <button type="button" id="tarteaucitronPersonalize" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
585                    html += '       ' + tarteaucitron.lang.personalize;
586                    html += '   </button>';
587
588                    if (tarteaucitron.parameters.privacyUrl !== "") {
589                        html += '   <button role="link" type="button" id="tarteaucitronPrivacyUrl">';
590                        html += '       ' + tarteaucitron.lang.privacyUrl;
591                        html += '   </button>';
592                    }
593
594                    //html += '   </span>';
595                    //html += '</div>';
596                    html += '</div>';
597                } else {
598                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>';
599                    //html += '<div class="tarteaucitronAlertBigWrapper">';
600                    html += '   <span id="tarteaucitronDisclaimerAlert" role="paragraph">';
601
602                    if (tarteaucitron.parameters.highPrivacy) {
603                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
604                    } else {
605                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
606                    }
607
608                    html += '   </span>';
609                    //html += '   <span class="tarteaucitronAlertBigBtnWrapper">';
610                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">';
611                    html += '       <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.acceptAll;
612                    html += '   </button>';
613
614
615                    if (tarteaucitron.parameters.DenyAllCta) {
616                        if (tarteaucitron.reloadThePage) {
617                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-label="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">';
618                        } else {
619                                    html += '   <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">';
620                        }
621                                    html += '       <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll;
622                                    html += '   </button>';
623                                    //html += '   <br/><br/>';
624                    }
625
626                    html += '   <button type="button" id="tarteaucitronCloseAlert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">';
627                    html += '       ' + tarteaucitron.lang.personalize;
628                    html += '   </button>';
629
630                    if (tarteaucitron.parameters.privacyUrl !== "") {
631                        html += '   <button type="button" id="tarteaucitronPrivacyUrl" role="link">';
632                        html += '       ' + tarteaucitron.lang.privacyUrl;
633                        html += '   </button>';
634                    }
635
636                    //html += '   </span>';
637                    //html += '</div>';
638                    html += '</div>';
639                    html += '<div id="tarteaucitronPercentage"></div>';
640                }
641
642                if (tarteaucitron.parameters.showIcon === true) {
643                    html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">';
644                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
645                    html += '       <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4ku
645NIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yjqvyJF/ppptqVlt+MCLCEh/oOkPPP6N38Mb5cnQBGFsEqmXg5j3QMwoMzwGnr4HYbybBq13gZAOom/FO63zdf2qQArCsZrUN2TlJy69eSDKYV+6Q4MpP75ivHzPA53ngaBW4eGuSOt0A/lsGPmXMz0+3TFJcTfFbPfFbfnwlhON+iQhlWmA82CQ4ocQ7c6KcfL3DHuls0yT6Sx4YnLXJDCQOIRRv5yGIJBgP8Sdisj2qubpc5UGJmo+W49ifVmzL8HcpGhQPvZCUKiCliIhEN0tr2OCqHuSA8gwQ/92MkU7gxEmeVqGrTTgpxPXbUrtGWYus0I9thRIraagRQUIDf7Qn4yZhKRiFQIyhfMfUr3yblokVWSJ6k8xSnc7eNN/RjowfCYiFoDUFer1S3gW6JiJ8Nt30EMbEhU+vzSIztuRYjRLsR8IHLjlf7HZ+MrWWEXxNmbvapt4jGSqZRYSkGUetSNTPzHsui5YMQ2ajJUNks6mw4wT54Ok2ShnzzIPCUGshzawCRKy5FqvrTZe0RWzQGvw79m67XZjKmxJrLsICjtZa55gxXy+6F4sYsEtxTqhXdRTLC8ulSDaWoCLsolfN+8YUhOsJV709H7Cudr0LlVEtzqBcN+shEyThdR941OnAbF8pirKJqXyupTRTtQSReiVmXW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC') + '" alt="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">';
646                    html += '   </button>';
647                    html += '</div>';
648                }
649
650                if (tarteaucitron.parameters.showAlertSmall === true) {
651                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
652                    html += '   <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '">';
653                    html += '       ' + tarteaucitron.lang.alertSmall;
654                    html += '       <span id="tarteaucitronDot">';
655                    html += '           <span id="tarteaucitronDotGreen"></span>';
656                    html += '           <span id="tarteaucitronDotYellow"></span>';
657                    html += '           <span id="tarteaucitronDotRed"></span>';
658                    html += '       </span>';
659                    if (tarteaucitron.parameters.cookieslist === true) {
660                        html += '   </button><!-- @whitespace';
661                        html += '   --><button type="button" id="tarteaucitronCookiesNumber" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">0</button>';
662                        html += '   <div id="tarteaucitronCookiesListContainer">';
663                        html += '       <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '">';
664                        if (tarteaucitron.reloadThePage) {
665                            html += '       <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">';
666                        } else {
667                            html += '       <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '">';
668                        }
669                        html += '           ' + tarteaucitron.lang.close;
670                        html += '       </button>';
671                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
vendor: 8,882 bytes, lines 672-829
672                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
673                        html += '       </div>';
674                        html += '       <div id="tarteaucitronCookiesList"></div>';
675                        html += '    </div>';
676                    } else {
677                        html += '   </div>';
678                    }
679                    html += '</div>';
680                }
681
682                tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising' + (useMinifiedJS ? '.min' : '') + '.js', '', function () {
683                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {
684
685                        // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
686                        /*var wrapper = document.createElement('div');
687                        wrapper.id = "tarteaucitronContentWrapper";
688
689                        while (document.body.firstChild)
690                        {
691                            wrapper.appendChild(document.body.firstChild);
692                        }
693
694                        // Append the wrapper to the body
695                        document.body.appendChild(wrapper);*/
696
697                        div.id = 'tarteaucitronRoot';
698                        if (tarteaucitron.parameters.bodyPosition === 'top') {
699                            // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
700                            var bodyFirstChild = body.firstChild;
701                            body.insertBefore(div, bodyFirstChild);
702                        }
703                        else {
704                            // Append tarteaucitron: #tarteaucitronRoot last-child of the body
705                            body.appendChild(div, body);
706                        }
707
708                        div.setAttribute('data-nosnippet', 'true');
709                        div.setAttribute('lang', language);
710                        div.setAttribute('role', 'region');
711                        div.setAttribute('aria-labelledby', 'tac_title');
712
713                        div.innerHTML = html;
714
715                        //ie compatibility
716                        var tacRootAvailableEvent;
717                        if(typeof(Event) === 'function') {
718                            tacRootAvailableEvent = new Event("tac.root_available");
719                        }else if (typeof(document.createEvent) === 'function'){
720                            tacRootAvailableEvent = document.createEvent('Event');
721                            tacRootAvailableEvent.initEvent("tac.root_available", true, true);
722                        }
723                        //end ie compatibility
724
725                        if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacRootAvailableEvent);}
726
727                        if (tarteaucitron.job !== undefined) {
728                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
729                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
730                                tarteaucitron.addService(tarteaucitron.job[index]);
731                            }
732                        } else {
733                            tarteaucitron.job = [];
734                        }
735
736                        if (tarteaucitron.job.length === 0) {
737                            tarteaucitron.userInterface.closeAlert();
738                        }
739
740                        tarteaucitron.isAjax = true;
741
742                        tarteaucitron.job.push = function (id) {
743
744                            // ie <9 hack
745                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
746                                tarteaucitron.job.indexOf = function (obj, start) {
747                                    var i,
748                                        j = this.length;
749                                    for (i = (start || 0); i < j; i += 1) {
750                                        if (this[i] === obj) { return i; }
751                                    }
752                                    return -1;
753                                };
754                            }
755
756                            if (tarteaucitron.job.indexOf(id) === -1) {
757                                Array.prototype.push.call(this, id);
758                            }
759                            tarteaucitron.launch[id] = false;
760                            tarteaucitron.addService(id);
761                        };
762
763                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
764                            tarteaucitron.userInterface.openPanel();
765                        }
766
767                        tarteaucitron.cookie.number();
768                        setInterval(tarteaucitron.cookie.number, 60000);
769                    }
770                }, tarteaucitron.parameters.adblocker);
771
772                if (tarteaucitron.parameters.adblocker === true) {
773                    setTimeout(function () {
774                        if (tarteaucitronNoAdBlocker === false) {
775                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' tarteaucitron-display-block" role="alert" aria-live="polite">';
776                            html += '   <p id="tarteaucitronDisclaimerAlert">';
777                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
778                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
779                            html += '   </p>';
780                            html += '   <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">';
781                            html += '       ' + tarteaucitron.lang.reload;
782                            html += '   </button>';
783                            html += '</div>';
784                            html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>';
785                            html += '<div id="tarteaucitronPremium"></div>';
786
787                            div.id = 'tarteaucitronRoot';
788                            if (tarteaucitron.parameters.bodyPosition === 'top') {
789                                // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
790                                var bodyFirstChild = body.firstChild;
791                                body.insertBefore(div, bodyFirstChild);
792                            }
793                            else {
794                                // Append tarteaucitron: #tarteaucitronRoot last-child of the body
795                                body.appendChild(div, body);
796                            }
797
798                            div.setAttribute('data-nosnippet', 'true');
799                            div.setAttribute('lang', language);
800                            div.setAttribute('role', 'region');
801                            div.setAttribute('aria-labelledby', 'tac_title');
802
803                            div.innerHTML = html;
804                        }
805                    }, 1500);
806                }
807                if(tarteaucitron.parameters.closePopup === true){
808                    setTimeout(function() {
809                        var closeElement = document.getElementById('tarteaucitronAlertBig'),
810                            closeButton = document.createElement('button');
811                        if (closeElement) {
812                            closeButton.innerHTML = '<span aria-hidden="true">X</span><span class="tac_visually-hidden">' + tarteaucitron.lang.closeBanner + '</span>';
813                            closeButton.setAttribute('id', 'tarteaucitronCloseCross');
814                            closeElement.insertAdjacentElement('beforeend', closeButton);
815                        }
816                    }, 100);
817                }
818
819                if(tarteaucitron.parameters.groupServices === true) {
820                    var tac_group_style = document.createElement('style');
821                    tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}';
822                    document.head.appendChild(tac_group_style);
823                    var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
824                    Array.prototype.forEach.call(cats, function(item) {
825                        var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, "");
826                        if (cat !== "mandatory") {
827                            var html = '';
828                            html += '<li  class="tarteaucitronLine">';
829                            html += '   <div class="tarteaucitronName">';
830                            html += '       <span class="tarteaucitronH3" role="heading" aria-level="2">'+tarteaucitron.lang[cat].title+'</span>';
831                            html += '       <span>'+tarteaucitron.lang[cat].details+'</span>';
832                            html += '   <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-'+cat+'">'+tarteaucitron.lang.alertSmall+' ('+document.getElementById("tarteaucitronServices_"+cat).childElementCount+')</button>';
833                            html += '   </div>';
834                            html += '   <div class="tarteaucitronAsk" id="tarteaucitron-group-'+cat+'">';
835                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronAllow" id="tarteaucitron-accept-group-'+cat+'">';
836                            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
837                            html += '       </button> ';
838                            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-'+cat+'">';
839                            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
840                            html += '       </button>';
841                            html += '   </div>';
842                            html += '</li>';
843                            var ul = document.createElement('ul');
844                            ul.innerHTML = html;
845                            item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+''));
846                            document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none';
847                            tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () {
848                                tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat);
849                               if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') {
850                                    tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
851                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'true');
852                                } else {
853                                    tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded');
854                                    document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'false');
855                                }
856                                //tarteaucitron.initEvents.resizeEvent();
857                            });
858                            tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () {
859                                tarteaucitron.userInterface.respondAll(true, cat);
860                            });
861                            tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () {
862                                tarteaucitron.userInterface.respondAll(false, cat);
863                            });
864                        }
865                    });
866                }
867
868                // add info about the services on the main banner
869                if (tarteaucitron.parameters.partnersList === true && (tarteaucitron.parameters.orientation === "middle" || tarteaucitron.parameters.orientation === "popup")) {
870                    setTimeout(function() {
871                        var liPartners = "";
872                        var tarteaucitronPartnersCat = [];
873                        tarteaucitron.job.forEach(function (id) {
874                            if (tarteaucitronPartnersCat[tarteaucitron.services[id].type] === undefined) {
875                                tarteaucitronPartnersCat[tarteaucitron.services[id].type] = true;
876                                liPartners += "<li>" + tarteaucitron.lang[tarteaucitron.services[id].type].title + "</li>";
877                            }
878                        });
879                        var tacPartnersInfoParent = document.getElementById('tarteaucitronDisclaimerAlert');
880                        if (tacPartnersInfoParent !== null) {
881                            tacPartnersInfoParent.insertAdjacentHTML('beforeend', '<div class="tarteaucitronPartnersList"><b>
881' + tarteaucitron.lang.ourpartners + ' (' + tarteaucitron.job.length + ')</b> <ul>' + liPartners + '</ul></div>');
882                        }
883                    }, 100);
884                }
885
886                // add a save button
887                setTimeout(function() {
888                    var tacSaveButtonParent = document.getElementById('tarteaucitronServices');
889                    if (tacSaveButtonParent !== null) {
890                        tacSaveButtonParent.insertAdjacentHTML('beforeend', '<div id="tarteaucitronSave"><button class="tarteaucitronAllow" id="tarteaucitronSaveButton" aria-label="' + tarteaucitron.lang.save + '">' + tarteaucitron.lang.save + '</button></div>');
891                    }
892                }, 100);
893
894                tarteaucitron.userInterface.color("", true);
895
896                // add a little timeout to be sure everything is accessible
897                setTimeout(function () {
898
899                    // Setup events
900                    tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () {
901                        tarteaucitron.userInterface.closeAlert();
902                    });
903                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
904                        tarteaucitron.userInterface.openPanel();
905                    });
906                    tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () {
907                        tarteaucitron.userInterface.respondAll(true);
908                    });
909                    tarteaucitron.addClickEventToId("tarteaucitronManager", function () {
910                        tarteaucitron.userInterface.openPanel();
911                    });
912                    tarteaucitron.addClickEventToId("tarteaucitronBack", function () {
913                        tarteaucitron.userInterface.closePanel();
914                    });
915                    tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () {
916                        tarteaucitron.userInterface.closePanel();
917                    });
918                    tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () {
919                        tarteaucitron.userInterface.closePanel();
920                    });
921                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () {
922                        document.location = tarteaucitron.parameters.privacyUrl;
923                    });
924                    tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () {
925                        document.location = tarteaucitron.parameters.privacyUrl;
926                    });
927                    tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () {
928                        tarteaucitron.userInterface.toggleCookiesList();
929                    });
930                    tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () {
931                        tarteaucitron.userInterface.respondAll(true);
932                    });
933                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () {
934                        tarteaucitron.userInterface.respondAll(false);
935                    });
936                    tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () {
937                        tarteaucitron.userInterface.respondAll(false, '', true);
938                        if (tarteaucitron.reloadThePage === true) {
939                            window.location.reload();
940                        }
941                    });
942                    tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
vendor: 38,834 bytes, lines 943-1712
943                        tarteaucitron.userInterface.openPanel();
944                    });
945                    tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () {
946                        location.reload();
947                    });
948                    tarteaucitron.addClickEventToId("tarteaucitronSaveButton", function () {
949                        var timeoutSaveButton = 0;
950                        tarteaucitron.job.forEach(function(id) {
951                            if (tarteaucitron.state[id] !== true && tarteaucitron.state[id] !== false) {
952                                timeoutSaveButton = 500;
953                                tarteaucitron.setConsent(id, false);
954                            }
955                        });
956                        setTimeout(tarteaucitron.userInterface.closePanel, timeoutSaveButton);
957                    });
958                    var toggleBtns = document.getElementsByClassName("catToggleBtn"), i;
959                    for (i = 0; i < toggleBtns.length; i++) {
960                        toggleBtns[i].dataset.index = i;
961                        tarteaucitron.addClickEventToElement(toggleBtns[i], function () {
962                            if(!tarteaucitron.parameters.showDetailsOnClick) return false;
963                            tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox');
964                            if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') {
965                                this.setAttribute('aria-expanded', 'true');
966                            } else {
967                                this.setAttribute('aria-expanded', 'false');
968                            }
969                            return false;
970                        });
971                    }
972
973                    // accessibility: on click on "Allow" in the site (not in TAC module), move focus to the loaded service's parent 
974                    var allowBtnsInSite = document.querySelectorAll(".tac_activate .tarteaucitronAllow");
975                    for (i = 0; i < allowBtnsInSite.length; i++) {
976                        tarteaucitron.addClickEventToElement(allowBtnsInSite[i], function () {
977                            if(this.closest('.tac_activate') !== null && this.closest('.tac_activate').parentNode !== null) {
978                                this.closest('.tac_activate').parentNode.setAttribute("tabindex", "-1");
979                                this.closest('.tac_activate').parentNode.focus();
980                            }
981                        });
982                    }
983
984                    var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
985                    for (i = 0; i < allowBtns.length; i++) {
986                        tarteaucitron.addClickEventToElement(allowBtns[i], function () {
987                            tarteaucitron.userInterface.respond(this, true);
988                        });
989                    }
990                    var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
991                    for (i = 0; i < denyBtns.length; i++) {
992                        tarteaucitron.addClickEventToElement(denyBtns[i], function () {
993                            tarteaucitron.userInterface.respond(this, false);
994                        });
995                    }
996                    if(tarteaucitron.events.load) {
997                        tarteaucitron.events.load();
998                    }
999                }, 500);
1000
1001            });
1002        });
1003    },
1004    "addService": function (serviceId) {
1005        "use strict";
1006        var html = '',
1007            s = tarteaucitron.services,
1008            service = s[serviceId];
1009
1010        if (tarteaucitron.parameters.alwaysNeedConsent === true) {
1011            service.needConsent = true;
1012        }
1013
1014        var cookie = tarteaucitron.cookie.read(),
1015            hostname = document.location.hostname,
1016            hostRef = document.referrer.split('/')[2],
1017            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl),
1018            isAutostart = (!service.needConsent),
1019            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0),
1020            isDenied = (cookie.indexOf(service.key + '=false') >= 0),
1021            isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
1022            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
1023            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"),
1024            currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed,
1025            state = (undefined !== service.defaultState) ? service.defaultState :
1026                    (undefined !== tarteaucitron.parameters.serviceDefaultState ? tarteaucitron.parameters.serviceDefaultState : 'wait');
1027
1028
1029        if (tarteaucitron.added[service.key] !== true) {
1030            tarteaucitron.added[service.key] = true;
1031
1032            html += '<div id="' + service.key + 'Line" class="tarteaucitronLine">';
1033            html += '   <div class="tarteaucitronName">';
1034            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
1035            html += '       <div class="tarteaucitronStatusInfo">';
1036            html += '          <span class="tacCurrentStatus" id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>';
1037            html += '          <span class="tarteaucitronReadmoreSeparator"> - </span>';
1038            html += '          <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span>';
1039            html += '       </div>';
1040            if (tarteaucitron.parameters.moreInfoLink == true) {
1041
1042                var link = 'https://tarteaucitron.io/service/' + service.key + '/';
1043                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
1044                    link = service.readmoreLink;
1045                }
1046                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
1047                    link = tarteaucitron.parameters.readmoreLink;
1048                }
1049                html += '       <ul style="display: flex; gap: 4px;">';
1050                html += '       <li>';
1051                html += '       <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" class="tarteaucitronReadmoreInfo">' + tarteaucitron.lang.more + '</a>';
1052                html += '       <span class="tarteaucitronReadmoreSeparator" aria-hidden="true"> - </span>';
1053                html += '       </li>';
1054                html += '       <li>';
1055                html += '       <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" class="tarteaucitronReadmoreOfficial">' + tarteaucitron.lang.source + '</a>';
1056                html += '       </li>';
1057                html += '       </ul>';
1058
1059            }
1060
1061            html += '   </div>';
1062            html += '   <div class="tarteaucitronAsk">';
1063            html += '       <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + service.name + '" id="' + service.key + 'Allowed" class="tarteaucitronAllow">';
1064            html += '           <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
1065            html += '       </button> ';
1066            html += '       <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + service.name + '" id="' + service.key + 'Denied" class="tarteaucitronDeny">';
1067            html += '           <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny;
1068            html += '       </button>';
1069            html += '   </div>';
1070            html += '</div>';
1071
1072            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');
1073
1074            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
1075                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
1076            }
1077
1078            tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
1079
1080            tarteaucitron.userInterface.order(service.type);
1081
1082            tarteaucitron.addClickEventToId(service.key + 'Allowed', function () {
1083                tarteaucitron.userInterface.respond(this, true);
1084            });
1085
1086            tarteaucitron.addClickEventToId(service.key + 'Denied', function () {
1087                tarteaucitron.userInterface.respond(this, false);
1088            });
1089        }
1090
1091        tarteaucitron.pro('!' + service.key + '=' + isAllowed);
1092
1093        // allow by default for non EU
1094        if (isResponded === false && tarteaucitron.user.bypass === true) {
1095            isAllowed = true;
1096            tarteaucitron.cookie.create(service.key, true);
1097        }
1098
1099        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
1100            if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) {
1101                tarteaucitron.cookie.create(service.key, true);
1102            }
1103            if (tarteaucitron.launch[service.key] !== true) {
1104                tarteaucitron.launch[service.key] = true;
1105                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.js(); }
1106                tarteaucitron.sendEvent(service.key + '_loaded');
1107            }
1108            tarteaucitron.state[service.key] = true;
1109            tarteaucitron.userInterface.color(service.key, true);
1110        } else if (isDenied) {
1111            if (typeof service.fallback === 'function') {
1112                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
1113            }
1114            tarteaucitron.state[service.key] = false;
1115            tarteaucitron.userInterface.color(service.key, false);
1116        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
1117            tarteaucitron.cookie.create(service.key, 'false');
1118            if (typeof service.fallback === 'function') {
1119                if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); }
1120            }
1121            tarteaucitron.state[service.key] = false;
1122            tarteaucitron.userInterface.color(service.key, false);
1123        } else if (!isResponded) {
1124            tarteaucitron.cookie.create(service.key, state);
1125            if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) {
1126                if(true === state && typeof service.js === 'function') {
1127                    service.js();
1128                    tarteaucitron.sendEvent(service.key + '_loaded');
1129                } else if (typeof service.fallback === 'function') {
1130                    service.fallback();
1131                }
1132            }
1133
1134            tarteaucitron.userInterface.color(service.key, state);
1135
1136            if( 'wait' === state ) {
1137                tarteaucitron.userInterface.openAlert();
1138            }
1139        }
1140
1141        tarteaucitron.cookie.checkCount(service.key);
1142        tarteaucitron.sendEvent(service.key + '_added');
1143    },
1144    "sendEvent" : function(event_key) {
1145        if(event_key !== undefined) {
1146            //ie compatibility
1147            var send_event_item;
1148            if(typeof(Event) === 'function') {
1149                send_event_item = new Event(event_key);
1150            }else if (typeof(document.createEvent) === 'function'){
1151                send_event_item = document.createEvent('Event');
1152                send_event_item.initEvent(event_key, true, true);
1153            }
1154            //end ie compatibility
1155
1156            document.dispatchEvent(send_event_item);
1157        }
1158    },
1159    "cleanArray": function cleanArray(arr) {
1160        "use strict";
1161        var i,
1162            len = arr.length,
1163            out = [],
1164            obj = {},
1165            s = tarteaucitron.services;
1166
1167        for (i = 0; i < len; i += 1) {
1168            if (!obj[arr[i]]) {
1169                obj[arr[i]] = {};
1170                if (tarteaucitron.services[arr[i]] !== undefined) {
1171                    out.push(arr[i]);
1172                }
1173            }
1174        }
1175
1176        out = out.sort(function (a, b) {
1177            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
1178            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
1179            return 0;
1180        });
1181
1182        return out;
1183    },
1184    "setConsent": function (id, status) {
1185        if (status === true) {
1186            tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true);
1187        } else if (status === false) {
1188            tarteaucitron.userInterface.respond(document.getElementById(id + 'Denied'), false);
1189        }
1190    },
1191    "userInterface": {
1192        "css": function (id, property, value) {
1193            "use strict";
1194            if (document.getElementById(id) !== null) {
1195
1196                if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) {
1197                    document.getElementById(id).style["opacity"] = "0";
1198
1199                    /*setTimeout(function() {*/document.getElementById(id).style[property] = value;/*}, 200);*/
1200                } else {
1201
1202                    document.getElementById(id).style[property] = value;
1203
1204                    if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) {
1205                        document.getElementById(id).style["opacity"] = "1";
1206                    }
1207
1208                    if (property == "display" && value == "block" && id == "tarteaucitronBack") {
1209                        document.getElementById(id).style["opacity"] = "0.7";
1210                    }
1211
1212                    if (property == "display" && value == "block" && id == "tarteaucitronAlertBig" && (tarteaucitron.parameters.orientation == "middle"|| tarteaucitron.parameters.orientation == "popup")) {
1213                        tarteaucitron.userInterface.focusTrap('tarteaucitronAlertBig');
1214                    }
1215                }
1216            }
1217        },
1218        "addClass": function (id, className) {
1219            "use strict";
1220            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1221                document.getElementById(id).classList.add(className);
1222            }
1223        },
1224        "removeClass": function (id, className) {
1225            "use strict";
1226            if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) {
1227                document.getElementById(id).classList.remove(className);
1228            }
1229        },
1230        "respondAll": function (status, type, allowSafeAnalytics) {
1231            "use strict";
1232            var s = tarteaucitron.services,
1233                service,
1234                key,
1235                index = 0;
1236
1237            for (index = 0; index < tarteaucitron.job.length; index += 1) {
1238
1239                if (typeof type !== 'undefined' && type !== '' && s[tarteaucitron.job[index]].type !== type) {
1240                    continue;
1241                }
1242
1243                if (allowSafeAnalytics && typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1244                    continue;
1245                }
1246
1247                service = s[tarteaucitron.job[index]];
1248                key = service.key;
1249                if (tarteaucitron.state[key] !== status) {
1250                    if (status === false && tarteaucitron.launch[key] === true) {
1251                        tarteaucitron.reloadThePage = true;
1252                        if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1253                            var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1254                            document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1255                            document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1256                        }
1257                    }
1258                    if (tarteaucitron.launch[key] !== true && status === true) {
1259
1260                        tarteaucitron.pro('!' + key + '=engage');
1261
1262                        tarteaucitron.launch[key] = true;
1263                        if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
1264                        tarteaucitron.sendEvent(key + '_loaded');
1265                    }
1266                    var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1267                    tarteaucitron.state[key] = status;
1268                    tarteaucitron.cookie.create(key, status);
1269                    tarteaucitron.userInterface.color(key, status);
1270                    if (status == true) {
1271                        itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1272                        tarteaucitron.sendEvent(key + '_allowed');
1273                    } else {
1274                        itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1275                        tarteaucitron.sendEvent(key + '_disallowed');
1276                    }
1277                }
1278            }
1279        },
1280        "respond": function (el, status) {
1281            "use strict";
1282            if (el.id === '') {
1283                return;
1284            }
1285            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');
1286
1287            if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;}
1288
1289            // return if same state
1290            if (tarteaucitron.state[key] === status) {
1291                return;
1292            }
1293
1294            if (status === false && tarteaucitron.launch[key] === true) {
1295                tarteaucitron.reloadThePage = true;
1296                if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1297                    var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')';
1298                    document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue);
1299                    document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue);
1300                }
1301            }
1302
1303            // if not already launched... launch the service
1304            if (status === true) {
1305                if (tarteaucitron.launch[key] !== true) {
1306
1307                    tarteaucitron.pro('!' + key + '=engage');
1308
1309                    tarteaucitron.launch[key] = true;
1310                    if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
1311                    tarteaucitron.sendEvent(key + '_loaded');
1312                }
1313            }
1314            var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
1315            tarteaucitron.state[key] = status;
1316            tarteaucitron.cookie.create(key, status);
1317            tarteaucitron.userInterface.color(key, status);
1318            if (status == true) {
1319                itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1320                tarteaucitron.sendEvent(key + '_allowed');
1321            } else {
1322                itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1323                tarteaucitron.sendEvent(key + '_disallowed');
1324            }
1325        },
1326        "color": function (key, status) {
1327            "use strict";
1328            var c = 'tarteaucitron',
1329                nbDenied = 0,
1330                nbPending = 0,
1331                nbAllowed = 0,
1332                sum = tarteaucitron.job.length,
1333                index,
1334                s = tarteaucitron.services;
1335
1336            if (key !== "") {
1337
1338            if (status === true) {
1339                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed');
1340                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied');
1341                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true');
1342                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1343            } else if (status === false) {
1344                tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed');
1345                tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied');
1346                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1347                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true');
1348            } else {
1349                document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false');
1350                document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false');
1351            }
1352
1353            // check if all services are allowed
1354            var sumToRemove = 0;
1355            for (index = 0; index < sum; index += 1) {
1356
1357                if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) {
1358                    sumToRemove += 1;
1359                    continue;
1360                }
1361
1362                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
1363                    nbDenied += 1;
1364                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
1365                    nbPending += 1;
1366                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
1367                    nbAllowed += 1;
1368                }
1369            }
1370            sum -= sumToRemove;
1371
1372            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
1373            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
1374            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');
1375
1376            if (nbDenied === 0 && nbPending === 0) {
1377                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1378                tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected');
1379
1380                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed');
1381                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1382
1383                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1384                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true');
1385
1386            } else if (nbAllowed === 0 && nbPending === 0) {
1387                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1388                tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected');
1389
1390                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1391                tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied');
1392
1393                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true');
1394                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1395
1396            } else {
1397                tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected');
1398                tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected');
1399
1400                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed');
1401                tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied');
1402
1403                document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false');
1404                document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false');
1405            }
1406
1407            // close the alert if all service have been reviewed
1408            if (nbPending === 0) {
1409                tarteaucitron.userInterface.closeAlert();
1410            }
1411
1412            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
1413                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
1414            }
1415
1416            if (status === true) {
1417                if (document.getElementById('tacCL' + key) !== null) {
1418                    document.getElementById('tacCL' + key).innerHTML = '...';
1419                }
1420                setTimeout(function () {
1421                    tarteaucitron.cookie.checkCount(key);
1422                }, 2500);
1423            } else {
1424                tarteaucitron.cookie.checkCount(key);
1425            }
1426
1427            }
1428
1429	    // groups
1430            var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]')
1431            Array.prototype.forEach.call(cats, function(item) {
1432                var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""),
1433                    total = document.getElementById("tarteaucitronServices_"+cat).childElementCount;
1434                var doc = document.getElementById("tarteaucitronServices_"+cat),
1435                    groupdenied = 0,
1436                    groupallowed = 0;
1437                for (var ii = 0; ii < doc.children.length; ii++) {
1438                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") {
1439                        groupdenied++;
1440                    }
1441                    if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") {
1442                        groupallowed++;
1443                    }
1444                }
1445                if (total === groupallowed) {
1446                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1447                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1448
1449                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1450                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1451                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true');
1452                    }
1453                }
1454                if (total === groupdenied) {
1455                    tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1456                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1457
1458                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1459                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true');
1460                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1461                    }
1462                }
1463                if (total !== groupdenied && total !== groupallowed) {
1464                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied');
1465                    tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed');
1466
1467                    if (document.getElementById('tarteaucitron-reject-group-'+cat)) {
1468                        document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false');
1469                        document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false');
1470                    }
1471                }
1472                groupdenied = 0;
1473                groupallowed = 0;
1474            });
1475
1476        },
1477        "openPanel": function () {
1478            "use strict";
1479
1480            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
1481            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1482            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1483
1484            document.getElementById('tarteaucitronClosePanel').focus();
1485            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1486                document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open');
1487            }
1488            tarteaucitron.userInterface.focusTrap('tarteaucitron');
1489            tarteaucitron.userInterface.jsSizing('main');
1490
1491            //ie compatibility
1492            var tacOpenPanelEvent;
1493            if(typeof(Event) === 'function') {
1494                tacOpenPanelEvent = new Event("tac.open_panel");
1495            }else if (typeof(document.createEvent) === 'function'){
1496                tacOpenPanelEvent = document.createEvent('Event');
1497                tacOpenPanelEvent.initEvent("tac.open_panel", true, true);
1498            }
1499            //end ie compatibility
1500
1501            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);}
1502        },
1503        "closePanel": function () {
1504            "use strict";
1505
1506            if (document.location.hash === tarteaucitron.hashtag) {
1507                if (window.history) {
1508                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
1509                } else {
1510                    document.location.hash = '';
1511                }
1512            }
1513            if (tarteaucitron.checkIfExist('tarteaucitron')) {
1514                // accessibility: manage focus on close panel
1515                if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) {
1516                    document.getElementById('tarteaucitronCloseAlert').focus();
1517                } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) {
1518                    document.getElementById('tarteaucitronManager').focus();
1519                } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) {
1520                    document.getElementById(tarteaucitron.customCloserId).focus();
1521                }
1522                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1523            }
1524
1525            if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) {
1526                // accessibility: manage focus on close cookies list
1527                document.getElementById('tarteaucitronCookiesNumber').focus();
1528                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false");
1529                tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');
1530            }
1531
1532            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1533                elem.style.display = 'none';
1534            }, true);
1535
1536            if (tarteaucitron.reloadThePage === true) {
1537                window.location.reload();
1538            } else {
1539                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1540            }
1541            if (document.getElementsByTagName('body')[0].classList !== undefined) {
1542                document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open');
1543            }
1544
1545            //ie compatibility
1546            var tacClosePanelEvent;
1547            if(typeof(Event) === 'function') {
1548                tacClosePanelEvent = new Event("tac.close_panel");
1549            }else if (typeof(document.createEvent) === 'function'){
1550                tacClosePanelEvent = document.createEvent('Event');
1551                tacClosePanelEvent.initEvent("tac.close_panel", true, true);
1552            }
1553            //end ie compatibility
1554
1555            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);}
1556        },
1557        "focusTrap": function(parentElement) {
1558            "use strict";
1559
1560            var focusableEls,
1561                firstFocusableEl,
1562                lastFocusableEl,
1563                filtered;
1564
1565            focusableEls = document.getElementById(parentElement).querySelectorAll('a[href], button');
1566            filtered = [];
1567
1568            // get only visible items
1569            for (var i = 0, max = focusableEls.length; i < max; i++) {
1570                if (focusableEls[i].offsetHeight > 0) {
1571                   filtered.push(focusableEls[i]);
1572                }
1573            }
1574
1575            firstFocusableEl = filtered[0];
1576            lastFocusableEl = filtered[filtered.length - 1];
1577
1578            //loop focus inside tarteaucitron
1579            document.getElementById(parentElement).addEventListener("keydown", function (evt) {
1580
1581                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {
1582
1583                    if ( evt.shiftKey ) /* shift + tab */ {
1584                        if (document.activeElement === firstFocusableEl) {
1585                            lastFocusableEl.focus();
1586                            evt.preventDefault();
1587                        }
1588                    } else /* tab */ {
1589                        if (document.activeElement === lastFocusableEl) {
1590                            firstFocusableEl.focus();
1591                            evt.preventDefault();
1592                        }
1593                    }
1594                }
1595            })
1596        },
1597        "openAlert": function () {
1598            "use strict";
1599            var c = 'tarteaucitron';
1600            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
1601            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
1602            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none');
1603            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
1604            tarteaucitron.userInterface.addClass(c + 'Root',   'tarteaucitronBeforeVisible');
1605
1606            //ie compatibility
1607            var tacOpenAlertEvent;
1608            if(typeof(Event) === 'function') {
1609                tacOpenAlertEvent = new Event("tac.open_alert");
1610            }else if (typeof(document.createEvent) === 'function'){
1611                tacOpenAlertEvent = document.createEvent('Event');
1612                tacOpenAlertEvent.initEvent("tac.open_alert", true, true);
1613            }
1614            //end ie compatibility
1615
1616            if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.parameters.orientation === 'middle') {
1617                document.getElementById('tarteaucitronAlertBig').focus();
1618            }
1619
1620            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);}
1621        },
1622        "closeAlert": function () {
1623            "use strict";
1624            var c = 'tarteaucitron';
1625            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
1626            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
1627            tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block');
1628            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
1629            tarteaucitron.userInterface.removeClass(c + 'Root',   'tarteaucitronBeforeVisible');
1630            tarteaucitron.userInterface.jsSizing('box');
1631
1632            //ie compatibility
1633            var tacCloseAlertEvent;
1634            if(typeof(Event) === 'function') {
1635                tacCloseAlertEvent = new Event("tac.close_alert");
1636            }else if (typeof(document.createEvent) === 'function'){
1637                tacCloseAlertEvent = document.createEvent('Event');
1638                tacCloseAlertEvent.initEvent("tac.close_alert", true, true);
1639            }
1640            //end ie compatibility
1641
1642            if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);}
1643        },
1644        "toggleCookiesList": function () {
1645            "use strict";
1646            var div = document.getElementById('tarteaucitronCookiesListContainer'),
1647                togglediv = document.getElementById('tarteaucitronCookiesNumber');
1648
1649            if (div === null) {
1650                return;
1651            }
1652
1653            if (div.style.display !== 'block') {
1654                tarteaucitron.cookie.number();
1655                div.style.display = 'block';
1656                togglediv.setAttribute("aria-expanded", "true");
1657                tarteaucitron.userInterface.jsSizing('cookie');
1658                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1659                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
1660                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
1661                    elem.style.display = 'none';
1662                }, true);
1663            } else {
1664                div.style.display = 'none';
1665                togglediv.setAttribute("aria-expanded", "false");
1666                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
1667                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
1668            }
1669        },
1670        "toggle": function (id, closeClass) {
1671            "use strict";
1672            var div = document.getElementById(id);
1673
1674            if (div === null) {
1675                return;
1676            }
1677
1678            if (closeClass !== undefined) {
1679                tarteaucitron.fallback([closeClass], function (elem) {
1680                    if (elem.id !== id) {
1681                        elem.style.display = 'none';
1682                    }
1683                }, true);
1684            }
1685
1686            if (div.style.display !== 'block') {
1687                div.style.display = 'block';
1688            } else {
1689                div.style.display = 'none';
1690            }
1691        },
1692        "order": function (id) {
1693            "use strict";
1694            var main = document.getElementById('tarteaucitronServices_' + id),
1695                allDivs,
1696                store = [],
1697                i;
1698
1699            if (main === null) {
1700                return;
1701            }
1702
1703            allDivs = main.childNodes;
1704
1705            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
1706                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
1707                //var mainChildren = Array.from(main.children);
1708                //mainChildren.sort(function (a, b) {
1709                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
1710                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
1711                    return 0;
1712                }
1712).forEach(function (element) {
1713                    main.appendChild(element);
1714                });
1715            }
1716        },
1717        "jsSizing": function (type) {
1718            "use strict";
1719            var scrollbarMarginRight = 10,
1720                scrollbarWidthParent,
1721                scrollbarWidthChild,
1722                servicesHeight,
1723                e = window,
1724                a = 'inner',
1725                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
1726                mainTop,
1727                mainHeight,
1728                closeButtonHeight,
1729                headerHeight,
1730                cookiesListHeight,
1731                cookiesCloseHeight,
1732                cookiesTitleHeight,
1733                paddingBox,
1734                alertSmallHeight,
1735                cookiesNumberHeight;
1736
1737            if (type === 'box') {
1738                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {
1739
1740                    // reset
1741                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');
1742
1743                    // calculate
1744                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
1745                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
1746                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
1747
1748                    // apply
1749                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
1750                }
1751            } else if (type === 'main') {
1752
1753                // get the real window width for media query
1754                if (window.innerWidth === undefined) {
1755                    a = 'client';
1756                    e = document.documentElement || document.body;
1757                }
1758
1759                // height of the services list container
1760                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {
1761
1762                    // reset
1763                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');
1764
1765                    // calculate
1766                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
1767                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;
1768
1769                    // apply
1770                    servicesHeight = (mainHeight - closeButtonHeight + 4);
1771                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
1772                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
1773                }
1774
1775                // align the main allow/deny button depending on scrollbar width
1776                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {
1777
1778                    // media query
1779                    if (e[a + 'Width'] <= 479) {
1780                        //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
1781                    } else if (e[a + 'Width'] <= 767) {
1782                        scrollbarMarginRight = 12;
1783                    }
1784
1785                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
1786                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
1787                    //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
1788                }
1789
1790                // center the main panel
1791                if (document.getElementById('tarteaucitron') !== null) {
1792
1793                    // media query
1794                    if (e[a + 'Width'] <= 767) {
1795                        mainTop = 0;
1796                    } else {
1797                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
1798                    }
1799
1800                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
1801                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
1802                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
1803                        }
1804                    }
1805
1806                    // correct
1807                    if (mainTop < 0) {
1808                        mainTop = 0;
1809                    }
1810
1811                    // apply
1812                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
1813                }
1814
1815
1816            } else if (type === 'cookie') {
1817
1818                // put cookies list at bottom
1819                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
1820                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
1821                }
1822
1823                // height of cookies list
1824                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
1825
1826                    // reset
1827                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');
1828
1829                    // calculate
1830                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
1831                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
1832                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;
1833
1834                    // apply
1835                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 10,277 bytes, lines 1835-2042
1835sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
1836                }
1837            }
1838        }
1839    },
1840    "cookie": {
1841        "owner": {},
1842        "create": function (key, status) {
1843            "use strict";
1844
1845            if (tarteaucitronForceExpire !== '') {
1846                // The number of day(s)/hour(s) can't be higher than 1 year
1847                if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) {
1848                    if (tarteaucitronExpireInDay) {
1849                        // Multiplication to tranform the number of days to milliseconds
1850                        timeExpire = tarteaucitronForceExpire * 86400000;
1851                    } else {
1852                        // Multiplication to tranform the number of hours to milliseconds
1853                        timeExpire = tarteaucitronForceExpire * 3600000;
1854                    }
1855                }
1856            }
1857
1858            var d = new Date(),
1859                time = d.getTime(),
1860                expireTime = time + timeExpire, // 365 days
1861                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
1862                cookie = tarteaucitron.cookie.read().replace(regex, ""),
1863                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
1864                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '',
1865                secure = location.protocol === 'https:' ? '; Secure' : '';
1866
1867            d.setTime(expireTime);
1868            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax';
1869
1870            tarteaucitron.sendEvent('tac.consent_updated');
1871        },
1872        "read": function () {
1873            "use strict";
1874            var nameEQ = tarteaucitron.parameters.cookieName + "=",
1875                ca = document.cookie.split(';'),
1876                i,
1877                c;
1878
1879            for (i = 0; i < ca.length; i += 1) {
1880                c = ca[i];
1881                while (c.charAt(0) === ' ') {
1882                    c = c.substring(1, c.length);
1883                }
1884                if (c.indexOf(nameEQ) === 0) {
1885                    return c.substring(nameEQ.length, c.length);
1886                }
1887            }
1888            return '';
1889        },
1890        "purge": function (arr) {
1891            "use strict";
1892            var i;
1893
1894            for (i = 0; i < arr.length; i += 1) {
1895
1896                var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$");
1897                if (document.cookie.match(rgxpCookie)) {
1898                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
1899                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
1900                    document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
1901                }
1902            }
1903        },
1904        "checkCount": function (key) {
1905            "use strict";
1906            var arr = tarteaucitron.services[key].cookies,
1907                nb = arr.length,
1908                nbCurrent = 0,
1909                html = '',
1910                i,
1911                status = document.cookie.indexOf(key + '=true');
1912
1913            if (status >= 0 && nb === 0) {
1914                html += tarteaucitron.lang.useNoCookie;
1915            } else if (status >= 0) {
1916                for (i = 0; i < nb; i += 1) {
1917                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
1918                        nbCurrent += 1;
1919                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
1920                            tarteaucitron.cookie.owner[arr[i]] = [];
1921                        }
1922                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
1923                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
1924                        }
1925                    }
1926                }
1927
1928                if (nbCurrent > 0) {
1929                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
1930                    if (nbCurrent > 1) {
1931                        html += 's';
1932                    }
1933                    html += '.';
1934                } else {
1935                    html += tarteaucitron.lang.useNoCookie;
1936                }
1937            } else if (nb === 0) {
1938                html = tarteaucitron.lang.noCookie;
1939            } else {
1940                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
1941                if (nb > 1) {
1942                    html += 's';
1943                }
1944                html += '.';
1945            }
1946
1947            if (document.getElementById('tacCL' + key) !== null) {
1948                document.getElementById('tacCL' + key).innerHTML = html;
1949            }
1950        },
1951        "crossIndexOf": function (arr, match) {
1952            "use strict";
1953            var i;
1954            for (i = 0; i < arr.length; i += 1) {
1955                if (arr[i] === match) {
1956                    return true;
1957                }
1958            }
1959            return false;
1960        },
1961        "number": function () {
1962            "use strict";
1963            var cookies = document.cookie.split(';'),
1964                nb = (document.cookie !== '') ? cookies.length : 0,
1965                html = '',
1966                i,
1967                name,
1968                namea,
1969                nameb,
1970                c,
1971                d,
1972                s = (nb > 1) ? 's' : '',
1973                savedname,
1974                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
1975                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
1976                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;
1977
1978            cookies = cookies.sort(function (a, b) {
1979                namea = a.split('=', 1).toString().replace(/ /g, '');
1980                nameb = b.split('=', 1).toString().replace(/ /g, '');
1981                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
1982                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
1983                if (c + a > d + b) { return 1; }
1984                if (c + a < d + b) { return -1; }
1985                return 0;
1986            });
1987
1988            if (document.cookie !== '') {
1989                for (i = 0; i < nb; i += 1) {
1990                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
1991                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
1992                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
1993                        html += '<div class="tarteaucitronHidden">';
1994                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
1995                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
1996                        html += '    </span>';
1997                        html += '</div><ul class="cookie-list">';
1998                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
1999                        savedname = host;
2000                        html += '<div class="tarteaucitronHidden">';
2001                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
2002                        html += '        ' + host;
2003                        html += '    </span>';
2004                        html += '</div><ul class="cookie-list">';
2005                    }
2006                    html += '<li class="tarteaucitronCookiesListMain">';
2007                    html += '    <div class="tarteaucitronCookiesListLeft"><button type="button" class="purgeBtn" data-cookie="' + tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) + '"><strong>&times;</strong></button> <strong>' + tarteaucitron.fixSelfXSS(name) + '</strong>';
2008                    html += '    </div>';
2009                    html += '    <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>';
2010                    html += '</li>';
2011                }
2012                html += '</ul>';
2013            } else {
2014                html += '<div class="tarteaucitronCookiesListMain">';
2015                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
2016                html += '    <div class="tarteaucitronCookiesListRight"></div>';
2017                html += '</div>';
2018            }
2019
2020            html += '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>';
2021
2022            if (document.getElementById('tarteaucitronCookiesList') !== null) {
2023                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
2024            }
2025
2026            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
2027                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
2028                document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-label", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2029                document.getElementById('tarteaucitronCookiesNumber').setAttribute("title", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox);
2030            }
2031
2032            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
2033                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
2034            }
2035
2036            var purgeBtns = document.getElementsByClassName("purgeBtn");
2037            for (i = 0; i < purgeBtns.length; i++) {
2038                tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
2039                    tarteaucitron.cookie.purge([this.dataset.cookie]);
2040                    tarteaucitron.cookie.number();
2041                    tarteaucitron.userInterface.jsSizing('cookie');
2042                    return false;
2043                });
2044            }
2045
2046            for (i = 0; i < tarteaucitron.job.length; i += 1) {
2047                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
2048            }
2049        }
2050    },
2051    "fixSelfXSS": function(html) {
2052        return html.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
2053    },
2054    "getLanguage": function () {
2055        "use strict";
2056
2057        var availableLanguages = 'ar,bg,ca,cn,cs,da,de,et,el,en,es,fi,fr,hr,hu,it,ja,kr,lb,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,uk,vi,zh',
2058            defaultLanguage = 'fr';
2059
2060        if (tarteaucitronForceLanguage !== '') {
2061            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
2062                return tarteaucitronForceLanguage;
2063            }
2064        }
2065
2066        if (document.documentElement.getAttribute("lang") !== null ){
2067            return defaultLanguage;
2068        }
2069        // get the html lang
2070        if (availableLanguages.indexOf(document.documentElement.getAttribute("lang").substr(0, 2)) !== -1) {
2071          return document.documentElement.getAttribute("lang").substr(0, 2);
2072        }
2073
2074        if (!navigator) { return defaultLanguage; }
2075
2076        var lang = navigator.language || navigator.browserLanguage ||
2077                navigator.systemLanguage || navigator.userLang || null,
2078            userLanguage = lang ? lang.slice(0, 2) : null;
2079
2080        if (availableLanguages.indexOf(userLanguage) !== -1) {
2081            return userLanguage;
2082        }
2083    },
2084    "getLocale": function () {
2085        "use strict";
2086        if (!navigator) { return 'en_US'; }
2087
2088        var lang = navigator.language || navigator.browserLanguage ||
2089                navigator.systemLanguage || navigator.userLang || null,
2090            userLanguage = lang ? lang.substr(0, 2) : null;
2091
2092        if (userLanguage === 'fr') {
2093            return 'fr_FR';
2094        } else if (userLanguage === 'en') {
2095            return 'en_US';
2096        } else if (userLanguage === 'de') {
2097            return 'de_DE';
2098        } else if (userLanguage === 'es') {
2099            return 'es_ES';
2100        } else if (userLanguage === 'it') {
2101            return 'it_IT';
2102        } else if (userLanguage === 'pt') {
2103            return 'pt_PT';
2104        } else if (userLanguage === 'nl') {
2105            return 'nl_NL';
2106        } else if (userLanguage === 'el') {
2107            return 'el_EL';
2108        } else {
2109            return 'en_US';
2110        }
2111    },
2112    "addScript": function (url, id, callback, execute, attrName, attrVal, internal) {
2113        "use strict";
2114        var script,
2115            done = false;
2116
2117        if (execute === false) {
2118            if (typeof callback === 'function') {
2119                callback();
2120            }
2121        } else {
2122            script = document.createElement('script');
2123            if (id !== undefined) {
2124                script.id = id;
2125            }
2126            script.async = true;
2127            script.src = url;
2128
2129            if (attrName !== undefined && attrVal !== undefined) {
2130                script.setAttribute(attrName, attrVal);
2131            }
2132
2133            if (typeof callback === 'function') {
2134                if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2135                    script.onreadystatechange = script.onload = function () {
2136                        var state = script.readyState;
2137                        if (!done && (!state || /loaded|complete/.test(state))) {
2138                            done = true;
2139                            callback();
2140                        }
2141                    };
2142                } else {
2143                    callback();
2144                }
2145            }
2146
2147            if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
2148                document.getElementsByTagName('head')[0].appendChild(script);
2149            }
2150        }
2151    },
2152    "addInternalScript": function (url, id, callback, execute, attrName, attrVal) {
2153        tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true);
2154    },
2155    "checkIfExist": function (elemId) {
2156        "use strict";
2157        return document.getElementById(elemId) !== null && document.getElementById(elemId).offsetWidth !== 0 && document.getElementById(elemId).offsetHeight !== 0;
2158    },
2159    "makeAsync": {
2160        "antiGhost": 0,
2161        "buffer": '',
2162        "init": function (url, id) {
2163            "use strict";
2164            var savedWrite = document.write,
2165                savedWriteln = document.writeln;
2166
2167            document.write = function (content) {
2168                tarteaucitron.makeAsync.buffer += content;
2169            };
2170            document.writeln = function (content) {
2171                tarteaucitron.makeAsync.buffer += content.concat("\n");
2172            };
2173
2174            setTimeout(function () {
2175                document.write = savedWrite;
2176                document.writeln = savedWriteln;
2177            }, 20000);
2178
2179            tarteaucitron.makeAsync.getAndParse(url, id);
2180        },
2181        "getAndParse": function (url, id) {
2182            "use strict";
2183            if (tarteaucitron.makeAsync.antiGhost > 9) {
2184                tarteaucitron.makeAsync.antiGhost = 0;
2185                return;
2186            }
2187            tarteaucitron.makeAsync.antiGhost += 1;
2188            tarteaucitron.addInternalScript(url, '', function () {
2189                if (document.getElementById(id) !== null) {
2190                    document.getElementById(id).innerHTML += "<span class='tarteaucitron-display-none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
2191                    tarteaucitron.makeAsync.buffer = '';
2192                    tarteaucitron.makeAsync.execJS(id);
2193                }
2194            });
2195        },
2196        "execJS": function (id) {
2197            /* not strict because third party scripts may have errors */
2198            var i,
2199                scripts,
2200                childId,
2201                type;
2202
2203            if (document.getElementById(id) === null) {
2204                return;
2205            }
2206
2207            scripts = document.getElementById(id).getElementsByTagName('script');
2208            for (i = 0; i < scripts.length; i += 1) {
2209                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
2210                if (type === '') {
2211                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
2212                }
2213                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
2214                    childId = id + Math.floor(Math.random() * 99999999999);
2215                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
2216                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
2217                } else if (type.indexOf('javascript') !== -1 || type === '') {
2218                    eval(scripts[i].innerHTML);
2219                }
2220            }
2221        }
2222    },
2223    "fallback": function (matchClass, content, noInner) {
2224        "use strict";
2225        var elems = document.getElementsByTagName('*'),
2226            i,
2227            index = 0;
2228
2229        for (i in elems) {
2230            if (elems[i] !== undefined) {
2231                for (index = 0; index < matchClass.length; index += 1) {
2232                    if ((' ' + elems[i].className + ' ')
2233                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
2234                        if (typeof content === 'function') {
2235                            if (noInner === true) {
2236                                content(elems[i]);
2237                            } else {
2238                                elems[i].innerHTML = content(elems[i]);
2239                            }
2240                        } else {
2241                            elems[i].innerHTML = content;
2242                        }
2243                    }
2244                }
2245            }
2246        }
2247    },
2248    "engage": function (id) {
2249        "use strict";
2250        var html = '',
2251            r = Math.floor(Math.random() * 100000),
2252            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
2253
2254        if (tarteaucitron.lang['engage-' + id] !== undefined) {
2255            engage = tarteaucitron.lang['engage-' + id];
2256        }
2257
2258        html += '<div class="tac_activate tac_activate_' + id + '">';
2259        html += '   <div class="tac_float">';
2260        html += '      ' + engage;
2261        html += '      <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">';
2262        html += '          <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow;
2263        html += '       </button>';
2264        html += '   </div>';
2265        html += '</div>';
2266
2267        return html;
2268    },
2269    "extend": function (a, b) {
2270        "use strict";
2271        var prop;
2272        for (prop in b) {
2273            if (b.hasOwnProperty(prop)) {
2274                a[prop] = b[prop];
2275            }
2276        }
2277    },
2278    "proTemp": '',
2279    "proTimer": function () {
2280        "use strict";
2281        setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2282    },
2283    "pro": function (list) {
2284        "use strict";
2285        tarteaucitron.proTemp += list;
2286        clearTimeout(tarteaucitron.proTimer);
2287        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500));
2288    },
2289    "proPing": function () {
2290        "use strict";
2291        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '' && tarteaucitronStatsEnabled) {
2292            var div = document.getElementById('tarteaucitronPremium'),
2293                timestamp = new Date().getTime(),
2294                url = 'https://tarteaucitron.io/log/?';
2295
2296            if (div === null) {
2297                return;
2298            }
2299
2300            url += 'account=' + tarteaucitron.uuid + '&';
2301            url += 'domain=' + tarteaucitron.domain + '&';
2302            url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
2303            url += '_time=' + timestamp;
2304
2305            div.innerHTML = '<img src="' + url + '" class="tarteaucitron-display-none" alt="" />';
2306
2307            tarteaucitron.proTemp = '';
2308        }
2309
2310        tarteaucitron.cookie.number();
2311    },
2312    "AddOrUpdate" : function(source, custom){
2313        /**
2314         Utility function to Add or update the fields of obj1 with the ones in obj2
2315         */
2316        for(var key in custom){
2317            if(custom[key] instanceof Object){
2318                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
2319            }else{
2320                source[key] = custom[key];
2321            }
2322        }
2323        return source;
2324    },
2325    "getElemWidth": function(elem) {
2326        return tarteaucitron.getElemAttr(elem, 'width') || elem.clientWidth;
2327    },
2328    "getElemHeight": function(elem) {
2329        return tarteaucitron.getElemAttr(elem, 'height') || elem.clientHeight;
2330    },
2331    "getElemAttr": function (elem, attr) {
2332        var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
2333
2334        if (typeof attribute === 'string') {
2335            return tarteaucitron.fixSelfXSS(attribute);
2336        }
2337
2338        return "";
2339    },
2340    "addClickEventToId": function (elemId, func) {
2341        tarteaucitron.addClickEventToElement(document.getElementById(elemId), func);
2342    },
2343    "addClickEventToElement": function (e, func) {
2344        if (e) {
2345            if (e.addEventListener) {
2346                e.addEventListener("click", func);
2347            } else {
2348                e.attachEvent("onclick", func);
2349            }
2350        }
2351    },
2352    "triggerJobsAfterAjaxCall": function() {
2353        tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) });
2354        var i;
2355        var allowBtns = document.getElementsByClassName("tarteaucitronAllow");
2356        for (i = 0; i < allowBtns.length; i++) {
2357            tarteaucitron.addClickEventToElement(allowBtns[i], function () {
2358                tarteaucitron.userInterface.respond(this, true);
2359            });
2360        }
2361        var denyBtns = document.getElementsByClassName("tarteaucitronDeny");
2362        for (i = 0; i < denyBtns.length; i++) {
2363            tarteaucitron.addClickEventToElement(denyBtns[i], function () {
2364                tarteaucitron.userInterface.respond(this, false);
2365            });
2366        }
2367    }
2368};

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.