!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):jQuery)}(function(n,t){function f(){return new Date(Date.UTC.apply(Date,arguments))}function s(){var n=new Date;return f(n.getFullYear(),n.getMonth(),n.getDate())}function l(n,t){return n.getUTCFullYear()===t.getUTCFullYear()&&n.getUTCMonth()===t.getUTCMonth()&&n.getUTCDate()===t.getUTCDate()}function h(i,r){return function(){return r!==t&&n.fn.datepicker.deprecated(r),this[i].apply(this,arguments)}}function p(n){return n&&!isNaN(n.getTime())}function w(t,i){function o(n,t){return t.toLowerCase()}var u,f=n(t).data(),e={},s=new RegExp("^"+i.toLowerCase()+"([A-Z])"),r;i=new RegExp("^"+i.toLowerCase());for(r in f)i.test(r)&&(u=r.replace(s,o),e[u]=f[r]);return e}function b(t){var u={},i;if(r[t]||(t=t.split("-")[0],r[t]))return i=r[t],n.each(y,function(n,t){t in i&&(u[t]=i[t])}),u}var a=function(){var t={get:function(n){return this.slice(n)[0]},contains:function(n){for(var i=n&&n.valueOf(),t=0,r=this.length;t<r;t++)if(0<=this[t].valueOf()-i&&this[t].valueOf()-i<864e5)return t;return-1},remove:function(n){this.splice(n,1)},replace:function(t){t&&(n.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.length=0},copy:function(){var n=new a;return n.replace(this),n}};return function(){var i=[];return i.push.apply(i,arguments),n.extend(i,t),i}}(),u=function(t,r){n.data(t,"datepicker",this);this._process_options(r);this.dates=new a;this.viewDate=this.o.defaultViewDate;this.focusDate=null;this.element=n(t);this.isInput=this.element.is("input");this.inputField=this.isInput?this.element:this.element.find("input");this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .btn");this.component&&0===this.component.length&&(this.component=!1);this.isInline=!this.component&&this.element.is("div");this.picker=n(i.template);this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow);this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&this.picker.addClass("datepicker-rtl");this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(n,t){return Number(t)+1});this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled});this._allow_update=!1;this.setViewMode(this.o.startView);this._allow_update=!0;this.fillDow();this.fillMonths();this.update();this.isInline&&this.show()},c,v,o,e,y,r,i;u.prototype={constructor:u,_resolveViewName:function(t){return n.each(i.viewModes,function(i,r){if(t===i||n.inArray(t,r.names)!==-1)return t=i,!1}),t},_resolveDaysOfWeek:function(t){return n.isArray(t)||(t=t.split(/[,\s]*/)),n.map(t,Number)},_check_template:function(i){try{if(i===t||""===i)return!1;if((i.match(/[<>]/g)||[]).length<=0)return!0;var r=n(i);return r.length>0}catch(n){return!1}},_process_options:function(t){var u,h,l,o,c;if(this._o=n.extend({},this._o,t),u=this.o=n.extend({},this._o),h=u.language,r[h]||(h=h.split("-")[0],r[h]||(h=e.language)),u.language=h,u.startView=this._resolveViewName(u.startView),u.minViewMode=this._resolveViewName(u.minViewMode),u.maxViewMode=this._resolveViewName(u.maxViewMode),u.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,u.startView)),u.multidate!==!0&&(u.multidate=Number(u.multidate)||!1,u.multidate!==!1&&(u.multidate=Math.max(0,u.multidate))),u.multidateSeparator=String(u.multidateSeparator),u.weekStart%=7,u.weekEnd=(u.weekStart+6)%7,l=i.parseFormat(u.format),u.startDate!==-(1/0)&&(u.startDate=u.startDate?u.startDate instanceof Date?this._local_to_utc(this._zero_time(u.startDate)):i.parseDate(u.startDate,l,u.language,u.assumeNearbyYear):-(1/0)),u.endDate!==1/0&&(u.endDate=u.endDate?u.endDate instanceof Date?this._local_to_utc(this._zero_time(u.endDate)):i.parseDate(u.endDate,l,u.language,u.assumeNearbyYear):1/0),u.daysOfWeekDisabled=this._resolveDaysOfWeek(u.daysOfWeekDisabled||[]),u.daysOfWeekHighlighted=this._resolveDaysOfWeek(u.daysOfWeekHighlighted||[]),u.datesDisabled=u.datesDisabled||[],n.isArray(u.datesDisabled)||(u.datesDisabled=u.datesDisabled.split(",")),u.datesDisabled=n.map(u.datesDisabled,function(n){return i.parseDate(n,l,u.language,u.assumeNearbyYear)}),o=String(u.orientation).toLowerCase().split(/\s+/g),c=u.orientation.toLowerCase(),o=n.grep(o,function(n){return/^auto|left|right|top|bottom$/.test(n)}),u.orientation={x:"auto",y:"auto"},c&&"auto"!==c)if(1===o.length)switch(o[0]){case"top":case"bottom":u.orientation.y=o[0];break;case"left":case"right":u.orientation.x=o[0]}else c=n.grep(o,function(n){return/^left|right$/.test(n)}),u.orientation.x=c[0]||"auto",c=n.grep(o,function(n){return/^top|bottom$/.test(n)}),u.orientation.y=c[0]||"auto";if(u.defaultViewDate instanceof Date||"string"==typeof u.defaultViewDate)u.defaultViewDate=i.parseDate(u.defaultViewDate,l,u.language,u.assumeNearbyYear);else if(u.defaultViewDate){var a=u.defaultViewDate.year||(new Date).getFullYear(),v=u.defaultViewDate.month||0,y=u.defaultViewDate.day||1;u.defaultViewDate=f(a,v,y)}else u.defaultViewDate=s()},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var f,r,u,i=0;i<n.length;i++)f=n[i][0],2===n[i].length?(r=t,u=n[i][1]):3===n[i].length&&(r=n[i][1],u=n[i][2]),f.on(u,r)},_unapplyEvents:function(n){for(var f,r,u,i=0;i<n.length;i++)f=n[i][0],2===n[i].length?(u=t,r=n[i][1]):3===n[i].length&&(u=n[i][1],r=n[i][2]),f.off(r,u)},_buildEvents:function(){var t={keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this),paste:n.proxy(this.paste,this)};this.o.showOnFocus===!0&&(t.focus=n.proxy(this.show,this));this._events=this.isInput?[[this.element,t]]:this.component&&this.inputField.length?[[this.inputField,t],[this.component,{click:n.proxy(this.show,this)}]]:[[this.element,{click:n.proxy(this.show,this),keydown:n.proxy(this.keydown,this)}]];this._events.push([this.element,"*",{blur:n.proxy(function(n){this._focused_from=n.target},this)}],[this.element,{blur:n.proxy(function(n){this._focused_from=n.target},this)}]);this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":n.proxy(function(n){this.update(n.date)},this)}]);this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[this.picker,".prev, .next",{click:n.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:n.proxy(this.dayCellClick,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{"mousedown touchstart":n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,r){var u=r||this.dates.get(-1),f=this._utc_to_local(u);this.element.trigger({type:t,date:f,viewMode:this.viewMode,dates:n.map(this.dates,this._utc_to_local),format:n.proxy(function(n,t){0===arguments.length?(n=this.dates.length-1,t=this.o.format):"string"==typeof n&&(t=n,n=this.dates.length-1);t=t||this.o.format;var r=this.dates.get(n);return i.formatDate(r,t,this.o.language)},this)})},show:function(){if(!(this.inputField.prop("disabled")||this.inputField.prop("readonly")&&this.o.enableOnReadonly===!1))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&n(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(t){var i;if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.types&&n.inArray("text/plain",t.originalEvent.clipboardData.types)!==-1)i=t.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;i=window.clipboardData.getData("Text")}this.setDate(i);this.update();t.preventDefault()},_utc_to_local:function(n){if(!n)return n;var t=new Date(n.getTime()+6e4*n.getTimezoneOffset());return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(t=new Date(n.getTime()+6e4*t.getTimezoneOffset())),t},_local_to_utc:function(n){return n&&new Date(n.getTime()-6e4*n.getTimezoneOffset())},_zero_time:function(n){return n&&new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return n&&f(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())},getDates:function(){return n.map(this.dates,this._utc_to_local)},getUTCDates:function(){return n.map(this.dates,function(n){return new Date(n)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var n=this.dates.get(-1);return n!==t?new Date(n):null},clearDates:function(){this.inputField.val("");this.update();this._trigger("changeDate");this.o.autoclose&&this.hide()},setDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,t),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,n.map(t,this._utc_to_local)),this},setDate:h("setDates"),setUTCDate:h("setUTCDates"),remove:h("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var n=this.getFormattedDate();return this.inputField.val(n),this},getFormattedDate:function(r){r===t&&(r=this.o.format);var u=this.o.language;return n.map(this.dates,function(n){return i.formatDate(n,r,u)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(n){return this._process_options({startDate:n}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(n){return this._process_options({endDate:n}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(n){return this._process_options({daysOfWeekDisabled:n}),this.update(),this},setDaysOfWeekHighlighted:function(n){return this._process_options({daysOfWeekHighlighted:n}),this.update(),this},setDatesDisabled:function(n){return this._process_options({datesDisabled:n}),this.update(),this},place:function(){var y,r,p;if(this.isInline)return this;var f=this.picker.outerWidth(),s=this.picker.outerHeight(),e=n(this.o.container),h=e.width(),c="body"===this.o.container?n(document).scrollTop():e.scrollTop(),l=e.offset(),a=[0];this.element.parents().each(function(){var t=n(this).css("z-index");"auto"!==t&&0!==Number(t)&&a.push(Number(t))});var v=Math.max.apply(Math,a)+this.o.zIndexOffset,u=this.component?this.component.parent().offset():this.element.offset(),w=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),o=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),t=u.left-l.left,i=u.top-l.top;return"body"!==this.o.container&&(i+=c),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(t-=f-o)):u.left<0?(this.picker.addClass("datepicker-orient-left"),t-=u.left-10):t+f>h?(this.picker.addClass("datepicker-orient-right"),t+=o-f):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left"),r=this.o.orientation.y,("auto"===r&&(y=-c+i-s,r=y<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+r),"top"===r?i-=s+parseInt(this.picker.css("padding-top")):i+=w,this.o.rtl)?(p=h-(t+o),this.picker.css({top:i,right:p,zIndex:v})):this.picker.css({top:i,left:t,zIndex:v}),this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var u=this.dates.copy(),t=[],r=!1;return arguments.length?(n.each(arguments,n.proxy(function(n,i){i instanceof Date&&(i=this._local_to_utc(i));t.push(i)},this)),r=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),t=t&&this.o.multidate?t.split(this.o.multidateSeparator):[t],delete this.element.data().date),t=n.map(t,n.proxy(function(n){return i.parseDate(n,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),t=n.grep(t,n.proxy(function(n){return!this.dateWithinRange(n)||!n},this),!0),this.dates.replace(t),this.o.updateViewDate&&(this.viewDate=this.dates.length?new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?new Date(this.o.startDate):this.viewDate>this.o.endDate?new Date(this.o.endDate):this.o.defaultViewDate),r?(this.setValue(),this.element.change()):this.dates.length&&String(u)!==String(this.dates)&&r&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&u.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var i=this.o.weekStart,t="<tr>";for(this.o.calendarWeeks&&(t+='<th class="cw">&#160;<\/th>');i<this.o.weekStart+7;)t+='<th class="dow',n.inArray(i,this.o.daysOfWeekDisabled)!==-1&&(t+=" disabled"),t+='">'+r[this.o.language].daysMin[i++%7]+"<\/th>";t+="<\/tr>";this.picker.find(".datepicker-days thead").append(t)}},fillMonths:function(){for(var t,i=this._utc_to_local(this.viewDate),u="",n=0;n<12;n++)t=i&&i.getMonth()===n?" focused":"",u+='<span class="month'+t+'">'+r[this.o.language].monthsShort[n]+"<\/span>";this.picker.find(".datepicker-months td").html(u)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),u=this.viewDate.getUTCMonth(),f=s();return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<u?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>u)&&i.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&l(t,f)&&i.push("today"),this.dates.contains(t)!==-1&&i.push("active"),this.dateWithinRange(t)||i.push("disabled"),this.dateIsDisabled(t)&&i.push("disabled","disabled-date"),n.inArray(t.getUTCDay(),this.o.daysOfWeekHighlighted)!==-1&&i.push("highlighted"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!==-1&&i.push("selected"),t.valueOf()===this.range[0]&&i.push("range-start"),t.valueOf()===this.range[this.range.length-1]&&i.push("range-end")),i},_fill_yearsView:function(i,r,u,f,e,o,s){for(var c,v,h,w="",l=u/10,b=this.picker.find(i),y=Math.floor(f/u)*u,p=y+9*l,k=Math.floor(this.viewDate.getFullYear()/l)*l,d=n.map(this.dates,function(n){return Math.floor(n.getUTCFullYear()/l)*l}),a=y-l;a<=p+l;a+=l)c=[r],v=null,a===y-l?c.push("old"):a===p+l&&c.push("new"),n.inArray(a,d)!==-1&&c.push("active"),(a<e||a>o)&&c.push("disabled"),a===k&&c.push("focused"),s!==n.noop&&(h=s(new Date(a,0,1)),h===t?h={}:"boolean"==typeof h?h={enabled:h}:"string"==typeof h&&(h={classes:h}),h.enabled===!1&&c.push("disabled"),h.classes&&(c=c.concat(h.classes.split(/\s+/))),h.tooltip&&(v=h.tooltip)),w+='<span class="'+c.join(" ")+'"'+(v?' title="'+v+'"':"")+">"+a+"<\/span>";b.find(".datepicker-switch").text(y+"-"+p);b.find("td").html(w)},fill:function(){var y,u,w=new Date(this.viewDate),o=w.getUTCFullYear(),d=w.getUTCMonth(),a=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),ut=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),v=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,ft=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,et=r[this.o.language].today||r.en.today||"",ot=r[this.o.language].clear||r.en.clear||"",st=r[this.o.language].titleFormat||r.en.titleFormat,e,g,h,p,s,c,k,it,l,rt;if(!isNaN(o)&&!isNaN(d)){for(this.picker.find(".datepicker-days .datepicker-switch").text(i.formatDate(w,st,this.o.language)),this.picker.find("tfoot .today").text(et).css("display",this.o.todayBtn===!0||"linked"===this.o.todayBtn?"table-cell":"none"),this.picker.find("tfoot .clear").text(ot).css("display",this.o.clearBtn===!0?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths(),e=f(o,d,0),g=e.getUTCDate(),e.setUTCDate(g-(e.getUTCDay()-this.o.weekStart+7)%7),h=new Date(e),e.getUTCFullYear()<100&&h.setUTCFullYear(e.getUTCFullYear()),h.setUTCDate(h.getUTCDate()+42),h=h.valueOf(),c=[];e.valueOf()<h;){if(p=e.getUTCDay(),p===this.o.weekStart&&(c.push("<tr>"),this.o.calendarWeeks)){var nt=new Date(+e+(this.o.weekStart-p-7)%7*864e5),tt=new Date(Number(nt)+(11-nt.getUTCDay())%7*864e5),b=new Date(Number(b=f(tt.getUTCFullYear(),0,1))+(11-b.getUTCDay())%7*864e5),ht=(tt-b)/6048e5+1;c.push('<td class="cw">'+ht+"<\/td>")}s=this.getClassNames(e);s.push("day");k=e.getUTCDate();this.o.beforeShowDay!==n.noop&&(u=this.o.beforeShowDay(this._utc_to_local(e)),u===t?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u}),u.enabled===!1&&s.push("disabled"),u.classes&&(s=s.concat(u.classes.split(/\s+/))),u.tooltip&&(y=u.tooltip),u.content&&(k=u.content));s=n.isFunction(n.uniqueSort)?n.uniqueSort(s):n.unique(s);c.push('<td class="'+s.join(" ")+'"'+(y?' title="'+y+'"':"")+' data-date="'+e.getTime().toString()+'">'+k+"<\/td>");y=null;p===this.o.weekEnd&&c.push("<\/tr>");e.setUTCDate(e.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(c.join(""));it=r[this.o.language].monthsTitle||r.en.monthsTitle||"Months";l=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?it:o).end().find("tbody span").removeClass("active");(n.each(this.dates,function(n,t){t.getUTCFullYear()===o&&l.eq(t.getUTCMonth()).addClass("active")}),(o<a||o>v)&&l.addClass("disabled"),o===a&&l.slice(0,ut).addClass("disabled"),o===v&&l.slice(ft+1).addClass("disabled"),this.o.beforeShowMonth!==n.noop)&&(rt=this,n.each(l,function(i,r){var f=new Date(o,i,1),u=rt.o.beforeShowMonth(f);u===t?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u});u.enabled!==!1||n(r).hasClass("disabled")||n(r).addClass("disabled");u.classes&&n(r).addClass(u.classes);u.tooltip&&n(r).prop("title",u.tooltip)}));this._fill_yearsView(".datepicker-years","year",10,o,a,v,this.o.beforeShowYear);this._fill_yearsView(".datepicker-decades","decade",100,o,a,v,this.o.beforeShowDecade);this._fill_yearsView(".datepicker-centuries","century",1e3,o,a,v,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var i,r,u=new Date(this.viewDate),t=u.getUTCFullYear(),f=u.getUTCMonth(),e=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),s=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),o=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,n=1;switch(this.viewMode){case 4:n*=10;case 3:n*=10;case 2:n*=10;case 1:i=Math.floor(t/n)*n<e;r=Math.floor(t/n)*n+n>o;break;case 0:i=t<=e&&f<s;r=t>=o&&f>h}this.picker.find(".prev").toggleClass("disabled",i);this.picker.find(".next").toggleClass("disabled",r)}},click:function(t){t.preventDefault();t.stopPropagation();var r,o,u,e;r=n(t.target);r.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1);r.hasClass("today")&&!r.hasClass("day")&&(this.setViewMode(0),this._setDate(s(),"linked"===this.o.todayBtn?null:"view"));r.hasClass("clear")&&this.clearDates();r.hasClass("disabled")||(r.hasClass("month")||r.hasClass("year")||r.hasClass("decade")||r.hasClass("century"))&&(this.viewDate.setUTCDate(1),o=1,1===this.viewMode?(e=r.parent().find("span").index(r),u=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(e)):(e=0,u=Number(r.text()),this.viewDate.setUTCFullYear(u)),this._trigger(i.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(f(u,e,o)):(this.setViewMode(this.viewMode-1),this.fill()));this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus();delete this._focused_from},dayCellClick:function(t){var r=n(t.currentTarget),u=r.data("date"),i=new Date(u);this.o.updateViewDate&&(i.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),i.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate));this._setDate(i)},navArrowsClick:function(t){var u=n(t.currentTarget),r=u.hasClass("prev")?-1:1;0!==this.viewMode&&(r*=12*i.viewModes[this.viewMode].navStep);this.viewDate=this.moveMonth(this.viewDate,r);this._trigger(i.viewModes[this.viewMode].e,this.viewDate);this.fill()},_toggle_multidate:function(n){var t=this.dates.contains(n);if(n||this.dates.clear(),t!==-1?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(t):this.o.multidate===!1?(this.dates.clear(),this.dates.push(n)):this.dates.push(n),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(n,t){t&&"date"!==t||this._toggle_multidate(n&&new Date(n));(!t&&this.o.updateViewDate||"view"===t)&&(this.viewDate=n&&new Date(n));this.fill();this.setValue();t&&"view"===t||this._trigger("changeDate");this.inputField.trigger("change");!this.o.autoclose||t&&"date"!==t||this.hide()},moveDay:function(n,t){var i=new Date(n);return i.setUTCDate(n.getUTCDate()+t),i},moveWeek:function(n,t){return this.moveDay(n,7*t)},moveMonth:function(n,t){var f;if(!p(n))return this.o.defaultViewDate;if(!t)return n;var r,u,i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t);if(t=t>0?1:-1,1===s)u=t===-1?function(){return i.getUTCMonth()===o}:function(){return i.getUTCMonth()!==r},r=o+t,i.setUTCMonth(r),r=(r+12)%12;else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!==i.getUTCMonth()}}for(;u();)i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,12*t)},moveAvailableDate:function(n,t,i){do{if(n=this[i](n,t),!this.dateWithinRange(n))return!1;i="moveDay"}while(this.dateIsDisabled(n));return n},weekOfDateIsDisabled:function(t){return n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1},dateIsDisabled:function(t){return this.weekOfDateIsDisabled(t)||n.grep(this.o.datesDisabled,function(n){return l(t,n)}).length>0},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){if(!this.picker.is(":visible"))return void(40!==n.keyCode&&27!==n.keyCode||(this.show(),n.stopPropagation()));var i,t,u=!1,r=this.focusDate||this.viewDate;switch(n.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide();n.preventDefault();n.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;i=37===n.keyCode||38===n.keyCode?-1:1;0===this.viewMode?n.ctrlKey?(t=this.moveAvailableDate(r,i,"moveYear"),t&&this._trigger("changeYear",this.viewDate)):n.shiftKey?(t=this.moveAvailableDate(r,i,"moveMonth"),t&&this._trigger("changeMonth",this.viewDate)):37===n.keyCode||39===n.keyCode?t=this.moveAvailableDate(r,i,"moveDay"):this.weekOfDateIsDisabled(r)||(t=this.moveAvailableDate(r,i,"moveWeek")):1===this.viewMode?(38!==n.keyCode&&40!==n.keyCode||(i*=4),t=this.moveAvailableDate(r,i,"moveMonth")):2===this.viewMode&&(38!==n.keyCode&&40!==n.keyCode||(i*=4),t=this.moveAvailableDate(r,i,"moveYear"));t&&(this.focusDate=this.viewDate=t,this.setValue(),this.fill(),n.preventDefault());break;case 13:if(!this.o.forceParse)break;r=this.focusDate||this.dates.get(-1)||this.viewDate;this.o.keyboardNavigation&&(this._toggle_multidate(r),u=!0);this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();this.picker.is(":visible")&&(n.preventDefault(),n.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide()}u&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(n){this.viewMode=n;this.picker.children("div").hide().filter(".datepicker-"+i.viewModes[this.viewMode].clsName).show();this.updateNavArrows();this._trigger("changeViewMode",new Date(this.viewDate))}};c=function(t,i){n.data(t,"datepicker",this);this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;this.keepEmptyValues=i.keepEmptyValues;delete i.keepEmptyValues;o.call(n(this.inputs),i).on("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n.data(t,"datepicker")});this.updateDates()};c.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.getUTCDate()});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},clearDates:function(){n.each(this.pickers,function(n,t){t.clearDates()})},dateUpdated:function(i){var u;if(!this.updating&&(this.updating=!0,u=n.data(i.target,"datepicker"),u!==t)){var r=u.getUTCDate(),s=this.keepEmptyValues,o=n.inArray(i.target,this.inputs),f=o-1,e=o+1,h=this.inputs.length;if(o!==-1){if(n.each(this.pickers,function(n,t){t.getUTCDate()||t!==u&&s||t.setUTCDate(r)}),r<this.dates[f])for(;f>=0&&r<this.dates[f];)this.pickers[f--].setUTCDate(r);else if(r>this.dates[e])for(;e<h&&r>this.dates[e];)this.pickers[e++].setUTCDate(r);this.updateDates();delete this.updating}}},destroy:function(){n.map(this.pickers,function(n){n.destroy()});n(this.inputs).off("changeDate",this.dateUpdated);delete this.element.data().datepicker},remove:h("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};v=n.fn.datepicker;o=function(i){var f=Array.apply(null,arguments),r;if(f.shift(),this.each(function(){var s=n(this),t=s.data("datepicker"),h="object"==typeof i&&i;if(!t){var l=w(this,"date"),a=n.extend({},e,l,h),v=b(a.language),o=n.extend({},e,v,l,h);s.hasClass("input-daterange")||o.inputs?(n.extend(o,{inputs:o.inputs||s.find("input").toArray()}),t=new c(this,o)):t=new u(this,o);s.data("datepicker",t)}"string"==typeof i&&"function"==typeof t[i]&&(r=t[i].apply(t,f))}),r===t||r instanceof u||r instanceof c)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+i+" function)");return r};n.fn.datepicker=o;e=n.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:n.noop,beforeShowMonth:n.noop,beforeShowYear:n.noop,beforeShowDecade:n.noop,beforeShowCentury:n.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0};y=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=u;r=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}};i={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(n){if("function"==typeof n.toValue&&"function"==typeof n.toDisplay)return n;var t=n.replace(this.validParts,"\0").split("\0"),i=n.match(this.validParts);if(!t||!t.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(f,e,o,h){function et(n,t){return t===!0&&(t=10),n<100&&(n+=2e3,n>(new Date).getFullYear()+t&&(n-=100)),n}function tt(){var n=this.slice(0,l[c].length),t=l[c].slice(0,n.length);return n.toLowerCase()===t.toLowerCase()}var l,y,it,c,rt,ut,g,v,ft,d,w;if(!f)return t;if(f instanceof Date)return f;if("string"==typeof e&&(e=i.parseFormat(e)),e.toValue)return e.toValue(f,e,o);if(ut={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},g={yesterday:"-1d",today:"+0d",tomorrow:"+1d"},f in g&&(f=g[f]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(f)){for(l=f.match(/([\-+]\d+)([dmwy])/gi),f=new Date,c=0;c<l.length;c++)y=l[c].match(/([\-+]\d+)([dmwy])/i),it=Number(y[1]),rt=ut[y[2].toLowerCase()],f=u.prototype[rt](f,it);return u.prototype._zero_utc_time(f)}l=f&&f.match(this.nonpunctuation)||[];var p,b,k={},nt=["yyyy","yy","M","MM","m","mm","d","dd"],a={yyyy:function(n,t){return n.setUTCFullYear(h?et(t,h):t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!==t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}};if(a.yy=a.yyyy,a.M=a.MM=a.mm=a.m,a.dd=a.d,f=s(),v=e.parts.slice(),l.length!==v.length&&(v=n(v).filter(function(t,i){return n.inArray(i,nt)!==-1}).toArray()),l.length===v.length){for(c=0,ft=v.length;c<ft;c++){if(p=parseInt(l[c],10),y=v[c],isNaN(p))switch(y){case"MM":b=n(r[o].months).filter(tt);p=n.inArray(b[0],r[o].months)+1;break;case"M":b=n(r[o].monthsShort).filter(tt);p=n.inArray(b[0],r[o].monthsShort)+1}k[y]=p}for(c=0;c<nt.length;c++)w=nt[c],w in k&&!isNaN(k[w])&&(d=new Date(f),a[w](d,k[w]),isNaN(d)||(f=d))}return f},formatDate:function(t,u,f){var e;if(!t)return"";if("string"==typeof u&&(u=i.parseFormat(u)),u.toDisplay)return u.toDisplay(t,u,f);e={d:t.getUTCDate(),D:r[f].daysShort[t.getUTCDay()],DD:r[f].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:r[f].monthsShort[t.getUTCMonth()],MM:r[f].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d;e.mm=(e.m<10?"0":"")+e.m;t=[];for(var s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&t.push(s.shift()),t.push(e[u.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"><\/th><\/tr><tr><th class="prev">'+e.templates.leftArrow+'<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">'+e.templates.rightArrow+"<\/th><\/tr><\/thead>",contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};i.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+i.headTemplate+"<tbody><\/tbody>"+i.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-decades"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-centuries"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=v,this};n.fn.datepicker.version="1.8.0";n.fn.datepicker.deprecated=function(n){var t=window.console;t&&t.warn&&t.warn("DEPRECATED: "+n)};n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),o.call(i,"show"))});n(function(){o.call(n('[data-provide="datepicker-inline"]'))})});!function(n){n.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery),function(n){typeof define=="function"&&define.amd?define(["./dependencyLibs/inputmask.dependencyLib","./global/window"],n):typeof exports=="object"?module.exports=n(require("./dependencyLibs/inputmask.dependencyLib"),require("./global/window")):window.Inputmask=n(window.dependencyLib||jQuery,window)}(function(n,t,i){function r(t,u,f){if(!(this instanceof r))return new r(t,u,f);this.el=i;this.events={};this.maskset=i;this.refreshValue=!1;f!==!0&&(n.isPlainObject(t)?u=t:(u=u||{},t&&(u.alias=t)),this.opts=n.extend(!0,{},this.defaults,u),this.noMasksCache=u&&u.definitions!==i,this.userOptions=u||{},this.isRTL=this.opts.numericInput,c(this.opts.alias,u,this.opts))}function c(t,u,f){var e=r.prototype.aliases[t];return e?(e.alias&&c(e.alias,i,f),n.extend(!0,f,e),n.extend(!0,f,u),!0):(f.mask===null&&(f.mask=t),!1)}function e(t,u){function o(t,f,e){var o=!1,c,s,h;return(t===null||t==="")&&(o=e.regex!==null,o?(t=e.regex,t=t.replace(/^(\^)(.*)(\$)$/,"$2")):(o=!0,t=".*")),t.length===1&&e.greedy===!1&&e.repeat!==0&&(e.placeholder=""),(e.repeat>0||e.repeat==="*"||e.repeat==="+")&&(c=e.repeat==="*"?0:e.repeat==="+"?1:e.repeat,t=e.groupmarker[0]+t+e.groupmarker[1]+e.quantifiermarker[0]+c+","+e.repeat+e.quantifiermarker[1]),h=o?"regex_"+e.regex:e.numericInput?t.split("").reverse().join(""):t,r.prototype.masksCache[h]===i||u===!0?(s={mask:t,maskToken:r.prototype.analyseMask(t,o,e),validPositions:{},_buffer:i,buffer:i,tests:{},excludes:{},metadata:f,maskLength:i},u!==!0&&(r.prototype.masksCache[h]=s,s=n.extend(!0,{},r.prototype.masksCache[h]))):s=n.extend(!0,{},r.prototype.masksCache[h]),s}var e,f;if(n.isFunction(t.mask)&&(t.mask=t.mask(t)),n.isArray(t.mask)){if(t.mask.length>1){if(t.keepStatic===null)for(t.keepStatic="auto",e=0;e<t.mask.length;e++)if(t.mask[e].charAt(0)!==t.mask[0].charAt(0)){t.keepStatic=!0;break}return f=t.groupmarker[0],n.each(t.isRTL?t.mask.reverse():t.mask,function(r,u){f.length>1&&(f+=t.groupmarker[1]+t.alternatormarker+t.groupmarker[0]);f+=u.mask===i||n.isFunction(u.mask)?u:u.mask}),f+=t.groupmarker[1],o(f,t.mask,t)}t.mask=t.mask.pop()}return t.mask&&t.mask.mask!==i&&!n.isFunction(t.mask.mask)?o(t.mask.mask,t.mask,t):o(t.mask,t.mask,t)}function a(n){var t=u.createElement("input"),i="on"+n,r=i in t;return r||(t.setAttribute(i,"return;"),r=typeof t[i]=="function"),t=null,r}function f(e,o,c){function bt(n,t,r,u,f){var v=c.greedy,l;f&&(c.greedy=!1);t=t||0;var h=[],a,e=0,o,s,p=b();do n===!0&&y().validPositions[e]?(s=f&&y().validPositions[e].match.optionality===!0&&y().validPositions[e+1]===i&&(y().validPositions[e].generatedInput===!0||y().validPositions[e].input==c.skipOptionalPartCharacter&&e>0)?ui(e,ct(e,a,e-1)):y().validPositions[e],o=s.match,a=s.locator.slice(),h.push(r===!0?s.input:r===!1?o.nativeDef:ht(e,o))):(s=kt(e,a,e-1),o=s.match,a=s.locator.slice(),l=u===!0?!1:c.jitMasking!==!1?c.jitMasking:o.jit,(l===!1||l===i||typeof l=="number"&&isFinite(l)&&l>e)&&h.push(r===!1?o.nativeDef:ht(e,o))),c.keepStatic==="auto"&&o.newBlockMarker&&o.fn!==null&&(c.keepStatic=e-1),e++;while((at===i||e<at)&&(o.fn!==null||o.def!=="")||t>e);return h[h.length-1]===""&&h.pop(),(r!==!1||y().maskLength===i)&&(y().maskLength=e-1),c.greedy=v,h}function y(){return o}function ot(n){var t=y();t.buffer=i;n!==!0&&(t.validPositions={},t.p=0)}function b(n,t,r){var f=-1,e=-1,o=r||y().validPositions,s,u;n===i&&(n=-1);for(s in o)u=parseInt(s),o[u]&&(t||o[u].generatedInput!==!0)&&(u<=n&&(f=u),u>=n&&(e=u));return f===-1||f==n?e:e==-1?f:n-f<e-n?f:e}function li(n){var t=n.locator[n.alternation];return typeof t=="string"&&t.length>0&&(t=t.split(",")[0]),t!==i?t.toString():""}function wi(n,t){var r=(n.alternation!=i?n.mloc[li(n)]:n.locator).join("");if(r!=="")while(r.length<t)r+="0";return r}function ui(n,t){var c,e,o,s,r,f,u,h;for(n=n>0?n-1:0,c=it(n),e=wi(c),f=0;f<t.length;f++)u=t[f],o=wi(u,e.length),h=Math.abs(o-e),(s===i||o!==""&&h<s||r&&r.match.optionality&&r.match.newBlockMarker==="master"&&(!u.match.optionality||!u.match.newBlockMarker)||r&&r.match.optionalQuantifier&&!u.match.optionalQuantifier)&&(s=h,r=u);return r}function kt(n,t,i){return y().validPositions[n]||ui(n,ct(n,t?t.slice():t,i))}function it(n,t){return y().validPositions[n]?y().validPositions[n]:(t||ct(n))[0]}function rr(n,t){for(var u=!1,r=ct(n),i=0;i<r.length;i++)if(r[i].match&&r[i].match.def===t){u=!0;break}return u}function ct(t,r,u){function p(r,u,s,h){function w(s,h,l){function st(t,i){var r=n.inArray(t,i.matches)===0;return r||n.each(i.matches,function(n,u){return u.isQuantifier===!0?r=st(t,i.matches[n-1]):u.hasOwnProperty("matches")&&(r=st(t,u)),r?!1:void 0}),r}function wt(t,r,u){var f,e,o,s;return(y().tests[t]||y().validPositions[t])&&n.each(y().tests[t]||[y().validPositions[t]],function(n,t){if(t.mloc[r])return f=t,!1;var s=u!==i?u:t.alternation,o=t.locator[s]!==i?t.locator[s].toString().indexOf(r):-1;(e===i||o<e)&&o!==-1&&(f=t,e=o)}),f?(o=f.locator[f.alternation],s=f.mloc[r]||f.mloc[o]||f.locator,s.slice((u!==i?u:f.alternation)+1)):u!==i?wt(t,r):i}function bt(n,t){function i(n){for(var i=[],r,u,t=0,f=n.length;t<f;t++)if(n.charAt(t)==="-")for(u=n.charCodeAt(t+1);++r<u;)i.push(String.fromCharCode(r));else r=n.charCodeAt(t),i.push(n.charAt(t));return i.join("")}return c.regex&&n.match.fn!==null&&t.match.fn!==null?i(t.match.def.replace(/[\[\]]/g,"")).indexOf(i(n.match.def.replace(/[\[\]]/g,"")))!==-1:n.match.def===t.match.nativeDef}function ii(n,i){var r=n.locator.slice(n.alternation).join(""),u=i.locator.slice(i.alternation).join(""),f=r==u;return f&&n.match.fn===null&&i.match.fn!==null?i.match.fn.test(n.match.def,y(),t,!1,c,!1):!1}function ft(n,t){var r,u;if(t===i||n.alternation===t.alternation&&n.locator[n.alternation].toString().indexOf(t.locator[t.alternation])===-1)if(n.mloc=n.mloc||{},r=n.locator[n.alternation],r===i)n.alternation=i;else{if(typeof r=="string"&&(r=r.split(",")[0]),n.mloc[r]===i&&(n.mloc[r]=n.locator.slice()),t!==i){for(u in t.mloc)typeof u=="string"&&(u=u.split(",")[0]),n.mloc[u]===i&&(n.mloc[u]=t.mloc[u]);n.locator[n.alternation]=Object.keys(n.mloc).join(",")}return!0}return!1}var kt,ni,ct,ti,pt,et,lt,b,ot,at,d,rt,it,ut;if(e>500&&l!==i)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. "+y().mask;if(e===t&&s.matches===i)return f.push({match:s,locator:h.reverse(),cd:v,mloc:{}}),!0;if(s.matches!==i){if(s.isGroup&&l!==s){if(s=w(r.matches[n.inArray(s,r.matches)+1],h,l),s)return!0}else if(s.isOptional){if(kt=s,s=p(s,u,h,l),s)if(n.each(f,function(n,t){t.match.optionality=!0}),o=f[f.length-1].match,l===i&&st(o,kt))a=!0,e=t;else return!0}else if(s.isAlternator){var ht=s,g=[],vt,ri=f.slice(),dt=h.length,nt=u.length>0?u.shift():-1;if(nt===-1||typeof nt=="string"){var gt=e,yt=u.slice(),k=[],tt;if(typeof nt=="string")k=nt.split(",");else for(tt=0;tt<ht.matches.length;tt++)k.push(tt.toString());if(y().excludes[t]){for(ni=k.slice(),ct=0,ti=y().excludes[t].length;ct<ti;ct++)k.splice(k.indexOf(y().excludes[t][ct].toString()),1);k.length===0&&(y().excludes[t]=i,k=ni)}for((c.keepStatic===!0||isFinite(parseInt(c.keepStatic))&&gt>=c.keepStatic)&&(k=k.slice(0,1)),pt=!1,et=0;et<k.length;et++)for(tt=parseInt(k[et]),f=[],u=typeof nt=="string"?wt(e,tt,dt)||yt.slice():yt.slice(),ht.matches[tt]&&w(ht.matches[tt],[tt].concat(h),l)?s=!0:et===0&&(pt=!0),vt=f.slice(),e=gt,f=[],lt=0;lt<vt.length;lt++){for(b=vt[lt],ot=!1,b.match.jit=b.match.jit||pt,b.alternation=b.alternation||dt,ft(b),at=0;at<g.length;at++)if(d=g[at],typeof nt!="string"||b.alternation!==i&&n.inArray(b.locator[b.alternation].toString(),k)!==-1)if(b.match.nativeDef===d.match.nativeDef){ot=!0;ft(d,b);break}else if(bt(b,d)){ft(b,d)&&(ot=!0,g.splice(g.indexOf(d),0,b));break}else if(bt(d,b)){ft(d,b);break}else if(ii(b,d)){ft(b,d)&&(ot=!0,g.splice(g.indexOf(d),0,b));break}ot||g.push(b)}f=ri.concat(g);e=t;a=f.length>0;s=g.length>0;u=yt.slice()}else s=w(ht.matches[nt]||r.matches[nt],[nt].concat(h),l);if(s)return!0}else if(s.isQuantifier&&l!==r.matches[n.inArray(s,r.matches)-1]){for(rt=s,it=u.length>0?u.shift():0;it<(isNaN(rt.quantifier.max)?it+1:rt.quantifier.max)&&e<=t;it++)if(ut=r.matches[n.inArray(rt,r.matches)-1],s=w(ut,[it].concat(h),ut),s){if(o=f[f.length-1].match,o.optionalQuantifier=it>rt.quantifier.min-1,o.jit=(it||1)*ut.matches.indexOf(o)>=rt.quantifier.jit,o.optionalQuantifier&&st(o,ut)){a=!0;e=t;break}return o.jit&&!o.optionalQuantifier&&(o.jitOffset=ut.matches.indexOf(o)),!0}}else if(s=p(s,u,h,l),s)return!0}else e++}for(var b,l=u.length>0?u.shift():0;l<r.matches.length;l++)if(r.matches[l].isQuantifier!==!0){if(b=w(r.matches[l],[l].concat(s),h),b&&e===t)return b;if(e>t)break}}function d(t,r){var u=[];return n.isArray(r)||(r=[r]),r.length>0&&(r[0].alternation===i?(u=ui(t,r.slice()).locator.slice(),u.length===0&&(u=r[0].locator.slice())):n.each(r,function(n,t){if(t.def!=="")if(u.length===0)u=t.locator.slice();else for(var i=0;i<u.length;i++)t.locator[i]&&u[i].toString().indexOf(t.locator[i])===-1&&(u[i]+=","+t.locator[i])})),u}var b=y().maskToken,e=r?u:0,l=r?r.slice():[0],f=[],a=!1,o,v=r?r.join(""):"",s,w,h,k;if(t>-1){if(r===i){for(s=t-1;(w=y().validPositions[s]||y().tests[s])===i&&s>-1;)s--;w!==i&&s>-1&&(l=d(s,w),v=l.join(""),e=s)}if(y().tests[t]&&y().tests[t][0].cd===v)return y().tests[t];for(h=l.shift();h<b.length;h++)if(k=p(b[h],l,[h]),k&&e===t||e>t)break}return((f.length===0||a)&&f.push({match:{fn:null,optionality:!1,casing:null,def:"",placeholder:""},locator:[],mloc:{},cd:v}),r!==i&&y().tests[t])?n.extend(!0,[],f):(y().tests[t]=n.extend(!0,[],f),y().tests[t])}function ut(){return y()._buffer===i&&(y()._buffer=bt(!1,1),y().buffer===i&&(y().buffer=y()._buffer.slice())),y()._buffer}function w(n){return(y().buffer===i||n===!0)&&(y().buffer=bt(!0,b(),!0),y()._buffer===i&&(y()._buffer=y().buffer.slice())),y().buffer}function bi(n,t,r){var u,e,f;if(n===!0)ot(),n=0,t=r.length;else for(u=n;u<t;u++)delete y().validPositions[u];for(e=n,u=n;u<t;u++)ot(!0),r[u]!==c.skipOptionalPartCharacter&&(f=yt(e,r[u],!0,!0),f!==!1&&(ot(!0),e=f.caret!==i?f.caret:f.pos+1))}function ur(t,i,u){var f,e;switch(c.casing||i.casing){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break;case"title":f=y().validPositions[u-1];t=u===0||f&&f.input===String.fromCharCode(r.keyCode.SPACE)?t.toUpperCase():t.toLowerCase();break;default:n.isFunction(c.casing)&&(e=Array.prototype.slice.call(arguments),e.push(y().validPositions),t=c.casing.apply(this,e))}return t}function fr(t,r,u){for(var f,l=c.greedy?r:r.slice(0,1),o=!1,s=u!==i?u.split(","):[],h,e=0;e<s.length;e++)(h=t.indexOf(s[e]))!==-1&&t.splice(h,1);for(f=0;f<t.length;f++)if(n.inArray(t[f],l)!==-1){o=!0;break}return o}function fi(t,r,u,f,e){var ft=n.extend(!0,{},y().validPositions),v,k,h=!1,l,c,s,a,o,p=e!==i?e:b(),d,g,w,nt,ut,tt,rt;if(p===-1&&e===i)v=0,c=it(v),k=c.alternation;else for(;p>=0;p--)if(l=y().validPositions[p],l&&l.alternation!==i){if(c&&c.locator[l.alternation]!==l.locator[l.alternation])break;v=p;k=y().validPositions[v].alternation;c=l}if(k!==i){for(o=parseInt(v),y().excludes[o]=y().excludes[o]||[],t!==!0&&y().excludes[o].push(li(c)),d=[],g=0,s=o;s<b(i,!0)+1;s++)a=y().validPositions[s],a&&a.generatedInput!==!0?d.push(a.input):s<t&&g++,delete y().validPositions[s];while(y().excludes[o]&&y().excludes[o].length<10){for(w=g*-1,nt=d.slice(),y().tests[o]=i,ot(!0),h=!0;nt.length>0;)if(ut=nt.shift(),!(h=yt(b(i,!0)+1,ut,!1,f,!0)))break;if(h&&r!==i){for(tt=b(t)+1,s=o;s<b()+1;s++)a=y().validPositions[s],(a===i||a.match.fn==null)&&s<t+w&&w++;t=t+w;h=yt(t>tt?tt:t,r,u,f,!0)}if(h)break;else if(ot(),c=it(o),y().validPositions=n.extend(!0,{},ft),y().excludes[o]){if(rt=li(c),y().excludes[o].indexOf(rt)!==-1){h=fi(t,r,u,f,o-1);break}for(y().excludes[o].push(rt),s=o;s<b(i,!0)+1;s++)delete y().validPositions[s]}else{h=fi(t,r,u,f,o-1);break}}}return y().excludes[o]=i,h}function yt(t,r,u,f,e,o){function b(n){return g?n.begin-n.end>1||n.begin-n.end==1:n.end-n.begin>1||n.end-n.begin==1}function k(r,u,e){var o=!1;return n.each(ct(r),function(s,h){var l=h.match,a,v;return w(!0),o=l.fn!=null?l.fn.test(u,y(),r,e,c,b(t)):(u===l.def||u===c.skipOptionalPartCharacter)&&l.def!==""?{c:ht(r,l,!0)||l.def,pos:r}:!1,o!==!1?(a=o.c!==i?o.c:u,v=r,a=a===c.skipOptionalPartCharacter&&l.fn===null?ht(r,l,!0)||l.def:a,o.remove!==i&&(n.isArray(o.remove)||(o.remove=[o.remove]),n.each(o.remove.sort(function(n,t){return t-n}),function(n,t){ei({begin:t,end:t+1})})),o.insert!==i&&(n.isArray(o.insert)||(o.insert=[o.insert]),n.each(o.insert.sort(function(n,t){return n-t}),function(n,t){yt(t.pos,t.c,!0,f)})),o!==!0&&o.pos!==i&&o.pos!==r&&(v=o.pos),o!==!0&&o.pos===i&&o.c===i)?!1:(ei(t,n.extend({},h,{input:ur(a,l,v)}),f,v)||(o=!1),!1):void 0}),o}var h,s,nt,p,a,tt,l,v;if(u=u===!0,h=t,t.begin!==i&&(h=g?t.end:t.begin),s=!0,nt=n.extend(!0,{},y().validPositions),n.isFunction(c.preValidation)&&!u&&f!==!0&&o!==!0&&(s=c.preValidation(w(),h,r,b(t),c,y())),s===!0){if(ai(i,h,!0),(at===i||h<at)&&(s=k(h,r,u),(!u||f===!0)&&s===!1&&o!==!0))if(p=y().validPositions[h],p&&p.match.fn===null&&(p.match.def===r||r===c.skipOptionalPartCharacter))s={caret:d(h)};else if((c.insertMode||y().validPositions[d(h)]===i)&&!ft(h,!0))for(a=h+1,tt=d(h);a<=tt;a++)if(s=k(a,r,u),s!==!1){s=ai(h,s.pos!==i?s.pos:a)||s;h=a;break}s===!1&&c.keepStatic!==!1&&(c.regex==null||wt(w()))&&!u&&e!==!0&&(s=fi(h,r,u,f));s===!0&&(s={pos:h})}return n.isFunction(c.postValidation)&&s!==!1&&!u&&f!==!0&&o!==!0&&(l=c.postValidation(w(!0),t.begin!==i?g?t.end:t.begin:t,s,c),l!==i&&(l.refreshFromBuffer&&l.buffer&&(v=l.refreshFromBuffer,bi(v===!0?v:v.start,v.end,l.buffer)),s=l===!0?s:l)),s&&s.pos===i&&(s.pos=h),(s===!1||o===!0)&&(ot(!0),y().validPositions=n.extend(!0,{},nt)),s}function ai(t,r,u){var s,f,h,o,e,c;if(t===i)for(t=r-1;t>0;t--)if(y().validPositions[t])break;for(f=t;f<r;f++)y().validPositions[f]!==i||ft(f,!0)||(h=f==0?it(f):y().validPositions[f-1],h&&(o=ct(f).slice(),o[o.length-1].match.def===""&&o.pop(),e=ui(f,o),e=n.extend({},e,{input:ht(f,e.match,!0)||e.match.def}),e.generatedInput=!0,ei(f,e,!0),u!==!0&&(c=y().validPositions[r].input,y().validPositions[r]=i,s=yt(r,c,!0,!0))));return s}function ei(t,r,u,f){function g(n,t,r){var u=t[n],f,e;return u!==i&&(u.match.fn===null&&u.match.optionality!==!0||u.input===c.radixPoint)?(f=r.begin<=n-1?t[n-1]&&t[n-1].match.fn===null&&t[n-1]:t[n-1],e=r.end>n+1?t[n+1]&&t[n+1].match.fn===null&&t[n+1]:t[n+1],f&&e):!1}var h=t.begin!==i?t.begin:t,v=t.end!==i?t.end:t,a,k,o,s,w;if(t.begin>t.end&&(h=t.end,v=t.begin),f=f!==i?f:h,h!==v||c.insertMode&&y().validPositions[f]!==i&&u===i){for(a=n.extend(!0,{},y().validPositions),k=b(i,!0),y().p=h,o=k;o>=h;o--)y().validPositions[o]&&y().validPositions[o].match.nativeDef==="+"&&(c.isNegative=!1),delete y().validPositions[o];var l=!0,p=f,nt=y().validPositions,d=!1,e=p,o=p;for(r&&(y().validPositions[f]=n.extend(!0,{},r),e++,p++,h<v&&o++);o<=k;o++){if(s=a[o],s!==i&&(o>=v||o>=h&&s.generatedInput!==!0&&g(o,a,{begin:h,end:v}))){while(it(e).match.def!==""){if(d===!1&&a[e]&&a[e].match.nativeDef===s.match.nativeDef?(y().validPositions[e]=n.extend(!0,{},a[e]),y().validPositions[e].input=s.input,ai(i,e,!0),p=e+1,l=!0):c.shiftPositions&&rr(e,s.match.def)?(w=yt(e,s.input,!0,!0),l=w!==!1,p=w.caret||w.insert?b():e+1,d=!0):l=s.generatedInput===!0||s.input===c.radixPoint&&c.numericInput===!0,l)break;if(!l&&e>v&&ft(e,!0)&&(s.match.fn!==null||e>y().maskLength))break;e++}it(e).match.def==""&&(l=!1);e=p}if(!l)break}if(!l)return y().validPositions=n.extend(!0,{},a),ot(!0),!1}else r&&(y().validPositions[f]=n.extend(!0,{},r));return ot(!0),!0}function ft(n,t){var i=kt(n).match,r;return(i.def===""&&(i=it(n).match),i.fn!=null)?i.fn:t!==!0&&n>-1?(r=ct(n),r.length>1+(r[r.length-1].match.def===""?1:0)):!1}function d(n,t){for(var i=n+1;it(i).match.def!==""&&(t===!0&&(it(i).match.newBlockMarker!==!0||!ft(i))||t!==!0&&!ft(i));)i++;return i}function dt(n,t){var i=n,r;if(i<=0)return 0;while(--i>0&&(t===!0&&it(i).match.newBlockMarker!==!0||t!==!0&&!ft(i)&&(r=ct(i),r.length<2||r.length===2&&r[1].match.def==="")));return i}function st(t,r,u,f,e){var o,s,h,l;f&&n.isFunction(c.onBeforeWrite)&&(o=c.onBeforeWrite.call(vt,f,r,u,c),o&&(o.refreshFromBuffer&&(s=o.refreshFromBuffer,bi(s===!0?s:s.start,s.end,o.buffer||r),r=w(!0)),u!==i&&(u=o.caret!==i?o.caret:u)));t!==i&&(t.inputmask._valueSet(r.join("")),u!==i&&(f===i||f.type!=="blur")?nt(t,u):tr(t,u,r.length===0),e===!0&&(h=n(t),l=t.inputmask._valueGet(),ti=!0,h.trigger("input"),setTimeout(function(){l===ut().join("")?h.trigger("cleared"):wt(r)===!0&&h.trigger("complete")},0)))}function ht(t,r,u){var f,o,s,e;if(r=r||it(t).match,r.placeholder!==i||u===!0)return n.isFunction(r.placeholder)?r.placeholder(c):r.placeholder;if(r.fn===null){if(t>-1&&y().validPositions[t]===i&&(f=ct(t),o=[],f.length>1+(f[f.length-1].match.def===""?1:0)))for(e=0;e<f.length;e++)if(f[e].match.optionality!==!0&&f[e].match.optionalQuantifier!==!0&&(f[e].match.fn===null||s===i||f[e].match.fn.test(s.match.def,y(),t,!0,c)!==!1)&&(o.push(f[e]),f[e].match.fn===null&&(s=f[e]),o.length>1&&/[0-9a-bA-Z]/.test(o[0].match.def)))return c.placeholder.charAt(t%c.placeholder.length);return r.def}return c.placeholder.charAt(t%c.placeholder.length)}function vi(n,t){if(v&&n.inputmask._valueGet()!==t){var i=w().slice(),r=n.inputmask._valueGet();r!==t&&(b()===-1&&r===ut().join("")?i=[]:gt(i),st(n,i))}else n.placeholder!==t&&(n.placeholder=t,n.placeholder===""&&n.removeAttribute("placeholder"))}function pt(t,u,f,e,o){function nt(n,t){var i=bt(!0,0,!1).slice(n,d(n)).join("").replace(/'/g,"").indexOf(t);return i!==-1&&!ft(n)&&(it(n).match.nativeDef===t.charAt(0)||it(n).match.fn===null&&it(n).match.nativeDef==="'"+t.charAt(0)||it(n).match.nativeDef===" "&&(it(n+1).match.nativeDef===t.charAt(0)||it(n+1).match.fn===null&&it(n+1).match.nativeDef==="'"+t.charAt(0)))}var a=this||t.inputmask,l=e.slice(),p="",s=-1,h=i,g,v;ot();f||c.autoUnmask===!0?s=d(s):(g=ut().slice(0,d(-1)).join(""),v=l.join("").match(new RegExp("^"+r.escapeRegex(g),"g")),v&&v.length>0&&(l.splice(0,v.length*g.length),s=d(s)));s===-1?(y().p=d(s),s=0):y().p=s;a.caretPos={begin:s};n.each(l,function(r,u){var e,o;u!==i&&(y().validPositions[r]===i&&l[r]===ht(r)&&ft(r,!0)&&yt(r,l[r],!0,i,i,!0)===!1?y().p++:(e=new n.Event("_checkval"),e.which=u.charCodeAt(0),p+=u,o=b(i,!0),nt(s,p)?h=k.keypressEvent.call(t,e,!0,!1,f,o+1):(h=k.keypressEvent.call(t,e,!0,!1,f,a.caretPos.begin),h&&(s=a.caretPos.begin+1,p="")),h&&(st(i,w(),h.forwardPosition,e,!1),a.caretPos={begin:h.forwardPosition,end:h.forwardPosition})))});u&&st(t,w(),h?h.forwardPosition:i,o||new n.Event("checkval"),o&&o.type==="input")}function ki(t){var r,u,f,e,o;if(t){if(t.inputmask===i)return t.value;t.inputmask&&t.inputmask.refreshValue&&k.setValueEvent.call(t)}r=[];u=y().validPositions;for(f in u)u[f].match&&u[f].match.fn!=null&&r.push(u[f].input);return e=r.length===0?"":(g?r.reverse():r).join(""),n.isFunction(c.onUnMask)&&(o=(g?w().slice().reverse():w()).join(""),e=c.onUnMask.call(vt,o,e,c)),e}function nt(r,f,e,o){function h(n){return g&&typeof n=="number"&&(!c.greedy||c.placeholder!=="")&&p&&(n=p.inputmask._valueGet().length-n),n}var s,l,v,a;if(f!==i)n.isArray(f)&&(e=g?f[0]:f[1],f=g?f[1]:f[0]),f.begin!==i&&(e=g?f.begin:f.end,f=g?f.end:f.begin),typeof f=="number"&&(f=o?f:h(f),e=o?e:h(e),e=typeof e=="number"?e:f,l=parseInt(((r.ownerDocument.defaultView||t).getComputedStyle?(r.ownerDocument.defaultView||t).getComputedStyle(r,null):r.currentStyle).fontSize)*e,r.scrollLeft=l>r.scrollWidth?l:0,r.inputmask.caretPos={begin:f,end:e},r===u.activeElement&&("selectionStart"in r?(r.selectionStart=f,r.selectionEnd=e):t.getSelection?(s=u.createRange(),(r.firstChild===i||r.firstChild===null)&&(v=u.createTextNode(""),r.appendChild(v)),s.setStart(r.firstChild,f<r.inputmask._valueGet().length?f:r.inputmask._valueGet().length),s.setEnd(r.firstChild,e<r.inputmask._valueGet().length?e:r.inputmask._valueGet().length),s.collapse(!0),a=t.getSelection(),a.removeAllRanges(),a.addRange(s)):r.createTextRange&&(s=r.createTextRange(),s.collapse(!0),s.moveEnd("character",e),s.moveStart("character",f),s.select()),tr(r,{begin:f,end:e})));else return"selectionStart"in r?(f=r.selectionStart,e=r.selectionEnd):t.getSelection?(s=t.getSelection().getRangeAt(0),(s.commonAncestorContainer.parentNode===r||s.commonAncestorContainer===r)&&(f=s.startOffset,e=s.endOffset)):u.selection&&u.selection.createRange&&(s=u.selection.createRange(),f=0-s.duplicate().moveStart("character",-r.inputmask._valueGet().length),e=f+s.text.length),{begin:o?f:h(f),end:o?e:h(e)}}function di(t){for(var h=bt(!0,b(),!0,!0),e=h.length,c=b(),o={},f=y().validPositions[c],l=f!==i?f.locator.slice():i,u,s,r=c+1;r<h.length;r++)u=kt(r,l,r-1),l=u.locator.slice(),o[r]=n.extend(!0,{},u);for(s=f&&f.alternation!==i?f.locator[f.alternation]:i,r=e-1;r>c;r--)if(u=o[r],(u.match.optionality||u.match.optionalQuantifier&&u.match.newBlockMarker||s&&(s!==o[r].locator[f.alternation]&&u.match.fn!=null||u.match.fn===null&&u.locator[f.alternation]&&fr(u.locator[f.alternation].toString().split(","),s.toString().split(","))&&ct(r)[0].def!==""))&&h[r]===ht(r,u.match))e--;else break;return t?{l:e,def:o[e]?o[e].match:i}:e}function gt(n){n.length=0;for(var r=bt(!0,0,!0,i,!0),t;t=r.shift(),t!==i;)n.push(t);return n}function wt(t){var r,u;if(n.isFunction(c.isComplete))return c.isComplete(t,c);if(c.repeat==="*")return i;var e=!1,f=di(!0),o=dt(f.l);if(f.def===i||f.def.newBlockMarker||f.def.optionality||f.def.optionalQuantifier)for(e=!0,r=0;r<=o;r++)if(u=kt(r).match,u.fn!==null&&y().validPositions[r]===i&&u.optionality!==!0&&u.optionalQuantifier!==!0||u.fn===null&&t[r]!==ht(r,u)){e=!1;break}return e}function gi(n,t,u,f,e){var l,o,h,s;if((c.numericInput||g)&&(t===r.keyCode.BACKSPACE?t=r.keyCode.DELETE:t===r.keyCode.DELETE&&(t=r.keyCode.BACKSPACE),g&&(l=u.end,u.end=u.begin,u.begin=l)),t===r.keyCode.BACKSPACE&&u.end-u.begin<1?(u.begin=dt(u.begin),y().validPositions[u.begin]!==i&&y().validPositions[u.begin].input===c.groupSeparator&&u.begin--):t===r.keyCode.DELETE&&u.begin===u.end&&(u.end=ft(u.end,!0)&&y().validPositions[u.end]&&y().validPositions[u.end].input!==c.radixPoint?u.end+1:d(u.end)+1,y().validPositions[u.begin]!==i&&y().validPositions[u.begin].input===c.groupSeparator&&u.end++),ei(u),(f!==!0&&c.keepStatic!==!1||c.regex!==null)&&(o=fi(!0),o&&(h=o.caret!==i?o.caret:o.pos?d(o.pos.begin?o.pos.begin:o.pos):b(-1,!0),(t!==r.keyCode.DELETE||u.begin>h)&&u.begin==h)),s=b(u.begin,!0),s<u.begin||u.begin===-1)y().p=d(s);else if(f!==!0&&(y().p=u.begin,e!==!0))while(y().p<s&&y().validPositions[y().p]===i)y().p++}function nr(i){function e(n){var t=u.createElement("span"),f,e,o,s,c,h,l;for(e in r)isNaN(e)&&e.indexOf("font")!==-1&&(t.style[e]=r[e]);for(t.style.textTransform=r.textTransform,t.style.letterSpacing=r.letterSpacing,t.style.position="absolute",t.style.height="auto",t.style.width="auto",t.style.visibility="hidden",t.style.whiteSpace="nowrap",u.body.appendChild(t),o=i.inputmask._valueGet(),s=0,f=0,c=o.length;f<=c;f++){if(t.innerHTML+=o.charAt(f)||"_",t.offsetWidth>=n){h=n-s;l=t.offsetWidth-n;t.innerHTML=o.charAt(f);h-=t.offsetWidth/3;f=h<l?f-1:f;break}s=t.offsetWidth}return u.body.removeChild(t),f}var r=(i.ownerDocument.defaultView||t).getComputedStyle(i,null),f=u.createElement("div");f.style.width=r.width;f.style.textAlign=r.textAlign;rt=u.createElement("div");i.inputmask.colorMask=rt;rt.className="im-colormask";i.parentNode.insertBefore(rt,i);i.parentNode.removeChild(i);rt.appendChild(i);rt.appendChild(f);i.style.left=f.offsetLeft+"px";n(rt).on("mouseleave",function(n){return k.mouseleaveEvent.call(i,[n])});n(rt).on("mouseenter",function(n){return k.mouseenterEvent.call(i,[n])});n(rt).on("click",function(n){return nt(i,e(n.clientX)),k.clickEvent.call(i,[n])})}function tr(n,t,r){function a(n){if(n===i&&(n=""),h||o.fn!==null&&s.input!==i)if(h&&(o.fn!==null&&s.input!==i||o.def==="")){h=!1;var t=e.length;e[t-1]=e[t-1]+"<\/span>";e.push(n)}else e.push(n);else h=!0,e.push("<span class='im-static'>"+n)}function d(){u.activeElement===n&&(e.splice(t.begin,0,t.begin===t.end||t.end>y().maskLength?'<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">':'<mark class="im-caret-select">'),e.splice(t.end+1,0,"<\/mark>"))}var e=[],h=!1,o,s,l,f=0,k,v,p;if(rt!==i){if(k=w(),t===i?t=nt(n):t.begin===i&&(t={begin:t,end:t}),r!==!0){v=b();do y().validPositions[f]?(s=y().validPositions[f],o=s.match,l=s.locator.slice(),a(k[f])):(s=kt(f,l,f-1),o=s.match,l=s.locator.slice(),c.jitMasking===!1||f<v||typeof c.jitMasking=="number"&&isFinite(c.jitMasking)&&c.jitMasking>f?a(ht(f,o)):h=!1),f++;while((at===i||f<at)&&(o.fn!==null||o.def!=="")||v>f||h);h&&a();d()}p=rt.getElementsByTagName("div")[0];p.innerHTML=e.join("");n.inputmask.positionColorMask(n,p)}}function er(t){function o(t,r){function s(t){function c(t){if(n.valHooks&&(n.valHooks[t]===i||n.valHooks[t].inputmaskpatch!==!0)){var u=n.valHooks[t]&&n.valHooks[t].get?n.valHooks[t].get:function(n){return n.value},f=n.valHooks[t]&&n.valHooks[t].set?n.valHooks[t].set:function(n,t){return n.value=t,n};n.valHooks[t]={get:function(n){if(n.inputmask){if(n.inputmask.opts.autoUnmask)return n.inputmask.unmaskedvalue();var t=u(n);return b(i,i,n.inputmask.maskset.validPositions)!==-1||r.nullable!==!0?t:""}return u(n)},set:function(t,i){var u=n(t),r;return r=f(t,i),t.inputmask&&u.trigger("setvalue",[i]),r},inputmaskpatch:!0}}}function s(){return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():b()!==-1||r.nullable!==!0?u.activeElement===this&&r.clearMaskOnLostFocus?(g?gt(w().slice()).reverse():gt(w().slice())).join(""):f.call(this):"":f.call(this)}function h(t){e.call(this,t);this.inputmask&&n(this).trigger("setvalue",[t])}function l(t){tt.on(t,"mouseenter",function(){var t=n(this),i=this,r=i.inputmask._valueGet();r!==w().join("")&&t.trigger("setvalue")})}var f,e,o;t.inputmask.__valueGet||(r.noValuePatching!==!0&&(Object.getOwnPropertyDescriptor?(typeof Object.getPrototypeOf!="function"&&(Object.getPrototypeOf=typeof"test".__proto__=="object"?function(n){return n.__proto__}:function(n){return n.constructor.prototype}),o=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"value"):i,o&&o.get&&o.set?(f=o.get,e=o.set,Object.defineProperty(t,"value",{get:s,set:h,configurable:!0})):t.tagName!=="INPUT"&&(f=function(){return this.textContent},e=function(n){this.textContent=n},Object.defineProperty(t,"value",{get:s,set:h,configurable:!0}))):u.__lookupGetter__&&t.__lookupGetter__("value")&&(f=t.__lookupGetter__("value"),e=t.__lookupSetter__("value"),t.__defineGetter__("value",s),t.__defineSetter__("value",h)),t.inputmask.__valueGet=f,t.inputmask.__valueSet=e),t.inputmask._valueGet=function(n){return g&&n!==!0?f.call(this.el).split("").reverse().join(""):f.call(this.el)},t.inputmask._valueSet=function(n,t){e.call(this.el,n===null||n===i?"":t!==!0&&g?n.split("").reverse().join(""):n)},f===i&&(f=function(){return this.value},e=function(n){this.value=n},c(t.type),l(t)))}var o=t.getAttribute("type"),f=t.tagName==="INPUT"&&n.inArray(o,r.supportsInputType)!==-1||t.isContentEditable||t.tagName==="TEXTAREA",e;return f||(t.tagName==="INPUT"?(e=u.createElement("input"),e.setAttribute("type",o),f=e.type==="text",e=null):f="partial"),f!==!1?s(t):t.inputmask=i,f}var f,e,r;if(tt.off(t),f=o(t,c),f!==!1){if(p=t,ni=n(p),ci=p.placeholder,at=p!==i?p.maxLength:i,at===-1&&(at=i),c.colorMask===!0&&nr(p),s&&("inputmode"in p&&(p.inputmode=c.inputmode,p.setAttribute("inputmode",c.inputmode)),c.disablePredictiveText===!0&&("autocorrect"in p?p.autocorrect=!1:(c.colorMask!==!0&&nr(p),p.type="password"))),f===!0){p.setAttribute("im-insert",c.insertMode);tt.on(p,"submit",k.submitEvent);tt.on(p,"reset",k.resetEvent);tt.on(p,"blur",k.blurEvent);tt.on(p,"focus",k.focusEvent);if(c.colorMask!==!0){tt.on(p,"click",k.clickEvent);tt.on(p,"mouseleave",k.mouseleaveEvent);tt.on(p,"mouseenter",k.mouseenterEvent)}tt.on(p,"paste",k.pasteEvent);tt.on(p,"cut",k.cutEvent);tt.on(p,"complete",c.oncomplete);tt.on(p,"incomplete",c.onincomplete);tt.on(p,"cleared",c.oncleared);if(s||c.inputEventOnly===!0)p.removeAttribute("maxLength");else{tt.on(p,"keydown",k.keydownEvent);tt.on(p,"keypress",k.keypressEvent)}tt.on(p,"input",k.inputFallBackEvent);tt.on(p,"beforeinput",k.beforeInputEvent)}tt.on(p,"setvalue",k.setValueEvent);et=ut().join("");(p.inputmask._valueGet(!0)!==""||c.clearMaskOnLostFocus===!1||u.activeElement===p)&&(e=n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(vt,p.inputmask._valueGet(!0),c)||p.inputmask._valueGet(!0):p.inputmask._valueGet(!0),e!==""&&pt(p,!0,!1,e.split("")),r=w().slice(),et=r.join(""),wt(r)===!1&&c.clearIncomplete&&ot(),c.clearMaskOnLostFocus&&u.activeElement!==p&&(b()===-1?r=[]:gt(r)),(c.clearMaskOnLostFocus===!1||c.showMaskOnFocus&&u.activeElement===p||p.inputmask._valueGet(!0)!=="")&&st(p,r),u.activeElement===p&&nt(p,d(b())))}}var tt,k,lt,ir,si;o=o||this.maskset;c=c||this.opts;var vt=this,p=this.el,g=this.isRTL,et,ni,hi=!1,ti=!1,ii=!1,at,ri=!1,rt,ci;if(tt={on:function(t,u,f){var e=function(t){var u=this,o,e,a;if(u.inputmask===i&&this.nodeName!=="FORM")o=n.data(u,"_inputmask_opts"),o?new r(o).mask(u):tt.off(u);else{if(t.type==="setvalue"||this.nodeName==="FORM"||!u.disabled&&(!u.readOnly||t.type==="keydown"&&t.ctrlKey&&t.keyCode===67||c.tabThrough===!1&&t.keyCode===r.keyCode.TAB)){switch(t.type){case"input":if(ti===!0)return ti=!1,t.preventDefault();if(s)return e=arguments,setTimeout(function(){f.apply(u,e);nt(u,u.inputmask.caretPos,i,!0)},0),!1;break;case"keydown":hi=!1;ti=!1;break;case"keypress":if(hi===!0)return t.preventDefault();hi=!0;break;case"click":if(h||l)return e=arguments,setTimeout(function(){f.apply(u,e)},0),!1}return a=f.apply(u,arguments),a===!1&&(t.preventDefault(),t.stopPropagation()),a}t.preventDefault()}};if(t.inputmask.events[u]=t.inputmask.events[u]||[],t.inputmask.events[u].push(e),n.inArray(u,["submit","reset"])!==-1){if(t.form!==null)n(t.form).on(u,e)}else n(t).on(u,e)},off:function(t,i){if(t.inputmask&&t.inputmask.events){var r;i?(r=[],r[i]=t.inputmask.events[i]):r=t.inputmask.events;n.each(r,function(i,r){while(r.length>0){var u=r.pop();n.inArray(i,["submit","reset"])!==-1?t.form!==null&&n(t.form).off(i,u):n(t).off(i,u)}delete t.inputmask.events[i]})}}},k={keydownEvent:function(t){var f=this,o=n(f),u=t.keyCode,i=nt(f),e;u===r.keyCode.BACKSPACE||u===r.keyCode.DELETE||l&&u===r.keyCode.BACKSPACE_SAFARI||t.ctrlKey&&u===r.keyCode.X&&!a("cut")?(t.preventDefault(),gi(f,u,i),st(f,w(!0),y().p,t,f.inputmask._valueGet()!==w().join(""))):u===r.keyCode.END||u===r.keyCode.PAGE_DOWN?(t.preventDefault(),e=d(b()),nt(f,t.shiftKey?i.begin:e,e,!0)):(u!==r.keyCode.HOME||t.shiftKey)&&u!==r.keyCode.PAGE_UP?(c.undoOnEscape&&u===r.keyCode.ESCAPE||u===90&&t.ctrlKey)&&t.altKey!==!0?(pt(f,!0,!1,et.split("")),o.trigger("click")):u!==r.keyCode.INSERT||t.shiftKey||t.ctrlKey?c.tabThrough===!0&&u===r.keyCode.TAB&&(t.shiftKey===!0?(it(i.begin).match.fn===null&&(i.begin=d(i.begin)),i.end=dt(i.begin,!0),i.begin=dt(i.end,!0)):(i.begin=d(i.begin,!0),i.end=d(i.begin,!0),i.end<y().maskLength&&i.end--),i.begin<y().maskLength&&(t.preventDefault(),nt(f,i.begin,i.end))):(c.insertMode=!c.insertMode,f.setAttribute("im-insert",c.insertMode)):(t.preventDefault(),nt(f,0,t.shiftKey?i.begin:0,!0));c.onKeyDown.call(this,t,w(),nt(f).begin,c);ii=n.inArray(u,c.ignorables)!==-1},keypressEvent:function(t,u,f,e,o){var a=this,g=n(a),h=t.which||t.charCode||t.keyCode,b,s,k;if(u===!0||t.ctrlKey&&t.altKey||!(t.ctrlKey||t.metaKey||ii)){if(h){h===46&&t.shiftKey===!1&&c.radixPoint!==""&&(h=c.radixPoint.charCodeAt(0));var v=u?{begin:o,end:o}:nt(a),l,tt=String.fromCharCode(h),p=0;if(c._radixDance&&c.numericInput&&(b=w().indexOf(c.radixPoint.charAt(0))+1,v.begin<=b&&(h===c.radixPoint.charCodeAt(0)&&(p=1),v.begin-=1,v.end-=1)),y().writeOutBuffer=!0,s=yt(v,tt,e),s!==!1&&(ot(!0),l=s.caret!==i?s.caret:d(s.pos.begin?s.pos.begin:s.pos),y().p=l),l=(c.numericInput&&s.caret===i?dt(l):l)+p,f!==!1&&(setTimeout(function(){c.onKeyValidation.call(a,h,s,c)},0),y().writeOutBuffer&&s!==!1&&(k=w(),st(a,k,l,t,u!==!0))),t.preventDefault(),u)return s!==!1&&(s.forwardPosition=l),s}}else return h===r.keyCode.ENTER&&et!==w().join("")&&(et=w().join(""),setTimeout(function(){g.trigger("change")},0)),!0},pasteEvent:function(i){var e=this,h=i.originalEvent||i,a=n(e),r=e.inputmask._valueGet(!0),u=nt(e),l,o,s,f;if(g&&(l=u.end,u.end=u.begin,u.begin=l),o=r.substr(0,u.begin),s=r.substr(u.end,r.length),o===(g?ut().reverse():ut()).slice(0,u.begin).join("")&&(o=""),s===(g?ut().reverse():ut()).slice(u.end).join("")&&(s=""),t.clipboardData&&t.clipboardData.getData)r=o+t.clipboardData.getData("Text")+s;else if(h.clipboardData&&h.clipboardData.getData)r=o+h.clipboardData.getData("text/plain")+s;else return!0;if(f=r,n.isFunction(c.onBeforePaste)){if(f=c.onBeforePaste.call(vt,r,c),f===!1)return i.preventDefault();f||(f=r)}return pt(e,!1,!1,f.toString().split("")),st(e,w(),d(b()),i,et!==w().join("")),i.preventDefault()},inputFallBackEvent:function(t){function it(n,t,i){return t.charAt(i.begin-1)==="."&&c.radixPoint!==""&&(t=t.split(""),t[i.begin-1]=c.radixPoint.charAt(0),t=t.join("")),t}function rt(n,t,i){var r,u;return h&&(r=t.replace(w().join(""),""),r.length===1&&(u=t.split(""),u.splice(i.begin,0,r),t=u.join(""))),t}var u=this,f=u.inputmask._valueGet(),e,tt,o,g;if(w().join("")!==f&&(e=nt(u),f=it(u,f,e),f=rt(u,f,e),w().join("")!==f)){var b=w().join(""),s=!c.numericInput&&f.length>b.length?-1:0,l=f.substr(0,e.begin),a=f.substr(e.begin),y=b.substr(0,e.begin+s),p=b.substr(e.begin+s),i=e,v="",d=!1;if(l!==y){for(tt=(d=l.length>=y.length)?l.length:y.length,o=0;l.charAt(o)===y.charAt(o)&&o<tt;o++);d&&(i.begin=o-s,v+=l.slice(o,i.end))}a!==p&&(a.length>p.length?v+=a.slice(0,1):a.length<p.length&&(i.end+=p.length-a.length,d||c.radixPoint===""||a!==""||l.charAt(i.begin+s-1)!==c.radixPoint||(i.begin--,v=c.radixPoint)));st(u,w(),{begin:i.begin+s,end:i.end+s});v.length>0?n.each(v.split(""),function(t,i){var r=new n.Event("keypress");r.which=i.charCodeAt(0);ii=!1;k.keypressEvent.call(u,r)}):(i.begin===i.end-1&&(i.begin=dt(i.begin+1),i.begin===i.end-1?nt(u,i.begin):nt(u,i.begin,i.end)),g=new n.Event("keydown"),g.keyCode=c.numericInput?r.keyCode.BACKSPACE:r.keyCode.DELETE,k.keydownEvent.call(u,g));t.preventDefault()}},beforeInputEvent:function(t){var u,i;if(t.cancelable){u=this;switch(t.inputType){case"insertText":return n.each(t.data.split(""),function(t,i){var r=new n.Event("keypress");r.which=i.charCodeAt(0);ii=!1;k.keypressEvent.call(u,r)}),t.preventDefault();case"deleteContentBackward":return i=new n.Event("keydown"),i.keyCode=r.keyCode.BACKSPACE,k.keydownEvent.call(u,i),t.preventDefault();case"deleteContentForward":return i=new n.Event("keydown"),i.keyCode=r.keyCode.DELETE,k.keydownEvent.call(u,i),t.preventDefault()}}},setValueEvent:function(t){this.inputmask.refreshValue=!1;var r=this,i=t&&t.detail?t.detail[0]:arguments[1],i=i||r.inputmask._valueGet(!0);n.isFunction(c.onBeforeMask)&&(i=c.onBeforeMask.call(vt,i,c)||i);i=i.split("");pt(r,!0,!1,i);et=w().join("");(c.clearMaskOnLostFocus||c.clearIncomplete)&&r.inputmask._valueGet()===ut().join("")&&r.inputmask._valueSet("")},focusEvent:function(n){var t=this,i=t.inputmask._valueGet();c.showMaskOnFocus&&(!c.showMaskOnHover||c.showMaskOnHover&&i==="")&&(t.inputmask._valueGet()!==w().join("")?st(t,w(),d(b())):ri===!1&&nt(t,d(b())));c.positionCaretOnTab===!0&&ri===!1&&k.clickEvent.apply(t,[n,!0]);et=w().join("")},mouseleaveEvent:function(){var n=this;ri=!1;c.clearMaskOnLostFocus&&u.activeElement!==n&&vi(n,ci)},clickEvent:function(t,r){function e(t){var r,f,u;if(c.radixPoint!==""&&(r=y().validPositions,r[t]===i||r[t].input===ht(t))){if(t<d(-1))return!0;if(f=n.inArray(c.radixPoint,w()),f!==-1){for(u in r)if(f<u&&r[u].input!==ht(u))return!1;return!0}}return!1}var f=this;setTimeout(function(){var n,h,v;if(u.activeElement===f&&(n=nt(f),r&&(g?n.end=n.begin:n.begin=n.end),n.begin===n.end))switch(c.positionCaretOnClick){case"none":break;case"select":nt(f,0,w().length);break;case"ignore":nt(f,d(b()));break;case"radixFocus":if(e(n.begin)){h=w().join("").indexOf(c.radixPoint);nt(f,c.numericInput?d(h):h);break}default:var o=n.begin,p=b(o,!0),t=d(p);if(o<t)nt(f,!ft(o,!0)&&!ft(o-1,!0)?d(o):o);else{var l=y().validPositions[p],s=kt(t,l?l.match.locator:i,l),a=ht(t,s.match);(a===""||w()[t]===a||s.match.optionalQuantifier===!0||s.match.newBlockMarker===!0)&&(ft(t,c.keepStatic)||s.match.def!==a)||(v=d(t),(o>=v||o===t)&&(t=v));nt(f,t)}}},0)},cutEvent:function(i){var e=this,c=n(e),f=nt(e),s=i.originalEvent||i,h=t.clipboardData||s.clipboardData,o=g?w().slice(f.end,f.begin):w().slice(f.begin,f.end);h.setData("text",g?o.reverse().join(""):o.join(""));u.execCommand&&u.execCommand("copy");gi(e,r.keyCode.DELETE,f);st(e,w(),y().p,i,et!==w().join(""))},blurEvent:function(t){var e=n(this),u=this,f,r;u.inputmask&&(vi(u,ci),f=u.inputmask._valueGet(),r=w().slice(),(f!==""||rt!==i)&&(c.clearMaskOnLostFocus&&(b()===-1&&f===ut().join("")?r=[]:gt(r)),wt(r)===!1&&(setTimeout(function(){e.trigger("incomplete")},0),c.clearIncomplete&&(ot(),r=c.clearMaskOnLostFocus?[]:ut().slice())),st(u,r,i,t)),et!==w().join("")&&(et=r.join(""),e.trigger("change")))},mouseenterEvent:function(){var n=this;ri=!0;u.activeElement!==n&&c.showMaskOnHover&&vi(n,(g?w().slice().reverse():w()).join(""))},submitEvent:function(){et!==w().join("")&&ni.trigger("change");c.clearMaskOnLostFocus&&b()===-1&&p.inputmask._valueGet&&p.inputmask._valueGet()===ut().join("")&&p.inputmask._valueSet("");c.clearIncomplete&&wt(w())===!1&&p.inputmask._valueSet("");c.removeMaskOnSubmit&&(p.inputmask._valueSet(p.inputmask.unmaskedvalue(),!0),setTimeout(function(){st(p,w())},0))},resetEvent:function(){p.inputmask.refreshValue=!0;setTimeout(function(){ni.trigger("setvalue")},0)}},r.prototype.positionColorMask=function(n,t){n.style.left=t.offsetLeft+"px"},e!==i)switch(e.action){case"isComplete":return p=e.el,wt(w());case"unmaskedvalue":return(p===i||e.value!==i)&&(lt=e.value,lt=(n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(vt,lt,c)||lt:lt).split(""),pt.call(this,i,!1,!1,lt),n.isFunction(c.onBeforeWrite)&&c.onBeforeWrite.call(vt,i,w(),0,c)),ki(p);case"mask":er(p);break;case"format":return(lt=(n.isFunction(c.onBeforeMask)?c.onBeforeMask.call(vt,e.value,c)||e.value:e.value).split(""),pt.call(this,i,!0,!1,lt),e.metadata)?{value:g?w().slice().reverse().join(""):w().join(""),metadata:f.call(this,{action:"getmetadata"},o,c)}:g?w().slice().reverse().join(""):w().join("");case"isValid":e.value?(lt=e.value.split(""),pt.call(this,i,!0,!0,lt)):e.value=w().join("");for(var yi=w(),pi=di(),oi=yi.length-1;oi>pi;oi--)if(ft(oi))break;return yi.splice(pi,oi+1-pi),wt(yi)&&e.value===w().join("");case"getemptymask":return ut().join("");case"remove":return p&&p.inputmask&&(n.data(p,"_inputmask_opts",null),ni=n(p),p.inputmask._valueSet(c.autoUnmask?ki(p):p.inputmask._valueGet(!0)),tt.off(p),p.inputmask.colorMask&&(rt=p.inputmask.colorMask,rt.removeChild(p),rt.parentNode.insertBefore(p,rt),rt.parentNode.removeChild(rt)),Object.getOwnPropertyDescriptor&&Object.getPrototypeOf?(ir=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(p),"value"),ir&&p.inputmask.__valueGet&&Object.defineProperty(p,"value",{get:p.inputmask.__valueGet,set:p.inputmask.__valueSet,configurable:!0})):u.__lookupGetter__&&p.__lookupGetter__("value")&&p.inputmask.__valueGet&&(p.__defineGetter__("value",p.inputmask.__valueGet),p.__defineSetter__("value",p.inputmask.__valueSet)),p.inputmask=i),p;case"getmetadata":return n.isArray(o.metadata)?(si=bt(!0,0,!1).join(""),n.each(o.metadata,function(n,t){if(t.mask===si)return si=t,!1}),si):o.metadata}}var u=t.document,o=navigator.userAgent,v=o.indexOf("MSIE ")>0||o.indexOf("Trident/")>0,s=a("touchstart"),h=/iemobile/i.test(o),l=/iphone/i.test(o)&&!h;return r.prototype={dataAttribute:"data-inputmask",defaults:{placeholder:"_",optionalmarker:["[","]"],quantifiermarker:["{","}"],groupmarker:["(",")"],alternatormarker:"|",escapeChar:"\\",mask:null,regex:null,oncomplete:n.noop,onincomplete:n.noop,oncleared:n.noop,repeat:0,greedy:!1,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,alias:null,onKeyDown:n.noop,onBeforeMask:null,onBeforePaste:function(t,i){return n.isFunction(i.onBeforeMask)?i.onBeforeMask.call(this,t,i):t},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:n.noop,skipOptionalPartCharacter:" ",numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",_radixDance:!1,groupSeparator:"",keepStatic:null,positionCaretOnTab:!0,tabThrough:!1,supportsInputType:["text","tel","password","search"],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,preValidation:null,postValidation:null,staticDefinitionSymbol:i,jitMasking:!1,nullable:!0,inputEventOnly:!1,noValuePatching:!1,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:!1,disablePredictiveText:!1,importDataAttributes:!0,shiftPositions:!0},definitions:{9:{validator:"[0-9１-９]",definitionSymbol:"*"},a:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",definitionSymbol:"*"},"*":{validator:"[0-9１-９A-Za-zА-яЁёÀ-ÿµ]"}},aliases:{},masksCache:{},mask:function(o){function h(r,u,f,e){if(u.importDataAttributes===!0){var l=r.getAttribute(e),a,o,s,h;function v(n,u){u=u!==i?u:r.getAttribute(e+"-"+n);u!==null&&(typeof u=="string"&&(n.indexOf("on")===0?u=t[u]:u==="false"?u=!1:u==="true"&&(u=!0)),f[n]=u)}if(l&&l!==""&&(l=l.replace(/'/g,'"'),o=JSON.parse("{"+l+"}")),o){s=i;for(h in o)if(h.toLowerCase()==="alias"){s=o[h];break}}v("alias",s);f.alias&&c(f.alias,f,u);for(a in u){if(o){s=i;for(h in o)if(h.toLowerCase()===a.toLowerCase()){s=o[h];break}}v(a,s)}}return n.extend(!0,u,f),(r.dir==="rtl"||u.rightAlign)&&(r.style.textAlign="right"),(r.dir==="rtl"||u.numericInput)&&(r.dir="ltr",r.removeAttribute("dir"),u.isRTL=!0),Object.keys(f).length}var s=this;return typeof o=="string"&&(o=u.getElementById(o)||u.querySelectorAll(o)),o=o.nodeName?[o]:o,n.each(o,function(t,u){var o=n.extend(!0,{},s.opts),c;h(u,o,n.extend(!0,{},s.userOptions),s.dataAttribute)&&(c=e(o,s.noMasksCache),c!==i&&(u.inputmask!==i&&(u.inputmask.opts.autoUnmask=!0,u.inputmask.remove()),u.inputmask=new r(i,i,!0),u.inputmask.opts=o,u.inputmask.noMasksCache=s.noMasksCache,u.inputmask.userOptions=n.extend(!0,{},s.userOptions),u.inputmask.isRTL=o.isRTL||o.numericInput,u.inputmask.el=u,u.inputmask.maskset=c,n.data(u,"_inputmask_opts",o),f.call(u.inputmask,{action:"mask"})))}),o&&o[0]?o[0].inputmask||this:this},option:function(t,i){return typeof t=="string"?this.opts[t]:typeof t=="object"?(n.extend(this.userOptions,t),this.el&&i!==!0&&this.mask(this.el),this):void 0},unmaskedvalue:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"unmaskedvalue",value:n})},remove:function(){return f.call(this,{action:"remove"})},getemptymask:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getemptymask"})},hasMaskedValue:function(){return!this.opts.autoUnmask},isComplete:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isComplete"})},getmetadata:function(){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"getmetadata"})},isValid:function(n){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"isValid",value:n})},format:function(n,t){return this.maskset=this.maskset||e(this.opts,this.noMasksCache),f.call(this,{action:"format",value:n,metadata:t})},setValue:function(t){this.el&&n(this.el).trigger("setvalue",[t])},analyseMask:function(t,u,f){function p(n,t,i,r){this.matches=[];this.openGroup=n||!1;this.alternatorGroup=!1;this.isGroup=n||!1;this.isOptional=t||!1;this.isQuantifier=i||!1;this.isAlternator=r||!1;this.quantifier={min:1,max:1}}function g(t,e,o){var s,h;o=o!==i?o:t.matches.length;s=t.matches[o-1];u?(e.indexOf("[")===0||v&&/\\d|\\s|\\w]/i.test(e)||e==="."?t.matches.splice(o++,0,{fn:new RegExp(e,f.casing?"i":""),optionality:!1,newBlockMarker:s===i?"master":s.def!==e,casing:null,def:e,placeholder:i,nativeDef:e}):(v&&(e=e[e.length-1]),n.each(e.split(""),function(n,r){s=t.matches[o-1];t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===i?"master":s.def!==r&&s.fn!==null,casing:null,def:f.staticDefinitionSymbol||r,placeholder:f.staticDefinitionSymbol!==i?r:i,nativeDef:(v?"'":"")+r})})),v=!1):(h=(f.definitions?f.definitions[e]:i)||r.prototype.definitions[e],h&&!v?t.matches.splice(o++,0,{fn:h.validator?typeof h.validator=="string"?new RegExp(h.validator,f.casing?"i":""):new function(){this.test=h.validator}:new RegExp("."),optionality:!1,newBlockMarker:s===i?"master":s.def!==(h.definitionSymbol||e),casing:h.casing,def:h.definitionSymbol||e,placeholder:h.placeholder,nativeDef:e}):(t.matches.splice(o++,0,{fn:null,optionality:!1,newBlockMarker:s===i?"master":s.def!==e&&s.fn!==null,casing:null,def:f.staticDefinitionSymbol||e,placeholder:f.staticDefinitionSymbol!==i?e:i,nativeDef:(v?"'":"")+e}),v=!1))}function et(t){t&&t.matches&&n.each(t.matches,function(n,r){var e=t.matches[n+1];(e===i||e.matches===i||e.isQuantifier===!1)&&r&&r.isGroup&&(r.isGroup=!1,u||(g(r,f.groupmarker[0],0),r.openGroup!==!0&&g(r,f.groupmarker[1])));et(r)})}function nt(){if(e.length>0){if(s=e[e.length-1],g(s,c),s.isAlternator){o=e.pop();for(var n=0;n<o.matches.length;n++)o.matches[n].isGroup&&(o.matches[n].isGroup=!1);e.length>0?(s=e[e.length-1],s.matches.push(o)):l.matches.push(o)}}else g(l,c)}function ot(n){function e(n){return n===f.optionalmarker[0]?n=f.optionalmarker[1]:n===f.optionalmarker[1]?n=f.optionalmarker[0]:n===f.groupmarker[0]?n=f.groupmarker[1]:n===f.groupmarker[1]&&(n=f.groupmarker[0]),n}var t,r,u;n.matches=n.matches.reverse();for(t in n.matches)n.matches.hasOwnProperty(t)&&(r=parseInt(t),n.matches[t].isQuantifier&&n.matches[r+1]&&n.matches[r+1].isGroup&&(u=n.matches[t],n.matches.splice(t,1),n.matches.splice(r+1,0,u)),n.matches[t]=n.matches[t].matches!==i?ot(n.matches[t]):e(n.matches[t]));return n}function st(n){var t=new p(!0);return t.openGroup=!1,t.matches=n,t}var vt=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?(?:\|[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,yt=/\[\^?]?(?:[^\\\]]+|\\[\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,v=!1,l=new p,h,c,e=[],it=[],w,s,o,a,k,ut,y,rt,lt,tt,ft;for(u&&(f.optionalmarker[0]=i,f.optionalmarker[1]=i);h=u?yt.exec(t):vt.exec(t);){if(c=h[0],u)switch(c.charAt(0)){case"?":c="{0,1}";break;case"+":case"*":c="{"+c+"}"}if(v){nt();continue}switch(c.charAt(0)){case"(?=":break;case"(?!":break;case"(?<=":break;case"(?<!":break;case f.escapeChar:v=!0;u&&nt();break;case f.optionalmarker[1]:case f.groupmarker[1]:if(w=e.pop(),w.openGroup=!1,w!==i)if(e.length>0){if(s=e[e.length-1],s.matches.push(w),s.isAlternator){for(o=e.pop(),k=0;k<o.matches.length;k++)o.matches[k].isGroup=!1,o.matches[k].alternatorGroup=!1;e.length>0?(s=e[e.length-1],s.matches.push(o)):l.matches.push(o)}}else l.matches.push(w);else nt();break;case f.optionalmarker[0]:e.push(new p(!1,!0));break;case f.groupmarker[0]:e.push(new p(!0));break;case f.quantifiermarker[0]:ut=new p(!1,!1,!0);c=c.replace(/[{}]/g,"");var ht=c.split("|"),b=ht[0].split(","),d=isNaN(b[0])?b[0]:parseInt(b[0]),ct=b.length===1?d:isNaN(b[1])?b[1]:parseInt(b[1]);(d==="*"||d==="+")&&(d=ct==="*"?0:1);ut.quantifier={min:d,max:ct,jit:ht[1]};y=e.length>0?e[e.length-1].matches:l.matches;h=y.pop();h.isAlternator&&(y.push(h),y=h.matches,rt=new p(!0),lt=y.pop(),y.push(rt),y=rt.matches,h=lt);h.isGroup||(h=st([h]));y.push(h);y.push(ut);break;case f.alternatormarker:function at(n){var t=n.pop();return t.isQuantifier&&(t=st([n.pop(),t])),t}e.length>0?(s=e[e.length-1],tt=s.matches[s.matches.length-1],a=s.openGroup&&(tt.matches===i||tt.isGroup===!1&&tt.isAlternator===!1)?e.pop():at(s.matches)):a=at(l.matches);a.isAlternator?e.push(a):(a.alternatorGroup?(o=e.pop(),a.alternatorGroup=!1):o=new p(!1,!1,!1,!0),o.matches.push(a),e.push(o),a.openGroup&&(a.openGroup=!1,ft=new p(!0),ft.alternatorGroup=!0,e.push(ft)));break;default:nt()}}while(e.length>0)w=e.pop(),l.matches.push(w);return l.matches.length>0&&(et(l),it.push(l)),(f.numericInput||f.isRTL)&&ot(it[0]),it}},r.extendDefaults=function(t){n.extend(!0,r.prototype.defaults,t)},r.extendDefinitions=function(t){n.extend(!0,r.prototype.definitions,t)},r.extendAliases=function(t){n.extend(!0,r.prototype.aliases,t)},r.format=function(n,t,i){return r(t).format(n,i)},r.unmask=function(n,t){return r(t).unmaskedvalue(n)},r.isValid=function(n,t){return r(t).isValid(n)},r.remove=function(t){typeof t=="string"&&(t=u.getElementById(t)||u.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(n,t){t.inputmask&&t.inputmask.remove()})},r.setValue=function(t,i){typeof t=="string"&&(t=u.getElementById(t)||u.querySelectorAll(t));t=t.nodeName?[t]:t;n.each(t,function(t,r){r.inputmask?r.inputmask.setValue(i):n(r).trigger("setvalue",[i])})},r.escapeRegex=function(n){return n.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","gim"),"\\$1")},r.keyCode={BACKSPACE:8,BACKSPACE_SAFARI:127,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SPACE:32,TAB:9,UP:38,X:88,CONTROL:17},r.dependencyLib=n,r}),function(n){typeof define=="function"&&define.amd?define(["jquery","./inputmask"],n):typeof exports=="object"?module.exports=n(require("jquery"),require("./inputmask")):n(jQuery,window.Inputmask)}(function(n,t){return n.fn.inputmask===undefined&&(n.fn.inputmask=function(i,r){var f,u=this[0];if(r===undefined&&(r={}),typeof i=="string")switch(i){case"unmaskedvalue":return u&&u.inputmask?u.inputmask.unmaskedvalue():n(u).val();case"remove":return this.each(function(){this.inputmask&&this.inputmask.remove()});case"getemptymask":return u&&u.inputmask?u.inputmask.getemptymask():"";case"hasMaskedValue":return u&&u.inputmask?u.inputmask.hasMaskedValue():!1;case"isComplete":return u&&u.inputmask?u.inputmask.isComplete():!0;case"getmetadata":return u&&u.inputmask?u.inputmask.getmetadata():undefined;case"setvalue":t.setValue(u,r);break;case"option":if(typeof r=="string"){if(u&&u.inputmask!==undefined)return u.inputmask.option(r)}else return this.each(function(){if(this.inputmask!==undefined)return this.inputmask.option(r)});break;default:return r.alias=i,f=new t(r),this.each(function(){f.mask(this)})}else{if(Array.isArray(i))return r.alias=i,f=new t(r),this.each(function(){f.mask(this)});if(typeof i=="object")return f=new t(i),i.mask===undefined&&i.alias===undefined?this.each(function(){if(this.inputmask!==undefined)return this.inputmask.option(i);f.mask(this)}):this.each(function(){f.mask(this)});if(i===undefined)return this.each(function(){f=new t(r);f.mask(this)})}}),n.fn.inputmask}),function(n){typeof define=="function"&&define.amd?define(["./inputmask"],n):typeof exports=="object"?module.exports=n(require("./inputmask")):n(window.Inputmask)}(function(n){function f(n){var i,r;if(!n.tokenizer){i=[];for(r in t)i.indexOf(r[0])===-1&&i.push(r[0]);n.tokenizer="("+i.join("+|")+")+?|.";n.tokenizer=new RegExp(n.tokenizer,"g")}return n.tokenizer}function s(n,t){return!isFinite(n.rawday)||n.day=="29"&&!isFinite(n.rawyear)||new Date(n.date.getFullYear(),isFinite(n.rawmonth)?n.month:n.date.getMonth()+1,0).getDate()>=n.day?t:!1}function h(n,t){var i=!0,r,u;return t.min&&(n.rawyear&&(r=n.rawyear.replace(/[^0-9]/g,""),u=t.min.year.substr(0,r.length),i=u<=r),n.year===n.rawyear&&t.min.date.getTime()===t.min.date.getTime()&&(i=t.min.date.getTime()<=n.date.getTime())),i&&t.max&&t.max.date.getTime()===t.max.date.getTime()&&(i=t.max.date.getTime()>=n.date.getTime()),i}function e(i,r,u,e){for(var s="",o,h;o=f(u).exec(i);)if(r===undefined)if(t[o[0]])s+="("+t[o[0]][0]+")";else switch(o[0]){case"[":s+="(";break;case"]":s+=")?";break;default:s+=n.escapeRegex(o[0])}else t[o[0]]?e!==!0&&t[o[0]][3]?(h=t[o[0]][3],s+=h.call(r.date)):s+=t[o[0]][2]?r["raw"+t[o[0]][2]]:o[0]:s+=o[0];return s}function i(n,t){for(n=String(n),t=t||2;n.length<t;)n="0"+n;return n}function r(n,i,r){function a(n){var i=n.replace(/[^0-9]/g,"0");if(i!=n){var t=n.replace(/[^0-9]/g,""),f=(r.min&&r.min[u]||n).toString(),e=(r.max&&r.max[u]||n).toString();i=t+(t<f.slice(0,t.length)?f.slice(t.length):t>e.slice(0,t.length)?e.slice(t.length):i.toString().slice(t.length))}return i}function v(n,t){n[u]=a(t);n["raw"+u]=t;s!==undefined&&s.call(n.date,u=="month"?parseInt(n[u])-1:n[u])}var c={date:new Date(1,0,1)},u,e=n,o,s,l,h;if(typeof e=="string"){while(o=f(r).exec(i))h=e.slice(0,o[0].length),t.hasOwnProperty(o[0])&&(l=t[o[0]][0],u=t[o[0]][2],s=t[o[0]][1],v(c,h,r)),e=e.slice(h.length);return c}return e&&typeof e=="object"&&e.hasOwnProperty("date")?e:undefined}var o=n.dependencyLib,t={d:["[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",Date.prototype.getDate],dd:["0[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",function(){return i(Date.prototype.getDate.call(this),2)}],ddd:[""],dddd:[""],m:["[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return Date.prototype.getMonth.call(this)+1}],mm:["0[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return i(Date.prototype.getMonth.call(this)+1,2)}],mmm:[""],mmmm:[""],yy:["[0-9]{2}",Date.prototype.setFullYear,"year",function(){return i(Date.prototype.getFullYear.call(this),2)}],yyyy:["[0-9]{4}",Date.prototype.setFullYear,"year",function(){return i(Date.prototype.getFullYear.call(this),4)}],h:["[1-9]|1[0-2]",Date.prototype.setHours,"hours",Date.prototype.getHours],hh:["0[1-9]|1[0-2]",Date.prototype.setHours,"hours",function(){return i(Date.prototype.getHours.call(this),2)}],hhh:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],H:["1?[0-9]|2[0-3]",Date.prototype.setHours,"hours",Date.prototype.getHours],HH:["[01][0-9]|2[0-3]",Date.prototype.setHours,"hours",function(){return i(Date.prototype.getHours.call(this),2)}],HHH:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],M:["[1-5]?[0-9]",Date.prototype.setMinutes,"minutes",Date.prototype.getMinutes],MM:["[0-5][0-9]",Date.prototype.setMinutes,"minutes",function(){return i(Date.prototype.getMinutes.call(this),2)}],s:["[1-5]?[0-9]",Date.prototype.setSeconds,"seconds",Date.prototype.getSeconds],ss:["[0-5][0-9]",Date.prototype.setSeconds,"seconds",function(){return i(Date.prototype.getSeconds.call(this),2)}],l:["[0-9]{3}",Date.prototype.setMilliseconds,"milliseconds",function(){return i(Date.prototype.getMilliseconds.call(this),3)}],L:["[0-9]{2}",Date.prototype.setMilliseconds,"milliseconds",function(){return i(Date.prototype.getMilliseconds.call(this),2)}],t:["[ap]"],tt:["[ap]m"],T:["[AP]"],TT:["[AP]M"],Z:[""],o:[""],S:[""]},u={isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};return n.extendAliases({datetime:{mask:function(n){return t.S=n.i18n.ordinalSuffix.join("|"),n.inputFormat=u[n.inputFormat]||n.inputFormat,n.displayFormat=u[n.displayFormat]||n.displayFormat||n.inputFormat,n.outputFormat=u[n.outputFormat]||n.outputFormat||n.inputFormat,n.placeholder=n.placeholder!==""?n.placeholder:n.inputFormat.replace(/[\[\]]/,""),n.regex=e(n.inputFormat,undefined,n),null},placeholder:"",inputFormat:"isoDateTime",displayFormat:undefined,outputFormat:undefined,min:null,max:null,i18n:{dayNames:["Mon","Tue","Wed","Thu","Fri","Sat","Sun","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],ordinalSuffix:["st","nd","rd","th"]},postValidation:function(n,t,i,u){u.min=r(u.min,u.inputFormat,u);u.max=r(u.max,u.inputFormat,u);var f=i,o=r(n.join(""),u.inputFormat,u);return(f&&o.date.getTime()===o.date.getTime()&&(f=s(o,f),f=f&&h(o,u)),t&&f&&i.pos!==t)?{buffer:e(u.inputFormat,o,u),refreshFromBuffer:{start:t,end:i.pos}}:f},onKeyDown:function(t,r,u,e){var l=this,c,s,h;if(t.ctrlKey&&t.keyCode===n.keyCode.RIGHT){for(c=new Date,h="";s=f(e).exec(e.inputFormat);)s[0].charAt(0)==="d"?h+=i(c.getDate(),s[0].length):s[0].charAt(0)==="m"?h+=i(c.getMonth()+1,s[0].length):s[0]==="yyyy"?h+=c.getFullYear().toString():s[0].charAt(0)==="y"&&(h+=i(c.getYear(),s[0].length));l.inputmask._valueSet(h);o(l).trigger("setvalue")}},onUnMask:function(n,t,i){return e(i.outputFormat,r(n,i.inputFormat,i),i,!0)},casing:function(n,t){return t.nativeDef.indexOf("[ap]")==0?n.toLowerCase():t.nativeDef.indexOf("[AP]")==0?n.toUpperCase():n},insertMode:!1,shiftPositions:!1}}),n})