// source --> https://www.dargel-planwerk.de/wp-content/plugins/cookie-law-info/legacy/admin/modules/ccpa/assets/js/cookie-law-info-ccpa.js?ver=3.4.2 
(function( $ ) {
	'use strict';
	var CCPA = {
		ccpaOptedOut: false,
		ccpaOptOutConfirmationOpen: false,
		set: function() {
			this.setCheckboxState();
			jQuery( document ).on(
				'click',
				'.wt-cli-ccpa-opt-out-checkbox',
				function() {
					CCPA.ccpaOptedOut = false;
					if (this.checked === true ) {
						CCPA.ccpaOptedOut = true;
					}
					CCPA.optOutCcpa();
				}
			);
			jQuery( document ).on(
				'click',
				'.wt-cli-ccpa-opt-out:not(.wt-cli-ccpa-opt-out-checkbox)',
				function(){
					CCPA.showCcpaOptOutConfirmBox();
				}
			)
		},
		setCheckboxState : function() {
			var cliConsent       = {};
			var preferenceCookie = CLI_Cookie.read( CLI_PREFERENCE_COOKIE );
			if ( preferenceCookie !== null ) {
				cliConsent = CCPA.parseCookie( preferenceCookie );
				if ( typeof( cliConsent.ccpaOptout ) !== 'undefined') {

					if ( cliConsent.ccpaOptout === true ) {
						jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',true );
					} else {
						jQuery( '.wt-cli-ccpa-opt-out-checkbox' ).prop( 'checked',false );
					}
				}

			}
		},
		optOutCcpa: function() {
			var preferenceCookie = CLI_Cookie.read( CLI_PREFERENCE_COOKIE );
			var cliConsent       = {};
			if ( preferenceCookie !== null ) {
				cliConsent = CCPA.parseCookie( preferenceCookie );
			}
			cliConsent.ccpaOptout = this.ccpaOptedOut;
			cliConsent            = JSON.stringify( cliConsent );
			cliConsent            = window.btoa( cliConsent );
			CLI_Cookie.set( CLI_PREFERENCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE );
			this.setCheckboxState();
		},
		parseCookie: function( preferenceCookie ) {
			var cliConsent = {};
			cliConsent     = window.atob( preferenceCookie );
			cliConsent     = JSON.parse( cliConsent );
			return cliConsent;
		},
		toggleCCPA: function() {

		},
		checkAuthentication: function() {

		},
		showCcpaOptOutConfirmBox: function() {

			var css                         = '.cli-alert-dialog-buttons button {\
                -webkit-box-flex: 1!important;\
                -ms-flex: 1!important;\
                flex: 1!important;\
                -webkit-appearance: none!important;\
                -moz-appearance: none!important;\
                appearance: none!important;\
                margin: 4px!important;\
                padding: 8px 16px!important;\
                border-radius: 64px!important;\
                cursor: pointer!important;\
                font-weight: 700!important;\
                font-size: 12px !important;\
                color: #fff;\
                text-align: center!important;\
                text-transform: capitalize;\
                border: 2px solid #61a229;\
            } #cLiCcpaOptoutPrompt .cli-modal-dialog{\
                max-width: 320px;\
            }\
            #cLiCcpaOptoutPrompt .cli-modal-content {\
                box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            -webkit-box-shadow:0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            -moz-box-shadow0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);\
            }\
            .cli-alert-dialog-content {\
                font-size: 14px;\
            }\
            .cli-alert-dialog-buttons {\
                padding-top:5px;\
            }\
            button.cli-ccpa-button-cancel {\
                background: transparent !important;\
                color: #61a229;\
            }\
            button.cli-ccpa-button-confirm {\
                background-color:#61a229;\
                color:#ffffff;\
            }';
			var head                        = document.head || document.getElementsByTagName( 'head' )[0];
			var style                       = document.createElement( 'style' );
			var primaryColor                = CLI.settings.button_1_button_colour;
			var primaryLinkColor            = CLI.settings.button_1_link_colour;
			var backgroundColor             = CLI.settings.background;
			var textColor                   = CLI.settings.text;
			CCPA.ccpaOptOutConfirmationOpen = false;
			var ccpaPrompt,
			$this                           = this;
			(ccpaPrompt = document.createElement( "div" )).classList.add( "cli-modal", "cli-show", "cli-blowup" );
			ccpaPrompt.id = "cLiCcpaOptoutPrompt";
			var t         = document.createElement( "div" );
			t.className   = "cli-modal-dialog";
			var n         = document.createElement( "div" );
			n.classList.add( "cli-modal-content","cli-bar-popup" );
			var o       = document.createElement( "div" );
			o.className = "cli-modal-body";
			var p       = document.createElement( "div" );
			p.classList.add( "wt-cli-element", "cli-container-fluid", "cli-tab-container" );
			var q       = document.createElement( "div" );
			q.className = "cli-row";
			var r       = document.createElement( "div" );
			r.classList.add( "cli-col-12" );
			var x = document.createElement( "div" );
			x.classList.add( "cli-modal-backdrop", "cli-fade", "cli-settings-overlay", "cli-show" );
			var a       = document.createElement( "button" );
			var b       = document.createElement( "button" );
			var c       = document.createElement( "div" );
			var d       = document.createElement( "div" );
			d.className = "cli-alert-dialog-content",
			d.innerText = ccpa_data.opt_out_prompt,
			c.className = "cli-alert-dialog-buttons";
			a.className = "cli-ccpa-button-confirm",
			a.innerText = ccpa_data.opt_out_confirm,
			a.addEventListener(
				"click",
				function() {
					CCPA.ccpaOptedOut = true,
					CCPA.optOutCcpa(),
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );
					if ( Cli_Data.ccpaType === 'ccpa' ) {
						CLI.enableAllCookies();
						CLI.accept_close();
					}
				}
			),
			b.className = "cli-ccpa-button-cancel",
			b.innerText = ccpa_data.opt_out_cancel,
			b.addEventListener(
				"click",
				function() {
					CCPA.ccpaOptedOut = false,
					CCPA.optOutCcpa(),
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );
					if ( Cli_Data.ccpaType === 'ccpa' ) {
						CLI.enableAllCookies();
						CLI.accept_close();
					}
				}
			),
			ccpaPrompt.addEventListener(
				"click",
				function( event ) {
					event.stopPropagation();
					if ( ccpaPrompt !== event.target) {
						return;
					}
					document.body.removeChild( ccpaPrompt ),
					document.body.removeChild( x ),
					document.body.classList.remove( "cli-modal-open" );
					head.removeChild( style );

				}
			),
			ccpaPrompt.appendChild( t ),
			t.appendChild( n ),
			n.appendChild( o ),
			o.appendChild( p ),
			p.appendChild( q ),
			q.appendChild( r ),
			r.appendChild( d ),
			r.appendChild( c ),
			c.appendChild( b ),
			c.appendChild( a ),

			head.appendChild( style );
			style.type = 'text/css';
			if (style.styleSheet) {
				// This is required for IE8 and below.
				style.styleSheet.cssText = css;
			} else {
				style.appendChild( document.createTextNode( css ) );
			}
			document.body.appendChild( ccpaPrompt );
			document.body.appendChild( x );
			document.body.classList.add( "cli-modal-open" );

		},
	}
	jQuery( document ).ready(
		function() {
			CCPA.set();
		}
	);

})( jQuery );
// source --> https://www.dargel-planwerk.de/wp-content/plugins/sticky-header-oceanwp//main.js?ver=1.0.0 
jQuery(document).ready(function($){
    
    var orginal_height = typeof(orginal_height==='undefined') || $('body').hasClass('fixed_sticky_active')==false ? $('#site-logo-inner').height() : orginal_height;

	function sticky_header_oceanwp(){		
	    
	    var style = typeof(sticky_header_style) !== 'undefined' && sticky_header_style == 'shrink' ? 'shrink' : 'float';
		var site_header = $('#site-header');
		var wpadmin_height = $('#wpadminbar').css('position') == 'fixed' && $('#wpadminbar').height() > 0 ? $('#wpadminbar').height() : 0;
		var top_bars = $('#wpadminbar').css('position') == 'fixed' ? $('#top-bar-wrap').height() : $('#top-bar-wrap').height() + $('#wpadminbar').height();
		if (Number.isNaN(top_bars)){
			top_bars = $('#top-bar-wrap').height();
		}
		top_bars = top_bars || 0;
		var header_status = $(window).scrollTop() >= top_bars;
		var header_padding = site_header.height();
		
		if (style == 'float'){
			
			if (!header_status){
				site_header.css({
					'position': 'relative',
					'top': '0',
				});
				site_header.next().css('margin-top', '0');
			}else{
				site_header.css({
					'position': 'fixed',
					'top': wpadmin_height,
					'width': '100%',
					'z-index': '998',
				});
				site_header.next().css('margin-top', header_padding);
			}	
	    }
	    
	    if (style == 'shrink'){
	        
    		if (!header_status){
    			site_header.css({
    				'position': 'relative',
    				'top': '0',
    			});
                $('body').removeClass('fixed_sticky_active');
    			site_header.next().css('margin-top', '0');
    		}else{
    			site_header.css({
    				'position': 'fixed',
    				'top': wpadmin_height,
    				'width': '100%',
    				'z-index': '998',
    			});
    			site_header.next().css('margin-top', header_padding);
                $('body').addClass('fixed_sticky_active');
    		}	
	    }
	    
	}
	
	$(window).resize(function(){
	    $('body').removeClass('fixed_sticky_active');
	    sticky_header_oceanwp();
	});
		
    $(window).scroll(function(){
        sticky_header_oceanwp();
    });
	
	sticky_header_oceanwp();

	
});