!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/platform"),require("@angular/core"),require("rxjs"),require("@angular/cdk/a11y"),require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/common"),require("@angular/material/button"),require("@angular/material/dialog"),require("@angular/cdk/keycodes"),require("@angular/cdk/bidi"),require("rxjs/operators"),require("@angular/cdk/coercion"),require("@angular/material/core"),require("@angular/animations"),require("@angular/forms"),require("@angular/material/form-field"),require("@angular/material/input")):"function"==typeof define&&define.amd?define("saturn-datepicker",["exports","@angular/cdk/platform","@angular/core","rxjs","@angular/cdk/a11y","@angular/cdk/overlay","@angular/cdk/portal","@angular/common","@angular/material/button","@angular/material/dialog","@angular/cdk/keycodes","@angular/cdk/bidi","rxjs/operators","@angular/cdk/coercion","@angular/material/core","@angular/animations","@angular/forms","@angular/material/form-field","@angular/material/input"],t):t((e=e||self)["saturn-datepicker"]={},e.ng.cdk.platform,e.ng.core,e.rxjs,e.ng.cdk.a11y,e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.common,e.ng.material.button,e.ng.material.dialog,e.ng.cdk.keycodes,e.ng.cdk.bidi,e.rxjs.operators,e.ng.cdk.coercion,e.ng.material.core,e.ng.animations,e.ng.forms,e.ng.material["form-field"],e.ng.material.input)}(this,(function(e,t,a,i,n,r,o,s,d,l,c,p,h,u,_,g,m,f,y){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var v=function(e,t){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])})(e,t)};function D(e,t){function a(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}var b=function(){return(b=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function A(e,t,a,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(r<3?n(o):r>3?n(t,a,o):n(t,a))||o);return r>3&&o&&Object.defineProperty(t,a,o),o}function C(e,t){return function(a,i){t(a,i,e)}}
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */
var O=new a.InjectionToken("MAT_DATE_LOCALE",{providedIn:"root",factory:w});function w(){return a.inject(a.LOCALE_ID)}var k,I={provide:O,useExisting:a.LOCALE_ID},S=function(){function e(){this._localeChanges=new i.Subject}return Object.defineProperty(e.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!0,configurable:!0}),e.prototype.deserialize=function(e){return null==e||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()},e.prototype.setLocale=function(e){this.locale=e,this._localeChanges.next()},e.prototype.compareDate=function(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)},e.prototype.sameDate=function(e,t){if(e&&t){var a=this.isValid(e),i=this.isValid(t);return a&&i?!this.compareDate(e,t):a==i}return e==t},e.prototype.clampDate=function(e,t,a){return t&&this.compareDate(e,t)<0?t:a&&this.compareDate(e,a)>0?a:e},e}(),x=new a.InjectionToken("mat-date-formats");try{k="undefined"!=typeof Intl}catch(e){k=!1}var M={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},V=F(31,(function(e){return String(e+1)})),E={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},R={af:1,ar:6,"ar-ly":6,"ar-ma":6,"ar-tn":1,az:1,be:1,bg:1,bm:1,br:1,bs:1,ca:1,cs:1,cv:1,cy:1,da:1,de:1,"de-at":1,"de-ch":1,el:1,"en-au":1,"en-gb":1,"en-ie":1,"en-nz":1,eo:1,es:1,"es-do":1,et:1,eu:1,fa:6,fi:1,fo:1,fr:1,"fr-ch":1,fy:1,gd:1,gl:1,"gom-latn":1,hr:1,hu:1,"hy-am":1,id:1,is:1,it:1,jv:1,ka:1,kk:1,km:1,ky:1,lb:1,lt:1,lv:1,me:1,mi:1,mk:1,ms:1,"ms-my":1,mt:1,my:1,nb:1,nl:1,"nl-be":1,nn:1,pl:1,pt:1,"pt-BR":0,ro:1,ru:1,sd:1,se:1,sk:1,sl:1,sq:1,sr:1,"sr-cyrl":1,ss:1,sv:1,sw:1,tet:1,tg:1,"tl-ph":1,tlh:1,tr:1,tzl:1,tzm:6,"tzm-latn":6,"ug-cn":1,uk:1,ur:1,uz:1,"uz-latn":1,vi:1,"x-pseudo":1,yo:1,"zh-cn":1},P=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function F(e,t){for(var a=Array(e),i=0;i<e;i++)a[i]=t(i);return a}var Y=function(e){function i(t,a){var i=e.call(this)||this;return i.useUtcForDisplay=!0,e.prototype.setLocale.call(i,t),i.useUtcForDisplay=!a.TRIDENT,i._clampDate=a.TRIDENT||a.EDGE,i}return D(i,e),i.prototype.getYear=function(e){return e.getFullYear()},i.prototype.getMonth=function(e){return e.getMonth()},i.prototype.getDate=function(e){return e.getDate()},i.prototype.getDayOfWeek=function(e){return e.getDay()},i.prototype.getMonthNames=function(e){var t=this;if(k){var a=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return F(12,(function(e){return t._stripDirectionalityCharacters(t._format(a,new Date(2017,e,1)))}))}return M[e]},i.prototype.getDateNames=function(){var e=this;if(k){var t=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return F(31,(function(a){return e._stripDirectionalityCharacters(e._format(t,new Date(2017,0,a+1)))}))}return V},i.prototype.getDayOfWeekNames=function(e){var t=this;if(k){var a=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return F(7,(function(e){return t._stripDirectionalityCharacters(t._format(a,new Date(2017,0,e+1)))}))}return E[e]},i.prototype.getYearName=function(e){if(k){var t=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(t,e))}return String(this.getYear(e))},i.prototype.getFirstDayOfWeek=function(){var e=this.locale.toLowerCase();return R[e]||R[e.substr(0,2)]||0},i.prototype.getNumDaysInMonth=function(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))},i.prototype.clone=function(e){return new Date(e.getTime())},i.prototype.createDate=function(e,t,a){if(t<0||t>11)throw Error('Invalid month index "'+t+'". Month index has to be between 0 and 11.');if(a<1)throw Error('Invalid date "'+a+'". Date has to be greater than 0.');var i=this._createDateWithOverflow(e,t,a);if(i.getMonth()!=t)throw Error('Invalid date "'+a+'" for month with index "'+t+'".');return i},i.prototype.today=function(){return new Date},i.prototype.parse=function(e){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null},i.prototype.format=function(e,t){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(k){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e)).setFullYear(Math.max(1,Math.min(9999,e.getFullYear()))),t=b({},t,{timeZone:"utc"});var a=new Intl.DateTimeFormat(this.locale,t);return this._stripDirectionalityCharacters(this._format(a,e))}return this._stripDirectionalityCharacters(e.toDateString())},i.prototype.addCalendarYears=function(e,t){return this.addCalendarMonths(e,12*t)},i.prototype.addCalendarMonths=function(e,t){var a=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+t,this.getDate(e));return this.getMonth(a)!=((this.getMonth(e)+t)%12+12)%12&&(a=this._createDateWithOverflow(this.getYear(a),this.getMonth(a),0)),a},i.prototype.addCalendarDays=function(e,t){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+t)},i.prototype.toIso8601=function(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")},i.prototype.deserialize=function(t){if("string"==typeof t){if(!t)return null;if(P.test(t)){var a=new Date(t);if(this.isValid(a))return a}}return e.prototype.deserialize.call(this,t)},i.prototype.isDateInstance=function(e){return e instanceof Date},i.prototype.isValid=function(e){return!isNaN(e.getTime())},i.prototype.invalid=function(){return new Date(NaN)},i.prototype._createDateWithOverflow=function(e,t,a){var i=new Date(e,t,a);return e>=0&&e<100&&i.setFullYear(this.getYear(i)-1900),i},i.prototype._2digit=function(e){return("00"+e).slice(-2)},i.prototype._stripDirectionalityCharacters=function(e){return e.replace(/[\u200e\u200f]/g,"")},i.prototype._format=function(e,t){var a=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.format(a)},i.ctorParameters=function(){return[{type:String,decorators:[{type:a.Optional},{type:a.Inject,args:[O]}]},{type:t.Platform}]},i=A([a.Injectable(),C(0,a.Optional()),C(0,a.Inject(O))],i)}(S),N={parse:{dateInput:null},display:{dateInput:{year:"numeric",month:"numeric",day:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},T=function(){function e(){}return e=A([a.NgModule({imports:[t.PlatformModule],providers:[{provide:S,useClass:Y}]})],e)}(),j=N,L=function(){function e(){}return e=A([a.NgModule({imports:[T],providers:[{provide:x,useValue:j}]})],e)}();
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */
function z(e){return Error("SatDatepicker: No provider found for "+e+". You must import one of the following modules at your application root: SatNativeDateModule, MatMomentDateModule, or provide a custom implementation.")}var B=function(){function e(){this.changes=new i.Subject,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 20 years",this.nextMultiYearLabel="Next 20 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year"}return e.ngInjectableDef=a.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=A([a.Injectable({providedIn:"root"})],e)}(),W=function(e,t,a,i,n){this.value=e,this.displayValue=t,this.ariaLabel=a,this.enabled=i,this.cssClasses=n},H=function(){function e(e,t){this._elementRef=e,this._ngZone=t,this.rangeHoverEffect=!0,this.rangeMode=!1,this.numCols=7,this.activeCell=0,this.cellAspectRatio=1,this.selectedValueChange=new a.EventEmitter}return e.prototype._cellClicked=function(e){e.enabled&&this.selectedValueChange.emit(e.value)},e.prototype._mouseOverCell=function(e){this.rangeHoverEffect&&(this._cellOver=e.value)},e.prototype.ngOnChanges=function(e){var t=e.numCols,a=this.rows,i=this.numCols;(e.rows||t)&&(this._firstRowOffset=a&&a.length&&a[0].length?i-a[0].length:0),(e.cellAspectRatio||t||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/i+"%"),!t&&this._cellWidth||(this._cellWidth=100/i+"%"),e.activeCell&&(this._cellOver=this.activeCell+1)},e.prototype._isActiveCell=function(e,t){var a=e*this.numCols+t;return e&&(a-=this._firstRowOffset),a==this.activeCell},e.prototype._isSemiSelected=function(e){return!!this.rangeMode&&(!!this.rangeFull||e!==this.begin&&e!==this.end&&(this.begin&&!this.end?e>this.begin:this.end&&!this.begin?e<this.end:e>this.begin&&e<this.end))},e.prototype._isBetweenOverAndBegin=function(e){return!!(this._cellOver&&this.rangeMode&&this.beginSelected)&&(this.isBeforeSelected&&!this.begin?e>this._cellOver:this._cellOver>this.begin?e>this.begin&&e<this._cellOver:this._cellOver<this.begin&&(e<this.begin&&e>this._cellOver))},e.prototype._isBegin=function(e){return this.rangeMode&&this.beginSelected&&this._cellOver?this.isBeforeSelected&&!this.begin?this._cellOver===e:this.begin===e&&!(this._cellOver<this.begin)||this._cellOver===e&&this._cellOver<this.begin:this.begin===e},e.prototype._isEnd=function(e){return this.rangeMode&&this.beginSelected&&this._cellOver?!(this.isBeforeSelected&&!this.begin)&&(this.end===e&&!(this._cellOver>this.begin)||this._cellOver===e&&this._cellOver>this.begin):this.end===e},e.prototype._focusActiveCell=function(){var e=this;this._ngZone.runOutsideAngular((function(){e._ngZone.onStable.asObservable().pipe(h.take(1)).subscribe((function(){var t=e._elementRef.nativeElement.querySelector(".mat-calendar-body-active");t&&t.focus()}))}))},e.prototype._previewCellOver=function(e){return this._cellOver===e&&this.rangeMode&&this.beginSelected},e.ctorParameters=function(){return[{type:a.ElementRef},{type:a.NgZone}]},A([a.Input()],e.prototype,"label",void 0),A([a.Input()],e.prototype,"rangeHoverEffect",void 0),A([a.Input()],e.prototype,"rows",void 0),A([a.Input()],e.prototype,"todayValue",void 0),A([a.Input()],e.prototype,"selectedValue",void 0),A([a.Input()],e.prototype,"begin",void 0),A([a.Input()],e.prototype,"end",void 0),A([a.Input()],e.prototype,"beginSelected",void 0),A([a.Input()],e.prototype,"isBeforeSelected",void 0),A([a.Input()],e.prototype,"rangeFull",void 0),A([a.Input()],e.prototype,"rangeMode",void 0),A([a.Input()],e.prototype,"labelMinRequiredCells",void 0),A([a.Input()],e.prototype,"numCols",void 0),A([a.Input()],e.prototype,"activeCell",void 0),A([a.Input()],e.prototype,"cellAspectRatio",void 0),A([a.Output()],e.prototype,"selectedValueChange",void 0),e=A([a.Component({moduleId:module.id,selector:"[sat-calendar-body]",template:'\x3c!--\n  If there\'s not enough space in the first row, create a separate label row. We mark this row as\n  aria-hidden because we don\'t want it to be read out as one of the weeks in the month.\n--\x3e\n<tr *ngIf="_firstRowOffset < labelMinRequiredCells" aria-hidden="true">\n  <td class="mat-calendar-body-label"\n      [attr.colspan]="numCols"\n      [style.paddingTop]="_cellPadding"\n      [style.paddingBottom]="_cellPadding">\n    {{label}}\n  </td>\n</tr>\n\n\x3c!-- Create the first row separately so we can include a special spacer cell. --\x3e\n<tr *ngFor="let row of rows; let rowIndex = index" role="row">\n  \x3c!--\n    We mark this cell as aria-hidden so it doesn\'t get read out as one of the days in the week.\n    The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n    percentage of the width (a variant of the trick described here:\n    https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n  --\x3e\n  <td *ngIf="rowIndex === 0 && _firstRowOffset"\n      aria-hidden="true"\n      class="mat-calendar-body-label"\n      [attr.colspan]="_firstRowOffset"\n      [style.paddingTop]="_cellPadding"\n      [style.paddingBottom]="_cellPadding">\n    {{_firstRowOffset >= labelMinRequiredCells ? label : \'\'}}\n  </td>\n  <td *ngFor="let item of row; let colIndex = index"\n      role="gridcell"\n      class="mat-calendar-body-cell"\n      [ngClass]="item.cssClasses"\n      [tabindex]="_isActiveCell(rowIndex, colIndex) ? 0 : -1"\n      [class.mat-calendar-body-disabled]="!item.enabled"\n      [class.mat-calendar-body-active]="_isActiveCell(rowIndex, colIndex)"\n      [class.mat-calendar-body-begin-range]="_isBegin(item.value)"\n      [class.mat-calendar-body-end-range]="_isEnd(item.value)"\n      [class.mat-calendar-cell-semi-selected]="_isSemiSelected(item.value) || _isBetweenOverAndBegin(item.value)"\n      [class.mat-calendar-cell-over]="_previewCellOver(item.value)"\n      [attr.aria-label]="item.ariaLabel"\n      [attr.aria-disabled]="!item.enabled || null"\n      [attr.aria-selected]="selectedValue === item.value"\n      (click)="_cellClicked(item)"\n      (mouseover)="_mouseOverCell(item)"\n      [style.width]="_cellWidth"\n      [style.paddingTop]="_cellPadding"\n      [style.paddingBottom]="_cellPadding">\n    <div class="mat-calendar-body-cell-content"\n         [class.mat-calendar-body-selected]="begin === item.value || end === item.value || selectedValue === item.value"\n         [class.mat-calendar-body-semi-selected]="_isSemiSelected(item.value)"\n         [class.mat-calendar-body-today]="todayValue === item.value">\n      {{item.displayValue}}\n    </div>\n  </td>\n</tr>\n',host:{class:"mat-calendar-body",role:"grid","aria-readonly":"true"},exportAs:"matCalendarBody",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,styles:[".mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.71429%;padding-right:4.71429%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:0;cursor:pointer}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}[dir=rtl] .mat-calendar-body-label{text-align:right}"]})],e)}(),U=function(){function e(e,t,i,n){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=i,this._dir=n,this.rangeMode=!1,this.rangeHoverEffect=!0,this.closeAfterSelection=!0,this._rangeFull=!1,this.selectedChange=new a.EventEmitter,this._userSelection=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw z("DateAdapter");if(!this._dateFormats)throw z("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"beginDate",{get:function(){return this._beginDate},set:function(e){this._beginDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this.updateRangeSpecificValues()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endDate",{get:function(){return this._endDate},set:function(e){this._endDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this.updateRangeSpecificValues()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"beginDateSelected",{set:function(e){this._beginDateSelected=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._hasSameMonthAndYear(t,this._activeDate)||this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedDate=this._getDateInCurrentMonth(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._dateSelected=function(e){if(this.rangeMode){var t=this._dateAdapter.getYear(this.activeDate),a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.createDate(t,a,e);this._beginDateSelected?(this._beginDateSelected=null,this.selectedChange.emit(i),this._userSelection.emit()):(this._beginDateSelected=i,this.selectedChange.emit(i)),this._createWeekCells(),this.activeDate=i,this._focusActiveCell()}else if(this._selectedDate!=e){t=this._dateAdapter.getYear(this.activeDate),a=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.createDate(t,a,e);this.selectedChange.emit(i),this._userSelection.emit(),this._createWeekCells()}},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case c.PAGE_UP:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case c.PAGE_DOWN:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case c.ENTER:case c.SPACE:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected(this._dateAdapter.getDate(this._activeDate)),this._beginDateSelected||this._userSelection.emit(),!this._beginDateSelected&&this.closeAfterSelection||this._focusActiveCell(),e.preventDefault()));default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._init=function(){this.updateRangeSpecificValues(),this._selectedDate=this._getDateInCurrentMonth(this.selected),this._todayDate=this._getDateInCurrentMonth(this._dateAdapter.today()),this._monthLabel=this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();var e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._initWeekdays=function(){var e=this._dateAdapter.getFirstDayOfWeek(),t=this._dateAdapter.getDayOfWeekNames("narrow"),a=this._dateAdapter.getDayOfWeekNames("long").map((function(e,a){return{long:e,narrow:t[a]}}));this._weekdays=a.slice(e).concat(a.slice(0,e))},e.prototype._createWeekCells=function(){var e=this._dateAdapter.getNumDaysInMonth(this.activeDate),t=this._dateAdapter.getDateNames();this._weeks=[[]];for(var a=0,i=this._firstWeekOffset;a<e;a++,i++){7==i&&(this._weeks.push([]),i=0);var n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),a+1),r=this._shouldEnableDate(n),o=this._dateAdapter.format(n,this._dateFormats.display.dateA11yLabel),s=this.dateClass?this.dateClass(n):void 0;this._weeks[this._weeks.length-1].push(new W(a+1,t[a],o,r,s))}},e.prototype._shouldEnableDate=function(e){return!!e&&(!this.dateFilter||this.dateFilter(e))&&(!this.minDate||this._dateAdapter.compareDate(e,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)},e.prototype._getDateInCurrentMonth=function(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null},e.prototype._hasSameMonthAndYear=function(e,t){return!(!e||!t||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(t)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(t))},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e.prototype.updateRangeSpecificValues=function(){this.rangeMode?(this._beginDateNumber=this._getDateInCurrentMonth(this._beginDate),this._endDateNumber=this._getDateInCurrentMonth(this._endDate),this._rangeFull=this.beginDate&&this.endDate&&!this._beginDateNumber&&!this._endDateNumber&&this._dateAdapter.compareDate(this.beginDate,this.activeDate)<=0&&this._dateAdapter.compareDate(this.activeDate,this.endDate)<=0):(this._beginDateNumber=this._endDateNumber=null,this._rangeFull=!1)},e.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[x]}]},{type:S,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},A([a.Input()],e.prototype,"beginDate",null),A([a.Input()],e.prototype,"endDate",null),A([a.Input()],e.prototype,"rangeMode",void 0),A([a.Input()],e.prototype,"rangeHoverEffect",void 0),A([a.Input()],e.prototype,"closeAfterSelection",void 0),A([a.Input()],e.prototype,"beginDateSelected",null),A([a.Input()],e.prototype,"activeDate",null),A([a.Input()],e.prototype,"selected",null),A([a.Input()],e.prototype,"minDate",null),A([a.Input()],e.prototype,"maxDate",null),A([a.Input()],e.prototype,"dateFilter",void 0),A([a.Input()],e.prototype,"dateClass",void 0),A([a.Output()],e.prototype,"selectedChange",void 0),A([a.Output()],e.prototype,"_userSelection",void 0),A([a.Output()],e.prototype,"activeDateChange",void 0),A([a.ViewChild(H,{static:!1})],e.prototype,"_matCalendarBody",void 0),e=A([a.Component({moduleId:module.id,selector:"sat-month-view",template:'<table class="mat-calendar-table">\n  <thead class="mat-calendar-table-header">\n    <tr><th *ngFor="let day of _weekdays" [attr.aria-label]="day.long">{{day.narrow}}</th></tr>\n    <tr><th class="mat-calendar-table-header-divider" colspan="7" aria-hidden="true"></th></tr>\n  </thead>\n  <tbody sat-calendar-body\n         [label]="_monthLabel"\n         [rows]="_weeks"\n         [todayValue]="_todayDate"\n         [selectedValue]="_selectedDate"\n         [begin]="_beginDateNumber"\n         [end]="_endDateNumber"\n         [beginSelected]="_beginDateSelected"\n         [isBeforeSelected]="_beginDateSelected && _dateAdapter.compareDate(activeDate, _beginDateSelected) < 0"\n         [rangeFull]="_rangeFull"\n         [rangeMode]="rangeMode"\n         [rangeHoverEffect]="rangeHoverEffect"\n         [labelMinRequiredCells]="3"\n         [activeCell]="_dateAdapter.getDate(activeDate) - 1"\n         (selectedValueChange)="_dateSelected($event)"\n         (keydown)="_handleCalendarBodyKeydown($event)">\n  </tbody>\n</table>\n',exportAs:"matMonthView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}),C(1,a.Optional()),C(1,a.Inject(x)),C(2,a.Optional()),C(3,a.Optional())],e)}(),q=function(){function e(e,t,i){if(this._changeDetectorRef=e,this._dateAdapter=t,this._dir=i,this.selectedChange=new a.EventEmitter,this.yearSelected=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw z("DateAdapter");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),K(this._dateAdapter,t,this._activeDate,this.minDate,this.maxDate)||this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedYear=this._selected&&this._dateAdapter.getYear(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._init=function(){var e=this;this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());var t=this._dateAdapter.getYear(this._activeDate)-$(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(var a=0,i=[];a<24;a++)i.push(t+a),4==i.length&&(this._years.push(i.map((function(t){return e._createCellForYear(t)}))),i=[]);this._changeDetectorRef.markForCheck()},e.prototype._yearSelected=function(e){this.yearSelected.emit(this._dateAdapter.createDate(e,0,1));var t=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,t,1));this.selectedChange.emit(this._dateAdapter.createDate(e,t,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-$(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,24-$(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case c.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-240:-24);break;case c.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?240:24);break;case c.ENTER:case c.SPACE:this._yearSelected(this._dateAdapter.getYear(this._activeDate));break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._getActiveCell=function(){return $(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._createCellForYear=function(e){var t=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1));return new W(e,t,t,this._shouldEnableYear(e))},e.prototype._shouldEnableYear=function(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(var t=this._dateAdapter.createDate(e,0,1);this._dateAdapter.getYear(t)==e;t=this._dateAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:S,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},A([a.Input()],e.prototype,"activeDate",null),A([a.Input()],e.prototype,"selected",null),A([a.Input()],e.prototype,"minDate",null),A([a.Input()],e.prototype,"maxDate",null),A([a.Input()],e.prototype,"dateFilter",void 0),A([a.Output()],e.prototype,"selectedChange",void 0),A([a.Output()],e.prototype,"yearSelected",void 0),A([a.Output()],e.prototype,"activeDateChange",void 0),A([a.ViewChild(H,{static:!1})],e.prototype,"_matCalendarBody",void 0),e=A([a.Component({moduleId:module.id,selector:"sat-multi-year-view",template:'<table class="mat-calendar-table" role="presentation">\n  <thead class="mat-calendar-table-header">\n    <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n  </thead>\n  <tbody sat-calendar-body\n         [rows]="_years"\n         [todayValue]="_todayYear"\n         [selectedValue]="_selectedYear"\n         [numCols]="4"\n         [cellAspectRatio]="4 / 7"\n         [activeCell]="_getActiveCell()"\n         (selectedValueChange)="_yearSelected($event)"\n         (keydown)="_handleCalendarBodyKeydown($event)">\n  </tbody>\n</table>\n',exportAs:"matMultiYearView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}),C(1,a.Optional()),C(2,a.Optional())],e)}();
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */function K(e,t,a,i,n){var r=e.getYear(t),o=e.getYear(a),s=G(e,i,n);return Math.floor((r-s)/24)===Math.floor((o-s)/24)}function $(e,t,a,i){var n,r=e.getYear(t);return((r-G(e,a,i))%(n=24)+n)%n}function G(e,t,a){var i=0;a?i=e.getYear(a)-24+1:t&&(i=e.getYear(t));return i}
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */
var Z=function(){function e(e,t,i,n){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=i,this._dir=n,this.selectedChange=new a.EventEmitter,this.monthSelected=new a.EventEmitter,this.activeDateChange=new a.EventEmitter,!this._dateAdapter)throw z("DateAdapter");if(!this._dateFormats)throw z("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}return Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._activeDate},set:function(e){var t=this._activeDate,a=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(a,this.minDate,this.maxDate),this._dateAdapter.getYear(t)!==this._dateAdapter.getYear(this._activeDate)&&this._init()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._selectedMonth=this._getMonthInCurrentYear(this._selected)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._init()},e.prototype._monthSelected=function(e){var t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1);this.monthSelected.emit(t);var a=this._dateAdapter.getNumDaysInMonth(t);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),a)))},e.prototype._handleCalendarBodyKeydown=function(e){var t=this._activeDate,a=this._isRtl();switch(e.keyCode){case c.LEFT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?1:-1);break;case c.RIGHT_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,a?-1:1);break;case c.UP_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case c.DOWN_ARROW:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case c.HOME:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case c.END:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case c.PAGE_UP:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case c.PAGE_DOWN:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case c.ENTER:case c.SPACE:this._monthSelected(this._dateAdapter.getMonth(this._activeDate));break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()},e.prototype._init=function(){var e=this;this._selectedMonth=this._getMonthInCurrentYear(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);var t=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map((function(a){return a.map((function(a){return e._createCellForMonth(a,t[a])}))})),this._changeDetectorRef.markForCheck()},e.prototype._focusActiveCell=function(){this._matCalendarBody._focusActiveCell()},e.prototype._getMonthInCurrentYear=function(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null},e.prototype._createCellForMonth=function(e,t){var a=this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),this._dateFormats.display.monthYearA11yLabel);return new W(e,t.toLocaleUpperCase(),a,this._shouldEnableMonth(e))},e.prototype._shouldEnableMonth=function(e){var t=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(t,e)||this._isYearAndMonthBeforeMinDate(t,e))return!1;if(!this.dateFilter)return!0;for(var a=this._dateAdapter.createDate(t,e,1);this._dateAdapter.getMonth(a)==e;a=this._dateAdapter.addCalendarDays(a,1))if(this.dateFilter(a))return!0;return!1},e.prototype._isYearAndMonthAfterMaxDate=function(e,t){if(this.maxDate){var a=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return e>a||e===a&&t>i}return!1},e.prototype._isYearAndMonthBeforeMinDate=function(e,t){if(this.minDate){var a=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return e<a||e===a&&t<i}return!1},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._isRtl=function(){return this._dir&&"rtl"===this._dir.value},e.ctorParameters=function(){return[{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[x]}]},{type:S,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]}]},A([a.Input()],e.prototype,"activeDate",null),A([a.Input()],e.prototype,"selected",null),A([a.Input()],e.prototype,"minDate",null),A([a.Input()],e.prototype,"maxDate",null),A([a.Input()],e.prototype,"dateFilter",void 0),A([a.Output()],e.prototype,"selectedChange",void 0),A([a.Output()],e.prototype,"monthSelected",void 0),A([a.Output()],e.prototype,"activeDateChange",void 0),A([a.ViewChild(H,{static:!1})],e.prototype,"_matCalendarBody",void 0),e=A([a.Component({moduleId:module.id,selector:"sat-year-view",template:'<table class="mat-calendar-table" role="presentation">\n  <thead class="mat-calendar-table-header">\n    <tr><th class="mat-calendar-table-header-divider" colspan="4"></th></tr>\n  </thead>\n  <tbody sat-calendar-body\n         [label]="_yearLabel"\n         [rows]="_months"\n         [todayValue]="_todayMonth"\n         [selectedValue]="_selectedMonth"\n         [labelMinRequiredCells]="2"\n         [numCols]="4"\n         [cellAspectRatio]="4 / 7"\n         [activeCell]="_dateAdapter.getMonth(activeDate)"\n         (selectedValueChange)="_monthSelected($event)"\n         (keydown)="_handleCalendarBodyKeydown($event)">\n  </tbody>\n</table>\n',exportAs:"matYearView",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}),C(1,a.Optional()),C(1,a.Inject(x)),C(2,a.Optional()),C(3,a.Optional())],e)}(),X=function(){function e(e,t,a,i,n){this._intl=e,this.calendar=t,this._dateAdapter=a,this._dateFormats=i,this.calendar.stateChanges.subscribe((function(){return n.markForCheck()}))}return Object.defineProperty(e.prototype,"periodButtonText",{get:function(){if("month"==this.calendar.currentView)return this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase();if("year"==this.calendar.currentView)return this._dateAdapter.getYearName(this.calendar.activeDate);var e=this._dateAdapter.getYear(this.calendar.activeDate)-$(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate);return e+" – "+(e+24-1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"periodButtonLabel",{get:function(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"prevButtonLabel",{get:function(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextButtonLabel",{get:function(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]},enumerable:!0,configurable:!0}),e.prototype.currentPeriodClicked=function(){var e="month"===this.calendar.orderPeriodLabel?["month","year","multi-year"]:["month","multi-year","month"];switch(this.calendar.currentView){case"month":this.calendar.currentView=e[1];break;case"year":this.calendar.currentView=e[2];break;default:this.calendar.currentView=e[0]}},e.prototype.previousClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)},e.prototype.nextClicked=function(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:24)},e.prototype.previousEnabled=function(){return!this.calendar.minDate||(!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate))},e.prototype.nextEnabled=function(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)},e.prototype._isSameView=function(e,t){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(t):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t):K(this._dateAdapter,e,t,this.calendar.minDate,this.calendar.maxDate)},e.ctorParameters=function(){return[{type:B},{type:Q,decorators:[{type:a.Inject,args:[a.forwardRef((function(){return Q}))]}]},{type:S,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[x]}]},{type:a.ChangeDetectorRef}]},e=A([a.Component({moduleId:module.id,selector:"sat-calendar-header",template:'<div class="mat-calendar-header">\n  <div class="mat-calendar-controls">\n    <button mat-button type="button" class="mat-calendar-period-button"\n            (click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel"\n            cdkAriaLive="polite">\n      {{periodButtonText}}\n      <div class="mat-calendar-arrow"\n           [class.mat-calendar-invert]="calendar.currentView != \'month\'"></div>\n    </button>\n\n    <div class="mat-calendar-spacer"></div>\n\n    <ng-content></ng-content>\n\n    <button mat-icon-button type="button" class="mat-calendar-previous-button"\n            [disabled]="!previousEnabled()" (click)="previousClicked()"\n            [attr.aria-label]="prevButtonLabel">\n    </button>\n\n    <button mat-icon-button type="button" class="mat-calendar-next-button"\n            [disabled]="!nextEnabled()" (click)="nextClicked()"\n            [attr.aria-label]="nextButtonLabel">\n    </button>\n  </div>\n</div>\n',exportAs:"matCalendarHeader",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush}),C(1,a.Inject(a.forwardRef((function(){return Q})))),C(2,a.Optional()),C(3,a.Optional()),C(3,a.Inject(x))],e)}(),J=function(){function e(){}return e=A([a.Component({moduleId:module.id,selector:"sat-calendar-footer",template:"",exportAs:"matCalendarFooter",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush})],e)}(),Q=function(){function e(e,t,n,r){var o=this;if(this._dateAdapter=t,this._dateFormats=n,this._changeDetectorRef=r,this.rangeMode=!1,this.rangeHoverEffect=!0,this.closeAfterSelection=!0,this.dateRangesChange=new a.EventEmitter,this.beginDateSelected=!1,this.beginDateSelectedChange=new a.EventEmitter,this._moveFocusOnNextTick=!1,this.startView="month",this.orderPeriodLabel="multi-year",this.selectedChange=new a.EventEmitter,this.yearSelected=new a.EventEmitter,this.monthSelected=new a.EventEmitter,this._userSelection=new a.EventEmitter,this.stateChanges=new i.Subject,!this._dateAdapter)throw z("DateAdapter");if(!this._dateFormats)throw z("MAT_DATE_FORMATS");this._intlChanges=e.changes.subscribe((function(){r.markForCheck(),o.stateChanges.next()}))}return Object.defineProperty(e.prototype,"beginDate",{get:function(){return this._beginDate},set:function(e){this._beginDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endDate",{get:function(){return this._endDate},set:function(e){this._endDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startAt",{get:function(){return this._startAt},set:function(e){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDate",{get:function(){return this._minDate},set:function(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{get:function(){return this._maxDate},set:function(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeDate",{get:function(){return this._clampedActiveDate},set:function(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentView",{get:function(){return this._currentView},set:function(e){this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._calendarHeaderPortal=new o.ComponentPortal(this.headerComponent||X),this._calendarFooterPortal=new o.ComponentPortal(this.footerComponent||J),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView},e.prototype.ngAfterViewChecked=function(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())},e.prototype.ngOnDestroy=function(){this._intlChanges.unsubscribe(),this.stateChanges.complete()},e.prototype.ngOnChanges=function(e){var t=e.minDate||e.maxDate||e.dateFilter;if(t&&!t.firstChange){var a=this._getCurrentViewComponent();a&&(this._changeDetectorRef.detectChanges(),a._init())}this.stateChanges.next()},e.prototype.focusActiveCell=function(){this._getCurrentViewComponent()._focusActiveCell()},e.prototype.updateTodaysDate=function(){("month"==this.currentView?this.monthView:"year"==this.currentView?this.yearView:this.multiYearView).ngAfterContentInit()},e.prototype._dateSelected=function(e){this.rangeMode?this.beginDateSelected?(this.beginDateSelected=!1,this._dateAdapter.compareDate(this.beginDate,e)<=0?this.endDate=e:(this.endDate=this.beginDate,this.beginDate=e),this.dateRangesChange.emit({begin:this.beginDate,end:this.endDate})):(this.beginDateSelected=e,this.beginDate=e,this.endDate=e,this.beginDateSelectedChange.emit(e)):this._dateAdapter.sameDate(e,this.selected)||this.selectedChange.emit(e)},e.prototype._yearSelectedInMultiYearView=function(e){this.yearSelected.emit(e)},e.prototype._monthSelectedInYearView=function(e){this.monthSelected.emit(e)},e.prototype._userSelected=function(){this._userSelection.emit()},e.prototype._goToDateInView=function(e,t){this.activeDate=e,this.currentView=t},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._getCurrentViewComponent=function(){return this.monthView||this.yearView||this.multiYearView},e.ctorParameters=function(){return[{type:B},{type:S,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[x]}]},{type:a.ChangeDetectorRef}]},A([a.Input()],e.prototype,"beginDate",null),A([a.Input()],e.prototype,"endDate",null),A([a.Input()],e.prototype,"rangeMode",void 0),A([a.Input()],e.prototype,"rangeHoverEffect",void 0),A([a.Input()],e.prototype,"closeAfterSelection",void 0),A([a.Output()],e.prototype,"dateRangesChange",void 0),A([a.Output()],e.prototype,"beginDateSelectedChange",void 0),A([a.Input()],e.prototype,"headerComponent",void 0),A([a.Input()],e.prototype,"footerComponent",void 0),A([a.Input()],e.prototype,"startAt",null),A([a.Input()],e.prototype,"startView",void 0),A([a.Input()],e.prototype,"selected",null),A([a.Input()],e.prototype,"minDate",null),A([a.Input()],e.prototype,"maxDate",null),A([a.Input()],e.prototype,"dateFilter",void 0),A([a.Input()],e.prototype,"dateClass",void 0),A([a.Input()],e.prototype,"orderPeriodLabel",void 0),A([a.Output()],e.prototype,"selectedChange",void 0),A([a.Output()],e.prototype,"yearSelected",void 0),A([a.Output()],e.prototype,"monthSelected",void 0),A([a.Output()],e.prototype,"_userSelection",void 0),A([a.ViewChild(U,{static:!1})],e.prototype,"monthView",void 0),A([a.ViewChild(Z,{static:!1})],e.prototype,"yearView",void 0),A([a.ViewChild(q,{static:!1})],e.prototype,"multiYearView",void 0),e=A([a.Component({moduleId:module.id,selector:"sat-calendar",template:'\n<ng-template [cdkPortalOutlet]="_calendarHeaderPortal"></ng-template>\n\n<div class="mat-calendar-content" [ngSwitch]="currentView" cdkMonitorSubtreeFocus tabindex="-1">\n  <sat-month-view\n      *ngSwitchCase="\'month\'"\n      [(activeDate)]="activeDate"\n      [selected]="selected"\n      [beginDate]="beginDate"\n      [endDate]="endDate"\n      [rangeMode]="rangeMode"\n      [closeAfterSelection]="closeAfterSelection"\n      [rangeHoverEffect]="rangeHoverEffect"\n      [dateFilter]="dateFilter"\n      [maxDate]="maxDate"\n      [minDate]="minDate"\n      [dateClass]="dateClass"\n      [beginDateSelected]="beginDateSelected"\n      (selectedChange)="_dateSelected($event)"\n      (_userSelection)="_userSelected()">\n  </sat-month-view>\n\n  <sat-year-view\n      *ngSwitchCase="\'year\'"\n      [(activeDate)]="activeDate"\n      [selected]="selected"\n      [dateFilter]="dateFilter"\n      [maxDate]="maxDate"\n      [minDate]="minDate"\n      (monthSelected)="_monthSelectedInYearView($event)"\n      (selectedChange)="_goToDateInView($event, \'month\')">\n  </sat-year-view>\n\n  <sat-multi-year-view\n      *ngSwitchCase="\'multi-year\'"\n      [(activeDate)]="activeDate"\n      [selected]="selected"\n      [dateFilter]="dateFilter"\n      [maxDate]="maxDate"\n      [minDate]="minDate"\n      (yearSelected)="_yearSelectedInMultiYearView($event)"\n      (selectedChange)="_goToDateInView($event, \'year\')">\n  </sat-multi-year-view>\n</div>\n\n<ng-template [cdkPortalOutlet]="_calendarFooterPortal"></ng-template>\n',host:{class:"mat-calendar"},exportAs:"matCalendar",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,styles:[".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0}.mat-calendar-content{padding:0 8px 8px;outline:0}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-next-button,.mat-calendar-previous-button{position:relative}.mat-calendar-next-button::after,.mat-calendar-previous-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:'';margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-next-button,[dir=rtl] .mat-calendar-previous-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:'';position:absolute;top:0;left:-8px;right:-8px;height:1px}"]}),C(1,a.Optional()),C(2,a.Optional()),C(2,a.Inject(x))],e)}(),ee={transformPanel:g.trigger("transformPanel",[g.state("void",g.style({opacity:0,transform:"scale(1, 0.8)"})),g.transition("void => enter",g.animate("120ms cubic-bezier(0, 0, 0.2, 1)",g.style({opacity:1,transform:"scale(1, 1)"}))),g.transition("* => void",g.animate("100ms linear",g.style({opacity:0})))]),fadeInCalendar:g.trigger("fadeInCalendar",[g.state("void",g.style({opacity:0})),g.state("enter",g.style({opacity:1})),g.transition("void => *",g.animate("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},te=0,ae=new a.InjectionToken("sat-datepicker-scroll-strategy");
/**
     * @license
     * Copyright Google LLC All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://angular.io/license
     */function ie(e){return function(){return e.scrollStrategies.reposition()}}var ne={provide:ae,deps:[r.Overlay],useFactory:ie},re=function(e){this._elementRef=e},oe=function(e){function t(t){return e.call(this,t)||this}return D(t,e),t.prototype.ngAfterViewInit=function(){this._calendar.focusActiveCell()},t.prototype.close=function(){this.datepicker.closeAfterSelection&&this.datepicker.close()},t.ctorParameters=function(){return[{type:a.ElementRef}]},A([a.ViewChild(Q,{static:!1})],t.prototype,"_calendar",void 0),t=A([a.Component({moduleId:module.id,selector:"sat-datepicker-content",template:'<sat-calendar cdkTrapFocus\n    [id]="datepicker.id"\n    [ngClass]="datepicker.panelClass"\n    [startAt]="datepicker.startAt"\n    [startView]="datepicker.startView"\n    [minDate]="datepicker._minDate"\n    [maxDate]="datepicker._maxDate"\n    [dateFilter]="datepicker._dateFilter"\n    [rangeHoverEffect]="datepicker.rangeHoverEffect"\n    [headerComponent]="datepicker.calendarHeaderComponent"\n    [footerComponent]="datepicker.calendarFooterComponent"\n    [selected]="datepicker._selected"\n    [dateClass]="datepicker.dateClass"\n    [@fadeInCalendar]="\'enter\'"\n    (selectedChange)="datepicker.select($event)"\n    (yearSelected)="datepicker._selectYear($event)"\n    (monthSelected)="datepicker._selectMonth($event)"\n    [beginDate]="datepicker._beginDate"\n    [endDate]="datepicker._endDate"\n    [rangeMode]="datepicker.rangeMode"\n    [closeAfterSelection]="datepicker.closeAfterSelection"\n    [orderPeriodLabel]="datepicker.orderPeriodLabel"\n    (dateRangesChange)="datepicker._selectRange($event)"\n    (beginDateSelectedChange)="datepicker.setBeginDateSelected($event)"\n    (_userSelection)="close()">\n</sat-calendar>\n',host:{class:"mat-datepicker-content","[@transformPanel]":'"enter"',"[class.mat-datepicker-content-touch]":"datepicker.touchUi"},animations:[ee.transformPanel,ee.fadeInCalendar],exportAs:"matDatepickerContent",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,inputs:["color"],styles:[".mat-datepicker-content{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);display:block}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content-touch{box-shadow:0 0 0 0 rgba(0,0,0,.2),0 0 0 0 rgba(0,0,0,.14),0 0 0 0 rgba(0,0,0,.12);display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-calendar{min-width:250px;min-height:312px;max-width:750px;max-height:788px}@media all and (orientation:landscape){.mat-datepicker-content-touch .mat-calendar{width:64vh;height:80vh}}@media all and (orientation:portrait){.mat-datepicker-content-touch .mat-calendar{width:80vw;height:100vw}}"]})],t)}(_.mixinColor(re)),se=function(){function e(e,t,n,r,o,s,d,l){if(this._dialog=e,this._overlay=t,this._ngZone=n,this._viewContainerRef=r,this._dateAdapter=s,this._dir=d,this._document=l,this.startView="month",this._touchUi=!1,this.yearSelected=new a.EventEmitter,this.monthSelected=new a.EventEmitter,this.openedStream=new a.EventEmitter,this.closedStream=new a.EventEmitter,this.closeAfterSelection=!0,this.rangeHoverEffect=!0,this.selectFirstDateOnClose=!1,this.orderPeriodLabel="multi-year",this._opened=!1,this.id="sat-datepicker-"+te++,this._validSelected=null,this._focusedElementBeforeOpen=null,this._inputSubscription=i.Subscription.EMPTY,this._disabledChange=new i.Subject,this._selectedChanged=new i.Subject,!this._dateAdapter)throw z("DateAdapter");this._scrollStrategy=o}return Object.defineProperty(e.prototype,"rangeMode",{get:function(){return this._rangeMode},set:function(e){this._rangeMode=e,this.rangeMode?this._validSelected=null:this._beginDate=this._endDate=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"beginDate",{get:function(){return this._beginDate},set:function(e){this._validSelected=null,this._beginDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endDate",{get:function(){return this._endDate},set:function(e){this._validSelected=null,this._endDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startAt",{get:function(){return this.rangeMode?this._startAt||(this._datepickerInput&&this._datepickerInput.value?this._datepickerInput.value.begin:null):this._startAt||(this._datepickerInput?this._datepickerInput.value:null)},set:function(e){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color||(this._datepickerInput?this._datepickerInput._getThemePalette():void 0)},set:function(e){this._color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchUi",{get:function(){return this._touchUi},set:function(e){this._touchUi=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return void 0===this._disabled&&this._datepickerInput?this._datepickerInput.disabled:!!this._disabled},set:function(e){var t=u.coerceBooleanProperty(e);t!==this._disabled&&(this._disabled=t,this._disabledChange.next(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"opened",{get:function(){return this._opened},set:function(e){e?this.open():this.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_selected",{get:function(){return this._validSelected},set:function(e){this._validSelected=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_minDate",{get:function(){return this._datepickerInput&&this._datepickerInput.min},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_maxDate",{get:function(){return this._datepickerInput&&this._datepickerInput.max},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_dateFilter",{get:function(){return this._datepickerInput&&this._datepickerInput._dateFilter},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.close(),this._inputSubscription.unsubscribe(),this._disabledChange.complete(),this._popupRef&&(this._popupRef.dispose(),this._popupComponentRef=null)},e.prototype.select=function(e){var t=this._selected;this._selected=e,this._dateAdapter.sameDate(t,this._selected)||this._selectedChanged.next(e)},e.prototype._selectRange=function(e){this._beginDateSelected=null,this._dateAdapter.sameDate(e.begin,this.beginDate)&&this._dateAdapter.sameDate(e.end,this.endDate)||this._selectedChanged.next(e),this._beginDate=e.begin,this._endDate=e.end},e.prototype._selectYear=function(e){this.yearSelected.emit(e)},e.prototype._selectMonth=function(e){this.monthSelected.emit(e)},e.prototype._registerInput=function(e){var t=this;if(this._datepickerInput)throw Error("A SatDatepicker can only be associated with a single input.");this._datepickerInput=e,this._inputSubscription=this._datepickerInput._valueChange.subscribe((function(e){null!==e?e&&e.hasOwnProperty("begin")&&e.hasOwnProperty("end")?(e=e).begin&&e.end&&t._dateAdapter.compareDate(e.begin,e.end)<=0?(t.beginDate=e.begin,t.endDate=e.end):t.beginDate=t.endDate=null:t._selected=e:t.beginDate=t.endDate=t._selected=null}))},e.prototype.open=function(){if(!this._opened&&!this.disabled){if(!this._datepickerInput)throw Error("Attempted to open an SatDatepicker with no associated input.");this._document&&(this._focusedElementBeforeOpen=this._document.activeElement),this.touchUi?this._openAsDialog():this._openAsPopup(),this._opened=!0,this.openedStream.emit()}},e.prototype.close=function(){var e=this;if(this._opened){this._popupRef&&this._popupRef.hasAttached()&&this._popupRef.detach(),this._dialogRef&&(this._dialogRef.close(),this._dialogRef=null),this._calendarPortal&&this._calendarPortal.isAttached&&this._calendarPortal.detach(),this._beginDateSelected&&this.selectFirstDateOnClose&&this._selectRange({begin:this._beginDateSelected,end:this._beginDateSelected});var t=function(){e._opened&&(e._opened=!1,e.closedStream.emit(),e._focusedElementBeforeOpen=null)};this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus?(this._focusedElementBeforeOpen.focus(),setTimeout(t)):t()}},e.prototype.setBeginDateSelected=function(e){this._beginDateSelected=e},e.prototype._openAsDialog=function(){var e=this;this._dialogRef&&this._dialogRef.close(),this._dialogRef=this._dialog.open(oe,{direction:this._dir?this._dir.value:"ltr",viewContainerRef:this._viewContainerRef,panelClass:"mat-datepicker-dialog"}),this._dialogRef.afterClosed().subscribe((function(){return e.close()})),this._dialogRef.componentInstance.datepicker=this,this._setColor()},e.prototype._openAsPopup=function(){var e=this;this._calendarPortal||(this._calendarPortal=new o.ComponentPortal(oe,this._viewContainerRef)),this._popupRef||this._createPopup(),this._popupRef.hasAttached()||(this._popupComponentRef=this._popupRef.attach(this._calendarPortal),this._popupComponentRef.instance.datepicker=this,this._setColor(),this._ngZone.onStable.asObservable().pipe(h.take(1)).subscribe((function(){e._popupRef.updatePosition()})))},e.prototype._createPopup=function(){var e=this,t=new r.OverlayConfig({positionStrategy:this._createPopupPositionStrategy(),hasBackdrop:!0,backdropClass:"mat-overlay-transparent-backdrop",direction:this._dir,scrollStrategy:this._scrollStrategy(),panelClass:"mat-datepicker-popup"});this._popupRef=this._overlay.create(t),this._popupRef.overlayElement.setAttribute("role","dialog"),i.merge(this._popupRef.backdropClick(),this._popupRef.detachments(),this._popupRef.keydownEvents().pipe(h.filter((function(t){return t.keyCode===c.ESCAPE||e._datepickerInput&&t.altKey&&t.keyCode===c.UP_ARROW})))).subscribe((function(t){t&&t.preventDefault(),e.close()}))},e.prototype._createPopupPositionStrategy=function(){return this._overlay.position().flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition().withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}])},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.prototype._setColor=function(){var e=this.color;this._popupComponentRef&&(this._popupComponentRef.instance.color=e),this._dialogRef&&(this._dialogRef.componentInstance.color=e)},e.ctorParameters=function(){return[{type:l.MatDialog},{type:r.Overlay},{type:a.NgZone},{type:a.ViewContainerRef},{type:void 0,decorators:[{type:a.Inject,args:[ae]}]},{type:S,decorators:[{type:a.Optional}]},{type:p.Directionality,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[s.DOCUMENT]}]}]},A([a.Input()],e.prototype,"rangeMode",null),A([a.Input()],e.prototype,"beginDate",null),A([a.Input()],e.prototype,"endDate",null),A([a.Input()],e.prototype,"calendarHeaderComponent",void 0),A([a.Input()],e.prototype,"calendarFooterComponent",void 0),A([a.Input()],e.prototype,"startAt",null),A([a.Input()],e.prototype,"startView",void 0),A([a.Input()],e.prototype,"color",null),A([a.Input()],e.prototype,"touchUi",null),A([a.Input()],e.prototype,"disabled",null),A([a.Output()],e.prototype,"yearSelected",void 0),A([a.Output()],e.prototype,"monthSelected",void 0),A([a.Input()],e.prototype,"panelClass",void 0),A([a.Input()],e.prototype,"dateClass",void 0),A([a.Output("opened")],e.prototype,"openedStream",void 0),A([a.Output("closed")],e.prototype,"closedStream",void 0),A([a.Input()],e.prototype,"closeAfterSelection",void 0),A([a.Input()],e.prototype,"rangeHoverEffect",void 0),A([a.Input()],e.prototype,"selectFirstDateOnClose",void 0),A([a.Input()],e.prototype,"orderPeriodLabel",void 0),A([a.Input()],e.prototype,"opened",null),e=A([a.Component({moduleId:module.id,selector:"sat-datepicker",template:"",exportAs:"matDatepicker",changeDetection:a.ChangeDetectionStrategy.OnPush,encapsulation:a.ViewEncapsulation.None}),C(4,a.Inject(ae)),C(5,a.Optional()),C(6,a.Optional()),C(7,a.Optional()),C(7,a.Inject(s.DOCUMENT))],e)}(),de={provide:m.NG_VALUE_ACCESSOR,useExisting:a.forwardRef((function(){return pe})),multi:!0},le={provide:m.NG_VALIDATORS,useExisting:a.forwardRef((function(){return pe})),multi:!0},ce=function(e,t){this.target=e,this.targetElement=t,this.value=this.target.value},pe=function(){function e(e,t,n,r){var o=this;if(this._elementRef=e,this._dateAdapter=t,this._dateFormats=n,this._formField=r,this.dateChange=new a.EventEmitter,this.dateInput=new a.EventEmitter,this._valueChange=new a.EventEmitter,this._disabledChange=new a.EventEmitter,this._onTouched=function(){},this._cvaOnChange=function(){},this._validatorOnChange=function(){},this._datepickerSubscription=i.Subscription.EMPTY,this._localeSubscription=i.Subscription.EMPTY,this._parseValidator=function(){return o._lastValueValid?null:{matDatepickerParse:{text:o._elementRef.nativeElement.value}}},this._minValidator=function(e){if(o._datepicker.rangeMode&&e.value){var t=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.begin)),a=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.end));if(o.min){if(t&&o._dateAdapter.compareDate(o.min,t)>0)return{matDatepickerMin:{min:o.min,actual:t}};if(a&&o._dateAdapter.compareDate(o.min,a)>0)return{matDatepickerMin:{min:o.min,actual:a}}}return null}var i=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value));return!o.min||!i||o._dateAdapter.compareDate(o.min,i)<=0?null:{matDatepickerMin:{min:o.min,actual:i}}},this._maxValidator=function(e){if(o._datepicker.rangeMode&&e.value){var t=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.begin)),a=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.end));if(o.max){if(t&&o._dateAdapter.compareDate(o.max,t)<0)return{matDatepickerMax:{max:o.max,actual:t}};if(a&&o._dateAdapter.compareDate(o.max,a)<0)return{matDatepickerMax:{max:o.max,actual:a}}}return null}var i=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value));return!o.max||!i||o._dateAdapter.compareDate(o.max,i)>=0?null:{matDatepickerMax:{max:o.max,actual:i}}},this._filterValidator=function(e){if(o._datepicker.rangeMode&&e.value){var t=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.begin)),a=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.end));return!o._dateFilter||!t&&!a||o._dateFilter(t)&&o._dateFilter(a)?null:{matDatepickerFilter:!0}}var i=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value));return o._dateFilter&&i&&!o._dateFilter(i)?{matDatepickerFilter:!0}:null},this._rangeValidator=function(e){if(o._datepicker.rangeMode&&e.value){var t=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.begin)),a=o._getValidDateOrNull(o._dateAdapter.deserialize(e.value.end));return!t||!a||o._dateAdapter.compareDate(t,a)<=0?null:{matDatepickerRange:!0}}return null},this._validator=m.Validators.compose([this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator,this._rangeValidator]),this._lastValueValid=!1,!this._dateAdapter)throw z("DateAdapter");if(!this._dateFormats)throw z("MAT_DATE_FORMATS");this._localeSubscription=t.localeChanges.subscribe((function(){o.value=o.value}))}var t;return t=e,Object.defineProperty(e.prototype,"satDatepicker",{set:function(e){var t=this;e&&(this._datepicker=e,this._datepicker._registerInput(this),this._datepickerSubscription.unsubscribe(),this._datepickerSubscription=this._datepicker._selectedChanged.subscribe((function(e){t.value=e,t._cvaOnChange(e),t._onTouched(),t.dateInput.emit(new ce(t,t._elementRef.nativeElement)),t.dateChange.emit(new ce(t,t._elementRef.nativeElement))})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matDatepickerFilter",{set:function(e){this._dateFilter=e,this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){if(e&&e.hasOwnProperty("begin")&&e.hasOwnProperty("end")){var t=e;t.begin=this._dateAdapter.deserialize(t.begin),t.end=this._dateAdapter.deserialize(t.end),this._lastValueValid=!t.begin||!t.end||this._dateAdapter.isValid(t.begin)&&this._dateAdapter.isValid(t.end),t.begin=this._getValidDateOrNull(t.begin),t.end=this._getValidDateOrNull(t.end);var a=this.value;this._elementRef.nativeElement.value=t&&t.begin&&t.end?this._dateAdapter.format(t.begin,this._dateFormats.display.dateInput)+" - "+this._dateAdapter.format(t.end,this._dateFormats.display.dateInput):"",(null==a&&null!=t||null!=a&&null==t||!this._dateAdapter.sameDate(a.begin,t.begin)||!this._dateAdapter.sameDate(a.end,t.end))&&(t.end&&t.begin&&this._dateAdapter.compareDate(t.begin,t.end)>0&&(e=null),this._value=e,this._valueChange.emit(e))}else{e=this._dateAdapter.deserialize(e),this._lastValueValid=!e||this._dateAdapter.isValid(e),e=this._getValidDateOrNull(e);a=this.value;this._value=e,this._elementRef.nativeElement.value=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):"",this._dateAdapter.sameDate(a,e)||this._valueChange.emit(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},set:function(e){this._min=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},set:function(e){this._max=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._validatorOnChange()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return!!this._disabled},set:function(e){var t=u.coerceBooleanProperty(e),a=this._elementRef.nativeElement;this._disabled!==t&&(this._disabled=t,this._disabledChange.emit(t)),t&&a.blur&&a.blur()},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._datepickerSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this._valueChange.complete(),this._disabledChange.complete()},e.prototype.registerOnValidatorChange=function(e){this._validatorOnChange=e},e.prototype.validate=function(e){return this._validator?this._validator(e):null},e.prototype.getPopupConnectionElementRef=function(){return this.getConnectedOverlayOrigin()},e.prototype.getConnectedOverlayOrigin=function(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this._cvaOnChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype._onKeydown=function(e){var t=e.altKey&&e.keyCode===c.DOWN_ARROW;this._datepicker&&t&&!this._elementRef.nativeElement.readOnly&&(this._datepicker.open(),e.preventDefault())},e.prototype._onInput=function(e){var t=null;if(this._datepicker.rangeMode){var a=e.split("-");if(a.length>1){var i=Math.floor(a.length/2),n=a.slice(0,i).join("-"),r=a.slice(i).join("-"),o=this._dateAdapter.parse(n,this._dateFormats.parse.dateInput),s=this._dateAdapter.parse(r,this._dateFormats.parse.dateInput);this._lastValueValid=!o||!s||this._dateAdapter.isValid(o)&&this._dateAdapter.isValid(s),o=this._getValidDateOrNull(o),s=this._getValidDateOrNull(s),o&&s&&(t={begin:o,end:s})}}else t=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput),this._lastValueValid=!t||this._dateAdapter.isValid(t),t=this._getValidDateOrNull(t);this._value=t,this._cvaOnChange(t),this._valueChange.emit(t),this.dateInput.emit(new ce(this,this._elementRef.nativeElement))},e.prototype._onChange=function(){this.dateChange.emit(new ce(this,this._elementRef.nativeElement))},e.prototype._getThemePalette=function(){return this._formField?this._formField.color:void 0},e.prototype._onBlur=function(){this.value&&this._formatValue(this.value),this._onTouched()},e.prototype._formatValue=function(e){e&&e.hasOwnProperty("begin")&&e.hasOwnProperty("end")?(e=e,this._elementRef.nativeElement.value=e&&e.begin&&e.end?this._dateAdapter.format(e.begin,this._dateFormats.display.dateInput)+" - "+this._dateAdapter.format(e.end,this._dateFormats.display.dateInput):""):(e=e,this._elementRef.nativeElement.value=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):"")},e.prototype._getValidDateOrNull=function(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null},e.ctorParameters=function(){return[{type:a.ElementRef},{type:S,decorators:[{type:a.Optional}]},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[x]}]},{type:f.MatFormField,decorators:[{type:a.Optional}]}]},A([a.Input()],e.prototype,"satDatepicker",null),A([a.Input()],e.prototype,"matDatepickerFilter",null),A([a.Input()],e.prototype,"value",null),A([a.Input()],e.prototype,"min",null),A([a.Input()],e.prototype,"max",null),A([a.Input()],e.prototype,"disabled",null),A([a.Output()],e.prototype,"dateChange",void 0),A([a.Output()],e.prototype,"dateInput",void 0),e=t=A([a.Directive({selector:"input[satDatepicker]",providers:[de,le,{provide:y.MAT_INPUT_VALUE_ACCESSOR,useExisting:t}],host:{"[attr.aria-haspopup]":'_datepicker ? "dialog" : null',"[attr.aria-owns]":"(_datepicker?.opened && _datepicker.id) || null","[attr.min]":"min ? _dateAdapter.toIso8601(min) : null","[attr.max]":"max ? _dateAdapter.toIso8601(max) : null","[disabled]":"disabled","(input)":"_onInput($event.target.value)","(change)":"_onChange()","(blur)":"_onBlur()","(keydown)":"_onKeydown($event)"},exportAs:"matDatepickerInput"}),C(1,a.Optional()),C(2,a.Optional()),C(2,a.Inject(x)),C(3,a.Optional())],e)}(),he=function(){function e(){}return e=A([a.Directive({selector:"[matDatepickerToggleIcon]"})],e)}(),ue=function(){function e(e,t,a){this._intl=e,this._changeDetectorRef=t,this._stateChanges=i.Subscription.EMPTY;var n=Number(a);this.tabIndex=n||0===n?n:null}return Object.defineProperty(e.prototype,"disabled",{get:function(){return void 0===this._disabled&&this.datepicker?this.datepicker.disabled:!!this._disabled},set:function(e){this._disabled=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){e.datepicker&&this._watchStateChanges()},e.prototype.ngOnDestroy=function(){this._stateChanges.unsubscribe()},e.prototype.ngAfterContentInit=function(){this._watchStateChanges()},e.prototype._open=function(e){this.datepicker&&!this.disabled&&(this.datepicker.open(),e.stopPropagation())},e.prototype._watchStateChanges=function(){var e=this,t=this.datepicker?this.datepicker._disabledChange:i.of(),a=this.datepicker&&this.datepicker._datepickerInput?this.datepicker._datepickerInput._disabledChange:i.of(),n=this.datepicker?i.merge(this.datepicker.openedStream,this.datepicker.closedStream):i.of();this._stateChanges.unsubscribe(),this._stateChanges=i.merge(this._intl.changes,t,a,n).subscribe((function(){return e._changeDetectorRef.markForCheck()}))},e.ctorParameters=function(){return[{type:B},{type:a.ChangeDetectorRef},{type:String,decorators:[{type:a.Attribute,args:["tabindex"]}]}]},A([a.Input("for")],e.prototype,"datepicker",void 0),A([a.Input()],e.prototype,"tabIndex",void 0),A([a.Input()],e.prototype,"disabled",null),A([a.Input()],e.prototype,"disableRipple",void 0),A([a.ContentChild(he,{static:!1})],e.prototype,"_customIcon",void 0),A([a.ViewChild("button",{static:!1})],e.prototype,"_button",void 0),e=A([a.Component({moduleId:module.id,selector:"sat-datepicker-toggle",template:'<button\n  #button\n  mat-icon-button\n  type="button"\n  [attr.aria-haspopup]="datepicker ? \'dialog\' : null"\n  [attr.aria-label]="_intl.openCalendarLabel"\n  [attr.tabindex]="disabled ? -1 : tabIndex"\n  [disabled]="disabled"\n  [disableRipple]="disableRipple"\n  (click)="_open($event)">\n\n  <svg\n    *ngIf="!_customIcon"\n    class="mat-datepicker-toggle-default-icon"\n    viewBox="0 0 24 24"\n    width="24px"\n    height="24px"\n    fill="currentColor"\n    focusable="false">\n    <path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/>\n  </svg>\n\n  <ng-content select="[matDatepickerToggleIcon]"></ng-content>\n</button>\n',host:{class:"mat-datepicker-toggle","[attr.tabindex]":"-1","[class.mat-datepicker-toggle-active]":"datepicker && datepicker.opened","[class.mat-accent]":'datepicker && datepicker.color === "accent"',"[class.mat-warn]":'datepicker && datepicker.color === "warn"',"(focus)":"_button.focus()"},exportAs:"matDatepickerToggle",encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,styles:[".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}"]}),C(2,a.Attribute("tabindex"))],e)}(),_e=function(){function e(){}return e=A([a.NgModule({imports:[s.CommonModule,d.MatButtonModule,l.MatDialogModule,r.OverlayModule,n.A11yModule,o.PortalModule],exports:[Q,H,se,oe,pe,ue,he,U,Z,q,X,J],declarations:[Q,H,se,oe,pe,ue,he,U,Z,q,X,J],providers:[B,ne],entryComponents:[oe,X,J]})],e)}();e.DateAdapter=S,e.MAT_DATEPICKER_SCROLL_STRATEGY=ae,e.MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY=ie,e.MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER=ne,e.MAT_DATEPICKER_VALIDATORS=le,e.MAT_DATEPICKER_VALUE_ACCESSOR=de,e.MAT_DATE_FORMATS=x,e.MAT_DATE_LOCALE=O,e.MAT_DATE_LOCALE_FACTORY=w,e.MAT_DATE_LOCALE_PROVIDER=I,e.MAT_NATIVE_DATE_FORMATS=N,e.NativeDateAdapter=Y,e.NativeDateModule=T,e.SatCalendar=Q,e.SatCalendarBody=H,e.SatCalendarCell=W,e.SatCalendarFooter=J,e.SatCalendarHeader=X,e.SatDatepicker=se,e.SatDatepickerContent=oe,e.SatDatepickerInput=pe,e.SatDatepickerInputEvent=ce,e.SatDatepickerIntl=B,e.SatDatepickerModule=_e,e.SatDatepickerToggle=ue,e.SatDatepickerToggleIcon=he,e.SatMonthView=U,e.SatMultiYearView=q,e.SatNativeDateModule=L,e.SatYearView=Z,e.matDatepickerAnimations=ee,e.yearsPerPage=24,e.yearsPerRow=4,e.ɵ0=j,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=saturn-datepicker.umd.min.js.map