// source --> https://cathydou.com/wp-admin/js/color-picker.min.js?ver=dae28406e26b5ff7d4a4bbbaed27c0ba 
/*! This file is auto-generated */
!function(i,t){var a=wp.i18n.__;i.widget("wp.wpColorPicker",{options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var e,o=this,t=o.element;t.hide(),e="hsl("+t.val()+", 100, 50)",t.iris({mode:"hsl",type:"hue",hide:!1,color:e,change:function(e,t){"function"==typeof o.options.change&&o.options.change.call(this,e,t)},width:o.options.width,slider:o.options.slider})},_create:function(){if(i.support.iris){var o=this,e=o.element;if(i.extend(o.options,e.data()),"hue"===o.options.type)return o._createHueOnly();o.close=o.close.bind(o),o.initialValue=e.val(),e.addClass("wp-color-picker"),e.parent("label").length||(e.wrap("<label></label>"),o.wrappingLabelText=i('<span class="screen-reader-text"></span>').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('<div class="wp-picker-container" />'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('<div class="wp-picker-holder" />').insertAfter(o.wrappingLabel),o.button=i('<input type="button" class="button button-small" />'),o.options.defaultColor?o.button.addClass("wp-picker-default").val(a("Default")).attr("aria-label",a("Select default color")):o.button.addClass("wp-picker-clear").val(a("Clear")).attr("aria-label",a("Clear color")),o.wrappingLabel.wrap('<span class="wp-picker-input-wrap hidden" />').after(o.button),o.inputWrapper=e.closest(".wp-picker-input-wrap"),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,mode:o.options.mode,palettes:o.options.palettes,change:function(e,t){o.toggler.css({backgroundColor:t.color.toString()}),"function"==typeof o.options.change&&o.options.change.call(this,e,t)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(e){e.stopPropagation()}),o.toggler.on("click",function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(e){var t=i(this).val();""!==t&&"#"!==t||(o.toggler.css("backgroundColor",""),"function"==typeof o.options.clear&&o.options.clear.call(this,e))}),o.button.on("click",function(e){var t=i(this);t.hasClass("wp-picker-clear")?(o.element.val(""),o.toggler.css("backgroundColor",""),"function"==typeof o.options.clear&&o.options.clear.call(this,e)):t.hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})},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"),i("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},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"),i("body").off("click.wpcolorpicker",this.close)},color:function(e){if(e===t)return this.element.iris("option","color");this.element.iris("option","color",e)},defaultColor:function(e){if(e===t)return this.options.defaultColor;this.options.defaultColor=e}})}(jQuery);
// source --> https://cathydou.com/wp-content/plugins/advanced-custom-fields-pro/assets/inc/color-picker-alpha/wp-color-picker-alpha.js?ver=3.0.0 
/**!
 * wp-color-picker-alpha
 *
 * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
 * Only run in input and is defined data alpha in true
 *
 * Version: 3.0.3
 * https://github.com/kallookoo/wp-color-picker-alpha
 * Licensed under the GPLv2 license or later.
 */

( function ( $, undef ) {
	var wpColorPickerAlpha = {
		'version': 302,
	};

	// Always try to use the last version of this script.
	if (
		'wpColorPickerAlpha' in window &&
		'version' in window.wpColorPickerAlpha
	) {
		var version = parseInt( window.wpColorPickerAlpha.version, 10 );
		if ( ! isNaN( version ) && version >= wpColorPickerAlpha.version ) {
			return;
		}
	}

	// Prevent multiple initiations
	if ( Color.fn.hasOwnProperty( 'to_s' ) ) {
		return;
	}

	// Create new method to replace the `Color.toString()` inside the scripts.
	Color.fn.to_s = function ( type ) {
		type = ( type || 'hex' );
		// Change hex to rgba to return the correct color.
		if ( 'hex' === type && this._alpha < 1 ) {
			type = 'rgba';
		}

		var color = '';
		if ( 'hex' === type ) {
			color = this.toString();
		} else if ( ! this.error ) {
			color = this.toCSS( type )
				.replace( /\(\s+/, '(' )
				.replace( /\s+\)/, ')' );
		}
		return color;
	};

	// Register the global variable.
	window.wpColorPickerAlpha = wpColorPickerAlpha;

	// Background image encoded
	var backgroundImage =
		'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==';

	/**
	 * Iris
	 */
	$.widget( 'a8c.iris', $.a8c.iris, {
		/**
		 * Alpha options
		 *
		 * @since 3.0.0
		 *
		 * @type {Object}
		 */
		alphaOptions: {
			alphaEnabled: false,
		},
		/**
		 * Get the current color or the new color.
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @param {Object|*} The color instance if not defined return the cuurent color.
		 *
		 * @return {string} The element's color.
		 */
		_getColor: function ( color ) {
			if ( color === undef ) {
				color = this._color;
			}

			if ( this.alphaOptions.alphaEnabled ) {
				color = color.to_s( this.alphaOptions.alphaColorType );
				if ( ! this.alphaOptions.alphaColorWithSpace ) {
					color = color.replace( /\s+/g, '' );
				}
				return color;
			}
			return color.toString();
		},
		/**
		 * Create widget
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_create: function () {
			try {
				// Try to get the wpColorPicker alpha options.
				this.alphaOptions = this.element.wpColorPicker(
					'instance'
				).alphaOptions;
			} catch ( e ) {}

			// We make sure there are all options
			$.extend( {}, this.alphaOptions, {
				alphaEnabled: false,
				alphaCustomWidth: 130,
				alphaReset: false,
				alphaColorType: 'hex',
				alphaColorWithSpace: false,
				alphaSkipDebounce: false,
				alphaDebounceTimeout: 100,
			} );

			this._super();
		},
		/**
		 * Binds event listeners to the Iris.
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_addInputListeners: function ( input ) {
			var self = this,
				callback = function ( event ) {
					var val = input.val(),
						color = new Color( val ),
						val = val.replace( /^(#|(rgb|hsl)a?)/, '' ),
						type = self.alphaOptions.alphaColorType;

					input.removeClass( 'iris-error' );

					if ( ! color.error ) {
						// let's not do this on keyup for hex shortcodes
						if (
							'hex' !== type ||
							! (
								event.type === 'keyup' &&
								val.match( /^[0-9a-fA-F]{3}$/ )
							)
						) {
							// Compare color ( #AARRGGBB )
							if (
								color.toIEOctoHex() !==
								self._color.toIEOctoHex()
							) {
								self._setOption(
									'color',
									self._getColor( color )
								);
							}
						}
					} else if ( val !== '' ) {
						input.addClass( 'iris-error' );
					}
				};

			input.on( 'change', callback );

			if( ! self.alphaOptions.alphaSkipDebounce ) {
				input.on( 'keyup', self._debounce( callback, self.alphaOptions.alphaDebounceTimeout ) );
			}

			// If we initialized hidden, show on first focus. The rest is up to you.
			if ( self.options.hide ) {
				input.one( 'focus', function () {
					self.show();
				} );
			}
		},
		/**
		 * Init Controls
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_initControls: function () {
			this._super();

			if ( this.alphaOptions.alphaEnabled ) {
				// Create Alpha controls
				var self = this,
					stripAlpha = self.controls.strip.clone( false, false ),
					stripAlphaSlider = stripAlpha.find( '.iris-slider-offset' ),
					controls = {
						stripAlpha: stripAlpha,
						stripAlphaSlider: stripAlphaSlider,
					};

				stripAlpha.addClass( 'iris-strip-alpha' );
				stripAlphaSlider.addClass( 'iris-slider-offset-alpha' );
				stripAlpha.appendTo( self.picker.find( '.iris-picker-inner' ) );

				// Push new controls
				$.each( controls, function ( k, v ) {
					self.controls[ k ] = v;
				} );

				// Create slider
				self.controls.stripAlphaSlider.slider( {
					orientation: 'vertical',
					min: 0,
					max: 100,
					step: 1,
					value: parseInt( self._color._alpha * 100 ),
					slide: function ( event, ui ) {
						self.active = 'strip';
						// Update alpha value
						self._color._alpha = parseFloat( ui.value / 100 );
						self._change.apply( self, arguments );
					},
				} );
			}
		},
		/**
		 * Create the controls sizes
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @param {bool} reset Set to True for recreate the controls sizes.
		 *
		 * @return {void}
		 */
		_dimensions: function ( reset ) {
			this._super( reset );

			if ( this.alphaOptions.alphaEnabled ) {
				var self = this,
					opts = self.options,
					controls = self.controls,
					square = controls.square,
					strip = self.picker.find( '.iris-strip' ),
					innerWidth,
					squareWidth,
					stripWidth,
					stripMargin,
					totalWidth;

				/**
				 * I use Math.round() to avoid possible size errors,
				 * this function returns the value of a number rounded
				 * to the nearest integer.
				 *
				 * The width to append all widgets,
				 * if border is enabled, 22 is subtracted.
				 * 20 for css left and right property
				 * 2 for css border
				 */
				innerWidth = Math.round(
					self.picker.outerWidth( true ) - ( opts.border ? 22 : 0 )
				);
				// The width of the draggable, aka square.
				squareWidth = Math.round( square.outerWidth() );
				// The width for the sliders
				stripWidth = Math.round( ( innerWidth - squareWidth ) / 2 );
				// The margin for the sliders
				stripMargin = Math.round( stripWidth / 2 );
				// The total width of the elements.
				totalWidth = Math.round(squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) );

				// Check and change if necessary.
				while ( totalWidth > innerWidth ) {
					stripWidth = Math.round( stripWidth - 2 );
					stripMargin = Math.round( stripMargin - 1 );
					totalWidth = Math.round( squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) );
				}

				square.css( 'margin', '0' );
				strip
					.width( stripWidth )
					.css( 'margin-left', stripMargin + 'px' );
			}
		},
		/**
		 * Callback to update the controls and the current color.
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_change: function () {
			var self = this,
				active = self.active;

			self._super();

			if ( self.alphaOptions.alphaEnabled ) {
				var	controls = self.controls,
					alpha = parseInt( self._color._alpha * 100 ),
					color = self._color.toRgb(),
					gradient = [
						'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
						'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
					],
					target = self.picker
						.closest( '.wp-picker-container' )
						.find( '.wp-color-result' );

				self.options.color = self._getColor();
				// Generate background slider alpha, only for CSS3.
				controls.stripAlpha.css( {'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + backgroundImage + ')' } );
				// Update alpha value
				if ( active ) {
					controls.stripAlphaSlider.slider( 'value', alpha );
				}

				if ( ! self._color.error ) {
					self.element.removeClass( 'iris-error' ).val( self.options.color );
				}

				self.picker
					.find( '.iris-palette-container' )
					.on( 'click.palette', '.iris-palette', function () {
						var color = $( this ).data( 'color' );
						if ( self.alphaOptions.alphaReset ) {
							self._color._alpha = 1;
							color = self._getColor();
						}
						self._setOption( 'color', color );
					} );
			}
		},
		/**
		 * Paint dimensions.
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @param {string} origin  Origin (position).
		 * @param {string} control Type of the control,
		 *
		 * @return {void}
		 */
		_paintDimension: function ( origin, control ) {
			var self = this,
				color = false;

			// Fix for slider hue opacity.
			if ( self.alphaOptions.alphaEnabled && 'strip' === control ) {
				color = self._color;
				self._color = new Color( color.toString() );
				self.hue = self._color.h();
			}

			self._super( origin, control );

			// Restore the color after paint.
			if ( color ) {
				self._color = color;
			}
		},
		/**
		 * To update the options, see original source to view the available options.
		 *
		 * @since 3.0.0
		 *
		 * @param {string} key   The Option name.
		 * @param {mixed} value  The Option value to update.
		 *
		 * @return {void}
		 */
		_setOption: function ( key, value ) {
			var self = this;
			if ( 'color' === key && self.alphaOptions.alphaEnabled ) {
				// cast to string in case we have a number
				value = '' + value;
				newColor = new Color( value ).setHSpace( self.options.mode );
				// Check if error && Check the color to prevent callbacks with the same color.
				if (
					! newColor.error &&
					self._getColor( newColor ) !== self._getColor()
				) {
					self._color = newColor;
					self.options.color = self._getColor();
					self.active = 'external';
					self._change();
				}
			} else {
				return self._super( key, value );
			}
		},
		/**
		 * 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.0.0
		 *
		 * @return {string} The element's color.
		 */
		color: function ( newColor ) {
			if ( newColor === true ) {
				return this._color.clone();
			}
			if ( newColor === undef ) {
				return this._getColor();
			}
			this.option( 'color', newColor );
		},
	} );

	/**
	 * wpColorPicker
	 */
	$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
		/**
		 * Alpha options
		 *
		 * @since 3.0.0
		 *
		 * @type {Object}
		 */
		alphaOptions: {
			alphaEnabled: false,
		},
		/**
		 * Get the alpha options.
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {object} The current alpha options.
		 */
		_getAlphaOptions: function () {
			var el = this.element,
				type = ( el.data( 'type' ) || this.options.type ),
				color = ( el.data( 'defaultColor' ) || el.val() ),
				options = {
					alphaEnabled: ( el.data( 'alphaEnabled' ) || false ),
					alphaCustomWidth: 130,
					alphaReset: false,
					alphaColorType: 'rgb',
					alphaColorWithSpace: false,
					alphaSkipDebounce: ( !!el.data( 'alphaSkipDebounce' ) || false ),
				};

			if ( options.alphaEnabled ) {
				options.alphaEnabled = ( el.is( 'input' ) && 'full' === type );
			}

			if ( ! options.alphaEnabled ) {
				return options;
			}

			options.alphaColorWithSpace = ( color && color.match( /\s/ ) );

			$.each( options, function ( name, defaultValue ) {
				var value = ( el.data( name ) || defaultValue );
				switch ( name ) {
					case 'alphaCustomWidth':
						value = ( value ? parseInt( value, 10 ) : 0 );
						value = ( isNaN( value ) ? defaultValue : value );
						break;
					case 'alphaColorType':
						if ( ! value.match( /^(hex|(rgb|hsl)a?)$/ ) ) {
							if ( color && color.match( /^#/ ) ) {
								value = 'hex';
							} else if ( color && color.match( /^hsla?/ ) ) {
								value = 'hsl';
							} else {
								value = defaultValue;
							}
						}
						break;
					default:
						value = !! value;
						break;
				}
				options[ name ] = value;
			} );

			return options;
		},
		/**
		 * Create widget
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_create: function () {
			// Return early if Iris support is missing.
			if ( ! $.support.iris ) {
				return;
			}

			// Set the alpha options for the current instance.
			this.alphaOptions = this._getAlphaOptions();

			// Create widget.
			this._super();
		},
		/**
		 * Binds event listeners to the color picker and create options, etc...
		 *
		 * @since 3.0.0
		 * @access private
		 *
		 * @return {void}
		 */
		_addListeners: function () {
			if ( ! this.alphaOptions.alphaEnabled ) {
				return this._super();
			}

			var self = this,
				el = self.element,
				isDeprecated = self.toggler.is( 'a' );

			this.alphaOptions.defaultWidth = el.width();
			if ( this.alphaOptions.alphaCustomWidth ) {
				el.width(
					parseInt(
						this.alphaOptions.defaultWidth +
							this.alphaOptions.alphaCustomWidth,
						10
					)
				);
			}

			self.toggler.css( {
				'position': 'relative',
				'background-image': 'url(' + backgroundImage + ')',
			} );

			if ( isDeprecated ) {
				self.toggler.html( '<span class="color-alpha" />' );
			} else {
				self.toggler.append( '<span class="color-alpha" />' );
			}

			self.colorAlpha = self.toggler.find( 'span.color-alpha' ).css( {
				'width': '30px',
				'height': '100%',
				'position': 'absolute',
				'top': 0,
				'background-color': el.val(),
			} );

			// Define the correct position for ltr or rtl direction.
			if ( 'ltr' === self.colorAlpha.css( 'direction' ) ) {
				self.colorAlpha.css( {
					'border-bottom-left-radius': '2px',
					'border-top-left-radius': '2px',
					'left': 0,
				} );
			} else {
				self.colorAlpha.css( {
					'border-bottom-right-radius': '2px',
					'border-top-right-radius': '2px',
					'right': 0,
				} );
			}

			el.iris( {
				/**
				 * @summary Handles the onChange event if one has been defined in the options.
				 *
				 * Handles the onChange event if one has been defined in the options and additionally
				 * sets the background color for the toggler element.
				 *
				 * @since 3.0.0
				 *
				 * @param {Event} event    The event that's being called.
				 * @param {HTMLElement} ui The HTMLElement containing the color picker.
				 *
				 * @returns {void}
				 */
				change: function ( event, ui ) {
					self.colorAlpha.css( {
						'background-color': ui.color.to_s(
							self.alphaOptions.alphaColorType
						),
					} );

					// fire change callback if we have one
					if ( typeof self.options.change === 'function' ) {
						self.options.change.call( this, event, ui );
					}
				},
			} );

			/**
			 * Prevent any clicks inside this widget from leaking to the top and closing it.
			 *
			 * @since 3.0.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.0.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.0.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @return {void}
			 */
			el.on( 'change', function ( event ) {
				var val = $( this ).val();

				if (
					el.hasClass( 'iris-error' ) ||
					val === '' ||
					val.match( /^(#|(rgb|hsl)a?)$/ )
				) {
					if ( isDeprecated ) {
						self.toggler.removeAttr( 'style' );
					}

					self.colorAlpha.css( 'background-color', '' );

					// 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.0.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @return {void}
			 */
			self.button.on( 'click', function ( event ) {
				if ( $( this ).hasClass( 'wp-picker-default' ) ) {
					el.val( self.options.defaultColor ).change();
				} else if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
					el.val( '' );
					if ( isDeprecated ) {
						self.toggler.removeAttr( 'style' );
					}

					self.colorAlpha.css( 'background-color', '' );

					// fire clear callback if we have one
					if ( typeof self.options.clear === 'function' ) {
						self.options.clear.call( this, event );
					}

					el.trigger( 'change' );
				}
			} );
		},
	} );
} )( jQuery );
// source --> https://cathydou.com/wp-content/plugins/acf-frontend-form-element-pro//includes/assets/js/pro/recaptcha.min.js?ver=6.3.16 
function acfef_recaptcha(){(function(c){"undefined"!==typeof acf&&c.each(acf.getFields({type:"acfef_recaptcha"}),function(a,b){b.render()})})(jQuery)}
(function(c){"undefined"!==typeof acf&&(c=acf.Field.extend({type:"acfef_recaptcha",actions:{validation_failure:"validationFailure"},$control:function(){return this.$(".acfef-field-recaptcha")},$input:function(){return this.$('input[type="hidden"]')},$selector:function(){return this.$control().find("> div")},selector:function(){return this.$selector()[0]},version:function(){return this.get("version")},render:function(){var a=this;"v2"===this.version()?this.recaptcha=grecaptcha.render(a.selector(),
{sitekey:a.$control().data("site-key"),theme:a.$control().data("theme"),size:a.$control().data("size"),callback:function(b){a.$input().val(b).change();a.$input().closest(".acf-input").find("> .acf-notice.-error").hide()},"error-callback":function(){a.$input().val("error").change()},"expired-callback":function(){a.$input().val("expired").change()}}):"v3"===this.version()&&grecaptcha.ready(function(){grecaptcha.execute(a.$control().data("site-key"),{action:"homepage"}).then(function(b){a.$input().val(b).change();
a.$input().closest(".acf-input").find("> .acf-notice.-error").hide()})})},validationFailure:function(a){"v2"===this.version()&&grecaptcha.reset(this.recaptcha)}}),acf.registerFieldType(c))})(jQuery);
// source --> https://cathydou.com/wp-content/plugins/ultimate-member/assets/js/um-gdpr.min.js?ver=2.11.4 
jQuery(document).on("click","a.um-toggle-gdpr",function(e){var e=jQuery(e.currentTarget),t=e.closest(".um-field-area"),g=t.find(".um-gdpr-content");g.is(":visible")?(t.find("a.um-toggle-gdpr").text(e.data("toggle-show")),g.hide().find("a.um-toggle-gdpr").remove(),e.length&&e.get(0).scrollIntoView()):(t.find("a.um-toggle-gdpr").text(e.data("toggle-hide")),g.show().prepend(e.clone()))});
// source --> https://cathydou.com/wp-content/plugins/mortgage-loan-calculator/en/widget-nj.js?ver=dae28406e26b5ff7d4a4bbbaed27c0ba 
/*
 * MLCalc.com
 *
 * Copyright (c) 2008-2021 ARSIDIAN LLC
 *
 */

function initializeMLCalcWidget(){
	var iframeHeight = 0;

	if(!jQuery('#MLCalcHolder, #MLCalcShader, #MLCalcClose').length) jQuery('body').prepend('<div id="MLCalcHolder"></div><div id="MLCalcShader"></div><div id="MLCalcClose" style="display:none">X</div>');

	jQuery('#MLCalcFormMortgageForm #dp INPUT').bind('keyup', function(){return calcDPValue()});
	jQuery('#MLCalcFormMortgageForm #ma INPUT').bind('keyup', function(){return calcDPValue()});
	jQuery('#MLCalcFormMortgageForm #dp INPUT').trigger('keyup');
	jQuery('#MLCalcFormMortgageForm').attr('autocomplete', 'off');
	jQuery('#MLCalcFormLoanForm').attr('autocomplete', 'off');

	jQuery('#MLCalcFormLoanForm').bind('submit', function(){
		if(typeof(mlcalc_amortization) == 'undefined') mlcalc_amortization = 'none';
		if(validateForm(jQuery(this)) == false) return false;
		iframeHeight = (mlcalc_amortization == 'none') ? 310 : 570;
		initFloatLayer(iframeHeight);
		jQuery(this).attr('target', 'MLCalcFrame');
	});
	jQuery('#MLCalcFormMortgageForm').bind('submit', function(){
		if(typeof(mlcalc_amortization) == 'undefined') mlcalc_amortization = 'none';
		if(validateForm(jQuery(this)) == false) return false;
		iframeHeight = (mlcalc_amortization == 'none') ? 327 : 578;
		initFloatLayer(iframeHeight);
		jQuery(this).attr('target', 'MLCalcFrame');
	});
	var now = new Date();
	jQuery('#MLCalcFormMortgageForm, #MLCalcFormLoanForm').each(function(i){
		jQuery('SELECT[name=sm] OPTION[value=' + (now.getMonth() + 1 > 12 ? 1 : now.getMonth() + 1) + '], SELECT[name=sy] OPTION[value=' + now.getFullYear() + ']', this).attr('selected', 'selected');
	});
};
function initFloatLayer(iframeHeight){
	var viewportWidth  = jQuery(window).width();
	var viewportHeight = jQuery(window).height();

	var documentWidth  = 0;
	var documentHeight = 0;
	var viewportLeft   = 0;
	var viewportTop    = 0;

	if(document.body){
		documentWidth  = document.body.scrollWidth;
		documentHeight = document.body.scrollHeight;
		viewportLeft   = document.body.scrollLeft;
		viewportTop    = document.body.scrollTop;
	};
	if(document.documentElement){
		documentWidth  = Math.min(documentWidth, document.documentElement.scrollWidth);
		documentHeight = Math.max(documentHeight, document.documentElement.scrollHeight);
		viewportLeft   = Math.max(viewportLeft, document.documentElement.scrollLeft);
		viewportTop    = Math.max(viewportTop, document.documentElement.scrollTop);
	};

    var viewWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
    var frameWidth = Math.min(viewWidth, 740);

	var shaderWidth = Math.max(documentWidth, viewportWidth);
	var shaderHeight = Math.max(documentHeight, viewportHeight);
	jQuery('#MLCalcShader')
		.css({
			width:shaderWidth,
			height:shaderHeight,
			top:0,
			left:0,
			opacity:'0.5'
		})
		.show()
		.click(function(){
			mlcalcHideAll();
		});

	var holderLeft = parseInt((viewportWidth - frameWidth) / 2) + viewportLeft;
	var holderTop  = parseInt((viewportHeight - iframeHeight) / 2) + viewportTop;
	if(holderLeft < 0) holderLeft = 0;
	if(holderTop < 0) holderTop = 0;
	mlcalcFrameIsShown = true;
	jQuery('#MLCalcHolder')
		.css({
			width:frameWidth,
			height:iframeHeight,
			top:holderTop,
			left:holderLeft
		})
		.show();

	if(jQuery('#MLCalcHolder #MLCalcFrame').length < 1){
		jQuery('#MLCalcHolder').html('<iframe src="#" scrolling="no" id="MLCalcFrame" name="MLCalcFrame" width="0" height="0" frameborder="0" allowtransparency="true" style="background-color: transparent; display: none"></iframe><iframe id="garbageFrame" style="display:none"></iframe>')
	};
	jQuery(document).keyup(function(e) {
		if (e.keyCode == 27) mlcalcHideAll();
	});
	jQuery('#MLCalcHolder').find('#MLCalcFrame').css({width:frameWidth, height:iframeHeight}).on("load", function(){
		jQuery(this).show();
		jQuery('#MLCalcHolder #garbageFrame').attr('src', '');
		jQuery('#MLCalcClose').show().css({height:25, width:25}).css({top:holderTop, left:holderLeft+jQuery('#MLCalcHolder').width()-2-jQuery('#MLCalcClose').width()})
			.click(function(){
				mlcalcHideAll();
			})
			.hover(function(){
				jQuery(this).css({background:'#F5F5F5', color:'#808080'});
			}, function(){
				jQuery(this).css({background:'#D5D5D5', color:'#F5F5F5'});
			});
	});
};
function mlcalcHideAll(){
	if(!mlcalcFrameIsShown) return false;
	mlcalcFrameIsShown = false;
	jQuery('#MLCalcShader').fadeOut(300);
	jQuery('#MLCalcHolder, #MLCalcClose').hide();
	jQuery('#MLCalcFrame').remove();
};
function validateForm(form){
	var validations = {
		'ma':{
			'minval' : 1, 'maxval' : 999999999, 'required' : true,
			'errmsg' : "Purchase price must be in the range from 1 to 999,999,999"
		},
		'dp':{
			'minval' : 0, 'maxval' : 99, 'required' : false,
			'errmsg' : "Down payment must be in the range from 0 to 99"
		},
		'mt':{
			'minval' : 1, 'maxval' : 100, 'required' : true,
			'errmsg' : "Mortgage term must be in the range from 1 to 100"
		},
		'pt':{
			'minval' : 0, 'maxval' : 999999, 'required' : false,
			'errmsg' : "Property tax must be in the range from 0 to 999,999"
		},
		'pi':{
			'minval' : 0, 'maxval' : 999999, 'required' : false,
			'errmsg' : "Property insurance must be in the range from 0 to 999,999"
		},
		'mi':{
			'minval' : 0, 'maxval' : 99.99, 'required' : false,
			'errmsg' : "PMI must be in the range from 0 to 99.99"
		},
		'la':{
			'minval' : 1, 'maxval' : 999999999, 'required' : true,
			'errmsg' : "Loan amount must be in the range from 1 to 999,999,999"
		},
		'lt':{
			'minval' : 1, 'maxval' : 100, 'required' : true,
			'errmsg' : "Loan term must be in the range from 1 to 100"
		},
		'ir':{
			'minval' : 0.01, 'maxval' : 99.99, 'required' : true,
			'errmsg' : "Interest rate must be in the range from 0.01 to 99.99"
		}
	};
	var toSubmit = true;
	form.find('.valid').each(function(){
		var val  = parseFloat(jQuery(this).val().replace(/[^0-9\.]/g));
		var name = jQuery(this).attr('name');
		if((val == 'null' || isNaN(val)) && (validations[name]['required'] === false)) return true;
		if(val < validations[name]['minval'] || val > validations[name]['maxval'] || (val == 'null' || isNaN(val))){
			alert(validations[name]['errmsg']);
			jQuery(this).select();
			toSubmit = false;
			return false;
		};
	});
	return toSubmit;
};

function formatNum(num){
	return num.toString().replace(/(\d+)(\d{3})/, function(num, num1, num2){
		return ((num1.length < 3) ? num1 : formatNum(num1)) + "," + num2;
	});
};
function calcDPValue(){
	var ma = parseFloat(jQuery('#MLCalcFormMortgageForm #ma INPUT').val().replace(/[^0-9\.]/g, ''));
	var dp = parseFloat(jQuery('#MLCalcFormMortgageForm #dp INPUT').val());
	if(dp < 100) jQuery('#MLCalcFormMortgageForm #downPaymentValue').html('(' + mlcalc_currency_symbol + '' + formatNum(Math.round(ma * dp / 100)) + ')');
	if(dp >= 20){
		jQuery('#MLCalcFormMortgageForm #mi *').attr('disabled', 'disabled').addClass('disabled');
	} else {
		jQuery('#MLCalcFormMortgageForm #mi *').removeAttr('disabled').removeClass('disabled');
	};
};

mlcalcFrameIsShown = false;





if(typeof mlcalc_jquery_noconflict != "undefined") jQuery.noConflict();

if(typeof mlcalc_no_write == "undefined"){
	jQuery(document).ready(function() {
		initializeMLCalcWidget();
	});
} else {
	jQuery('#mlcalcWidgetHolder').prepend(FORM);
	initializeMLCalcWidget();
};


var _mlcalc_preload_img = new Image(312,44);
if(typeof(mlcalc_cdn_protocol) != 'undefined') _mlcalc_preload_img.src="https://www.mlcalc.com/themes/mlcalc/images/ajax-loader.gif";