/* HTML5 Placeholder jQuery Plugin - v2.3.1 * Copyright (c)2015 Mathias Bynens * 2015-12-16 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?e(require("jquery")):e(jQuery)}(function(e){var t,a,l=!1,o="[object OperaMini]"===Object.prototype.toString.call(window.operamini),r="placeholder"in document.createElement("input")&&!o&&!l,s="placeholder"in document.createElement("textarea")&&!o&&!l,c=e.valHooks,d=e.propHooks,i={};function n(t,a){var o=e(this);if(this.value===o.attr(l?"placeholder-x":"placeholder")&&o.hasClass(i.customClass))if(this.value="",o.removeClass(i.customClass),o.data("placeholder-password")){if(o=o.hide().nextAll('input[type="password"]:eq( 0 )').show().attr("id",o.removeAttr("id").data("placeholder-id")),!0===t)return o[0].value=a,a;o.focus()}else this==p()&&this.select()}function u(t){var a,o,r,s,c=e(this),d=this.id;if(!t||"blur"!==t.type||!c.hasClass(i.customClass))if(""===this.value){if("password"===this.type){if(!c.data("placeholder-textinput")){try{a=c.clone().prop({type:"text"})}catch(t){a=e("").attr(e.extend((o=this,r={},s=/^jQuery\d+$/,e.each(o.attributes,function(e,t){t.specified&&!s.test(t.name)&&(r[t.name]=t.value)}),r),{type:"text"}))}a.removeAttr("name").data({"placeholder-enabled":!0,"placeholder-password":c,"placeholder-id":d}).on("focus.placeholder",n),c.data({"placeholder-textinput":a,"placeholder-id":d}).before(a)}this.value="",c=c.removeAttr("id").hide().prevAll('input[type="text"]:eq( 0 )').attr("id",c.data("placeholder-id")).show()}else{var u=c.data("placeholder-password");u&&(u[0].value="",c.attr("id",c.data("placeholder-id")).show().nextAll('input[type="password"]').last().hide().removeAttr("id"))}c.addClass(i.customClass),c[0].value=c.attr(l?"placeholder-x":"placeholder")}else c.removeClass(i.customClass)}function p(){try{return document.activeElement}catch(e){}}r&&s?((a=e.fn.placeholder=function(){return this}).input=!0,a.textarea=!0):((a=e.fn.placeholder=function(t){return i=e.extend({},{customClass:"placeholder"},t),this.filter((r?"textarea":":input")+"["+(l?"placeholder-x":"placeholder")+"]").not("."+i.customClass).not(":radio, :checkbox, [type=hidden]").on({"focus.placeholder":n,"blur.placeholder":u}).data("placeholder-enabled",!0).trigger("blur.placeholder")}).input=r,a.textarea=s,t={get:function(t){var a=e(t),l=a.data("placeholder-password");return l?l[0].value:a.data("placeholder-enabled")&&a.hasClass(i.customClass)?"":t.value},set:function(t,a){var l,o,r=e(t);return""!==a&&(l=r.data("placeholder-textinput"),o=r.data("placeholder-password"),l?(n.call(l[0],!0,a)||(t.value=a),l[0].value=a):o&&(n.call(t,!0,a)||(o[0].value=a),t.value=a)),r.data("placeholder-enabled")?(""===a?(t.value=a,t!=p()&&u.call(t)):(r.hasClass(i.customClass)&&n.call(t),t.value=a),r):(t.value=a,r)}},r||(c.input=t,d.value=t),s||(c.textarea=t,d.value=t),e(function(){e(document).on("form","submit.placeholder",function(){var t=e("."+i.customClass,this).each(function(){n.call(this,!0,"")});setTimeout(function(){t.each(u)},10)})}),e(window).on("beforeunload.placeholder",function(){var t=!0;try{"javascript:void(0)"===document.activeElement.toString()&&(t=!1)}catch(e){}t&&e("."+i.customClass).each(function(){this.value=""})}))});