"use strict";function _typeof3(t){return(_typeof3="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof3(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof3(t)})(t)}
/**
 * jquery.mask.js
 * @version: v1.14.16
 * @author: Igor Escobar
 *
 * Created by Igor Escobar on 2012-03-10. Please report any bug at github.com/igorescobar/jQuery-Mask-Plugin
 *
 * Copyright (c) 2012 Igor Escobar http://igorescobar.com
 *
 * The MIT License (http://www.opensource.org/licenses/mit-license.php)
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
/* jshint laxbreak: true */
/* jshint maxcomplexity:17 */
/* global define */
// UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.
// https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js
!function(t,a,e){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof3(exports))&&"undefined"==typeof Meteor?module.exports=t(require("jquery")):t(a||e)}(function(r){function i(u,y,M){var b={invalid:[],getCaret:function(){try{var t,a=0,e=u.get(0),n=document.selection,s=e.selectionStart;// IE Support
return n&&-1===navigator.appVersion.indexOf("MSIE 10")?((t=n.createRange()).moveStart("character",-b.val().length),a=t.text.length):!s&&"0"!==s||(a=s),a}catch(t){}},setCaret:function(t){try{var a,e;u.is(":focus")&&(// Firefox, WebKit, etc..
(e=u.get(0)).setSelectionRange?e.setSelectionRange(t,t):(
// IE
(a=e.createTextRange()).collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select()))}catch(t){}},events:function(){u.on("keydown.mask",function(t){u.data("mask-keycode",t.keyCode||t.which),u.data("mask-previus-value",u.val()),u.data("mask-previus-caret-pos",b.getCaret()),b.maskDigitPosMapOld=b.maskDigitPosMap}).on(r.jMaskGlobals.useInput?"input.mask":"keyup.mask",b.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){u.keydown().keyup()},100)}).on("change.mask",function(){u.data("changed",!0)}).on("blur.mask",function(){o===b.val()||u.data("changed")||u.trigger("change"),u.data("changed",!1)}).on("blur.mask",function(){o=b.val()}).on("focus.mask",function(t){!0===M.selectOnFocus&&r(t.target).select()}).on("focusout.mask",function(){M.clearIfNotMatch&&!s.test(b.val())&&b.val("")})},getRegexMask:function(){for(var t,a,e,n,s,o=[],r=0;r<y.length;r++)(e=w.translation[y.charAt(r)])?(t=e.pattern.toString().replace(/.{1}$|^.{1}/g,""),a=e.optional,(e=e.recursive)?(o.push(y.charAt(r)),n={digit:y.charAt(r),pattern:t}):o.push(a||e?t+"?":t)):o.push(y.charAt(r).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return s=o.join(""),n&&(s=s.replace(new RegExp("("+n.digit+"(.*"+n.digit+")?)"),"($1)?").replace(new RegExp(n.digit,"g"),n.pattern)),new RegExp(s)},destroyEvents:function(){u.off(["input","keydown","keyup","paste","drop","blur","focusout",""].join(".mask "))},val:function(t){var a=u.is("input")?"val":"text",a=0<arguments.length?(u[a]()!==t&&u[a](t),u):u[a]();return a},calculateCaretPosition:function(t){var a=b.getMasked(),e=b.getCaret();if(t!==a){for(var n=u.data("mask-previus-caret-pos")||0,s=a.length,t=t.length,o=0,r=0,i=0,l=0,c=0,c=e;c<s&&b.maskDigitPosMap[c];c++)r++;for(c=e-1;0<=c&&b.maskDigitPosMap[c];c--)o++;for(c=e-1;0<=c;c--)b.maskDigitPosMap[c]&&i++;for(c=n-1;0<=c;c--)b.maskDigitPosMapOld[c]&&l++;// if the cursor is at the end keep it there
t<e?e=10*s:e<=n&&n!==t?b.maskDigitPosMapOld[e]||(t=e,e-=l-i,b.maskDigitPosMap[e-=o]&&(e=t)):n<e&&(e+=i-l,e+=r)}return e},behaviour:function(t){t=t||window.event,b.invalid=[];var a=u.data("mask-keycode");if(-1===r.inArray(a,w.byPassKeys)){var e=b.getMasked(),a=b.getCaret(),n=u.data("mask-previus-value")||"";// this is a compensation to devices/browsers that don't compensate
// caret positioning the right way
return setTimeout(function(){b.setCaret(b.calculateCaretPosition(n))},r.jMaskGlobals.keyStrokeCompensation),b.val(e),b.setCaret(a),b.callbacks(t)}},getMasked:function(t,a){for(var e,n,s=[],o=void 0===a?b.val():a+"",r=0,i=y.length,l=0,c=o.length,u=1,f="push",d=-1,p=0,k=[],h=M.reverse?(f="unshift",u=-1,e=0,r=i-1,l=c-1,function(){return-1<r&&-1<l}):(e=i-1,function(){return r<i&&l<c});h();){var v=y.charAt(r),m=o.charAt(l),g=w.translation[v];g?(m.match(g.pattern)?(s[f](m),g.recursive&&(-1===d?d=r:r===e&&r!==d&&(r=d-u),e===d&&(r-=u)),r+=u):m===n?(
// matched the last untranslated (raw) mask character that we encountered
// likely an insert offset the mask character from the last entry; fall
// through and only increment v
p--,n=void 0):g.optional?(r+=u,l-=u):g.fallback?(s[f](g.fallback),r+=u,l-=u):b.invalid.push({p:l,v:m,e:g.pattern}),l+=u):(t||s[f](v),m===v?(k.push(l),l+=u):(n=v,k.push(l+p),p++),r+=u)}a=y.charAt(e);i!==c+1||w.translation[a]||s.push(a);a=s.join("");return b.mapMaskdigitPositions(a,k,c),a},mapMaskdigitPositions:function(t,a,e){var n=M.reverse?t.length-e:0;b.maskDigitPosMap={};for(var s=0;s<a.length;s++)b.maskDigitPosMap[a[s]+n]=1},callbacks:function(t){function a(t,a,e){"function"==typeof M[t]&&a&&M[t].apply(this,e)}var e=b.val(),n=e!==o,s=[e,t,u,M];a("onChange",!0==n,s),a("onKeyPress",!0==n,s),a("onComplete",e.length===y.length,s),a("onInvalid",0<b.invalid.length,[e,t,u,b.invalid,M])}};u=r(u);var s,w=this,o=b.val();y="function"==typeof y?y(b.val(),void 0,u,M):y,// public methods
w.mask=y,w.options=M,w.remove=function(){var t=b.getCaret();return w.options.placeholder&&u.removeAttr("placeholder"),u.data("mask-maxlength")&&u.removeAttr("maxlength"),b.destroyEvents(),b.val(w.getCleanVal()),b.setCaret(t),u},// get value without mask
w.getCleanVal=function(){return b.getMasked(!0)},// get masked value without the value being in the input or element
w.getMaskedVal=function(t){return b.getMasked(!1,t)},w.init=function(t){if(t=t||!1,M=M||{},w.clearIfNotMatch=r.jMaskGlobals.clearIfNotMatch,w.byPassKeys=r.jMaskGlobals.byPassKeys,w.translation=r.extend({},r.jMaskGlobals.translation,M.translation),w=r.extend(!0,{},w,M),s=b.getRegexMask(),t)b.events(),b.val(b.getMasked());else{M.placeholder&&u.attr("placeholder",M.placeholder),// this is necessary, otherwise if the user submit the form
// and then press the "back" button, the autocomplete will erase
// the data. Works fine on IE9+, FF, Opera, Safari.
u.data("mask")&&u.attr("autocomplete","off");// detect if is necessary let the user type freely.
// for is a lot faster than forEach.
for(var a=0,e=!0;a<y.length;a++){var n=w.translation[y.charAt(a)];if(n&&n.recursive){e=!1;break}}e&&u.attr("maxlength",y.length).data("mask-maxlength",!0),b.destroyEvents(),b.events();t=b.getCaret();b.val(b.getMasked()),b.setCaret(t)}},w.init(!u.is("input"))}r.maskWatchers={};function a(){var t=r(this),a={},e="data-mask-",n=t.attr("data-mask");if(t.attr(e+"reverse")&&(a.reverse=!0),t.attr(e+"clearifnotmatch")&&(a.clearIfNotMatch=!0),"true"===t.attr(e+"selectonfocus")&&(a.selectOnFocus=!0),l(t,n,a))return t.data("mask",new i(this,n,a))}function l(t,a,e){e=e||{};var n=r(t).data("mask"),s=JSON.stringify,t=r(t).val()||r(t).text();try{return"function"==typeof a&&(a=a(t)),"object"!==(void 0===n?"undefined":_typeof3(n))||s(n.options)!==s(e)||n.mask!==a}catch(t){}}r.fn.mask=function(t,a){a=a||{};function e(){if(l(this,t,a))return r(this).data("mask",new i(this,t,a))}var n=this.selector,s=r.jMaskGlobals,o=s.watchInterval,s=a.watchInputs||s.watchInputs;return r(this).each(e),n&&""!==n&&s&&(clearInterval(r.maskWatchers[n]),r.maskWatchers[n]=setInterval(function(){r(document).find(n).each(e)},o)),this},r.fn.masked=function(t){return this.data("mask").getMaskedVal(t)},r.fn.unmask=function(){return clearInterval(r.maskWatchers[this.selector]),delete r.maskWatchers[this.selector],this.each(function(){var t=r(this).data("mask");t&&t.remove().removeData("mask")})},r.fn.cleanVal=function(){return this.data("mask").getCleanVal()},r.applyDataMask=function(t){((t=t||r.jMaskGlobals.maskElements)instanceof r?t:r(t)).filter(r.jMaskGlobals.dataMaskAttr).each(a)};var t,e,n,s={maskElements:"input,td,span,div",dataMaskAttr:"[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,
// old versions of chrome dont work great with input event
useInput:!/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent)&&(t="input",n=document.createElement("div"),(e=(t="on"+t)in n)||(n.setAttribute(t,"return;"),e="function"==typeof n[t]),n=null,e),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};r.jMaskGlobals=r.jMaskGlobals||{},// looking for inputs with data-mask attribute
(s=r.jMaskGlobals=r.extend(!0,{},s,r.jMaskGlobals)).dataMask&&r.applyDataMask(),setInterval(function(){r.jMaskGlobals.watchDataMask&&r.applyDataMask()},s.watchInterval)},window.jQuery,window.Zepto);