PageSourceSearch

https://www.ffgym-regionsud.fr/wp-content/plugins/ct-ultimate-gdpr/assets/js/cookie-popup.js?ver=4.3

js ffgym-regionsud.fr collected 2026-10-10 00:02:32 UTC 28,949 bytes, 724 lines download raw bytes

1/**
2 * cookie popup features
3 * @var object ct_ultimate_gdpr_cookie - from wp_localize_script
4 * @var object ct_ultimate_gdpr_cookie_shortcode_popup - from wp_localize_script
5 *
6 * */
7 jQuery(document).ready(function ($) {
8
9    // IN PANEL VIEW @ 1024px WINDOW WIDTH AND WIDER, ALLOWS OREO
10    // SKIN BUTTONS TO HAVE 50% HEIGHT EVEN IF PARENT HAS DYNAMIC HEIGHT
11    var oreoTopPanel = $('.ct-ultimate-gdpr-cookie-popup-oreo.ct-ultimate-gdpr-cookie-topPanel');
12    var oreoBottomPanel = $('.ct-ultimate-gdpr-cookie-popup-oreo.ct-ultimate-gdpr-cookie-bottomPanel');
13    if (oreoTopPanel.add(oreoBottomPanel).length) {
14        function setBtnHeight() {
15            if ($(window).width() >= 1024) {
16                var boxHeight = jQuery('#ct-ultimate-gdpr-cookie-popup').outerHeight();
17                var btnHeight = boxHeight;
18                if ($('#ct-ultimate-gdpr-cookie-change-settings').length) {
19                    var btnHeight = boxHeight / 2;
20                }
21                $('#ct-ultimate-gdpr-cookie-accept, #ct-ultimate-gdpr-cookie-change-settings, #ct_ultimate-gdpr-cookie-reject').css({
22                    'height': btnHeight + 'px',
23                    'line-height': btnHeight + 'px'
24                });
25            } else {
26                $('#ct-ultimate-gdpr-cookie-accept, #ct-ultimate-gdpr-cookie-change-settings, #ct_ultimate-gdpr-cookie-reject').css({
27                    'height': '52px',
28                    'line-height': 'normal'
29                });
30            }
31        }
32        setBtnHeight();
33        $(window).resize(function() {
34            setBtnHeight();
35        });
36    }
37  
38    // FIX DOUBLE VERTICAL SCROLLBAR AFTER COOKIE MODAL POPUP SAVE BUTTON IS CLICKED
39    $('.ct-ultimate-gdpr-cookie-modal-btn.save').on('click', function () {
40        $(this).parents('#ct-ultimate-gdpr-cookie-modal').hide();
41    });
42  
43    // 1173
44    $('input.ct-ultimate-gdpr-cookie-modal-single-item').each(function() {
45      if ( $(this).is(":checked") ) {
46          var checkboxParent = $(this).closest("li");
47
48          $(this).addClass('ct-cookie-item-selected');
49          checkboxParent.addClass('activ');
50          checkboxParent.find('path').css('fill', '#82aa3b');
51      }
52    });
53  
54    // TOGGLE "HIDE DETAILS" BUTTON, AND COOKIE WILL / WON'T LIST ACCORDINGLY
55    var compactBlock = $('.ct-ultimate-gdpr-cookie-modal-compact #ct-ultimate-gdpr-cookie-modal-slider-item-block');
56    compactBlock.on('click', function () {
57        var cookieList = jQuery(this).parents('form').next();
58        var hideDetails = jQuery('.hide-btn-wrapper');
59        if (cookieList.is(':visible')) {
60            cookieList.slideUp();
61        }
62        if (hideDetails.is(':visible')) {
63            hideDetails.slideUp();
64        }
65    });
66    var compactItem = $('.ct-ultimate-gdpr-cookie-modal-compact .ct-ultimate-gdpr-cookie-modal-slider-item');
67    compactItem.not('#ct-ultimate-gdpr-cookie-modal-slider-item-block').on('click', function () {
68        var cookieList = jQuery(this).parents('form').next();
69        var hideDetails = jQuery('.hide-btn-wrapper');
70        if (cookieList.is(':hidden')) {
71            cookieList.slideDown();
72        }
73        if (hideDetails.is(':hidden')) {
74            hideDetails.slideDown();
75        }
76    });
77  
78    function isModalAlwaysVisible() {
79        return false;
80        // return !! ( window.ct_ultimate_gdpr_cookie_shortcode_popup && ct_ultimate_gdpr_cookie_shortcode_popup.always_visible );
81    }
82  
83    function hidePopup() {
84  
85        if (isModalAlwaysVisible()) return;
86  
87        jQuery('#ct-ultimate-gdpr-cookie-popup').hide();
88        jQuery('.ct-ultimate-gdpr-cookie-fullPanel-overlay').hide();
89        jQuery('#ct-ultimate-gdpr-cookie-open').show(function(){
90            $(this).css('display','flex');
91        });
92    }
93  
94    function showPopup() {
95        jQuery('#ct-ultimate-gdpr-cookie-popup').show();
96    }
97  
98    function hideModal() {
99  
100        if (isModalAlwaysVisible()) return;
101  
102        jQuery('#ct-ultimate-gdpr-cookie-modal').hide();
103        jQuery('#ct-ultimate-gdpr-cookie-open').show(function(){
104            $(this).css('display','flex');
105        });
106    }
107  
108    function showModal() {
109        jQuery('#ct-ultimate-gdpr-cookie-modal').show();
110        jQuery('#ct-ultimate-gdpr-cookie-open').hide();
111    }
112  
113    function getCookie(name) {
114        var ctCookie = document.cookie;
115        if (ctCookie) {
116            var match = ctCookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
117            if (match) return match[2];
118        } else {
119            return '';
120        }
121  
122    }
123  
124    function dateToAge(date) {
125        const msDiff = Date.now() - date.getTime();
126        const diffDate = new Date(msDiff);
127  
128        return Math.abs(diffDate.getUTCFullYear() - 1970);
129    }
130  
131    function shouldDisplayPopup() {
132  
133        // on some setups php is unable to grab cookie in backend, then check in js below
134        if (ct_ultimate_gdpr_cookie.consent) {
135            return false;
136        }
137  
138        const consentCookieValue = getCookie('ct-ultimate-gdpr-cookie');
139  
140        //fix for old version of the plugin
141        if(consentCookieValue){
142            var myCookieIsFromOldVersion = (consentCookieValue.indexOf("consent") !== -1);
143            if(myCookieIsFromOldVersion){
144                document.cookie = "ct-ultimate-gdpr-cookie" + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
145                return true;
146            }
147        }
148  
149        var cookieObject = consentCookieValue ? JSON.parse(atob(decodeURIComponent(consentCookieValue))) : {};
150  
151        //checking for latest/legacy expire_time js implementation
152        if (cookieObject.consent_expire_time) {
153            return cookieObject.consent_expire_time < +new Date / 1000;
154        } else if (cookieObject.expire_time) {
155            return cookieObject.expire_time < +new Date / 1000;
156        } else {
157            return true;
158        }
159  
160    }
161  
162    function maybeShowPopup(e) {
163        // hide popup and show small gear icon if user already given consent
164        if (shouldDisplayPopup()) {
165            showPopup();
166            $('body').removeClass("ct-ultimate-gdpr-cookie-bottomPanel-padding");
167            $('body').removeClass("ct-ultimate-gdpr-cookie-topPanel-padding");
168            
169        } else {
170            hidePopup();
171        }
172   
173    }
174  
175    function setJsCookie(consent_level) {
176  
177        try {
178  
179            var consent_expire_time = ct_ultimate_gdpr_cookie.consent_expire_time;
180            var consent_time = ct_ultimate_gdpr_cookie.consent_time;
181            var content = {
182                'consent_level': consent_level,
183                'consent_expire_time': consent_expire_time,
184                'consent_time': consent_time,
185                'consent_declined': false
186            };
187  
188            content = btoa(JSON.stringify(content));
189            var js_expire_time = new Date(1000 * consent_expire_time).toUTCString();
190            document.cookie = "ct-ultimate-gdpr-cookie=" + content + "; expires=" + js_expire_time + "; path=/";
191  
192        } catch (e) {
193  
194        }
195  
196    }
197  
198    function onAccept() {
199  
200        var level = ct_ultimate_gdpr_cookie.consent_accept_level;
201        var protectLevel = $(".ct-ultimate-gdpr-shortcode-protection").attr('data-level');
202        var $this = $(this);
203        setJsCookie(level);
204  
205        // triggering click in proper modal input
206        jQuery('.ct-ultimate-gdpr-cookie-modal-content input[data-count=' + level + ']').trigger('click');
207  
208        jQuery.post(ct_ultimate_gdpr_cookie.ajaxurl, {
209                "action": "ct_ultimate_gdpr_cookie_consent_give",
210                "level": level
211            },
212            function () {
213                if( $this.attr("id") != "ct-ultimate-cookie-close-modal" ){
214                    if (ct_ultimate_gdpr_cookie.reload) {
215                        window.location.reload(true);
216                    }
217                }
218            }
219        ).fail(function () {
220  
221  
222            jQuery.post(ct_ultimate_gdpr_cookie.ajaxurl, {
223                "skip_cookies": true,
224                "action": "ct_ultimate_gdpr_cookie_consent_give",
225                "level": level
226            }, function () {
227                if( $this.attr("id") != "ct-ultimate-cookie-close-modal" ){
228                    if (ct_ultimate_gdpr_cookie.reload) {
229                        window.location.reload(true);
230                    }
231                }
232            });
233  
234        });
235  
236        if (!ct_ultimate_gdpr_cookie.reload) {
237            hidePopup()
238            if (level >= protectLevel) {
239                $(".ct-ultimate-gdpr-shortcode-protection").removeClass("blur")
240                $("span.ct-ultimate-gdpr-shortcode-protection-label").remove();
241                var content = $("div.ct-ultimate-gdpr-shortcode-protection").text();
242                var result = $.base64.decode(content);
243                $(".ct-ultimate-gdpr-shortcode-protection").html(result);
244            }
245  
246        }
247  
248        $('body').removeClass("ct-ultimate-gdpr-cookie-bottomPanel-padding");
249        $('body').removeClass("ct-ultimate-gdpr-cookie-topPanel-padding");
250  
251  
252        if (level >= protectLevel) {
253            $(".ct-ultimate-gdpr-shortcode-protection").removeClass("blur")
254            $("span.ct-ultimate-gdpr-shortcode-protection-label").remove();
255            var content = $("div.ct-ultimate-gdpr-shortcode-protection").text();
256            var result = $.base64.decode(content);
257            $(".ct-ultimate-gdpr-shortcode-protection").html(result);
258        }
259    }
260  
261    function onRead() {
262        if (ct_ultimate_gdpr_cookie && ct_ultimate_gdpr_cookie.readurl) {
263            if (ct_ultimate_gdpr_cookie.readurl_new_tab == "off"){
264                window.location.href = ct_ultimate_gdpr_cookie.readurl;
265            }else{
266                window.open(ct_ultimate_gdpr_cookie.readurl, '_blank');
267            }
268        }
269    }
270  
271    function onCloseModal(e) {
272        e.preventDefault();
273  
274        var level = ct_ultimate_gdpr_cookie.consent_default_level;
275  
276        jQuery.post( ct_ultimate_gdpr_cookie.ajaxurl, {
277                "action"                        : "ct_ultimate_gdpr_cookie_consent_decline",
278                "ct_ultimate_gdpr_button_close" : "1"
279            },
280            function () {
281                if (ct_ultimate_gdpr_cookie.reload) {
282                    window.location.reload(true);
283                }
284            });
285  
286        if (isModalAlwaysVisible()) return;
287  
288        jQuery('#ct-ultimate-gdpr-cookie-popup').hide();
289        jQuery('.ct-ultimate-gdpr-cookie-fullPanel-overlay').hide();
290  
291    }
292     // 1173
293    function ASCValidate(array) {
294      var length = array.length;
295      return array.every(function(value, index) {
296          var nextIndex = index + 1;
297          return nextIndex < length ? value < array[nextIndex] : true;
298      });
299    }
300  
301    function onSave(e) {
302  
303        e.preventDefault();
304  
305          var level          = $('.ct-ultimate-gdpr-cookie-modal-slider-item--active input').val(),
306              protectLevel   = $(".ct-ultimate-gdpr-shortcode-protection").attr('data-level'),
307              init_level_id  = $('li input.ct-ultimate-gdpr-cookie-modal-single-item.ct-cookie-item-selected').map(function(){ return this.value; }).get();
308  
309          let level_id = init_level_id; // 1173
310  
311          if(init_level_id.length > 0) {
312              $('li input.ct-ultimate-gdpr-cookie-modal-single-item.ct-cookie-item-selected').each(function(e) {
313                  if( !ASCValidate(level_id) ) {
314                      level_id = level_id.slice(0, -1); // delete last index until statement is true.
315                  }
316                  if( init_level_id[0] === '1') { // force block-all = 1.
317                      level_id = ['1'];
318                  }
319              });
320          }
321          
322        document.cookie = 'ct-ultimate-gdpr-cookie=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
323  
324        jQuery.post(ct_ultimate_gdpr_cookie.ajaxurl, {
325            "action": "ct_ultimate_gdpr_cookie_consent_give",
326            "level": level,
327            "level_id": level_id
328        }, function () {
329            if (ct_ultimate_gdpr_cookie.reload) {
330                window.location.reload(true);
331            }
332        }).fail(function () {
333  
334            jQuery.post(ct_ultimate_gdpr_cookie.ajaxurl, {
335                "skip_cookies": true,
336                "action": "ct_ultimate_gdpr_cookie_consent_give",
337                "level": level,
338                "level_id": level_id
339            }, function () {
340                setJsCookie(level);
341                if (ct_ultimate_gdpr_cookie.reload) {
342                    window.location.reload(true);
343                }
344            })
345  
346        });
347  
348        if (!ct_ultimate_gdpr_cookie.reload) {
349            hideModal();
350            hidePopup();
351            if (level >= protectLevel) {
352                $(".ct-ultimate-gdpr-shortcode-protection").removeClass("blur")
353                $("span.ct-ultimate-gdpr-shortcode-protection-label").remove();
354                var content = $("div.ct-ultimate-gdpr-shortcode-protection").text();
355                var result = $.base64.decode(content);
356                $(".ct-ultimate-gdpr-shortcode-protection").html(result);
357            }
358        }
359        $('body').removeClass("ct-ultimate-gdpr-cookie-bottomPanel-padding");
360        $('body').removeClass("ct-ultimate-gdpr-cookie-topPanel-padding");
361        $('html').removeClass("cookie-modal-open");
362        $('body').removeClass("cookie-modal-open");
363  
364        if (level >= protectLevel) {
365            $(".ct-ultimate-gdpr-shortcode-protection").removeClass("blur")
366            $("span.ct-ultimate-gdpr-shortcode-protection-label").remove();
367            var content = $("div.ct-ultimate-gdpr-shortcode-protection").text();
368            var result = $.base64.decode(content);
369            $(".ct-ultimate-gdpr-shortcode-protection").html(result);
370        }
371    }
372  
373    $('#ct-ultimate-gdpr-cookie-accept').bind('click', onAccept);
374    $('#ct-ultimate-cookie-close-modal').bind('click', onCloseModal);
375    $('#ct-ultimate-gdpr-cookie-read-more').bind('click', onRead);
376    $('.ct-ultimate-gdpr-cookie-modal-btn.save').bind('click', onSave);
377  
378  
379    //MODAL
380    $('#ct-ultimate-gdpr-cookie-open,#ct-ultimate-gdpr-cookie-change-settings,.ct-ultimate-triggler-modal-sc').on('click', function (e) {
381        var modalbody = $("body");
382        var modal = $("#ct-ultimate-gdpr-cookie-modal");
383        modal.show();
384        $('.ct-ultimate-gdpr-cookie-modal-slider-item.ct-ultimate-gdpr-cookie-modal-slider-item--active').trigger('click');
385        modalbody.addClass("cookie-modal-open");
386        $("html").addClass("cookie-modal-open");
387        e.stopPropagation();
388  
389        var slider_class = $("#ct-ultimate-gdpr-cookie-modal-slider-form").attr("class");
390        if(typeof slider_class !== "undefined") {
391            var level = slider_class.substr(slider_class.length - 1);
392            $(".ct-ultimate-gdpr-cookie-modal-slider li:nth-child(" + level + ")").addClass('ct-ultimate-gdpr-cookie-modal-slider-item--active');
393        }
394    });
395  
396    //Close modal on x button
397    $('#ct-ultimate-gdpr-cookie-modal-close,#ct-ultimate-gdpr-cookie-modal-compact-close').on('click', function () {
398  
399        if (isModalAlwaysVisible()) return;
400  
401        var modalbody = $("body");
402        var modal = $("#ct-ultimate-gdpr-cookie-modal");
403        modal.hide();
404        modalbody.removeClass("cookie-modal-open");
405        $("html").removeClass("cookie-modal-open");
406    });
407  
408    //Close modal when clicking outside of modal area.
409    $('#ct-ultimate-gdpr-cookie-modal').on("click", function (e) {
410  
411        if (isModalAlwaysVisible()) return;
412  
413        if (!($(e.target).closest('#ct-ultimate-gdpr-cookie-change-settings, .ct-ultimate-gdpr-cookie-modal-content').length)) {
414            var modalbody = $("body");
415            var modal = $("#ct-ultimate-gdpr-cookie-modal");
416            modal.hide();
417            modalbody.removeClass("cookie-modal-open");
418            $("html").removeClass("cookie-modal-open");
419        }
420  
421        e.stopPropagation();
422    });
423  
424    //SVG
425    jQuery('img.ct-svg').each(function () {
426        var $img = jQuery(this);
427        var imgID = $img.attr('id');
428        var imgClass = $img.attr('class');
429        var imgURL = $img.attr('src');
430  
431        jQuery.get(imgURL, function (data) {
432            // Get the SVG tag, ignore the rest
433            var $svg = jQuery(data).find('svg');
434  
435            // Add replaced image's ID to the new SVG
436            if (typeof imgID !== 'undefined') {
437                $svg = $svg.attr('id', imgID);
438            }
439            // Add replaced image's classes to the new SVG
440            if (typeof imgClass !== 'undefined') {
441                $svg = $svg.attr('class', imgClass + ' replaced-svg');
442            }
443  
444            // Remove any invalid XML tags as per http://validator.w3.org
445            $svg = $svg.removeAttr('xmlns:a');
446  
447            // Check if the viewport is set, else we gonna set it if we can.
448            if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
449                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
450            }
451  
452            // Replace image with new SVG
453            $img.replaceWith($svg);
454  
455        }, 'xml');
456    });
457  
458    function alwaysDisplayCookie(){
459      if(ct_ultimate_gdpr_cookie.display_cookie_always) {
460          showPopup();
461          jQuery('#ct-ultimate-gdpr-cookie-open').hide();
462      } 
463    }
464  
465    function deleteAllCookies(){
466      var cookies = document.cookie.split(";");
467      
468          for (var i = 0; i < cookies.length; i++) {
469              var cookie = cookies[i];
470              var eqPos = cookie.indexOf("=");
471              var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
472              setCookie(name,'',-1);
473          }
474      }
475
476        
477    function setCookie(name,value,days) {
478        var expires = "";
479        if (days) {
480            var date = new Date();
481            date.setTime(date.getTime() + (days*24*60*60*1000));
482            expires = "; expires=" + date.toUTCString();
483        }
484        document.cookie = name + "=" + (value || "")  + expires + "; path=/";
485    }
486  
487    function resetCookieConsent(){
488        if(ct_ultimate_gdpr_cookie.cookie_reset_consent){
489          deleteAllCookies();
490        } else {
491            // do nothing here
492        }
493    }
494  
495    $(window).on('load', function () {
496        var selected = $('.ct-ultimate-gdpr-cookie-modal-slider-item--active');
497
498        var checked = selected.find('input');
499        var input_id = checked.attr('id');
500        var $count = checked.attr('data-count');
501        selected.find('path').css('fill', '#82aa3b');
502        selected.prevUntil('#ct-ultimate-gdpr-cookie-modal-slider-item-block').addClass('ct-ultimate-gdpr-cookie-modal-slider-item--selected');
503        checked.parent().prevUntil('#ct-ultimate-gdpr-cookie-modal-slider-item-block').find('path').css('fill', '#82aa3b');
504  
505        $('#ct-ultimate-gdpr-cookie-modal-slider-form').attr('class', 'ct-slider-cookie' + $count);
506        $('.ct-ultimate-gdpr-cookie-modal-slider-info.' + 'cookie_' + $count).css('display', 'block');
507  
508        if( getCookie('ct-ultimate-gdpr-cookie-popup') == 1 ){
509            jQuery('#ct-ultimate-gdpr-cookie-popup').hide();
510            jQuery('.ct-ultimate-gdpr-cookie-fullPanel-overlay').hide();
511        }    
512  
513  
514    });
515  
516    $('.ct-ultimate-gdpr-cookie-modal-slider').each(function () {
517  
518        var $btns = $('.ct-ultimate-gdpr-cookie-modal-slider-item').click(function () {
519  
520            var $input = $(this).find('input').attr('id');
521  
522            $('.tab').removeClass('ct-ultimate-gdpr-cookie-modal-active-tab');
523            $('.tab.' + $input).addClass('ct-ultimate-gdpr-cookie-modal-active-tab');
524  
525            var $el = $('.' + $input);
526            $el.show();
527            var form_class = $('#ct-ultimate-gdpr-cookie-modal-slider-form');
528            var modalBody = $('div#ct-ultimate-gdpr-cookie-modal-body');
529  
530            var $count = $(this).find('input').attr('data-count');
531  
532            $('#ct-ultimate-gdpr-cookie-modal-slider-form').attr('class', 'ct-slider-cookie' + $count);
533            $('.ct-ultimate-gdpr-cookie-modal-slider-wrap .ct-ultimate-gdpr-cookie-modal-slider-info').not($el).hide();
534  
535            $btns.removeClass('ct-ultimate-gdpr-cookie-modal-slider-item--active');
536            $(this).addClass('ct-ultimate-gdpr-cookie-modal-slider-item--active');
537  
538            $(this).prevUntil('#ct-ultimate-gdpr-cookie-modal-slider-item-block').find('path').css('fill', '#82aa3b');
539            $(this).prevUntil('#ct-ultimate-gdpr-cookie-modal-slider-item-block').addClass('ct-ultimate-gdpr-cookie-modal-slider-item--selected');
540            $(this).find('path').css('fill', '#82aa3b');
541            $(this).nextAll().find('path').css('fill', '#595959');
542            $(this).removeClass('ct-ultimate-gdpr-cookie-modal-slider-item--selected');
543            $(this).nextAll().removeClass('ct-ultimate-gdpr-cookie-modal-slider-item--selected');
544  
545            if ($(this).attr('id') === 'ct-ultimate-gdpr-cookie-modal-slider-item-block') {
546                modalBody.addClass('ct-ultimate-gdpr-slider-block');
547                modalBody.removeClass('ct-ultimate-gdpr-slider-not-block');
548            } else {
549                modalBody.removeClass('ct-ultimate-gdpr-slider-block');
550                modalBody.addClass('ct-ultimate-gdpr-slider-not-block');
551            }
552  
553        });
554  
555    });
556  
557      // 1173 granular cookie
558      $('li input.ct-ultimate-gdpr-cookie-modal-single-item').click(function (elem) {
559        
560        $('input[type=radio]').on('change', function() {
561        $('.ct-ultimate-gdpr-cookie-modal-single-wrap').hide();
562             var radioParent = $(this).closest("li");
563              $("input[type=checkbox]").prop( "checked", false );
564
565              if( $(this).prop("checked") ) {
566                  radioParent.addClass('activ');
567                  $(this).addClass('ct-cookie-item-selected');
568                  $("#cookie5").closest("li").removeClass('activ');
569                  $("#cookie6").closest("li").removeClass('activ');
570                  $("#cookie7").closest("li").removeClass('activ');
571                  $("#cookie8").closest("li").removeClass('activ');
572                  $("#cookie5").closest("li").find('path').css('fill', '#595959');
573                  $("#cookie6").closest("li").find('path').css('fill', '#595959');
574                  $("#cookie7").closest("li").find('path').css('fill', '#595959');
575                  $("#cookie8").closest("li").find('path').css('fill', '#595959');
576                  radioParent.find('path').css('fill', '#82aa3b');
577
578                  
579
580              }
581              else {
582                  $(this).removeClass('ct-cookie-item-selected');
583                  $(this).removeAttr('checked');
584              } 
585
586          });
587  
588          $('input[type=checkbox]').on('change', function() {      
589            $('.ct-ultimate-gdpr-cookie-modal-single-wrap').show();
590            var checkboxParent = $(this).closest("li");
591              $("#cookie0").prop( "checked", false );
592              $("#cookie0").closest("li").removeClass('activ');
593              $("#cookie0").removeClass('ct-cookie-item-selected');
594              $("#cookie0").closest("li").find('path').css('fill', '#111');
595
596              if( $(this).prop("checked") ) {
597                  $(this).addClass('ct-cookie-item-selected');
598                  checkboxParent.addClass('activ');
599                  checkboxParent.find('path').css('fill', '#82aa3b');
600              }
601              else {
602                  $(this).removeAttr('checked');
603                  $(this).removeClass('ct-cookie-item-selected');
604                  checkboxParent.removeClass('activ');
605                  checkboxParent.find('path').css('fill', '#595959');
606              }
607          });
608
609         
610          displayItalianDescription();
611
612
613      });
614  
615    /* HIDE DETAILS BUTTON */
616    $('.hide-btn').on('click', function () {
617  
618        var infoBox = $('.ct-ultimate-gdpr-cookie-modal-slider-wrap');
619        var hideBtnI = jQuery(this).find('span');
620        if (infoBox.is(':hidden')) {
621            hideBtnI.removeClass('fa-chevron-down');
622            hideBtnI.addClass('fa-chevron-up');
623        } else {
624            hideBtnI.removeClass('fa-chevron-up');
625            hideBtnI.addClass('fa-chevron-down');
626        }
627        infoBox.slideToggle();
628    });
629  
630    // MAKE LEFT PANEL OF COOKIE MODAL POPUP INFO BOX IN COMPACT SKINS CLICKABLE
631    $('.cookie-modal-tab-wrapper li').on('click', function () {
632        var $this = jQuery(this);
633        var cookieType = '';
634        if ($this.hasClass('cookie0')) {
635            cookieType = 'cookie0';
636        } else if ($this.hasClass('cookie1')) {
637            cookieType = 'cookie1';
638        } else if ($this.hasClass('cookie2')) {
639            cookieType = 'cookie2';
640        } else if ($this.hasClass('cookie3')) {
641            cookieType = 'cookie3';
642        } else if ($this.hasClass('cookie4')) {
643            cookieType = 'cookie4';
644        }
645        var formCookieType = jQuery('#ct-ultimate-gdpr-cookie-modal-slider-form').find('#' + cookieType);
646        formCookieType.parent().click();
647    });
648  
649    if ($("#ct-ultimate-gdpr-cookie-popup").hasClass("ct-ultimate-gdpr-cookie-topPanel")) {
650        if (!ct_ultimate_gdpr_cookie.consent) {
651            $('body').addClass("ct-ultimate-gdpr-cookie-topPanel-padding");
652        }
653    }
654  
655    if ($("#ct-ultimate-gdpr-cookie-popup").hasClass("ct-ultimate-gdpr-cookie-bottomPanel")) {
656        if (!ct_ultimate_gdpr_cookie.consent) {
657            $('body').addClass("ct-ultimate-gdpr-cookie-bottomPanel-padding");
658        }
659    }
660  
661    if ($("#ct-ultimate-gdpr-cookie-popup").hasClass("ct-ultimate-gdpr-cookie-topPanel ct-ultimate-gdpr-cookie-popup-modern")) {
662        $('body').addClass("popup-modern-style");
663    }
664  
665    if ($("#ct-ultimate-gdpr-cookie-popup").hasClass("ct-ultimate-gdpr-cookie-bottomPanel ct-ultimate-gdpr-cookie-popup-modern")) {
666        $('body').addClass("popup-modern-style");
667    }
668  
669    $(window).on('load resize', function() {
670        var cookiePopupHeight = $('#ct-ultimate-gdpr-cookie-popup').outerHeight();
671  
672        $('.ct-ultimate-gdpr-cookie-bottomPanel-padding').css('padding-bottom', cookiePopupHeight);
673    });
674
675    function displayItalianDescription(){
676        var essentials = $('#cookie5');
677        var functionality = $('#cookie6');
678        var analytics = $('#cookie7');
679        var advertising = $('#cookie8');
680        var descriptions = $('.ct-ultimate-gdpr-cookie-modal-single-wrap__inner--info');
681
682        if(essentials.prop('checked')) {
683            descriptions.find('#desc-left li.essentials').show();
684            descriptions.find('#desc-right li.essentials').hide();
685            } else {
686            descriptions.find('#desc-right li.essentials').show();
687            descriptions.find('#desc-left li.essentials').hide();
688
689            }
690            if(functionality.prop('checked')) {
691            descriptions.find('#desc-left li.functionality').show();
692            descriptions.find('#desc-right li.functionality').hide();
693        } else {
694            descriptions.find('#desc-right li.functionality').show();
695            descriptions.find('#desc-left li.functionality').hide();
696
697        }
698
699        if(analytics.prop('checked')) {
700            descriptions.find('#desc-left li.analytics').show();
701            descriptions.find('#desc-right li.analytics').hide();
702        } else {
703            descriptions.find('#desc-right li.analytics').show();
704            descriptions.find('#desc-left li.analytics').hide();
705
706        }
707
708        if(advertising.prop('checked')) {
709            descriptions.find('#desc-left li.advertising').show();
710            descriptions.find('#desc-right li.advertising').hide();
711        } else {
712            descriptions.find('#desc-right li.advertising').show();
713            descriptions.find('#desc-left li.advertising').hide();
714
715        }
716    }
717  
718    $(document).on('ct-age-clicked', maybeShowPopup);
719    maybeShowPopup();
720    displayItalianDescription();
721    alwaysDisplayCookie();
722    resetCookieConsent();
723  });
724  

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.