@progress/kendo-dateinputs-common 0.2.0-dev.202301130811 → 0.2.0-dev.202301131210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoDateinputsCommon=e():t.KendoDateinputsCommon=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(2),o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(!i.length)return t;var u=i.shift();if(o(t)&&o(u))for(var l in u)a(u[l])?t[l]=u[l]:o(u[l])?(t[l]||e.extend(t,((n={})[l]={},n)),e.deepExtend(t[l],u[l])):e.extend(t,((r={})[l]=u[l],r));return e.deepExtend.apply(void 0,[t].concat(i))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(r="setFullYear",function(t,e){var n=i.cloneDate(t);return n[r](e),n}),e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,r,i,o,a,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==o||t.getSeconds()!==a||t.getMilliseconds()!==s)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";n.r(e),n.d(e,"addCenturies",(function(){return f})),n.d(e,"addDays",(function(){return a})),n.d(e,"addDecades",(function(){return d})),n.d(e,"addMonths",(function(){return l})),n.d(e,"addWeeks",(function(){return p})),n.d(e,"addYears",(function(){return c})),n.d(e,"adjustDST",(function(){return o})),n.d(e,"cloneDate",(function(){return i})),n.d(e,"MS_PER_MINUTE",(function(){return m})),n.d(e,"MS_PER_HOUR",(function(){return g})),n.d(e,"MS_PER_DAY",(function(){return v})),n.d(e,"createDate",(function(){return s})),n.d(e,"dayOfWeek",(function(){return D})),n.d(e,"Day",(function(){return y})),n.d(e,"Direction",(function(){return r})),n.d(e,"durationInCenturies",(function(){return M})),n.d(e,"durationInDecades",(function(){return w})),n.d(e,"durationInMonths",(function(){return P})),n.d(e,"durationInYears",(function(){return C})),n.d(e,"firstDayInWeek",(function(){return T})),n.d(e,"firstDayOfMonth",(function(){return O})),n.d(e,"firstDecadeOfCentury",(function(){return E})),n.d(e,"firstMonthOfYear",(function(){return I})),n.d(e,"firstYearOfDecade",(function(){return S})),n.d(e,"getDate",(function(){return x})),n.d(e,"isEqual",(function(){return F})),n.d(e,"isEqualDate",(function(){return j})),n.d(e,"lastDayOfMonth",(function(){return u})),n.d(e,"lastDecadeOfCentury",(function(){return k})),n.d(e,"lastMonthOfYear",(function(){return V})),n.d(e,"lastYearOfDecade",(function(){return U})),n.d(e,"nextDayOfWeek",(function(){return N})),n.d(e,"prevDayOfWeek",(function(){return A})),n.d(e,"abbrTimezone",(function(){return Q})),n.d(e,"loadTimezone",(function(){return X})),n.d(e,"offset",(function(){return $})),n.d(e,"timezoneGroupNames",(function(){return tt})),n.d(e,"timezoneNames",(function(){return et})),n.d(e,"timezoneTitle",(function(){return nt})),n.d(e,"toLocalDate",(function(){return rt})),n.d(e,"ZonedDate",(function(){return ft})),n.d(e,"zonesPerGroup",(function(){return dt})),n.d(e,"weekInYear",(function(){return mt}));var r,i=function(t){return t?new Date(t.getTime()):null},o=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},a=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),o(n,t.getHours())},s=function(t,e,n,r,i,a,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=0);var u=new Date(t,e,n,r,i,a,s);return t>-1&&t<100&&u.setFullYear(u.getFullYear()-1900),o(u,r)},u=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return a(e,-1)},l=function(t,e){var n=i(t),r=(12+(n.getMonth()+e)%12)%12;return n.setMonth(n.getMonth()+e),function(t,e){return t.getMonth()!==e?u(l(t,-1)):t}(o(n,t.getHours()),r)},h=function(t,e){var n=t.getMonth(),r=s(e,n,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getMonth()===n?r:u(l(r,-1))},c=function(t,e){return o(h(t,t.getFullYear()+e),t.getHours())},f=function(t,e){return c(t,100*e)},d=function(t,e){return c(t,10*e)},p=function(t,e){return a(t,7*e)},m=6e4,g=36e5,v=864e5;!function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"}(r||(r={}));var y,D=function(t,e,n){void 0===n&&(n=r.Forward);var a=i(t),s=(e-a.getDay()+7*n)%7;return a.setDate(a.getDate()+s),o(a,t.getHours())};!function(t){t[t.Sunday=0]="Sunday",t[t.Monday=1]="Monday",t[t.Tuesday=2]="Tuesday",t[t.Wednesday=3]="Wednesday",t[t.Thursday=4]="Thursday",t[t.Friday=5]="Friday",t[t.Saturday=6]="Saturday"}(y||(y={}));var b=function(t,e){return h(t,e(t.getFullYear()))},E=function(t){return b(t,(function(t){return t-t%100}))},M=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},w=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},P=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},C=function(t,e){return e.getFullYear()-t.getFullYear()},T=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},O=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},_=function(t,e){var n=t.getDate(),r=s(t.getFullYear(),e,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getDate()===n?r:u(l(r,-1))},I=function(t){return _(t,0)},x=function(t){return s(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0)},F=function(t,e){return!t&&!e||t&&e&&t.getTime()===e.getTime()},j=function(t,e){return!t&&!e||t&&e&&F(x(t),x(e))},k=function(t){return b(t,(function(t){return t-t%100+90}))},V=function(t){return _(t,11)},U=function(t){return b(t,(function(t){return t-t%10+9}))},N=function(t,e){return D(t,e,r.Forward)},A=function(t,e){return D(t,e,r.Backward)},L={rules:{},titles:{},zones:{}},Y={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},H={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},K=function(t,e,n){var r,i=e[3],o=e[4],a=e[5],s="u"===a[3]?6e4*-n:0;if(isNaN(o)){if(0===o.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,a[0]-24,a[1],a[2])+s);var u=H[o.substr(4,3)],l=r.getUTCDay();r.setUTCDate(r.getUTCDate()+u-l-(u>l?7:0))}else if(o.indexOf(">=")>=0){r=new Date(Date.UTC(t,Y[i],o.substr(5),a[0],a[1],a[2],0)+s);u=H[o.substr(0,3)],l=r.getUTCDay();r.setUTCDate(r.getUTCDate()+u-l+(u<l?7:0))}}else r=new Date(Date.UTC(t,Y[i],o,a[0],a[1],a[2])+s);return r},W=(new Date).getTime(),R=function(t,e,n){void 0===e&&(e=W),void 0===n&&(n=0);var r=L.rules[t];if(!r){var i=t.split(":"),o=0;return i.length>1&&(o=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"]}var a=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=a&&(n>=a||e===a&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(a,t,n))),"number"!=typeof e&&(e=Number(K(a,e,n))),t-e}));var s=r[r.indexOf(e)-1]||r[r.length-1];return isNaN(s)?s:null},z="The required {0} timezone information is not provided!",B=/\{(\d+)}?\}/g,Z=function(t){return t.reduce((function(t,e){return t.concat(e)}),[])},G=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Z(e);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},J=function(t,e){if(void 0===e&&(e=(new Date).getTime()),"Etc/UTC"===t||"Etc/GMT"===t)return[0,"-","UTC",null];for(var n=function(t){var e=L.zones;if(!e)throw new Error(G(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(G(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var o=n[r+1];if(!o)throw new Error(G(z,t));return o},q=function(t,e){var n=e.getTime(),r=J(t,n);return{rule:R(r[1],n,r[0]),zone:r}},Q=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t)return"UTC";if("Etc/GMT"===t)return"GMT";if(""===t)return"";var n=q(t,e),r=n.zone,i=n.rule,o=r[2];return o.indexOf("/")>=0?o.split("/")[i&&+i[6]?1:0]:o.indexOf("%s")>=0?o.replace("%s",i&&"-"!==i[7]?i[7]:""):o},X=function(t){if(!t)throw new Error(G(z,""));var e=t.rules,n=t.titles,r=t.zones;if(void 0===e||void 0===r)throw new Error("The provided timezone information has invalid stucture!");Object.assign(L.rules,e),Object.assign(L.titles,n||{}),Object.assign(L.zones,r)},$=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t||"Etc/GMT"===t)return 0;if(""===t)return e.getTimezoneOffset();var n=q(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},tt=function(){var t=Object.keys(L.titles).reduce((function(t,e){var n=L.titles[e].group;return t[n]=n,t}),{});return Object.keys(t)},et=function(){return Object.keys(L.zones)},nt=function(t){return(L.titles[t]||{}).long||t};function rt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var it=function(t,e){return new Date(t.getTime()+e*m)},ot=function(t,e){return new Date(t.getTime()+e*g)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dev"],ut=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)};function lt(t,e){var n=$(e,t),r=ot(t,-1);return n<$(e,r)}function ht(t,e){var n=lt(t,e)?1:0;return ot(t,n)}function ct(t,e,n){if(e===n)return t;var r=$(e,t),i=$(n,t),o=r-i,a=it(t,o),s=$(n,a);return it(t,o+(i-s))}var ft=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=$(e,t);this.timezoneOffset=n;var r=ht(t,e);this._localDate=ct(r,e,"Etc/UTC")}return Object.defineProperty(t.prototype,"cachedLocalDate",{get:function(){return this._localDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cachedUTCDate",{get:function(){return this._utcDate},enumerable:!0,configurable:!0}),t.fromLocalDate=function(e,n){void 0===n&&(n="");var r=ct(e,"Etc/UTC",n),i=lt(r,n),o=$(n,r),a=0;i&&(a=o>0?-1:1);var s=ot(r,a);return t.fromUTCDate(s,n)},t.fromUTCDate=function(e,n){return void 0===n&&(n=""),new t(e,n)},t.prototype.toLocalDate=function(){return i(this._localDate)},t.prototype.toUTCDate=function(){return i(this._utcDate)},t.prototype.toTimezone=function(e){if(this.timezone===e)return this.clone();var n=$(this.timezone,this._utcDate),r=it(this._utcDate,n);return t.fromLocalDate(r,e)},t.prototype.clone=function(){return t.fromUTCDate(this._utcDate,this.timezone)},t.prototype.addDays=function(e){var n=new Date(this._utcDate.getTime());return n.setUTCDate(n.getUTCDate()+e),t.fromUTCDate(n,this.timezone)},t.prototype.addTime=function(e){var n=ht(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=ht(n,this.timezone);return t.fromUTCDate(r,this.timezone)},t.prototype.stripTime=function(){var e=this._utcDate,n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0);return t.fromUTCDate(new Date(n),this.timezone)},t.prototype.getTime=function(){return this._localDate.getTime()},t.prototype.getTimezoneOffset=function(){return this.timezoneOffset},t.prototype.getFullYear=function(){return this._utcDate.getUTCFullYear()},t.prototype.getMonth=function(){return this._utcDate.getUTCMonth()},t.prototype.getDate=function(){return this._utcDate.getUTCDate()},t.prototype.getDay=function(){return this._utcDate.getUTCDay()},t.prototype.getHours=function(){return this._utcDate.getUTCHours()},t.prototype.getMinutes=function(){return this._utcDate.getUTCMinutes()},t.prototype.getSeconds=function(){return this._utcDate.getUTCSeconds()},t.prototype.getMilliseconds=function(){return this._utcDate.getUTCMilliseconds()},t.prototype.getUTCDate=function(){return this._localDate.getUTCDate()},t.prototype.getUTCDay=function(){return this._localDate.getUTCDay()},t.prototype.getUTCFullYear=function(){return this._localDate.getUTCFullYear()},t.prototype.getUTCHours=function(){return this._localDate.getUTCHours()},t.prototype.getUTCMilliseconds=function(){return this._localDate.getUTCMilliseconds()},t.prototype.getUTCMinutes=function(){return this._localDate.getUTCMinutes()},t.prototype.getUTCMonth=function(){return this._localDate.getUTCMonth()},t.prototype.getUTCSeconds=function(){return this._localDate.getUTCSeconds()},t.prototype.setTime=function(t){throw new Error("Method not implemented.")},t.prototype.setMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setUTCHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setDate=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCDate=function(t){throw new Error("Method not implemented.")},t.prototype.setMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.toISOString=function(){return this._localDate.toISOString()},t.prototype.toJSON=function(){return this._localDate.toJSON()},t.prototype.toString=function(){var t,e=(t=this._utcDate,at[t.getUTCDay()]+" "+st[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return rt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=ut(this.getHours())+":"+ut(this.getMinutes())+":"+ut(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+ut(Math.floor(n/60))+ut(n%60)}(this.timezoneOffset),n=Q(this.timezone,this._utcDate);return n&&(n=" ("+n+")"),t+" "+e+n},t.prototype.toLocaleString=function(t,e){return this._localDate.toLocaleString(t,e)},t.prototype.toLocaleDateString=function(t,e){return this._localDate.toLocaleDateString(t,e)},t.prototype.toLocaleTimeString=function(t,e){return this._localDate.toLocaleTimeString(t,e)},t.prototype.toUTCString=function(){return this.toTimezone("Etc/UTC").toString()},t.prototype[Symbol.toPrimitive]=function(t){return"string"===t||"default"===t?this.toString():this._localDate.getTime()},t.prototype.valueOf=function(){return this.getTime()},t.prototype.getVarDate=function(){throw new Error("Not implemented.")},t.prototype.format=function(t){throw new Error("Not implemented.")},t.prototype.formatUTC=function(t){throw new Error("Not implemented.")},t}(),dt=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},pt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?a(A(t,e),4):a(t,4-(t.getDay()||7))}(t,e).getTime()-n.getTime(),i=Math.floor(r/v);return 1+Math.floor(i/7)},mt=function(t,e){void 0===e&&(e=y.Monday),t=x(t);var n=a(t,-7),r=a(t,7),i=pt(t,e);return 0===i?pt(n,e)+1:53===i&&pt(r,e)>1?1:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(4);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,o=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,u=t.keyEvent,l=e[a+e.length-n.length],h=e.substring(0,a+e.length-n.length),c=n.substring(0,a),f=[];if(h===c&&a>0)return f.push([o[a-1],c[a-1]]),f;if(0===h.indexOf(c)&&s&&(u.key===i.Key.DELETE||u.key===i.Key.BACKSPACE)||0===h.indexOf(c)&&!s&&(0===c.length||o[c.length-1]!==o[c.length])){var d="";s||1!==c.length||f.push([o[0],c[0]]);for(var p=c.length;p<h.length;p++)o[p]!==d&&o[p]!==r.Constants.formatSeparator&&(d=o[p],f.push([d,""]));return f}if(s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)){var m=o[0];for(p=Math.max(0,h.length-1);p<o.length;p++)if(o[p]!==r.Constants.formatSeparator){m=o[p];break}return[[m,c[a-1]]]}return!s&&" "===c[c.length-1]||!s&&c[c.length-1]===l?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],c[a-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6);e.DateInput=r.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(7),o=n(8),a=n(3),s=n(10),u=n(4),l=n(1),h=n(11),c=n(12),f=n(2),d=n(0),p={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(r={},r.valueChange=null,r.input=null,r.inputEnd=null,r.focus=null,r.focusEnd=null,r.blur=null,r.blurEnd=null,r.keydown=null,r.mousewheel=null,r.change=null,r),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:d.Constants.twoDigitYearMax,autoCorrectParts:!0},m=function(t){function e(e,n){var r=t.call(this,n)||this;return r.dateObject=null,r.currentText="",r.currentFormat="",r.interactionMode=c.DateInputInteractionMode.None,r.previousElementSelection={start:0,end:0},r.init(e,n),r}return i.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var n=l.isValidDate(this.options.value)?f.cloneDate(this.options.value):new Date(e.formattedValue);l.isValidDate(n)||(n=null),this.element=t,this.options=l.extend({},p,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=l.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,r=l.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,i=!n&&r?0:this.caret()[0];this.selectNearestSegment(i)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===s.KeyCode.BACKSPACE||e.key===u.Key.BACKSPACE,r=e.keyCode===s.KeyCode.DELETE||e.key===u.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var i=this.interactionMode;!this.options.allowCaretMode||i===c.DateInputInteractionMode.Caret||r||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var o=this.isInCaretMode();if(o&&this.keyDownEvent.key===u.Key.SPACE)this.restorePreviousInputEventState();else{var h=this.dateObject&&this.dateObject.getValue(),p=this.dateObject.getTextAndFormat(),m=p.text,g=p.format;this.currentFormat=g;var v="";v=o&&(n||r||i===c.DateInputInteractionMode.Caret)?this.previousElementValue:m;var y=this.elementValue,D=a.approximateStringMatching({oldText:v,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:o,keyEvent:this.keyDownEvent});if(!o||D&&0!==D.length){if(o&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(o&&D[0]&&(D[0][0]===d.Constants.formatSeparator||D[0][1]===d.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var b=1===D.length&&D[0][1]===d.Constants.formatSeparator,E=[],M=!1;if(!b)for(var S=0;S<D.length;S++){var w=this.dateObject.parsePart({symbol:D[S][0],currentChar:D[S][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||r,originalFormat:this.currentFormat});E.push(w),M=w.switchToNext}this.options.autoSwitchParts||(M=!1),this.resetSegmentValue=!1;var P,C=E[E.length-1],T=C&&!C.value,O=o&&(n||r)&&T,_=!!C&&C.resetPart,I=!f.isEqual(h,this.dateObject.value),x=this.selection;(!o||O||_)&&(_&&(P=this.currentFormat[x.start]),this.forceUpdate()),D.length&&D[0][0]!==d.Constants.formatSeparator&&(!o||O||_?P?this.setSelection(this.selectionBySymbol(P)):(this.options.autoSwitchParts||D[0][1]!==d.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0])):o&&(this.options.format.length!==this.currentFormat.length?I&&l.isPresent(this.dateObject.getValue())&&M&&this.switchDateSegment(1):I?T&&this.restorePreviousInputEventState():this.restorePreviousInputEventState())),M||!o||n||r||_||!T?this.options.autoSwitchParts&&(M||b)&&(o||this.switchDateSegment(1)):I?this.currentFormat.length===this.elementValue.length||o&&i!==c.DateInputInteractionMode.Caret&&I||(o&&i!==c.DateInputInteractionMode.Caret?(P=this.currentFormat[x.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(P))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:h,event:t}),this.triggerInputEnd({event:t}),o&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,r=e.end;this.previousElementSelection={start:n,end:r};var i=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(i.indexOf(t.keyCode.toString())>=0||i.indexOf(t.keyCode)>=0||i.indexOf(t.key.toLowerCase().trim())>=0){var o=i.indexOf(u.Key.TAB.toLowerCase().trim())>=0||i.indexOf(s.KeyCode.TAB)>=0||i.indexOf(s.KeyCode.TAB.toString())>=0;if(!o)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,l=a.start,h=a.end;if(t.shiftKey&&o?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],f=this.getStepFromSymbol(c),d=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(f,c,event),d=!0;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-f,c,event),d=!0;break;case s.KeyCode.ENTER:break;case s.KeyCode.DELETE:case s.KeyCode.BACKSPACE:if(this.options.allowNulls){var p=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:p,event:t})}return d=!0,void(t.keyCode===s.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(s.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(u.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case u.Key.HOME:this.selectNearestSegment(0);break;case u.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;l.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:d.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:d.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,r=t-1;n<this.currentFormat.length||r>=0;n++,r--){if(n<this.currentFormat.length&&this.currentFormat[n]!==d.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==d.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[r]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,r=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)],i="",o="";if(t<0){for(var a=0;a<n+t;a++)if((o=this.currentFormat[a])!==d.Constants.formatSeparator&&o!==r){n=a,i=o;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((o=this.currentFormat[a])!==d.Constants.formatSeparator&&o!==r){n=a,i=o;break}if(i)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(i)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}var s=this.selection,u=s.start,l=s.end;if(u<l&&this.currentFormat[u]!==this.currentFormat[l-1])return this.setSelection(this.selectionByIndex(t>0?u:l-1)),void(this.resetSegmentValue=!0);for(var h=this.currentFormat[u],f=u+t;f>0&&f<this.currentFormat.length&&(this.currentFormat[f]===h||this.currentFormat[f]===d.Constants.formatSeparator);)f+=t;if(this.currentFormat[f]!==d.Constants.formatSeparator){for(var p=f;p>=0&&p<this.currentFormat.length&&this.currentFormat[p]===this.currentFormat[f];)p+=t;f>p&&(p+1!==u||f+1!==l)?(this.setSelection({start:p+1,end:f+1}),this.resetSegmentValue=!0):f<p&&(f!==u||p!==l)&&(this.setSelection({start:f,end:p}),this.resetSegmentValue=!0)}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var r=this.value,i=1*t,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&!this.options.steps.millisecond){var a=l.millisecondDigitsInFormat(this.inputFormat);i=l.millisecondStepFor(a)}this.dateObject.modifyPart(e,i),this.tryTriggerValueChange({oldValue:r,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!f.isEqual(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger("valueChange",l.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",l.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("inputEnd",l.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",l.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",l.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",l.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",l.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",l.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",l.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",l.extend({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!l.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,r=this.dateObject.getTextAndFormat(n),i=r.text,o=r.format;this.currentFormat=o,this.currentText=i;var a=!this.isActive&&l.isPresent(this.options.placeholder)&&!this.dateObject.hasValue();l.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var s=a?"":i;this.previousElementValue=this.elementValue,this.setElementValue(s),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,r=[t,t],i=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==i.selectionStart&&(n&&(l.isDocumentAvailable()&&document.activeElement!==i&&i.focus(),i.setSelectionRange(t,e)),r=[i.selectionStart,i.selectionEnd])}catch(t){r=[]}return r}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new o.DateObject(l.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(h.Observable);e.DateInput=m},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return l})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return c})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return y})),n.d(e,"__await",(function(){return D})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return E})),n.d(e,"__asyncValues",(function(){return M})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return P})),n.d(e,"__importDefault",(function(){return C})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return O})),n.d(e,"__classPrivateFieldIn",(function(){return _}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var f=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||f(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function y(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function D(t){return this instanceof D?(this.v=t,this):new D(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof D?Promise.resolve(n.value.v).then(u,l):h(o[0][2],n)}catch(t){h(o[0][3],t)}var n}function u(t){s("next",t)}function l(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function E(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:D(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function M(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var w=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&f(e,t,n);return w(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function O(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function _(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(9),o=n(3),a=n(1),s=n(0),u=/d|M|H|h|m|s/,l=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,o=t.cycleTime,a=void 0!==o&&o,u=t.twoDigitYearMax,l=void 0===u?s.Constants.twoDigitYearMax:u,h=t.value,c=void 0===h?null:h,f=t.autoCorrectParts,d=void 0===f||f;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=r.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=l,this.autoCorrectParts=d,c)this._value=r.cloneDate(c);else{this._value=r.getDate(new Date);for(var p=this.dateFormatString(this.value,this.format).symbols,m=0;m<p.length;m++)this.setExisting(p[m],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=s.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var r=e[n],i=this.intl.cldr[r];if(i.name&&i.calendar&&i.numbers&&i.name!==s.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?r.isEqual(t,this._value)||(this._value=r.cloneDate(t),this.modifyExisting(!0)):(this._value=r.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return r.cloneDate(this.value)},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),r=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,e,this.localeId),u=this.getFormattedInvalidDates(e),l=0;l<s.length;l++){var h=r.symbols[l];if("literal"===r.partMap[l].type)i+=n[l];else if(this.getInvalidDatePartValue(h)){var c=this.getPartsForSegment(r,l);if("M"===h){var f=(a.parseToInt(this.getInvalidDatePartValue(h))+1).toString();if(c.length>2)i+=u[h][l];else if(this.getInvalidDatePartValue(h))i+=o.padZero(c.length-f.length)+f,l+=c.length-1;else i+=u[h][l]}else if(this.getInvalidDatePartValue(h)){f=this.getInvalidDatePartValue(h).toString();i+=o.padZero(c.length-f.length)+f,l+=c.length-1}else i+=u[h][l]}else i+=n[l]}n=i}return this.merge(n,r)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,r={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var i=e.getInvalidDatePart(t).date;if(i){var o=e.intl.formatDate(i,n,e.localeId);r[t]=o}})),r},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,i=r.cloneDate(this.value),o=!1,s="M"===t,u="d"===t||"E"===t,l=this.getExisting(t);if(this.autoCorrectParts||!u&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=r.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),o=!0;break;case"m":i.setMinutes(i.getMinutes()+e),o=!0;break;case"s":i.setSeconds(i.getSeconds()+e),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),o=!0}else{var h=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),f=h.y.value||i.getFullYear(),d=h.M.value||i.getMonth(),p=h.d.value||h.E.value||i.getDate(),m=h.h.value||h.H.value||i.getHours(),g=h.m.value||i.getMinutes(),v=h.s.value||i.getSeconds(),y=h.S.value||i.getMilliseconds();switch(t){case"y":f+=e;break;case"M":d+=e;break;case"d":case"E":p+=e}if("M"===t){if((d<0||d>11)&&l)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!l){if(d<0)d=a.clamp(d%11+1+11,0,11);else{var D=a.isPresent(c)?d:(e-1)%12;d=a.clamp(D,0,11)}d=a.clamp(d,0,11)}d=a.clamp(d,0,11)}else if("d"===t)if(l){if(p<=0||p>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!l){if(a.isPresent(c)&&(p<=0||p>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var b=a.isPresent(c)?p:31-Math.abs(e%31)+1;p=a.clamp(b,1,31)}else{b=a.isPresent(c)?p:e%31;p=a.clamp(b,1,31)}p=a.clamp(p,1,31)}var E=r.createDate(f,d,p,m,g,v,y),M=s||u?this.modifyDateSymbolWithValue(i,t,s?d:p):null,S=a.areDatePartsEqualTo(E,f,d,p,m,g,v,y);this.getValue()&&a.areDatePartsEqualTo(E,f,d,p,m,g,v,y)?(i=r.cloneDate(E),this.markDatePartsAsExisting()):s&&M?M.getMonth()===d?this.getExisting("d")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(this.resetInvalidDateSymbol(t),i=r.cloneDate(E),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(M)):(n=!0,this.setInvalidDatePart(t,{value:d,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):u&&M&&(M.getDate()===p?this.getExisting("M")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(M)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(this.value),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),o&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,i=t.currentChar,s=t.resetSegmentValue,u=t.cycleSegmentValue,l=t.rawTextValue,h=t.isDeleting,c=t.originalFormat,f=!u,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=0;m<p.length;m++){for(var g=p[m],v=0;v<g.pattern.length;v++)p[m+v]&&(p[m+v].literal=g.pattern[v]);m+=g.pattern.length-1}var y={value:null,switchPart:!1,resetPart:f&&"M"===n&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2}))};if(!i){if(!f)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(m=0;m<p.length;m++){var D=p[m].literal,b=l.startsWith(D),E=l.endsWith(D),M=l.indexOf(D+D)>=0;if(b||E||M)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),w=d.symbols,P=!1,C="",T="",O="",_="",I="",x="",F=c.indexOf(n),j=c.lastIndexOf(n)-F+1,k=this.format===w||this.format===c||this.format.length===c.length;if(f){var V=0;for(m=0;m<S.length;m++){if(w[m]===n)T+=this.getExisting(n)?S[m]:"0",h?(V<j-1&&(O+=l[m]||""),V++):O+=l[m]||"",P=!0;else P?(x+=S[m],I+=S[m]):(C+=S[m],_+=S[m])}if(k){if(c.length<l.length&&(O+=i),O.length>j)return a.extend(y,{value:null,switchToNext:!1})}else{V=0,T="",O="",C="",x="",P=!1;for(m=0;m<c.length;m++){if(c[m]===n)T+=this.getExisting(n)?S[m]||"":"0",h?(V<j-1&&(O+=l[m]||""),V++):O+=l[m]||"",P=!0;else P?x+=l[m]||"":C+=l[m]||""}c.length<l.length&&(O+=i)}}else for(m=0;m<S.length;m++){if(w[m]===n)T+=this.getExisting(n)?S[m]:"0",P=!0;else P?x+=S[m]:C+=S[m]}var U=null,N=this.matchMonth(i),A=this.matchDayPeriod(i,n),L="0"===i,Y=this.leadingZero||{};L&&!f?0!==parseInt(s?i:T+i,10)||this.isAbbrMonth(d.partMap,n)||this.incrementLeadingZero(n):this.resetLeadingZero();var H=this.partPattern(d.partMap,n),K=H?H.pattern:null;if(f&&h&&!O)return this.setExisting(n,!1),a.extend(y,{value:null,switchToNext:!1});var W=T.length-3,R=!0;for(m=Math.max(0,W);m<=T.length&&R;m++){this.autoCorrectParts||(R=!1);var z=s?i:f?O:T.substring(m)+i;f&&(R=!1,z=o.unpadZero(z));var B=parseInt(z,10),Z=C+z+x;U=this.intl.parseDate(Z,this.format,this.localeId),!f||k||a.isValidDate(U)||(U=this.intl.parseDate(_+z+I,this.format,this.localeId),O=z);var G=!isNaN(parseInt(i,10))||f&&h&&""===i;if(!U&&!isNaN(B)&&G){if("M"===n&&!N){var J=B-1;J>-1&&J<12&&((U=r.cloneDate(this.value)).setMonth(J),U.getMonth()!==J&&(U=r.lastDayOfMonth(r.addMonths(U,-1))))}"y"===n&&(U=r.createDate(parseInt(z,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(f&&a.isValidDate(U)||!f&&U)&&this.date&&U.getDate()!==this.value.getDate()&&(U=r.lastDayOfMonth(r.addMonths(U,-1))))}if(f&&a.isValidDate(U)||!f&&U){var q=this.intl.parseDate(""+C+this.peek(z,K)+x,this.format,this.localeId),Q=this.patternLength(K)||K.length,X=((this.leadingZero||{})[n]||0)+(o.unpadZero(z)||i).length>=Q,$=null===q||Y[n]&&K.length<=z.length||X;if(this.shouldNormalizeCentury()&&(U=this.normalizeCentury(U)),this._value=U,this.setExisting(n,!0),f&&$)if("M"===n){if(j<=2)$=(tt=a.parseToInt(O))>=2}else $=$?k?O.length===j:O.length>j:$;return a.extend(y,{value:this.value,switchToNext:$})}}if(N&&(U=this.intl.parseDate(C+N+x,this.format,this.localeId)))return this._value=U,this.setExisting(n,!0),a.extend(y,{value:this.value,switchToNext:!1});if(A&&(U=this.intl.parseDate(C+A+x,this.format)))return this._value=U,a.extend(y,{value:this.value,switchToNext:!0});if(L&&(this.leadingZero=this.isAbbrMonth(d.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),f&&O.length>j)return a.extend(y,{value:null,switchToNext:!1});if(!this.autoCorrectParts){this.setExisting(n,!1);var tt=void 0,et=f?O:T,nt=a.parseToInt(et);if(a.isNumber(nt)&&(tt="M"===n?a.clamp(nt-1,0,11):nt),a.isNumber(tt)){var rt=this.modifyDateSymbolWithValue(this.value,n,tt);this.setExisting(n,!1),this.setInvalidDatePart(n,{value:tt,date:r.cloneDate(rt),startDate:this._partiallyInvalidDate.startDate||r.cloneDate(this.value)})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(o.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.normalizeCentury=function(t){if(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.setYears(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return o.padZero(e.length-n.length)+n},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(n>=1&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:u.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),r=[],o=[],a=0;a<n.length;a++)for(var u=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;u>0;)r.push(this.symbols[n[a].pattern[0]]||s.Constants.formatSeparator),o.push(n[a]),u--;var l=new i.Mask;return l.symbols=r.join(""),l.partMap=o,l},t.prototype.merge=function(t,e){for(var n="",r="",i=e.symbols,o=!1,s=0,u=this.getFormattedInvalidDates(i),l=i.length-1;l>=0;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(i[l])||this.getExisting(i[l]))this.autoCorrectParts?n=t[l]+n:t.length!==i.length?o?n=t[l]+n:s>0?(n=t[l]+n,--s<=0&&(o=!0)):n=(t[l+t.length-i.length]||"")+n:n=t[l]+n,r=i[l]+r;else{var c=i[l],f=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;l>=0&&c===i[l];)l--;l++}if(this.leadingZero&&this.leadingZero[c])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(c)){var d=this.getInvalidDatePartValue(c).toString();"M"===c?(d=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),h.length>2?n=u[c][l]+n:(n=(d=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,s=d.length-h.length)):(n=d+n,f=d.length-1,s=d.length-h.length)}else n=this.dateFieldName(e.partMap[l])+n;for(;r.length<n.length;)r=i[l]+r;0!==f&&(l=l-f+(t.length-i.length))}}return{text:n,format:r}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&a.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,r=void 0===n?null:n,i=e.date,o=void 0===i?null:i,a=e.startDateOffset,s=void 0===a?0:a,u=e.startDate,l=void 0===u?null:u;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=o,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=l)},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=r.cloneDate(t),o=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=r.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),o=!0;break;case"m":i.setMinutes(i.getMinutes()+n),o=!0;break;case"s":i.setSeconds(i.getSeconds()+n),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),o=!0}return{date:i,timeModified:o}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=r.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=r.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],r=[],i=e;i<t.partMap.length;i++){var o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.push(o)}for(i=e-1;i>=0;i--){o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.unshift(o)}return r},t}();e.DateObject=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){this.symbols="",this.partMap=[]};e.Mask=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i={events:{}},o=function(){function t(t){this.options=r.extend({},i,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!r.isFunction(this.options.events[t])&&(this.options.events[t](r.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KendoDateinputsCommon=e():t.KendoDateinputsCommon=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(2),o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,r,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(!i.length)return t;var u=i.shift();if(o(t)&&o(u))for(var l in u)a(u[l])?t[l]=u[l]:o(u[l])?(t[l]||e.extend(t,((n={})[l]={},n)),e.deepExtend(t[l],u[l])):e.extend(t,((r={})[l]=u[l],r));return e.deepExtend.apply(void 0,[t].concat(i))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(r="setFullYear",function(t,e){var n=i.cloneDate(t);return n[r](e),n}),e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,r,i,o,a,s){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==r||t.getHours()!==i||t.getMinutes()!==o||t.getSeconds()!==a||t.getMilliseconds()!==s)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";n.r(e),n.d(e,"addCenturies",(function(){return f})),n.d(e,"addDays",(function(){return a})),n.d(e,"addDecades",(function(){return d})),n.d(e,"addMonths",(function(){return l})),n.d(e,"addWeeks",(function(){return p})),n.d(e,"addYears",(function(){return c})),n.d(e,"adjustDST",(function(){return o})),n.d(e,"cloneDate",(function(){return i})),n.d(e,"MS_PER_MINUTE",(function(){return m})),n.d(e,"MS_PER_HOUR",(function(){return g})),n.d(e,"MS_PER_DAY",(function(){return v})),n.d(e,"createDate",(function(){return s})),n.d(e,"dayOfWeek",(function(){return D})),n.d(e,"Day",(function(){return y})),n.d(e,"Direction",(function(){return r})),n.d(e,"durationInCenturies",(function(){return M})),n.d(e,"durationInDecades",(function(){return w})),n.d(e,"durationInMonths",(function(){return P})),n.d(e,"durationInYears",(function(){return C})),n.d(e,"firstDayInWeek",(function(){return T})),n.d(e,"firstDayOfMonth",(function(){return O})),n.d(e,"firstDecadeOfCentury",(function(){return E})),n.d(e,"firstMonthOfYear",(function(){return I})),n.d(e,"firstYearOfDecade",(function(){return S})),n.d(e,"getDate",(function(){return x})),n.d(e,"isEqual",(function(){return F})),n.d(e,"isEqualDate",(function(){return j})),n.d(e,"lastDayOfMonth",(function(){return u})),n.d(e,"lastDecadeOfCentury",(function(){return k})),n.d(e,"lastMonthOfYear",(function(){return V})),n.d(e,"lastYearOfDecade",(function(){return U})),n.d(e,"nextDayOfWeek",(function(){return N})),n.d(e,"prevDayOfWeek",(function(){return A})),n.d(e,"abbrTimezone",(function(){return Q})),n.d(e,"loadTimezone",(function(){return X})),n.d(e,"offset",(function(){return $})),n.d(e,"timezoneGroupNames",(function(){return tt})),n.d(e,"timezoneNames",(function(){return et})),n.d(e,"timezoneTitle",(function(){return nt})),n.d(e,"toLocalDate",(function(){return rt})),n.d(e,"ZonedDate",(function(){return ft})),n.d(e,"zonesPerGroup",(function(){return dt})),n.d(e,"weekInYear",(function(){return mt}));var r,i=function(t){return t?new Date(t.getTime()):null},o=function(t,e){var n=i(t);return 0===e&&23===n.getHours()&&n.setHours(n.getHours()+2),n},a=function(t,e){var n=i(t);return n.setDate(n.getDate()+e),o(n,t.getHours())},s=function(t,e,n,r,i,a,s){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=0);var u=new Date(t,e,n,r,i,a,s);return t>-1&&t<100&&u.setFullYear(u.getFullYear()-1900),o(u,r)},u=function(t){var e=s(t.getFullYear(),t.getMonth()+1,1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return a(e,-1)},l=function(t,e){var n=i(t),r=(12+(n.getMonth()+e)%12)%12;return n.setMonth(n.getMonth()+e),function(t,e){return t.getMonth()!==e?u(l(t,-1)):t}(o(n,t.getHours()),r)},h=function(t,e){var n=t.getMonth(),r=s(e,n,t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getMonth()===n?r:u(l(r,-1))},c=function(t,e){return o(h(t,t.getFullYear()+e),t.getHours())},f=function(t,e){return c(t,100*e)},d=function(t,e){return c(t,10*e)},p=function(t,e){return a(t,7*e)},m=6e4,g=36e5,v=864e5;!function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"}(r||(r={}));var y,D=function(t,e,n){void 0===n&&(n=r.Forward);var a=i(t),s=(e-a.getDay()+7*n)%7;return a.setDate(a.getDate()+s),o(a,t.getHours())};!function(t){t[t.Sunday=0]="Sunday",t[t.Monday=1]="Monday",t[t.Tuesday=2]="Tuesday",t[t.Wednesday=3]="Wednesday",t[t.Thursday=4]="Thursday",t[t.Friday=5]="Friday",t[t.Saturday=6]="Saturday"}(y||(y={}));var b=function(t,e){return h(t,e(t.getFullYear()))},E=function(t){return b(t,(function(t){return t-t%100}))},M=function(t,e){return(E(e).getFullYear()-E(t).getFullYear())/100},S=function(t){return b(t,(function(t){return t-t%10}))},w=function(t,e){return(S(e).getFullYear()-S(t).getFullYear())/10},P=function(t,e){return 12*(e.getFullYear()-t.getFullYear())+(e.getMonth()-t.getMonth())},C=function(t,e){return e.getFullYear()-t.getFullYear()},T=function(t,e){void 0===e&&(e=y.Sunday);for(var n=i(t);n.getDay()!==e;)n.setDate(n.getDate()-1);return n},O=function(t){return s(t.getFullYear(),t.getMonth(),1,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},_=function(t,e){var n=t.getDate(),r=s(t.getFullYear(),e,n,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return r.getDate()===n?r:u(l(r,-1))},I=function(t){return _(t,0)},x=function(t){return s(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0)},F=function(t,e){return!t&&!e||t&&e&&t.getTime()===e.getTime()},j=function(t,e){return!t&&!e||t&&e&&F(x(t),x(e))},k=function(t){return b(t,(function(t){return t-t%100+90}))},V=function(t){return _(t,11)},U=function(t){return b(t,(function(t){return t-t%10+9}))},N=function(t,e){return D(t,e,r.Forward)},A=function(t,e){return D(t,e,r.Backward)},L={rules:{},titles:{},zones:{}},Y={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},H={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},K=function(t,e,n){var r,i=e[3],o=e[4],a=e[5],s="u"===a[3]?6e4*-n:0;if(isNaN(o)){if(0===o.indexOf("last")){r=new Date(Date.UTC(t,Y[i]+1,1,a[0]-24,a[1],a[2])+s);var u=H[o.substr(4,3)],l=r.getUTCDay();r.setUTCDate(r.getUTCDate()+u-l-(u>l?7:0))}else if(o.indexOf(">=")>=0){r=new Date(Date.UTC(t,Y[i],o.substr(5),a[0],a[1],a[2],0)+s);u=H[o.substr(0,3)],l=r.getUTCDay();r.setUTCDate(r.getUTCDate()+u-l+(u<l?7:0))}}else r=new Date(Date.UTC(t,Y[i],o,a[0],a[1],a[2])+s);return r},W=(new Date).getTime(),R=function(t,e,n){void 0===e&&(e=W),void 0===n&&(n=0);var r=L.rules[t];if(!r){var i=t.split(":"),o=0;return i.length>1&&(o=60*i[0]+Number(i[1])),[-1e6,"max","-","Jan",1,[0,0,0],o,"-"]}var a=new Date(e).getUTCFullYear();(r=r.filter((function(t){var e=t[0],n=t[1];return e<=a&&(n>=a||e===a&&"only"===n||"max"===n)}))).push(e),r.sort((function(t,e){return"number"!=typeof t&&(t=Number(K(a,t,n))),"number"!=typeof e&&(e=Number(K(a,e,n))),t-e}));var s=r[r.indexOf(e)-1]||r[r.length-1];return isNaN(s)?s:null},z="The required {0} timezone information is not provided!",B=/\{(\d+)}?\}/g,Z=function(t){return t.reduce((function(t,e){return t.concat(e)}),[])},G=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Z(e);return t.replace(B,(function(t,e){return r[parseInt(e,10)]}))},J=function(t,e){if(void 0===e&&(e=(new Date).getTime()),"Etc/UTC"===t||"Etc/GMT"===t)return[0,"-","UTC",null];for(var n=function(t){var e=L.zones;if(!e)throw new Error(G(z,t));var n=e[t],r="string"==typeof n?e[n]:n;if(!r)throw new Error(G(z,t));return r}(t),r=n.length-1;r>=0;r--){var i=n[r][3];if(i&&e>i)break}var o=n[r+1];if(!o)throw new Error(G(z,t));return o},q=function(t,e){var n=e.getTime(),r=J(t,n);return{rule:R(r[1],n,r[0]),zone:r}},Q=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t)return"UTC";if("Etc/GMT"===t)return"GMT";if(""===t)return"";var n=q(t,e),r=n.zone,i=n.rule,o=r[2];return o.indexOf("/")>=0?o.split("/")[i&&+i[6]?1:0]:o.indexOf("%s")>=0?o.replace("%s",i&&"-"!==i[7]?i[7]:""):o},X=function(t){if(!t)throw new Error(G(z,""));var e=t.rules,n=t.titles,r=t.zones;if(void 0===e||void 0===r)throw new Error("The provided timezone information has invalid stucture!");Object.assign(L.rules,e),Object.assign(L.titles,n||{}),Object.assign(L.zones,r)},$=function(t,e){if(void 0===e&&(e=new Date),"Etc/UTC"===t||"Etc/GMT"===t)return 0;if(""===t)return e.getTimezoneOffset();var n=q(t,e),r=n.rule,i=n.zone;return parseFloat(r?i[0]-r[6]:i[0])},tt=function(){var t=Object.keys(L.titles).reduce((function(t,e){var n=L.titles[e].group;return t[n]=n,t}),{});return Object.keys(t)},et=function(){return Object.keys(L.zones)},nt=function(t){return(L.titles[t]||{}).long||t};function rt(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}var it=function(t,e){return new Date(t.getTime()+e*m)},ot=function(t,e){return new Date(t.getTime()+e*g)},at=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dev"],ut=function(t,e){return void 0===e&&(e=2),(t<0?"-":"")+new Array(e).concat([Math.abs(t)]).join("0").slice(-e)};function lt(t,e){var n=$(e,t),r=ot(t,-1);return n<$(e,r)}function ht(t,e){var n=lt(t,e)?1:0;return ot(t,n)}function ct(t,e,n){if(e===n)return t;var r=$(e,t),i=$(n,t),o=r-i,a=it(t,o),s=$(n,a);return it(t,o+(i-s))}var ft=function(){function t(t,e){this._utcDate=i(t),this.timezone=e;var n=$(e,t);this.timezoneOffset=n;var r=ht(t,e);this._localDate=ct(r,e,"Etc/UTC")}return Object.defineProperty(t.prototype,"cachedLocalDate",{get:function(){return this._localDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cachedUTCDate",{get:function(){return this._utcDate},enumerable:!0,configurable:!0}),t.fromLocalDate=function(e,n){void 0===n&&(n="");var r=ct(e,"Etc/UTC",n),i=lt(r,n),o=$(n,r),a=0;i&&(a=o>0?-1:1);var s=ot(r,a);return t.fromUTCDate(s,n)},t.fromUTCDate=function(e,n){return void 0===n&&(n=""),new t(e,n)},t.prototype.toLocalDate=function(){return i(this._localDate)},t.prototype.toUTCDate=function(){return i(this._utcDate)},t.prototype.toTimezone=function(e){if(this.timezone===e)return this.clone();var n=$(this.timezone,this._utcDate),r=it(this._utcDate,n);return t.fromLocalDate(r,e)},t.prototype.clone=function(){return t.fromUTCDate(this._utcDate,this.timezone)},t.prototype.addDays=function(e){var n=new Date(this._utcDate.getTime());return n.setUTCDate(n.getUTCDate()+e),t.fromUTCDate(n,this.timezone)},t.prototype.addTime=function(e){var n=ht(new Date(this._utcDate.getTime()),this.timezone);n.setTime(n.getTime()+e);var r=ht(n,this.timezone);return t.fromUTCDate(r,this.timezone)},t.prototype.stripTime=function(){var e=this._utcDate,n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0);return t.fromUTCDate(new Date(n),this.timezone)},t.prototype.getTime=function(){return this._localDate.getTime()},t.prototype.getTimezoneOffset=function(){return this.timezoneOffset},t.prototype.getFullYear=function(){return this._utcDate.getUTCFullYear()},t.prototype.getMonth=function(){return this._utcDate.getUTCMonth()},t.prototype.getDate=function(){return this._utcDate.getUTCDate()},t.prototype.getDay=function(){return this._utcDate.getUTCDay()},t.prototype.getHours=function(){return this._utcDate.getUTCHours()},t.prototype.getMinutes=function(){return this._utcDate.getUTCMinutes()},t.prototype.getSeconds=function(){return this._utcDate.getUTCSeconds()},t.prototype.getMilliseconds=function(){return this._utcDate.getUTCMilliseconds()},t.prototype.getUTCDate=function(){return this._localDate.getUTCDate()},t.prototype.getUTCDay=function(){return this._localDate.getUTCDay()},t.prototype.getUTCFullYear=function(){return this._localDate.getUTCFullYear()},t.prototype.getUTCHours=function(){return this._localDate.getUTCHours()},t.prototype.getUTCMilliseconds=function(){return this._localDate.getUTCMilliseconds()},t.prototype.getUTCMinutes=function(){return this._localDate.getUTCMinutes()},t.prototype.getUTCMonth=function(){return this._localDate.getUTCMonth()},t.prototype.getUTCSeconds=function(){return this._localDate.getUTCSeconds()},t.prototype.setTime=function(t){throw new Error("Method not implemented.")},t.prototype.setMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCMilliseconds=function(t){throw new Error("Method not implemented.")},t.prototype.setSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCSeconds=function(t,e){throw new Error("Method not implemented.")},t.prototype.setMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCMinutes=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setUTCHours=function(t,e,n,r){throw new Error("Method not implemented.")},t.prototype.setDate=function(t){throw new Error("Method not implemented.")},t.prototype.setUTCDate=function(t){throw new Error("Method not implemented.")},t.prototype.setMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setUTCMonth=function(t,e){throw new Error("Method not implemented.")},t.prototype.setFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.setUTCFullYear=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.toISOString=function(){return this._localDate.toISOString()},t.prototype.toJSON=function(){return this._localDate.toJSON()},t.prototype.toString=function(){var t,e=(t=this._utcDate,at[t.getUTCDay()]+" "+st[t.getUTCMonth()]),n=this.toTimeString();return e+" "+this.getDate()+" "+this.getFullYear()+" "+n},t.prototype.toDateString=function(){return rt(this._utcDate).toDateString()},t.prototype.toTimeString=function(){var t=ut(this.getHours())+":"+ut(this.getMinutes())+":"+ut(this.getSeconds()),e=function(t){var e=t<=0?"+":"-",n=Math.abs(t);return"GMT"+e+ut(Math.floor(n/60))+ut(n%60)}(this.timezoneOffset),n=Q(this.timezone,this._utcDate);return n&&(n=" ("+n+")"),t+" "+e+n},t.prototype.toLocaleString=function(t,e){return this._localDate.toLocaleString(t,e)},t.prototype.toLocaleDateString=function(t,e){return this._localDate.toLocaleDateString(t,e)},t.prototype.toLocaleTimeString=function(t,e){return this._localDate.toLocaleTimeString(t,e)},t.prototype.toUTCString=function(){return this.toTimezone("Etc/UTC").toString()},t.prototype[Symbol.toPrimitive]=function(t){return"string"===t||"default"===t?this.toString():this._localDate.getTime()},t.prototype.valueOf=function(){return this.getTime()},t.prototype.getVarDate=function(){throw new Error("Not implemented.")},t.prototype.format=function(t){throw new Error("Not implemented.")},t.prototype.formatUTC=function(t){throw new Error("Not implemented.")},t}(),dt=function(t){var e=L.titles;return Object.keys(e).reduce((function(n,r){return(e[r]||{}).group===t?n.concat(r.split(" ")):n}),[])},pt=function(t,e){var n=s(t.getFullYear(),0,1,-6),r=function(t,e){return e!==y.Monday?a(A(t,e),4):a(t,4-(t.getDay()||7))}(t,e).getTime()-n.getTime(),i=Math.floor(r/v);return 1+Math.floor(i/7)},mt=function(t,e){void 0===e&&(e=y.Monday),t=x(t);var n=a(t,-7),r=a(t,7),i=pt(t,e);return 0===i?pt(n,e)+1:53===i&&pt(r,e)>1?1:i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(4);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,o=t.formatPattern,a=t.selectionStart,s=t.isInCaretMode,u=t.keyEvent,l=e[a+e.length-n.length],h=e.substring(0,a+e.length-n.length),c=n.substring(0,a),f=[];if(h===c&&a>0)return f.push([o[a-1],c[a-1]]),f;if(0===h.indexOf(c)&&s&&(u.key===i.Key.DELETE||u.key===i.Key.BACKSPACE)||0===h.indexOf(c)&&!s&&(0===c.length||o[c.length-1]!==o[c.length])){var d="";s||1!==c.length||f.push([o[0],c[0]]);for(var p=c.length;p<h.length;p++)o[p]!==d&&o[p]!==r.Constants.formatSeparator&&(d=o[p],f.push([d,""]));return f}if(s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)||!s&&(0===c.indexOf(h)||o[a-1]===r.Constants.formatSeparator)){var m=o[0];for(p=Math.max(0,h.length-1);p<o.length;p++)if(o[p]!==r.Constants.formatSeparator){m=o[p];break}return[[m,c[a-1]]]}return!s&&" "===c[c.length-1]||!s&&c[c.length-1]===l?[[o[a-1],r.Constants.formatSeparator]]:[[o[a-1],c[a-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6);e.DateInput=r.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(7),o=n(8),a=n(3),s=n(10),u=n(4),l=n(1),h=n(11),c=n(12),f=n(2),d=n(0),p={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(r={},r.valueChange=null,r.input=null,r.inputEnd=null,r.focus=null,r.focusEnd=null,r.blur=null,r.blurEnd=null,r.keydown=null,r.mousewheel=null,r.change=null,r),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:d.Constants.twoDigitYearMax,autoCorrectParts:!0},m=function(t){function e(e,n){var r=t.call(this,n)||this;return r.dateObject=null,r.currentText="",r.currentFormat="",r.interactionMode=c.DateInputInteractionMode.None,r.previousElementSelection={start:0,end:0},r.init(e,n),r}return i.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var n=l.isValidDate(this.options.value)?f.cloneDate(this.options.value):new Date(e.formattedValue);l.isValidDate(n)||(n=null),this.element=t,this.options=l.extend({},p,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=l.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,r=l.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,i=!n&&r?0:this.caret()[0];this.selectNearestSegment(i)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===s.KeyCode.BACKSPACE||e.key===u.Key.BACKSPACE,r=e.keyCode===s.KeyCode.DELETE||e.key===u.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var i=this.interactionMode;!this.options.allowCaretMode||i===c.DateInputInteractionMode.Caret||r||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var o=this.isInCaretMode();if(o&&this.keyDownEvent.key===u.Key.SPACE)this.restorePreviousInputEventState();else{var h=this.dateObject&&this.dateObject.getValue(),p=this.dateObject.getTextAndFormat(),m=p.text,g=p.format;this.currentFormat=g;var v="";v=o&&(n||r||i===c.DateInputInteractionMode.Caret)?this.previousElementValue:m;var y=this.elementValue,D=a.approximateStringMatching({oldText:v,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:o,keyEvent:this.keyDownEvent});if(!o||D&&0!==D.length){if(o&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(o&&D[0]&&(D[0][0]===d.Constants.formatSeparator||D[0][1]===d.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var b=1===D.length&&D[0][1]===d.Constants.formatSeparator,E=[],M=!1;if(!b)for(var S=0;S<D.length;S++){var w=this.dateObject.parsePart({symbol:D[S][0],currentChar:D[S][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||r,originalFormat:this.currentFormat});E.push(w),M=w.switchToNext}this.options.autoSwitchParts||(M=!1),this.resetSegmentValue=!1;var P,C=E[E.length-1],T=C&&!C.value,O=o&&(n||r)&&T,_=!!C&&C.resetPart,I=!f.isEqual(h,this.dateObject.value),x=this.selection;(!o||O||_)&&(_&&(P=this.currentFormat[x.start]),this.forceUpdate()),D.length&&D[0][0]!==d.Constants.formatSeparator&&(!o||O||_?P?this.setSelection(this.selectionBySymbol(P)):(this.options.autoSwitchParts||D[0][1]!==d.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0])):o&&(I&&l.isPresent(this.dateObject.getValue())?M&&this.switchDateSegment(1):T&&this.restorePreviousInputEventState())),M||!o||n||r||_||!T?this.options.autoSwitchParts&&(M||b)&&(o||this.switchDateSegment(1)):I?this.currentFormat.length===this.elementValue.length||o&&i!==c.DateInputInteractionMode.Caret&&I||(o&&i!==c.DateInputInteractionMode.Caret?(P=this.currentFormat[x.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(P))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:h,event:t}),this.triggerInputEnd({event:t}),o&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,r=e.end;this.previousElementSelection={start:n,end:r};var i=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(i.indexOf(t.keyCode.toString())>=0||i.indexOf(t.keyCode)>=0||i.indexOf(t.key.toLowerCase().trim())>=0){var o=i.indexOf(u.Key.TAB.toLowerCase().trim())>=0||i.indexOf(s.KeyCode.TAB)>=0||i.indexOf(s.KeyCode.TAB.toString())>=0;if(!o)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,l=a.start,h=a.end;if(t.shiftKey&&o?this.switchDateSegment(-1):this.switchDateSegment(1),l!==this.selection.start||h!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],f=this.getStepFromSymbol(c),d=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===s.KeyCode.TAB)){switch(t.keyCode){case s.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),d=!0;break;case s.KeyCode.ARROW_UP:this.modifyDateSegmentValue(f,c,event),d=!0;break;case s.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),d=!0;break;case s.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-f,c,event),d=!0;break;case s.KeyCode.ENTER:break;case s.KeyCode.DELETE:case s.KeyCode.BACKSPACE:if(this.options.allowNulls){var p=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:p,event:t})}return d=!0,void(t.keyCode===s.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(s.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(u.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case u.Key.HOME:this.selectNearestSegment(0);break;case u.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}d&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;l.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:d.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:d.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,r=t-1;n<this.currentFormat.length||r>=0;n++,r--){if(n<this.currentFormat.length&&this.currentFormat[n]!==d.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(r>=0&&this.currentFormat[r]!==d.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[r]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,r=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],i="",o="";if(t<0){for(var a=n+t;a>=0;a--)if((o=this.currentFormat[a])!==d.Constants.formatSeparator&&o!==r){n=a,i=o;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((o=this.currentFormat[a])!==d.Constants.formatSeparator&&o!==r){n=a,i=o;break}if(i)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(i)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}var s=this.selection,u=s.start,l=s.end;if(u<l&&this.currentFormat[u]!==this.currentFormat[l-1])return this.setSelection(this.selectionByIndex(t>0?u:l-1)),void(this.resetSegmentValue=!0);for(var h=this.currentFormat[u],f=u+t;f>0&&f<this.currentFormat.length&&(this.currentFormat[f]===h||this.currentFormat[f]===d.Constants.formatSeparator);)f+=t;if(this.currentFormat[f]!==d.Constants.formatSeparator){for(var p=f;p>=0&&p<this.currentFormat.length&&this.currentFormat[p]===this.currentFormat[f];)p+=t;f>p&&(p+1!==u||f+1!==l)?(this.setSelection({start:p+1,end:f+1}),this.resetSegmentValue=!0):f<p&&(f!==u||p!==l)&&(this.setSelection({start:f,end:p}),this.resetSegmentValue=!0)}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var r=this.value,i=1*t,o=this.caret();if("S"===(e=e||this.currentFormat[o[0]])&&!this.options.steps.millisecond){var a=l.millisecondDigitsInFormat(this.inputFormat);i=l.millisecondStepFor(a)}this.dateObject.modifyPart(e,i),this.tryTriggerValueChange({oldValue:r,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!f.isEqual(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger("valueChange",l.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",l.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("inputEnd",l.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",l.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",l.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",l.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",l.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",l.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",l.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",l.extend({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!l.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,r=this.dateObject.getTextAndFormat(n),i=r.text,o=r.format;this.currentFormat=o,this.currentText=i;var a=!this.isActive&&l.isPresent(this.options.placeholder)&&!this.dateObject.hasValue();l.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var s=a?"":i;this.previousElementValue=this.elementValue,this.setElementValue(s),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,r=[t,t],i=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==i.selectionStart&&(n&&(l.isDocumentAvailable()&&document.activeElement!==i&&i.focus(),i.setSelectionRange(t,e)),r=[i.selectionStart,i.selectionEnd])}catch(t){r=[]}return r}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,r=0;r<this.currentFormat.length;r++)this.currentFormat[r]===t&&(n=r+1,-1===e&&(e=r));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new o.DateObject(l.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(h.Observable);e.DateInput=m},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return l})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return c})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return y})),n.d(e,"__await",(function(){return D})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return E})),n.d(e,"__asyncValues",(function(){return M})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return P})),n.d(e,"__importDefault",(function(){return C})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return O})),n.d(e,"__classPrivateFieldIn",(function(){return _}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var f=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||f(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function y(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function D(t){return this instanceof D?(this.v=t,this):new D(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof D?Promise.resolve(n.value.v).then(u,l):h(o[0][2],n)}catch(t){h(o[0][3],t)}var n}function u(t){s("next",t)}function l(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function E(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:D(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function M(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var w=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function P(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&f(e,t,n);return w(e,t),e}function C(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function O(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function _(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(9),o=n(3),a=n(1),s=n(0),u=/d|M|H|h|m|s/,l=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,o=t.cycleTime,a=void 0!==o&&o,u=t.twoDigitYearMax,l=void 0===u?s.Constants.twoDigitYearMax:u,h=t.value,c=void 0===h?null:h,f=t.autoCorrectParts,d=void 0===f||f;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=r.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=l,this.autoCorrectParts=d,c)this._value=r.cloneDate(c);else{this._value=r.getDate(new Date);for(var p=this.dateFormatString(this.value,this.format).symbols,m=0;m<p.length;m++)this.setExisting(p[m],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=s.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var r=e[n],i=this.intl.cldr[r];if(i.name&&i.calendar&&i.numbers&&i.name!==s.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?r.isEqual(t,this._value)||(this._value=r.cloneDate(t),this.modifyExisting(!0)):(this._value=r.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return r.cloneDate(this.value)},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),r=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,e,this.localeId),u=this.getFormattedInvalidDates(e),l=0;l<s.length;l++){var h=r.symbols[l];if("literal"===r.partMap[l].type)i+=n[l];else if(this.getInvalidDatePartValue(h)){var c=this.getPartsForSegment(r,l);if("M"===h){var f=(a.parseToInt(this.getInvalidDatePartValue(h))+1).toString();if(c.length>2)i+=u[h][l];else if(this.getInvalidDatePartValue(h))i+=o.padZero(c.length-f.length)+f,l+=c.length-1;else i+=u[h][l]}else if(this.getInvalidDatePartValue(h)){f=this.getInvalidDatePartValue(h).toString();i+=o.padZero(c.length-f.length)+f,l+=c.length-1}else i+=u[h][l]}else i+=n[l]}n=i}return this.merge(n,r)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,r={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var i=e.getInvalidDatePart(t).date;if(i){var o=e.intl.formatDate(i,n,e.localeId);r[t]=o}})),r},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,i=r.cloneDate(this.value),o=!1,s="M"===t,u="d"===t||"E"===t,l=this.getExisting(t);if(this.autoCorrectParts||!u&&!s)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=r.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),o=!0;break;case"m":i.setMinutes(i.getMinutes()+e),o=!0;break;case"s":i.setSeconds(i.getSeconds()+e),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),o=!0}else{var h=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),f=h.y.value||i.getFullYear(),d=h.M.value||i.getMonth(),p=h.d.value||h.E.value||i.getDate(),m=h.h.value||h.H.value||i.getHours(),g=h.m.value||i.getMinutes(),v=h.s.value||i.getSeconds(),y=h.S.value||i.getMilliseconds();switch(t){case"y":f+=e;break;case"M":d+=e;break;case"d":case"E":p+=e}if("M"===t){if((d<0||d>11)&&l)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!l){if(d<0)d=a.clamp(d%11+1+11,0,11);else{var D=a.isPresent(c)?d:(e-1)%12;d=a.clamp(D,0,11)}d=a.clamp(d,0,11)}d=a.clamp(d,0,11)}else if("d"===t)if(l){if(p<=0||p>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!l){if(a.isPresent(c)&&(p<=0||p>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var b=a.isPresent(c)?p:31-Math.abs(e%31)+1;p=a.clamp(b,1,31)}else{b=a.isPresent(c)?p:e%31;p=a.clamp(b,1,31)}p=a.clamp(p,1,31)}var E=r.createDate(f,d,p,m,g,v,y),M=s||u?this.modifyDateSymbolWithValue(i,t,s?d:p):null,S=a.areDatePartsEqualTo(E,f,d,p,m,g,v,y);this.getValue()&&a.areDatePartsEqualTo(E,f,d,p,m,g,v,y)?(i=r.cloneDate(E),this.markDatePartsAsExisting()):s&&M?M.getMonth()===d?this.getExisting("d")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(this.resetInvalidDateSymbol(t),i=r.cloneDate(E),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(M)):(n=!0,this.setInvalidDatePart(t,{value:d,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):u&&M&&(M.getDate()===p?this.getExisting("M")?S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(M),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)):S?(i=r.cloneDate(E),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=r.cloneDate(M)):(n=!0,this.setInvalidDatePart(t,{value:p,date:r.cloneDate(this.value),startDateOffset:e,startDate:r.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),o&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,i=t.currentChar,s=t.resetSegmentValue,u=t.cycleSegmentValue,l=t.rawTextValue,h=t.isDeleting,c=t.originalFormat,f=!u,d=this.dateFormatString(this.value,this.format),p=d.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),m=0;m<p.length;m++){for(var g=p[m],v=0;v<g.pattern.length;v++)p[m+v]&&(p[m+v].literal=g.pattern[v]);m+=g.pattern.length-1}var y={value:null,switchPart:!1,resetPart:f&&"M"===n&&d.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2}))};if(!i){if(!f)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(m=0;m<p.length;m++){var D=p[m].literal,b=l.startsWith(D),E=l.endsWith(D),M=l.indexOf(D+D)>=0;if(b||E||M)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(y,{value:null,switchToNext:!1})}}var S=this.intl.formatDate(this.value,this.format,this.localeId),w=d.symbols,P=!1,C="",T="",O="",_="",I="",x="",F=c.indexOf(n),j=c.lastIndexOf(n)-F+1,k=this.format===w||this.format===c||this.format.length===c.length;if(f){var V=0;for(m=0;m<S.length;m++){if(w[m]===n)T+=this.getExisting(n)?S[m]:"0",h?(V<j-1&&(O+=l[m]||""),V++):O+=l[m]||"",P=!0;else P?(x+=S[m],I+=S[m]):(C+=S[m],_+=S[m])}if(k){if(c.length<l.length)O+=i;else if(!h&&c.length>l.length){var U=c.length-l.length;(N=O.substring(0,O.length-U))&&N.length>0&&(O=N)}if(O.length>j)return a.extend(y,{value:null,switchToNext:!1})}else{V=0,T="",O="",C="",x="",P=!1;for(m=0;m<c.length;m++){if(c[m]===n)T+=this.getExisting(n)?S[m]||"":"0",h?(V<j-1&&(O+=l[m]||""),V++):O+=l[m]||"",P=!0;else P?x+=l[m]||"":C+=l[m]||""}if(c.length<l.length)O+=i;else if(!h&&c.length>l.length){var N;U=c.length-l.length;(N=O.substring(0,O.length-U))&&N.length>0&&(O=N)}}}else for(m=0;m<S.length;m++){if(w[m]===n)T+=this.getExisting(n)?S[m]:"0",P=!0;else P?x+=S[m]:C+=S[m]}var A=null,L=this.matchMonth(i),Y=this.matchDayPeriod(i,n),H="0"===i,K=this.leadingZero||{};H&&!f?0!==parseInt(s?i:T+i,10)||this.isAbbrMonth(d.partMap,n)||this.incrementLeadingZero(n):this.resetLeadingZero();var W=this.partPattern(d.partMap,n),R=W?W.pattern:null;if(f&&h&&!O)return this.setExisting(n,!1),a.extend(y,{value:null,switchToNext:!1});var z=T.length-3,B=!0;for(m=Math.max(0,z);m<=T.length&&B;m++){var Z=s?i:f?O:T.substring(m)+i;this.autoCorrectParts||(B=!1,f||(Z=o.unpadZero(Z),Z=o.padZero(j-Z.length)+Z)),f&&(B=!1,Z=o.unpadZero(Z));var G=parseInt(Z,10),J=C+Z+x;A=this.intl.parseDate(J,this.format,this.localeId),!f||k||a.isValidDate(A)||(A=this.intl.parseDate(_+Z+I,this.format,this.localeId),O=Z);var q=!isNaN(parseInt(i,10))||f&&h&&""===i;if(!A&&!isNaN(G)&&q){if("M"===n&&!L){var Q=G-1;Q>-1&&Q<12&&((A=r.cloneDate(this.value)).setMonth(Q),A.getMonth()!==Q&&(A=r.lastDayOfMonth(r.addMonths(A,-1))))}"y"===n&&(A=r.createDate(parseInt(Z,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(f&&a.isValidDate(A)||!f&&A)&&this.date&&A.getDate()!==this.value.getDate()&&(A=r.lastDayOfMonth(r.addMonths(A,-1))))}if(f&&a.isValidDate(A)||!f&&A){var X=this.intl.parseDate(""+C+this.peek(Z,R)+x,this.format,this.localeId),$=this.patternLength(R)||R.length,tt=((this.leadingZero||{})[n]||0)+(o.unpadZero(Z)||i).length>=$,et=null===X||K[n]&&R.length<=Z.length||tt;if(this.shouldNormalizeCentury()&&(A=this.normalizeCentury(A)),this._value=A,this.setExisting(n,!0),f&&et)if("M"===n){if(j<=2)et=(nt=a.parseToInt(O))>=2}else et=et?k?O.length===j:O.length>j:et;return a.extend(y,{value:this.value,switchToNext:et})}}if(L&&(A=this.intl.parseDate(C+L+x,this.format,this.localeId)))return this._value=A,this.setExisting(n,!0),a.extend(y,{value:this.value,switchToNext:!1});if(Y&&(A=this.intl.parseDate(C+Y+x,this.format)))return this._value=A,a.extend(y,{value:this.value,switchToNext:!0});if(H&&(this.leadingZero=this.isAbbrMonth(d.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),f&&O.length>j)return a.extend(y,{value:null,switchToNext:!1});if(!this.autoCorrectParts){this.setExisting(n,!1);var nt=void 0,rt=f?O:T,it=a.parseToInt(rt);if(a.isNumber(it)&&(nt="M"===n?a.clamp(it-1,0,11):it),a.isNumber(nt)){var ot=this.modifyDateSymbolWithValue(this.value,n,nt);this.setExisting(n,!1),this.setInvalidDatePart(n,{value:nt,date:r.cloneDate(ot),startDate:this._partiallyInvalidDate.startDate||r.cloneDate(this.value)})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(o.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.normalizeCentury=function(t){if(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.setYears(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return o.padZero(e.length-n.length)+n},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(n>=1&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:u.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),r=[],o=[],a=0;a<n.length;a++)for(var u=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;u>0;)r.push(this.symbols[n[a].pattern[0]]||s.Constants.formatSeparator),o.push(n[a]),u--;var l=new i.Mask;return l.symbols=r.join(""),l.partMap=o,l},t.prototype.merge=function(t,e){for(var n="",r="",i=e.symbols,o=!1,s=0,u=this.getFormattedInvalidDates(i),l=i.length-1;l>=0;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(i[l])||this.getExisting(i[l]))this.autoCorrectParts?n=t[l]+n:t.length!==i.length?o?n=t[l]+n:s>0?(n=t[l]+n,--s<=0&&(o=!0)):n=(t[l+t.length-i.length]||"")+n:n=t[l]+n,r=i[l]+r;else{var c=i[l],f=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;l>=0&&c===i[l];)l--;l++}if(this.leadingZero&&this.leadingZero[c])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(c)){var d=this.getInvalidDatePartValue(c).toString();"M"===c?(d=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),h.length>2?n=u[c][l]+n:(n=(d=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,s=d.length-h.length)):(n=d+n,f=d.length-1,s=d.length-h.length)}else n=this.dateFieldName(e.partMap[l])+n;for(;r.length<n.length;)r=i[l]+r;0!==f&&(l=l-f+(t.length-i.length))}}return{text:n,format:r}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&a.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,r=void 0===n?null:n,i=e.date,o=void 0===i?null:i,a=e.startDateOffset,s=void 0===a?0:a,u=e.startDate,l=void 0===u?null:u;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=r,this._partiallyInvalidDate.invalidDateParts[t].date=o,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=l)},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=r.cloneDate(t),o=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=r.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),o=!0;break;case"m":i.setMinutes(i.getMinutes()+n),o=!0;break;case"s":i.setSeconds(i.getSeconds()+n),o=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),o=!0}return{date:i,timeModified:o}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=r.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=r.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],r=[],i=e;i<t.partMap.length;i++){var o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.push(o)}for(i=e-1;i>=0;i--){o=t.partMap[i];if(n.type!==o.type||n.pattern!==o.pattern)break;r.unshift(o)}return r},t}();e.DateObject=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){this.symbols="",this.partMap=[]};e.Mask=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i={events:{}},o=function(){function t(t){this.options=r.extend({},i,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!r.isFunction(this.options.events[t])&&(this.options.events[t](r.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
package/dist/cdn/main.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@progress/kendo-date-math"),require("tslib")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.KendoDateinputsCommon=e(require("@progress/kendo-date-math"),require("tslib")):t.KendoDateinputsCommon=e(t.KendoDateMath,t.self)}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(0),s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var l=r.shift();if(s(t)&&s(l))for(var h in l)a(l[h])?t[h]=l[h]:s(l[h])?(t[h]||e.extend(t,((n={})[h]={},n)),e.deepExtend(t[h],l[h])):e.extend(t,((i={})[h]=l[h],i));return e.deepExtend.apply(void 0,[t].concat(r))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(i="setFullYear",function(t,e){var n=r.cloneDate(t);return n[i](e),n}),e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,i,r,s,a,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==r||t.getMinutes()!==s||t.getSeconds()!==a||t.getMilliseconds()!==o)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(4);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,s=t.formatPattern,a=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=e[a+e.length-n.length],u=e.substring(0,a+e.length-n.length),c=n.substring(0,a),d=[];if(u===c&&a>0)return d.push([s[a-1],c[a-1]]),d;if(0===u.indexOf(c)&&o&&(l.key===r.Key.DELETE||l.key===r.Key.BACKSPACE)||0===u.indexOf(c)&&!o&&(0===c.length||s[c.length-1]!==s[c.length])){var p="";o||1!==c.length||d.push([s[0],c[0]]);for(var m=c.length;m<u.length;m++)s[m]!==p&&s[m]!==i.Constants.formatSeparator&&(p=s[m],d.push([p,""]));return d}if(o&&(0===c.indexOf(u)||s[a-1]===i.Constants.formatSeparator)||!o&&(0===c.indexOf(u)||s[a-1]===i.Constants.formatSeparator)){var f=s[0];for(m=Math.max(0,u.length-1);m<s.length;m++)if(s[m]!==i.Constants.formatSeparator){f=s[m];break}return[[f,c[a-1]]]}return!o&&" "===c[c.length-1]||!o&&c[c.length-1]===h?[[s[a-1],i.Constants.formatSeparator]]:[[s[a-1],c[a-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.DateInput=i.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(7),s=n(8),a=n(3),o=n(10),l=n(4),h=n(2),u=n(11),c=n(12),d=n(0),p=n(1),m={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(i={},i.valueChange=null,i.input=null,i.inputEnd=null,i.focus=null,i.focusEnd=null,i.blur=null,i.blurEnd=null,i.keydown=null,i.mousewheel=null,i.change=null,i),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0},f=function(t){function e(e,n){var i=t.call(this,n)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=c.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(e,n),i}return r.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var n=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(n)||(n=null),this.element=t,this.options=h.extend({},m,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=h.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,i=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,r=!n&&i?0:this.caret()[0];this.selectNearestSegment(r)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===o.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,i=e.keyCode===o.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var r=this.interactionMode;!this.options.allowCaretMode||r===c.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var s=this.isInCaretMode();if(s&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var u=this.dateObject&&this.dateObject.getValue(),m=this.dateObject.getTextAndFormat(),f=m.text,v=m.format;this.currentFormat=v;var g="";g=s&&(n||i||r===c.DateInputInteractionMode.Caret)?this.previousElementValue:f;var y=this.elementValue,D=a.approximateStringMatching({oldText:g,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||D&&0!==D.length){if(s&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(s&&D[0]&&(D[0][0]===p.Constants.formatSeparator||D[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var E=1===D.length&&D[0][1]===p.Constants.formatSeparator,b=[],S=!1;if(!E)for(var P=0;P<D.length;P++){var M=this.dateObject.parsePart({symbol:D[P][0],currentChar:D[P][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});b.push(M),S=M.switchToNext}this.options.autoSwitchParts||(S=!1),this.resetSegmentValue=!1;var I,x=b[b.length-1],C=x&&!x.value,O=s&&(n||i)&&C,w=!!x&&x.resetPart,F=!d.isEqual(u,this.dateObject.value),V=this.selection;(!s||O||w)&&(w&&(I=this.currentFormat[V.start]),this.forceUpdate()),D.length&&D[0][0]!==p.Constants.formatSeparator&&(!s||O||w?I?this.setSelection(this.selectionBySymbol(I)):(this.options.autoSwitchParts||D[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0])):s&&(this.options.format.length!==this.currentFormat.length?F&&h.isPresent(this.dateObject.getValue())&&S&&this.switchDateSegment(1):F?C&&this.restorePreviousInputEventState():this.restorePreviousInputEventState())),S||!s||n||i||w||!C?this.options.autoSwitchParts&&(S||E)&&(s||this.switchDateSegment(1)):F?this.currentFormat.length===this.elementValue.length||s&&r!==c.DateInputInteractionMode.Caret&&F||(s&&r!==c.DateInputInteractionMode.Caret?(I=this.currentFormat[V.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(I))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:u,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,i=e.end;this.previousElementSelection={start:n,end:i};var r=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(r.indexOf(t.keyCode.toString())>=0||r.indexOf(t.keyCode)>=0||r.indexOf(t.key.toLowerCase().trim())>=0){var s=r.indexOf(l.Key.TAB.toLowerCase().trim())>=0||r.indexOf(o.KeyCode.TAB)>=0||r.indexOf(o.KeyCode.TAB.toString())>=0;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,h=a.start,u=a.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),h!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),p=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),p=!0;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),p=!0;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),p=!0;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),p=!0;break;case o.KeyCode.ENTER:break;case o.KeyCode.DELETE:case o.KeyCode.BACKSPACE:if(this.options.allowNulls){var m=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:m,event:t})}return p=!0,void(t.keyCode===o.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(o.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}p&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;h.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||i>=0;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(i>=0&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)],r="",s="";if(t<0){for(var a=0;a<n+t;a++)if((s=this.currentFormat[a])!==p.Constants.formatSeparator&&s!==i){n=a,r=s;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((s=this.currentFormat[a])!==p.Constants.formatSeparator&&s!==i){n=a,r=s;break}if(r)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(r)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),void(this.resetSegmentValue=!0);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0)}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var i=this.value,r=1*t,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&!this.options.steps.millisecond){var a=h.millisecondDigitsInFormat(this.inputFormat);r=h.millisecondStepFor(a)}this.dateObject.modifyPart(e,r),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!d.isEqual(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger("valueChange",h.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",h.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("inputEnd",h.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",h.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",h.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",h.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",h.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",h.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",h.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",h.extend({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!h.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(n),r=i.text,s=i.format;this.currentFormat=s,this.currentText=r;var a=!this.isActive&&h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue();h.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var o=a?"":r;this.previousElementValue=this.elementValue,this.setElementValue(o),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],r=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==r.selectionStart&&(n&&(h.isDocumentAvailable()&&document.activeElement!==r&&r.focus(),r.setSelectionRange(t,e)),i=[r.selectionStart,r.selectionEnd])}catch(t){i=[]}return i}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new s.DateObject(h.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(u.Observable);e.DateInput=f},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=n(9),s=n(3),a=n(2),o=n(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,r=t.format,s=t.cycleTime,a=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=i.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=r,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=h,this.autoCorrectParts=p,c)this._value=i.cloneDate(c);else{this._value=i.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,f=0;f<m.length;f++)this.setExisting(m[f],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=o.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],r=this.intl.cldr[i];if(r.name&&r.calendar&&r.numbers&&r.name!==o.Constants.defaultLocaleId){t=r.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?i.isEqual(t,this._value)||(this._value=i.cloneDate(t),this.modifyExisting(!0)):(this._value=i.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return i.cloneDate(this.value)},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),i=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var r="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=i.symbols[h];if("literal"===i.partMap[h].type)r+=n[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(i,h);if("M"===u){var d=(a.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)r+=l[u][h];else if(this.getInvalidDatePartValue(u))r+=s.padZero(c.length-d.length)+d,h+=c.length-1;else r+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();r+=s.padZero(c.length-d.length)+d,h+=c.length-1}else r+=l[u][h]}else r+=n[h]}n=r}return this.merge(n,i)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,i={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var r=e.getInvalidDatePart(t).date;if(r){var s=e.intl.formatDate(r,n,e.localeId);i[t]=s}})),i},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,r=i.cloneDate(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":r.setFullYear(r.getFullYear()+e);break;case"M":r=i.addMonths(this.value,e);break;case"d":case"E":r.setDate(r.getDate()+e);break;case"h":case"H":r.setHours(r.getHours()+e),s=!0;break;case"m":r.setMinutes(r.getMinutes()+e),s=!0;break;case"s":r.setSeconds(r.getSeconds()+e),s=!0;break;case"S":r.setMilliseconds(r.getMilliseconds()+e);break;case"a":r.setHours(r.getHours()+12*e),s=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||r.getFullYear(),p=u.M.value||r.getMonth(),m=u.d.value||u.E.value||r.getDate(),f=u.h.value||u.H.value||r.getHours(),v=u.m.value||r.getMinutes(),g=u.s.value||r.getSeconds(),y=u.S.value||r.getMilliseconds();switch(t){case"y":d+=e;break;case"M":p+=e;break;case"d":case"E":m+=e}if("M"===t){if((p<0||p>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(p<0)p=a.clamp(p%11+1+11,0,11);else{var D=a.isPresent(c)?p:(e-1)%12;p=a.clamp(D,0,11)}p=a.clamp(p,0,11)}p=a.clamp(p,0,11)}else if("d"===t)if(h){if(m<=0||m>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if(a.isPresent(c)&&(m<=0||m>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=a.isPresent(c)?m:31-Math.abs(e%31)+1;m=a.clamp(E,1,31)}else{E=a.isPresent(c)?m:e%31;m=a.clamp(E,1,31)}m=a.clamp(m,1,31)}var b=i.createDate(d,p,m,f,v,g,y),S=o||l?this.modifyDateSymbolWithValue(r,t,o?p:m):null,P=a.areDatePartsEqualTo(b,d,p,m,f,v,g,y);this.getValue()&&a.areDatePartsEqualTo(b,d,p,m,f,v,g,y)?(r=i.cloneDate(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===p?this.getExisting("d")?P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(this.resetInvalidDateSymbol(t),r=i.cloneDate(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),r=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===m?this.getExisting("M")?P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),r=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(this.value),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(r=this.normalizeCentury(r)),s&&!this.cycleTime&&(r.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=r,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,r=t.currentChar,o=t.resetSegmentValue,l=t.cycleSegmentValue,h=t.rawTextValue,u=t.isDeleting,c=t.originalFormat,d=!l,p=this.dateFormatString(this.value,this.format),m=p.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=0;f<m.length;f++){for(var v=m[f],g=0;g<v.pattern.length;g++)m[f+g]&&(m[f+g].literal=v.pattern[g]);f+=v.pattern.length-1}var y={value:null,switchPart:!1,resetPart:d&&"M"===n&&p.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2}))};if(!r){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(f=0;f<m.length;f++){var D=m[f].literal,E=h.startsWith(D),b=h.endsWith(D),S=h.indexOf(D+D)>=0;if(E||b||S)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(y,{value:null,switchToNext:!1})}}var P=this.intl.formatDate(this.value,this.format,this.localeId),M=p.symbols,I=!1,x="",C="",O="",w="",F="",V="",k=c.indexOf(n),T=c.lastIndexOf(n)-k+1,_=this.format===M||this.format===c||this.format.length===c.length;if(d){var A=0;for(f=0;f<P.length;f++){if(M[f]===n)C+=this.getExisting(n)?P[f]:"0",u?(A<T-1&&(O+=h[f]||""),A++):O+=h[f]||"",I=!0;else I?(V+=P[f],F+=P[f]):(x+=P[f],w+=P[f])}if(_){if(c.length<h.length&&(O+=r),O.length>T)return a.extend(y,{value:null,switchToNext:!1})}else{A=0,C="",O="",x="",V="",I=!1;for(f=0;f<c.length;f++){if(c[f]===n)C+=this.getExisting(n)?P[f]||"":"0",u?(A<T-1&&(O+=h[f]||""),A++):O+=h[f]||"",I=!0;else I?V+=h[f]||"":x+=h[f]||""}c.length<h.length&&(O+=r)}}else for(f=0;f<P.length;f++){if(M[f]===n)C+=this.getExisting(n)?P[f]:"0",I=!0;else I?V+=P[f]:x+=P[f]}var N=null,j=this.matchMonth(r),L=this.matchDayPeriod(r,n),K="0"===r,B=this.leadingZero||{};K&&!d?0!==parseInt(o?r:C+r,10)||this.isAbbrMonth(p.partMap,n)||this.incrementLeadingZero(n):this.resetLeadingZero();var W=this.partPattern(p.partMap,n),H=W?W.pattern:null;if(d&&u&&!O)return this.setExisting(n,!1),a.extend(y,{value:null,switchToNext:!1});var R=C.length-3,Z=!0;for(f=Math.max(0,R);f<=C.length&&Z;f++){this.autoCorrectParts||(Z=!1);var Y=o?r:d?O:C.substring(f)+r;d&&(Z=!1,Y=s.unpadZero(Y));var U=parseInt(Y,10),q=x+Y+V;N=this.intl.parseDate(q,this.format,this.localeId),!d||_||a.isValidDate(N)||(N=this.intl.parseDate(w+Y+F,this.format,this.localeId),O=Y);var z=!isNaN(parseInt(r,10))||d&&u&&""===r;if(!N&&!isNaN(U)&&z){if("M"===n&&!j){var G=U-1;G>-1&&G<12&&((N=i.cloneDate(this.value)).setMonth(G),N.getMonth()!==G&&(N=i.lastDayOfMonth(i.addMonths(N,-1))))}"y"===n&&(N=i.createDate(parseInt(Y,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(d&&a.isValidDate(N)||!d&&N)&&this.date&&N.getDate()!==this.value.getDate()&&(N=i.lastDayOfMonth(i.addMonths(N,-1))))}if(d&&a.isValidDate(N)||!d&&N){var J=this.intl.parseDate(""+x+this.peek(Y,H)+V,this.format,this.localeId),Q=this.patternLength(H)||H.length,X=((this.leadingZero||{})[n]||0)+(s.unpadZero(Y)||r).length>=Q,$=null===J||B[n]&&H.length<=Y.length||X;if(this.shouldNormalizeCentury()&&(N=this.normalizeCentury(N)),this._value=N,this.setExisting(n,!0),d&&$)if("M"===n){if(T<=2)$=(tt=a.parseToInt(O))>=2}else $=$?_?O.length===T:O.length>T:$;return a.extend(y,{value:this.value,switchToNext:$})}}if(j&&(N=this.intl.parseDate(x+j+V,this.format,this.localeId)))return this._value=N,this.setExisting(n,!0),a.extend(y,{value:this.value,switchToNext:!1});if(L&&(N=this.intl.parseDate(x+L+V,this.format)))return this._value=N,a.extend(y,{value:this.value,switchToNext:!0});if(K&&(this.leadingZero=this.isAbbrMonth(p.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),d&&O.length>T)return a.extend(y,{value:null,switchToNext:!1});if(!this.autoCorrectParts){this.setExisting(n,!1);var tt=void 0,et=d?O:C,nt=a.parseToInt(et);if(a.isNumber(nt)&&(tt="M"===n?a.clamp(nt-1,0,11):nt),a.isNumber(tt)){var it=this.modifyDateSymbolWithValue(this.value,n,tt);this.setExisting(n,!1),this.setInvalidDatePart(n,{value:tt,date:i.cloneDate(it),startDate:this._partiallyInvalidDate.startDate||i.cloneDate(this.value)})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.normalizeCentury=function(t){if(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.setYears(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return s.padZero(e.length-n.length)+n},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(n>=1&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var l=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;l>0;)i.push(this.symbols[n[a].pattern[0]]||o.Constants.formatSeparator),s.push(n[a]),l--;var h=new r.Mask;return h.symbols=i.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var n="",i="",r=e.symbols,s=!1,o=0,l=this.getFormattedInvalidDates(r),h=r.length-1;h>=0;h--){var u=this.getPartsForSegment(e,h);if(-1===this.knownParts.indexOf(r[h])||this.getExisting(r[h]))this.autoCorrectParts?n=t[h]+n:t.length!==r.length?s?n=t[h]+n:o>0?(n=t[h]+n,--o<=0&&(s=!0)):n=(t[h+t.length-r.length]||"")+n:n=t[h]+n,i=r[h]+i;else{var c=r[h],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;h>=0&&c===r[h];)h--;h++}if(this.leadingZero&&this.leadingZero[c])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(c)){var p=this.getInvalidDatePartValue(c).toString();"M"===c?(p=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),u.length>2?n=l[c][h]+n:(n=(p=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,o=p.length-u.length)):(n=p+n,d=p.length-1,o=p.length-u.length)}else n=this.dateFieldName(e.partMap[h])+n;for(;i.length<n.length;)i=r[h]+i;0!==d&&(h=h-d+(t.length-r.length))}}return{text:n,format:i}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&a.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=void 0===n?null:n,r=e.date,s=void 0===r?null:r,a=e.startDateOffset,o=void 0===a?0:a,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=i,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var r=i.cloneDate(t),s=!1;switch(e){case"y":r.setFullYear(r.getFullYear()+n);break;case"M":r=i.addMonths(this.value,n);break;case"d":case"E":r.setDate(r.getDate()+n);break;case"h":case"H":r.setHours(r.getHours()+n),s=!0;break;case"m":r.setMinutes(r.getMinutes()+n),s=!0;break;case"s":r.setSeconds(r.getSeconds()+n),s=!0;break;case"S":r.setMilliseconds(r.getMilliseconds()+n);break;case"a":r.setHours(r.getHours()+12*n),s=!0}return{date:r,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var r=i.cloneDate(t);switch(e){case"y":r.setFullYear(n);break;case"M":r=i.addMonths(t,n-t.getMonth());break;case"d":case"E":r.setDate(n);break;case"h":case"H":r.setHours(n);break;case"m":r.setMinutes(n);break;case"s":r.setSeconds(n);break;case"S":r.setMilliseconds(n);break;case"a":r.setHours(n)}return r},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],r=e;r<t.partMap.length;r++){var s=t.partMap[r];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(r=e-1;r>=0;r--){s=t.partMap[r];if(n.type!==s.type||n.pattern!==s.pattern)break;i.unshift(s)}return i},t}();e.DateObject=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){this.symbols="",this.partMap=[]};e.Mask=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r={events:{}},s=function(){function t(t){this.options=i.extend({},r,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@progress/kendo-date-math"),require("tslib")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.KendoDateinputsCommon=e(require("@progress/kendo-date-math"),require("tslib")):t.KendoDateinputsCommon=e(t.KendoDateMath,t.self)}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(0),s=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},a=function(t){return t instanceof HTMLElement};e.isPresent=function(t){return null!=t},e.isDocumentAvailable=function(){return!!document},e.isNumber=function(t){return e.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},e.parseToInt=function(t){return parseInt(t,10)},e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},e.deepExtend=function(t){for(var n,i,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var l=r.shift();if(s(t)&&s(l))for(var h in l)a(l[h])?t[h]=l[h]:s(l[h])?(t[h]||e.extend(t,((n={})[h]={},n)),e.deepExtend(t[h],l[h])):e.extend(t,((i={})[h]=l[h],i));return e.deepExtend.apply(void 0,[t].concat(r))},e.noop=function(){},e.isFunction=function(t){return"function"==typeof t},e.cropTwoDigitYear=function(t){return!e.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},e.setYears=(i="setFullYear",function(t,e){var n=r.cloneDate(t);return n[i](e),n}),e.millisecondDigitsInFormat=function(t){var e=t&&t.match(/S+(\1)/);return e?e[0].length:0},e.millisecondStepFor=function(t){return Math.pow(10,3-t)},e.areDatePartsEqualTo=function(t,e,n,i,r,s,a,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==r||t.getMinutes()!==s||t.getSeconds()!==a||t.getMilliseconds()!==o)},e.isValidDate=function(t){return e.isPresent(t)&&t.getTime&&e.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(4);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,s=t.formatPattern,a=t.selectionStart,o=t.isInCaretMode,l=t.keyEvent,h=e[a+e.length-n.length],u=e.substring(0,a+e.length-n.length),c=n.substring(0,a),d=[];if(u===c&&a>0)return d.push([s[a-1],c[a-1]]),d;if(0===u.indexOf(c)&&o&&(l.key===r.Key.DELETE||l.key===r.Key.BACKSPACE)||0===u.indexOf(c)&&!o&&(0===c.length||s[c.length-1]!==s[c.length])){var p="";o||1!==c.length||d.push([s[0],c[0]]);for(var m=c.length;m<u.length;m++)s[m]!==p&&s[m]!==i.Constants.formatSeparator&&(p=s[m],d.push([p,""]));return d}if(o&&(0===c.indexOf(u)||s[a-1]===i.Constants.formatSeparator)||!o&&(0===c.indexOf(u)||s[a-1]===i.Constants.formatSeparator)){var f=s[0];for(m=Math.max(0,u.length-1);m<s.length;m++)if(s[m]!==i.Constants.formatSeparator){f=s[m];break}return[[f,c[a-1]]]}return!o&&" "===c[c.length-1]||!o&&c[c.length-1]===h?[[s[a-1],i.Constants.formatSeparator]]:[[s[a-1],c[a-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&e>t||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6);e.DateInput=i.DateInput},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(7),s=n(8),a=n(3),o=n(10),l=n(4),h=n(2),u=n(11),c=n(12),d=n(0),p=n(1),m={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:(i={},i.valueChange=null,i.input=null,i.inputEnd=null,i.focus=null,i.focusEnd=null,i.blur=null,i.blurEnd=null,i.keydown=null,i.mousewheel=null,i.change=null,i),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:p.Constants.twoDigitYearMax,autoCorrectParts:!0},f=function(t){function e(e,n){var i=t.call(this,n)||this;return i.dateObject=null,i.currentText="",i.currentFormat="",i.interactionMode=c.DateInputInteractionMode.None,i.previousElementSelection={start:0,end:0},i.init(e,n),i}return r.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),e.prototype.init=function(t,e){var n=h.isValidDate(this.options.value)?d.cloneDate(this.options.value):new Date(e.formattedValue);h.isValidDate(n)||(n=null),this.element=t,this.options=h.extend({},m,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder?this.options.formatPlaceholder:"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=c.DateInputInteractionMode.None,this.forceUpdate()},e.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,t.prototype.destroy.call(this)},e.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},e.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=h.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},e.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},e.prototype.isInCaretMode=function(){return this.interactionMode===c.DateInputInteractionMode.Caret},e.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},e.prototype.onElementDragStart=function(t){t.preventDefault()},e.prototype.onElementDrop=function(t){t.preventDefault()},e.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},e.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},e.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e=this.selection;if(this.isInCaretMode()&&this.forceUpdate(),3===t.detail);else if(this.isActive&&this.options.selectNearestSegmentOnFocus){var n=this.element.selectionStart!==this.element.selectionEnd,i=h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,r=!n&&i?0:this.caret()[0];this.selectNearestSegment(r)}else this.setSelection(this.selectionByIndex(e.start))},e.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===o.KeyCode.BACKSPACE||e.key===l.Key.BACKSPACE,i=e.keyCode===o.KeyCode.DELETE||e.key===l.Key.DELETE;if(this.element&&this.dateObject){if(this.isPasteInProgress)return this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),void(this.isPasteInProgress=!1);var r=this.interactionMode;!this.options.allowCaretMode||r===c.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=c.DateInputInteractionMode.Caret:this.interactionMode=c.DateInputInteractionMode.Selection;var s=this.isInCaretMode();if(s&&this.keyDownEvent.key===l.Key.SPACE)this.restorePreviousInputEventState();else{var u=this.dateObject&&this.dateObject.getValue(),m=this.dateObject.getTextAndFormat(),f=m.text,v=m.format;this.currentFormat=v;var g="";g=s&&(n||i||r===c.DateInputInteractionMode.Caret)?this.previousElementValue:f;var y=this.elementValue,D=a.approximateStringMatching({oldText:g,newText:y,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||D&&0!==D.length){if(s&&1===D.length){if(!D[0]||!D[0][0])return void this.restorePreviousInputEventState();if(s&&D[0]&&(D[0][0]===p.Constants.formatSeparator||D[0][1]===p.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var E=1===D.length&&D[0][1]===p.Constants.formatSeparator,b=[],S=!1;if(!E)for(var P=0;P<D.length;P++){var M=this.dateObject.parsePart({symbol:D[P][0],currentChar:D[P][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});b.push(M),S=M.switchToNext}this.options.autoSwitchParts||(S=!1),this.resetSegmentValue=!1;var I,x=b[b.length-1],C=x&&!x.value,O=s&&(n||i)&&C,w=!!x&&x.resetPart,F=!d.isEqual(u,this.dateObject.value),V=this.selection;(!s||O||w)&&(w&&(I=this.currentFormat[V.start]),this.forceUpdate()),D.length&&D[0][0]!==p.Constants.formatSeparator&&(!s||O||w?I?this.setSelection(this.selectionBySymbol(I)):(this.options.autoSwitchParts||D[0][1]!==p.Constants.formatSeparator)&&this.setSelection(this.selectionBySymbol(D[0][0])):s&&(F&&h.isPresent(this.dateObject.getValue())?S&&this.switchDateSegment(1):C&&this.restorePreviousInputEventState())),S||!s||n||i||w||!C?this.options.autoSwitchParts&&(S||E)&&(s||this.switchDateSegment(1)):F?this.currentFormat.length===this.elementValue.length||s&&r!==c.DateInputInteractionMode.Caret&&F||(s&&r!==c.DateInputInteractionMode.Caret?(I=this.currentFormat[V.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(I))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:u,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},e.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},e.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=c.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},e.prototype.onElementChange=function(t){this.triggerChange({event:t})},e.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,i=e.end;this.previousElementSelection={start:n,end:i};var r=(this.options.autoSwitchKeys||[]).map((function(t){return t.toString().toLowerCase().trim()}));if(r.indexOf(t.keyCode.toString())>=0||r.indexOf(t.keyCode)>=0||r.indexOf(t.key.toLowerCase().trim())>=0){var s=r.indexOf(l.Key.TAB.toLowerCase().trim())>=0||r.indexOf(o.KeyCode.TAB)>=0||r.indexOf(o.KeyCode.TAB.toString())>=0;if(!s)return t.preventDefault(),void this.switchDateSegment(1);var a=this.selection,h=a.start,u=a.end;if(t.shiftKey&&s?this.switchDateSegment(-1):this.switchDateSegment(1),h!==this.selection.start||u!==this.selection.end)return void t.preventDefault()}var c=this.currentFormat[this.selection.start],d=this.getStepFromSymbol(c),p=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===o.KeyCode.TAB)){switch(t.keyCode){case o.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),p=!0;break;case o.KeyCode.ARROW_UP:this.modifyDateSegmentValue(d,c,event),p=!0;break;case o.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),p=!0;break;case o.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-d,c,event),p=!0;break;case o.KeyCode.ENTER:break;case o.KeyCode.DELETE:case o.KeyCode.BACKSPACE:if(this.options.allowNulls){var m=this.dateObject.value;this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:m,event:t})}return p=!0,void(t.keyCode===o.KeyCode.BACKSPACE&&((this.options.autoSwitchKeys||[]).indexOf(o.KeyCode.BACKSPACE)>=0||(this.options.autoSwitchKeys||[]).indexOf(l.Key.BACKSPACE)>=0)&&this.switchDateSegment(-1));case l.Key.HOME:this.selectNearestSegment(0);break;case l.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}p&&t.preventDefault()}}},e.prototype.onElementPaste=function(){this.isPasteInProgress=!0},e.prototype.onElementMouseWheel=function(t){if(this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive){var e=t;e.shiftKey?this.switchDateSegment((e.wheelDelta||-e.detail)>0?-1:1):this.modifyDateSegmentValue((e.wheelDelta||-e.detail)>0?1:-1),e.returnValue=!1,e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()}},e.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value;h.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e));var n=this.dateObject&&this.dateObject.getValue();this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(e.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:p.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:p.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t={start:0,end:0};return null!==this.element&&void 0!==this.element.selectionStart&&(t={start:this.element.selectionStart,end:this.element.selectionEnd}),t},enumerable:!0,configurable:!0}),e.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},e.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},e.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||i>=0;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(i>=0&&this.currentFormat[i]!==p.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},e.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],r="",s="";if(t<0){for(var a=n+t;a>=0;a--)if((s=this.currentFormat[a])!==p.Constants.formatSeparator&&s!==i){n=a,r=s;break}}else for(a=n+t;a<this.currentFormat.length;a++)if((s=this.currentFormat[a])!==p.Constants.formatSeparator&&s!==i){n=a,r=s;break}if(r)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(r)),void(this.interactionMode=c.DateInputInteractionMode.Selection)}var o=this.selection,l=o.start,h=o.end;if(l<h&&this.currentFormat[l]!==this.currentFormat[h-1])return this.setSelection(this.selectionByIndex(t>0?l:h-1)),void(this.resetSegmentValue=!0);for(var u=this.currentFormat[l],d=l+t;d>0&&d<this.currentFormat.length&&(this.currentFormat[d]===u||this.currentFormat[d]===p.Constants.formatSeparator);)d+=t;if(this.currentFormat[d]!==p.Constants.formatSeparator){for(var m=d;m>=0&&m<this.currentFormat.length&&this.currentFormat[m]===this.currentFormat[d];)m+=t;d>m&&(m+1!==l||d+1!==h)?(this.setSelection({start:m+1,end:d+1}),this.resetSegmentValue=!0):d<m&&(d!==l||m!==h)&&(this.setSelection({start:d,end:m}),this.resetSegmentValue=!0)}},e.prototype.modifyDateSegmentValue=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject){var i=this.value,r=1*t,s=this.caret();if("S"===(e=e||this.currentFormat[s[0]])&&!this.options.steps.millisecond){var a=h.millisecondDigitsInFormat(this.inputFormat);r=h.millisecondStepFor(a)}this.dateObject.modifyPart(e,r),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e))}},e.prototype.tryTriggerValueChange=function(t){if(void 0===t&&(t={oldValue:null,event:{}}),!d.isEqual(this.value,t.oldValue))return this.triggerValueChange(t)},e.prototype.triggerValueChange=function(t){return void 0===t&&(t={oldValue:null,event:{}}),this.trigger("valueChange",h.extend(t,{value:this.value}))},e.prototype.triggerInput=function(t){return void 0===t&&(t={event:{}}),this.trigger("input",h.extend(t,{value:this.value}))},e.prototype.triggerInputEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("inputEnd",h.extend(t,{value:this.value}))},e.prototype.triggerFocus=function(t){return void 0===t&&(t={event:{}}),this.trigger("focus",h.extend({},t))},e.prototype.triggerFocusEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("focusEnd",h.extend({},t))},e.prototype.triggerBlur=function(t){return void 0===t&&(t={event:{}}),this.trigger("blur",h.extend({},t))},e.prototype.triggerBlurEnd=function(t){return void 0===t&&(t={event:{}}),this.trigger("blurEnd",h.extend({},t))},e.prototype.triggerChange=function(t){return void 0===t&&(t={event:{}}),this.trigger("change",h.extend(t,{value:this.value}))},e.prototype.triggerKeyDown=function(t){return void 0===t&&(t={event:{}}),this.trigger("keydown",h.extend({},t))},e.prototype.triggerMouseWheel=function(t){return void 0===t&&(t={event:{}}),this.trigger("mousewheel",h.extend({},t))},e.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},e.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,n=t.format;this.currentFormat=n,this.currentText=e},e.prototype.setElementValue=function(t){this.element.value=t},e.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},e.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},e.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},e.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,n=t.end;this.setSelection({start:e||0,end:n||0})},e.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},e.prototype.verifyValue=function(t){if(t&&!h.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},e.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,i=this.dateObject.getTextAndFormat(n),r=i.text,s=i.format;this.currentFormat=s,this.currentText=r;var a=!this.isActive&&h.isPresent(this.options.placeholder)&&!this.dateObject.hasValue();h.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder);var o=a?"":r;this.previousElementValue=this.elementValue,this.setElementValue(o),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},e.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],r=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==r.selectionStart&&(n&&(h.isDocumentAvailable()&&document.activeElement!==r&&r.focus(),r.setSelectionRange(t,e)),i=[r.selectionStart,r.selectionEnd])}catch(t){i=[]}return i}},e.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||n>=0;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(n>=0&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},e.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e&&(e=i));e<0&&(e=0),this.caret(0,0),this.caret(e,n)},e.prototype.getDateObject=function(t){var e=(this.dateObject||{}||null).leadingZero,n=this.createDateObject({value:t});return n.setLeadingZero(this.isActive?e:null),n},e.prototype.createDateObject=function(t){return void 0===t&&(t={}),new s.DateObject(h.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t))},e}(u.Observable);e.DateInput=f},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),r=n(9),s=n(3),a=n(2),o=n(1),l=/d|M|H|h|m|s/,h=function(){function t(t){var e=t.intlService,n=t.formatPlaceholder,r=t.format,s=t.cycleTime,a=void 0!==s&&s,l=t.twoDigitYearMax,h=void 0===l?o.Constants.twoDigitYearMax:l,u=t.value,c=void 0===u?null:u,d=t.autoCorrectParts,p=void 0===d||d;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=i.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=r,this.cycleTime=a,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=h,this.autoCorrectParts=p,c)this._value=i.cloneDate(c);else{this._value=i.getDate(new Date);for(var m=this.dateFormatString(this.value,this.format).symbols,f=0;f<m.length;f++)this.setExisting(m[f],!1)}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localeId",{get:function(){for(var t=o.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],r=this.intl.cldr[i];if(r.name&&r.calendar&&r.numbers&&r.name!==o.Constants.defaultLocaleId){t=r.name;break}}return t},enumerable:!0,configurable:!0}),t.prototype.setValue=function(t){t?i.isEqual(t,this._value)||(this._value=i.cloneDate(t),this.modifyExisting(!0)):(this._value=i.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},t.prototype.hasValue=function(){var t=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce((function(e,n){return e||"literal"!==n.type&&"dayperiod"!==n.type&&t.getExisting(n.pattern[0])}),!1)},t.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return i.cloneDate(this.value)},t.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},t.prototype.getTextAndFormat=function(t){void 0===t&&(t="");var e=t||this.format,n=this.intl.formatDate(this.value,e,this.localeId),i=this.dateFormatString(this.value,e);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var r="",o=this.intl.formatDate(this.value,e,this.localeId),l=this.getFormattedInvalidDates(e),h=0;h<o.length;h++){var u=i.symbols[h];if("literal"===i.partMap[h].type)r+=n[h];else if(this.getInvalidDatePartValue(u)){var c=this.getPartsForSegment(i,h);if("M"===u){var d=(a.parseToInt(this.getInvalidDatePartValue(u))+1).toString();if(c.length>2)r+=l[u][h];else if(this.getInvalidDatePartValue(u))r+=s.padZero(c.length-d.length)+d,h+=c.length-1;else r+=l[u][h]}else if(this.getInvalidDatePartValue(u)){d=this.getInvalidDatePartValue(u).toString();r+=s.padZero(c.length-d.length)+d,h+=c.length-1}else r+=l[u][h]}else r+=n[h]}n=r}return this.merge(n,i)},t.prototype.getFormattedInvalidDates=function(t){var e=this;void 0===t&&(t="");var n=t||this.format,i={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){var r=e.getInvalidDatePart(t).date;if(r){var s=e.intl.formatDate(r,n,e.localeId);i[t]=s}})),i},t.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},t.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},t.prototype.setExisting=function(t,e){switch(t){case"y":this.year=e,!1===e&&this._value.setFullYear(2e3);break;case"M":this.month=e,!1===e&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},t.prototype.modifyPart=function(t,e){if(a.isPresent(t)&&a.isPresent(e)&&0!==e){var n,r=i.cloneDate(this.value),s=!1,o="M"===t,l="d"===t||"E"===t,h=this.getExisting(t);if(this.autoCorrectParts||!l&&!o)switch(t){case"y":r.setFullYear(r.getFullYear()+e);break;case"M":r=i.addMonths(this.value,e);break;case"d":case"E":r.setDate(r.getDate()+e);break;case"h":case"H":r.setHours(r.getHours()+e),s=!0;break;case"m":r.setMinutes(r.getMinutes()+e),s=!0;break;case"s":r.setSeconds(r.getSeconds()+e),s=!0;break;case"S":r.setMilliseconds(r.getMilliseconds()+e);break;case"a":r.setHours(r.getHours()+12*e),s=!0}else{var u=this._partiallyInvalidDate.invalidDateParts||{},c=this.getInvalidDatePartValue(t),d=u.y.value||r.getFullYear(),p=u.M.value||r.getMonth(),m=u.d.value||u.E.value||r.getDate(),f=u.h.value||u.H.value||r.getHours(),v=u.m.value||r.getMinutes(),g=u.s.value||r.getSeconds(),y=u.S.value||r.getMilliseconds();switch(t){case"y":d+=e;break;case"M":p+=e;break;case"d":case"E":m+=e}if("M"===t){if((p<0||p>11)&&h)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(!h){if(p<0)p=a.clamp(p%11+1+11,0,11);else{var D=a.isPresent(c)?p:(e-1)%12;p=a.clamp(D,0,11)}p=a.clamp(p,0,11)}p=a.clamp(p,0,11)}else if("d"===t)if(h){if(m<=0||m>31)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!h){if(a.isPresent(c)&&(m<=0||m>31))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);if(e<0){var E=a.isPresent(c)?m:31-Math.abs(e%31)+1;m=a.clamp(E,1,31)}else{E=a.isPresent(c)?m:e%31;m=a.clamp(E,1,31)}m=a.clamp(m,1,31)}var b=i.createDate(d,p,m,f,v,g,y),S=o||l?this.modifyDateSymbolWithValue(r,t,o?p:m):null,P=a.areDatePartsEqualTo(b,d,p,m,f,v,g,y);this.getValue()&&a.areDatePartsEqualTo(b,d,p,m,f,v,g,y)?(r=i.cloneDate(b),this.markDatePartsAsExisting()):o&&S?S.getMonth()===p?this.getExisting("d")?P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(this.resetInvalidDateSymbol(t),r=i.cloneDate(b),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),r=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:p,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):l&&S&&(S.getDate()===m?this.getExisting("M")?P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(S),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)):P?(r=i.cloneDate(b),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),r=i.cloneDate(S)):(n=!0,this.setInvalidDatePart(t,{value:m,date:i.cloneDate(this.value),startDateOffset:e,startDate:i.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(r=this.normalizeCentury(r)),s&&!this.cycleTime&&(r.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=r,this.getValue()&&this.resetInvalidDate())}},t.prototype.parsePart=function(t){for(var e,n=t.symbol,r=t.currentChar,o=t.resetSegmentValue,l=t.cycleSegmentValue,h=t.rawTextValue,u=t.isDeleting,c=t.originalFormat,d=!l,p=this.dateFormatString(this.value,this.format),m=p.partMap.filter((function(t){return"literal"===t.type})).map((function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}})),f=0;f<m.length;f++){for(var v=m[f],g=0;g<v.pattern.length;g++)m[f+g]&&(m[f+g].literal=v.pattern[g]);f+=v.pattern.length-1}var y={value:null,switchPart:!1,resetPart:d&&"M"===n&&p.partMap.filter((function(t){return"month"===t.type})).some((function(t){return t.pattern.length>2}))};if(!r){if(!d)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),{value:null,switchToNext:!1};for(f=0;f<m.length;f++){var D=m[f].literal,E=h.startsWith(D),b=h.endsWith(D),S=h.indexOf(D+D)>=0;if(E||b||S)return this.resetLeadingZero(),this.setExisting(n,!1),this.resetInvalidDateSymbol(n),a.extend(y,{value:null,switchToNext:!1})}}var P=this.intl.formatDate(this.value,this.format,this.localeId),M=p.symbols,I=!1,x="",C="",O="",w="",F="",V="",k=c.indexOf(n),T=c.lastIndexOf(n)-k+1,_=this.format===M||this.format===c||this.format.length===c.length;if(d){var A=0;for(f=0;f<P.length;f++){if(M[f]===n)C+=this.getExisting(n)?P[f]:"0",u?(A<T-1&&(O+=h[f]||""),A++):O+=h[f]||"",I=!0;else I?(V+=P[f],F+=P[f]):(x+=P[f],w+=P[f])}if(_){if(c.length<h.length)O+=r;else if(!u&&c.length>h.length){var N=c.length-h.length;(j=O.substring(0,O.length-N))&&j.length>0&&(O=j)}if(O.length>T)return a.extend(y,{value:null,switchToNext:!1})}else{A=0,C="",O="",x="",V="",I=!1;for(f=0;f<c.length;f++){if(c[f]===n)C+=this.getExisting(n)?P[f]||"":"0",u?(A<T-1&&(O+=h[f]||""),A++):O+=h[f]||"",I=!0;else I?V+=h[f]||"":x+=h[f]||""}if(c.length<h.length)O+=r;else if(!u&&c.length>h.length){var j;N=c.length-h.length;(j=O.substring(0,O.length-N))&&j.length>0&&(O=j)}}}else for(f=0;f<P.length;f++){if(M[f]===n)C+=this.getExisting(n)?P[f]:"0",I=!0;else I?V+=P[f]:x+=P[f]}var L=null,K=this.matchMonth(r),B=this.matchDayPeriod(r,n),W="0"===r,H=this.leadingZero||{};W&&!d?0!==parseInt(o?r:C+r,10)||this.isAbbrMonth(p.partMap,n)||this.incrementLeadingZero(n):this.resetLeadingZero();var R=this.partPattern(p.partMap,n),Z=R?R.pattern:null;if(d&&u&&!O)return this.setExisting(n,!1),a.extend(y,{value:null,switchToNext:!1});var Y=C.length-3,U=!0;for(f=Math.max(0,Y);f<=C.length&&U;f++){var q=o?r:d?O:C.substring(f)+r;this.autoCorrectParts||(U=!1,d||(q=s.unpadZero(q),q=s.padZero(T-q.length)+q)),d&&(U=!1,q=s.unpadZero(q));var z=parseInt(q,10),G=x+q+V;L=this.intl.parseDate(G,this.format,this.localeId),!d||_||a.isValidDate(L)||(L=this.intl.parseDate(w+q+F,this.format,this.localeId),O=q);var J=!isNaN(parseInt(r,10))||d&&u&&""===r;if(!L&&!isNaN(z)&&J){if("M"===n&&!K){var Q=z-1;Q>-1&&Q<12&&((L=i.cloneDate(this.value)).setMonth(Q),L.getMonth()!==Q&&(L=i.lastDayOfMonth(i.addMonths(L,-1))))}"y"===n&&(L=i.createDate(parseInt(q,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),(d&&a.isValidDate(L)||!d&&L)&&this.date&&L.getDate()!==this.value.getDate()&&(L=i.lastDayOfMonth(i.addMonths(L,-1))))}if(d&&a.isValidDate(L)||!d&&L){var X=this.intl.parseDate(""+x+this.peek(q,Z)+V,this.format,this.localeId),$=this.patternLength(Z)||Z.length,tt=((this.leadingZero||{})[n]||0)+(s.unpadZero(q)||r).length>=$,et=null===X||H[n]&&Z.length<=q.length||tt;if(this.shouldNormalizeCentury()&&(L=this.normalizeCentury(L)),this._value=L,this.setExisting(n,!0),d&&et)if("M"===n){if(T<=2)et=(nt=a.parseToInt(O))>=2}else et=et?_?O.length===T:O.length>T:et;return a.extend(y,{value:this.value,switchToNext:et})}}if(K&&(L=this.intl.parseDate(x+K+V,this.format,this.localeId)))return this._value=L,this.setExisting(n,!0),a.extend(y,{value:this.value,switchToNext:!1});if(B&&(L=this.intl.parseDate(x+B+V,this.format)))return this._value=L,a.extend(y,{value:this.value,switchToNext:!0});if(W&&(this.leadingZero=this.isAbbrMonth(p.partMap,n)?null:((e={})[n]=!0,e),this.setExisting(n,!1)),d&&O.length>T)return a.extend(y,{value:null,switchToNext:!1});if(!this.autoCorrectParts){this.setExisting(n,!1);var nt=void 0,it=d?O:C,rt=a.parseToInt(it);if(a.isNumber(rt)&&(nt="M"===n?a.clamp(rt-1,0,11):rt),a.isNumber(nt)){var st=this.modifyDateSymbolWithValue(this.value,n,nt);this.setExisting(n,!1),this.setInvalidDatePart(n,{value:nt,date:i.cloneDate(st),startDate:this._partiallyInvalidDate.startDate||i.cloneDate(this.value)})}}return a.extend(y,{value:null,switchToNext:!1})},t.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(s.dateSymbolMap,{})[t]},t.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},t.prototype.setLeadingZero=function(t){this.leadingZero=t},t.prototype.normalizeCentury=function(t){if(!a.isPresent(t))return t;var e=a.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e);return a.setYears(t,n+e)},t.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},t.prototype.isAbbrMonth=function(t,e){var n=this.partPattern(t,e);return"month"===n.type&&n.names},t.prototype.partPattern=function(t,e){return t.filter((function(t){return-1!==t.pattern.indexOf(e)}))[0]},t.prototype.peek=function(t,e){var n=t.replace(/^0*/,"")+"0";return s.padZero(e.length-n.length)+n},t.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0===this.monthNames.length)return"";for(;this.typedMonthPart.length>0;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(n>=1&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},t.prototype.matchDayPeriod=function(t,e){var n=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(n))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(n))return this.dayPeriods.pm}return""},t.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},t.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},t.prototype.patternLength=function(t){return"y"===t[0]?4:l.test(t)?2:0},t.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var l=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;l>0;)i.push(this.symbols[n[a].pattern[0]]||o.Constants.formatSeparator),s.push(n[a]),l--;var h=new r.Mask;return h.symbols=i.join(""),h.partMap=s,h},t.prototype.merge=function(t,e){for(var n="",i="",r=e.symbols,s=!1,o=0,l=this.getFormattedInvalidDates(r),h=r.length-1;h>=0;h--){var u=this.getPartsForSegment(e,h);if(-1===this.knownParts.indexOf(r[h])||this.getExisting(r[h]))this.autoCorrectParts?n=t[h]+n:t.length!==r.length?s?n=t[h]+n:o>0?(n=t[h]+n,--o<=0&&(s=!0)):n=(t[h+t.length-r.length]||"")+n:n=t[h]+n,i=r[h]+i;else{var c=r[h],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;h>=0&&c===r[h];)h--;h++}if(this.leadingZero&&this.leadingZero[c])n="0"+n;else if(!this.autoCorrectParts&&this.getInvalidDatePartValue(c)){var p=this.getInvalidDatePartValue(c).toString();"M"===c?(p=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),u.length>2?n=l[c][h]+n:(n=(p=(a.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,o=p.length-u.length)):(n=p+n,d=p.length-1,o=p.length-u.length)}else n=this.dateFieldName(e.partMap[h])+n;for(;i.length<n.length;)i=r[h]+i;0!==d&&(h=h-d+(t.length-r.length))}}return{text:n,format:i}},t.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:"formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))},t.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},t.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some((function(t){return"yy"===t.pattern}))},t.prototype.resetInvalidDate=function(){var t=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(e){t.resetInvalidDatePart(e)}))},t.prototype.resetInvalidDateSymbol=function(t){var e=this;this.resetInvalidDatePart(t);var n=!0;Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach((function(t){e._partiallyInvalidDate.invalidDateParts[t]&&a.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)})),n&&this.resetInvalidDate()},t.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},t.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},t.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},t.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=void 0===n?null:n,r=e.date,s=void 0===r?null:r,a=e.startDateOffset,o=void 0===a?0:a,l=e.startDate,h=void 0===l?null:l;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=i,this._partiallyInvalidDate.invalidDateParts[t].date=s,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=o,this._partiallyInvalidDate.startDate=h)},t.prototype.modifyDateSymbolWithOffset=function(t,e,n){var r=i.cloneDate(t),s=!1;switch(e){case"y":r.setFullYear(r.getFullYear()+n);break;case"M":r=i.addMonths(this.value,n);break;case"d":case"E":r.setDate(r.getDate()+n);break;case"h":case"H":r.setHours(r.getHours()+n),s=!0;break;case"m":r.setMinutes(r.getMinutes()+n),s=!0;break;case"s":r.setSeconds(r.getSeconds()+n),s=!0;break;case"S":r.setMilliseconds(r.getMilliseconds()+n);break;case"a":r.setHours(r.getHours()+12*n),s=!0}return{date:r,timeModified:s}},t.prototype.modifyDateSymbolWithValue=function(t,e,n){var r=i.cloneDate(t);switch(e){case"y":r.setFullYear(n);break;case"M":r=i.addMonths(t,n-t.getMonth());break;case"d":case"E":r.setDate(n);break;case"h":case"H":r.setHours(n);break;case"m":r.setMinutes(n);break;case"s":r.setSeconds(n);break;case"S":r.setMilliseconds(n);break;case"a":r.setHours(n)}return r},t.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},t.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],r=e;r<t.partMap.length;r++){var s=t.partMap[r];if(n.type!==s.type||n.pattern!==s.pattern)break;i.push(s)}for(r=e-1;r>=0;r--){s=t.partMap[r];if(n.type!==s.type||n.pattern!==s.pattern)break;i.unshift(s)}return i},t}();e.DateObject=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){this.symbols="",this.partMap=[]};e.Mask=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),r={events:{}},s=function(){function t(t){this.options=i.extend({},r,t)}return t.prototype.destroy=function(){},t.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},t}();e.Observable=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.None="none",t.Caret="caret",t.Selection="selection"}(e.DateInputInteractionMode||(e.DateInputInteractionMode={}))}])}));
@@ -631,6 +631,13 @@ var DateObject = /** @class */ (function () {
631
631
  if (originalFormat.length < rawInputValue.length) {
632
632
  datePartText += currentChar;
633
633
  }
634
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
635
+ var lengthDiff = originalFormat.length - rawInputValue.length;
636
+ var trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
637
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
638
+ datePartText = trimmedDatePartText;
639
+ }
640
+ }
634
641
  if (datePartText.length > segmentLength) {
635
642
  return extend(parseResult, { value: null, switchToNext: false });
636
643
  }
@@ -668,6 +675,13 @@ var DateObject = /** @class */ (function () {
668
675
  if (originalFormat.length < rawInputValue.length) {
669
676
  datePartText += currentChar;
670
677
  }
678
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
679
+ var lengthDiff = originalFormat.length - rawInputValue.length;
680
+ var trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
681
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
682
+ datePartText = trimmedDatePartText;
683
+ }
684
+ }
671
685
  }
672
686
  }
673
687
  else {
@@ -713,14 +727,19 @@ var DateObject = /** @class */ (function () {
713
727
  if (!tryParse) {
714
728
  break;
715
729
  }
716
- if (!this.autoCorrectParts) {
717
- tryParse = false;
718
- }
719
730
  var middle = resetSegmentValue ?
720
731
  currentChar :
721
732
  isInCaretMode ?
722
733
  datePartText :
723
734
  (current.substring(i) + currentChar);
735
+ if (!this.autoCorrectParts) {
736
+ tryParse = false;
737
+ if (!isInCaretMode) {
738
+ // try to make an exact match as there will be only 1 attempt
739
+ middle = unpadZero(middle);
740
+ middle = padZero(segmentLength - middle.length) + middle;
741
+ }
742
+ }
724
743
  if (isInCaretMode) {
725
744
  // try to make an exact match as there will be only 1 attempt
726
745
  tryParse = false;
@@ -823,9 +842,6 @@ var DateObject = /** @class */ (function () {
823
842
  }
824
843
  if (!this.autoCorrectParts) {
825
844
  this.setExisting(symbol, false);
826
- // todo check if string is better
827
- // const padPrefix = padZero(Math.abs(current.length - datePartText.length));
828
- // const paddedDatePartText = padPrefix + datePartText;
829
845
  var datePartValue = void 0;
830
846
  var textToParse = isInCaretMode ? datePartText : current;
831
847
  var parsedValue = parseToInt(textToParse);
@@ -369,20 +369,13 @@ var DateInput = /** @class */ (function (_super) {
369
369
  }
370
370
  }
371
371
  else if (hasCaret) {
372
- if (this.options.format.length !== this.currentFormat.length) {
373
- if (hasDateValueChanged && isPresent(this.dateObject.getValue())) {
374
- if (switchPart) {
375
- this.switchDateSegment(1);
376
- }
372
+ if (hasDateValueChanged && isPresent(this.dateObject.getValue())) {
373
+ if (switchPart) {
374
+ this.switchDateSegment(1);
377
375
  }
378
376
  }
379
377
  else {
380
- if (hasDateValueChanged) {
381
- if (lastParseResultHasNoValue) {
382
- this.restorePreviousInputEventState();
383
- }
384
- }
385
- else {
378
+ if (lastParseResultHasNoValue) {
386
379
  this.restorePreviousInputEventState();
387
380
  }
388
381
  }
@@ -709,11 +702,12 @@ var DateInput = /** @class */ (function (_super) {
709
702
  var selection = this.selection;
710
703
  if (this.isInCaretMode()) {
711
704
  var start = selection.start;
712
- var currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)];
705
+ var currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)] ||
706
+ this.currentFormat[start];
713
707
  var symbol = "";
714
708
  var symbolCandidate = "";
715
709
  if (offset < 0) {
716
- for (var i = 0; i < start + offset; i++) {
710
+ for (var i = start + offset; i >= 0; i--) {
717
711
  symbolCandidate = this.currentFormat[i];
718
712
  if (symbolCandidate !== Constants.formatSeparator &&
719
713
  symbolCandidate !== currentSymbol) {
@@ -616,6 +616,13 @@ export class DateObject {
616
616
  if (originalFormat.length < rawInputValue.length) {
617
617
  datePartText += currentChar;
618
618
  }
619
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
620
+ const lengthDiff = originalFormat.length - rawInputValue.length;
621
+ const trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
622
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
623
+ datePartText = trimmedDatePartText;
624
+ }
625
+ }
619
626
  if (datePartText.length > segmentLength) {
620
627
  return extend(parseResult, { value: null, switchToNext: false });
621
628
  }
@@ -653,6 +660,13 @@ export class DateObject {
653
660
  if (originalFormat.length < rawInputValue.length) {
654
661
  datePartText += currentChar;
655
662
  }
663
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
664
+ const lengthDiff = originalFormat.length - rawInputValue.length;
665
+ const trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
666
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
667
+ datePartText = trimmedDatePartText;
668
+ }
669
+ }
656
670
  }
657
671
  }
658
672
  else {
@@ -698,14 +712,19 @@ export class DateObject {
698
712
  if (!tryParse) {
699
713
  break;
700
714
  }
701
- if (!this.autoCorrectParts) {
702
- tryParse = false;
703
- }
704
715
  let middle = resetSegmentValue ?
705
716
  currentChar :
706
717
  isInCaretMode ?
707
718
  datePartText :
708
719
  (current.substring(i) + currentChar);
720
+ if (!this.autoCorrectParts) {
721
+ tryParse = false;
722
+ if (!isInCaretMode) {
723
+ // try to make an exact match as there will be only 1 attempt
724
+ middle = unpadZero(middle);
725
+ middle = padZero(segmentLength - middle.length) + middle;
726
+ }
727
+ }
709
728
  if (isInCaretMode) {
710
729
  // try to make an exact match as there will be only 1 attempt
711
730
  tryParse = false;
@@ -808,9 +827,6 @@ export class DateObject {
808
827
  }
809
828
  if (!this.autoCorrectParts) {
810
829
  this.setExisting(symbol, false);
811
- // todo check if string is better
812
- // const padPrefix = padZero(Math.abs(current.length - datePartText.length));
813
- // const paddedDatePartText = padPrefix + datePartText;
814
830
  let datePartValue;
815
831
  const textToParse = isInCaretMode ? datePartText : current;
816
832
  const parsedValue = parseToInt(textToParse);
@@ -360,20 +360,13 @@ export class DateInput extends Observable {
360
360
  }
361
361
  }
362
362
  else if (hasCaret) {
363
- if (this.options.format.length !== this.currentFormat.length) {
364
- if (hasDateValueChanged && isPresent(this.dateObject.getValue())) {
365
- if (switchPart) {
366
- this.switchDateSegment(1);
367
- }
363
+ if (hasDateValueChanged && isPresent(this.dateObject.getValue())) {
364
+ if (switchPart) {
365
+ this.switchDateSegment(1);
368
366
  }
369
367
  }
370
368
  else {
371
- if (hasDateValueChanged) {
372
- if (lastParseResultHasNoValue) {
373
- this.restorePreviousInputEventState();
374
- }
375
- }
376
- else {
369
+ if (lastParseResultHasNoValue) {
377
370
  this.restorePreviousInputEventState();
378
371
  }
379
372
  }
@@ -684,11 +677,12 @@ export class DateInput extends Observable {
684
677
  const selection = this.selection;
685
678
  if (this.isInCaretMode()) {
686
679
  let start = selection.start;
687
- const currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)];
680
+ const currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)] ||
681
+ this.currentFormat[start];
688
682
  let symbol = "";
689
683
  let symbolCandidate = "";
690
684
  if (offset < 0) {
691
- for (let i = 0; i < start + offset; i++) {
685
+ for (let i = start + offset; i >= 0; i--) {
692
686
  symbolCandidate = this.currentFormat[i];
693
687
  if (symbolCandidate !== Constants.formatSeparator &&
694
688
  symbolCandidate !== currentSymbol) {
@@ -633,6 +633,13 @@ var DateObject = /** @class */ (function () {
633
633
  if (originalFormat.length < rawInputValue.length) {
634
634
  datePartText += currentChar;
635
635
  }
636
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
637
+ var lengthDiff = originalFormat.length - rawInputValue.length;
638
+ var trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
639
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
640
+ datePartText = trimmedDatePartText;
641
+ }
642
+ }
636
643
  if (datePartText.length > segmentLength) {
637
644
  return utils_2.extend(parseResult, { value: null, switchToNext: false });
638
645
  }
@@ -670,6 +677,13 @@ var DateObject = /** @class */ (function () {
670
677
  if (originalFormat.length < rawInputValue.length) {
671
678
  datePartText += currentChar;
672
679
  }
680
+ else if (!isDeleting && originalFormat.length > rawInputValue.length) {
681
+ var lengthDiff = originalFormat.length - rawInputValue.length;
682
+ var trimmedDatePartText = datePartText.substring(0, datePartText.length - lengthDiff);
683
+ if (trimmedDatePartText && trimmedDatePartText.length > 0) {
684
+ datePartText = trimmedDatePartText;
685
+ }
686
+ }
673
687
  }
674
688
  }
675
689
  else {
@@ -715,14 +729,19 @@ var DateObject = /** @class */ (function () {
715
729
  if (!tryParse) {
716
730
  break;
717
731
  }
718
- if (!this.autoCorrectParts) {
719
- tryParse = false;
720
- }
721
732
  var middle = resetSegmentValue ?
722
733
  currentChar :
723
734
  isInCaretMode ?
724
735
  datePartText :
725
736
  (current.substring(i) + currentChar);
737
+ if (!this.autoCorrectParts) {
738
+ tryParse = false;
739
+ if (!isInCaretMode) {
740
+ // try to make an exact match as there will be only 1 attempt
741
+ middle = utils_1.unpadZero(middle);
742
+ middle = utils_1.padZero(segmentLength - middle.length) + middle;
743
+ }
744
+ }
726
745
  if (isInCaretMode) {
727
746
  // try to make an exact match as there will be only 1 attempt
728
747
  tryParse = false;
@@ -825,9 +844,6 @@ var DateObject = /** @class */ (function () {
825
844
  }
826
845
  if (!this.autoCorrectParts) {
827
846
  this.setExisting(symbol, false);
828
- // todo check if string is better
829
- // const padPrefix = padZero(Math.abs(current.length - datePartText.length));
830
- // const paddedDatePartText = padPrefix + datePartText;
831
847
  var datePartValue = void 0;
832
848
  var textToParse = isInCaretMode ? datePartText : current;
833
849
  var parsedValue = utils_2.parseToInt(textToParse);
@@ -371,20 +371,13 @@ var DateInput = /** @class */ (function (_super) {
371
371
  }
372
372
  }
373
373
  else if (hasCaret) {
374
- if (this.options.format.length !== this.currentFormat.length) {
375
- if (hasDateValueChanged && utils_2.isPresent(this.dateObject.getValue())) {
376
- if (switchPart) {
377
- this.switchDateSegment(1);
378
- }
374
+ if (hasDateValueChanged && utils_2.isPresent(this.dateObject.getValue())) {
375
+ if (switchPart) {
376
+ this.switchDateSegment(1);
379
377
  }
380
378
  }
381
379
  else {
382
- if (hasDateValueChanged) {
383
- if (lastParseResultHasNoValue) {
384
- this.restorePreviousInputEventState();
385
- }
386
- }
387
- else {
380
+ if (lastParseResultHasNoValue) {
388
381
  this.restorePreviousInputEventState();
389
382
  }
390
383
  }
@@ -711,11 +704,12 @@ var DateInput = /** @class */ (function (_super) {
711
704
  var selection = this.selection;
712
705
  if (this.isInCaretMode()) {
713
706
  var start = selection.start;
714
- var currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)];
707
+ var currentSymbol = this.currentFormat[start - (this.elementValue.length - this.currentFormat.length)] ||
708
+ this.currentFormat[start];
715
709
  var symbol = "";
716
710
  var symbolCandidate = "";
717
711
  if (offset < 0) {
718
- for (var i = 0; i < start + offset; i++) {
712
+ for (var i = start + offset; i >= 0; i--) {
719
713
  symbolCandidate = this.currentFormat[i];
720
714
  if (symbolCandidate !== constants_1.Constants.formatSeparator &&
721
715
  symbolCandidate !== currentSymbol) {
@@ -1 +1 @@
1
- System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,s;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,s=e.shift();if(o(t)&&o(s))for(var a in s)i=s[a],i instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((i={})[a]={},i)),r.deepExtend(t[a],s[a])):r.extend(t,((i={})[a]=s[a],i));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=n.cloneDate(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,n,i,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=n(1),p=n(3);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,i=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-n.length],o=e.substring(0,s+e.length-n.length),e=n.substring(0,s),l=[];if(o===e&&0<s)return l.push([i[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";a||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if((!a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator)&&(a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator))return!a&&" "===e[e.length-1]||!a&&e[e.length-1]===r?[[i[s-1],d.Constants.formatSeparator]]:[[i[s-1],e[s-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),s={events:{}};function a(t){this.options=i.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var B=n(2),o=n(8),W=n(4),H=n(0),h=n(1),i=/d|M|H|h|m|s/;function s(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=B.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=B.cloneDate(r);else{this._value=B.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),s.prototype.setValue=function(t){t?B.isEqual(t,this._value)||(this._value=B.cloneDate(t),this.modifyExisting(!0)):(this._value=B.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return B.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l,h=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(n,r),"M"===h?(l=(H.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):i+=e[r]}e=i}return this.merge(e,n)},s.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if(H.isPresent(t)&&H.isPresent(e)&&0!==e){var n,i=B.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=B.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),s=!0;break;case"m":i.setMinutes(i.getMinutes()+e),s=!0;break;case"s":i.setSeconds(i.getSeconds()+e),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),s=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||i.getFullYear(),c=l.M.value||i.getMonth(),d=l.d.value||l.E.value||i.getDate(),p=l.h.value||l.H.value||i.getHours(),m=l.m.value||i.getMinutes(),f=l.s.value||i.getSeconds(),l=l.S.value||i.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?H.clamp(c%11+1+11,0,11):(g=H.isPresent(h)?c:(e-1)%12,H.clamp(g,0,11)),c=H.clamp(c,0,11)),c=H.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(H.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(g=e<0?H.isPresent(h)?d:31-Math.abs(e%31)+1:H.isPresent(h)?d:e%31,H.clamp(g,1,31)),d=H.clamp(d,1,31)}var o=B.createDate(u,c,d,p,m,f,l),h=a||r?this.modifyDateSymbolWithValue(i,t,a?c:d):null,g=H.areDatePartsEqualTo(o,u,c,d,p,m,f,l);this.getValue()&&H.areDatePartsEqualTo(o,u,c,d,p,m,f,l)?(i=B.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(this.resetInvalidDateSymbol(t),i=B.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(this.value),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),s&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,a=t.rawTextValue,r=t.isDeleting,o=t.originalFormat,l=!s,t=this.dateFormatString(this.value,this.format),h=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),u=0;u<h.length;u++){for(var c=h[u],d=0;d<c.pattern.length;d++)h[u+d]&&(h[u+d].literal=c.pattern[d]);u+=c.pattern.length-1}var p={value:null,switchPart:!1,resetPart:l&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length})};if(!n){if(!l)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(u=0;u<h.length;u++){var m=h[u].literal,N=a.startsWith(m),j=a.endsWith(m),m=0<=a.indexOf(m+m);if(N||j||m)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),H.extend(p,{value:null,switchToNext:!1})}}var f=this.intl.formatDate(this.value,this.format,this.localeId),g=t.symbols,v=!1,y="",D="",E="",b="",L="",S="",s=o.indexOf(e),P=o.lastIndexOf(e)-s+1,M=this.format===g||this.format===o||this.format.length===o.length;if(l){for(var I=0,u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?(S+=f[u],L+=f[u]):(y+=f[u],b+=f[u]);if(M){if(o.length<a.length&&(E+=n),E.length>P)return H.extend(p,{value:null,switchToNext:!1})}else{for(S=y=E=D="",v=!1,u=I=0;u<o.length;u++)o[u]===e?(D+=this.getExisting(e)?f[u]||"":"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?S+=a[u]||"":y+=a[u]||"";o.length<a.length&&(E+=n)}}else for(u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",v=!0):v?S+=f[u]:y+=f[u];var x=null,C=this.matchMonth(n),s=this.matchDayPeriod(n,e),O="0"===n,K=this.leadingZero||{},F=(O&&!l?0!==parseInt(i?n:D+n,10)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e):this.resetLeadingZero(),this.partPattern(t.partMap,e)),w=F?F.pattern:null;if(l&&r&&!E)this.setExisting(e,!1);else{var V,F=D.length-3,k=!0;for(u=Math.max(0,F);u<=D.length&&k;u++){this.autoCorrectParts||(k=!1);var _=i?n:l?E:D.substring(u)+n,T=(l&&(k=!1,_=W.unpadZero(_)),parseInt(_,10)),x=this.intl.parseDate(y+_+S,this.format,this.localeId),A=(!l||M||H.isValidDate(x)||(x=this.intl.parseDate(b+_+L,this.format,this.localeId),E=_),!isNaN(parseInt(n,10))||l&&r&&""===n);if(x||isNaN(T)||!A||("M"!==e||C||-1<(A=T-1)&&A<12&&((x=B.cloneDate(this.value)).setMonth(A),x.getMonth()!==A)&&(x=B.lastDayOfMonth(B.addMonths(x,-1))),"y"===e&&(x=B.createDate(parseInt(_,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),l&&H.isValidDate(x)||!l&&x)&&this.date&&x.getDate()!==this.value.getDate()&&(x=B.lastDayOfMonth(B.addMonths(x,-1)))),l&&H.isValidDate(x)||!l&&x)return T=this.intl.parseDate(""+y+this.peek(_,w)+S,this.format,this.localeId),A=this.patternLength(w)||w.length,A=((this.leadingZero||{})[e]||0)+(W.unpadZero(_)||n).length>=A,T=null===T||K[e]&&w.length<=_.length||A,this.shouldNormalizeCentury()&&(x=this.normalizeCentury(x)),this._value=x,this.setExisting(e,!0),l&&T&&("M"===e?P<=2&&(T=2<=(V=H.parseToInt(E))):T=T&&(M?E.length===P:E.length>P)),H.extend(p,{value:this.value,switchToNext:T})}if(C&&(x=this.intl.parseDate(y+C+S,this.format,this.localeId)))return this._value=x,this.setExisting(e,!0),H.extend(p,{value:this.value,switchToNext:!1});if(s&&(x=this.intl.parseDate(y+s+S,this.format)))return this._value=x,H.extend(p,{value:this.value,switchToNext:!0});O&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((F={})[e]=!0,F),this.setExisting(e,!1)),l&&E.length>P||this.autoCorrectParts||(this.setExisting(e,!1),V=void 0,s=H.parseToInt(l?E:D),H.isNumber(s)&&(V="M"===e?H.clamp(s-1,0,11):s),H.isNumber(V)&&(O=this.modifyDateSymbolWithValue(this.value,e,V),this.setExisting(e,!1),this.setInvalidDatePart(e,{value:V,date:B.cloneDate(O),startDate:this._partiallyInvalidDate.startDate||B.cloneDate(this.value)})))}return H.extend(p,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(W.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.normalizeCentury=function(t){var e,n;return H.isPresent(t)?(e=H.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),H.setYears(t,n+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return W.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var r=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[a].pattern[0]]||h.Constants.formatSeparator),s.push(n[a]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var n="",i="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(a=!0)):n=(t[l+t.length-s.length]||"")+n,i=s[l]+i;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(n=(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,r=u.length-h.length)):(n=u+n,d=u.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=s[l]+i;0!==d&&(l=l-d+(t.length-s.length))}}return{text:n,format:i}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&H.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=B.cloneDate(t),s=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=B.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),s=!0;break;case"m":i.setMinutes(i.getMinutes()+n),s=!0;break;case"s":i.setSeconds(i.getSeconds()+n),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),s=!0}return{date:i,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=B.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=B.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(n.type!==a.type||n.pattern!==a.pattern)break;i.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],n.type===a.type&&n.pattern===a.pattern);s--)i.unshift(a);return i},e.DateObject=s},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(10),a=n(9),y=n(4),D=n(7),E=n(3),b=n(0),r=n(6),S=n(5),P=n(2),M=n(1),o={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((n={}).valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:M.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,s.__extends(l,i),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var n=b.isValidDate(this.options.value)?P.cloneDate(this.options.value):new Date(e.formattedValue);b.isValidDate(n)||(n=null),this.element=t,this.options=b.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=S.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=b.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===S.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=b.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},l.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===D.KeyCode.BACKSPACE||e.key===E.Key.BACKSPACE,i=e.keyCode===D.KeyCode.DELETE||e.key===E.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,s=(!this.options.allowCaretMode||e===S.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=S.DateInputInteractionMode.Caret:this.interactionMode=S.DateInputInteractionMode.Selection,this.isInCaretMode());if(s&&this.keyDownEvent.key===E.Key.SPACE)this.restorePreviousInputEventState();else{var a=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,s&&(n||i||e===S.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=y.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||l&&0!==l.length){if(s&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(s&&l[0]&&(l[0][0]===M.Constants.formatSeparator||l[0][1]===M.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var r=1===l.length&&l[0][1]===M.Constants.formatSeparator,h=[],u=!1;if(!r)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,o=h[h.length-1],m=o&&!o.value,f=s&&(n||i)&&m,o=!!o&&o.resetPart,g=!P.isEqual(a,this.dateObject.value),v=this.selection;s&&!f&&!o||(o&&(p=this.currentFormat[v.start]),this.forceUpdate()),l.length&&l[0][0]!==M.Constants.formatSeparator&&(!s||f||o?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===M.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):s&&(this.options.format.length!==this.currentFormat.length?g&&b.isPresent(this.dateObject.getValue())&&u&&this.switchDateSegment(1):g&&!m||this.restorePreviousInputEventState())),u||!s||n||i||o||!m?this.options.autoSwitchParts&&(u||r)&&!s&&this.switchDateSegment(1):g?this.currentFormat.length===this.elementValue.length||s&&e!==S.DateInputInteractionMode.Caret&&g||(s&&e!==S.DateInputInteractionMode.Caret?(p=this.currentFormat[v.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:a,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=S.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},l.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=S.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,e=e.end,n=(this.previousElementSelection={start:n,end:e},(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()}));if(0<=n.indexOf(t.keyCode.toString())||0<=n.indexOf(t.keyCode)||0<=n.indexOf(t.key.toLowerCase().trim())){e=0<=n.indexOf(E.Key.TAB.toLowerCase().trim())||0<=n.indexOf(D.KeyCode.TAB)||0<=n.indexOf(D.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var s,a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===D.KeyCode.TAB)){switch(t.keyCode){case D.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case D.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,event),o=!0;break;case D.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case D.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,event),o=!0;break;case D.KeyCode.ENTER:break;case D.KeyCode.DELETE:case D.KeyCode.BACKSPACE:return this.options.allowNulls&&(s=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:s,event:t})),o=!0,void(t.keyCode===D.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(D.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(E.Key.BACKSPACE))&&this.switchDateSegment(-1));case E.Key.HOME:this.selectNearestSegment(0);break;case E.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&t.preventDefault()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,n=(b.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},l.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)],s="",a="";if(t<0){for(var r=0;r<n+t;r++)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=S.DateInputInteractionMode.Selection)}var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===M.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==M.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0)}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,s;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=b.millisecondDigitsInFormat(this.inputFormat),t=b.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!P.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",b.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!b.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,!this.isActive&&b.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()),e=(b.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],s=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(n&&(b.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),i=[s.selectionStart,s.selectionEnd])}catch(t){i=[]}return i}},l.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},l.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new a.DateObject(b.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l);function l(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=S.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),s=(e.DateInput=n.DateInput,e);for(i in s)a(i,s[i])}],s={},i.m=n,i.c=s,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}}});
1
+ System.register("@progress/kendo-dateinputs-common",["tslib","@progress/kendo-date-math"],function(a){var r,o;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)}],execute:function(){function i(t){var e;return(s[t]||(e=s[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}var n,s;n=[function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}var n=e(2);r.isPresent=function(t){return null!=t},r.isDocumentAvailable=function(){return!!document},r.isNumber=function(t){return r.isPresent(t)&&"number"==typeof t&&!Number.isNaN(t)},r.parseToInt=function(t){return parseInt(t,10)},r.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},r.extend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object.assign.apply(Object,t)},r.deepExtend=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!e.length)return t;var i,s=e.shift();if(o(t)&&o(s))for(var a in s)i=s[a],i instanceof HTMLElement?t[a]=s[a]:o(s[a])?(t[a]||r.extend(t,((i={})[a]={},i)),r.deepExtend(t[a],s[a])):r.extend(t,((i={})[a]=s[a],i));return r.deepExtend.apply(void 0,[t].concat(e))},r.noop=function(){},r.isFunction=function(t){return"function"==typeof t},r.cropTwoDigitYear=function(t){return!r.isPresent(t)||isNaN(t.getTime())?0:Number(t.getFullYear().toString().slice(-2))},r.setYears=function(t,e){t=n.cloneDate(t);return t.setFullYear(e),t},r.millisecondDigitsInFormat=function(t){t=t&&t.match(/S+(\1)/);return t?t[0].length:0},r.millisecondStepFor=function(t){return Math.pow(10,3-t)},r.areDatePartsEqualTo=function(t,e,n,i,s,a,r,o){return!(!t||t.getFullYear()!==e||t.getMonth()!==n||t.getDate()!==i||t.getHours()!==s||t.getMinutes()!==a||t.getSeconds()!==r||t.getMilliseconds()!==o)},r.isValidDate=function(t){return r.isPresent(t)&&t.getTime&&r.isNumber(t.getTime())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Constants={formatSeparator:"_",twoDigitYearMax:68,defaultDateFormat:"d",defaultLocaleId:"en"}},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Key={DELETE:"Delete",BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",SPACE:" ",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var d=n(1),p=n(3);e.padZero=function(t){return new Array(Math.max(t,0)).fill("0").join("")},e.unpadZero=function(t){return t.replace(/^0*/,"")},e.approximateStringMatching=function(t){var e=t.oldText,n=t.newText,i=t.formatPattern,s=t.selectionStart,a=t.isInCaretMode,t=t.keyEvent,r=e[s+e.length-n.length],o=e.substring(0,s+e.length-n.length),e=n.substring(0,s),l=[];if(o===e&&0<s)return l.push([i[s-1],e[s-1]]),l;if(0===o.indexOf(e)&&a&&(t.key===p.Key.DELETE||t.key===p.Key.BACKSPACE)||0===o.indexOf(e)&&!a&&(0===e.length||i[e.length-1]!==i[e.length])){var h="";a||1!==e.length||l.push([i[0],e[0]]);for(var u=e.length;u<o.length;u++)i[u]!==h&&i[u]!==d.Constants.formatSeparator&&(h=i[u],l.push([h,""]));return l}if((!a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator)&&(a||0!==e.indexOf(o)&&i[s-1]!==d.Constants.formatSeparator))return!a&&" "===e[e.length-1]||!a&&e[e.length-1]===r?[[i[s-1],d.Constants.formatSeparator]]:[[i[s-1],e[s-1]]];for(var c=i[0],u=Math.max(0,o.length-1);u<i.length;u++)if(i[u]!==d.Constants.formatSeparator){c=i[u];break}return[[c,e[s-1]]]},e.dateSymbolMap=function(t,e){return t[e.pattern[0]]=e.type,t},e.isInRange=function(t,e,n){return null===t||!(e&&t<e||n&&n<t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(e=e.DateInputInteractionMode||(e.DateInputInteractionMode={})).None="none",e.Caret="caret",e.Selection="selection"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),s={events:{}};function a(t){this.options=i.extend({},s,t)}a.prototype.destroy=function(){},a.prototype.trigger=function(t,e){void 0===e&&(e={});var n={defaultPrevented:!1,preventDefault:function(){n.defaultPrevented=!0}};return!!i.isFunction(this.options.events[t])&&(this.options.events[t](i.extend(n,e,{sender:this})),n.defaultPrevented)},e.Observable=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode={BACKSPACE:8,DELETE:46,TAB:9,ENTER:13,ESCAPE:27,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,SPACE:32,END:35,HOME:36,PAGE_UP:33,PAGE_DOWN:34}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=function(){this.symbols="",this.partMap=[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var B=n(2),o=n(8),W=n(4),H=n(0),h=n(1),i=/d|M|H|h|m|s/;function s(t){var e=t.intlService,n=t.formatPlaceholder,i=t.format,s=t.cycleTime,s=void 0!==s&&s,a=t.twoDigitYearMax,a=void 0===a?h.Constants.twoDigitYearMax:a,r=t.value,r=void 0===r?null:r,t=t.autoCorrectParts,t=void 0===t||t;if(this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEyS",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y",S:"S"},this._value=B.getDate(new Date),this.cycleTime=!1,this._partiallyInvalidDate={startDate:null,invalidDateParts:{E:{value:null,date:null,startDateOffset:0},H:{value:null,date:null,startDateOffset:0},M:{value:null,date:null,startDateOffset:0},a:{value:null,date:null,startDateOffset:0},d:{value:null,date:null,startDateOffset:0},h:{value:null,date:null,startDateOffset:0},m:{value:null,date:null,startDateOffset:0},s:{value:null,date:null,startDateOffset:0},y:{value:null,date:null,startDateOffset:0},S:{value:null,date:null,startDateOffset:0}}},this.intl=e,this.formatPlaceholder=n||"wide",this.format=i,this.cycleTime=s,this.monthNames=this.allFormattedMonths(this.localeId),this.dayPeriods=this.allDayPeriods(this.localeId),this.twoDigitYearMax=a,this.autoCorrectParts=t,r)this._value=B.cloneDate(r);else{this._value=B.getDate(new Date);for(var o=this.dateFormatString(this.value,this.format).symbols,l=0;l<o.length;l++)this.setExisting(o[l],!1)}}Object.defineProperty(s.prototype,"value",{get:function(){return this._value},set:function(t){(!t||t instanceof Date)&&(this._value=t,this.resetInvalidDate())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"localeId",{get:function(){for(var t=h.Constants.defaultLocaleId,e=Object.keys(this.intl.cldr),n=0;n<e.length;n++){var i=e[n],i=this.intl.cldr[i];if(i.name&&i.calendar&&i.numbers&&i.name!==h.Constants.defaultLocaleId){t=i.name;break}}return t},enumerable:!0,configurable:!0}),s.prototype.setValue=function(t){t?B.isEqual(t,this._value)||(this._value=B.cloneDate(t),this.modifyExisting(!0)):(this._value=B.getDate(new Date),this.modifyExisting(!1)),this.resetInvalidDate()},s.prototype.hasValue=function(){var n=this;return this.intl.splitDateFormat(this.format,this.localeId).reduce(function(t,e){return t||"literal"!==e.type&&"dayperiod"!==e.type&&n.getExisting(e.pattern[0])},!1)},s.prototype.getValue=function(){for(var t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return B.cloneDate(this.value)},s.prototype.getFormattedDate=function(t){return this.intl.formatDate(this.getValue(),t,this.localeId)},s.prototype.getTextAndFormat=function(t){var t=(t=void 0===t?"":t)||this.format,e=this.intl.formatDate(this.value,t,this.localeId),n=this.dateFormatString(this.value,t);if(!this.autoCorrectParts&&this._partiallyInvalidDate.startDate){for(var i="",s=this.intl.formatDate(this.value,t,this.localeId),a=this.getFormattedInvalidDates(t),r=0;r<s.length;r++){var o,l,h=n.symbols[r];"literal"!==n.partMap[r].type&&this.getInvalidDatePartValue(h)?(o=this.getPartsForSegment(n,r),"M"===h?(l=(H.parseToInt(this.getInvalidDatePartValue(h))+1).toString(),!(2<o.length)&&this.getInvalidDatePartValue(h)?(i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):this.getInvalidDatePartValue(h)?(l=this.getInvalidDatePartValue(h).toString(),i+=W.padZero(o.length-l.length)+l,r+=o.length-1):i+=a[h][r]):i+=e[r]}e=i}return this.merge(e,n)},s.prototype.getFormattedInvalidDates=function(t){var n=this,i=(t=void 0===t?"":t)||this.format,s={E:"",H:"",M:"",a:"",d:"",h:"",m:"",s:"",y:"",S:""};return Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){var e=n.getInvalidDatePart(t).date;e&&(e=n.intl.formatDate(e,i,n.localeId),s[t]=e)}),s},s.prototype.modifyExisting=function(t){for(var e=this.dateFormatString(this.value,this.format).symbols,n=0;n<e.length;n++)this.setExisting(e[n],t)},s.prototype.getExisting=function(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;case"S":return this.milliseconds;default:return!0}},s.prototype.setExisting=function(t,e){switch(t){case"y":!1===(this.year=e)&&this._value.setFullYear(2e3);break;case"M":!1===(this.month=e)&&this.autoCorrectParts&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;case"S":this.milliseconds=e}this.getValue()&&this.resetInvalidDate()},s.prototype.modifyPart=function(t,e){if(H.isPresent(t)&&H.isPresent(e)&&0!==e){var n,i=B.cloneDate(this.value),s=!1,a="M"===t,r="d"===t||"E"===t,o=this.getExisting(t);if(this.autoCorrectParts||!r&&!a)switch(t){case"y":i.setFullYear(i.getFullYear()+e);break;case"M":i=B.addMonths(this.value,e);break;case"d":case"E":i.setDate(i.getDate()+e);break;case"h":case"H":i.setHours(i.getHours()+e),s=!0;break;case"m":i.setMinutes(i.getMinutes()+e),s=!0;break;case"s":i.setSeconds(i.getSeconds()+e),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+e);break;case"a":i.setHours(i.getHours()+12*e),s=!0}else{var l=this._partiallyInvalidDate.invalidDateParts||{},h=this.getInvalidDatePartValue(t),u=l.y.value||i.getFullYear(),c=l.M.value||i.getMonth(),d=l.d.value||l.E.value||i.getDate(),p=l.h.value||l.H.value||i.getHours(),m=l.m.value||i.getMinutes(),f=l.s.value||i.getSeconds(),l=l.S.value||i.getMilliseconds();switch(t){case"y":u+=e;break;case"M":c+=e;break;case"d":case"E":d+=e}if("M"===t){if((c<0||11<c)&&o)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);o||(c=c<0?H.clamp(c%11+1+11,0,11):(g=H.isPresent(h)?c:(e-1)%12,H.clamp(g,0,11)),c=H.clamp(c,0,11)),c=H.clamp(c,0,11)}else if("d"===t)if(o){if(d<=0||31<d)return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t)}else if(!o){if(H.isPresent(h)&&(d<=0||31<d))return this.setExisting(t,!1),void this.resetInvalidDateSymbol(t);d=(g=e<0?H.isPresent(h)?d:31-Math.abs(e%31)+1:H.isPresent(h)?d:e%31,H.clamp(g,1,31)),d=H.clamp(d,1,31)}var o=B.createDate(u,c,d,p,m,f,l),h=a||r?this.modifyDateSymbolWithValue(i,t,a?c:d):null,g=H.areDatePartsEqualTo(o,u,c,d,p,m,f,l);this.getValue()&&H.areDatePartsEqualTo(o,u,c,d,p,m,f,l)?(i=B.cloneDate(o),this.markDatePartsAsExisting()):a&&h?h.getMonth()===c?this.getExisting("d")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(this.resetInvalidDateSymbol(t),i=B.cloneDate(o),this.getExisting("M")&&this.getExisting("y")&&(this.setExisting("d",!0),this.resetInvalidDateSymbol("d"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:c,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):r&&h&&(h.getDate()===d?this.getExisting("M")?g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(h),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)):g?(i=B.cloneDate(o),this.resetInvalidDateSymbol(t),this.getExisting("d")&&this.getExisting("y")&&(this.setExisting("M",!0),this.resetInvalidDateSymbol("M"))):(this.resetInvalidDateSymbol(t),i=B.cloneDate(h)):(n=!0,this.setInvalidDatePart(t,{value:d,date:B.cloneDate(this.value),startDateOffset:e,startDate:B.cloneDate(this.value)}),this.setExisting(t,!1)))}this.shouldNormalizeCentury()&&(i=this.normalizeCentury(i)),s&&!this.cycleTime&&(i.getDate(),this._value.getDate()),n||(this.setExisting(t,!0),this._value=i,this.getValue()&&this.resetInvalidDate())}},s.prototype.parsePart=function(t){for(var e=t.symbol,n=t.currentChar,i=t.resetSegmentValue,s=t.cycleSegmentValue,a=t.rawTextValue,r=t.isDeleting,o=t.originalFormat,l=!s,t=this.dateFormatString(this.value,this.format),h=t.partMap.filter(function(t){return"literal"===t.type}).map(function(t,e){return{datePartIndex:e,type:t.type,pattern:t.pattern,literal:""}}),u=0;u<h.length;u++){for(var c=h[u],d=0;d<c.pattern.length;d++)h[u+d]&&(h[u+d].literal=c.pattern[d]);u+=c.pattern.length-1}var p={value:null,switchPart:!1,resetPart:l&&"M"===e&&t.partMap.filter(function(t){return"month"===t.type}).some(function(t){return 2<t.pattern.length})};if(!n){if(!l)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),{value:null,switchToNext:!1};for(u=0;u<h.length;u++){var m=h[u].literal,N=a.startsWith(m),j=a.endsWith(m),m=0<=a.indexOf(m+m);if(N||j||m)return this.resetLeadingZero(),this.setExisting(e,!1),this.resetInvalidDateSymbol(e),H.extend(p,{value:null,switchToNext:!1})}}var f=this.intl.formatDate(this.value,this.format,this.localeId),g=t.symbols,v=!1,y="",D="",E="",b="",L="",S="",s=o.indexOf(e),P=o.lastIndexOf(e)-s+1,M=this.format===g||this.format===o||this.format.length===o.length;if(l){for(var I=0,u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?(S+=f[u],L+=f[u]):(y+=f[u],b+=f[u]);if(M){if(o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,F=E.substring(0,E.length-O))&&0<F.length&&(E=F),E.length>P)return H.extend(p,{value:null,switchToNext:!1})}else{for(S=y=E=D="",v=!1,u=I=0;u<o.length;u++)o[u]===e?(D+=this.getExisting(e)?f[u]||"":"0",r?(I<P-1&&(E+=a[u]||""),I++):E+=a[u]||"",v=!0):v?S+=a[u]||"":y+=a[u]||"";o.length<a.length?E+=n:!r&&o.length>a.length&&(O=o.length-a.length,F=E.substring(0,E.length-O))&&0<F.length&&(E=F)}}else for(u=0;u<f.length;u++)g[u]===e?(D+=this.getExisting(e)?f[u]:"0",v=!0):v?S+=f[u]:y+=f[u];var x=null,C=this.matchMonth(n),s=this.matchDayPeriod(n,e),O="0"===n,K=this.leadingZero||{},F=(O&&!l?0!==parseInt(i?n:D+n,10)||this.isAbbrMonth(t.partMap,e)||this.incrementLeadingZero(e):this.resetLeadingZero(),this.partPattern(t.partMap,e)),w=F?F.pattern:null;if(l&&r&&!E)this.setExisting(e,!1);else{var V,F=D.length-3,k=!0;for(u=Math.max(0,F);u<=D.length&&k;u++){var _=i?n:l?E:D.substring(u)+n,T=(this.autoCorrectParts||(k=!1,l)||(_=W.unpadZero(_),_=W.padZero(P-_.length)+_),l&&(k=!1,_=W.unpadZero(_)),parseInt(_,10)),x=this.intl.parseDate(y+_+S,this.format,this.localeId),A=(!l||M||H.isValidDate(x)||(x=this.intl.parseDate(b+_+L,this.format,this.localeId),E=_),!isNaN(parseInt(n,10))||l&&r&&""===n);if(x||isNaN(T)||!A||("M"!==e||C||-1<(A=T-1)&&A<12&&((x=B.cloneDate(this.value)).setMonth(A),x.getMonth()!==A)&&(x=B.lastDayOfMonth(B.addMonths(x,-1))),"y"===e&&(x=B.createDate(parseInt(_,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),l&&H.isValidDate(x)||!l&&x)&&this.date&&x.getDate()!==this.value.getDate()&&(x=B.lastDayOfMonth(B.addMonths(x,-1)))),l&&H.isValidDate(x)||!l&&x)return T=this.intl.parseDate(""+y+this.peek(_,w)+S,this.format,this.localeId),A=this.patternLength(w)||w.length,A=((this.leadingZero||{})[e]||0)+(W.unpadZero(_)||n).length>=A,T=null===T||K[e]&&w.length<=_.length||A,this.shouldNormalizeCentury()&&(x=this.normalizeCentury(x)),this._value=x,this.setExisting(e,!0),l&&T&&("M"===e?P<=2&&(T=2<=(V=H.parseToInt(E))):T=T&&(M?E.length===P:E.length>P)),H.extend(p,{value:this.value,switchToNext:T})}if(C&&(x=this.intl.parseDate(y+C+S,this.format,this.localeId)))return this._value=x,this.setExisting(e,!0),H.extend(p,{value:this.value,switchToNext:!1});if(s&&(x=this.intl.parseDate(y+s+S,this.format)))return this._value=x,H.extend(p,{value:this.value,switchToNext:!0});O&&(this.leadingZero=this.isAbbrMonth(t.partMap,e)?null:((F={})[e]=!0,F),this.setExisting(e,!1)),l&&E.length>P||this.autoCorrectParts||(this.setExisting(e,!1),V=void 0,s=H.parseToInt(l?E:D),H.isNumber(s)&&(V="M"===e?H.clamp(s-1,0,11):s),H.isNumber(V)&&(O=this.modifyDateSymbolWithValue(this.value,e,V),this.setExisting(e,!1),this.setInvalidDatePart(e,{value:V,date:B.cloneDate(O),startDate:this._partiallyInvalidDate.startDate||B.cloneDate(this.value)})))}return H.extend(p,{value:null,switchToNext:!1})},s.prototype.symbolMap=function(t){return this.intl.splitDateFormat(this.format,this.localeId).reduce(W.dateSymbolMap,{})[t]},s.prototype.resetLeadingZero=function(){var t=null!==this.leadingZero;return this.setLeadingZero(null),t},s.prototype.setLeadingZero=function(t){this.leadingZero=t},s.prototype.normalizeCentury=function(t){var e,n;return H.isPresent(t)?(e=H.cropTwoDigitYear(t),n=this.getNormalizedCenturyBase(e),H.setYears(t,n+e)):t},s.prototype.incrementLeadingZero=function(t){var e=this.leadingZero||{};e[t]=(e[t]||0)+1,this.leadingZero=e},s.prototype.isAbbrMonth=function(t,e){t=this.partPattern(t,e);return"month"===t.type&&t.names},s.prototype.partPattern=function(t,e){return t.filter(function(t){return-1!==t.pattern.indexOf(e)})[0]},s.prototype.peek=function(t,e){t=t.replace(/^0*/,"")+"0";return W.padZero(e.length-t.length)+t},s.prototype.matchMonth=function(t){if(this.typedMonthPart+=t.toLowerCase(),0!==this.monthNames.length)for(;0<this.typedMonthPart.length;){for(var e=0;e<this.monthNames.length;e++)if(0===this.monthNames[e].toLowerCase().indexOf(this.typedMonthPart))return this.monthNames[e];var n=parseInt(this.typedMonthPart,10);if(1<=n&&n<=12&&n.toString()===this.typedMonthPart)return this.monthNames[n-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""},s.prototype.matchDayPeriod=function(t,e){t=t.toLowerCase();if("a"===e&&this.dayPeriods){if(this.dayPeriods.am.toLowerCase().startsWith(t))return this.dayPeriods.am;if(this.dayPeriods.pm.toLowerCase().startsWith(t))return this.dayPeriods.pm}return""},s.prototype.allFormattedMonths=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format,this.localeId),n=0;n<e.length;n++)if("month"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return[]},s.prototype.allDayPeriods=function(t){void 0===t&&(t="en");for(var e=this.intl.splitDateFormat(this.format),n=0;n<e.length;n++)if("dayperiod"===e[n].type&&e[n].names)return this.intl.dateFormatNames(t,e[n].names);return null},s.prototype.patternLength=function(t){return"y"===t[0]?4:i.test(t)?2:0},s.prototype.dateFormatString=function(t,e){for(var n=this.intl.splitDateFormat(e,this.localeId),i=[],s=[],a=0;a<n.length;a++)for(var r=this.intl.formatDate(t,{pattern:n[a].pattern},this.localeId).length;0<r;)i.push(this.symbols[n[a].pattern[0]]||h.Constants.formatSeparator),s.push(n[a]),r--;e=new o.Mask;return e.symbols=i.join(""),e.partMap=s,e},s.prototype.merge=function(t,e){for(var n="",i="",s=e.symbols,a=!1,r=0,o=this.getFormattedInvalidDates(s),l=s.length-1;0<=l;l--){var h=this.getPartsForSegment(e,l);if(-1===this.knownParts.indexOf(s[l])||this.getExisting(s[l]))this.autoCorrectParts||t.length===s.length||a?n=t[l]+n:0<r?(n=t[l]+n,--r<=0&&(a=!0)):n=(t[l+t.length-s.length]||"")+n,i=s[l]+i;else{var u,c=s[l],d=0;if(this.autoCorrectParts||!this.autoCorrectParts&&!this.getInvalidDatePartValue(c)){for(;0<=l&&c===s[l];)l--;l++}for(this.leadingZero&&this.leadingZero[c]?n="0"+n:!this.autoCorrectParts&&this.getInvalidDatePartValue(c)?(u=this.getInvalidDatePartValue(c).toString(),"M"===c?(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString(),2<h.length?n=o[c][l]+n:(n=(u=(H.parseToInt(this.getInvalidDatePartValue(c))+1).toString())+n,r=u.length-h.length)):(n=u+n,d=u.length-1,r=u.length-h.length)):n=this.dateFieldName(e.partMap[l])+n;i.length<n.length;)i=s[l]+i;0!==d&&(l=l-d+(t.length-s.length))}}return{text:n,format:i}},s.prototype.dateFieldName=function(t){var e=this.formatPlaceholder||"wide";return e[t.type]||("formatPattern"===e?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e})))},s.prototype.getNormalizedCenturyBase=function(t){return t>this.twoDigitYearMax?1900:2e3},s.prototype.shouldNormalizeCentury=function(){return this.intl.splitDateFormat(this.format).some(function(t){return"yy"===t.pattern})},s.prototype.resetInvalidDate=function(){var e=this;this._partiallyInvalidDate.startDate=null,Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e.resetInvalidDatePart(t)})},s.prototype.resetInvalidDateSymbol=function(t){var e=this,n=(this.resetInvalidDatePart(t),!0);Object.keys(this._partiallyInvalidDate.invalidDateParts).forEach(function(t){e._partiallyInvalidDate.invalidDateParts[t]&&H.isPresent(e._partiallyInvalidDate.invalidDateParts[t].value)&&(n=!1)}),n&&this.resetInvalidDate()},s.prototype.resetInvalidDatePart=function(t){this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t]={value:null,date:null,startDateOffset:0})},s.prototype.getInvalidDatePart=function(t){return this._partiallyInvalidDate.invalidDateParts[t]||{}},s.prototype.getInvalidDatePartValue=function(t){return(this._partiallyInvalidDate.invalidDateParts[t]||{}).value},s.prototype.setInvalidDatePart=function(t,e){var n=e.value,i=e.date,i=void 0===i?null:i,s=e.startDateOffset,s=void 0===s?0:s,e=e.startDate,e=void 0===e?null:e;this._partiallyInvalidDate.invalidDateParts[t]&&(this._partiallyInvalidDate.invalidDateParts[t].value=void 0===n?null:n,this._partiallyInvalidDate.invalidDateParts[t].date=i,this._partiallyInvalidDate.invalidDateParts[t].startDateOffset=s,this._partiallyInvalidDate.startDate=e)},s.prototype.modifyDateSymbolWithOffset=function(t,e,n){var i=B.cloneDate(t),s=!1;switch(e){case"y":i.setFullYear(i.getFullYear()+n);break;case"M":i=B.addMonths(this.value,n);break;case"d":case"E":i.setDate(i.getDate()+n);break;case"h":case"H":i.setHours(i.getHours()+n),s=!0;break;case"m":i.setMinutes(i.getMinutes()+n),s=!0;break;case"s":i.setSeconds(i.getSeconds()+n),s=!0;break;case"S":i.setMilliseconds(i.getMilliseconds()+n);break;case"a":i.setHours(i.getHours()+12*n),s=!0}return{date:i,timeModified:s}},s.prototype.modifyDateSymbolWithValue=function(t,e,n){var i=B.cloneDate(t);switch(e){case"y":i.setFullYear(n);break;case"M":i=B.addMonths(t,n-t.getMonth());break;case"d":case"E":i.setDate(n);break;case"h":case"H":i.setHours(n);break;case"m":i.setMinutes(n);break;case"s":i.setSeconds(n);break;case"S":i.setMilliseconds(n);break;case"a":i.setHours(n)}return i},s.prototype.markDatePartsAsExisting=function(){this.modifyExisting(!0)},s.prototype.getPartsForSegment=function(t,e){for(var n=t.partMap[e],i=[],s=e;s<t.partMap.length;s++){var a=t.partMap[s];if(n.type!==a.type||n.pattern!==a.pattern)break;i.push(a)}for(s=e-1;0<=s&&(a=t.partMap[s],n.type===a.type&&n.pattern===a.pattern);s--)i.unshift(a);return i},e.DateObject=s},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(10),a=n(9),y=n(4),D=n(7),E=n(3),b=n(0),r=n(6),S=n(5),P=n(2),M=n(1),o={format:"d",allowNulls:!1,placeholder:null,cycleTime:!0,locale:null,steps:{millisecond:1,second:1,minute:1,hour:1,day:1,month:1,year:1},formatPlaceholder:null,events:((n={}).valueChange=null,n.input=null,n.inputEnd=null,n.focus=null,n.focusEnd=null,n.blur=null,n.blurEnd=null,n.keydown=null,n.mousewheel=null,n.change=null,n),selectNearestSegmentOnFocus:!1,enableMouseWheel:!1,allowCaretMode:!1,autoSwitchParts:!0,autoSwitchKeys:[],twoDigitYearMax:M.Constants.twoDigitYearMax,autoCorrectParts:!0},n=(i=r.Observable,s.__extends(l,i),Object.defineProperty(l.prototype,"value",{get:function(){return this.dateObject&&this.dateObject.getValue()},enumerable:!0,configurable:!0}),l.prototype.init=function(t,e){var n=b.isValidDate(this.options.value)?P.cloneDate(this.options.value):new Date(e.formattedValue);b.isValidDate(n)||(n=null),this.element=t,this.options=b.extend({},o,e),this.intl=this.options.intlService,this.formatPlaceholder=this.options.formatPlaceholder||"formatPattern",this.dateObject=this.createDateObject(),this.dateObject.setValue(n),this.setTextAndFormat(),this.bindEvents(),this.resetSegmentValue=!0,this.interactionMode=S.DateInputInteractionMode.None,this.forceUpdate()},l.prototype.destroy=function(){this.unbindEvents(),this.dateObject=null,i.prototype.destroy.call(this)},l.prototype.bindEvents=function(){this.onElementDragStart=this.onElementDragStart.bind(this),this.element.addEventListener("dragStart",this.onElementDragStart),this.onElementDrop=this.onElementDrop.bind(this),this.element.addEventListener("drop",this.onElementDrop),this.onElementClick=this.onElementClick.bind(this),this.element.addEventListener("click",this.onElementClick),this.onElementMouseDown=this.onElementMouseDown.bind(this),this.element.addEventListener("mousedown",this.onElementMouseDown),this.element.addEventListener("touchstart",this.onElementMouseDown),this.onElementMouseUp=this.onElementMouseUp.bind(this),this.element.addEventListener("mouseup",this.onElementMouseUp),this.onElementInput=this.onElementInput.bind(this),this.element.addEventListener("input",this.onElementInput),this.onElementKeyDown=this.onElementKeyDown.bind(this),this.element.addEventListener("keydown",this.onElementKeyDown),this.onElementFocus=this.onElementFocus.bind(this),this.element.addEventListener("focus",this.onElementFocus),this.onElementBlur=this.onElementBlur.bind(this),this.element.addEventListener("blur",this.onElementBlur),this.onElementChange=this.onElementChange.bind(this),this.element.addEventListener("change",this.onElementChange),this.onElementPaste=this.onElementPaste.bind(this),this.element.addEventListener("paste",this.onElementPaste),this.onElementMouseWheel=this.onElementMouseWheel.bind(this),this.element.addEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.addEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.unbindEvents=function(){this.element.removeEventListener("dragStart",this.onElementDragStart),this.element.removeEventListener("drop",this.onElementDrop),this.element.removeEventListener("touchstart",this.onElementMouseDown),this.element.removeEventListener("mousedown",this.onElementMouseDown),this.element.removeEventListener("mouseup",this.onElementMouseUp),this.element.removeEventListener("click",this.onElementClick),this.element.removeEventListener("input",this.onElementInput),this.element.removeEventListener("keydown",this.onElementKeyDown),this.element.removeEventListener("focus",this.onElementFocus),this.element.removeEventListener("blur",this.onElementBlur),this.element.removeEventListener("change",this.onElementChange),this.element.removeEventListener("paste",this.onElementPaste),this.element.removeEventListener("DOMMouseScroll",this.onElementMouseWheel),this.element.removeEventListener("mousewheel",this.onElementMouseWheel)},l.prototype.setOptions=function(t,e){void 0===e&&(e=!1),this.options=b.extend(this.options,t),e&&(this.unbindEvents(),this.init(this.element,this.options))},l.prototype.resetLocale=function(){this.unbindEvents(),this.init(this.element,this.options)},l.prototype.isInCaretMode=function(){return this.interactionMode===S.DateInputInteractionMode.Caret},l.prototype.focus=function(){this.element.focus(),this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(0)},l.prototype.onElementDragStart=function(t){t.preventDefault()},l.prototype.onElementDrop=function(t){t.preventDefault()},l.prototype.onElementMouseDown=function(){this.mouseDownStarted=!0,this.focusedPriorToMouseDown=this.isActive},l.prototype.onElementMouseUp=function(t){this.mouseDownStarted=!1,t.preventDefault()},l.prototype.onElementClick=function(t){this.mouseDownStarted=!1;var e,n=this.selection;this.isInCaretMode()&&this.forceUpdate(),3!==t.detail&&(this.isActive&&this.options.selectNearestSegmentOnFocus?(t=this.element.selectionStart!==this.element.selectionEnd,e=b.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()&&!this.focusedPriorToMouseDown,t=!t&&e?0:this.caret()[0],this.selectNearestSegment(t)):this.setSelection(this.selectionByIndex(n.start)))},l.prototype.onElementInput=function(t){this.triggerInput({event:t});var e=this.keyDownEvent||{},n=e.keyCode===D.KeyCode.BACKSPACE||e.key===E.Key.BACKSPACE,i=e.keyCode===D.KeyCode.DELETE||e.key===E.Key.DELETE;if(this.element&&this.dateObject)if(this.isPasteInProgress)this.options.allowCaretMode&&(this.resetSegmentValue=!1),this.updateOnPaste(t),this.isPasteInProgress=!1;else{var e=this.interactionMode,s=(!this.options.allowCaretMode||e===S.DateInputInteractionMode.Caret||i||n||(this.resetSegmentValue=!0),this.options.allowCaretMode?this.interactionMode=S.DateInputInteractionMode.Caret:this.interactionMode=S.DateInputInteractionMode.Selection,this.isInCaretMode());if(s&&this.keyDownEvent.key===E.Key.SPACE)this.restorePreviousInputEventState();else{var a=this.dateObject&&this.dateObject.getValue(),r=this.dateObject.getTextAndFormat(),o=r.text,r=r.format,r=(this.currentFormat=r,s&&(n||i||e===S.DateInputInteractionMode.Caret)?this.previousElementValue:o),o=this.elementValue,l=y.approximateStringMatching({oldText:r,newText:o,formatPattern:this.currentFormat,selectionStart:this.selection.start,isInCaretMode:s,keyEvent:this.keyDownEvent});if(!s||l&&0!==l.length){if(s&&1===l.length){if(!l[0]||!l[0][0])return void this.restorePreviousInputEventState();if(s&&l[0]&&(l[0][0]===M.Constants.formatSeparator||l[0][1]===M.Constants.formatSeparator))return void this.restorePreviousInputEventState()}var r=1===l.length&&l[0][1]===M.Constants.formatSeparator,h=[],u=!1;if(!r)for(var c=0;c<l.length;c++){var d=this.dateObject.parsePart({symbol:l[c][0],currentChar:l[c][1],resetSegmentValue:this.resetSegmentValue,cycleSegmentValue:!this.isInCaretMode(),rawTextValue:this.element.value,isDeleting:n||i,originalFormat:this.currentFormat});h.push(d),u=d.switchToNext}this.options.autoSwitchParts||(u=!1),this.resetSegmentValue=!1;var p,o=h[h.length-1],m=o&&!o.value,f=s&&(n||i)&&m,o=!!o&&o.resetPart,g=!P.isEqual(a,this.dateObject.value),v=this.selection;s&&!f&&!o||(o&&(p=this.currentFormat[v.start]),this.forceUpdate()),l.length&&l[0][0]!==M.Constants.formatSeparator&&(!s||f||o?p?this.setSelection(this.selectionBySymbol(p)):!this.options.autoSwitchParts&&l[0][1]===M.Constants.formatSeparator||this.setSelection(this.selectionBySymbol(l[0][0])):s&&(g&&b.isPresent(this.dateObject.getValue())?u&&this.switchDateSegment(1):m&&this.restorePreviousInputEventState())),u||!s||n||i||o||!m?this.options.autoSwitchParts&&(u||r)&&!s&&this.switchDateSegment(1):g?this.currentFormat.length===this.elementValue.length||s&&e!==S.DateInputInteractionMode.Caret&&g||(s&&e!==S.DateInputInteractionMode.Caret?(p=this.currentFormat[v.start],this.forceUpdate(),this.setSelection(this.selectionBySymbol(p))):this.restorePreviousInputEventState()):this.restorePreviousInputEventState(),this.tryTriggerValueChange({oldValue:a,event:t}),this.triggerInputEnd({event:t}),s&&this.setTextAndFormat()}else this.restorePreviousInputEventState()}}},l.prototype.onElementFocus=function(t){this.triggerFocus({event:t})||(this.isActive=!0,this.interactionMode=S.DateInputInteractionMode.None,this.refreshElementValue(),this.mouseDownStarted||this.caret(0,this.elementValue.length),this.mouseDownStarted=!1,this.triggerFocusEnd({event:t}))},l.prototype.onElementBlur=function(t){this.resetSegmentValue=!0,this.isActive=!1,this.triggerBlur({event:t})||(this.interactionMode=S.DateInputInteractionMode.None,this.refreshElementValue(),this.triggerBlurEnd({event:t}))},l.prototype.onElementChange=function(t){this.triggerChange({event:t})},l.prototype.onElementKeyDown=function(t){if(!this.triggerKeyDown({event:t})){this.keyDownEvent=t,this.previousElementValue=this.element.value;var e=this.selection,n=e.start,e=e.end,n=(this.previousElementSelection={start:n,end:e},(this.options.autoSwitchKeys||[]).map(function(t){return t.toString().toLowerCase().trim()}));if(0<=n.indexOf(t.keyCode.toString())||0<=n.indexOf(t.keyCode)||0<=n.indexOf(t.key.toLowerCase().trim())){e=0<=n.indexOf(E.Key.TAB.toLowerCase().trim())||0<=n.indexOf(D.KeyCode.TAB)||0<=n.indexOf(D.KeyCode.TAB.toString());if(!e)return t.preventDefault(),void this.switchDateSegment(1);var n=this.selection,i=n.start,n=n.end;if(t.shiftKey&&e?this.switchDateSegment(-1):this.switchDateSegment(1),i!==this.selection.start||n!==this.selection.end)return void t.preventDefault()}var s,a=this.currentFormat[this.selection.start],r=this.getStepFromSymbol(a),o=!1;if(!(t.altKey||t.ctrlKey||t.metaKey||t.keyCode===D.KeyCode.TAB)){switch(t.keyCode){case D.KeyCode.ARROW_LEFT:this.switchDateSegment(-1),o=!0;break;case D.KeyCode.ARROW_UP:this.modifyDateSegmentValue(r,a,event),o=!0;break;case D.KeyCode.ARROW_RIGHT:this.switchDateSegment(1),o=!0;break;case D.KeyCode.ARROW_DOWN:this.modifyDateSegmentValue(-r,a,event),o=!0;break;case D.KeyCode.ENTER:break;case D.KeyCode.DELETE:case D.KeyCode.BACKSPACE:return this.options.allowNulls&&(s=this.dateObject.value,this.dateObject.setValue(null),this.forceUpdate(),this.tryTriggerValueChange({oldValue:s,event:t})),o=!0,void(t.keyCode===D.KeyCode.BACKSPACE&&(0<=(this.options.autoSwitchKeys||[]).indexOf(D.KeyCode.BACKSPACE)||0<=(this.options.autoSwitchKeys||[]).indexOf(E.Key.BACKSPACE))&&this.switchDateSegment(-1));case E.Key.HOME:this.selectNearestSegment(0);break;case E.Key.END:this.selectNearestSegment(this.elementValue.length);break;default:return}o&&t.preventDefault()}}},l.prototype.onElementPaste=function(){this.isPasteInProgress=!0},l.prototype.onElementMouseWheel=function(t){this.options.enableMouseWheel&&!this.triggerMouseWheel({event:t})&&this.isActive&&((t=t).shiftKey?this.switchDateSegment(0<(t.wheelDelta||-t.detail)?-1:1):this.modifyDateSegmentValue(0<(t.wheelDelta||-t.detail)?1:-1),t.returnValue=!1,t.preventDefault&&t.preventDefault(),t.stopPropagation)&&t.stopPropagation()},l.prototype.updateOnPaste=function(t){var e=this.intl.parseDate(this.elementValue,this.inputFormat)||this.value,n=(b.isPresent(e)&&this.dateObject.shouldNormalizeCentury()&&(e=this.dateObject.normalizeCentury(e)),this.dateObject&&this.dateObject.getValue());this.writeValue(e),this.tryTriggerValueChange({oldValue:n,event:t})},Object.defineProperty(l.prototype,"elementValue",{get:function(){return(this.element||{}).value||""},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"inputFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.inputFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"displayFormat",{get:function(){return this.options.format?"string"==typeof this.options.format?this.options.format:this.options.format.displayFormat:M.Constants.defaultDateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selection",{get:function(){var t={start:0,end:0};return t=null!==this.element&&void 0!==this.element.selectionStart?{start:this.element.selectionStart,end:this.element.selectionEnd}:t},enumerable:!0,configurable:!0}),l.prototype.setSelection=function(t){this.element&&document.activeElement===this.element&&this.element.setSelectionRange(t.start,t.end)},l.prototype.selectionBySymbol=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);return e<0&&(e=0),this.options.autoCorrectParts||this.currentFormat.length===this.currentText.length||(this.currentFormat.length<this.currentText.length?n+=this.currentText.length-this.currentFormat.length:n=Math.max(0,n-(this.currentFormat.length-this.currentText.length))),{start:e,end:n}},l.prototype.selectionByIndex=function(t){for(var e={start:t,end:t},n=t,i=t-1;n<this.currentFormat.length||0<=i;n++,i--){if(n<this.currentFormat.length&&this.currentFormat[n]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[n]);break}if(0<=i&&this.currentFormat[i]!==M.Constants.formatSeparator){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e},l.prototype.switchDateSegment=function(t){var e=this.selection;if(this.isInCaretMode()){var n=e.start,i=this.currentFormat[n-(this.elementValue.length-this.currentFormat.length)]||this.currentFormat[n],s="",a="";if(t<0){for(var r=n+t;0<=r;r--)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}}else for(r=n+t;r<this.currentFormat.length;r++)if((a=this.currentFormat[r])!==M.Constants.formatSeparator&&a!==i){n=r,s=a;break}if(s)return this.forceUpdate(),this.setSelection(this.selectionBySymbol(s)),void(this.interactionMode=S.DateInputInteractionMode.Selection)}var e=this.selection,o=e.start,e=e.end;if(o<e&&this.currentFormat[o]!==this.currentFormat[e-1])this.setSelection(this.selectionByIndex(0<t?o:e-1)),this.resetSegmentValue=!0;else{for(var l=this.currentFormat[o],h=o+t;0<h&&h<this.currentFormat.length&&(this.currentFormat[h]===l||this.currentFormat[h]===M.Constants.formatSeparator);)h+=t;if(this.currentFormat[h]!==M.Constants.formatSeparator){for(var u=h;0<=u&&u<this.currentFormat.length&&this.currentFormat[u]===this.currentFormat[h];)u+=t;u<h&&(u+1!==o||h+1!==e)?(this.setSelection({start:u+1,end:h+1}),this.resetSegmentValue=!0):h<u&&(h!==o||u!==e)&&(this.setSelection({start:h,end:u}),this.resetSegmentValue=!0)}}},l.prototype.modifyDateSegmentValue=function(t,e,n){var i,s;void 0===e&&(e=""),void 0===n&&(n={}),this.dateObject&&(i=this.value,t=+t,s=this.caret(),"S"!==(e=e||this.currentFormat[s[0]])||this.options.steps.millisecond||(s=b.millisecondDigitsInFormat(this.inputFormat),t=b.millisecondStepFor(s)),this.dateObject.modifyPart(e,t),this.tryTriggerValueChange({oldValue:i,event:n}),this.forceUpdate(),this.setSelection(this.selectionBySymbol(e)))},l.prototype.tryTriggerValueChange=function(t){if(!P.isEqual(this.value,(t=void 0===t?{oldValue:null,event:{}}:t).oldValue))return this.triggerValueChange(t)},l.prototype.triggerValueChange=function(t){return this.trigger("valueChange",b.extend(t=void 0===t?{oldValue:null,event:{}}:t,{value:this.value}))},l.prototype.triggerInput=function(t){return this.trigger("input",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerInputEnd=function(t){return this.trigger("inputEnd",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerFocus=function(t){return this.trigger("focus",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerFocusEnd=function(t){return this.trigger("focusEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlur=function(t){return this.trigger("blur",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerBlurEnd=function(t){return this.trigger("blurEnd",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerChange=function(t){return this.trigger("change",b.extend(t=void 0===t?{event:{}}:t,{value:this.value}))},l.prototype.triggerKeyDown=function(t){return this.trigger("keydown",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.triggerMouseWheel=function(t){return this.trigger("mousewheel",b.extend({},t=void 0===t?{event:{}}:t))},l.prototype.forceUpdate=function(){this.setTextAndFormat(),this.refreshElementValue()},l.prototype.setTextAndFormat=function(){var t=this.dateObject.getTextAndFormat(),e=t.text,t=t.format;this.currentFormat=t,this.currentText=e},l.prototype.setElementValue=function(t){this.element.value=t},l.prototype.getStepFromSymbol=function(t){switch(t){case"S":return Number(this.options.steps.millisecond);case"s":return Number(this.options.steps.second);case"m":return Number(this.options.steps.minute);case"h":case"H":return Number(this.options.steps.hour);case"M":return Number(this.options.steps.month);case"d":case"E":return Number(this.options.steps.day);case"y":return Number(this.options.steps.year);default:return 1}},l.prototype.restorePreviousInputEventState=function(){this.restorePreviousElementValue(),this.restorePreviousElementSelection()},l.prototype.restorePreviousElementValue=function(){this.setElementValue(this.previousElementValue||"")},l.prototype.restorePreviousElementSelection=function(){var t=this.previousElementSelection,e=t.start,t=t.end;this.setSelection({start:e||0,end:t||0})},l.prototype.writeValue=function(t){this.verifyValue(t),this.dateObject=this.getDateObject(t),this.refreshElementValue()},l.prototype.verifyValue=function(t){if(t&&!b.isValidDate(t))throw new Error("The 'value' should be a valid JavaScript Date instance.")},l.prototype.refreshElementValue=function(){var t=this.caret()[0],e=this.element,n=this.isActive?this.inputFormat:this.displayFormat,n=this.dateObject.getTextAndFormat(n),i=n.text,n=n.format,n=(this.currentFormat=n,this.currentText=i,!this.isActive&&b.isPresent(this.options.placeholder)&&!this.dateObject.hasValue()),e=(b.isPresent(this.options.placeholder)&&(e.placeholder=this.options.placeholder),n?"":i);this.previousElementValue=this.elementValue,this.setElementValue(e),this.isActive&&!this.options.allowCaretMode&&this.options.selectNearestSegmentOnFocus&&this.selectNearestSegment(t)},l.prototype.caret=function(t,e){void 0===e&&(e=t);var n=void 0!==t,i=[t,t],s=this.element;if(!n||!this.options.disabled&&!this.options.readonly){try{void 0!==s.selectionStart&&(n&&(b.isDocumentAvailable()&&document.activeElement!==s&&s.focus(),s.setSelectionRange(t,e)),i=[s.selectionStart,s.selectionEnd])}catch(t){i=[]}return i}},l.prototype.selectNearestSegment=function(t){for(var e=t,n=t-1;e<this.currentFormat.length||0<=n;e++,n--){if(e<this.currentFormat.length&&"_"!==this.currentFormat[e])return void this.selectDateSegment(this.currentFormat[e]);if(0<=n&&"_"!==this.currentFormat[n])return void this.selectDateSegment(this.currentFormat[n])}},l.prototype.selectDateSegment=function(t){for(var e=-1,n=0,i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===t&&(n=i+1,-1===e)&&(e=i);e<0&&(e=0),this.caret(0,0),this.caret(e,n)},l.prototype.getDateObject=function(t){var e=(this.dateObject||{}).leadingZero,t=this.createDateObject({value:t});return t.setLeadingZero(this.isActive?e:null),t},l.prototype.createDateObject=function(t){return new a.DateObject(b.extend({intlService:this.intl,formatPlaceholder:this.formatPlaceholder,format:this.inputFormat,cycleTime:this.options.cycleTime,twoDigitYearMax:this.options.twoDigitYearMax,autoCorrectParts:this.options.autoCorrectParts,value:this.options.value},t=void 0===t?{}:t))},l);function l(t,e){var n=i.call(this,e)||this;return n.dateObject=null,n.currentText="",n.currentFormat="",n.interactionMode=S.DateInputInteractionMode.None,n.previousElementSelection={start:0,end:0},n.init(t,e),n}e.DateInput=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=n(11),s=(e.DateInput=n.DateInput,e);for(i in s)a(i,s[i])}],s={},i.m=n,i.c=s,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=12)}}});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-dateinputs-common",
3
3
  "description": "Kendo UI common date input utilities",
4
- "version": "0.2.0-dev.202301130811",
4
+ "version": "0.2.0-dev.202301131210",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],