| 123456789 |
- /*!
- * inputmask.min.js
- * https://github.com/RobinHerbots/jquery.inputmask
- * Copyright (c) 2010 - 2017 Robin Herbots
- * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
- * Version: 3.3.5-211
- */
- !function(a){"function"==typeof define&&define.amd?define(["./dependencyLibs/inputmask.dependencyLib","./global/window","./global/document"],a):"object"==typeof exports?module.exports=a(require("./dependencyLibs/inputmask.dependencyLib"),require("./global/window"),require("./global/document")):window.Inputmask=a(window.dependencyLib||jQuery,window,document)}(function(a,b,c,d){function e(b,c,g){return this instanceof e?(this.el=d,this.events={},this.maskset=d,this.refreshValue=!1,void(g!==!0&&(a.isPlainObject(b)?c=b:(c=c||{},c.alias=b),this.opts=a.extend(!0,{},this.defaults,c),this.noMasksCache=c&&c.definitions!==d,this.userOptions=c||{},this.isRTL=this.opts.numericInput,f(this.opts.alias,c,this.opts)))):new e(b,c,g)}function f(b,c,g){var h=e.prototype.aliases[b];return h?(h.alias&&f(h.alias,d,g),a.extend(!0,g,h),a.extend(!0,g,c),!0):(null===g.mask&&(g.mask=b),!1)}function g(b,c){function f(b,f,g){var h=!1;if(null!==b&&""!==b||(h=null!==g.regex,h?(b=g.regex,b=b.replace(/^(\^)(.*)(\$)$/,"$2")):b="*{*}"),1===b.length&&g.greedy===!1&&0!==g.repeat&&(g.placeholder=""),g.repeat>0||"*"===g.repeat||"+"===g.repeat){var i="*"===g.repeat?0:"+"===g.repeat?1:g.repeat;b=g.groupmarker.start+b+g.groupmarker.end+g.quantifiermarker.start+i+","+g.repeat+g.quantifiermarker.end}var j;return e.prototype.masksCache[b]===d||c===!0?(j={mask:b,maskToken:e.prototype.analyseMask(b,h,g),validPositions:{},_buffer:d,buffer:d,tests:{},metadata:f,maskLength:d},c!==!0&&(e.prototype.masksCache[g.numericInput?b.split("").reverse().join(""):b]=j,j=a.extend(!0,{},e.prototype.masksCache[g.numericInput?b.split("").reverse().join(""):b]))):j=a.extend(!0,{},e.prototype.masksCache[g.numericInput?b.split("").reverse().join(""):b]),j}var g;if(a.isFunction(b.mask)&&(b.mask=b.mask(b)),a.isArray(b.mask)){if(b.mask.length>1){b.keepStatic=null===b.keepStatic||b.keepStatic;var h=b.groupmarker.start;return a.each(b.numericInput?b.mask.reverse():b.mask,function(c,e){h.length>1&&(h+=b.groupmarker.end+b.alternatormarker+b.groupmarker.start),h+=e.mask===d||a.isFunction(e.mask)?e:e.mask}),h+=b.groupmarker.end,f(h,b.mask,b)}b.mask=b.mask.pop()}return g=b.mask&&b.mask.mask!==d&&!a.isFunction(b.mask.mask)?f(b.mask.mask,b.mask,b):f(b.mask,b.mask,b)}function h(f,g,i){function n(a,b,c){b=b||0;var e,f,g,h=[],j=0,k=q();V=Y!==d?Y.maxLength:d,V===-1&&(V=d);do a===!0&&o().validPositions[j]?(g=o().validPositions[j],f=g.match,e=g.locator.slice(),h.push(c===!0?g.input:c===!1?f.nativeDef:I(j,f))):(g=t(j,e,j-1),f=g.match,e=g.locator.slice(),(i.jitMasking===!1||j<k||"number"==typeof i.jitMasking&&isFinite(i.jitMasking)&&i.jitMasking>j)&&h.push(c===!1?f.nativeDef:I(j,f))),j++;while((V===d||j<V)&&(null!==f.fn||""!==f.def)||b>j);return""===h[h.length-1]&&h.pop(),o().maskLength=j+1,h}function o(){return g}function p(a){var b=o();b.buffer=d,a!==!0&&(b.validPositions={},b.p=0)}function q(a,b,c){var e=-1,f=-1,g=c||o().validPositions;a===d&&(a=-1);for(var h in g){var i=parseInt(h);g[i]&&(b||g[i].generatedInput!==!0)&&(i<=a&&(e=i),i>=a&&(f=i))}return e!==-1&&a-e>1||f<a?e:f}function r(b,c,e,f){function g(a){var b=o().validPositions[a];if(b!==d&&null===b.match.fn){var c=o().validPositions[a-1],e=o().validPositions[a+1];return c!==d&&e!==d}return!1}var h,j=b,k=a.extend(!0,{},o().validPositions),l=!1;for(o().p=b,h=c-1;h>=j;h--)o().validPositions[h]!==d&&(e!==!0&&(!o().validPositions[h].match.optionality&&g(h)||i.canClearPosition(o(),h,q(),f,i)===!1)||delete o().validPositions[h]);for(p(!0),h=j+1;h<=q();){for(;o().validPositions[j]!==d;)j++;if(h<j&&(h=j+1),o().validPositions[h]===d&&D(h))h++;else{var m=t(h);l===!1&&k[j]&&k[j].match.def===m.match.def?(o().validPositions[j]=a.extend(!0,{},k[j]),o().validPositions[j].input=m.input,delete o().validPositions[h],h++):v(j,m.match.def)?C(j,m.input||I(h),!0)!==!1&&(delete o().validPositions[h],h++,l=!0):D(h)||(h++,j--),j++}}p(!0)}function s(a,b){for(var c,e=a,f=q(),g=o().validPositions[f]||w(0)[0],h=g.alternation!==d?g.locator[g.alternation].toString().split(","):[],j=0;j<e.length&&(c=e[j],!(c.match&&(i.greedy&&c.match.optionalQuantifier!==!0||(c.match.optionality===!1||c.match.newBlockMarker===!1)&&c.match.optionalQuantifier!==!0)&&(g.alternation===d||g.alternation!==c.alternation||c.locator[g.alternation]!==d&&B(c.locator[g.alternation].toString().split(","),h)))||b===!0&&(null!==c.match.fn||/[0-9a-bA-Z]/.test(c.match.def)));j++);return c}function t(a,b,c){return o().validPositions[a]||s(w(a,b?b.slice():b,c))}function u(a){return o().validPositions[a]?o().validPositions[a]:w(a)[0]}function v(a,b){for(var c=!1,d=w(a),e=0;e<d.length;e++)if(d[e].match&&d[e].match.def===b){c=!0;break}return c}function w(b,c,e){function f(c,e,g,h){function k(g,h,m){function r(b,c){var d=0===a.inArray(b,c.matches);return d||a.each(c.matches,function(a,e){if(e.isQuantifier===!0&&(d=r(b,c.matches[a-1])))return!1}),d}function s(b,c,e){var f,g;return(o().tests[b]||o().validPositions[b])&&a.each(o().tests[b]||[o().validPositions[b]],function(a,b){var h=e!==d?e:b.alternation,i=b.locator[h]!==d?b.locator[h].toString().indexOf(c):-1;(g===d||i<g)&&i!==-1&&(f=b,g=i)}),f?f.locator.slice((e!==d?e:f.alternation)+1):e!==d?s(b,c):d}function t(a,c){return null===a.match.fn&&null!==c.match.fn&&c.match.fn.test(a.match.def,o(),b,!1,i,!1)}if(l>1e4)throw"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+o().mask;if(l===b&&g.matches===d)return n.push({match:g,locator:h.reverse(),cd:q}),!0;if(g.matches!==d){if(g.isGroup&&m!==g){if(g=k(c.matches[a.inArray(g,c.matches)+1],h))return!0}else if(g.isOptional){var u=g;if(g=f(g,e,h,m)){if(j=n[n.length-1].match,!r(j,u))return!0;p=!0,l=b}}else if(g.isAlternator){var v,w=g,x=[],y=n.slice(),z=h.length,A=e.length>0?e.shift():-1;if(A===-1||"string"==typeof A){var B,C=l,D=e.slice(),E=[];if("string"==typeof A)E=A.split(",");else for(B=0;B<w.matches.length;B++)E.push(B);for(var F=0;F<E.length;F++){if(B=parseInt(E[F]),n=[],e=s(l,B,z)||D.slice(),g=k(w.matches[B]||c.matches[B],[B].concat(h),m)||g,g!==!0&&g!==d&&E[E.length-1]<w.matches.length){var G=a.inArray(g,c.matches)+1;c.matches.length>G&&(g=k(c.matches[G],[G].concat(h.slice(1,h.length)),m),g&&(E.push(G.toString()),a.each(n,function(a,b){b.alternation=h.length-1})))}v=n.slice(),l=C,n=[];for(var H=0;H<v.length;H++){var I=v[H],J=!1;I.alternation=I.alternation||z;for(var K=0;K<x.length;K++){var L=x[K];if("string"!=typeof A||a.inArray(I.locator[I.alternation].toString(),E)!==-1){if(I.match.nativeDef===L.match.nativeDef||I.match.def===L.match.nativeDef||I.match.nativeDef===L.match.def){J=!0,I.alternation==L.alternation&&L.locator[L.alternation].toString().indexOf(I.locator[I.alternation])===-1&&(L.locator[L.alternation]=L.locator[L.alternation]+","+I.locator[I.alternation],L.alternation=I.alternation),I.match.nativeDef===L.match.def&&(I.locator[I.alternation]=L.locator[L.alternation],x.splice(x.indexOf(L),1,I));break}if(I.match.def===L.match.def){J=!1;break}if(t(I,L)){J=I.match.nativeDef===L.match.nativeDef,I.alternation==L.alternation&&L.locator[L.alternation].toString().indexOf(I.locator[I.alternation])===-1&&(L.locator[L.alternation]=L.locator[L.alternation]+","+I.locator[I.alternation],L.alternation=I.alternation,null==I.match.fn&&(L.na=L.na||I.locator[I.alternation].toString(),L.na.indexOf(I.locator[I.alternation])===-1&&(L.na=L.na+","+I.locator[I.alternation])));break}}}J||x.push(I)}}"string"==typeof A&&(x=a.map(x,function(b,c){if(isFinite(c)){var e,f=b.alternation,g=b.locator[f].toString().split(",");b.locator[f]=d,b.alternation=d;for(var h=0;h<g.length;h++)e=a.inArray(g[h],E)!==-1,e&&(b.locator[f]!==d?(b.locator[f]+=",",b.locator[f]+=g[h]):b.locator[f]=parseInt(g[h]),b.alternation=f);if(b.locator[f]!==d)return b}})),n=y.concat(x),l=b,p=n.length>0,e=D.slice()}else g=k(w.matches[A]||c.matches[A],[A].concat(h),m);if(g)return!0}else if(g.isQuantifier&&m!==c.matches[a.inArray(g,c.matches)-1])for(var M=g,N=e.length>0?e.shift():0;N<(isNaN(M.quantifier.max)?N+1:M.quantifier.max)&&l<=b;N++){var O=c.matches[a.inArray(M,c.matches)-1];if(g=k(O,[N].concat(h),O)){if(j=n[n.length-1].match,j.optionalQuantifier=N>M.quantifier.min-1,r(j,O)){if(N>M.quantifier.min-1){p=!0,l=b;break}return!0}return!0}}else if(g=f(g,e,h,m))return!0}else l++}for(var m=e.length>0?e.shift():0;m<c.matches.length;m++)if(c.matches[m].isQuantifier!==!0){var r=k(c.matches[m],[m].concat(g),h);if(r&&l===b)return r;if(l>b)break}}function g(b){var c=[];return a.isArray(b)||(b=[b]),b.length>0&&(b[0].alternation===d?(c=s(b.slice()).locator.slice(),0===c.length&&(c=b[0].locator.slice())):a.each(b,function(a,b){if(""!==b.def)if(0===c.length)c=b.locator.slice();else for(var d=0;d<c.length;d++)b.locator[d]&&c[d].toString().indexOf(b.locator[d])===-1&&(c[d]+=","+b.locator[d])})),c}function h(a){return i.keepStatic&&b>0&&a.length>1+(""===a[a.length-1].match.def?1:0)&&a[0].match.optionality!==!0&&a[0].match.optionalQuantifier!==!0&&null===a[0].match.fn&&!/[0-9a-bA-Z]/.test(a[0].match.def)?[s(a)]:a}var j,k=o().maskToken,l=c?e:0,m=c?c.slice():[0],n=[],p=!1,q=c?c.join(""):"";if(b>-1){if(c===d){for(var r,t=b-1;(r=o().validPositions[t]||o().tests[t])===d&&t>-1;)t--;r!==d&&t>-1&&(m=g(r),q=m.join(""),l=t)}if(o().tests[b]&&o().tests[b][0].cd===q)return h(o().tests[b]);for(var u=m.shift();u<k.length;u++){var v=f(k[u],m,[u]);if(v&&l===b||l>b)break}}return(0===n.length||p)&&n.push({match:{fn:null,cardinality:0,optionality:!0,casing:null,def:"",placeholder:""},locator:[],cd:q}),c!==d&&o().tests[b]?h(a.extend(!0,[],n)):(o().tests[b]=a.extend(!0,[],n),h(o().tests[b]))}function x(){return o()._buffer===d&&(o()._buffer=n(!1,1),o().buffer===d&&(o().buffer=o()._buffer.slice())),o()._buffer}function y(a){return o().buffer!==d&&a!==!0||(o().buffer=n(!0,q(),!0)),o().buffer}function z(a,b,c){var e,f;if(a===!0)p(),a=0,b=c.length;else for(e=a;e<b;e++)delete o().validPositions[e];for(f=a,e=a;e<b;e++)if(p(!0),c[e]!==i.skipOptionalPartCharacter){var g=C(f,c[e],!0,!0);g!==!1&&(p(!0),f=g.caret!==d?g.caret:g.pos+1)}}function A(a,b,c){switch(i.casing||b.casing){case"upper":a=a.toUpperCase();break;case"lower":a=a.toLowerCase();break;case"title":var d=o().validPositions[c-1];a=0===c||d&&d.input===String.fromCharCode(e.keyCode.SPACE)?a.toUpperCase():a.toLowerCase()}return a}function B(b,c,e){for(var f,g=i.greedy?c:c.slice(0,1),h=!1,j=e!==d?e.split(","):[],k=0;k<j.length;k++)(f=b.indexOf(j[k]))!==-1&&b.splice(f,1);for(var l=0;l<b.length;l++)if(a.inArray(b[l],g)!==-1){h=!0;break}return h}function C(b,c,f,g,h){function j(a){var b=Z?a.begin-a.end>1||a.begin-a.end===1:a.end-a.begin>1||a.end-a.begin===1;return b&&0===a.begin&&a.end===o().maskLength?"full":b}function k(c,e,f){var h=!1;return a.each(w(c),function(k,l){for(var m=l.match,s=e?1:0,t="",u=m.cardinality;u>s;u--)t+=G(c-(u-1));if(e&&(t+=e),y(!0),h=null!=m.fn?m.fn.test(t,o(),c,f,i,j(b)):(e===m.def||e===i.skipOptionalPartCharacter)&&""!==m.def&&{c:I(c,m,!0)||m.def,pos:c},h!==!1){var v=h.c!==d?h.c:e;v=v===i.skipOptionalPartCharacter&&null===m.fn?I(c,m,!0)||m.def:v;var w=c,x=y();if(h.remove!==d&&(a.isArray(h.remove)||(h.remove=[h.remove]),a.each(h.remove.sort(function(a,b){return b-a}),function(a,b){r(b,b+1,!0)})),h.insert!==d&&(a.isArray(h.insert)||(h.insert=[h.insert]),a.each(h.insert.sort(function(a,b){return a-b}),function(a,b){C(b.pos,b.c,!0,g)})),h.refreshFromBuffer){var B=h.refreshFromBuffer;if(z(B===!0?B:B.start,B.end,x),h.pos===d&&h.c===d)return h.pos=q(),!1;if(w=h.pos!==d?h.pos:c,w!==c)return h=a.extend(h,C(w,v,!0,g)),!1}else if(h!==!0&&h.pos!==d&&h.pos!==c&&(w=h.pos,z(c,w,y().slice()),w!==c))return h=a.extend(h,C(w,v,!0)),!1;return(h===!0||h.pos!==d||h.c!==d)&&(k>0&&p(!0),n(w,a.extend({},l,{input:A(v,m,w)}),g,j(b))||(h=!1),!1)}}),h}function l(b,c,e){var f,h,j,k,l,m,n,r,s=a.extend(!0,{},o().validPositions),t=!1,u=q();for(k=o().validPositions[u];u>=0;u--)if(j=o().validPositions[u],j&&j.alternation!==d){if(f=u,h=o().validPositions[f].alternation,k.locator[j.alternation]!==j.locator[j.alternation])break;k=j}if(h!==d){r=parseInt(f);var v=k.locator[k.alternation||h]!==d?k.locator[k.alternation||h]:n[0];v.length>0&&(v=v.split(",")[0]);var x=o().validPositions[r],y=o().validPositions[r-1];a.each(w(r,y?y.locator:d,r-1),function(f,j){n=j.locator[h]?j.locator[h].toString().split(","):[];for(var k=0;k<n.length;k++){var u=[],w=0,y=0,z=!1;if(v<n[k]&&(j.na===d||a.inArray(n[k],j.na.split(","))===-1)){o().validPositions[r]=a.extend(!0,{},j);var A=o().validPositions[r].locator;for(o().validPositions[r].locator[h]=parseInt(n[k]),null==j.match.fn?(x.input!==j.match.def&&(z=!0,x.generatedInput!==!0&&u.push(x.input)),y++,o().validPositions[r].generatedInput=!/[0-9a-bA-Z]/.test(j.match.def),o().validPositions[r].input=j.match.def):o().validPositions[r].input=x.input,l=r+1;l<q(d,!0)+1;l++)m=o().validPositions[l],m&&m.generatedInput!==!0&&/[0-9a-bA-Z]/.test(m.input)?u.push(m.input):l<b&&w++,delete o().validPositions[l];for(z&&u[0]===j.match.def&&u.shift(),p(!0),t=!0;u.length>0;){var B=u.shift();if(B!==i.skipOptionalPartCharacter&&!(t=C(q(d,!0)+1,B,!1,g,!0)))break}if(t){o().validPositions[r].locator=A;var D=q(b)+1;for(l=r+1;l<q()+1;l++)m=o().validPositions[l],(m===d||null==m.match.fn)&&l<b+(y-w)&&y++;b+=y-w,t=C(b>D?D:b,c,e,g,!0)}if(t)return!1;p(),o().validPositions=a.extend(!0,{},s)}}})}return t}function m(b,c){var e=o().validPositions[c];if(e)for(var f=e.locator,g=f.length,h=b;h<c;h++)if(o().validPositions[h]===d&&!D(h,!0)){var i=w(h).slice(),j=s(i,!0),l=-1;""===i[i.length-1].match.def&&i.pop(),a.each(i,function(a,b){for(var c=0;c<g;c++){if(b.locator[c]===d||!B(b.locator[c].toString().split(","),f[c].toString().split(","),b.na)){var e=f[c],h=j.locator[c],i=b.locator[c];e-h>Math.abs(e-i)&&(j=b);break}l<c&&(l=c,j=b)}}),j=a.extend({},j,{input:I(h,j.match,!0)||j.match.def}),j.generatedInput=!0,n(h,j,!0),o().validPositions[c]=d,k(c,e.input,!0)}}function n(b,c,e,f){if(f||i.insertMode&&o().validPositions[b]!==d&&e===d){var g,h=a.extend(!0,{},o().validPositions),j=q(d,!0);for(g=b;g<=j;g++)delete o().validPositions[g];o().validPositions[b]=a.extend(!0,{},c);var k,l=!0,m=o().validPositions,n=!1,r=o().maskLength;for(g=k=b;g<=j;g++){var s=h[g];if(s!==d)for(var t=k;t<o().maskLength&&(null===s.match.fn&&m[g]&&(m[g].match.optionalQuantifier===!0||m[g].match.optionality===!0)||null!=s.match.fn);){if(t++,n===!1&&h[t]&&h[t].match.def===s.match.def)o().validPositions[t]=a.extend(!0,{},h[t]),o().validPositions[t].input=s.input,u(t),k=t,l=!0;else if(v(t,s.match.def)){var w=C(t,s.input,!0,!0);l=w!==!1,k=w.caret||w.insert?q():t,n=!0}else if(l=s.generatedInput===!0,!l&&t>=o().maskLength-1)break;if(o().maskLength<r&&(o().maskLength=r),l)break}if(!l)break}if(!l)return o().validPositions=a.extend(!0,{},h),p(!0),!1}else o().validPositions[b]=a.extend(!0,{},c);return p(!0),!0}function u(b){for(var c=b-1;c>-1&&!o().validPositions[c];c--);var e,f;for(c++;c<b;c++)o().validPositions[c]===d&&(i.jitMasking===!1||i.jitMasking>c)&&(f=w(c,t(c-1).locator,c-1).slice(),""===f[f.length-1].match.def&&f.pop(),e=s(f),e&&(e.match.def===i.radixPointDefinitionSymbol||!D(c,!0)||a.inArray(i.radixPoint,y())<c&&e.match.fn&&e.match.fn.test(I(c),o(),c,!1,i))&&(F=k(c,I(c,e.match,!0)||(null==e.match.fn?e.match.def:""!==I(c)?I(c):y()[c]),!0),F!==!1&&(o().validPositions[F.pos||c].generatedInput=!0)))}f=f===!0;var x=b;b.begin!==d&&(x=Z&&!j(b)?b.end:b.begin);var F=!0,H=a.extend(!0,{},o().validPositions);if(a.isFunction(i.preValidation)&&!f&&g!==!0&&(F=i.preValidation(y(),x,c,j(b),i)),F===!0){if(u(x),j(b)&&(P(d,e.keyCode.DELETE,b),x=o().p),x<o().maskLength&&(F=k(x,c,f),(!f||g===!0)&&F===!1)){var J=o().validPositions[x];if(!J||null!==J.match.fn||J.match.def!==c&&c!==i.skipOptionalPartCharacter){if((i.insertMode||o().validPositions[E(x)]===d)&&!D(x,!0))for(var K=x+1,L=E(x);K<=L;K++)if(F=k(K,c,f),F!==!1){m(x,F.pos!==d?F.pos:K),x=K;break}}else F={caret:E(x)}}F===!1&&i.keepStatic&&!f&&h!==!0&&(F=l(x,c,f)),F===!0&&(F={pos:x})}if(a.isFunction(i.postValidation)&&F!==!1&&!f&&g!==!0){var M=i.postValidation(y(!0),F,i);if(M.refreshFromBuffer&&M.buffer){var N=M.refreshFromBuffer;z(N===!0?N:N.start,N.end,M.buffer)}F=M===!0?F:M}return F.pos===d&&(F.pos=x),F===!1&&(p(!0),o().validPositions=a.extend(!0,{},H)),F}function D(a,b){var c=t(a).match;if(""===c.def&&(c=u(a).match),null!=c.fn)return c.fn;if(b!==!0&&a>-1){var d=w(a);return d.length>1+(""===d[d.length-1].match.def?1:0)}return!1}function E(a,b){var c=o().maskLength;if(a>=c)return c;for(var d=a;++d<c&&(b===!0&&(u(d).match.newBlockMarker!==!0||!D(d))||b!==!0&&!D(d)););return d}function F(a,b){var c,d=a;if(d<=0)return 0;for(;--d>0&&(b===!0&&u(d).match.newBlockMarker!==!0||b!==!0&&!D(d)&&(c=w(d),c.length<2||2===c.length&&""===c[1].match.def)););return d}function G(a){return o().validPositions[a]===d?I(a):o().validPositions[a].input}function H(b,c,e,f,g){if(f&&a.isFunction(i.onBeforeWrite)){var h=i.onBeforeWrite(f,c,e,i);if(h){if(h.refreshFromBuffer){var j=h.refreshFromBuffer;z(j===!0?j:j.start,j.end,h.buffer||c),c=y(!0)}e!==d&&(e=h.caret!==d?h.caret:e)}}b!==d&&(b.inputmask._valueSet(c.join("")),e===d||f!==d&&"blur"===f.type?R(b,c,e):m&&"input"===f.type?setTimeout(function(){L(b,e)},0):L(b,e),g===!0&&(_=!0,a(b).trigger("input")))}function I(b,c,e){if(c=c||u(b).match,c.placeholder!==d||e===!0)return a.isFunction(c.placeholder)?c.placeholder(i):c.placeholder;if(null===c.fn){if(b>-1&&o().validPositions[b]===d){var f,g=w(b),h=[];if(g.length>1+(""===g[g.length-1].match.def?1:0))for(var j=0;j<g.length;j++)if(g[j].match.optionality!==!0&&g[j].match.optionalQuantifier!==!0&&(null===g[j].match.fn||f===d||g[j].match.fn.test(f.match.def,o(),b,!0,i)!==!1)&&(h.push(g[j]),null===g[j].match.fn&&(f=g[j]),h.length>1&&/[0-9a-bA-Z]/.test(h[0].match.def)))return i.placeholder.charAt(b%i.placeholder.length)}return c.def}return i.placeholder.charAt(b%i.placeholder.length)}function J(b,f,g,h,j){function k(a,b){var c=x().slice(a,E(a)).join("").indexOf(b);return c!==-1&&!D(a)&&u(a).match.nativeDef===b.charAt(b.length-1)}var l=h.slice(),m="",n=0,r=d;if(p(),o().p=E(-1),!g)if(i.autoUnmask!==!0){var s=x().slice(0,E(-1)).join(""),v=l.join("").match(new RegExp("^"+e.escapeRegex(s),"g"));v&&v.length>0&&(l.splice(0,v.length*s.length),n=E(n))}else n=E(n);if(a.each(l,function(c,e){if(e!==d){var f=new a.Event("_checkval");f.which=e.charCodeAt(0),m+=e;var h=q(d,!0),j=o().validPositions[h],l=t(h+1,j?j.locator.slice():d,h);if(!k(n,m)||g||i.autoUnmask){var s=g?c:null==l.match.fn&&l.match.optionality&&h+1<o().p?h+1:o().p;r=da.keypressEvent.call(b,f,!0,!1,g,s),n=s+1,m=""}else r=da.keypressEvent.call(b,f,!0,!1,!0,h+1);if(!g&&a.isFunction(i.onBeforeWrite)){var u=r.forwardPosition;if(r=i.onBeforeWrite(f,y(),r.forwardPosition,i),r.forwardPosition=u,r&&r.refreshFromBuffer){var v=r.refreshFromBuffer;z(v===!0?v:v.start,v.end,r.buffer),p(!0),r.caret&&(o().p=r.caret,r.forwardPosition=r.caret)}}}}),f){var w=d;c.activeElement===b&&r&&(w=i.numericInput?F(r.forwardPosition):r.forwardPosition),H(b,y(),w,j||new a.Event("checkval"))}}function K(b){if(b){if(b.inputmask===d)return b.value;b.inputmask&&b.inputmask.refreshValue&&da.setValueEvent.call(b)}var c=[],e=o().validPositions;for(var f in e)e[f].match&&null!=e[f].match.fn&&c.push(e[f].input);var g=0===c.length?"":(Z?c.reverse():c).join("");if(a.isFunction(i.onUnMask)){var h=(Z?y().slice().reverse():y()).join("");g=i.onUnMask(h,g,i)}return g}function L(a,e,f,g){function h(a){if(g!==!0&&Z&&"number"==typeof a&&(!i.greedy||""!==i.placeholder)){var b=y().join("").length;a=b-a}return a}var k;if("number"!=typeof e)return a.setSelectionRange?(e=a.selectionStart,f=a.selectionEnd):b.getSelection?(k=b.getSelection().getRangeAt(0),k.commonAncestorContainer.parentNode!==a&&k.commonAncestorContainer!==a||(e=k.startOffset,f=k.endOffset)):c.selection&&c.selection.createRange&&(k=c.selection.createRange(),e=0-k.duplicate().moveStart("character",-a.inputmask._valueGet().length),f=e+k.text.length),{begin:h(e),end:h(f)};e=h(e),f=h(f),f="number"==typeof f?f:e;var l=parseInt(((a.ownerDocument.defaultView||b).getComputedStyle?(a.ownerDocument.defaultView||b).getComputedStyle(a,null):a.currentStyle).fontSize)*f;if(a.scrollLeft=l>a.scrollWidth?l:0,j||i.insertMode!==!1||e!==f||f++,a.setSelectionRange)a.selectionStart=e,a.selectionEnd=f;else if(b.getSelection){if(k=c.createRange(),a.firstChild===d||null===a.firstChild){var m=c.createTextNode("");a.appendChild(m)}k.setStart(a.firstChild,e<a.inputmask._valueGet().length?e:a.inputmask._valueGet().length),k.setEnd(a.firstChild,f<a.inputmask._valueGet().length?f:a.inputmask._valueGet().length),k.collapse(!0);var n=b.getSelection();n.removeAllRanges(),n.addRange(k)}else a.createTextRange&&(k=a.createTextRange(),k.collapse(!0),k.moveEnd("character",f),k.moveStart("character",e),k.select());R(a,d,{begin:e,end:f})}function M(b){var c,e,f=y(),g=f.length,h=q(),i={},j=o().validPositions[h],k=j!==d?j.locator.slice():d;for(c=h+1;c<f.length;c++)e=t(c,k,c-1),k=e.locator.slice(),i[c]=a.extend(!0,{},e);var l=j&&j.alternation!==d?j.locator[j.alternation]:d;for(c=g-1;c>h&&(e=i[c],(e.match.optionality||e.match.optionalQuantifier||l&&(l!==i[c].locator[j.alternation]&&null!=e.match.fn||null===e.match.fn&&e.locator[j.alternation]&&B(e.locator[j.alternation].toString().split(","),l.toString().split(","))&&""!==w(c)[0].def))&&f[c]===I(c,e.match));c--)g--;return b?{l:g,def:i[g]?i[g].match:d}:g}function N(a){for(var b,c=M(),d=a.length;c<d&&!D(c+1)&&(b=u(c+1))&&b.match.optionality!==!0&&b.match.optionalQuantifier!==!0;)c++;for(;(b=u(c-1))&&b.match.optionality&&b.input===i.skipOptionalPartCharacter;)c--;return a.splice(c),a}function O(b){if(a.isFunction(i.isComplete))return i.isComplete(b,i);if("*"===i.repeat)return d;var c=!1,e=M(!0),f=F(e.l);if(e.def===d||e.def.newBlockMarker||e.def.optionality||e.def.optionalQuantifier){c=!0;for(var g=0;g<=f;g++){var h=t(g).match;if(null!==h.fn&&o().validPositions[g]===d&&h.optionality!==!0&&h.optionalQuantifier!==!0||null===h.fn&&b[g]!==I(g,h)){c=!1;break}}}return c}function P(b,c,f,g){function h(){if(i.keepStatic){for(var c=[],e=q(-1,!0),f=a.extend(!0,{},o().validPositions),g=o().validPositions[e];e>=0;e--){var h=o().validPositions[e];if(h){if(h.generatedInput!==!0&&/[0-9a-bA-Z]/.test(h.input)&&c.push(h.input),delete o().validPositions[e],h.alternation!==d&&h.locator[h.alternation]!==g.locator[h.alternation])break;g=h}}if(e>-1)for(o().p=E(q(-1,!0));c.length>0;){var j=new a.Event("keypress");j.which=c.pop().charCodeAt(0),da.keypressEvent.call(b,j,!0,!1,!1,o().p)}else o().validPositions=a.extend(!0,{},f)}}if((i.numericInput||Z)&&(c===e.keyCode.BACKSPACE?c=e.keyCode.DELETE:c===e.keyCode.DELETE&&(c=e.keyCode.BACKSPACE),Z)){var j=f.end;f.end=f.begin,f.begin=j}c===e.keyCode.BACKSPACE&&(f.end-f.begin<1||i.insertMode===!1)?(f.begin=F(f.begin),o().validPositions[f.begin]===d||o().validPositions[f.begin].input!==i.groupSeparator&&o().validPositions[f.begin].input!==i.radixPoint||f.begin--):c===e.keyCode.DELETE&&f.begin===f.end&&(f.end=D(f.end,!0)?f.end+1:E(f.end)+1,o().validPositions[f.begin]===d||o().validPositions[f.begin].input!==i.groupSeparator&&o().validPositions[f.begin].input!==i.radixPoint||f.end++),r(f.begin,f.end,!1,g),g!==!0&&h();var k=q(f.begin,!0);k<f.begin?o().p=E(k):g!==!0&&(o().p=f.begin)}function Q(d){function e(a){var b,e=c.createElement("span");for(var f in h)isNaN(f)&&f.indexOf("font")!==-1&&(e.style[f]=h[f]);e.style.textTransform=h.textTransform,e.style.letterSpacing=h.letterSpacing,e.style.position="absolute",e.style.height="auto",e.style.width="auto",e.style.visibility="hidden",e.style.whiteSpace="nowrap",c.body.appendChild(e);var g,i=d.inputmask._valueGet(),j=0;for(b=0,g=i.length;b<=g;b++){if(e.innerHTML+=i.charAt(b)||"_",e.offsetWidth>=a){var k=a-j,l=e.offsetWidth-a;e.innerHTML=i.charAt(b),k-=e.offsetWidth/3,b=k<l?b-1:b;break}j=e.offsetWidth}return c.body.removeChild(e),b}function f(){W.style.position="absolute",W.style.top=g.top+"px",W.style.left=g.left+"px",W.style.width=parseInt(d.offsetWidth)-parseInt(h.paddingLeft)-parseInt(h.paddingRight)-parseInt(h.borderLeftWidth)-parseInt(h.borderRightWidth)+"px",W.style.height=parseInt(d.offsetHeight)-parseInt(h.paddingTop)-parseInt(h.paddingBottom)-parseInt(h.borderTopWidth)-parseInt(h.borderBottomWidth)+"px",W.style.lineHeight=W.style.height,W.style.zIndex=isNaN(h.zIndex)?-1:h.zIndex-1,W.style.webkitAppearance="textfield",W.style.mozAppearance="textfield",W.style.Appearance="textfield"}var g=a(d).position(),h=(d.ownerDocument.defaultView||b).getComputedStyle(d,null);d.parentNode;W=c.createElement("div"),c.body.appendChild(W);for(var j in h)isNaN(j)&&"cssText"!==j&&j.indexOf("webkit")==-1&&(W.style[j]=h[j]);d.style.backgroundColor="transparent",d.style.color="transparent",d.style.webkitAppearance="caret",d.style.mozAppearance="caret",d.style.Appearance="caret",f(),a(b).on("resize",function(c){g=a(d).position(),h=(d.ownerDocument.defaultView||b).getComputedStyle(d,null),f()}),a(d).on("click",function(a){return L(d,e(a.clientX)),da.clickEvent.call(this,[a])}),a(d).on("keydown",function(a){a.shiftKey||i.insertMode===!1||setTimeout(function(){R(d)},0)})}function R(a,b,e){function f(){h||null!==k.fn&&l.input!==d?h&&null!==k.fn&&l.input!==d&&(h=!1,g+="</span>"):(h=!0,g+="<span class='im-static''>")}if(W!==d){b=b||y(),e===d?e=L(a):e.begin===d&&(e={begin:e,end:e});var g="",h=!1;if(""!=b){var j,k,l,m=0,n=q();do m===e.begin&&c.activeElement===a&&(g+="<span class='im-caret' style='border-right-width: 1px;border-right-style: solid;'></span>"),o().validPositions[m]?(l=o().validPositions[m],k=l.match,j=l.locator.slice(),f(),g+=l.input):(l=t(m,j,m-1),k=l.match,j=l.locator.slice(),(i.jitMasking===!1||m<n||"number"==typeof i.jitMasking&&isFinite(i.jitMasking)&&i.jitMasking>m)&&(f(),g+=I(m,k))),m++;while((V===d||m<V)&&(null!==k.fn||""!==k.def)||n>m)}W.innerHTML=g}}function S(b){function e(b,e){function f(b){function f(b){if(a.valHooks&&(a.valHooks[b]===d||a.valHooks[b].inputmaskpatch!==!0)){var c=a.valHooks[b]&&a.valHooks[b].get?a.valHooks[b].get:function(a){return a.value},f=a.valHooks[b]&&a.valHooks[b].set?a.valHooks[b].set:function(a,b){return a.value=b,a};a.valHooks[b]={get:function(a){if(a.inputmask){if(a.inputmask.opts.autoUnmask)return a.inputmask.unmaskedvalue();var b=c(a);return q(d,d,a.inputmask.maskset.validPositions)!==-1||e.nullable!==!0?b:""}return c(a)},set:function(b,c){var d,e=a(b);return d=f(b,c),b.inputmask&&e.trigger("setvalue"),d},inputmaskpatch:!0}}}function g(){return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():q()!==-1||e.nullable!==!0?c.activeElement===this&&e.clearMaskOnLostFocus?(Z?N(y().slice()).reverse():N(y().slice())).join(""):j.call(this):"":j.call(this)}function h(b){k.call(this,b),this.inputmask&&a(this).trigger("setvalue")}function i(b){ca.on(b,"mouseenter",function(b){var c=a(this),d=this,e=d.inputmask._valueGet();e!==y().join("")&&c.trigger("setvalue")})}var j,k;if(!b.inputmask.__valueGet){if(e.noValuePatching!==!0){if(Object.getOwnPropertyDescriptor){"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"==typeof"test".__proto__?function(a){return a.__proto__}:function(a){return a.constructor.prototype});var l=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(b),"value"):d;l&&l.get&&l.set?(j=l.get,k=l.set,Object.defineProperty(b,"value",{get:g,set:h,configurable:!0})):"INPUT"!==b.tagName&&(j=function(){return this.textContent},k=function(a){this.textContent=a},Object.defineProperty(b,"value",{get:g,set:h,configurable:!0}))}else c.__lookupGetter__&&b.__lookupGetter__("value")&&(j=b.__lookupGetter__("value"),k=b.__lookupSetter__("value"),b.__defineGetter__("value",g),b.__defineSetter__("value",h));b.inputmask.__valueGet=j,b.inputmask.__valueSet=k}b.inputmask._valueGet=function(a){return Z&&a!==!0?j.call(this.el).split("").reverse().join(""):j.call(this.el)},b.inputmask._valueSet=function(a,b){k.call(this.el,null===a||a===d?"":b!==!0&&Z?a.split("").reverse().join(""):a)},j===d&&(j=function(){return this.value},k=function(a){this.value=a},f(b.type),i(b))}}var g=b.getAttribute("type"),h="INPUT"===b.tagName&&a.inArray(g,e.supportsInputType)!==-1||b.isContentEditable||"TEXTAREA"===b.tagName;if(!h)if("INPUT"===b.tagName){var i=c.createElement("input");i.setAttribute("type",g),h="text"===i.type,i=null}else h="partial";return h!==!1&&f(b),h}ca.off(b);var f=e(b,i);if(f!==!1&&(Y=b,U=a(Y),("rtl"===Y.dir||i.rightAlign)&&(Y.style.textAlign="right"),("rtl"===Y.dir||i.numericInput)&&(Y.dir="ltr",Y.removeAttribute("dir"),Y.inputmask.isRTL=!0,Z=!0),i.colorMask===!0&&Q(Y),m&&(Y.hasOwnProperty("inputmode")&&(Y.inputmode=i.inputmode,Y.setAttribute("inputmode",i.inputmode)),"rtfm"===i.androidHack&&(i.colorMask!==!0&&Q(Y),Y.type="password")),f===!0&&(ca.on(Y,"submit",da.submitEvent),ca.on(Y,"reset",da.resetEvent),ca.on(Y,"mouseenter",da.mouseenterEvent),ca.on(Y,"blur",da.blurEvent),ca.on(Y,"focus",da.focusEvent),ca.on(Y,"mouseleave",da.mouseleaveEvent),i.colorMask!==!0&&ca.on(Y,"click",da.clickEvent),ca.on(Y,"dblclick",da.dblclickEvent),ca.on(Y,"paste",da.pasteEvent),ca.on(Y,"dragdrop",da.pasteEvent),ca.on(Y,"drop",da.pasteEvent),ca.on(Y,"cut",da.cutEvent),ca.on(Y,"complete",i.oncomplete),ca.on(Y,"incomplete",i.onincomplete),ca.on(Y,"cleared",i.oncleared),m||i.inputEventOnly===!0||(ca.on(Y,"keydown",da.keydownEvent),ca.on(Y,"keypress",da.keypressEvent)),ca.on(Y,"compositionstart",a.noop),ca.on(Y,"compositionupdate",a.noop),ca.on(Y,"compositionend",a.noop),ca.on(Y,"keyup",a.noop),ca.on(Y,"input",da.inputFallBackEvent),ca.on(Y,"beforeinput",a.noop)),ca.on(Y,"setvalue",da.setValueEvent),x(),""!==Y.inputmask._valueGet(!0)||i.clearMaskOnLostFocus===!1||c.activeElement===Y)){var g=a.isFunction(i.onBeforeMask)?i.onBeforeMask(Y.inputmask._valueGet(!0),i)||Y.inputmask._valueGet(!0):Y.inputmask._valueGet(!0);""!==g&&J(Y,!0,!1,Z?g.split("").reverse():g.split(""));var h=y().slice();T=h.join(""),O(h)===!1&&i.clearIncomplete&&p(),i.clearMaskOnLostFocus&&c.activeElement!==Y&&(q()===-1?h=[]:N(h)),H(Y,h),c.activeElement===Y&&L(Y,E(q()))}}g=g||this.maskset,i=i||this.opts;var T,U,V,W,X,Y=this.el,Z=this.isRTL,$=!1,_=!1,aa=!1,ba=!1,ca={on:function(b,c,f){var g=function(b){if(this.inputmask===d&&"FORM"!==this.nodeName){var c=a.data(this,"_inputmask_opts");c?new e(c).mask(this):ca.off(this)}else{if("setvalue"===b.type||"FORM"===this.nodeName||!(this.disabled||this.readOnly&&!("keydown"===b.type&&b.ctrlKey&&67===b.keyCode||i.tabThrough===!1&&b.keyCode===e.keyCode.TAB))){switch(b.type){case"input":if(_===!0)return _=!1,b.preventDefault();break;case"keydown":$=!1,_=!1;break;case"keypress":if($===!0)return b.preventDefault();$=!0;break;case"click":if(k||l){var g=this,h=arguments;return setTimeout(function(){f.apply(g,h)},0),!1}}var j=f.apply(this,arguments);return j===!1&&(b.preventDefault(),b.stopPropagation()),j}b.preventDefault()}};b.inputmask.events[c]=b.inputmask.events[c]||[],b.inputmask.events[c].push(g),a.inArray(c,["submit","reset"])!==-1?null!=b.form&&a(b.form).on(c,g):a(b).on(c,g)},off:function(b,c){if(b.inputmask&&b.inputmask.events){var d;c?(d=[],d[c]=b.inputmask.events[c]):d=b.inputmask.events,a.each(d,function(c,d){for(;d.length>0;){var e=d.pop();a.inArray(c,["submit","reset"])!==-1?null!=b.form&&a(b.form).off(c,e):a(b).off(c,e)}delete b.inputmask.events[c]})}}},da={keydownEvent:function(b){function d(a){var b=c.createElement("input"),d="on"+a,e=d in b;return e||(b.setAttribute(d,"return;"),e="function"==typeof b[d]),b=null,e}var f=this,g=a(f),h=b.keyCode,j=L(f);if(h===e.keyCode.BACKSPACE||h===e.keyCode.DELETE||l&&h===e.keyCode.BACKSPACE_SAFARI||b.ctrlKey&&h===e.keyCode.X&&!d("cut"))b.preventDefault(),P(f,h,j),H(f,y(!0),o().p,b,f.inputmask._valueGet()!==y().join("")),f.inputmask._valueGet()===x().join("")?g.trigger("cleared"):O(y())===!0&&g.trigger("complete");else if(h===e.keyCode.END||h===e.keyCode.PAGE_DOWN){b.preventDefault();var k=E(q());i.insertMode||k!==o().maskLength||b.shiftKey||k--,L(f,b.shiftKey?j.begin:k,k,!0)}else h===e.keyCode.HOME&&!b.shiftKey||h===e.keyCode.PAGE_UP?(b.preventDefault(),L(f,0,b.shiftKey?j.begin:0,!0)):(i.undoOnEscape&&h===e.keyCode.ESCAPE||90===h&&b.ctrlKey)&&b.altKey!==!0?(J(f,!0,!1,T.split("")),
- g.trigger("click")):h!==e.keyCode.INSERT||b.shiftKey||b.ctrlKey?i.tabThrough===!0&&h===e.keyCode.TAB?(b.shiftKey===!0?(null===u(j.begin).match.fn&&(j.begin=E(j.begin)),j.end=F(j.begin,!0),j.begin=F(j.end,!0)):(j.begin=E(j.begin,!0),j.end=E(j.begin,!0),j.end<o().maskLength&&j.end--),j.begin<o().maskLength&&(b.preventDefault(),L(f,j.begin,j.end))):b.shiftKey||i.insertMode===!1&&(h===e.keyCode.RIGHT?setTimeout(function(){var a=L(f);L(f,a.begin)},0):h===e.keyCode.LEFT&&setTimeout(function(){var a=L(f);L(f,Z?a.begin+1:a.begin-1)},0)):(i.insertMode=!i.insertMode,L(f,i.insertMode||j.begin!==o().maskLength?j.begin:j.begin-1));i.onKeyDown.call(this,b,y(),L(f).begin,i),aa=a.inArray(h,i.ignorables)!==-1},keypressEvent:function(b,c,f,g,h){var j=this,k=a(j),l=b.which||b.charCode||b.keyCode;if(!(c===!0||b.ctrlKey&&b.altKey)&&(b.ctrlKey||b.metaKey||aa))return l===e.keyCode.ENTER&&T!==y().join("")&&(T=y().join(""),setTimeout(function(){k.trigger("change")},0)),!0;if(l){46===l&&b.shiftKey===!1&&""!==i.radixPoint&&(l=i.radixPoint.charCodeAt(0));var m,n=c?{begin:h,end:h}:L(j),q=String.fromCharCode(l);o().writeOutBuffer=!0;var r=C(n,q,g);if(r!==!1&&(p(!0),m=r.caret!==d?r.caret:c?r.pos+1:E(r.pos),o().p=m),f!==!1){var s=this;if(setTimeout(function(){i.onKeyValidation.call(s,l,r,i)},0),o().writeOutBuffer&&r!==!1){var t=y();H(j,t,i.numericInput&&r.caret===d?F(m):m,b,c!==!0),c!==!0&&setTimeout(function(){O(t)===!0&&k.trigger("complete")},0)}}if(b.preventDefault(),c)return r.forwardPosition=m,r}},pasteEvent:function(c){var d,e=this,f=c.originalEvent||c,g=a(e),h=e.inputmask._valueGet(!0),j=L(e);Z&&(d=j.end,j.end=j.begin,j.begin=d);var k=h.substr(0,j.begin),l=h.substr(j.end,h.length);if(k===(Z?x().reverse():x()).slice(0,j.begin).join("")&&(k=""),l===(Z?x().reverse():x()).slice(j.end).join("")&&(l=""),Z&&(d=k,k=l,l=d),b.clipboardData&&b.clipboardData.getData)h=k+b.clipboardData.getData("Text")+l;else{if(!f.clipboardData||!f.clipboardData.getData)return!0;h=k+f.clipboardData.getData("text/plain")+l}var m=h;if(a.isFunction(i.onBeforePaste)){if(m=i.onBeforePaste(h,i),m===!1)return c.preventDefault();m||(m=h)}return J(e,!1,!1,Z?m.split("").reverse():m.toString().split("")),H(e,y(),E(q()),c,T!==y().join("")),O(y())===!0&&g.trigger("complete"),c.preventDefault()},inputFallBackEvent:function(b){var c=this,d=c.inputmask._valueGet();if(y().join("")!==d){var f=L(c);if("."===d.charAt(f.begin-1)&&""!==i.radixPoint&&(d=d.split(""),d[f.begin-1]=i.radixPoint.charAt(0),d=d.join("")),d.charAt(f.begin-1)===i.radixPoint&&d.length>y().length){var g=new a.Event("keypress");return g.which=i.radixPoint.charCodeAt(0),da.keypressEvent.call(c,g,!0,!0,!1,f.begin),!1}if(d=d.replace(new RegExp("("+e.escapeRegex(x().join(""))+")*"),""),k){var h=d.replace(y().join(""),"");if(1===h.length){var g=new a.Event("keypress");return g.which=h.charCodeAt(0),da.keypressEvent.call(c,g,!0,!0,!1,o().validPositions[f.begin-1]?f.begin:f.begin-1),!1}}if(f.begin>d.length&&(L(c,d.length),f=L(c)),y().length-d.length!==1||d.charAt(f.begin)===y()[f.begin]||d.charAt(f.begin+1)===y()[f.begin]||D(f.begin)){var j=[],l=n(!0,1).join("");for(j.push(d.substr(0,f.begin)),j.push(d.substr(f.begin));null===d.match(e.escapeRegex(l)+"$");)l=l.slice(1);d=d.replace(l,""),a.isFunction(i.onBeforeMask)&&(d=i.onBeforeMask(d,i)||d),J(c,!0,!1,d.split(""),b);var p=L(c).begin,q=c.inputmask._valueGet(),r=q.indexOf(j[0]);if(0===r&&p!==j[0].length)L(c,j[0].length),m&&setTimeout(function(){L(c,j[0].length)},0);else{for(;null===q.match(e.escapeRegex(j[1])+"$");)j[1]=j[1].substr(1);var s=q.indexOf(j[1]);s!==-1&&""!==j[1]&&p>s&&s>r&&(L(c,s),m&&setTimeout(function(){L(c,s)},0))}O(y())===!0&&a(c).trigger("complete")}else b.keyCode=e.keyCode.BACKSPACE,da.keydownEvent.call(c,b);b.preventDefault()}},setValueEvent:function(b){this.inputmask.refreshValue=!1;var c=this,d=c.inputmask._valueGet(!0);a.isFunction(i.onBeforeMask)&&(d=i.onBeforeMask(d,i)||d),d=d.split(""),J(c,!0,!1,Z?d.reverse():d),T=y().join(""),(i.clearMaskOnLostFocus||i.clearIncomplete)&&c.inputmask._valueGet()===x().join("")&&c.inputmask._valueSet("")},focusEvent:function(a){var b=this,c=b.inputmask._valueGet();i.showMaskOnFocus&&(!i.showMaskOnHover||i.showMaskOnHover&&""===c)&&(b.inputmask._valueGet()!==y().join("")?H(b,y(),E(q())):ba===!1&&L(b,E(q()))),i.positionCaretOnTab===!0&&ba===!1&&da.clickEvent.apply(b,[a,!0]),T=y().join("")},mouseleaveEvent:function(a){var b=this;if(ba=!1,i.clearMaskOnLostFocus&&c.activeElement!==b){var d=y().slice(),e=b.inputmask._valueGet();e!==b.getAttribute("placeholder")&&""!==e&&(q()===-1&&e===x().join("")?d=[]:N(d),H(b,d))}},clickEvent:function(b,e){function f(b){if(""!==i.radixPoint){var c=o().validPositions;if(c[b]===d||c[b].input===I(b)){if(b<E(-1))return!0;var e=a.inArray(i.radixPoint,y());if(e!==-1){for(var f in c)if(e<f&&c[f].input!==I(f))return!1;return!0}}}return!1}var g=this;setTimeout(function(){if(c.activeElement===g){var a=L(g);if(e&&(Z?a.end=a.begin:a.begin=a.end),a.begin===a.end)switch(i.positionCaretOnClick){case"none":break;case"radixFocus":if(f(a.begin)){var b=y().join("").indexOf(i.radixPoint);L(g,i.numericInput?E(b):b);break}default:var d=a.begin,h=q(d,!0),j=E(h);if(d<j)L(g,D(d)||D(d-1)?d:E(d));else{var k=I(j);(""!==k&&y()[j]!==k&&u(j).match.optionalQuantifier!==!0||!D(j)&&u(j).match.def===k)&&(j=E(j)),L(g,j)}}}},0)},dblclickEvent:function(a){var b=this;setTimeout(function(){L(b,0,E(q()))},0)},cutEvent:function(d){var f=this,g=a(f),h=L(f),i=d.originalEvent||d,j=b.clipboardData||i.clipboardData,k=Z?y().slice(h.end,h.begin):y().slice(h.begin,h.end);j.setData("text",Z?k.reverse().join(""):k.join("")),c.execCommand&&c.execCommand("copy"),P(f,e.keyCode.DELETE,h),H(f,y(),o().p,d,T!==y().join("")),f.inputmask._valueGet()===x().join("")&&g.trigger("cleared")},blurEvent:function(b){var c=a(this),e=this;if(e.inputmask){var f=e.inputmask._valueGet(),g=y().slice();T!==g.join("")&&setTimeout(function(){c.trigger("change"),T=g.join("")},0),""!==f&&(i.clearMaskOnLostFocus&&(q()===-1&&f===x().join("")?g=[]:N(g)),O(g)===!1&&(setTimeout(function(){c.trigger("incomplete")},0),i.clearIncomplete&&(p(),g=i.clearMaskOnLostFocus?[]:x().slice())),H(e,g,d,b))}},mouseenterEvent:function(a){var b=this;ba=!0,c.activeElement!==b&&i.showMaskOnHover&&b.inputmask._valueGet()!==y().join("")&&H(b,y())},submitEvent:function(a){T!==y().join("")&&U.trigger("change"),i.clearMaskOnLostFocus&&q()===-1&&Y.inputmask._valueGet&&Y.inputmask._valueGet()===x().join("")&&Y.inputmask._valueSet(""),i.removeMaskOnSubmit&&(Y.inputmask._valueSet(Y.inputmask.unmaskedvalue(),!0),setTimeout(function(){H(Y,y())},0))},resetEvent:function(a){Y.inputmask.refreshValue=!0,setTimeout(function(){U.trigger("setvalue")},0)}};if(f!==d)switch(f.action){case"isComplete":return Y=f.el,O(y());case"unmaskedvalue":return Y!==d&&f.value===d||(X=f.value,X=(a.isFunction(i.onBeforeMask)?i.onBeforeMask(X,i)||X:X).split(""),J(d,!1,!1,Z?X.reverse():X),a.isFunction(i.onBeforeWrite)&&i.onBeforeWrite(d,y(),0,i)),K(Y);case"mask":S(Y);break;case"format":return X=(a.isFunction(i.onBeforeMask)?i.onBeforeMask(f.value,i)||f.value:f.value).split(""),J(d,!0,!1,Z?X.reverse():X),f.metadata?{value:Z?y().slice().reverse().join(""):y().join(""),metadata:h.call(this,{action:"getmetadata"},g,i)}:Z?y().slice().reverse().join(""):y().join("");case"isValid":f.value?(X=f.value.split(""),J(d,!0,!0,Z?X.reverse():X)):f.value=y().join("");for(var ea=y(),fa=M(),ga=ea.length-1;ga>fa&&!D(ga);ga--);return ea.splice(fa,ga+1-fa),O(ea)&&f.value===y().join("");case"getemptymask":return x().join("");case"remove":if(Y&&Y.inputmask){U=a(Y),Y.inputmask._valueSet(i.autoUnmask?K(Y):Y.inputmask._valueGet(!0)),ca.off(Y);var ha;Object.getOwnPropertyDescriptor&&Object.getPrototypeOf?(ha=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Y),"value"),ha&&Y.inputmask.__valueGet&&Object.defineProperty(Y,"value",{get:Y.inputmask.__valueGet,set:Y.inputmask.__valueSet,configurable:!0})):c.__lookupGetter__&&Y.__lookupGetter__("value")&&Y.inputmask.__valueGet&&(Y.__defineGetter__("value",Y.inputmask.__valueGet),Y.__defineSetter__("value",Y.inputmask.__valueSet)),Y.inputmask=d}return Y;case"getmetadata":if(a.isArray(g.metadata)){var ia=n(!0,0,!1).join("");return a.each(g.metadata,function(a,b){if(b.mask===ia)return ia=b,!1}),ia}return g.metadata}}var i=navigator.userAgent,j=/mobile/i.test(i),k=/iemobile/i.test(i),l=/iphone/i.test(i)&&!k,m=/android/i.test(i)&&!k;return e.prototype={dataAttribute:"data-inputmask",defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},alternatormarker:"|",escapeChar:"\\",mask:null,regex:null,oncomplete:a.noop,onincomplete:a.noop,oncleared:a.noop,repeat:0,greedy:!0,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,alias:null,onKeyDown:a.noop,onBeforeMask:null,onBeforePaste:function(b,c){return a.isFunction(c.onBeforeMask)?c.onBeforeMask(b,c):b},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:a.noop,skipOptionalPartCharacter:" ",numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",radixPointDefinitionSymbol:d,groupSeparator:"",keepStatic:null,positionCaretOnTab:!0,tabThrough:!1,supportsInputType:["text","tel","password"],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,0,229],isComplete:null,canClearPosition:a.noop,preValidation:null,postValidation:null,staticDefinitionSymbol:d,jitMasking:!1,nullable:!0,inputEventOnly:!1,noValuePatching:!1,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:!1,androidHack:!1},definitions:{9:{validator:"[0-9]",cardinality:1,definitionSymbol:"*"},a:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,definitionSymbol:"*"},"*":{validator:function(){return!0},cardinality:1}},aliases:{},masksCache:{},mask:function(i){function j(c,e,g,h){function i(a,e){e=e!==d?e:c.getAttribute(h+"-"+a),null!==e&&("string"==typeof e&&(0===a.indexOf("on")?e=b[e]:"false"===e?e=!1:"true"===e&&(e=!0)),g[a]=e)}var j,k,l,m,n=c.getAttribute(h);if(n&&""!==n&&(n=n.replace(new RegExp("'","g"),'"'),k=JSON.parse("{"+n+"}")),k){l=d;for(m in k)if("alias"===m.toLowerCase()){l=k[m];break}}i("alias",l),g.alias&&f(g.alias,g,e);for(j in e){if(k){l=d;for(m in k)if(m.toLowerCase()===j.toLowerCase()){l=k[m];break}}i(j,l)}return a.extend(!0,e,g),e}var k=this;return"string"==typeof i&&(i=c.getElementById(i)||c.querySelectorAll(i)),i=i.nodeName?[i]:i,a.each(i,function(b,c){var f=a.extend(!0,{},k.opts);j(c,f,a.extend(!0,{},k.userOptions),k.dataAttribute);var i=g(f,k.noMasksCache);i!==d&&(c.inputmask!==d&&c.inputmask.remove(),c.inputmask=new e(d,d,(!0)),c.inputmask.opts=f,c.inputmask.noMasksCache=k.noMasksCache,c.inputmask.userOptions=a.extend(!0,{},k.userOptions),c.inputmask.isRTL=k.isRTL,c.inputmask.el=c,c.inputmask.maskset=i,a.data(c,"_inputmask_opts",f),h.call(c.inputmask,{action:"mask"}))}),i&&i[0]?i[0].inputmask||this:this},option:function(b,c){return"string"==typeof b?this.opts[b]:"object"==typeof b?(a.extend(this.userOptions,b),this.el&&c!==!0&&this.mask(this.el),this):void 0},unmaskedvalue:function(a){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"unmaskedvalue",value:a})},remove:function(){return h.call(this,{action:"remove"})},getemptymask:function(){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"getemptymask"})},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"isComplete"})},getmetadata:function(){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"getmetadata"})},isValid:function(a){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"isValid",value:a})},format:function(a,b){return this.maskset=this.maskset||g(this.opts,this.noMasksCache),h.call(this,{action:"format",value:a,metadata:b})},analyseMask:function(b,c,f){function g(a,b,c,d){this.matches=[],this.openGroup=a||!1,this.isGroup=a||!1,this.isOptional=b||!1,this.isQuantifier=c||!1,this.isAlternator=d||!1,this.quantifier={min:1,max:1}}function h(a,b,g){if(g=g!==d?g:a.matches.length,c)0===b.indexOf("[")||u?a.matches.splice(g++,0,{fn:new RegExp(b),cardinality:0,optionality:a.isOptional,newBlockMarker:i===d||i.def!==b,casing:null,def:f.staticDefinitionSymbol||b,placeholder:f.staticDefinitionSymbol!==d?b:d,nativeDef:b}):a.matches.splice(g++,0,{fn:null,cardinality:0,optionality:a.isOptional,newBlockMarker:i===d||i.def!==b,casing:null,def:f.staticDefinitionSymbol||b,placeholder:f.staticDefinitionSymbol!==d?b:d,nativeDef:b}),u=!1;else{var h=(f.definitions?f.definitions[b]:d)||e.prototype.definitions[b],i=a.matches[g-1];if(h&&!u){for(var j=h.prevalidator,k=j?j.length:0,l=1;l<h.cardinality;l++){var m=k>=l?j[l-1]:[],n=m.validator,o=m.cardinality;a.matches.splice(g++,0,{fn:n?"string"==typeof n?new RegExp(n):new function(){this.test=n}:new RegExp("."),cardinality:o?o:1,optionality:a.isOptional,newBlockMarker:i===d||i.def!==(h.definitionSymbol||b),casing:h.casing,def:h.definitionSymbol||b,placeholder:h.placeholder,nativeDef:b}),i=a.matches[g-1]}a.matches.splice(g++,0,{fn:h.validator?"string"==typeof h.validator?new RegExp(h.validator):new function(){this.test=h.validator}:new RegExp("."),cardinality:h.cardinality,optionality:a.isOptional,newBlockMarker:i===d||i.def!==(h.definitionSymbol||b),casing:h.casing,def:h.definitionSymbol||b,placeholder:h.placeholder,nativeDef:b})}else a.matches.splice(g++,0,{fn:null,cardinality:0,optionality:a.isOptional,newBlockMarker:i===d||i.def!==b,casing:null,def:f.staticDefinitionSymbol||b,placeholder:f.staticDefinitionSymbol!==d?b:d,nativeDef:b}),u=!1}}function i(b){b&&b.matches&&a.each(b.matches,function(a,c){var e=b.matches[a+1];(e===d||e.matches===d||e.isQuantifier===!1)&&c&&c.isGroup&&(c.isGroup=!1,h(c,f.groupmarker.start,0),c.openGroup!==!0&&h(c,f.groupmarker.end)),i(c)})}function j(){if(w.length>0){if(o=w[w.length-1],h(o,m),o.isAlternator){p=w.pop();for(var a=0;a<p.matches.length;a++)p.matches[a].isGroup=!1;w.length>0?(o=w[w.length-1],o.matches.push(p)):v.matches.push(p)}}else h(v,m)}function k(a){function b(a){return a===f.optionalmarker.start?a=f.optionalmarker.end:a===f.optionalmarker.end?a=f.optionalmarker.start:a===f.groupmarker.start?a=f.groupmarker.end:a===f.groupmarker.end&&(a=f.groupmarker.start),a}a.matches=a.matches.reverse();for(var c in a.matches)if(a.matches.hasOwnProperty(c)){var e=parseInt(c);if(a.matches[c].isQuantifier&&a.matches[e+1]&&a.matches[e+1].isGroup){var g=a.matches[c];a.matches.splice(c,1),a.matches.splice(e+1,0,g)}a.matches[c].matches!==d?a.matches[c]=k(a.matches[c]):a.matches[c]=b(a.matches[c])}return a}var l,m,n,o,p,q,r,s=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,t=/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,u=!1,v=new g,w=[],x=[];for(c&&(f.optionalmarker.start=d,f.optionalmarker.end=d);l=c?t.exec(b):s.exec(b);){if(m=l[0],c)switch(m.charAt(0)){case"?":m="{+}";break;case"+":case"*":m="{"+m+"}"}if(u)j();else switch(m.charAt(0)){case f.escapeChar:u=!0,c&&j();break;case f.optionalmarker.end:case f.groupmarker.end:if(n=w.pop(),n.openGroup=!1,n!==d)if(w.length>0){if(o=w[w.length-1],o.matches.push(n),o.isAlternator){p=w.pop();for(var y=0;y<p.matches.length;y++)p.matches[y].isGroup=!1;w.length>0?(o=w[w.length-1],o.matches.push(p)):v.matches.push(p)}}else v.matches.push(n);else j();break;case f.optionalmarker.start:w.push(new g((!1),(!0)));break;case f.groupmarker.start:w.push(new g((!0)));break;case f.quantifiermarker.start:var z=new g((!1),(!1),(!0));m=m.replace(/[{}]/g,"");var A=m.split(","),B=isNaN(A[0])?A[0]:parseInt(A[0]),C=1===A.length?B:isNaN(A[1])?A[1]:parseInt(A[1]);if("*"!==C&&"+"!==C||(B="*"===C?0:1),z.quantifier={min:B,max:C},w.length>0){var D=w[w.length-1].matches;l=D.pop(),l.isGroup||(r=new g((!0)),r.matches.push(l),l=r),D.push(l),D.push(z)}else l=v.matches.pop(),l.isGroup||(r=new g((!0)),r.matches.push(l),l=r),v.matches.push(l),v.matches.push(z);break;case f.alternatormarker:w.length>0?(o=w[w.length-1],q=o.matches.pop()):q=v.matches.pop(),q.isAlternator?w.push(q):(p=new g((!1),(!1),(!1),(!0)),p.matches.push(q),w.push(p));break;default:j()}}for(;w.length>0;)n=w.pop(),v.matches.push(n);return v.matches.length>0&&(i(v),x.push(v)),f.numericInput&&k(x[0]),x}},e.extendDefaults=function(b){a.extend(!0,e.prototype.defaults,b)},e.extendDefinitions=function(b){a.extend(!0,e.prototype.definitions,b)},e.extendAliases=function(b){a.extend(!0,e.prototype.aliases,b)},e.format=function(a,b,c){return e(b).format(a,c)},e.unmask=function(a,b){return e(b).unmaskedvalue(a)},e.isValid=function(a,b){return e(b).isValid(a)},e.remove=function(b){a.each(b,function(a,b){b.inputmask&&b.inputmask.remove()})},e.escapeRegex=function(a){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return a.replace(new RegExp("(\\"+b.join("|\\")+")","gim"),"\\$1")},e.keyCode={ALT:18,BACKSPACE:8,BACKSPACE_SAFARI:127,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,X:88},e});
|