/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.maskedtextbox.min",["kendo.core.min"],e)}(function(){return function(e,t){var n=window.kendo,s=n.caret,i=n.keys,o=n.ui,a=o.Widget,r=".kendoMaskedTextBox",l=e.proxy,u=(n.support.propertyChangeEvent?"propertychange":"input")+r,m="k-state-disabled",_="disabled",h="readonly",d="change",p=a.extend({init:function(t,i){var o,l,u=this;a.fn.init.call(u,t,i),u._rules=e.extend({},u.rules,u.options.rules),t=u.element,o=t[0],u.wrapper=t,u._tokenize(),u._form(),u.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+r,function(){var e=o.value;e?u._togglePrompt(!0):o.value=u._old=u._emptyMask,u._oldValue=e,u._timeoutId=setTimeout(function(){s(t,0,e?u._maskLength:0)})}).on("focusout"+r,function(){var e=t.val();clearTimeout(u._timeoutId),o.value=u._old="",e!==u._emptyMask&&(o.value=u._old=e),u._change(),u._togglePrompt()}),l=t.is("[disabled]")||e(u.element).parents("fieldset").is(":disabled"),l?u.enable(!1):u.readonly(t.is("[readonly]")),u.value(u.options.value||t.val()),n.notify(u)},options:{name:"MaskedTextBox",clearPromptChar:!1,unmaskOnPost:!1,promptChar:"_",culture:"",rules:{},value:"",mask:""},events:[d],rules:{0:/\d/,9:/\d|\s/,"#":/\d|\s|\+|\-/,L:/[a-zA-Z]/,"?":/[a-zA-Z]|\s/,"&":/\S/,C:/./,A:/[a-zA-Z0-9]/,a:/[a-zA-Z0-9]|\s/},setOptions:function(t){var n=this;a.fn.setOptions.call(n,t),n._rules=e.extend({},n.rules,n.options.rules),n._tokenize(),this._unbindInput(),this._bindInput(),n.value(n.element.val())},destroy:function(){var e=this;e.element.off(r),e._formElement&&(e._formElement.off("reset",e._resetHandler),e._formElement.off("submit",e._submitHandler)),a.fn.destroy.call(e)},raw:function(){var e=this._unmask(this.element.val(),0);return e.replace(RegExp(this.options.promptChar,"g"),"")},value:function(e){var s=this.element,i=this._emptyMask;return e===t?this.element.val():(null===e&&(e=""),i?(e=this._unmask(e+""),s.val(e?i:""),this._mask(0,this._maskLength,e),e=s.val(),this._oldValue=e,n._activeElement()!==s&&(e===i?s.val(""):this._togglePrompt()),t):(s.val(e),t))},_togglePrompt:function(e){var t=this.element[0],n=t.value;this.options.clearPromptChar&&(n=e?this._oldValue:n.replace(RegExp(this.options.promptChar,"g")," "),t.value=this._old=n)},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},_bindInput:function(){var e=this;e._maskLength&&e.element.on("keydown"+r,l(e._keydown,e)).on("keypress"+r,l(e._keypress,e)).on("paste"+r,l(e._paste,e)).on(u,l(e._propertyChange,e))},_unbindInput:function(){this.element.off("keydown"+r).off("keypress"+r).off("paste"+r).off(u)},_editable:function(e){var t=this,n=t.element,s=e.disable,i=e.readonly;t._unbindInput(),i||s?n.attr(_,s).attr(h,i).toggleClass(m,s):(n.removeAttr(_).removeAttr(h).removeClass(m),t._bindInput())},_change:function(){var e=this,t=e.value();t!==e._oldValue&&(e._oldValue=t,e.trigger(d),e.element.trigger(d))},_propertyChange:function(){var e,t,i=this,o=i.element[0],a=o.value;n._activeElement()===o&&(a===i._old||i._pasting||(t=s(o)[0],e=i._unmask(a.substring(t),t),o.value=i._old=a.substring(0,t)+i._emptyMask.substring(t),i._mask(t,t,e),s(o,t)))},_paste:function(e){var t=this,n=e.target,i=s(n),o=i[0],a=i[1],r=t._unmask(n.value.substring(a),a);t._pasting=!0,setTimeout(function(){var e=n.value,i=e.substring(o,s(n)[0]);n.value=t._old=e.substring(0,o)+t._emptyMask.substring(o),t._mask(o,o,i),o=s(n)[0],t._mask(o,o,r),s(n,o),t._pasting=!1})},_form:function(){var t=this,n=t.element,s=n.attr("form"),i=s?e("#"+s):n.closest("form");i[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._submitHandler=function(){t.element[0].value=t._old=t.raw()},t.options.unmaskOnPost&&i.on("submit",t._submitHandler),t._formElement=i.on("reset",t._resetHandler))},_keydown:function(e){var n,o=e.keyCode,a=this.element[0],r=s(a),l=r[0],u=r[1],m=o===i.BACKSPACE;m||o===i.DELETE?(l===u&&(m?l-=1:u+=1,n=this._find(l,m)),n!==t&&n!==l?(m&&(n+=1),s(a,n)):l>-1&&this._mask(l,u,"",m),e.preventDefault()):o===i.ENTER&&this._change()},_keypress:function(e){var t,n;0===e.which||e.metaKey||e.ctrlKey||e.keyCode===i.ENTER||(t=String.fromCharCode(e.which),n=s(this.element),this._mask(n[0],n[1],t),(e.keyCode===i.BACKSPACE||t)&&e.preventDefault())},_find:function(e,t){var n=this.element.val()||this._emptyMask,s=1;for(t===!0&&(s=-1);e>-1||e<=this._maskLength;){if(n.charAt(e)!==this.tokens[e])return e;e+=s}return-1},_mask:function(e,i,o,a){var r,l,u,m,_=this.element[0],h=_.value||this._emptyMask,d=this.options.promptChar,p=0;for(e=this._find(e,a),e>i&&(i=e),l=this._unmask(h.substring(i),i),o=this._unmask(o,e),r=o.length,o&&(l=l.replace(RegExp("^_{0,"+r+"}"),"")),o+=l,h=h.split(""),u=o.charAt(p);e<this._maskLength;)h[e]=u||d,u=o.charAt(++p),m===t&&p>r&&(m=e),e=this._find(e+1);_.value=this._old=h.join(""),n._activeElement()===_&&(m===t&&(m=this._maskLength),s(_,m))},_unmask:function(t,n){var s,i,o,a,r,l,u,m;if(!t)return"";for(t=(t+"").split(""),o=0,a=n||0,r=this.options.promptChar,l=t.length,u=this.tokens.length,m="";a<u&&(s=t[o],i=this.tokens[a],s===i||s===r?(m+=s===r?r:"",o+=1,a+=1):"string"!=typeof i?((i.test&&i.test(s)||e.isFunction(i)&&i(s))&&(m+=s,a+=1),o+=1):a+=1,!(o>=l)););return m},_tokenize:function(){for(var e,t,s,i,o=[],a=0,r=this.options.mask||"",l=r.split(""),u=l.length,m=0,_="",h=this.options.promptChar,d=n.getCulture(this.options.culture).numberFormat,p=this._rules;m<u;m++)if(e=l[m],t=p[e])o[a]=t,_+=h,a+=1;else for("."===e||","===e?e=d[e]:"$"===e?e=d.currency.symbol:"\\"===e&&(m+=1,e=l[m]),e=e.split(""),s=0,i=e.length;s<i;s++)o[a]=e[s],_+=e[s],a+=1;this.tokens=o,this._emptyMask=_,this._maskLength=_.length}});o.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.maskedtextbox.min.js.map
