?
Current Path : /home1/savoy/www/savoyglobal.net/chess2015open/assets/js/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/chess2015open/assets/js/maskedinput.min.js |
/* Input Mask plugin for jquery http://github.com/RobinHerbots/jquery.inputmask Copyright (c) 2010 - 2013 Robin Herbots Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) Version: 0.0.0 */ (function(e){if(e.fn.inputmask===undefined){var t={};function n(e){var t=document.createElement("input"),e="on"+e,n=e in t;if(!n){t.setAttribute(e,"return;");n=typeof t[e]=="function"}t=null;return n}function r(n,i){var s=t.aliases[n];if(s){if(s.alias)r(s.alias);e.extend(true,t,s);e.extend(true,t,i);return true}return false}function s(n){if(t.numericInput){n=n.split("").reverse().join("")}var r=false,i=0,s=t.greedy,o=t.repeat;if(o=="*")s=false;if(n.length==1&&s==false&&o!=0){t.placeholder=""}var u=e.map(n.split(""),function(e,n){var s=[];if(e==t.escapeChar){r=true}else if(e!=t.optionalmarker.start&&e!=t.optionalmarker.end||r){var o=t.definitions[e];if(o&&!r){for(var u=0;u<o.cardinality;u++){s.push(a(i+u))}}else{s.push(e);r=false}i+=s.length;return s}});var f=u.slice();for(var l=1;l<o&&s;l++){f=f.concat(u.slice())}return{mask:f,repeat:o,greedy:s}}function o(n){if(t.numericInput){n=n.split("").reverse().join("")}var r=false,i=false;var s=false;return e.map(n.split(""),function(e,n){var o=[];if(e==t.escapeChar){i=true}else if(e==t.optionalmarker.start&&!i){r=true;s=true}else if(e==t.optionalmarker.end&&!i){r=false;s=true}else{var u=t.definitions[e];if(u&&!i){var a=u["prevalidator"],f=a?a.length:0;for(var l=1;l<u.cardinality;l++){var c=f>=l?a[l-1]:[],h=c["validator"],p=c["cardinality"];o.push({fn:h?typeof h=="string"?new RegExp(h):new function(){this.test=h}:new RegExp("."),cardinality:p?p:1,optionality:r,newBlockMarker:r==true?s:false,offset:0,casing:u["casing"],def:u["definitionSymbol"]||e});if(r==true)s=false}o.push({fn:u.validator?typeof u.validator=="string"?new RegExp(u.validator):new function(){this.test=u.validator}:new RegExp("."),cardinality:u.cardinality,optionality:r,newBlockMarker:s,offset:0,casing:u["casing"],def:u["definitionSymbol"]||e})}else{o.push({fn:null,cardinality:0,optionality:r,newBlockMarker:s,offset:0,casing:null,def:e});i=false}s=false;return o}})}function u(){function u(e){return t.optionalmarker.start+e+t.optionalmarker.end}function a(e){var n=0,r=0,s=e.length;for(i=0;i<s;i++){if(e.charAt(i)==t.optionalmarker.start){n++}if(e.charAt(i)==t.optionalmarker.end){r++}if(n>0&&n==r)break}var o=[e.substring(0,i)];if(i<s){o.push(e.substring(i+1,s))}return o}function f(e){var n=e.length;for(i=0;i<n;i++){if(e.charAt(i)==t.optionalmarker.start){break}}var r=[e.substring(0,i)];if(i<n){r.push(e.substring(i+1,n))}return r}function l(t,i,c){var h=a(i);var p,d;var v=f(h[0]);if(v.length>1){p=t+v[0]+u(v[1])+(h.length>1?h[1]:"");if(e.inArray(p,r)==-1&&p!=""){r.push(p);d=s(p);n.push({mask:p,_buffer:d["mask"],buffer:d["mask"].slice(),tests:o(p),lastValidPosition:-1,greedy:d["greedy"],repeat:d["repeat"],metadata:c})}p=t+v[0]+(h.length>1?h[1]:"");if(e.inArray(p,r)==-1&&p!=""){r.push(p);d=s(p);n.push({mask:p,_buffer:d["mask"],buffer:d["mask"].slice(),tests:o(p),lastValidPosition:-1,greedy:d["greedy"],repeat:d["repeat"],metadata:c})}if(f(v[1]).length>1){l(t+v[0],v[1]+h[1],c)}if(h.length>1&&f(h[1]).length>1){l(t+v[0]+u(v[1]),h[1],c);l(t+v[0],h[1],c)}}else{p=t+h;if(e.inArray(p,r)==-1&&p!=""){r.push(p);d=s(p);n.push({mask:p,_buffer:d["mask"],buffer:d["mask"].slice(),tests:o(p),lastValidPosition:-1,greedy:d["greedy"],repeat:d["repeat"],metadata:c})}}}var n=[];var r=[];if(e.isFunction(t.mask)){t.mask=t.mask.call(this,t)}if(e.isArray(t.mask)){e.each(t.mask,function(e,t){if(t["mask"]!=undefined){l("",t["mask"].toString(),t)}else l("",t.toString())})}else l("",t.mask.toString());return t.greedy?n:n.sort(function(e,t){return e["mask"].length-t["mask"].length})}function a(e){return t.placeholder.charAt(e%t.placeholder.length)}var f=navigator.userAgent.match(new RegExp("msie 10","i"))!==null,l=navigator.userAgent.match(new RegExp("iphone","i"))!==null,c=navigator.userAgent.match(new RegExp("android.*safari.*","i"))!==null,h=navigator.userAgent.match(new RegExp("android.*chrome.*","i"))!==null,p=n("paste")&&!f?"paste":n("input")?"input":"propertychange";function d(t,n,r){function f(){return t[n]}function d(){return f()["tests"]}function v(){return f()["_buffer"]}function m(){return f()["buffer"]}function g(i,s,o){function u(e,t,n,i){var s=w(e),o=n?1:0,u="",a=t["buffer"];for(var f=t["tests"][s].cardinality;f>o;f--){u+=N(a,s-(f-1))}if(n){u+=n}return t["tests"][s].fn!=null?t["tests"][s].fn.test(u,a,e,i,r):n==N(t["_buffer"],e,true)||n==r.skipOptionalPartCharacter?{refresh:true,c:N(t["_buffer"],e,true),pos:e}:false}function a(n,r){var o=false;e.each(r,function(t,r){o=e.inArray(r["activeMasksetIndex"],n)==-1&&r["result"]!==false;if(o)return false});if(o){r=e.map(r,function(r,i){if(e.inArray(r["activeMasksetIndex"],n)==-1){return r}else{t[r["activeMasksetIndex"]]["lastValidPosition"]=d}})}else{var a=-1,f=-1;e.each(r,function(t,r){if(e.inArray(r["activeMasksetIndex"],n)!=-1&&r["result"]!==false&(a==-1||a>r["result"]["pos"])){a=r["result"]["pos"];f=r["activeMasksetIndex"]}});r=e.map(r,function(r,o){if(e.inArray(r["activeMasksetIndex"],n)!=-1){if(r["result"]["pos"]==a){return r}else if(r["result"]!==false){for(var l=i;l<a;l++){rsltValid=u(l,t[r["activeMasksetIndex"]],t[f]["buffer"][l],true);if(rsltValid===false){t[r["activeMasksetIndex"]]["lastValidPosition"]=a-1;break}else{T(t[r["activeMasksetIndex"]]["buffer"],l,t[f]["buffer"][l],true);t[r["activeMasksetIndex"]]["lastValidPosition"]=l}}rsltValid=u(a,t[r["activeMasksetIndex"]],s,true);if(rsltValid!==false){T(t[r["activeMasksetIndex"]]["buffer"],a,s,true);t[r["activeMasksetIndex"]]["lastValidPosition"]=a}return r}}})}return r}o=o===true;if(o){var l=u(i,f(),s,o);if(l===true){l={pos:i}}return l}var c=[],l=false,h=n,p=m().slice(),d=f()["lastValidPosition"],v=x(i),g=[];e.each(t,function(e,t){if(typeof t=="object"){n=e;var r=i;var a=f()["lastValidPosition"],v;if(a==d){if(r-d>1){for(var y=a==-1?0:a;y<r;y++){v=u(y,f(),p[y],true);if(v===false){break}else{T(m(),y,p[y],true);if(v===true){v={pos:y}}var w=v.pos||y;if(f()["lastValidPosition"]<w)f()["lastValidPosition"]=w}}}if(!b(r)&&!u(r,f(),s,o)){var x=S(r)-r;for(var N=0;N<x;N++){if(u(++r,f(),s,o)!==false)break}g.push(n)}}if(f()["lastValidPosition"]>=d||n==h){if(r>=0&&r<E()){l=u(r,f(),s,o);if(l!==false){if(l===true){l={pos:r}}var w=l.pos||r;if(f()["lastValidPosition"]<w)f()["lastValidPosition"]=w}c.push({activeMasksetIndex:e,result:l})}}}});n=h;return a(g,c)}function y(){var r=n,i={activeMasksetIndex:0,lastValidPosition:-1,next:-1};e.each(t,function(e,t){if(typeof t=="object"){n=e;if(f()["lastValidPosition"]>i["lastValidPosition"]){i["activeMasksetIndex"]=e;i["lastValidPosition"]=f()["lastValidPosition"];i["next"]=S(f()["lastValidPosition"])}else if(f()["lastValidPosition"]==i["lastValidPosition"]&&(i["next"]==-1||i["next"]>S(f()["lastValidPosition"]))){i["activeMasksetIndex"]=e;i["lastValidPosition"]=f()["lastValidPosition"];i["next"]=S(f()["lastValidPosition"])}}});n=i["lastValidPosition"]!=-1&&t[r]["lastValidPosition"]==i["lastValidPosition"]?r:i["activeMasksetIndex"];if(r!=n){L(m(),S(i["lastValidPosition"]),E());f()["writeOutBuffer"]=true}o.data("_inputmask")["activeMasksetIndex"]=n}function b(e){var t=w(e);var n=d()[t];return n!=undefined?n.fn:false}function w(e){return e%d().length}function E(){return r.getMaskLength(v(),f()["greedy"],f()["repeat"],m(),r)}function S(e){var t=E();if(e>=t)return t;var n=e;while(++n<t&&!b(n)){}return n}function x(e){var t=e;if(t<=0)return 0;while(--t>0&&!b(t)){}return t}function T(e,t,n,r){if(r)t=C(e,t);var i=d()[w(t)];var s=n;if(s!=undefined&&i!=undefined){switch(i.casing){case"upper":s=n.toUpperCase();break;case"lower":s=n.toLowerCase();break}}e[t]=s}function N(e,t,n){if(n)t=C(e,t);return e[t]}function C(e,t){var n;while(e[t]==undefined&&e.length<E()){n=0;while(v()[n]!==undefined){e.push(v()[n++])}}return t}function k(e,t,n){e._valueSet(t.join(""));if(n!=undefined){B(e,n)}}function L(e,t,n,r){for(var i=t,s=E();i<n&&i<s;i++){if(r===true){if(!b(i))T(e,i,"")}else T(e,i,N(v().slice(),i,true))}}function A(e,t){var n=w(t);T(e,t,N(v(),n))}function O(r,i,s,o,u){var a=o!=undefined?o.slice():_(r._valueGet()).split("");e.each(t,function(e,t){if(typeof t=="object"){t["buffer"]=t["_buffer"].slice();t["lastValidPosition"]=-1;t["p"]=-1}});if(s!==true)n=0;if(i)r._valueSet("");var l=E();e.each(a,function(t,n){if(u===true){var o=f()["p"],a=o==-1?o:x(o),l=a==-1?t:S(a);if(e.inArray(n,v().slice(a+1,l))==-1){e(r).trigger("_keypress",[true,n.charCodeAt(0),i,s,t])}}else{e(r).trigger("_keypress",[true,n.charCodeAt(0),i,s,t])}});if(s===true&&f()["p"]!=-1){f()["lastValidPosition"]=x(f()["p"])}}function M(t){return e.inputmask.escapeRegex.call(this,t)}function _(e){return e.replace(new RegExp("("+M(v().join(""))+")*$"),"")}function D(e){var t=m(),n=t.slice(),r,i;for(var i=n.length-1;i>=0;i--){var r=w(i);if(d()[r].optionality){if(!b(i)||!g(i,t[i],true))n.pop();else break}else break}k(e,n)}function P(t,n){if(d()&&(n===true||!t.hasClass("hasDatepicker"))){var s=e.map(m(),function(e,t){return b(t)&&g(t,e,true)?e:null});var o=(i?s.reverse():s).join("");return r.onUnMask!=undefined?r.onUnMask.call(this,m().join(""),o):o}else{return t[0]._valueGet()}}function H(e){if(i&&typeof e=="number"&&(!r.greedy||r.placeholder!="")){var t=m().length;e=t-e}return e}function B(t,n,i){var s=t.jquery&&t.length>0?t[0]:t,o;if(typeof n=="number"){n=H(n);i=H(i);if(!e(t).is(":visible")){return}i=typeof i=="number"?i:n;s.scrollLeft=s.scrollWidth;if(r.insertMode==false&&n==i)i++;if(s.setSelectionRange){s.selectionStart=n;s.selectionEnd=c?n:i}else if(s.createTextRange){o=s.createTextRange();o.collapse(true);o.moveEnd("character",i);o.moveStart("character",n);o.select()}}else{if(!e(t).is(":visible")){return{begin:0,end:0}}if(s.setSelectionRange){n=s.selectionStart;i=s.selectionEnd}else if(document.selection&&document.selection.createRange){o=document.selection.createRange();n=0-o.duplicate().moveStart("character",-1e5);i=n+o.text.length}n=H(n);i=H(i);return{begin:n,end:i}}}function j(i){if(r.repeat=="*")return undefined;var s=false,o=0,u=n;e.each(t,function(e,t){if(typeof t=="object"){n=e;var r=x(E());if(t["lastValidPosition"]>=o&&t["lastValidPosition"]==r){var u=true;for(var f=0;f<=r;f++){var l=b(f),c=w(f);if(l&&(i[f]==undefined||i[f]==a(f))||!l&&i[f]!=v()[c]){u=false;break}}s=s||u;if(s)return false}o=t["lastValidPosition"]}});n=u;return s}function F(e,t){return i?e-t>1||e-t==1&&r.insertMode:t-e>1||t-e==1&&r.insertMode}var i=false,s=m().join(""),o,u;this.unmaskedvalue=function(e,t){i=e.data("_inputmask")["isRTL"];return P(e,t)};this.isComplete=function(e){return j(e)};this.mask=function(c){function z(t){var n=e._data(t).events;e.each(n,function(t,n){e.each(n,function(e,t){if(t.namespace=="inputmask"){if(t.type!="setvalue"&&t.type!="_keypress"){var n=t.handler;t.handler=function(e){if(this.readOnly||this.disabled)e.preventDefault;else return n.apply(this,arguments)}}}})})}function W(t){var n;if(Object.getOwnPropertyDescriptor)n=Object.getOwnPropertyDescriptor(t,"value");if(n&&n.get){if(!t._valueGet){var r=n.get;var s=n.set;t._valueGet=function(){return i?r.call(this).split("").reverse().join(""):r.call(this)};t._valueSet=function(e){s.call(this,i?e.split("").reverse().join(""):e)};Object.defineProperty(t,"value",{get:function(){var t=e(this),n=e(this).data("_inputmask"),i=n["masksets"],s=n["activeMasksetIndex"];return n&&n["opts"].autoUnmask?t.inputmask("unmaskedvalue"):r.call(this)!=i[s]["_buffer"].join("")?r.call(this):""},set:function(t){s.call(this,t);e(this).triggerHandler("setvalue.inputmask")}})}}else if(document.__lookupGetter__&&t.__lookupGetter__("value")){if(!t._valueGet){var r=t.__lookupGetter__("value");var s=t.__lookupSetter__("value");t._valueGet=function(){return i?r.call(this).split("").reverse().join(""):r.call(this)};t._valueSet=function(e){s.call(this,i?e.split("").reverse().join(""):e)};t.__defineGetter__("value",function(){var t=e(this),n=e(this).data("_inputmask"),i=n["masksets"],s=n["activeMasksetIndex"];return n&&n["opts"].autoUnmask?t.inputmask("unmaskedvalue"):r.call(this)!=i[s]["_buffer"].join("")?r.call(this):""});t.__defineSetter__("value",function(t){s.call(this,t);e(this).triggerHandler("setvalue.inputmask")})}}else{if(!t._valueGet){t._valueGet=function(){return i?this.value.split("").reverse().join(""):this.value};t._valueSet=function(e){this.value=i?e.split("").reverse().join(""):e}}if(e.valHooks.text==undefined||e.valHooks.text.inputmaskpatch!=true){var r=e.valHooks.text&&e.valHooks.text.get?e.valHooks.text.get:function(e){return e.value};var s=e.valHooks.text&&e.valHooks.text.set?e.valHooks.text.set:function(e,t){e.value=t;return e};jQuery.extend(e.valHooks,{text:{get:function(t){var n=e(t);if(n.data("_inputmask")){if(n.data("_inputmask")["opts"].autoUnmask)return n.inputmask("unmaskedvalue");else{var i=r(t),s=n.data("_inputmask"),o=s["masksets"],u=s["activeMasksetIndex"];return i!=o[u]["_buffer"].join("")?i:""}}else return r(t)},set:function(t,n){var r=e(t);var i=s(t,n);if(r.data("_inputmask"))r.triggerHandler("setvalue.inputmask");return i},inputmaskpatch:true}})}}}function X(e,t,n,r){var i=m();if(r!==false)while(!b(e)&&e-1>=0)e--;for(var s=e;s<t&&s<E();s++){if(b(s)){A(i,s);var o=S(s);var u=N(i,o);if(u!=a(o)){if(o<E()&&g(s,u,true)!==false&&d()[w(s)].def==d()[w(o)].def){T(i,s,u,true)}else{if(b(s))break}}}else{A(i,s)}}if(n!=undefined)T(i,x(t),n);if(f()["greedy"]==false){var l=_(i.join("")).split("");i.length=l.length;for(var s=0,c=i.length;s<c;s++){i[s]=l[s]}if(i.length==0)f()["buffer"]=v().slice()}return e}function V(e,t,n){var r=m();if(N(r,e,true)!=a(e)){for(var i=x(t);i>e&&i>=0;i--){if(b(i)){var s=x(i);var o=N(r,s);if(o!=a(s)){if(g(s,o,true)!==false&&d()[w(i)].def==d()[w(s)].def){T(r,i,o,true);A(r,s)}}}else A(r,i)}}if(n!=undefined&&N(r,e)==a(e))T(r,e,n);var u=r.length;if(f()["greedy"]==false){var l=_(r.join("")).split("");r.length=l.length;for(var i=0,c=r.length;i<c;i++){r[i]=l[i]}if(r.length==0)f()["buffer"]=v().slice()}return t-(u-r.length)}function J(e,n,s){if(r.numericInput||i){switch(n){case r.keyCode.BACKSPACE:n=r.keyCode.DELETE;break;case r.keyCode.DELETE:n=r.keyCode.BACKSPACE;break}if(i){var o=s.end;s.end=s.begin;s.begin=o}}var u=true;if(s.begin==s.end){var a=n==r.keyCode.BACKSPACE?s.begin-1:s.begin;if(r.isNumeric&&r.radixPoint!=""&&m()[a]==r.radixPoint){s.begin=m().length-1==a?s.begin:n==r.keyCode.BACKSPACE?a:S(a);s.end=s.begin}u=false;if(n==r.keyCode.BACKSPACE)s.begin--;else if(n==r.keyCode.DELETE)s.end++}else if(s.end-s.begin==1&&!r.insertMode){u=false;if(n==r.keyCode.BACKSPACE)s.begin--}L(m(),s.begin,s.end);var l=E();if(r.greedy==false){X(s.begin,l,undefined,!i&&n==r.keyCode.BACKSPACE&&!u)}else{var c=s.begin;for(var h=s.begin;h<s.end;h++){if(b(h)||!u)c=X(s.begin,l,undefined,!i&&n==r.keyCode.BACKSPACE&&!u)}if(!u)s.begin=c}var p=S(-1);L(m(),s.begin,s.end,true);O(e,false,t[1]==undefined||p>=s.end,m());if(f()["lastValidPosition"]<p){f()["lastValidPosition"]=-1;f()["p"]=p}else{f()["p"]=s.begin}}function K(t){M=false;var n=this,i=e(n),o=t.keyCode,u=B(n);if(o==r.keyCode.BACKSPACE||o==r.keyCode.DELETE||l&&o==127||t.ctrlKey&&o==88){t.preventDefault();if(o==88)s=m().join("");J(n,o,u);y();k(n,m(),f()["p"]);if(n._valueGet()==v().join(""))i.trigger("cleared");if(r.showTooltip){i.prop("title",f()["mask"])}}else if(o==r.keyCode.END||o==r.keyCode.PAGE_DOWN){setTimeout(function(){var e=S(f()["lastValidPosition"]);if(!r.insertMode&&e==E()&&!t.shiftKey)e--;B(n,t.shiftKey?u.begin:e,e)},0)}else if(o==r.keyCode.HOME&&!t.shiftKey||o==r.keyCode.PAGE_UP){B(n,0,t.shiftKey?u.begin:0)}else if(o==r.keyCode.ESCAPE||o==90&&t.ctrlKey){O(n,true,false,s.split(""));i.click()}else if(o==r.keyCode.INSERT&&!(t.shiftKey||t.ctrlKey)){r.insertMode=!r.insertMode;B(n,!r.insertMode&&u.begin==E()?u.begin-1:u.begin)}else if(r.insertMode==false&&!t.shiftKey){if(o==r.keyCode.RIGHT){setTimeout(function(){var e=B(n);B(n,e.begin)},0)}else if(o==r.keyCode.LEFT){setTimeout(function(){var e=B(n);B(n,e.begin-1)},0)}}var a=B(n);if(r.onKeyDown.call(this,t,m(),r)===true)B(n,a.begin,a.end);I=e.inArray(o,r.ignorables)!=-1}function Q(i,s,o,u,l,c){if(o==undefined&&M)return false;M=true;var h=this,p=e(h);i=i||window.event;var o=o||i.which||i.charCode||i.keyCode;if(!(i.ctrlKey&&i.altKey)&&(i.ctrlKey||i.metaKey||I)&&s!==true){return true}else{if(o){if(s!==true&&o==46&&i.shiftKey==false&&r.radixPoint==",")o=44;var d,v,b,w=String.fromCharCode(o);if(s){var C=l?c:f()["lastValidPosition"]+1;d={begin:C,end:C}}else{d=B(h)}var L=F(d.begin,d.end),A=false,O=n;if(L){n=O;e.each(t,function(e,t){if(typeof t=="object"){n=e;f()["undoBuffer"]=m().join("")}});J(h,r.keyCode.DELETE,d);if(!r.insertMode){e.each(t,function(e,t){if(typeof t=="object"){n=e;V(d.begin,E());f()["lastValidPosition"]=S(f()["lastValidPosition"])}})}n=O}var _=m().join("").indexOf(r.radixPoint);if(r.isNumeric&&s!==true&&_!=-1){if(r.greedy&&d.begin<=_){d.begin=x(d.begin);d.end=d.begin}else if(w==r.radixPoint){d.begin=_;d.end=d.begin}}var D=d.begin;v=g(D,w,l);if(l===true)v=[{activeMasksetIndex:n,result:v}];var H=-1;e.each(v,function(e,t){n=t["activeMasksetIndex"];f()["writeOutBuffer"]=true;var i=t["result"];if(i!==false){var s=false,o=m();if(i!==true){s=i["refresh"];D=i.pos!=undefined?i.pos:D;w=i.c!=undefined?i.c:w}if(s!==true){if(r.insertMode==true){var u=E();var c=o.slice();while(N(c,u,true)!=a(u)&&u>=D){u=u==0?-1:x(u)}if(u>=D){V(D,E(),w);var h=f()["lastValidPosition"],p=S(h);if(p!=E()&&h>=D&&N(m(),p,true)!=a(p)){f()["lastValidPosition"]=p}}else f()["writeOutBuffer"]=false}else T(o,D,w,true);if(H==-1||H>S(D)){H=S(D)}}else if(!l){var d=D<E()?D+1:D;if(H==-1||H>d){H=d}}if(H>f()["p"])f()["p"]=H}});if(l!==true){n=O;y()}if(u!==false){e.each(v,function(e,t){if(t["activeMasksetIndex"]==n){b=t;return false}});if(b!=undefined){var q=this;setTimeout(function(){r.onKeyValidation.call(q,b["result"],r)},0);if(f()["writeOutBuffer"]&&b["result"]!==false){var R=m();var U;if(s){U=undefined}else if(r.numericInput){if(D>_){U=x(H)}else if(w==r.radixPoint){U=H-1}else U=x(H-1)}else{U=H}k(h,R,U);if(s!==true){setTimeout(function(){if(j(R)===true)p.trigger("complete");P=true;p.trigger("input")},0)}}else if(L){f()["buffer"]=f()["undoBuffer"].split("")}}}if(r.showTooltip){p.prop("title",f()["mask"])}i.preventDefault()}}}function G(t){var n=e(this),i=this,o=t.keyCode,a=m();if(h&&o==r.keyCode.BACKSPACE){if(u==i._valueGet())K.call(this,t)}r.onKeyUp.call(this,t,a,r);if(o==r.keyCode.TAB&&r.showMaskOnFocus){if(n.hasClass("focus.inputmask")&&i._valueGet().length==0){a=v().slice();k(i,a);B(i,0);s=m().join("")}else{k(i,a);if(a.join("")==v().join("")&&e.inArray(r.radixPoint,a)!=-1){B(i,H(0));n.click()}else B(i,H(0),H(E()))}}}o=e(c);if(!o.is(":input"))return;o.data("_inputmask",{masksets:t,activeMasksetIndex:n,opts:r,isRTL:false});if(r.showTooltip){o.prop("title",f()["mask"])}f()["greedy"]=f()["greedy"]?f()["greedy"]:f()["repeat"]==0;if(o.attr("maxLength")!=null){var C=o.prop("maxLength");if(C>-1){e.each(t,function(e,t){if(typeof t=="object"){if(t["repeat"]=="*"){t["repeat"]=C}}})}if(E()>=C&&C>-1){if(C<v().length)v().length=C;if(f()["greedy"]==false){f()["repeat"]=Math.round(C/v().length)}o.prop("maxLength",E()*2)}}W(c);var M=false,P=false,I=false;if(r.numericInput)r.isNumeric=r.numericInput;if(c.dir=="rtl"||r.numericInput&&r.rightAlignNumerics||r.isNumeric&&r.rightAlignNumerics)o.css("text-align","right");if(c.dir=="rtl"||r.numericInput){c.dir="ltr";o.removeAttr("dir");var q=o.data("_inputmask");q["isRTL"]=true;o.data("_inputmask",q);i=true}o.unbind(".inputmask");o.removeClass("focus.inputmask");o.closest("form").bind("submit",function(){if(s!=m().join("")){o.change()}}).bind("reset",function(){setTimeout(function(){o.trigger("setvalue")},0)});o.bind("mouseenter.inputmask",function(){var t=e(this),n=this;if(!t.hasClass("focus.inputmask")&&r.showMaskOnHover){if(n._valueGet()!=m().join("")){k(n,m())}}}).bind("blur.inputmask",function(){var i=e(this),o=this,u=o._valueGet(),a=m();i.removeClass("focus.inputmask");if(s!=m().join("")){i.change()}if(r.clearMaskOnLostFocus&&u!=""){if(u==v().join(""))o._valueSet("");else{D(o)}}if(j(a)===false){i.trigger("incomplete");if(r.clearIncomplete){e.each(t,function(e,t){if(typeof t=="object"){t["buffer"]=t["_buffer"].slice();t["lastValidPosition"]=-1}});n=0;if(r.clearMaskOnLostFocus)o._valueSet("");else{a=v().slice();k(o,a)}}}}).bind("focus.inputmask",function(){var t=e(this),n=this,i=n._valueGet();if(r.showMaskOnFocus&&!t.hasClass("focus.inputmask")&&(!r.showMaskOnHover||r.showMaskOnHover&&i=="")){if(n._valueGet()!=m().join("")){k(n,m(),S(f()["lastValidPosition"]))}}t.addClass("focus.inputmask");s=m().join("")}).bind("mouseleave.inputmask",function(){var t=e(this),n=this;if(r.clearMaskOnLostFocus){if(!t.hasClass("focus.inputmask")&&n._valueGet()!=t.attr("placeholder")){if(n._valueGet()==v().join("")||n._valueGet()=="")n._valueSet("");else{D(n)}}}}).bind("click.inputmask",function(){var t=this;setTimeout(function(){var n=B(t),i=m();if(n.begin==n.end){var s=r.isRTL?H(n.begin):n.begin,o=f()["lastValidPosition"],u;if(r.isNumeric){u=r.skipRadixDance===false&&r.radixPoint!=""&&e.inArray(r.radixPoint,i)!=-1?r.numericInput?S(e.inArray(r.radixPoint,i)):e.inArray(r.radixPoint,i):S(o)}else{u=S(o)}if(s<u){if(b(s))B(t,s);else B(t,S(s))}else B(t,u)}},0)}).bind("dblclick.inputmask",function(){var e=this;setTimeout(function(){B(e,0,S(f()["lastValidPosition"]))},0)}).bind(p+".inputmask dragdrop.inputmask drop.inputmask",function(t){if(P===true){P=false;return true}var n=this,i=e(n);if(t.type=="propertychange"&&n._valueGet().length<=E()){return true}setTimeout(function(){var e=r.onBeforePaste!=undefined?r.onBeforePaste.call(this,n._valueGet()):n._valueGet();O(n,true,false,e.split(""),true);if(j(m())===true)i.trigger("complete");i.click()},0)}).bind("setvalue.inputmask",function(){var e=this;O(e,true);s=m().join("");if(e._valueGet()==v().join(""))e._valueSet("")}).bind("_keypress.inputmask",Q).bind("complete.inputmask",r.oncomplete).bind("incomplete.inputmask",r.onincomplete).bind("cleared.inputmask",r.oncleared).bind("keyup.inputmask",G);if(h){o.bind("input.inputmask",function(t){if(P===true){P=false;return true}var n=this,r=e(n);u=m().join("");O(n,false,false);k(n,m());if(j(m())===true)r.trigger("complete");r.click()})}else{o.bind("keydown.inputmask",K).bind("keypress.inputmask",Q)}O(c,true,false);s=m().join("");var R;try{R=document.activeElement}catch(U){}if(R===c){o.addClass("focus.inputmask");B(c,S(f()["lastValidPosition"]))}else if(r.clearMaskOnLostFocus){if(m().join("")==v().join("")){c._valueSet("")}else{D(c)}}else{k(c,m())}z(c);};return this}e.inputmask={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},escapeChar:"\\",mask:null,oncomplete:e.noop,onincomplete:e.noop,oncleared:e.noop,repeat:0,greedy:true,autoUnmask:false,clearMaskOnLostFocus:true,insertMode:true,clearIncomplete:false,aliases:{},onKeyUp:e.noop,onKeyDown:e.noop,onBeforePaste:undefined,onUnMask:undefined,showMaskOnFocus:true,showMaskOnHover:true,onKeyValidation:e.noop,skipOptionalPartCharacter:" ",showTooltip:false,numericInput:false,isNumeric:false,radixPoint:"",skipRadixDance:false,rightAlignNumerics:true,definitions:{"*":{validator:"[A-Za-zА-яЁё0-9]",cardinality:1}},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],getMaskLength:function(e,t,n,r,i){var s=e.length;if(!t){if(n=="*"){s=r.length+1}else if(n>1){s+=e.length*(n-1)}}return s}},escapeRegex:function(e){var t=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];return e.replace(new RegExp("(\\"+t.join("|\\")+")","gim"),"\\$1")},format:function(e,t){}};e.fn.inputmask=function(n,i){t=e.extend(true,{},e.inputmask.defaults,i);var s,o=0;if(typeof n==="string"){switch(n){case"mask":r(t.alias,i);s=u();if(s.length==0){return this}return this.each(function(){d(e.extend(true,{},s),0,t).mask(this)});case"unmaskedvalue":var a=e(this),f=this;if(a.data("_inputmask")){s=a.data("_inputmask")["masksets"];o=a.data("_inputmask")["activeMasksetIndex"];t=a.data("_inputmask")["opts"];return d(s,o,t).unmaskedvalue(a)}else return a.val();case"remove":return this.each(function(){var n=e(this),r=this;if(n.data("_inputmask")){s=n.data("_inputmask")["masksets"];o=n.data("_inputmask")["activeMasksetIndex"];t=n.data("_inputmask")["opts"];r._valueSet(d(s,o,t).unmaskedvalue(n,true));n.removeData("_inputmask");n.unbind(".inputmask");n.removeClass("focus.inputmask");var i;if(Object.getOwnPropertyDescriptor)i=Object.getOwnPropertyDescriptor(r,"value");if(i&&i.get){if(r._valueGet){Object.defineProperty(r,"value",{get:r._valueGet,set:r._valueSet})}}else if(document.__lookupGetter__&&r.__lookupGetter__("value")){if(r._valueGet){r.__defineGetter__("value",r._valueGet);r.__defineSetter__("value",r._valueSet)}}try{delete r._valueGet;delete r._valueSet}catch(u){r._valueGet=undefined;r._valueSet=undefined}}});break;case"getemptymask":if(this.data("_inputmask")){s=this.data("_inputmask")["masksets"];o=this.data("_inputmask")["activeMasksetIndex"];return s[o]["_buffer"].join("")}else return"";case"hasMaskedValue":return this.data("_inputmask")?!this.data("_inputmask")["opts"].autoUnmask:false;case"isComplete":s=this.data("_inputmask")["masksets"];o=this.data("_inputmask")["activeMasksetIndex"];t=this.data("_inputmask")["opts"];return d(s,o,t).isComplete(this[0]._valueGet().split(""));case"getmetadata":if(this.data("_inputmask")){s=this.data("_inputmask")["masksets"];o=this.data("_inputmask")["activeMasksetIndex"];return s[o]["metadata"]}else return undefined;default:if(!r(n,i)){t.mask=n}s=u();if(s.length==0){return this}return this.each(function(){d(e.extend(true,{},s),o,t).mask(this)});break}}else if(typeof n=="object"){t=e.extend(true,{},e.inputmask.defaults,n);r(t.alias,n);s=u();if(s.length==0){return this}return this.each(function(){d(e.extend(true,{},s),o,t).mask(this)})}else if(n==undefined){return this.each(function(){var n=e(this).attr("data-inputmask");if(n&&n!=""){try{n=n.replace(new RegExp("'","g"),'"');var s=e.parseJSON("{"+n+"}");e.extend(true,s,i);t=e.extend(true,{},e.inputmask.defaults,s);r(t.alias,s);t.alias=undefined;e(this).inputmask(t)}catch(o){}}})}}}})(jQuery)