@gouvfr/dsfr-roller 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/package.json +2 -2
  2. package/src/component/components/button.js +2 -2
  3. package/src/component/components/header.js +1 -1
  4. package/src/node/directive/{doc → components/accordion}/accordion-container-directive.js +4 -4
  5. package/src/node/directive/{doc → components/accordion}/accordions-group-container-directive.js +1 -1
  6. package/src/node/directive/{doc → components/button}/button-leaf-directive.js +3 -3
  7. package/src/node/directive/components/card/card-container-directive.js +114 -0
  8. package/src/node/directive/{doc → components/table}/table-container-directive.js +7 -7
  9. package/src/node/directive/{doc → components/tabs}/tab-container-directive.js +1 -1
  10. package/src/node/directive/{doc → components/tabs}/tabs-container-directive.js +1 -1
  11. package/src/node/directive/components/tile/tile-container-directive.js +135 -0
  12. package/src/node/directive/core/grid-container-directive.js +15 -0
  13. package/src/node/directive/doc/{anatomy-container-directive.js → guidance/anatomy-container-directive.js} +2 -2
  14. package/src/node/directive/doc/{guideline-container-directive.js → guidance/guideline-container-directive.js} +3 -3
  15. package/src/node/directive/doc/{guidelines-container-directive.js → guidance/guidelines-container-directive.js} +1 -1
  16. package/src/node/directive/doc/{pin-leaf-directive.js → guidance/pin-leaf-directive.js} +1 -1
  17. package/src/node/directive/doc/page-item-card-container-directive.js +53 -0
  18. package/src/node/directive/doc/page-item-list-leaf-directive.js +33 -0
  19. package/src/node/directive/doc/tab-navigation-container-directive.js +1 -1
  20. package/src/node/directive/doc/video-leaf-directive.js +44 -0
  21. package/src/node/directive/home/hp-analytics-container-directive.js +67 -0
  22. package/src/node/directive/home/hp-community-container-directive.js +78 -0
  23. package/src/node/directive/home/hp-community-tile-container-directive.js +57 -0
  24. package/src/node/directive/home/hp-discover-container-directive.js +41 -0
  25. package/src/node/directive/home/hp-discover-tile-container-directive.js +81 -0
  26. package/src/node/directive/home/hp-faq-container-directive.js +60 -0
  27. package/src/node/directive/home/hp-goals-container-directive.js +37 -0
  28. package/src/node/directive/home/hp-hero-container-directive.js +54 -0
  29. package/src/node/directive/home/hp-news-container-directive.js +53 -0
  30. package/src/node/directive/home/hp-showcase-card-container-directive.js +81 -0
  31. package/src/node/directive/home/hp-showcase-container-directive.js +55 -0
  32. package/src/node/directive/home/hp-slice-video-container-directive.js +246 -0
  33. package/src/node/generic/link-node.js +1 -1
  34. package/src/node/node-factory.js +45 -11
  35. package/src/page/head/head.js +3 -0
  36. package/src/page/head/resource.js +17 -0
  37. package/src/page/head/share.js +23 -5
  38. package/src/page/head/stylesheets.js +2 -1
  39. package/src/page/page.js +3 -1
  40. package/src/page/scripts/scripts.js +2 -1
  41. package/src/script/home/index.js +10 -0
  42. package/src/script/home/inject-svg.js +28 -0
  43. package/src/script/home/show-on-scroll.js +24 -0
  44. package/src/script/home/stop-video-on-close.js +20 -0
  45. package/src/script/main/cmp/index.js +72 -0
  46. package/src/script/main/cmp/tarteaucitron/config.js +34 -0
  47. package/src/script/main/cmp/tarteaucitron/lang.js +14 -0
  48. package/src/script/main/cmp/tarteaucitron/services.js +9142 -0
  49. package/src/script/main/cmp/tarteaucitron/tarteaucitron.js +3301 -0
  50. package/src/script/main/core/element.js +7 -3
  51. package/src/script/main/core/get-current-repo.js +6 -0
  52. package/src/script/main/core/get-query.js +12 -0
  53. package/src/script/main/core/replace-fragments.js +4 -0
  54. package/src/script/main/elements/pagination/index.js +23 -0
  55. package/src/script/main/elements/pagination/pagination-item.js +94 -0
  56. package/src/script/main/elements/pagination/pagination-list.js +131 -0
  57. package/src/script/main/elements/search-bar/index.js +64 -0
  58. package/src/script/main/elements/search-bar/results/result-item.js +13 -0
  59. package/src/script/main/elements/search-bar/results/results-button.js +20 -0
  60. package/src/script/main/elements/search-bar/results/results-dropdown.js +48 -0
  61. package/src/script/main/elements/search-bar/results/results-empty.js +21 -0
  62. package/src/script/main/elements/search-bar/results/results-list.js +19 -0
  63. package/src/script/main/index.js +11 -5
  64. package/src/script/main/minisearch/index.js +46 -0
  65. package/src/script/search/elements/result-card.js +46 -0
  66. package/src/script/search/elements/results-count.js +21 -0
  67. package/src/script/search/elements/results-empty.js +21 -0
  68. package/src/script/search/elements/results-list.js +25 -0
  69. package/src/script/search/elements/search-page.js +44 -0
  70. package/src/script/search/index.js +9 -0
  71. package/src/style/home/_analytics.scss +105 -0
  72. package/src/style/home/_community.scss +222 -0
  73. package/src/style/home/_discover.scss +208 -0
  74. package/src/style/home/_faq.scss +24 -0
  75. package/src/style/home/_goals.scss +53 -0
  76. package/src/style/home/_hero.scss +135 -0
  77. package/src/style/home/_news.scss +26 -0
  78. package/src/style/home/_showcase.scss +129 -0
  79. package/src/style/home/_slice-video.scss +168 -0
  80. package/src/style/home/index.scss +13 -0
  81. package/src/style/main/components/_dsfr-doc-pagination.scss +4 -0
  82. package/src/style/main/components/_dsfr-doc-searchbar.scss +54 -0
  83. package/src/style/main/components/_index.scss +3 -1
  84. package/src/style/search/_search-page.scss +0 -0
  85. package/src/style/search/index.scss +1 -0
  86. package/src/template/templates/home-template.js +4 -3
  87. package/src/template/templates/search-template.js +15 -8
  88. package/static/img/placeholder.16x9.png +0 -0
  89. package/src/script/main/elements/searchbar.js +0 -18
@@ -0,0 +1,3301 @@
1
+ /* eslint-disable */
2
+ var scripts = document.getElementsByTagName('script'),
3
+ path = (document.currentScript || scripts[scripts.length - 1]).src.split(
4
+ '?'
5
+ )[0],
6
+ tarteaucitronForceCDN =
7
+ tarteaucitronForceCDN === undefined ? '' : tarteaucitronForceCDN,
8
+ tarteaucitronUseMin =
9
+ tarteaucitronUseMin === undefined ? '' : tarteaucitronUseMin,
10
+ cdn =
11
+ tarteaucitronForceCDN === ''
12
+ ? path.split('/').slice(0, -1).join('/') + '/'
13
+ : tarteaucitronForceCDN,
14
+ alreadyLaunch = alreadyLaunch === undefined ? 0 : alreadyLaunch,
15
+ tarteaucitronForceLanguage =
16
+ tarteaucitronForceLanguage === undefined
17
+ ? ''
18
+ : tarteaucitronForceLanguage,
19
+ tarteaucitronForceExpire =
20
+ tarteaucitronForceExpire === undefined ? '' : tarteaucitronForceExpire,
21
+ tarteaucitronCustomText =
22
+ tarteaucitronCustomText === undefined ? '' : tarteaucitronCustomText,
23
+ // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value
24
+ tarteaucitronExpireInDay =
25
+ tarteaucitronExpireInDay === undefined ||
26
+ typeof tarteaucitronExpireInDay !== 'boolean'
27
+ ? true
28
+ : tarteaucitronExpireInDay,
29
+ timeExpire = 31536000000,
30
+ tarteaucitronProLoadServices,
31
+ tarteaucitronNoAdBlocker = false;
32
+
33
+ export var tarteaucitron = {
34
+ version: 20230203,
35
+ cdn: cdn,
36
+ user: {},
37
+ lang: {},
38
+ services: {},
39
+ added: [],
40
+ idprocessed: [],
41
+ state: {},
42
+ launch: [],
43
+ parameters: {},
44
+ isAjax: false,
45
+ reloadThePage: false,
46
+ events: {
47
+ init: function () {},
48
+ load: function () {},
49
+ },
50
+ init: function (params) {
51
+ 'use strict';
52
+ var origOpen;
53
+
54
+ tarteaucitron.parameters = params;
55
+ if (alreadyLaunch === 0) {
56
+ alreadyLaunch = 1;
57
+ if (window.addEventListener) {
58
+ window.addEventListener(
59
+ 'load',
60
+ function () {
61
+ tarteaucitron.initEvents.loadEvent(false);
62
+ },
63
+ false
64
+ );
65
+ window.addEventListener(
66
+ 'scroll',
67
+ function () {
68
+ tarteaucitron.initEvents.scrollEvent();
69
+ },
70
+ false
71
+ );
72
+
73
+ window.addEventListener(
74
+ 'keydown',
75
+ function (evt) {
76
+ tarteaucitron.initEvents.keydownEvent(false, evt);
77
+ },
78
+ false
79
+ );
80
+ window.addEventListener(
81
+ 'hashchange',
82
+ function () {
83
+ tarteaucitron.initEvents.hashchangeEvent();
84
+ },
85
+ false
86
+ );
87
+ window.addEventListener(
88
+ 'resize',
89
+ function () {
90
+ tarteaucitron.initEvents.resizeEvent();
91
+ },
92
+ false
93
+ );
94
+ } else {
95
+ window.attachEvent('onload', function () {
96
+ tarteaucitron.initEvents.loadEvent(true);
97
+ });
98
+ window.attachEvent('onscroll', function () {
99
+ tarteaucitron.initEvents.scrollEvent();
100
+ });
101
+ window.attachEvent('onkeydown', function (evt) {
102
+ tarteaucitron.initEvents.keydownEvent(true, evt);
103
+ });
104
+ window.attachEvent('onhashchange', function () {
105
+ tarteaucitron.initEvents.hashchangeEvent();
106
+ });
107
+ window.attachEvent('onresize', function () {
108
+ tarteaucitron.initEvents.resizeEvent();
109
+ });
110
+ }
111
+
112
+ if (typeof XMLHttpRequest !== 'undefined') {
113
+ origOpen = XMLHttpRequest.prototype.open;
114
+ XMLHttpRequest.prototype.open = function () {
115
+ if (window.addEventListener) {
116
+ this.addEventListener(
117
+ 'load',
118
+ function () {
119
+ if (
120
+ typeof tarteaucitronProLoadServices ===
121
+ 'function'
122
+ ) {
123
+ tarteaucitronProLoadServices();
124
+ }
125
+ },
126
+ false
127
+ );
128
+ } else if (typeof this.attachEvent !== 'undefined') {
129
+ this.attachEvent('onload', function () {
130
+ if (
131
+ typeof tarteaucitronProLoadServices ===
132
+ 'function'
133
+ ) {
134
+ tarteaucitronProLoadServices();
135
+ }
136
+ });
137
+ } else {
138
+ if (
139
+ typeof tarteaucitronProLoadServices === 'function'
140
+ ) {
141
+ setTimeout(tarteaucitronProLoadServices, 1000);
142
+ }
143
+ }
144
+
145
+ try {
146
+ origOpen.apply(this, arguments);
147
+ } catch (err) {}
148
+ };
149
+ }
150
+ }
151
+
152
+ if (tarteaucitron.events.init) {
153
+ tarteaucitron.events.init();
154
+ }
155
+ },
156
+ initEvents: {
157
+ loadEvent: function (isOldBrowser) {
158
+ tarteaucitron.load();
159
+ tarteaucitron.fallback(
160
+ ['tarteaucitronOpenPanel'],
161
+ function (elem) {
162
+ if (isOldBrowser) {
163
+ elem.attachEvent('onclick', function (event) {
164
+ tarteaucitron.userInterface.openPanel();
165
+ event.preventDefault();
166
+ });
167
+ } else {
168
+ elem.addEventListener(
169
+ 'click',
170
+ function (event) {
171
+ tarteaucitron.userInterface.openPanel();
172
+ event.preventDefault();
173
+ },
174
+ false
175
+ );
176
+ }
177
+ },
178
+ true
179
+ );
180
+ },
181
+ keydownEvent: function (isOldBrowser, evt) {
182
+ if (
183
+ document.querySelector('.tarteaucitron-modal-open') &&
184
+ evt.code === 'Escape'
185
+ ) {
186
+ tarteaucitron.userInterface.closePanel();
187
+ }
188
+
189
+ if (isOldBrowser) {
190
+ if (
191
+ evt.keyCode === 9 &&
192
+ focusableEls.indexOf(evt.target) >= 0
193
+ ) {
194
+ if (evt.shiftKey) {
195
+ /* shift + tab */ if (
196
+ document.activeElement === firstFocusableEl
197
+ ) {
198
+ lastFocusableEl.focus();
199
+ evt.preventDefault();
200
+ }
201
+ } /* tab */ else {
202
+ if (document.activeElement === lastFocusableEl) {
203
+ firstFocusableEl.focus();
204
+ evt.preventDefault();
205
+ }
206
+ }
207
+ }
208
+ }
209
+ },
210
+ hashchangeEvent: function () {
211
+ if (
212
+ document.location.hash === tarteaucitron.hashtag &&
213
+ tarteaucitron.hashtag !== ''
214
+ ) {
215
+ tarteaucitron.userInterface.openPanel();
216
+ }
217
+ },
218
+ resizeEvent: function () {
219
+ var tacElem = document.getElementById('tarteaucitron');
220
+ var tacCookieContainer = document.getElementById(
221
+ 'tarteaucitronCookiesListContainer'
222
+ );
223
+
224
+ if (tacElem && tacElem.style.display === 'block') {
225
+ tarteaucitron.userInterface.jsSizing('main');
226
+ }
227
+
228
+ if (
229
+ tacCookieContainer &&
230
+ tacCookieContainer.style.display === 'block'
231
+ ) {
232
+ tarteaucitron.userInterface.jsSizing('cookie');
233
+ }
234
+ },
235
+ scrollEvent: function () {
236
+ var scrollPos =
237
+ window.pageYOffset || document.documentElement.scrollTop;
238
+ var heightPosition;
239
+ var tacPercentage = document.getElementById(
240
+ 'tarteaucitronPercentage'
241
+ );
242
+ var tacAlertBig = document.getElementById('tarteaucitronAlertBig');
243
+
244
+ if (tacAlertBig && !tarteaucitron.highPrivacy) {
245
+ if (tacAlertBig.style.display === 'block') {
246
+ heightPosition = tacAlertBig.offsetHeight + 'px';
247
+
248
+ if (scrollPos > screen.height * 2) {
249
+ tarteaucitron.userInterface.respondAll(true);
250
+ } else if (scrollPos > screen.height / 2) {
251
+ document.getElementById(
252
+ 'tarteaucitronDisclaimerAlert'
253
+ ).innerHTML =
254
+ '<strong>' +
255
+ tarteaucitron.lang.alertBigScroll +
256
+ '</strong> ' +
257
+ tarteaucitron.lang.alertBig;
258
+ }
259
+
260
+ if (tacPercentage) {
261
+ if (tarteaucitron.orientation === 'top') {
262
+ tacPercentage.style.top = heightPosition;
263
+ } else {
264
+ tacPercentage.style.bottom = heightPosition;
265
+ }
266
+ tacPercentage.style.width =
267
+ (100 / (screen.height * 2)) * scrollPos + '%';
268
+ }
269
+ }
270
+ }
271
+ },
272
+ },
273
+ load: function () {
274
+ 'use strict';
275
+ var cdn = tarteaucitron.cdn,
276
+ language = tarteaucitron.getLanguage(),
277
+ useMinifiedJS =
278
+ cdn.indexOf('cdn.jsdelivr.net') >= 0 ||
279
+ path.indexOf('.min.') >= 0 ||
280
+ tarteaucitronUseMin !== '',
281
+ pathToLang =
282
+ cdn +
283
+ 'lang/tarteaucitron.' +
284
+ language +
285
+ (useMinifiedJS ? '.min' : '') +
286
+ '.js',
287
+ pathToServices =
288
+ cdn +
289
+ 'tarteaucitron.services' +
290
+ (useMinifiedJS ? '.min' : '') +
291
+ '.js',
292
+ linkElement = document.createElement('link'),
293
+ defaults = {
294
+ adblocker: false,
295
+ hashtag: '#tarteaucitron',
296
+ cookieName: 'tarteaucitron',
297
+ highPrivacy: true,
298
+ orientation: 'middle',
299
+ bodyPosition: 'bottom',
300
+ removeCredit: false,
301
+ showAlertSmall: false,
302
+ showDetailsOnClick: true,
303
+ showIcon: true,
304
+ iconPosition: 'BottomRight',
305
+ cookieslist: false,
306
+ handleBrowserDNTRequest: false,
307
+ DenyAllCta: true,
308
+ AcceptAllCta: true,
309
+ moreInfoLink: true,
310
+ privacyUrl: '',
311
+ useExternalCss: false,
312
+ useExternalJs: false,
313
+ mandatory: true,
314
+ mandatoryCta: true,
315
+ closePopup: false,
316
+ groupServices: false,
317
+ serviceDefaultState: 'wait',
318
+ },
319
+ params = tarteaucitron.parameters;
320
+
321
+ // Don't show the middle bar if we are on the privacy policy or more page
322
+ if (
323
+ ((tarteaucitron.parameters.readmoreLink !== undefined &&
324
+ window.location.href ==
325
+ tarteaucitron.parameters.readmoreLink) ||
326
+ window.location.href == tarteaucitron.parameters.privacyUrl) &&
327
+ tarteaucitron.parameters.orientation == 'middle'
328
+ ) {
329
+ tarteaucitron.parameters.orientation = 'bottom';
330
+ }
331
+
332
+ // Step -1
333
+ if (typeof tarteaucitronCustomPremium !== 'undefined') {
334
+ tarteaucitronCustomPremium();
335
+ }
336
+
337
+ // Step 0: get params
338
+ if (params !== undefined) {
339
+ for (var k in defaults) {
340
+ if (!tarteaucitron.parameters.hasOwnProperty(k)) {
341
+ tarteaucitron.parameters[k] = defaults[k];
342
+ }
343
+ }
344
+ }
345
+
346
+ // global
347
+ tarteaucitron.orientation = tarteaucitron.parameters.orientation;
348
+ tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
349
+ tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
350
+ tarteaucitron.handleBrowserDNTRequest =
351
+ tarteaucitron.parameters.handleBrowserDNTRequest;
352
+ tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId;
353
+
354
+ // Step 1: load css
355
+ if (!tarteaucitron.parameters.useExternalCss) {
356
+ linkElement.rel = 'stylesheet';
357
+ linkElement.type = 'text/css';
358
+ linkElement.href =
359
+ cdn +
360
+ 'css/tarteaucitron' +
361
+ (useMinifiedJS ? '.min' : '') +
362
+ '.css';
363
+ document.getElementsByTagName('head')[0].appendChild(linkElement);
364
+ }
365
+ // Step 2: load language and services
366
+ tarteaucitron.addInternalScript(pathToLang, '', function () {
367
+ if (tarteaucitronCustomText !== '') {
368
+ tarteaucitron.lang = tarteaucitron.AddOrUpdate(
369
+ tarteaucitron.lang,
370
+ tarteaucitronCustomText
371
+ );
372
+ }
373
+ tarteaucitron.addInternalScript(pathToServices, '', function () {
374
+ // disable the expand option if services grouped by category
375
+ if (tarteaucitron.parameters.groupServices == true) {
376
+ tarteaucitron.parameters.showDetailsOnClick = true;
377
+ }
378
+
379
+ var body = document.body,
380
+ div = document.createElement('div'),
381
+ html = '',
382
+ index,
383
+ orientation = 'Top',
384
+ modalAttrs = '',
385
+ cat = [
386
+ 'ads',
387
+ 'analytic',
388
+ 'api',
389
+ 'comment',
390
+ 'social',
391
+ 'support',
392
+ 'video',
393
+ 'other',
394
+ ],
395
+ i;
396
+
397
+ cat = cat.sort(function (a, b) {
398
+ if (
399
+ tarteaucitron.lang[a].title >
400
+ tarteaucitron.lang[b].title
401
+ ) {
402
+ return 1;
403
+ }
404
+ if (
405
+ tarteaucitron.lang[a].title <
406
+ tarteaucitron.lang[b].title
407
+ ) {
408
+ return -1;
409
+ }
410
+ return 0;
411
+ });
412
+
413
+ // Step 3: prepare the html
414
+ html += `
415
+ <div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden fr-hidden">
416
+ ${tarteaucitron.lang.title}
417
+ </div>
418
+ <div id="tarteaucitronPremium"></div>
419
+ <dialog id="consent-modal" class="fr-modal" role="dialog" aria-labelledby="fr-consent-modal-title">
420
+ <div id="tarteaucitronBack" aria-hidden="true" aria-controls="consent-modal"></div>
421
+ <div class="fr-container fr-container--fluid fr-container-md">
422
+ <div class="fr-grid-row fr-grid-row--center">
423
+ <div class="fr-col-12 fr-col-md-10 fr-col-lg-8">
424
+ <div class="fr-modal__body">
425
+ <div class="fr-modal__header">
426
+ <button type="button" id="tarteaucitronClosePanel" class="fr-btn--close fr-btn" aria-controls="consent-modal" title="${
427
+ tarteaucitron.lang.close +
428
+ (tarteaucitron.reloadThePage
429
+ ? ' (' +
430
+ tarteaucitron.lang
431
+ .reload +
432
+ ')'
433
+ : '')
434
+ }">
435
+ ${tarteaucitron.lang.close}
436
+ </button>
437
+ </div>
438
+ <div class="fr-modal__content">
439
+ <h3 class="fr-modal__title fr-h3" id="fr-consent-modal-title">
440
+ ${tarteaucitron.lang.title}
441
+ </h3>
442
+ <div class="fr-consent-manager">
443
+ <div class="fr-consent-service fr-consent-manager__header">
444
+ <fieldset class="fr-fieldset fr-fieldset--inline">
445
+ <legend id="finality-legend" class="fr-consent-service__title">
446
+ ${
447
+ tarteaucitron
448
+ .lang
449
+ .disclaimer
450
+ ? `<p class="fr-mb-0">${tarteaucitron.lang.disclaimer}</p>`
451
+ : ''
452
+ }
453
+ ${
454
+ tarteaucitron
455
+ .parameters
456
+ .privacyUrl !==
457
+ ''
458
+ ? `<a class="fr-link" id="tarteaucitronPrivacyUrlDialog" href="${tarteaucitron.parameters.privacyUrl}" title="${tarteaucitron.lang.privacyUrl} (${tarteaucitron.lang.newWindow})">${tarteaucitron.lang.privacyUrl}</a>`
459
+ : ''
460
+ }
461
+ ${
462
+ tarteaucitron
463
+ .lang
464
+ .all !== ''
465
+ ? `<p class="fr-mt-3w fr-mb-0">${tarteaucitron.lang.all}</p>`
466
+ : ''
467
+ }
468
+ </legend>
469
+ <div class="fr-consent-service__radios">
470
+ <div class="fr-radio-group">
471
+ <input type="radio" id="tarteaucitronAllAllowed" name="consent-all" class="tarteaucitronAllow">
472
+ <label class="fr-label" for="tarteaucitronAllAllowed">
473
+ ${
474
+ tarteaucitron
475
+ .lang
476
+ .allowAll
477
+ }
478
+ </label>
479
+ </div>
480
+ <div class="fr-radio-group">
481
+ <input type="radio" id="tarteaucitronAllDenied" name="consent-all" class="tarteaucitronDeny">
482
+ <label class="fr-label" for="tarteaucitronAllDenied">
483
+ ${
484
+ tarteaucitron
485
+ .lang
486
+ .denyAll
487
+ }
488
+ </label>
489
+ </div>
490
+ </div>
491
+ </fieldset>
492
+ </div>`;
493
+ if (tarteaucitron.parameters.mandatory == true) {
494
+ html += `
495
+ <div class="fr-consent-service">
496
+ <fieldset aria-labelledby="tarteaucitronServicesTitle_mandatory finality-mandatory-desc" role="group" class="fr-fieldset fr-fieldset--inline">
497
+ <legend id="tarteaucitronServicesTitle_mandatory" class="fr-consent-service__title">
498
+ ${tarteaucitron.lang.mandatoryTitle}
499
+ </legend>`;
500
+ if (tarteaucitron.parameters.mandatoryCta == true) {
501
+ html += `<div class="fr-consent-service__radios" id="tarteaucitronServices_mandatory">
502
+ <div class="fr-radio-group">
503
+ <input disabled checked type="radio" class="tarteaucitronAllow" id="consent-finality-mandatory-accept" name="consent-finality-mandatory">
504
+ <label class="fr-label" for="consent-finality-mandatory-accept">
505
+ ${tarteaucitron.lang.allow}
506
+ </label>
507
+ </div>
508
+ <div class="fr-radio-group">
509
+ <input disabled type="radio" class="tarteaucitronDeny" id="consent-finality-mandatory-refuse" name="consent-finality-mandatory">
510
+ <label class="fr-label" for="consent-finality-mandatory-refuse">
511
+ ${tarteaucitron.lang.deny}
512
+ </label>
513
+ </div>
514
+ </div>`;
515
+ }
516
+ html += `
517
+ <p id="finality-mandatory-desc" class="fr-consent-service__desc">${tarteaucitron.lang.mandatoryText}</p>
518
+ </fieldset>
519
+ </div>`;
520
+ }
521
+ for (i = 0; i < cat.length; i += 1) {
522
+ html += `
523
+ <div class="fr-consent-service tarteaucitronHidden fr-hidden" id="tarteaucitronServicesTitle_${
524
+ cat[i]
525
+ }">
526
+ <fieldset aria-labelledby="finality-${
527
+ cat[i]
528
+ }-legend finality-${
529
+ cat[i]
530
+ }-desc" role="group" class="fr-fieldset fr-fieldset--inline">
531
+ <legend id="finality-${
532
+ cat[i]
533
+ }-legend" class="fr-consent-service__title fr-h4 fr-pb-0">
534
+ ${
535
+ tarteaucitron
536
+ .parameters
537
+ .showDetailsOnClick
538
+ ? '<button aria-describedby="finality-' +
539
+ cat[i] +
540
+ '-decription" aria-controls="tarteaucitronDetails' +
541
+ cat[i] +
542
+ '" type="button" class="fr-btn catToggleBtn" aria-expanded="false" data-cat="tarteaucitronDetails' +
543
+ cat[i] +
544
+ '">' +
545
+ tarteaucitron
546
+ .lang[
547
+ cat[i]
548
+ ].title +
549
+ '</button>'
550
+ : tarteaucitron
551
+ .lang[
552
+ cat[i]
553
+ ].title
554
+ }
555
+ ${
556
+ !tarteaucitron
557
+ .parameters
558
+ .showDetailsOnClick &&
559
+ tarteaucitron
560
+ .lang[
561
+ cat[i]
562
+ ].details
563
+ ? `
564
+ <button class="fr-btn--tooltip fr-btn" aria-describedby="tooltip-modal-${
565
+ cat[i]
566
+ }" id="button-tooltip-${
567
+ cat[i]
568
+ }">
569
+ ${
570
+ tarteaucitron
571
+ .lang
572
+ .cookieDetail
573
+ }
574
+ </button>
575
+ <span class="fr-tooltip fr-placement fr-text--regular" id="tooltip-modal-${
576
+ cat[i]
577
+ }" role="tooltip">
578
+ ${
579
+ tarteaucitron
580
+ .lang[
581
+ cat[
582
+ i
583
+ ]
584
+ ]
585
+ .details
586
+ }
587
+ </span>`
588
+ : ''
589
+ }
590
+ </legend>`;
591
+ if (tarteaucitron.parameters.showDetailsOnClick) {
592
+ html += `
593
+ <div id="tarteaucitronDetails${
594
+ cat[i]
595
+ }" class="tarteaucitronDetails fr-collapse">
596
+ <p id="finality-${
597
+ cat[i]
598
+ }-desc" class="fr-consent-service__desc fr-mt-2w">
599
+ ${
600
+ tarteaucitron
601
+ .lang[
602
+ cat[i]
603
+ ].details
604
+ }
605
+ </p>
606
+ </div>
607
+ <div class="fr-consent-service__collapse fr-mt-1w">
608
+ <button class="fr-consent-service__collapse-btn" aria-expanded="false" aria-describedby="finality-${
609
+ cat[i]
610
+ }-legend" aria-controls="finality-${
611
+ cat[i]
612
+ }-collapse">${tarteaucitron.lang.cookieDetail}</button>
613
+ </div>`;
614
+ }
615
+ html += `
616
+ <div class="fr-mt-0 fr-consent-services${
617
+ tarteaucitron
618
+ .parameters
619
+ .showDetailsOnClick
620
+ ? ' fr-collapse'
621
+ : ''
622
+ }" id="finality-${
623
+ cat[i]
624
+ }-collapse">
625
+ <div id="tarteaucitronServices_${
626
+ cat[i]
627
+ }"></div>
628
+ </div>
629
+ </fieldset>
630
+ </div>`;
631
+ }
632
+ html += `
633
+ <div id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">
634
+ ${tarteaucitron.lang.noServices}
635
+ </div>
636
+ </div>
637
+ </div>`;
638
+
639
+ html += `
640
+ <div class="tarteaucitronHidden tarteaucitron-spacer-20" id="tarteaucitronScrollbarChild"></div>`;
641
+ if (tarteaucitron.parameters.removeCredit === false) {
642
+ 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>`;
643
+ }
644
+ html += `
645
+ </div>
646
+ </div>
647
+ </div>
648
+ </div>
649
+ </dialog>`;
650
+
651
+ if (tarteaucitron.parameters.orientation === 'bottom') {
652
+ orientation = 'Bottom';
653
+ }
654
+
655
+ if (
656
+ tarteaucitron.parameters.orientation === 'middle' ||
657
+ tarteaucitron.parameters.orientation === 'popup'
658
+ ) {
659
+ modalAttrs =
660
+ 'role="dialog" aria-modal="true" aria-labelledby="tac_title"';
661
+ }
662
+
663
+ // That condition does not respect the DSFR, as 3 buttons should always be visible.
664
+ if (
665
+ tarteaucitron.parameters.highPrivacy &&
666
+ !tarteaucitron.parameters.AcceptAllCta
667
+ ) {
668
+ html += `<div tabindex="-1" id="tarteaucitronAlertBig" class="fr-consent-banner" ${modalAttrs}>`;
669
+ html += `<h3 class="fr-h6">${tarteaucitron.lang.alertBigPrivacy.title}</h3>`;
670
+ html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${tarteaucitron.lang.alertBigPrivacy.content}</p></div>`;
671
+ html += `<ul class="fr-consent-banner__buttons fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-sm">`;
672
+ html += `<li><button class="fr-btn fr-btn--secondary" data-fr-opened="false" aria-controls="consent-modal" aria-label="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}" title="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}" type="button" id="tarteaucitronPersonalize">${tarteaucitron.lang.personalize}</button></li>`;
673
+ html += '</ul></div>';
674
+ } else {
675
+ html += `<div tabindex="-1" id="tarteaucitronAlertBig" class="fr-consent-banner" ${modalAttrs}>`;
676
+ html += `<h3 class="fr-h6">${tarteaucitron.lang.alertBigPrivacy.title}</h3>`;
677
+ html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${
678
+ tarteaucitron.parameters.highPrivacy
679
+ ? tarteaucitron.lang.alertBigPrivacy.content
680
+ : tarteaucitron.lang.alertBigClick +
681
+ tarteaucitron.lang.alertBig
682
+ }</p></div>`;
683
+ html += `<ul class="fr-consent-banner__buttons fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-sm">`;
684
+ html += `<li><button class="fr-btn tarteaucitronCTAButton tarteaucitronAllow" type="button" id="tarteaucitronPersonalize2" aria-label="${tarteaucitron.lang.acceptAll}" title="${tarteaucitron.lang.acceptAll}">${tarteaucitron.lang.acceptAll}</button></li>`;
685
+ if (tarteaucitron.parameters.DenyAllCta) {
686
+ const denyText = tarteaucitron.reloadThePage
687
+ ? `${tarteaucitron.lang.denyAll} (${tarteaucitron.lang.reload})`
688
+ : tarteaucitron.lang.denyAll;
689
+ html += `<li><button class="fr-btn tarteaucitronCTAButton tarteaucitronDeny" type="button" id="tarteaucitronAllDenied2" aria-label="${denyText}" title="${denyText}">${tarteaucitron.lang.denyAll}</button></li>`;
690
+ }
691
+
692
+ html += `<li><button class="fr-btn fr-btn--secondary" aria-label="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}" data-link="#tarteaucitron" aria-controls="consent-modal" type="button" id="tarteaucitronCloseAlert" data-fr-opened="false" title="${tarteaucitron.lang.personalize} ${tarteaucitron.lang.modalWindow}">
693
+ ${tarteaucitron.lang.personalize}
694
+ </button></li>`;
695
+ html += '</ul></div>';
696
+ html += '<div id="tarteaucitronPercentage"></div>';
697
+ }
698
+
699
+ if (tarteaucitron.parameters.showIcon === true) {
700
+ html +=
701
+ '<div id="tarteaucitronIcon" class="tarteaucitronIcon' +
702
+ tarteaucitron.parameters.iconPosition +
703
+ '" style="display: block">';
704
+ html +=
705
+ ' <button type="button" id="tarteaucitronManager" aria-label="' +
706
+ tarteaucitron.lang.icon +
707
+ ' ' +
708
+ tarteaucitron.lang.modalWindow +
709
+ '" title="' +
710
+ tarteaucitron.lang.icon +
711
+ ' ' +
712
+ tarteaucitron.lang.modalWindow +
713
+ '">';
714
+ html +=
715
+ ' <img src="' +
716
+ (tarteaucitron.parameters.iconSrc
717
+ ? tarteaucitron.parameters.iconSrc
718
+ : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/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') +
719
+ '" alt="' +
720
+ tarteaucitron.lang.icon +
721
+ ' ' +
722
+ tarteaucitron.lang.modalWindow +
723
+ '" title="' +
724
+ tarteaucitron.lang.icon +
725
+ ' ' +
726
+ tarteaucitron.lang.modalWindow +
727
+ '">';
728
+ html += ' </button>';
729
+ html += '</div>';
730
+ }
731
+
732
+ if (tarteaucitron.parameters.showAlertSmall === true) {
733
+ html +=
734
+ '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' +
735
+ orientation +
736
+ '">';
737
+ html +=
738
+ ' <button type="button" id="tarteaucitronManager" aria-label="' +
739
+ tarteaucitron.lang.alertSmall +
740
+ ' ' +
741
+ tarteaucitron.lang.modalWindow +
742
+ '" title="' +
743
+ tarteaucitron.lang.alertSmall +
744
+ ' ' +
745
+ tarteaucitron.lang.modalWindow +
746
+ '">';
747
+ html += ' ' + tarteaucitron.lang.alertSmall;
748
+ html += ' <span id="tarteaucitronDot">';
749
+ html +=
750
+ ' <span id="tarteaucitronDotGreen"></span>';
751
+ html +=
752
+ ' <span id="tarteaucitronDotYellow"></span>';
753
+ html += ' <span id="tarteaucitronDotRed"></span>';
754
+ html += ' </span>';
755
+ if (tarteaucitron.parameters.cookieslist === true) {
756
+ html += ' </button><!-- @whitespace';
757
+ html +=
758
+ ' --><button type="button" id="tarteaucitronCookiesNumber" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">0</button>';
759
+ html +=
760
+ ' <div id="tarteaucitronCookiesListContainer">';
761
+ if (tarteaucitron.reloadThePage) {
762
+ html +=
763
+ ' <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' +
764
+ tarteaucitron.lang.close +
765
+ ' (' +
766
+ tarteaucitron.lang.reload +
767
+ ')" title="' +
768
+ tarteaucitron.lang.close +
769
+ ' (' +
770
+ tarteaucitron.lang.reload +
771
+ ')">';
772
+ } else {
773
+ html +=
774
+ ' <button type="button" id="tarteaucitronClosePanelCookie">';
775
+ }
776
+ html += ' ' + tarteaucitron.lang.close;
777
+ html += ' </button>';
778
+ html +=
779
+ ' <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
780
+ html +=
781
+ ' <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
782
+ html += ' </div>';
783
+ html +=
784
+ ' <div id="tarteaucitronCookiesList"></div>';
785
+ html += ' </div>';
786
+ } else {
787
+ html += ' </div>';
788
+ }
789
+ html += '</div>';
790
+ }
791
+
792
+ tarteaucitron.addInternalScript(
793
+ tarteaucitron.cdn +
794
+ 'advertising' +
795
+ (useMinifiedJS ? '.min' : '') +
796
+ '.js',
797
+ '',
798
+ function () {
799
+ if (
800
+ tarteaucitronNoAdBlocker === true ||
801
+ tarteaucitron.parameters.adblocker === false
802
+ ) {
803
+ // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened
804
+ /*var wrapper = document.createElement('div');
805
+ wrapper.id = "tarteaucitronContentWrapper";
806
+
807
+ while (document.body.firstChild)
808
+ {
809
+ wrapper.appendChild(document.body.firstChild);
810
+ }
811
+
812
+ // Append the wrapper to the body
813
+ document.body.appendChild(wrapper);*/
814
+
815
+ div.id = 'tarteaucitronRoot';
816
+ if (
817
+ tarteaucitron.parameters.bodyPosition === 'top'
818
+ ) {
819
+ // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
820
+ var bodyFirstChild = body.firstChild;
821
+ body.insertBefore(div, bodyFirstChild);
822
+ } else {
823
+ // Append tarteaucitron: #tarteaucitronRoot last-child of the body
824
+ body.appendChild(div, body);
825
+ }
826
+
827
+ div.setAttribute('data-nosnippet', 'true');
828
+ div.setAttribute('lang', language);
829
+ div.setAttribute('role', 'region');
830
+ div.setAttribute('aria-labelledby', 'tac_title');
831
+
832
+ div.innerHTML = html;
833
+
834
+ //ie compatibility
835
+ var tacRootAvailableEvent;
836
+ if (typeof Event === 'function') {
837
+ tacRootAvailableEvent = new Event(
838
+ 'tac.root_available'
839
+ );
840
+ } else if (
841
+ typeof document.createEvent === 'function'
842
+ ) {
843
+ tacRootAvailableEvent =
844
+ document.createEvent('Event');
845
+ tacRootAvailableEvent.initEvent(
846
+ 'tac.root_available',
847
+ true,
848
+ true
849
+ );
850
+ }
851
+ //end ie compatibility
852
+
853
+ if (typeof window.dispatchEvent === 'function') {
854
+ window.dispatchEvent(tacRootAvailableEvent);
855
+ }
856
+
857
+ if (tarteaucitron.job !== undefined) {
858
+ tarteaucitron.job = tarteaucitron.cleanArray(
859
+ tarteaucitron.job
860
+ );
861
+ for (
862
+ index = 0;
863
+ index < tarteaucitron.job.length;
864
+ index += 1
865
+ ) {
866
+ tarteaucitron.addService(
867
+ tarteaucitron.job[index]
868
+ );
869
+ }
870
+ } else {
871
+ tarteaucitron.job = [];
872
+ }
873
+
874
+ if (tarteaucitron.job.length === 0) {
875
+ tarteaucitron.userInterface.closeAlert();
876
+ }
877
+
878
+ tarteaucitron.isAjax = true;
879
+
880
+ tarteaucitron.job.push = function (id) {
881
+ // ie <9 hack
882
+ if (
883
+ typeof tarteaucitron.job.indexOf ===
884
+ 'undefined'
885
+ ) {
886
+ tarteaucitron.job.indexOf = function (
887
+ obj,
888
+ start
889
+ ) {
890
+ var i,
891
+ j = this.length;
892
+ for (i = start || 0; i < j; i += 1) {
893
+ if (this[i] === obj) {
894
+ return i;
895
+ }
896
+ }
897
+ return -1;
898
+ };
899
+ }
900
+
901
+ if (tarteaucitron.job.indexOf(id) === -1) {
902
+ Array.prototype.push.call(this, id);
903
+ }
904
+ tarteaucitron.launch[id] = false;
905
+ tarteaucitron.addService(id);
906
+ };
907
+
908
+ if (
909
+ document.location.hash ===
910
+ tarteaucitron.hashtag &&
911
+ tarteaucitron.hashtag !== ''
912
+ ) {
913
+ tarteaucitron.userInterface.openPanel();
914
+ }
915
+
916
+ tarteaucitron.cookie.number();
917
+ setInterval(tarteaucitron.cookie.number, 60000);
918
+ }
919
+ },
920
+ tarteaucitron.parameters.adblocker
921
+ );
922
+
923
+ if (tarteaucitron.parameters.adblocker === true) {
924
+ setTimeout(function () {
925
+ // The setimeout at 1500 ms will prevent the location.reload event to be properly binded...
926
+ if (tarteaucitronNoAdBlocker === false) {
927
+ html = `<div id="tarteaucitronAlertBig" class="fr-consent-banner tarteaucitronAlertBig tarteaucitron-display-block" role="alert" aria-live="polite">`;
928
+ html += `<h3 class="fr-h6">${tarteaucitron.lang.adblock}</h3>`;
929
+ html += `<div id="tarteaucitronDisclaimerAlert" class="fr-consent-banner__content"><p class="fr-text--sm">${tarteaucitron.lang.adblock_call}</p></div>`;
930
+ html += `<ul class="fr-consent-banner__buttons fr-btns-group fr-btns-group--right fr-btns-group--inline-reverse fr-btns-group--inline-sm">`;
931
+ html += `<li><button class="fr-btn tarteaucitronCTAButton" aria-label="${tarteaucitron.lang.reload}" title="${tarteaucitron.lang.reload}" type="button" id="tarteaucitronCTAButton">${tarteaucitron.lang.reload}</button></li>`;
932
+ html += '</ul></div>';
933
+ html +=
934
+ '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' +
935
+ tarteaucitron.lang.title +
936
+ '</div>';
937
+ html += '<div id="tarteaucitronPremium"></div>';
938
+
939
+ div.id = 'tarteaucitronRoot';
940
+ if (
941
+ tarteaucitron.parameters.bodyPosition === 'top'
942
+ ) {
943
+ // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility
944
+ var bodyFirstChild = body.firstChild;
945
+ body.insertBefore(div, bodyFirstChild);
946
+ } else {
947
+ // Append tarteaucitron: #tarteaucitronRoot last-child of the body
948
+ body.appendChild(div, body);
949
+ }
950
+
951
+ div.setAttribute('data-nosnippet', 'true');
952
+ div.setAttribute('lang', language);
953
+ div.setAttribute('role', 'region');
954
+ div.setAttribute('aria-labelledby', 'tac_title');
955
+
956
+ div.innerHTML = html;
957
+ }
958
+ }, 1500);
959
+ }
960
+ if (tarteaucitron.parameters.closePopup === true) {
961
+ setTimeout(function () {
962
+ var closeElement = document.getElementById(
963
+ 'tarteaucitronAlertBig'
964
+ ),
965
+ closeSpan = document.createElement('span');
966
+ if (closeElement) {
967
+ closeSpan.textContent = 'X';
968
+ closeSpan.setAttribute(
969
+ 'id',
970
+ 'tarteaucitronCloseCross'
971
+ );
972
+ closeElement.insertBefore(
973
+ closeSpan,
974
+ closeElement.firstElementChild
975
+ );
976
+ }
977
+ }, 100);
978
+ }
979
+
980
+ if (tarteaucitron.parameters.groupServices === true) {
981
+ var tac_group_style = document.createElement('style');
982
+ tac_group_style.innerHTML =
983
+ '.tarteaucitronTitle{display:none}';
984
+ document.head.appendChild(tac_group_style);
985
+ var cats = document.querySelectorAll(
986
+ '[id^="tarteaucitronServicesTitle_"]'
987
+ );
988
+ Array.prototype.forEach.call(cats, function (item) {
989
+ var cat = item
990
+ .getAttribute('id')
991
+ .replace(/^(tarteaucitronServicesTitle_)/, '');
992
+ if (cat !== 'mandatory') {
993
+ var html = '';
994
+ html += '<li class="tarteaucitronLine">';
995
+ html += ' <div class="tarteaucitronName">';
996
+ html +=
997
+ ' <span class="tarteaucitronH3" role="heading" aria-level="2">' +
998
+ tarteaucitron.lang[cat].title +
999
+ '</span>';
1000
+ html +=
1001
+ ' <span>' +
1002
+ tarteaucitron.lang[cat].details +
1003
+ '</span>';
1004
+ html +=
1005
+ ' <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-' +
1006
+ cat +
1007
+ '">' +
1008
+ tarteaucitron.lang.alertSmall +
1009
+ ' (' +
1010
+ document.getElementById(
1011
+ 'tarteaucitronServices_' + cat
1012
+ ).childElementCount +
1013
+ ')</button>';
1014
+ html += ' </div>';
1015
+ html +=
1016
+ ' <div class="tarteaucitronAsk" id="tarteaucitron-group-' +
1017
+ cat +
1018
+ '">';
1019
+ html +=
1020
+ ' <button type="button" aria-label="' +
1021
+ tarteaucitron.lang.allow +
1022
+ ' ' +
1023
+ tarteaucitron.lang[cat].title +
1024
+ '" class="tarteaucitronAllow" id="tarteaucitron-accept-group-' +
1025
+ cat +
1026
+ '">';
1027
+ html +=
1028
+ ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' +
1029
+ tarteaucitron.lang.allow;
1030
+ html += ' </button> ';
1031
+ html +=
1032
+ ' <button type="button" aria-label="' +
1033
+ tarteaucitron.lang.deny +
1034
+ ' ' +
1035
+ tarteaucitron.lang[cat].title +
1036
+ '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-' +
1037
+ cat +
1038
+ '">';
1039
+ html +=
1040
+ ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' +
1041
+ tarteaucitron.lang.deny;
1042
+ html += ' </button>';
1043
+ html += ' </div>';
1044
+ html += '</li>';
1045
+ var ul = document.createElement('ul');
1046
+ ul.innerHTML = html;
1047
+ item.insertBefore(
1048
+ ul,
1049
+ item.querySelector(
1050
+ '#tarteaucitronServices_' + cat + ''
1051
+ )
1052
+ );
1053
+ document.querySelector(
1054
+ '#tarteaucitronServices_' + cat
1055
+ ).style.display = 'none';
1056
+ tarteaucitron.addClickEventToId(
1057
+ 'tarteaucitron-toggle-group-' + cat,
1058
+ function () {
1059
+ tarteaucitron.userInterface.toggle(
1060
+ 'tarteaucitronServices_' + cat
1061
+ );
1062
+ if (
1063
+ document.getElementById(
1064
+ 'tarteaucitronServices_' + cat
1065
+ ).style.display == 'block'
1066
+ ) {
1067
+ tarteaucitron.userInterface.addClass(
1068
+ 'tarteaucitronServicesTitle_' + cat,
1069
+ 'tarteaucitronIsExpanded'
1070
+ );
1071
+ document
1072
+ .getElementById(
1073
+ 'tarteaucitron-toggle-group-' +
1074
+ cat
1075
+ )
1076
+ .setAttribute(
1077
+ 'aria-expanded',
1078
+ 'true'
1079
+ );
1080
+ } else {
1081
+ tarteaucitron.userInterface.removeClass(
1082
+ 'tarteaucitronServicesTitle_' + cat,
1083
+ 'tarteaucitronIsExpanded'
1084
+ );
1085
+ document
1086
+ .getElementById(
1087
+ 'tarteaucitron-toggle-group-' +
1088
+ cat
1089
+ )
1090
+ .setAttribute(
1091
+ 'aria-expanded',
1092
+ 'false'
1093
+ );
1094
+ }
1095
+ //tarteaucitron.initEvents.resizeEvent();
1096
+ }
1097
+ );
1098
+ tarteaucitron.addClickEventToId(
1099
+ 'tarteaucitron-accept-group-' + cat,
1100
+ function () {
1101
+ tarteaucitron.userInterface.respondAll(
1102
+ true,
1103
+ cat
1104
+ );
1105
+ }
1106
+ );
1107
+ tarteaucitron.addClickEventToId(
1108
+ 'tarteaucitron-reject-group-' + cat,
1109
+ function () {
1110
+ tarteaucitron.userInterface.respondAll(
1111
+ false,
1112
+ cat
1113
+ );
1114
+ }
1115
+ );
1116
+ }
1117
+ });
1118
+ }
1119
+ tarteaucitron.userInterface.color('', true);
1120
+
1121
+ // add a little timeout to be sure everything is accessible
1122
+ setTimeout(function () {
1123
+ // Setup events
1124
+ tarteaucitron.addClickEventToId(
1125
+ 'tarteaucitronCloseCross',
1126
+ function () {
1127
+ tarteaucitron.userInterface.closeAlert();
1128
+ }
1129
+ );
1130
+ tarteaucitron.addClickEventToId(
1131
+ 'tarteaucitronPersonalize',
1132
+ function () {
1133
+ tarteaucitron.userInterface.openPanel();
1134
+ }
1135
+ );
1136
+ tarteaucitron.addClickEventToId(
1137
+ 'tarteaucitronPersonalize2',
1138
+ function () {
1139
+ tarteaucitron.userInterface.respondAll(true);
1140
+ }
1141
+ );
1142
+ tarteaucitron.addClickEventToId(
1143
+ 'tarteaucitronManager',
1144
+ function () {
1145
+ tarteaucitron.userInterface.openPanel();
1146
+ }
1147
+ );
1148
+ tarteaucitron.addClickEventToId(
1149
+ 'tarteaucitronBack',
1150
+ function () {
1151
+ tarteaucitron.userInterface.closePanel();
1152
+ }
1153
+ );
1154
+ tarteaucitron.addClickEventToId(
1155
+ 'tarteaucitronClosePanel',
1156
+ function () {
1157
+ tarteaucitron.userInterface.closePanel();
1158
+ }
1159
+ );
1160
+ tarteaucitron.addClickEventToId(
1161
+ 'tarteaucitronClosePanelCookie',
1162
+ function () {
1163
+ tarteaucitron.userInterface.closePanel();
1164
+ }
1165
+ );
1166
+ tarteaucitron.addClickEventToId(
1167
+ 'tarteaucitronPrivacyUrl',
1168
+ function () {
1169
+ document.location =
1170
+ tarteaucitron.parameters.privacyUrl;
1171
+ }
1172
+ );
1173
+ tarteaucitron.addClickEventToId(
1174
+ 'tarteaucitronPrivacyUrlDialog',
1175
+ function () {
1176
+ document.location =
1177
+ tarteaucitron.parameters.privacyUrl;
1178
+ }
1179
+ );
1180
+ tarteaucitron.addClickEventToId(
1181
+ 'tarteaucitronCookiesNumber',
1182
+ function () {
1183
+ tarteaucitron.userInterface.toggleCookiesList();
1184
+ }
1185
+ );
1186
+ tarteaucitron.addClickEventToId(
1187
+ 'tarteaucitronAllAllowed',
1188
+ function () {
1189
+ tarteaucitron.userInterface.respondAll(true);
1190
+ }
1191
+ );
1192
+ tarteaucitron.addClickEventToId(
1193
+ 'tarteaucitronAllDenied',
1194
+ function () {
1195
+ tarteaucitron.userInterface.respondAll(false);
1196
+ }
1197
+ );
1198
+ tarteaucitron.addClickEventToId(
1199
+ 'tarteaucitronAllDenied2',
1200
+ function () {
1201
+ tarteaucitron.userInterface.respondAll(
1202
+ false,
1203
+ '',
1204
+ true
1205
+ );
1206
+ if (tarteaucitron.reloadThePage === true) {
1207
+ window.location.reload();
1208
+ }
1209
+ }
1210
+ );
1211
+ tarteaucitron.addClickEventToId(
1212
+ 'tarteaucitronCloseAlert',
1213
+ function (e) {
1214
+ tarteaucitron.userInterface.addClass(
1215
+ e.currentTarget.id,
1216
+ 'focusA11yButton'
1217
+ );
1218
+ tarteaucitron.userInterface.openPanel();
1219
+ }
1220
+ );
1221
+ tarteaucitron.addClickEventToId(
1222
+ 'fr-nav-footer-legal-id-#tarteaucitron',
1223
+ function () {
1224
+ tarteaucitron.userInterface.openPanel();
1225
+ }
1226
+ );
1227
+ tarteaucitron.addClickEventToId(
1228
+ 'tarteaucitronCTAButton',
1229
+ function () {
1230
+ location.reload();
1231
+ }
1232
+ );
1233
+ var toggleBtns =
1234
+ document.getElementsByClassName('catToggleBtn'),
1235
+ i;
1236
+ for (i = 0; i < toggleBtns.length; i++) {
1237
+ toggleBtns[i].dataset.index = i;
1238
+ tarteaucitron.addClickEventToElement(
1239
+ toggleBtns[i],
1240
+ function () {
1241
+ if (
1242
+ !tarteaucitron.parameters.showDetailsOnClick
1243
+ )
1244
+ return false;
1245
+ tarteaucitron.userInterface.toggle(
1246
+ 'tarteaucitronDetails' +
1247
+ cat[this.dataset.index],
1248
+ 'tarteaucitronInfoBox'
1249
+ );
1250
+ if (
1251
+ document.getElementById(
1252
+ 'tarteaucitronDetails' +
1253
+ cat[this.dataset.index]
1254
+ ).style.display === 'block'
1255
+ ) {
1256
+ this.setAttribute('aria-expanded', 'true');
1257
+ } else {
1258
+ this.setAttribute('aria-expanded', 'false');
1259
+ }
1260
+ return false;
1261
+ }
1262
+ );
1263
+ }
1264
+
1265
+ // accessibility: on click on "Allow" in the site (not in TAC module), move focus to the loaded service's parent
1266
+ var allowBtnsInSite = document.querySelectorAll(
1267
+ '.tarteaucitronAllow:not(#tarteaucitronRoot .tarteaucitronAllow)'
1268
+ );
1269
+ for (i = 0; i < allowBtnsInSite.length; i++) {
1270
+ tarteaucitron.addClickEventToElement(
1271
+ allowBtnsInSite[i],
1272
+ function () {
1273
+ if (
1274
+ this.closest('.tac_activate') !== null &&
1275
+ this.closest('.tac_activate').parentNode !==
1276
+ null
1277
+ ) {
1278
+ this.closest(
1279
+ '.tac_activate'
1280
+ ).parentNode.setAttribute('tabindex', '-1');
1281
+ this.closest(
1282
+ '.tac_activate'
1283
+ ).parentNode.focus();
1284
+ }
1285
+ }
1286
+ );
1287
+ }
1288
+
1289
+ var allowBtns =
1290
+ document.getElementsByClassName('tarteaucitronAllow');
1291
+ for (i = 0; i < allowBtns.length; i++) {
1292
+ tarteaucitron.addClickEventToElement(
1293
+ allowBtns[i],
1294
+ function () {
1295
+ tarteaucitron.userInterface.respond(this, true);
1296
+ }
1297
+ );
1298
+ }
1299
+ var denyBtns =
1300
+ document.getElementsByClassName('tarteaucitronDeny');
1301
+ for (i = 0; i < denyBtns.length; i++) {
1302
+ tarteaucitron.addClickEventToElement(
1303
+ denyBtns[i],
1304
+ function () {
1305
+ tarteaucitron.userInterface.respond(
1306
+ this,
1307
+ false
1308
+ );
1309
+ }
1310
+ );
1311
+ }
1312
+ if (tarteaucitron.events.load) {
1313
+ tarteaucitron.events.load();
1314
+ }
1315
+ }, 500);
1316
+ });
1317
+ });
1318
+ },
1319
+ addService: function (serviceId) {
1320
+ 'use strict';
1321
+ var html = '',
1322
+ s = tarteaucitron.services,
1323
+ service = s[serviceId],
1324
+ cookie = tarteaucitron.cookie.read(),
1325
+ hostname = document.location.hostname,
1326
+ hostRef = document.referrer.split('/')[2],
1327
+ isNavigating =
1328
+ hostRef === hostname &&
1329
+ window.location.href !== tarteaucitron.parameters.privacyUrl,
1330
+ isAutostart = !service.needConsent,
1331
+ isWaiting = cookie.indexOf(service.key + '=wait') >= 0,
1332
+ isDenied = cookie.indexOf(service.key + '=false') >= 0,
1333
+ isAllowed =
1334
+ cookie.indexOf(service.key + '=true') >= 0 ||
1335
+ (!service.needConsent &&
1336
+ cookie.indexOf(service.key + '=false') < 0),
1337
+ isResponded =
1338
+ cookie.indexOf(service.key + '=false') >= 0 ||
1339
+ cookie.indexOf(service.key + '=true') >= 0,
1340
+ isDNTRequested =
1341
+ navigator.doNotTrack === '1' ||
1342
+ navigator.doNotTrack === 'yes' ||
1343
+ navigator.msDoNotTrack === '1' ||
1344
+ window.doNotTrack === '1',
1345
+ currentStatus = isAllowed
1346
+ ? tarteaucitron.lang.allowed
1347
+ : tarteaucitron.lang.disallowed,
1348
+ state =
1349
+ undefined !== service.defaultState
1350
+ ? service.defaultState
1351
+ : undefined !== tarteaucitron.parameters.serviceDefaultState
1352
+ ? tarteaucitron.parameters.serviceDefaultState
1353
+ : 'wait';
1354
+
1355
+ if (tarteaucitron.added[service.key] !== true) {
1356
+ tarteaucitron.added[service.key] = true;
1357
+
1358
+ html += `
1359
+ <div id="${service.key}Line" class="fr-consent-service fr-mt-2w tarteaucitronLine">
1360
+ <fieldset class="fr-fieldset fr-fieldset--inline">
1361
+ <legend id="finality-${service.key}-legend" class="fr-consent-service__title fr-pb-1v">
1362
+ ${service.name}
1363
+ </legend>
1364
+ <div>
1365
+ <p class="fr-mb-1v">
1366
+ <span class="tacCurrentStatus fr-hidden" id="tacCurrentStatus${service.key}">${currentStatus}</span>
1367
+ <span id="tacCL${service.key}" class="tarteaucitronListCookies"></span>
1368
+ </p>`;
1369
+ if (tarteaucitron.parameters.moreInfoLink == true) {
1370
+ let link =
1371
+ 'https://tarteaucitron.io/service/' + service.key + '/';
1372
+ if (
1373
+ service.readmoreLink !== undefined &&
1374
+ service.readmoreLink !== ''
1375
+ ) {
1376
+ link = service.readmoreLink;
1377
+ }
1378
+ if (
1379
+ tarteaucitron.parameters.readmoreLink !== undefined &&
1380
+ tarteaucitron.parameters.readmoreLink !== ''
1381
+ ) {
1382
+ link = tarteaucitron.parameters.readmoreLink;
1383
+ }
1384
+ html += `
1385
+ <p class="fr-mb-1w">
1386
+ <a href="${link}" target="_blank" rel="noreferrer noopener nofollow" title="${
1387
+ tarteaucitron.lang.more
1388
+ } : ${tarteaucitron.lang.cookieDetail.toLowerCase()} ${
1389
+ service.name
1390
+ } ${tarteaucitron.lang.ourSite} ${
1391
+ tarteaucitron.lang.newWindow
1392
+ }" class="tarteaucitronReadmoreInfo fr-link fr-text-default--grey" id="consent-link-private-${
1393
+ service.key
1394
+ }">
1395
+ ${tarteaucitron.lang.more}
1396
+ </a>
1397
+ <span class="tarteaucitronReadmoreSeparator fr-mx-1w"> - </span>
1398
+ <a href="${
1399
+ service.uri
1400
+ }" target="_blank" rel="noreferrer noopener" title="${
1401
+ tarteaucitron.lang.source
1402
+ } ${service.name} ${
1403
+ tarteaucitron.lang.newWindow
1404
+ }" class="tarteaucitronReadmoreOfficial fr-link fr-text-default--grey" id="consent-link-partner-${
1405
+ service.key
1406
+ }">
1407
+ ${tarteaucitron.lang.source}
1408
+ </a>
1409
+ </p>`;
1410
+ }
1411
+ html += `</div>
1412
+ <div class="fr-consent-service__radios fr-fieldset--inline">
1413
+ <div class="fr-radio-group">
1414
+ <input type="radio" id="${service.key}Allowed" class="tarteaucitronAllow" name="consent-${service.key}-radio" data-fr-analytics-action="false">
1415
+ <label for="${service.key}Allowed" class="fr-label">
1416
+ ${tarteaucitron.lang.allow}
1417
+ </label>
1418
+ </div>
1419
+ <div class="fr-radio-group">
1420
+ <input type="radio" id="${service.key}Denied" class="tarteaucitronDeny" name="consent-${service.key}-radio" data-fr-analytics-action="false">
1421
+ <label for="${service.key}Denied" class="fr-label">
1422
+ ${tarteaucitron.lang.deny}
1423
+ </label>
1424
+ </div>
1425
+ </div>
1426
+ </fieldset>
1427
+ </div>`;
1428
+
1429
+ tarteaucitron.userInterface.css(
1430
+ 'tarteaucitronServicesTitle_' + service.type,
1431
+ 'display',
1432
+ 'block'
1433
+ );
1434
+
1435
+ tarteaucitron.userInterface.removeClass(
1436
+ 'tarteaucitronServicesTitle_' + service.type,
1437
+ 'fr-hidden'
1438
+ );
1439
+
1440
+ if (
1441
+ document.getElementById(
1442
+ 'tarteaucitronServices_' + service.type
1443
+ ) !== null
1444
+ ) {
1445
+ document.getElementById(
1446
+ 'tarteaucitronServices_' + service.type
1447
+ ).innerHTML += html;
1448
+ }
1449
+
1450
+ tarteaucitron.userInterface.css(
1451
+ 'tarteaucitronNoServicesTitle',
1452
+ 'display',
1453
+ 'none'
1454
+ );
1455
+
1456
+ tarteaucitron.userInterface.order(service.type);
1457
+
1458
+ tarteaucitron.addClickEventToId(
1459
+ service.key + 'Allowed',
1460
+ function () {
1461
+ tarteaucitron.userInterface.respond(this, true);
1462
+ }
1463
+ );
1464
+
1465
+ tarteaucitron.addClickEventToId(
1466
+ service.key + 'Denied',
1467
+ function () {
1468
+ tarteaucitron.userInterface.respond(this, false);
1469
+ }
1470
+ );
1471
+ }
1472
+
1473
+ tarteaucitron.pro('!' + service.key + '=' + isAllowed);
1474
+
1475
+ // allow by default for non EU
1476
+ if (isResponded === false && tarteaucitron.user.bypass === true) {
1477
+ isAllowed = true;
1478
+ tarteaucitron.cookie.create(service.key, true);
1479
+ }
1480
+
1481
+ if (
1482
+ (!isResponded &&
1483
+ (isAutostart || (isNavigating && isWaiting)) &&
1484
+ !tarteaucitron.highPrivacy) ||
1485
+ isAllowed
1486
+ ) {
1487
+ if (
1488
+ !isAllowed ||
1489
+ (!service.needConsent &&
1490
+ cookie.indexOf(service.key + '=false') < 0)
1491
+ ) {
1492
+ tarteaucitron.cookie.create(service.key, true);
1493
+ }
1494
+ if (tarteaucitron.launch[service.key] !== true) {
1495
+ tarteaucitron.launch[service.key] = true;
1496
+ if (
1497
+ typeof tarteaucitronMagic === 'undefined' ||
1498
+ tarteaucitronMagic.indexOf('_' + service.key + '_') < 0
1499
+ ) {
1500
+ service.js();
1501
+ }
1502
+ tarteaucitron.sendEvent(service.key + '_loaded');
1503
+ }
1504
+ tarteaucitron.state[service.key] = true;
1505
+ tarteaucitron.userInterface.color(service.key, true);
1506
+ } else if (isDenied) {
1507
+ if (typeof service.fallback === 'function') {
1508
+ if (
1509
+ typeof tarteaucitronMagic === 'undefined' ||
1510
+ tarteaucitronMagic.indexOf('_' + service.key + '_') < 0
1511
+ ) {
1512
+ service.fallback();
1513
+ }
1514
+ }
1515
+ tarteaucitron.state[service.key] = false;
1516
+ tarteaucitron.userInterface.color(service.key, false);
1517
+ } else if (
1518
+ !isResponded &&
1519
+ isDNTRequested &&
1520
+ tarteaucitron.handleBrowserDNTRequest
1521
+ ) {
1522
+ tarteaucitron.cookie.create(service.key, 'false');
1523
+ if (typeof service.fallback === 'function') {
1524
+ if (
1525
+ typeof tarteaucitronMagic === 'undefined' ||
1526
+ tarteaucitronMagic.indexOf('_' + service.key + '_') < 0
1527
+ ) {
1528
+ service.fallback();
1529
+ }
1530
+ }
1531
+ tarteaucitron.state[service.key] = false;
1532
+ tarteaucitron.userInterface.color(service.key, false);
1533
+ } else if (!isResponded) {
1534
+ tarteaucitron.cookie.create(service.key, state);
1535
+ if (
1536
+ typeof tarteaucitronMagic === 'undefined' ||
1537
+ tarteaucitronMagic.indexOf('_' + service.key + '_') < 0
1538
+ ) {
1539
+ if (true === state && typeof service.js === 'function') {
1540
+ service.js();
1541
+ } else if (typeof service.fallback === 'function') {
1542
+ service.fallback();
1543
+ }
1544
+ }
1545
+
1546
+ tarteaucitron.userInterface.color(service.key, state);
1547
+
1548
+ if ('wait' === state) {
1549
+ tarteaucitron.userInterface.openAlert();
1550
+ }
1551
+ }
1552
+
1553
+ tarteaucitron.cookie.checkCount(service.key);
1554
+ tarteaucitron.sendEvent(service.key + '_added');
1555
+ },
1556
+ sendEvent: function (event_key) {
1557
+ if (event_key !== undefined) {
1558
+ //ie compatibility
1559
+ var send_event_item;
1560
+ if (typeof Event === 'function') {
1561
+ send_event_item = new Event(event_key);
1562
+ } else if (typeof document.createEvent === 'function') {
1563
+ send_event_item = document.createEvent('Event');
1564
+ send_event_item.initEvent(event_key, true, true);
1565
+ }
1566
+ //end ie compatibility
1567
+
1568
+ document.dispatchEvent(send_event_item);
1569
+ }
1570
+ },
1571
+ cleanArray: function cleanArray(arr) {
1572
+ 'use strict';
1573
+ var i,
1574
+ len = arr.length,
1575
+ out = [],
1576
+ obj = {},
1577
+ s = tarteaucitron.services;
1578
+
1579
+ for (i = 0; i < len; i += 1) {
1580
+ if (!obj[arr[i]]) {
1581
+ obj[arr[i]] = {};
1582
+ if (tarteaucitron.services[arr[i]] !== undefined) {
1583
+ out.push(arr[i]);
1584
+ }
1585
+ }
1586
+ }
1587
+
1588
+ out = out.sort(function (a, b) {
1589
+ if (s[a].type + s[a].key > s[b].type + s[b].key) {
1590
+ return 1;
1591
+ }
1592
+ if (s[a].type + s[a].key < s[b].type + s[b].key) {
1593
+ return -1;
1594
+ }
1595
+ return 0;
1596
+ });
1597
+
1598
+ return out;
1599
+ },
1600
+ userInterface: {
1601
+ css: function (id, property, value) {
1602
+ 'use strict';
1603
+ if (document.getElementById(id) !== null) {
1604
+ if (
1605
+ property == 'display' &&
1606
+ value == 'none' &&
1607
+ (id == 'tarteaucitron' ||
1608
+ id == 'tarteaucitronBack' ||
1609
+ id == 'tarteaucitronAlertBig')
1610
+ ) {
1611
+ document.getElementById(id).style['opacity'] = '0';
1612
+
1613
+ /*setTimeout(function() {*/ document.getElementById(
1614
+ id
1615
+ ).style[property] = value; /*}, 200);*/
1616
+ } else {
1617
+ document.getElementById(id).style[property] = value;
1618
+
1619
+ if (
1620
+ property == 'display' &&
1621
+ value == 'block' &&
1622
+ (id == 'tarteaucitron' || id == 'tarteaucitronAlertBig')
1623
+ ) {
1624
+ document.getElementById(id).style['opacity'] = '1';
1625
+ }
1626
+
1627
+ if (
1628
+ property == 'display' &&
1629
+ value == 'block' &&
1630
+ id == 'tarteaucitronBack'
1631
+ ) {
1632
+ document.getElementById(id).style['opacity'] = '0.7';
1633
+ document.getElementById(id).style['width'] = '100%';
1634
+ document.getElementById(id).style['height'] = '100%';
1635
+ document.getElementById(id).style['position'] = 'fixed';
1636
+ document.getElementById(id).style['top'] = '0';
1637
+ document.getElementById(id).style['left'] = '0';
1638
+ document.getElementById(id).style['backgroundColor'] =
1639
+ 'transparent';
1640
+ }
1641
+ }
1642
+ }
1643
+ },
1644
+ addClass: function (id, className) {
1645
+ 'use strict';
1646
+ if (
1647
+ document.getElementById(id) !== null &&
1648
+ document.getElementById(id).classList !== undefined
1649
+ ) {
1650
+ document.getElementById(id).classList.add(className);
1651
+ }
1652
+ },
1653
+ removeClass: function (id, className) {
1654
+ 'use strict';
1655
+ if (
1656
+ document.getElementById(id) !== null &&
1657
+ document.getElementById(id).classList !== undefined
1658
+ ) {
1659
+ document.getElementById(id).classList.remove(className);
1660
+ }
1661
+ },
1662
+ respondAll: function (status, type, allowSafeAnalytics) {
1663
+ 'use strict';
1664
+ var s = tarteaucitron.services,
1665
+ service,
1666
+ key,
1667
+ index = 0;
1668
+
1669
+ for (index = 0; index < tarteaucitron.job.length; index += 1) {
1670
+ if (
1671
+ typeof type !== 'undefined' &&
1672
+ type !== '' &&
1673
+ s[tarteaucitron.job[index]].type !== type
1674
+ ) {
1675
+ continue;
1676
+ }
1677
+
1678
+ if (
1679
+ allowSafeAnalytics &&
1680
+ typeof s[tarteaucitron.job[index]].safeanalytic !==
1681
+ 'undefined' &&
1682
+ s[tarteaucitron.job[index]].safeanalytic === true
1683
+ ) {
1684
+ continue;
1685
+ }
1686
+
1687
+ service = s[tarteaucitron.job[index]];
1688
+ key = service.key;
1689
+ if (tarteaucitron.state[key] !== status) {
1690
+ if (
1691
+ status === false &&
1692
+ tarteaucitron.launch[key] === true
1693
+ ) {
1694
+ tarteaucitron.reloadThePage = true;
1695
+ if (
1696
+ tarteaucitron.checkIfExist(
1697
+ 'tarteaucitronClosePanel'
1698
+ )
1699
+ ) {
1700
+ var ariaCloseValue =
1701
+ document
1702
+ .getElementById('tarteaucitronClosePanel')
1703
+ .textContent.trim() +
1704
+ ' (' +
1705
+ tarteaucitron.lang.reload +
1706
+ ')';
1707
+ document
1708
+ .getElementById('tarteaucitronClosePanel')
1709
+ .setAttribute('aria-label', ariaCloseValue);
1710
+ document
1711
+ .getElementById('tarteaucitronClosePanel')
1712
+ .setAttribute('title', ariaCloseValue);
1713
+ }
1714
+ }
1715
+ if (tarteaucitron.launch[key] !== true && status === true) {
1716
+ tarteaucitron.pro('!' + key + '=engage');
1717
+
1718
+ tarteaucitron.launch[key] = true;
1719
+ if (
1720
+ typeof tarteaucitronMagic === 'undefined' ||
1721
+ tarteaucitronMagic.indexOf('_' + key + '_') < 0
1722
+ ) {
1723
+ tarteaucitron.services[key].js();
1724
+ }
1725
+ tarteaucitron.sendEvent(key + '_loaded');
1726
+ }
1727
+ var itemStatusElem = document.getElementById(
1728
+ 'tacCurrentStatus' + key
1729
+ );
1730
+ tarteaucitron.state[key] = status;
1731
+ tarteaucitron.cookie.create(key, status);
1732
+ tarteaucitron.userInterface.color(key, status);
1733
+ if (status == true) {
1734
+ itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1735
+ tarteaucitron.sendEvent(key + '_allowed');
1736
+ } else {
1737
+ itemStatusElem.innerHTML =
1738
+ tarteaucitron.lang.disallowed;
1739
+ tarteaucitron.sendEvent(key + '_disallowed');
1740
+ }
1741
+ }
1742
+ }
1743
+ },
1744
+ respond: function (el, status) {
1745
+ 'use strict';
1746
+ if (el.id === '') {
1747
+ return;
1748
+ }
1749
+ var key = el.id.replace(
1750
+ new RegExp('(Eng[0-9]+|Allow|Deni)ed', 'g'),
1751
+ ''
1752
+ );
1753
+
1754
+ if (key.substring(0, 13) === 'tarteaucitron' || key === '') {
1755
+ return;
1756
+ }
1757
+
1758
+ // return if same state
1759
+ if (tarteaucitron.state[key] === status) {
1760
+ return;
1761
+ }
1762
+
1763
+ if (status === false && tarteaucitron.launch[key] === true) {
1764
+ tarteaucitron.reloadThePage = true;
1765
+ if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) {
1766
+ var ariaCloseValue =
1767
+ document
1768
+ .getElementById('tarteaucitronClosePanel')
1769
+ .textContent.trim() +
1770
+ ' (' +
1771
+ tarteaucitron.lang.reload +
1772
+ ')';
1773
+ document
1774
+ .getElementById('tarteaucitronClosePanel')
1775
+ .setAttribute('aria-label', ariaCloseValue);
1776
+ document
1777
+ .getElementById('tarteaucitronClosePanel')
1778
+ .setAttribute('title', ariaCloseValue);
1779
+ }
1780
+ }
1781
+
1782
+ // if not already launched... launch the service
1783
+ if (status === true) {
1784
+ if (tarteaucitron.launch[key] !== true) {
1785
+ tarteaucitron.pro('!' + key + '=engage');
1786
+
1787
+ tarteaucitron.launch[key] = true;
1788
+ if (
1789
+ typeof tarteaucitronMagic === 'undefined' ||
1790
+ tarteaucitronMagic.indexOf('_' + key + '_') < 0
1791
+ ) {
1792
+ tarteaucitron.services[key].js();
1793
+ }
1794
+ tarteaucitron.sendEvent(key + '_loaded');
1795
+ }
1796
+ }
1797
+ var itemStatusElem = document.getElementById(
1798
+ 'tacCurrentStatus' + key
1799
+ );
1800
+ tarteaucitron.state[key] = status;
1801
+ tarteaucitron.cookie.create(key, status);
1802
+ tarteaucitron.userInterface.color(key, status);
1803
+ if (status == true) {
1804
+ itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
1805
+ tarteaucitron.sendEvent(key + '_allowed');
1806
+ } else {
1807
+ itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
1808
+ tarteaucitron.sendEvent(key + '_disallowed');
1809
+ }
1810
+
1811
+ const allDecide = document.querySelector(
1812
+ '.tarteaucitronIsSelected'
1813
+ );
1814
+ if (allDecide) {
1815
+ allDecide.checked = true;
1816
+ } else {
1817
+ document
1818
+ .querySelectorAll(
1819
+ '#tarteaucitronAllAllowed, #tarteaucitronAllDenied'
1820
+ )
1821
+ .forEach((item) => {
1822
+ item.checked = false;
1823
+ item.setAttribute('aria-pressed', 'false');
1824
+ });
1825
+ }
1826
+ },
1827
+ color: function (key, status) {
1828
+ 'use strict';
1829
+ var c = 'tarteaucitron',
1830
+ nbDenied = 0,
1831
+ nbPending = 0,
1832
+ nbAllowed = 0,
1833
+ sum = tarteaucitron.job.length,
1834
+ index,
1835
+ s = tarteaucitron.services;
1836
+
1837
+ if (key !== '') {
1838
+ if (status === true) {
1839
+ tarteaucitron.userInterface.addClass(
1840
+ key + 'Line',
1841
+ 'tarteaucitronIsAllowed'
1842
+ );
1843
+ tarteaucitron.userInterface.removeClass(
1844
+ key + 'Line',
1845
+ 'tarteaucitronIsDenied'
1846
+ );
1847
+ document
1848
+ .getElementById(key + 'Denied')
1849
+ .removeAttribute('checked');
1850
+ document
1851
+ .getElementById(key + 'Allowed')
1852
+ .setAttribute('checked', 'true');
1853
+ } else if (status === false) {
1854
+ tarteaucitron.userInterface.removeClass(
1855
+ key + 'Line',
1856
+ 'tarteaucitronIsAllowed'
1857
+ );
1858
+ tarteaucitron.userInterface.addClass(
1859
+ key + 'Line',
1860
+ 'tarteaucitronIsDenied'
1861
+ );
1862
+ document
1863
+ .getElementById(key + 'Allowed')
1864
+ .removeAttribute('checked');
1865
+ document
1866
+ .getElementById(key + 'Denied')
1867
+ .setAttribute('checked', 'true');
1868
+ } else {
1869
+ document
1870
+ .getElementById(key + 'Allowed')
1871
+ .removeAttribute('checked');
1872
+ document
1873
+ .getElementById(key + 'Denied')
1874
+ .removeAttribute('checked');
1875
+ }
1876
+
1877
+ // check if all services are allowed
1878
+ var sumToRemove = 0;
1879
+ for (index = 0; index < sum; index += 1) {
1880
+ if (
1881
+ typeof s[tarteaucitron.job[index]].safeanalytic !==
1882
+ 'undefined' &&
1883
+ s[tarteaucitron.job[index]].safeanalytic === true
1884
+ ) {
1885
+ sumToRemove += 1;
1886
+ continue;
1887
+ }
1888
+
1889
+ if (
1890
+ tarteaucitron.state[tarteaucitron.job[index]] === false
1891
+ ) {
1892
+ nbDenied += 1;
1893
+ } else if (
1894
+ tarteaucitron.state[tarteaucitron.job[index]] ===
1895
+ undefined
1896
+ ) {
1897
+ nbPending += 1;
1898
+ } else if (
1899
+ tarteaucitron.state[tarteaucitron.job[index]] === true
1900
+ ) {
1901
+ nbAllowed += 1;
1902
+ }
1903
+ }
1904
+ sum -= sumToRemove;
1905
+
1906
+ tarteaucitron.userInterface.css(
1907
+ c + 'DotGreen',
1908
+ 'width',
1909
+ (100 / sum) * nbAllowed + '%'
1910
+ );
1911
+ tarteaucitron.userInterface.css(
1912
+ c + 'DotYellow',
1913
+ 'width',
1914
+ (100 / sum) * nbPending + '%'
1915
+ );
1916
+ tarteaucitron.userInterface.css(
1917
+ c + 'DotRed',
1918
+ 'width',
1919
+ (100 / sum) * nbDenied + '%'
1920
+ );
1921
+
1922
+ if (nbDenied === 0 && nbPending === 0) {
1923
+ tarteaucitron.userInterface.removeClass(
1924
+ c + 'AllDenied',
1925
+ c + 'IsSelected'
1926
+ );
1927
+ tarteaucitron.userInterface.addClass(
1928
+ c + 'AllAllowed',
1929
+ c + 'IsSelected'
1930
+ );
1931
+
1932
+ tarteaucitron.userInterface.addClass(
1933
+ c + 'MainLineOffset',
1934
+ c + 'IsAllowed'
1935
+ );
1936
+ tarteaucitron.userInterface.removeClass(
1937
+ c + 'MainLineOffset',
1938
+ c + 'IsDenied'
1939
+ );
1940
+
1941
+ document
1942
+ .getElementById(c + 'AllDenied')
1943
+ .removeAttribute('checked');
1944
+ document
1945
+ .getElementById(c + 'AllAllowed')
1946
+ .setAttribute('checked', 'true');
1947
+ } else if (nbAllowed === 0 && nbPending === 0) {
1948
+ tarteaucitron.userInterface.removeClass(
1949
+ c + 'AllAllowed',
1950
+ c + 'IsSelected'
1951
+ );
1952
+ tarteaucitron.userInterface.addClass(
1953
+ c + 'AllDenied',
1954
+ c + 'IsSelected'
1955
+ );
1956
+
1957
+ tarteaucitron.userInterface.removeClass(
1958
+ c + 'MainLineOffset',
1959
+ c + 'IsAllowed'
1960
+ );
1961
+ tarteaucitron.userInterface.addClass(
1962
+ c + 'MainLineOffset',
1963
+ c + 'IsDenied'
1964
+ );
1965
+
1966
+ document
1967
+ .getElementById(c + 'AllAllowed')
1968
+ .removeAttribute('checked');
1969
+ document
1970
+ .getElementById(c + 'AllDenied')
1971
+ .setAttribute('checked', 'true');
1972
+ } else {
1973
+ tarteaucitron.userInterface.removeClass(
1974
+ c + 'AllAllowed',
1975
+ c + 'IsSelected'
1976
+ );
1977
+ tarteaucitron.userInterface.removeClass(
1978
+ c + 'AllDenied',
1979
+ c + 'IsSelected'
1980
+ );
1981
+
1982
+ tarteaucitron.userInterface.removeClass(
1983
+ c + 'MainLineOffset',
1984
+ c + 'IsAllowed'
1985
+ );
1986
+ tarteaucitron.userInterface.removeClass(
1987
+ c + 'MainLineOffset',
1988
+ c + 'IsDenied'
1989
+ );
1990
+
1991
+ document
1992
+ .getElementById(c + 'AllAllowed')
1993
+ .removeAttribute('checked');
1994
+ document
1995
+ .getElementById(c + 'AllDenied')
1996
+ .removeAttribute('checked');
1997
+ }
1998
+
1999
+ // close the alert if all service have been reviewed
2000
+ if (nbPending === 0) {
2001
+ tarteaucitron.userInterface.closeAlert();
2002
+ }
2003
+
2004
+ if (
2005
+ tarteaucitron.services[key].cookies.length > 0 &&
2006
+ status === false
2007
+ ) {
2008
+ tarteaucitron.cookie.purge(
2009
+ tarteaucitron.services[key].cookies
2010
+ );
2011
+ }
2012
+
2013
+ if (status === true) {
2014
+ if (document.getElementById('tacCL' + key) !== null) {
2015
+ document.getElementById('tacCL' + key).innerHTML =
2016
+ '...';
2017
+ }
2018
+ setTimeout(function () {
2019
+ tarteaucitron.cookie.checkCount(key);
2020
+ }, 2500);
2021
+ } else {
2022
+ tarteaucitron.cookie.checkCount(key);
2023
+ }
2024
+ }
2025
+
2026
+ // groups
2027
+ var cats = document.querySelectorAll(
2028
+ '[id^="tarteaucitronServicesTitle_"]'
2029
+ );
2030
+ Array.prototype.forEach.call(cats, function (item) {
2031
+ var cat = item
2032
+ .getAttribute('id')
2033
+ .replace(/^(tarteaucitronServicesTitle_)/, ''),
2034
+ total = document.getElementById(
2035
+ 'tarteaucitronServices_' + cat
2036
+ ).childElementCount;
2037
+ var doc = document.getElementById(
2038
+ 'tarteaucitronServices_' + cat
2039
+ ),
2040
+ groupdenied = 0,
2041
+ groupallowed = 0;
2042
+ for (var ii = 0; ii < doc.children.length; ii++) {
2043
+ if (
2044
+ doc.children[ii].className ==
2045
+ 'tarteaucitronLine tarteaucitronIsDenied'
2046
+ ) {
2047
+ groupdenied++;
2048
+ }
2049
+ if (
2050
+ doc.children[ii].className ==
2051
+ 'tarteaucitronLine tarteaucitronIsAllowed'
2052
+ ) {
2053
+ groupallowed++;
2054
+ }
2055
+ }
2056
+ if (total === groupallowed) {
2057
+ tarteaucitron.userInterface.removeClass(
2058
+ 'tarteaucitron-group-' + cat,
2059
+ 'tarteaucitronIsDenied'
2060
+ );
2061
+ tarteaucitron.userInterface.addClass(
2062
+ 'tarteaucitron-group-' + cat,
2063
+ 'tarteaucitronIsAllowed'
2064
+ );
2065
+
2066
+ if (
2067
+ document.getElementById(
2068
+ 'tarteaucitron-reject-group-' + cat
2069
+ )
2070
+ ) {
2071
+ document
2072
+ .getElementById('tarteaucitron-reject-group-' + cat)
2073
+ .setAttribute('aria-pressed', 'false');
2074
+ document
2075
+ .getElementById('tarteaucitron-accept-group-' + cat)
2076
+ .setAttribute('aria-pressed', 'true');
2077
+ }
2078
+ }
2079
+ if (total === groupdenied) {
2080
+ tarteaucitron.userInterface.addClass(
2081
+ 'tarteaucitron-group-' + cat,
2082
+ 'tarteaucitronIsDenied'
2083
+ );
2084
+ tarteaucitron.userInterface.removeClass(
2085
+ 'tarteaucitron-group-' + cat,
2086
+ 'tarteaucitronIsAllowed'
2087
+ );
2088
+
2089
+ if (
2090
+ document.getElementById(
2091
+ 'tarteaucitron-reject-group-' + cat
2092
+ )
2093
+ ) {
2094
+ document
2095
+ .getElementById('tarteaucitron-reject-group-' + cat)
2096
+ .setAttribute('aria-pressed', 'true');
2097
+ document
2098
+ .getElementById('tarteaucitron-accept-group-' + cat)
2099
+ .setAttribute('aria-pressed', 'false');
2100
+ }
2101
+ }
2102
+ if (total !== groupdenied && total !== groupallowed) {
2103
+ tarteaucitron.userInterface.removeClass(
2104
+ 'tarteaucitron-group-' + cat,
2105
+ 'tarteaucitronIsDenied'
2106
+ );
2107
+ tarteaucitron.userInterface.removeClass(
2108
+ 'tarteaucitron-group-' + cat,
2109
+ 'tarteaucitronIsAllowed'
2110
+ );
2111
+
2112
+ if (
2113
+ document.getElementById(
2114
+ 'tarteaucitron-reject-group-' + cat
2115
+ )
2116
+ ) {
2117
+ document
2118
+ .getElementById('tarteaucitron-reject-group-' + cat)
2119
+ .setAttribute('aria-pressed', 'false');
2120
+ document
2121
+ .getElementById('tarteaucitron-accept-group-' + cat)
2122
+ .setAttribute('aria-pressed', 'false');
2123
+ }
2124
+ }
2125
+ groupdenied = 0;
2126
+ groupallowed = 0;
2127
+ });
2128
+ },
2129
+ openPanel: function () {
2130
+ 'use strict';
2131
+
2132
+ tarteaucitron.userInterface.css(
2133
+ 'tarteaucitronBack',
2134
+ 'display',
2135
+ 'block'
2136
+ );
2137
+ tarteaucitron.userInterface.css(
2138
+ 'tarteaucitronCookiesListContainer',
2139
+ 'display',
2140
+ 'none'
2141
+ );
2142
+ if (
2143
+ document.getElementsByTagName('body')[0].classList !== undefined
2144
+ ) {
2145
+ document
2146
+ .getElementsByTagName('body')[0]
2147
+ .classList.add('tarteaucitron-modal-open');
2148
+ }
2149
+ tarteaucitron.userInterface.jsSizing('main');
2150
+
2151
+ //ie compatibility
2152
+ var tacOpenPanelEvent;
2153
+ if (typeof Event === 'function') {
2154
+ tacOpenPanelEvent = new Event('tac.open_panel');
2155
+ } else if (typeof document.createEvent === 'function') {
2156
+ tacOpenPanelEvent = document.createEvent('Event');
2157
+ tacOpenPanelEvent.initEvent('tac.open_panel', true, true);
2158
+ }
2159
+ //end ie compatibility
2160
+
2161
+ if (typeof window.dispatchEvent === 'function') {
2162
+ window.dispatchEvent(tacOpenPanelEvent);
2163
+ }
2164
+ },
2165
+ closePanel: function () {
2166
+ 'use strict';
2167
+ if (document.location.hash === tarteaucitron.hashtag) {
2168
+ if (window.history) {
2169
+ window.history.replaceState(
2170
+ '',
2171
+ document.title,
2172
+ window.location.pathname + window.location.search
2173
+ );
2174
+ } else {
2175
+ document.location.hash = '';
2176
+ }
2177
+ }
2178
+ if (tarteaucitron.checkIfExist('tarteaucitron')) {
2179
+ // accessibility: manage focus on close panel
2180
+ if (!document.querySelector('.focusA11yButton')) {
2181
+ document
2182
+ .getElementById('fr-nav-footer-legal-id-#tarteaucitron')
2183
+ .focus();
2184
+ } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) {
2185
+ document.getElementById('tarteaucitronManager').focus();
2186
+ } else if (
2187
+ tarteaucitron.customCloserId &&
2188
+ tarteaucitron.checkIfExist(tarteaucitron.customCloserId)
2189
+ ) {
2190
+ document
2191
+ .getElementById(tarteaucitron.customCloserId)
2192
+ .focus();
2193
+ }
2194
+ tarteaucitron.userInterface.removeClass(
2195
+ 'tarteaucitronCloseAlert',
2196
+ 'focusA11yButton'
2197
+ );
2198
+ }
2199
+
2200
+ if (
2201
+ tarteaucitron.checkIfExist(
2202
+ 'tarteaucitronCookiesListContainer'
2203
+ ) &&
2204
+ tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')
2205
+ ) {
2206
+ // accessibility: manage focus on close cookies list
2207
+ document.getElementById('tarteaucitronCookiesNumber').focus();
2208
+ document
2209
+ .getElementById('tarteaucitronCookiesNumber')
2210
+ .setAttribute('aria-expanded', 'false');
2211
+ tarteaucitron.userInterface.css(
2212
+ 'tarteaucitronCookiesListContainer',
2213
+ 'display',
2214
+ 'none'
2215
+ );
2216
+ }
2217
+
2218
+ tarteaucitron.fallback(
2219
+ ['tarteaucitronInfoBox'],
2220
+ function (elem) {
2221
+ elem.style.display = 'none';
2222
+ },
2223
+ true
2224
+ );
2225
+
2226
+ if (tarteaucitron.reloadThePage === true) {
2227
+ window.location.reload();
2228
+ } else {
2229
+ tarteaucitron.userInterface.css(
2230
+ 'tarteaucitronBack',
2231
+ 'display',
2232
+ 'none'
2233
+ );
2234
+ }
2235
+ if (
2236
+ document.getElementsByTagName('body')[0].classList !== undefined
2237
+ ) {
2238
+ document
2239
+ .getElementsByTagName('body')[0]
2240
+ .classList.remove('tarteaucitron-modal-open');
2241
+ }
2242
+
2243
+ //ie compatibility
2244
+ var tacClosePanelEvent;
2245
+ if (typeof Event === 'function') {
2246
+ tacClosePanelEvent = new Event('tac.close_panel');
2247
+ } else if (typeof document.createEvent === 'function') {
2248
+ tacClosePanelEvent = document.createEvent('Event');
2249
+ tacClosePanelEvent.initEvent('tac.close_panel', true, true);
2250
+ }
2251
+ //end ie compatibility
2252
+
2253
+ if (typeof window.dispatchEvent === 'function') {
2254
+ window.dispatchEvent(tacClosePanelEvent);
2255
+ }
2256
+ },
2257
+ openAlert: function () {
2258
+ 'use strict';
2259
+ var c = 'tarteaucitron';
2260
+ tarteaucitron.userInterface.css(
2261
+ c + 'Percentage',
2262
+ 'display',
2263
+ 'block'
2264
+ );
2265
+ tarteaucitron.userInterface.css(
2266
+ c + 'AlertSmall',
2267
+ 'display',
2268
+ 'none'
2269
+ );
2270
+ tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none');
2271
+ tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block');
2272
+ tarteaucitron.userInterface.addClass(
2273
+ c + 'Root',
2274
+ 'tarteaucitronBeforeVisible'
2275
+ );
2276
+
2277
+ //ie compatibility
2278
+ var tacOpenAlertEvent;
2279
+ if (typeof Event === 'function') {
2280
+ tacOpenAlertEvent = new Event('tac.open_alert');
2281
+ } else if (typeof document.createEvent === 'function') {
2282
+ tacOpenAlertEvent = document.createEvent('Event');
2283
+ tacOpenAlertEvent.initEvent('tac.open_alert', true, true);
2284
+ }
2285
+ //end ie compatibility
2286
+
2287
+ if (
2288
+ document.getElementById('tarteaucitronAlertBig') !== null &&
2289
+ tarteaucitron.parameters.orientation === 'middle'
2290
+ ) {
2291
+ document.getElementById('tarteaucitronAlertBig').focus();
2292
+ }
2293
+
2294
+ if (typeof window.dispatchEvent === 'function') {
2295
+ window.dispatchEvent(tacOpenAlertEvent);
2296
+ }
2297
+ },
2298
+ closeAlert: function () {
2299
+ 'use strict';
2300
+ var c = 'tarteaucitron';
2301
+ tarteaucitron.userInterface.css(
2302
+ c + 'Percentage',
2303
+ 'display',
2304
+ 'none'
2305
+ );
2306
+ tarteaucitron.userInterface.css(
2307
+ c + 'AlertSmall',
2308
+ 'display',
2309
+ 'block'
2310
+ );
2311
+ tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block');
2312
+ tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none');
2313
+ tarteaucitron.userInterface.removeClass(
2314
+ c + 'Root',
2315
+ 'tarteaucitronBeforeVisible'
2316
+ );
2317
+ tarteaucitron.userInterface.jsSizing('box');
2318
+
2319
+ //ie compatibility
2320
+ var tacCloseAlertEvent;
2321
+ if (typeof Event === 'function') {
2322
+ tacCloseAlertEvent = new Event('tac.close_alert');
2323
+ } else if (typeof document.createEvent === 'function') {
2324
+ tacCloseAlertEvent = document.createEvent('Event');
2325
+ tacCloseAlertEvent.initEvent('tac.close_alert', true, true);
2326
+ }
2327
+ //end ie compatibility
2328
+
2329
+ if (typeof window.dispatchEvent === 'function') {
2330
+ window.dispatchEvent(tacCloseAlertEvent);
2331
+ }
2332
+ },
2333
+ toggleCookiesList: function () {
2334
+ 'use strict';
2335
+ var div = document.getElementById(
2336
+ 'tarteaucitronCookiesListContainer'
2337
+ ),
2338
+ togglediv = document.getElementById(
2339
+ 'tarteaucitronCookiesNumber'
2340
+ );
2341
+
2342
+ if (div === null) {
2343
+ return;
2344
+ }
2345
+
2346
+ if (div.style.display !== 'block') {
2347
+ tarteaucitron.cookie.number();
2348
+ div.style.display = 'block';
2349
+ togglediv.setAttribute('aria-expanded', 'true');
2350
+ tarteaucitron.userInterface.jsSizing('cookie');
2351
+ tarteaucitron.userInterface.css(
2352
+ 'tarteaucitron',
2353
+ 'display',
2354
+ 'none'
2355
+ );
2356
+ tarteaucitron.userInterface.css(
2357
+ 'tarteaucitronBack',
2358
+ 'display',
2359
+ 'block'
2360
+ );
2361
+ tarteaucitron.fallback(
2362
+ ['tarteaucitronInfoBox'],
2363
+ function (elem) {
2364
+ elem.style.display = 'none';
2365
+ },
2366
+ true
2367
+ );
2368
+ } else {
2369
+ div.style.display = 'none';
2370
+ togglediv.setAttribute('aria-expanded', 'false');
2371
+ tarteaucitron.userInterface.css(
2372
+ 'tarteaucitron',
2373
+ 'display',
2374
+ 'none'
2375
+ );
2376
+ tarteaucitron.userInterface.css(
2377
+ 'tarteaucitronBack',
2378
+ 'display',
2379
+ 'none'
2380
+ );
2381
+ }
2382
+ },
2383
+ toggle: function (id, closeClass) {
2384
+ 'use strict';
2385
+ var div = document.getElementById(id);
2386
+
2387
+ if (div === null) {
2388
+ return;
2389
+ }
2390
+
2391
+ if (closeClass !== undefined) {
2392
+ tarteaucitron.fallback(
2393
+ [closeClass],
2394
+ function (elem) {
2395
+ if (elem.id !== id) {
2396
+ elem.style.display = 'none';
2397
+ }
2398
+ },
2399
+ true
2400
+ );
2401
+ }
2402
+
2403
+ if (div.style.display !== 'block') {
2404
+ div.style.display = 'block';
2405
+ } else {
2406
+ div.style.display = 'none';
2407
+ }
2408
+ },
2409
+ order: function (id) {
2410
+ 'use strict';
2411
+ var main = document.getElementById('tarteaucitronServices_' + id),
2412
+ allDivs,
2413
+ store = [],
2414
+ i;
2415
+
2416
+ if (main === null) {
2417
+ return;
2418
+ }
2419
+
2420
+ allDivs = main.childNodes;
2421
+
2422
+ if (
2423
+ typeof Array.prototype.map === 'function' &&
2424
+ typeof Enumerable === 'undefined'
2425
+ ) {
2426
+ Array.prototype.map
2427
+ .call(main.children, Object)
2428
+ .sort(function (a, b) {
2429
+ //var mainChildren = Array.from(main.children);
2430
+ //mainChildren.sort(function (a, b) {
2431
+ if (
2432
+ tarteaucitron.services[a.id.replace(/Line/g, '')]
2433
+ .name >
2434
+ tarteaucitron.services[b.id.replace(/Line/g, '')]
2435
+ .name
2436
+ ) {
2437
+ return 1;
2438
+ }
2439
+ if (
2440
+ tarteaucitron.services[a.id.replace(/Line/g, '')]
2441
+ .name <
2442
+ tarteaucitron.services[b.id.replace(/Line/g, '')]
2443
+ .name
2444
+ ) {
2445
+ return -1;
2446
+ }
2447
+ return 0;
2448
+ })
2449
+ .forEach(function (element) {
2450
+ main.appendChild(element);
2451
+ });
2452
+ }
2453
+ },
2454
+ jsSizing: function (type) {
2455
+ 'use strict';
2456
+ var scrollbarMarginRight = 10,
2457
+ e = window,
2458
+ a = 'inner',
2459
+ cookiesListHeight,
2460
+ cookiesCloseHeight,
2461
+ cookiesTitleHeight,
2462
+ paddingBox,
2463
+ alertSmallHeight,
2464
+ cookiesNumberHeight;
2465
+
2466
+ if (type === 'box') {
2467
+ if (
2468
+ document.getElementById('tarteaucitronAlertSmall') !==
2469
+ null &&
2470
+ document.getElementById('tarteaucitronCookiesNumber') !==
2471
+ null
2472
+ ) {
2473
+ // reset
2474
+ tarteaucitron.userInterface.css(
2475
+ 'tarteaucitronCookiesNumber',
2476
+ 'padding',
2477
+ '0px 10px'
2478
+ );
2479
+
2480
+ // calculate
2481
+ alertSmallHeight = document.getElementById(
2482
+ 'tarteaucitronAlertSmall'
2483
+ ).offsetHeight;
2484
+ cookiesNumberHeight = document.getElementById(
2485
+ 'tarteaucitronCookiesNumber'
2486
+ ).offsetHeight;
2487
+ paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;
2488
+
2489
+ // apply
2490
+ tarteaucitron.userInterface.css(
2491
+ 'tarteaucitronCookiesNumber',
2492
+ 'padding',
2493
+ paddingBox + 'px 10px'
2494
+ );
2495
+ }
2496
+ } else if (type === 'main') {
2497
+ // get the real window width for media query
2498
+ if (window.innerWidth === undefined) {
2499
+ a = 'client';
2500
+ e = document.documentElement || document.body;
2501
+ }
2502
+
2503
+ // align the main allow/deny button depending on scrollbar width
2504
+ if (
2505
+ document.getElementById('tarteaucitronScrollbarChild') !==
2506
+ null
2507
+ ) {
2508
+ // media query
2509
+ if (e[a + 'Width'] <= 479) {
2510
+ //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
2511
+ } else if (e[a + 'Width'] <= 767) {
2512
+ scrollbarMarginRight = 12;
2513
+ }
2514
+ }
2515
+ } else if (type === 'cookie') {
2516
+ // put cookies list at bottom
2517
+ if (
2518
+ document.getElementById('tarteaucitronAlertSmall') !== null
2519
+ ) {
2520
+ tarteaucitron.userInterface.css(
2521
+ 'tarteaucitronCookiesListContainer',
2522
+ 'bottom',
2523
+ document.getElementById('tarteaucitronAlertSmall')
2524
+ .offsetHeight + 'px'
2525
+ );
2526
+ }
2527
+
2528
+ // height of cookies list
2529
+ if (
2530
+ document.getElementById(
2531
+ 'tarteaucitronCookiesListContainer'
2532
+ ) !== null
2533
+ ) {
2534
+ // reset
2535
+ tarteaucitron.userInterface.css(
2536
+ 'tarteaucitronCookiesList',
2537
+ 'height',
2538
+ 'auto'
2539
+ );
2540
+
2541
+ // calculate
2542
+ cookiesListHeight = document.getElementById(
2543
+ 'tarteaucitronCookiesListContainer'
2544
+ ).offsetHeight;
2545
+ cookiesCloseHeight = document.getElementById(
2546
+ 'tarteaucitronClosePanelCookie'
2547
+ ).offsetHeight;
2548
+ cookiesTitleHeight = document.getElementById(
2549
+ 'tarteaucitronCookiesTitle'
2550
+ ).offsetHeight;
2551
+
2552
+ // apply
2553
+ tarteaucitron.userInterface.css(
2554
+ 'tarteaucitronCookiesList',
2555
+ 'height',
2556
+ cookiesListHeight -
2557
+ cookiesCloseHeight -
2558
+ cookiesTitleHeight -
2559
+ 2 +
2560
+ 'px'
2561
+ );
2562
+ }
2563
+ }
2564
+ },
2565
+ },
2566
+ cookie: {
2567
+ owner: {},
2568
+ create: function (key, status) {
2569
+ 'use strict';
2570
+
2571
+ if (tarteaucitronForceExpire !== '') {
2572
+ // The number of day(s)/hour(s) can't be higher than 1 year
2573
+ if (
2574
+ (tarteaucitronExpireInDay &&
2575
+ tarteaucitronForceExpire < 365) ||
2576
+ (!tarteaucitronExpireInDay &&
2577
+ tarteaucitronForceExpire < 8760)
2578
+ ) {
2579
+ if (tarteaucitronExpireInDay) {
2580
+ // Multiplication to tranform the number of days to milliseconds
2581
+ timeExpire = tarteaucitronForceExpire * 86400000;
2582
+ } else {
2583
+ // Multiplication to tranform the number of hours to milliseconds
2584
+ timeExpire = tarteaucitronForceExpire * 3600000;
2585
+ }
2586
+ }
2587
+ }
2588
+
2589
+ var d = new Date(),
2590
+ time = d.getTime(),
2591
+ expireTime = time + timeExpire, // 365 days
2592
+ regex = new RegExp('!' + key + '=(wait|true|false)', 'g'),
2593
+ cookie = tarteaucitron.cookie.read().replace(regex, ''),
2594
+ value =
2595
+ tarteaucitron.parameters.cookieName +
2596
+ '=' +
2597
+ cookie +
2598
+ '!' +
2599
+ key +
2600
+ '=' +
2601
+ status,
2602
+ domain =
2603
+ tarteaucitron.parameters.cookieDomain !== undefined &&
2604
+ tarteaucitron.parameters.cookieDomain !== ''
2605
+ ? '; domain=' + tarteaucitron.parameters.cookieDomain
2606
+ : '',
2607
+ secure = location.protocol === 'https:' ? '; Secure' : '';
2608
+
2609
+ d.setTime(expireTime);
2610
+ document.cookie =
2611
+ value +
2612
+ '; expires=' +
2613
+ d.toGMTString() +
2614
+ '; path=/' +
2615
+ domain +
2616
+ secure +
2617
+ '; samesite=lax';
2618
+
2619
+ tarteaucitron.sendEvent('tac.consent_updated');
2620
+ },
2621
+ read: function () {
2622
+ 'use strict';
2623
+ var nameEQ = tarteaucitron.parameters.cookieName + '=',
2624
+ ca = document.cookie.split(';'),
2625
+ i,
2626
+ c;
2627
+
2628
+ for (i = 0; i < ca.length; i += 1) {
2629
+ c = ca[i];
2630
+ while (c.charAt(0) === ' ') {
2631
+ c = c.substring(1, c.length);
2632
+ }
2633
+ if (c.indexOf(nameEQ) === 0) {
2634
+ return c.substring(nameEQ.length, c.length);
2635
+ }
2636
+ }
2637
+ return '';
2638
+ },
2639
+ purge: function (arr) {
2640
+ 'use strict';
2641
+ var i;
2642
+
2643
+ for (i = 0; i < arr.length; i += 1) {
2644
+ var rgxpCookie = new RegExp(
2645
+ '^(.*;)?\\s*' + arr[i] + '\\s*=\\s*[^;]+(.*)?$'
2646
+ );
2647
+ if (document.cookie.match(rgxpCookie)) {
2648
+ document.cookie =
2649
+ arr[i] +
2650
+ '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
2651
+ document.cookie =
2652
+ arr[i] +
2653
+ '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' +
2654
+ location.hostname +
2655
+ ';';
2656
+ document.cookie =
2657
+ arr[i] +
2658
+ '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' +
2659
+ location.hostname.split('.').slice(-2).join('.') +
2660
+ ';';
2661
+ }
2662
+ }
2663
+ },
2664
+ checkCount: function (key) {
2665
+ 'use strict';
2666
+ var arr = tarteaucitron.services[key].cookies,
2667
+ nb = arr.length,
2668
+ nbCurrent = 0,
2669
+ html = '',
2670
+ i,
2671
+ status = document.cookie.indexOf(key + '=true');
2672
+
2673
+ if (status >= 0 && nb === 0) {
2674
+ html += tarteaucitron.lang.useNoCookie;
2675
+ } else if (status >= 0) {
2676
+ for (i = 0; i < nb; i += 1) {
2677
+ if (document.cookie.indexOf(arr[i] + '=') !== -1) {
2678
+ nbCurrent += 1;
2679
+ if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
2680
+ tarteaucitron.cookie.owner[arr[i]] = [];
2681
+ }
2682
+ if (
2683
+ tarteaucitron.cookie.crossIndexOf(
2684
+ tarteaucitron.cookie.owner[arr[i]],
2685
+ tarteaucitron.services[key].name
2686
+ ) === false
2687
+ ) {
2688
+ tarteaucitron.cookie.owner[arr[i]].push(
2689
+ tarteaucitron.services[key].name
2690
+ );
2691
+ }
2692
+ }
2693
+ }
2694
+
2695
+ if (nbCurrent > 0) {
2696
+ html +=
2697
+ tarteaucitron.lang.useCookieCurrent +
2698
+ ' ' +
2699
+ nbCurrent +
2700
+ ' cookie';
2701
+ if (nbCurrent > 1) {
2702
+ html += 's';
2703
+ }
2704
+ html += '.';
2705
+ } else {
2706
+ html += tarteaucitron.lang.useNoCookie;
2707
+ }
2708
+ } else if (nb === 0) {
2709
+ html = tarteaucitron.lang.noCookie;
2710
+ } else {
2711
+ html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
2712
+ if (nb > 1) {
2713
+ html += 's';
2714
+ }
2715
+ html += '.';
2716
+ }
2717
+
2718
+ if (document.getElementById('tacCL' + key) !== null) {
2719
+ document.getElementById('tacCL' + key).innerHTML = html;
2720
+ }
2721
+ },
2722
+ crossIndexOf: function (arr, match) {
2723
+ 'use strict';
2724
+ var i;
2725
+ for (i = 0; i < arr.length; i += 1) {
2726
+ if (arr[i] === match) {
2727
+ return true;
2728
+ }
2729
+ }
2730
+ return false;
2731
+ },
2732
+ number: function () {
2733
+ 'use strict';
2734
+ var cookies = document.cookie.split(';'),
2735
+ nb = document.cookie !== '' ? cookies.length : 0,
2736
+ html = '',
2737
+ i,
2738
+ name,
2739
+ namea,
2740
+ nameb,
2741
+ c,
2742
+ d,
2743
+ s = nb > 1 ? 's' : '',
2744
+ savedname,
2745
+ regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
2746
+ regexedDomain =
2747
+ tarteaucitron.cdn.match(regex) !== null
2748
+ ? tarteaucitron.cdn.match(regex)[1]
2749
+ : tarteaucitron.cdn,
2750
+ host =
2751
+ tarteaucitron.domain !== undefined
2752
+ ? tarteaucitron.domain
2753
+ : regexedDomain;
2754
+
2755
+ cookies = cookies.sort(function (a, b) {
2756
+ namea = a.split('=', 1).toString().replace(/ /g, '');
2757
+ nameb = b.split('=', 1).toString().replace(/ /g, '');
2758
+ c =
2759
+ tarteaucitron.cookie.owner[namea] !== undefined
2760
+ ? tarteaucitron.cookie.owner[namea]
2761
+ : '0';
2762
+ d =
2763
+ tarteaucitron.cookie.owner[nameb] !== undefined
2764
+ ? tarteaucitron.cookie.owner[nameb]
2765
+ : '0';
2766
+ if (c + a > d + b) {
2767
+ return 1;
2768
+ }
2769
+ if (c + a < d + b) {
2770
+ return -1;
2771
+ }
2772
+ return 0;
2773
+ });
2774
+
2775
+ if (document.cookie !== '') {
2776
+ for (i = 0; i < nb; i += 1) {
2777
+ name = cookies[i]
2778
+ .split('=', 1)
2779
+ .toString()
2780
+ .replace(/ /g, '');
2781
+ if (
2782
+ tarteaucitron.cookie.owner[name] !== undefined &&
2783
+ tarteaucitron.cookie.owner[name].join(' // ') !==
2784
+ savedname
2785
+ ) {
2786
+ savedname =
2787
+ tarteaucitron.cookie.owner[name].join(' // ');
2788
+ html += '<div class="tarteaucitronHidden">';
2789
+ html +=
2790
+ ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
2791
+ html +=
2792
+ ' ' +
2793
+ tarteaucitron.cookie.owner[name].join(' // ');
2794
+ html += ' </span>';
2795
+ html += '</div><ul class="cookie-list">';
2796
+ } else if (
2797
+ tarteaucitron.cookie.owner[name] === undefined &&
2798
+ host !== savedname
2799
+ ) {
2800
+ savedname = host;
2801
+ html += '<div class="tarteaucitronHidden">';
2802
+ html +=
2803
+ ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">';
2804
+ html += ' ' + host;
2805
+ html += ' </span>';
2806
+ html += '</div><ul class="cookie-list">';
2807
+ }
2808
+ html += '<li class="tarteaucitronCookiesListMain">';
2809
+ html +=
2810
+ ' <div class="tarteaucitronCookiesListLeft"><button type="button" class="purgeBtn" data-cookie="' +
2811
+ tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) +
2812
+ '"><strong>&times;</strong></button> <strong>' +
2813
+ tarteaucitron.fixSelfXSS(name) +
2814
+ '</strong>';
2815
+ html += ' </div>';
2816
+ html +=
2817
+ ' <div class="tarteaucitronCookiesListRight">' +
2818
+ tarteaucitron.fixSelfXSS(
2819
+ cookies[i].split('=').slice(1).join('=')
2820
+ ) +
2821
+ '</div>';
2822
+ html += '</li>';
2823
+ }
2824
+ html += '</ul>';
2825
+ } else {
2826
+ html += '<div class="tarteaucitronCookiesListMain">';
2827
+ html +=
2828
+ ' <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
2829
+ html += ' <div class="tarteaucitronCookiesListRight"></div>';
2830
+ html += '</div>';
2831
+ }
2832
+
2833
+ html +=
2834
+ '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>';
2835
+
2836
+ if (document.getElementById('tarteaucitronCookiesList') !== null) {
2837
+ document.getElementById('tarteaucitronCookiesList').innerHTML =
2838
+ html;
2839
+ }
2840
+
2841
+ if (
2842
+ document.getElementById('tarteaucitronCookiesNumber') !== null
2843
+ ) {
2844
+ document.getElementById(
2845
+ 'tarteaucitronCookiesNumber'
2846
+ ).innerHTML = nb;
2847
+ document
2848
+ .getElementById('tarteaucitronCookiesNumber')
2849
+ .setAttribute(
2850
+ 'aria-label',
2851
+ nb +
2852
+ ' cookie' +
2853
+ s +
2854
+ ' - ' +
2855
+ tarteaucitron.lang.toggleInfoBox
2856
+ );
2857
+ document
2858
+ .getElementById('tarteaucitronCookiesNumber')
2859
+ .setAttribute(
2860
+ 'title',
2861
+ nb +
2862
+ ' cookie' +
2863
+ s +
2864
+ ' - ' +
2865
+ tarteaucitron.lang.toggleInfoBox
2866
+ );
2867
+ }
2868
+
2869
+ if (
2870
+ document.getElementById('tarteaucitronCookiesNumberBis') !==
2871
+ null
2872
+ ) {
2873
+ document.getElementById(
2874
+ 'tarteaucitronCookiesNumberBis'
2875
+ ).innerHTML = nb + ' cookie' + s;
2876
+ }
2877
+
2878
+ var purgeBtns = document.getElementsByClassName('purgeBtn');
2879
+ for (i = 0; i < purgeBtns.length; i++) {
2880
+ tarteaucitron.addClickEventToElement(purgeBtns[i], function () {
2881
+ tarteaucitron.cookie.purge([this.dataset.cookie]);
2882
+ tarteaucitron.cookie.number();
2883
+ tarteaucitron.userInterface.jsSizing('cookie');
2884
+ return false;
2885
+ });
2886
+ }
2887
+
2888
+ for (i = 0; i < tarteaucitron.job.length; i += 1) {
2889
+ tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
2890
+ }
2891
+ },
2892
+ },
2893
+ fixSelfXSS: function (html) {
2894
+ return html
2895
+ .toString()
2896
+ .replace(/&/g, '&amp;')
2897
+ .replace(/</g, '&lt;')
2898
+ .replace(/>/g, '&gt;')
2899
+ .replace(/"/g, '&quot;')
2900
+ .replace(/'/g, '&#039;');
2901
+ },
2902
+ getLanguage: function () {
2903
+ 'use strict';
2904
+
2905
+ var availableLanguages =
2906
+ 'ar,bg,ca,cn,cs,da,de,et,el,en,es,fi,fr,hu,it,ja,lb,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,uk,vi,zh',
2907
+ defaultLanguage = 'en';
2908
+
2909
+ if (tarteaucitronForceLanguage !== '') {
2910
+ if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
2911
+ return tarteaucitronForceLanguage;
2912
+ }
2913
+ }
2914
+
2915
+ // get the html lang
2916
+ if (
2917
+ availableLanguages.indexOf(
2918
+ document.documentElement.getAttribute('lang').substr(0, 2)
2919
+ ) !== -1
2920
+ ) {
2921
+ return document.documentElement.getAttribute('lang').substr(0, 2);
2922
+ }
2923
+
2924
+ if (!navigator) {
2925
+ return defaultLanguage;
2926
+ }
2927
+
2928
+ var lang =
2929
+ navigator.language ||
2930
+ navigator.browserLanguage ||
2931
+ navigator.systemLanguage ||
2932
+ navigator.userLang ||
2933
+ null,
2934
+ userLanguage = lang ? lang.substr(0, 2) : null;
2935
+
2936
+ if (availableLanguages.indexOf(userLanguage) !== -1) {
2937
+ return userLanguage;
2938
+ }
2939
+
2940
+ return defaultLanguage;
2941
+ },
2942
+ getLocale: function () {
2943
+ 'use strict';
2944
+ if (!navigator) {
2945
+ return 'en_US';
2946
+ }
2947
+
2948
+ var lang =
2949
+ navigator.language ||
2950
+ navigator.browserLanguage ||
2951
+ navigator.systemLanguage ||
2952
+ navigator.userLang ||
2953
+ null,
2954
+ userLanguage = lang ? lang.substr(0, 2) : null;
2955
+
2956
+ if (userLanguage === 'fr') {
2957
+ return 'fr_FR';
2958
+ } else if (userLanguage === 'en') {
2959
+ return 'en_US';
2960
+ } else if (userLanguage === 'de') {
2961
+ return 'de_DE';
2962
+ } else if (userLanguage === 'es') {
2963
+ return 'es_ES';
2964
+ } else if (userLanguage === 'it') {
2965
+ return 'it_IT';
2966
+ } else if (userLanguage === 'pt') {
2967
+ return 'pt_PT';
2968
+ } else if (userLanguage === 'nl') {
2969
+ return 'nl_NL';
2970
+ } else if (userLanguage === 'el') {
2971
+ return 'el_EL';
2972
+ } else {
2973
+ return 'en_US';
2974
+ }
2975
+ },
2976
+ addScript: function (
2977
+ url,
2978
+ id,
2979
+ callback,
2980
+ execute,
2981
+ attrName,
2982
+ attrVal,
2983
+ internal
2984
+ ) {
2985
+ 'use strict';
2986
+ var script,
2987
+ done = false;
2988
+
2989
+ if (execute === false) {
2990
+ if (typeof callback === 'function') {
2991
+ callback();
2992
+ }
2993
+ } else {
2994
+ script = document.createElement('script');
2995
+ if (id !== undefined) {
2996
+ script.id = id;
2997
+ }
2998
+ script.async = true;
2999
+ script.src = url;
3000
+
3001
+ if (attrName !== undefined && attrVal !== undefined) {
3002
+ script.setAttribute(attrName, attrVal);
3003
+ }
3004
+
3005
+ if (typeof callback === 'function') {
3006
+ if (!tarteaucitron.parameters.useExternalJs || !internal) {
3007
+ script.onreadystatechange = script.onload = function () {
3008
+ var state = script.readyState;
3009
+ if (
3010
+ !done &&
3011
+ (!state || /loaded|complete/.test(state))
3012
+ ) {
3013
+ done = true;
3014
+ callback();
3015
+ }
3016
+ };
3017
+ } else {
3018
+ callback();
3019
+ }
3020
+ }
3021
+
3022
+ if (!tarteaucitron.parameters.useExternalJs || !internal) {
3023
+ document.getElementsByTagName('head')[0].appendChild(script);
3024
+ }
3025
+ }
3026
+ },
3027
+ addInternalScript: function (
3028
+ url,
3029
+ id,
3030
+ callback,
3031
+ execute,
3032
+ attrName,
3033
+ attrVal
3034
+ ) {
3035
+ tarteaucitron.addScript(
3036
+ url,
3037
+ id,
3038
+ callback,
3039
+ execute,
3040
+ attrName,
3041
+ attrVal,
3042
+ true
3043
+ );
3044
+ },
3045
+ checkIfExist: function (elemId) {
3046
+ 'use strict';
3047
+ return (
3048
+ document.getElementById(elemId) !== null &&
3049
+ document.getElementById(elemId).offsetWidth !== 0 &&
3050
+ document.getElementById(elemId).offsetHeight !== 0
3051
+ );
3052
+ },
3053
+ makeAsync: {
3054
+ antiGhost: 0,
3055
+ buffer: '',
3056
+ init: function (url, id) {
3057
+ 'use strict';
3058
+ var savedWrite = document.write,
3059
+ savedWriteln = document.writeln;
3060
+
3061
+ document.write = function (content) {
3062
+ tarteaucitron.makeAsync.buffer += content;
3063
+ };
3064
+ document.writeln = function (content) {
3065
+ tarteaucitron.makeAsync.buffer += content.concat('\n');
3066
+ };
3067
+
3068
+ setTimeout(function () {
3069
+ document.write = savedWrite;
3070
+ document.writeln = savedWriteln;
3071
+ }, 20000);
3072
+
3073
+ tarteaucitron.makeAsync.getAndParse(url, id);
3074
+ },
3075
+ getAndParse: function (url, id) {
3076
+ 'use strict';
3077
+ if (tarteaucitron.makeAsync.antiGhost > 9) {
3078
+ tarteaucitron.makeAsync.antiGhost = 0;
3079
+ return;
3080
+ }
3081
+ tarteaucitron.makeAsync.antiGhost += 1;
3082
+ tarteaucitron.addInternalScript(url, '', function () {
3083
+ if (document.getElementById(id) !== null) {
3084
+ document.getElementById(id).innerHTML +=
3085
+ "<span class='tarteaucitron-display-none'>&nbsp;</span>" +
3086
+ tarteaucitron.makeAsync.buffer;
3087
+ tarteaucitron.makeAsync.buffer = '';
3088
+ tarteaucitron.makeAsync.execJS(id);
3089
+ }
3090
+ });
3091
+ },
3092
+ execJS: function (id) {
3093
+ /* not strict because third party scripts may have errors */
3094
+ var i, scripts, childId, type;
3095
+
3096
+ if (document.getElementById(id) === null) {
3097
+ return;
3098
+ }
3099
+
3100
+ scripts = document
3101
+ .getElementById(id)
3102
+ .getElementsByTagName('script');
3103
+ for (i = 0; i < scripts.length; i += 1) {
3104
+ type =
3105
+ scripts[i].getAttribute('type') !== null
3106
+ ? scripts[i].getAttribute('type')
3107
+ : '';
3108
+ if (type === '') {
3109
+ type =
3110
+ scripts[i].getAttribute('language') !== null
3111
+ ? scripts[i].getAttribute('language')
3112
+ : '';
3113
+ }
3114
+ if (
3115
+ scripts[i].getAttribute('src') !== null &&
3116
+ scripts[i].getAttribute('src') !== ''
3117
+ ) {
3118
+ childId = id + Math.floor(Math.random() * 99999999999);
3119
+ document.getElementById(id).innerHTML +=
3120
+ '<div id="' + childId + '"></div>';
3121
+ tarteaucitron.makeAsync.getAndParse(
3122
+ scripts[i].getAttribute('src'),
3123
+ childId
3124
+ );
3125
+ } else if (type.indexOf('javascript') !== -1 || type === '') {
3126
+ // eval(scripts[i].innerHTML);
3127
+ const scriptContent = scripts[i].innerHTML;
3128
+ const scriptElement = document.createElement('script');
3129
+ scriptElement.textContent = scriptContent;
3130
+ document.body.appendChild(scriptElement);
3131
+ }
3132
+ }
3133
+ },
3134
+ },
3135
+ fallback: function (matchClass, content, noInner) {
3136
+ 'use strict';
3137
+ var elems = document.getElementsByTagName('*'),
3138
+ i,
3139
+ index = 0;
3140
+
3141
+ for (i in elems) {
3142
+ if (elems[i] !== undefined) {
3143
+ for (index = 0; index < matchClass.length; index += 1) {
3144
+ if (
3145
+ (' ' + elems[i].className + ' ').indexOf(
3146
+ ' ' + matchClass[index] + ' '
3147
+ ) > -1
3148
+ ) {
3149
+ if (typeof content === 'function') {
3150
+ if (noInner === true) {
3151
+ content(elems[i]);
3152
+ } else {
3153
+ elems[i].innerHTML = content(elems[i]);
3154
+ }
3155
+ } else {
3156
+ elems[i].innerHTML = content;
3157
+ }
3158
+ }
3159
+ }
3160
+ }
3161
+ }
3162
+ },
3163
+ engage: function (id) {
3164
+ 'use strict';
3165
+ let r = Math.floor(Math.random() * 100000),
3166
+ engage = `${tarteaucitron.services[id].name} ${tarteaucitron.lang.fallback}`;
3167
+
3168
+ if (tarteaucitron.lang['engage-' + id] !== undefined) {
3169
+ engage = tarteaucitron.lang['engage-' + id];
3170
+ }
3171
+
3172
+ let html = `<div class="fr-consent-placeholder tac_activate tac_activate_${id}">`;
3173
+ html += `<h4 class="fr-h6">${engage}</h4>`;
3174
+ html += `<p>${tarteaucitron.lang.allowFeature}</p>`;
3175
+ html += `<button class="fr-btn tarteaucitronAllow" type="button" id="Eng${r}ed${id}" title="${tarteaucitron.lang.allowService} ${tarteaucitron.services[id].name}">${tarteaucitron.lang.allow}</button>`;
3176
+ html += `</div>`;
3177
+ return html;
3178
+ },
3179
+ extend: function (a, b) {
3180
+ 'use strict';
3181
+ var prop;
3182
+ for (prop in b) {
3183
+ if (b.hasOwnProperty(prop)) {
3184
+ a[prop] = b[prop];
3185
+ }
3186
+ }
3187
+ },
3188
+ proTemp: '',
3189
+ proTimer: function () {
3190
+ 'use strict';
3191
+ setTimeout(
3192
+ tarteaucitron.proPing,
3193
+ Math.floor(Math.random() * (1200 - 500 + 1)) + 500
3194
+ );
3195
+ },
3196
+ pro: function (list) {
3197
+ 'use strict';
3198
+ tarteaucitron.proTemp += list;
3199
+ clearTimeout(tarteaucitron.proTimer);
3200
+ tarteaucitron.proTimer = setTimeout(
3201
+ tarteaucitron.proPing,
3202
+ Math.floor(Math.random() * (1200 - 500 + 1)) + 500
3203
+ );
3204
+ },
3205
+ proPing: function () {
3206
+ 'use strict';
3207
+ if (
3208
+ tarteaucitron.uuid !== '' &&
3209
+ tarteaucitron.uuid !== undefined &&
3210
+ tarteaucitron.proTemp !== '' &&
3211
+ tarteaucitronStatsEnabled
3212
+ ) {
3213
+ var div = document.getElementById('tarteaucitronPremium'),
3214
+ timestamp = new Date().getTime(),
3215
+ url = 'https://tarteaucitron.io/log/?';
3216
+
3217
+ if (div === null) {
3218
+ return;
3219
+ }
3220
+
3221
+ url += 'account=' + tarteaucitron.uuid + '&';
3222
+ url += 'domain=' + tarteaucitron.domain + '&';
3223
+ url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
3224
+ url += '_time=' + timestamp;
3225
+
3226
+ div.innerHTML =
3227
+ '<img src="' +
3228
+ url +
3229
+ '" class="tarteaucitron-display-none" alt="" />';
3230
+
3231
+ tarteaucitron.proTemp = '';
3232
+ }
3233
+
3234
+ tarteaucitron.cookie.number();
3235
+ },
3236
+ AddOrUpdate: function (source, custom) {
3237
+ /**
3238
+ Utility function to Add or update the fields of obj1 with the ones in obj2
3239
+ */
3240
+ for (var key in custom) {
3241
+ if (custom[key] instanceof Object) {
3242
+ source[key] = tarteaucitron.AddOrUpdate(
3243
+ source[key],
3244
+ custom[key]
3245
+ );
3246
+ } else {
3247
+ source[key] = custom[key];
3248
+ }
3249
+ }
3250
+ return source;
3251
+ },
3252
+ getElemWidth: function (elem) {
3253
+ return elem.getAttribute('width') || elem.clientWidth;
3254
+ },
3255
+ getElemHeight: function (elem) {
3256
+ return elem.getAttribute('height') || elem.clientHeight;
3257
+ },
3258
+ getElemAttr: function (elem, attr) {
3259
+ var attribute =
3260
+ elem.getAttribute('data-' + attr) || elem.getAttribute(attr);
3261
+
3262
+ if (typeof attribute === 'string') {
3263
+ return tarteaucitron.fixSelfXSS(attribute);
3264
+ }
3265
+
3266
+ return '';
3267
+ },
3268
+ addClickEventToId: function (elemId, func) {
3269
+ tarteaucitron.addClickEventToElement(
3270
+ document.getElementById(elemId),
3271
+ func
3272
+ );
3273
+ },
3274
+ addClickEventToElement: function (e, func) {
3275
+ if (e) {
3276
+ if (e.addEventListener) {
3277
+ e.addEventListener('click', func);
3278
+ } else {
3279
+ e.attachEvent('onclick', func);
3280
+ }
3281
+ }
3282
+ },
3283
+ triggerJobsAfterAjaxCall: function () {
3284
+ tarteaucitron.job.forEach(function (e) {
3285
+ tarteaucitron.job.push(e);
3286
+ });
3287
+ var i;
3288
+ var allowBtns = document.getElementsByClassName('tarteaucitronAllow');
3289
+ for (i = 0; i < allowBtns.length; i++) {
3290
+ tarteaucitron.addClickEventToElement(allowBtns[i], function () {
3291
+ tarteaucitron.userInterface.respond(this, true);
3292
+ });
3293
+ }
3294
+ var denyBtns = document.getElementsByClassName('tarteaucitronDeny');
3295
+ for (i = 0; i < denyBtns.length; i++) {
3296
+ tarteaucitron.addClickEventToElement(denyBtns[i], function () {
3297
+ tarteaucitron.userInterface.respond(this, false);
3298
+ });
3299
+ }
3300
+ },
3301
+ };