text: /**
   * @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 (global, factory) {
  	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/common'), require('@angular/core'), require('@angular/material/button'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/cdk/keycodes'), require('@angular/material/core'), require('rxjs/operators/take'), require('rxjs/Subject'), require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/cdk/portal'), require('rxjs/Subscription'), require('@angular/forms'), require('@angular/material/form-field'), require('@angular/material/input'), require('rxjs/observable/merge'), require('rxjs/observable/of')) :
  	typeof define === 'function' && define.amd ? define(['exports', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/common', '@angular/core', '@angular/material/button', '@angular/material/dialog', '@angular/material/icon', '@angular/cdk/keycodes', '@angular/material/core', 'rxjs/operators/take', 'rxjs/Subject', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/cdk/portal', 'rxjs/Subscription', '@angular/forms', '@angular/material/form-field', '@angular/material/input', 'rxjs/observable/merge', 'rxjs/observable/of'], factory) :
  	(factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.datepicker = global.ng.material.datepicker || {}),global.ng.cdk.a11y,global.ng.cdk.overlay,global.ng.common,global.ng.core,global.ng.material.button,global.ng.material.dialog,global.ng.material.icon,global.ng.cdk.keycodes,global.ng.material.core,global.Rx.Observable,global.Rx,global.ng.cdk.bidi,global.ng.cdk.coercion,global.ng.cdk.portal,global.Rx,global.ng.forms,global.ng.material.formField,global.ng.material.input,global.Rx.Observable,global.Rx.Observable));
  }(this, (function (exports,_angular_cdk_a11y,_angular_cdk_overlay,_angular_common,_angular_core,_angular_material_button,_angular_material_dialog,_angular_material_icon,_angular_cdk_keycodes,_angular_material_core,rxjs_operators_take,rxjs_Subject,_angular_cdk_bidi,_angular_cdk_coercion,_angular_cdk_portal,rxjs_Subscription,_angular_forms,_angular_material_formField,_angular_material_input,rxjs_observable_merge,rxjs_observable_of) { 'use strict';
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  /**
   * \@docs-private
   * @param {?} provider
   * @return {?}
   */
  function createMissingDateImplError(provider) {
      return Error("MatDatepicker: No provider found for " + provider + ". You must import one of the following " +
          "modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a " +
          "custom implementation.");
  }
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * Datepicker data that requires internationalization.
   */
  var MatDatepickerIntl = (function () {
      function MatDatepickerIntl() {
          /**
           * Stream that emits whenever the labels here are changed. Use this to notify
           * components if the labels have changed after initialization.
           */
          this.changes = new rxjs_Subject.Subject();
          /**
           * A label for the calendar popup (used by screen readers).
           */
          this.calendarLabel = 'Calendar';
          /**
           * A label for the button used to open the calendar popup (used by screen readers).
           */
          this.openCalendarLabel = 'Open calendar';
          /**
           * A label for the previous month button (used by screen readers).
           */
          this.prevMonthLabel = 'Previous month';
          /**
           * A label for the next month button (used by screen readers).
           */
          this.nextMonthLabel = 'Next month';
          /**
           * A label for the previous year button (used by screen readers).
           */
          this.prevYearLabel = 'Previous year';
          /**
           * A label for the next year button (used by screen readers).
           */
          this.nextYearLabel = 'Next year';
          /**
           * A label for the 'switch to month view' button (used by screen readers).
           */
          this.switchToMonthViewLabel = 'Change to month view';
          /**
           * A label for the 'switch to year view' button (used by screen readers).
           */
          this.switchToYearViewLabel = 'Change to year view';
      }
      MatDatepickerIntl.decorators = [
          { type: _angular_core.Injectable },
      ];
      /** @nocollapse */
      MatDatepickerIntl.ctorParameters = function () { return []; };
      return MatDatepickerIntl;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * An internal class that represents the data corresponding to a single calendar cell.
   * \@docs-private
   */
  var MatCalendarCell = (function () {
      function MatCalendarCell(value, displayValue, ariaLabel, enabled) {
          this.value = value;
          this.displayValue = displayValue;
          this.ariaLabel = ariaLabel;
          this.enabled = enabled;
      }
      return MatCalendarCell;
  }());
  /**
   * An internal component used to display calendar data in a table.
   * \@docs-private
   */
  var MatCalendarBody = (function () {
      function MatCalendarBody() {
          /**
           * The number of columns in the table.
           */
          this.numCols = 7;
          /**
           * Whether to allow selection of disabled cells.
           */
          this.allowDisabledSelection = false;
          /**
           * The cell number of the active cell in the table.
           */
          this.activeCell = 0;
          /**
           * The aspect ratio (width / height) to use for the cells in the table. This aspect ratio will be
           * maintained even as the table resizes.
           */
          this.cellAspectRatio = 1;
          /**
           * Emits when a new value is selected.
           */
          this.selectedValueChange = new _angular_core.EventEmitter();
      }
      /**
       * @param {?} cell
       * @return {?}
       */
      MatCalendarBody.prototype._cellClicked = /**
       * @param {?} cell
       * @return {?}
       */
      function (cell) {
          if (!this.allowDisabledSelection && !cell.enabled) {
              return;
          }
          this.selectedValueChange.emit(cell.value);
      };
      Object.defineProperty(MatCalendarBody.prototype, "_firstRowOffset", {
          /** The number of blank cells to put at the beginning for the first row. */
          get: /**
           * The number of blank cells to put at the beginning for the first row.
           * @return {?}
           */
          function () {
              return this.rows && this.rows.length && this.rows[0].length ?
                  this.numCols - this.rows[0].length : 0;
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @param {?} rowIndex
       * @param {?} colIndex
       * @return {?}
       */
      MatCalendarBody.prototype._isActiveCell = /**
       * @param {?} rowIndex
       * @param {?} colIndex
       * @return {?}
       */
      function (rowIndex, colIndex) {
          var /** @type {?} */ cellNumber = rowIndex * this.numCols + colIndex;
          // Account for the fact that the first row may not have as many cells.
          if (rowIndex) {
              cellNumber -= this._firstRowOffset;
          }
          return cellNumber == this.activeCell;
      };
      MatCalendarBody.decorators = [
          { type: _angular_core.Component, args: [{selector: '[mat-calendar-body]',
                      template: "<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\"><td class=\"mat-calendar-body-label\" [attr.colspan]=\"numCols\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\">{{label}}</td></tr><tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\"><td *ngIf=\"rowIndex === 0 && _firstRowOffset\" aria-hidden=\"true\" class=\"mat-calendar-body-label\" [attr.colspan]=\"_firstRowOffset\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\">{{_firstRowOffset >= labelMinRequiredCells ? label : ''}}</td><td *ngFor=\"let item of row; let colIndex = index\" role=\"gridcell\" class=\"mat-calendar-body-cell\" [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\" [class.mat-calendar-body-disabled]=\"!item.enabled\" [class.mat-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\" [attr.aria-label]=\"item.ariaLabel\" [attr.aria-disabled]=\"!item.enabled || null\" (click)=\"_cellClicked(item)\" [style.width.%]=\"100 / numCols\" [style.paddingTop.%]=\"50 * cellAspectRatio / numCols\" [style.paddingBottom.%]=\"50 * cellAspectRatio / numCols\"><div class=\"mat-calendar-body-cell-content\" [class.mat-calendar-body-selected]=\"selectedValue === item.value\" [class.mat-calendar-body-today]=\"todayValue === item.value\">{{item.displayValue}}</div></td></tr>",
                      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}"],
                      host: {
                          'class': 'mat-calendar-body',
                      },
                      exportAs: 'matCalendarBody',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatCalendarBody.ctorParameters = function () { return []; };
      MatCalendarBody.propDecorators = {
          "label": [{ type: _angular_core.Input },],
          "rows": [{ type: _angular_core.Input },],
          "todayValue": [{ type: _angular_core.Input },],
          "selectedValue": [{ type: _angular_core.Input },],
          "labelMinRequiredCells": [{ type: _angular_core.Input },],
          "numCols": [{ type: _angular_core.Input },],
          "allowDisabledSelection": [{ type: _angular_core.Input },],
          "activeCell": [{ type: _angular_core.Input },],
          "cellAspectRatio": [{ type: _angular_core.Input },],
          "selectedValueChange": [{ type: _angular_core.Output },],
      };
      return MatCalendarBody;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  var DAYS_PER_WEEK = 7;
  /**
   * An internal component used to display a single month in the datepicker.
   * \@docs-private
   */
  var MatMonthView = (function () {
      function MatMonthView(_dateAdapter, _dateFormats, _changeDetectorRef) {
          this._dateAdapter = _dateAdapter;
          this._dateFormats = _dateFormats;
          this._changeDetectorRef = _changeDetectorRef;
          /**
           * Emits when a new date is selected.
           */
          this.selectedChange = new _angular_core.EventEmitter();
          /**
           * Emits when any date is selected.
           */
          this._userSelection = new _angular_core.EventEmitter();
          if (!this._dateAdapter) {
              throw createMissingDateImplError('DateAdapter');
          }
          if (!this._dateFormats) {
              throw createMissingDateImplError('MAT_DATE_FORMATS');
          }
          var /** @type {?} */ firstDayOfWeek = this._dateAdapter.getFirstDayOfWeek();
          var /** @type {?} */ narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow');
          var /** @type {?} */ longWeekdays = this._dateAdapter.getDayOfWeekNames('long');
          // Rotate the labels for days of the week based on the configured first day of the week.
          var /** @type {?} */ weekdays = longWeekdays.map(function (long, i) {
              return { long: long, narrow: narrowWeekdays[i] };
          });
          this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
          this._activeDate = this._dateAdapter.today();
      }
      Object.defineProperty(MatMonthView.prototype, "activeDate", {
          get: /**
           * The date to display in this month view (everything other than the month and year is ignored).
           * @return {?}
           */
          function () { return this._activeDate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              var /** @type {?} */ oldActiveDate = this._activeDate;
              this._activeDate =
                  this._getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today();
              if (!this._hasSameMonthAndYear(oldActiveDate, this._activeDate)) {
                  this._init();
              }
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatMonthView.prototype, "selected", {
          get: /**
           * The currently selected date.
           * @return {?}
           */
          function () { return this._selected; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
              this._selectedDate = this._getDateInCurrentMonth(this._selected);
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MatMonthView.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._init();
      };
      /** Handles when a new date is selected. */
      /**
       * Handles when a new date is selected.
       * @param {?} date
       * @return {?}
       */
      MatMonthView.prototype._dateSelected = /**
       * Handles when a new date is selected.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          if (this._selectedDate != date) {
              var /** @type {?} */ selectedYear = this._dateAdapter.getYear(this.activeDate);
              var /** @type {?} */ selectedMonth = this._dateAdapter.getMonth(this.activeDate);
              var /** @type {?} */ selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);
              this.selectedChange.emit(selectedDate);
          }
          this._userSelection.emit();
      };
      /** Initializes this month view. */
      /**
       * Initializes this month view.
       * @return {?}
       */
      MatMonthView.prototype._init = /**
       * Initializes this month view.
       * @return {?}
       */
      function () {
          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 /** @type {?} */ firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);
          this._firstWeekOffset =
              (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -
                  this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;
          this._createWeekCells();
          this._changeDetectorRef.markForCheck();
      };
      /**
       * Creates MatCalendarCells for the dates in this month.
       * @return {?}
       */
      MatMonthView.prototype._createWeekCells = /**
       * Creates MatCalendarCells for the dates in this month.
       * @return {?}
       */
      function () {
          var /** @type {?} */ daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);
          var /** @type {?} */ dateNames = this._dateAdapter.getDateNames();
          this._weeks = [[]];
          for (var /** @type {?} */ i = 0, /** @type {?} */ cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
              if (cell == DAYS_PER_WEEK) {
                  this._weeks.push([]);
                  cell = 0;
              }
              var /** @type {?} */ date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);
              var /** @type {?} */ enabled = !this.dateFilter ||
                  this.dateFilter(date);
              var /** @type {?} */ ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);
              this._weeks[this._weeks.length - 1]
                  .push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
          }
      };
      /**
       * Gets the date in this month that the given Date falls on.
       * Returns null if the given Date is in another month.
       * @param {?} date
       * @return {?}
       */
      MatMonthView.prototype._getDateInCurrentMonth = /**
       * Gets the date in this month that the given Date falls on.
       * Returns null if the given Date is in another month.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          return date && this._hasSameMonthAndYear(date, this.activeDate) ?
              this._dateAdapter.getDate(date) : null;
      };
      /**
       * Checks whether the 2 dates are non-null and fall within the same month of the same year.
       * @param {?} d1
       * @param {?} d2
       * @return {?}
       */
      MatMonthView.prototype._hasSameMonthAndYear = /**
       * Checks whether the 2 dates are non-null and fall within the same month of the same year.
       * @param {?} d1
       * @param {?} d2
       * @return {?}
       */
      function (d1, d2) {
          return !!(d1 && d2 && this._dateAdapter.getMonth(d1) == this._dateAdapter.getMonth(d2) &&
              this._dateAdapter.getYear(d1) == this._dateAdapter.getYear(d2));
      };
      /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      MatMonthView.prototype._getValidDateOrNull = /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      function (obj) {
          return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
      };
      MatMonthView.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-month-view',
                      template: "<table class=\"mat-calendar-table\"><thead class=\"mat-calendar-table-header\"><tr><th *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th></tr><tr><th class=\"mat-calendar-table-header-divider\" colspan=\"7\" aria-hidden=\"true\"></th></tr></thead><tbody mat-calendar-body role=\"grid\" [label]=\"_monthLabel\" [rows]=\"_weeks\" [todayValue]=\"_todayDate\" [selectedValue]=\"_selectedDate\" [labelMinRequiredCells]=\"3\" [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\" (selectedValueChange)=\"_dateSelected($event)\"></tbody></table>",
                      exportAs: 'matMonthVeiw',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatMonthView.ctorParameters = function () { return [
          { type: _angular_material_core.DateAdapter, decorators: [{ type: _angular_core.Optional },] },
          { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_material_core.MAT_DATE_FORMATS,] },] },
          { type: _angular_core.ChangeDetectorRef, },
      ]; };
      MatMonthView.propDecorators = {
          "activeDate": [{ type: _angular_core.Input },],
          "selected": [{ type: _angular_core.Input },],
          "dateFilter": [{ type: _angular_core.Input },],
          "selectedChange": [{ type: _angular_core.Output },],
          "_userSelection": [{ type: _angular_core.Output },],
      };
      return MatMonthView;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * An internal component used to display a single year in the datepicker.
   * \@docs-private
   */
  var MatYearView = (function () {
      function MatYearView(_dateAdapter, _dateFormats, _changeDetectorRef) {
          this._dateAdapter = _dateAdapter;
          this._dateFormats = _dateFormats;
          this._changeDetectorRef = _changeDetectorRef;
          /**
           * Emits when a new month is selected.
           */
          this.selectedChange = new _angular_core.EventEmitter();
          if (!this._dateAdapter) {
              throw createMissingDateImplError('DateAdapter');
          }
          if (!this._dateFormats) {
              throw createMissingDateImplError('MAT_DATE_FORMATS');
          }
          this._activeDate = this._dateAdapter.today();
      }
      Object.defineProperty(MatYearView.prototype, "activeDate", {
          get: /**
           * The date to display in this year view (everything other than the year is ignored).
           * @return {?}
           */
          function () { return this._activeDate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              var /** @type {?} */ oldActiveDate = this._activeDate;
              this._activeDate =
                  this._getValidDateOrNull(this._dateAdapter.deserialize(value)) || this._dateAdapter.today();
              if (this._dateAdapter.getYear(oldActiveDate) != this._dateAdapter.getYear(this._activeDate)) {
                  this._init();
              }
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatYearView.prototype, "selected", {
          get: /**
           * The currently selected date.
           * @return {?}
           */
          function () { return this._selected; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
              this._selectedMonth = this._getMonthInCurrentYear(this._selected);
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MatYearView.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._init();
      };
      /** Handles when a new month is selected. */
      /**
       * Handles when a new month is selected.
       * @param {?} month
       * @return {?}
       */
      MatYearView.prototype._monthSelected = /**
       * Handles when a new month is selected.
       * @param {?} month
       * @return {?}
       */
      function (month) {
          var /** @type {?} */ daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1));
          this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));
      };
      /** Initializes this month view. */
      /**
       * Initializes this month view.
       * @return {?}
       */
      MatYearView.prototype._init = /**
       * Initializes this month view.
       * @return {?}
       */
      function () {
          var _this = this;
          this._selectedMonth = this._getMonthInCurrentYear(this.selected);
          this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());
          this._yearLabel = this._dateAdapter.getYearName(this.activeDate);
          var /** @type {?} */ monthNames = this._dateAdapter.getMonthNames('short');
          // First row of months only contains 5 elements so we can fit the year label on the same row.
          this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(function (row) {
              return row.map(function (month) { return _this._createCellForMonth(month, monthNames[month]); });
          });
          this._changeDetectorRef.markForCheck();
      };
      /**
       * Gets the month in this year that the given Date falls on.
       * Returns null if the given Date is in another year.
       * @param {?} date
       * @return {?}
       */
      MatYearView.prototype._getMonthInCurrentYear = /**
       * Gets the month in this year that the given Date falls on.
       * Returns null if the given Date is in another year.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          return date && this._dateAdapter.getYear(date) == this._dateAdapter.getYear(this.activeDate) ?
              this._dateAdapter.getMonth(date) : null;
      };
      /**
       * Creates an MatCalendarCell for the given month.
       * @param {?} month
       * @param {?} monthName
       * @return {?}
       */
      MatYearView.prototype._createCellForMonth = /**
       * Creates an MatCalendarCell for the given month.
       * @param {?} month
       * @param {?} monthName
       * @return {?}
       */
      function (month, monthName) {
          var /** @type {?} */ ariaLabel = this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1), this._dateFormats.display.monthYearA11yLabel);
          return new MatCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._isMonthEnabled(month));
      };
      /**
       * Whether the given month is enabled.
       * @param {?} month
       * @return {?}
       */
      MatYearView.prototype._isMonthEnabled = /**
       * Whether the given month is enabled.
       * @param {?} month
       * @return {?}
       */
      function (month) {
          if (!this.dateFilter) {
              return true;
          }
          var /** @type {?} */ firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);
          // If any date in the month is enabled count the month as enabled.
          for (var /** @type {?} */ date = firstOfMonth; this._dateAdapter.getMonth(date) == month; date = this._dateAdapter.addCalendarDays(date, 1)) {
              if (this.dateFilter(date)) {
                  return true;
              }
          }
          return false;
      };
      /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      MatYearView.prototype._getValidDateOrNull = /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      function (obj) {
          return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
      };
      MatYearView.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-year-view',
                      template: "<table class=\"mat-calendar-table\"><thead class=\"mat-calendar-table-header\"><tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr></thead><tbody mat-calendar-body role=\"grid\" allowDisabledSelection=\"true\" [label]=\"_yearLabel\" [rows]=\"_months\" [todayValue]=\"_todayMonth\" [selectedValue]=\"_selectedMonth\" [labelMinRequiredCells]=\"2\" [numCols]=\"4\" [cellAspectRatio]=\"4 / 7\" [activeCell]=\"_dateAdapter.getMonth(activeDate)\" (selectedValueChange)=\"_monthSelected($event)\"></tbody></table>",
                      exportAs: 'matYearView',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatYearView.ctorParameters = function () { return [
          { type: _angular_material_core.DateAdapter, decorators: [{ type: _angular_core.Optional },] },
          { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_material_core.MAT_DATE_FORMATS,] },] },
          { type: _angular_core.ChangeDetectorRef, },
      ]; };
      MatYearView.propDecorators = {
          "activeDate": [{ type: _angular_core.Input },],
          "selected": [{ type: _angular_core.Input },],
          "dateFilter": [{ type: _angular_core.Input },],
          "selectedChange": [{ type: _angular_core.Output },],
      };
      return MatYearView;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * A calendar that is used as part of the datepicker.
   * \@docs-private
   */
  var MatCalendar = (function () {
      function MatCalendar(_elementRef, _intl, _ngZone, _dateAdapter, _dateFormats, changeDetectorRef) {
          var _this = this;
          this._elementRef = _elementRef;
          this._intl = _intl;
          this._ngZone = _ngZone;
          this._dateAdapter = _dateAdapter;
          this._dateFormats = _dateFormats;
          /**
           * Whether the calendar should be started in month or year view.
           */
          this.startView = 'month';
          /**
           * Emits when the currently selected date changes.
           */
          this.selectedChange = new _angular_core.EventEmitter();
          /**
           * Emits when any date is selected.
           */
          this._userSelection = new _angular_core.EventEmitter();
          /**
           * Date filter for the month and year views.
           */
          this._dateFilterForViews = function (date) {
              return !!date &&
                  (!_this.dateFilter || _this.dateFilter(date)) &&
                  (!_this.minDate || _this._dateAdapter.compareDate(date, _this.minDate) >= 0) &&
                  (!_this.maxDate || _this._dateAdapter.compareDate(date, _this.maxDate) <= 0);
          };
          if (!this._dateAdapter) {
              throw createMissingDateImplError('DateAdapter');
          }
          if (!this._dateFormats) {
              throw createMissingDateImplError('MAT_DATE_FORMATS');
          }
          this._intlChanges = _intl.changes.subscribe(function () { return changeDetectorRef.markForCheck(); });
      }
      Object.defineProperty(MatCalendar.prototype, "startAt", {
          get: /**
           * A date representing the period (month or year) to start the calendar in.
           * @return {?}
           */
          function () { return this._startAt; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._startAt = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "selected", {
          get: /**
           * The currently selected date.
           * @return {?}
           */
          function () { return this._selected; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._selected = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "minDate", {
          get: /**
           * The minimum selectable date.
           * @return {?}
           */
          function () { return this._minDate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._minDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "maxDate", {
          get: /**
           * The maximum selectable date.
           * @return {?}
           */
          function () { return this._maxDate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._maxDate = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "_activeDate", {
          /**
           * The current active date. This determines which time period is shown and which date is
           * highlighted when using keyboard navigation.
           */
          get: /**
           * The current active date. This determines which time period is shown and which date is
           * highlighted when using keyboard navigation.
           * @return {?}
           */
          function () { return this._clampedActiveDate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._clampedActiveDate = this._dateAdapter.clampDate(value, this.minDate, this.maxDate);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "_periodButtonText", {
          /** The label for the current calendar view. */
          get: /**
           * The label for the current calendar view.
           * @return {?}
           */
          function () {
              return this._monthView ?
                  this._dateAdapter.format(this._activeDate, this._dateFormats.display.monthYearLabel)
                      .toLocaleUpperCase() :
                  this._dateAdapter.getYearName(this._activeDate);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "_periodButtonLabel", {
          get: /**
           * @return {?}
           */
          function () {
              return this._monthView ? this._intl.switchToYearViewLabel : this._intl.switchToMonthViewLabel;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "_prevButtonLabel", {
          /** The label for the the previous button. */
          get: /**
           * The label for the the previous button.
           * @return {?}
           */
          function () {
              return this._monthView ? this._intl.prevMonthLabel : this._intl.prevYearLabel;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatCalendar.prototype, "_nextButtonLabel", {
          /** The label for the the next button. */
          get: /**
           * The label for the the next button.
           * @return {?}
           */
          function () {
              return this._monthView ? this._intl.nextMonthLabel : this._intl.nextYearLabel;
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MatCalendar.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._activeDate = this.startAt || this._dateAdapter.today();
          this._focusActiveCell();
          this._monthView = this.startView != 'year';
      };
      /**
       * @return {?}
       */
      MatCalendar.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this._intlChanges.unsubscribe();
      };
      /**
       * @param {?} changes
       * @return {?}
       */
      MatCalendar.prototype.ngOnChanges = /**
       * @param {?} changes
       * @return {?}
       */
      function (changes) {
          var /** @type {?} */ change = changes["minDate"] || changes["maxDate"] || changes["dateFilter"];
          if (change && !change.firstChange) {
              var /** @type {?} */ view = this.monthView || this.yearView;
              if (view) {
                  view._init();
              }
          }
      };
      /** Handles date selection in the month view. */
      /**
       * Handles date selection in the month view.
       * @param {?} date
       * @return {?}
       */
      MatCalendar.prototype._dateSelected = /**
       * Handles date selection in the month view.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          if (!this._dateAdapter.sameDate(date, this.selected)) {
              this.selectedChange.emit(date);
          }
      };
      /**
       * @return {?}
       */
      MatCalendar.prototype._userSelected = /**
       * @return {?}
       */
      function () {
          this._userSelection.emit();
      };
      /** Handles month selection in the year view. */
      /**
       * Handles month selection in the year view.
       * @param {?} month
       * @return {?}
       */
      MatCalendar.prototype._monthSelected = /**
       * Handles month selection in the year view.
       * @param {?} month
       * @return {?}
       */
      function (month) {
          this._activeDate = month;
          this._monthView = true;
      };
      /** Handles user clicks on the period label. */
      /**
       * Handles user clicks on the period label.
       * @return {?}
       */
      MatCalendar.prototype._currentPeriodClicked = /**
       * Handles user clicks on the period label.
       * @return {?}
       */
      function () {
          this._monthView = !this._monthView;
      };
      /** Handles user clicks on the previous button. */
      /**
       * Handles user clicks on the previous button.
       * @return {?}
       */
      MatCalendar.prototype._previousClicked = /**
       * Handles user clicks on the previous button.
       * @return {?}
       */
      function () {
          this._activeDate = this._monthView ?
              this._dateAdapter.addCalendarMonths(this._activeDate, -1) :
              this._dateAdapter.addCalendarYears(this._activeDate, -1);
      };
      /** Handles user clicks on the next button. */
      /**
       * Handles user clicks on the next button.
       * @return {?}
       */
      MatCalendar.prototype._nextClicked = /**
       * Handles user clicks on the next button.
       * @return {?}
       */
      function () {
          this._activeDate = this._monthView ?
              this._dateAdapter.addCalendarMonths(this._activeDate, 1) :
              this._dateAdapter.addCalendarYears(this._activeDate, 1);
      };
      /** Whether the previous period button is enabled. */
      /**
       * Whether the previous period button is enabled.
       * @return {?}
       */
      MatCalendar.prototype._previousEnabled = /**
       * Whether the previous period button is enabled.
       * @return {?}
       */
      function () {
          if (!this.minDate) {
              return true;
          }
          return !this.minDate || !this._isSameView(this._activeDate, this.minDate);
      };
      /** Whether the next period button is enabled. */
      /**
       * Whether the next period button is enabled.
       * @return {?}
       */
      MatCalendar.prototype._nextEnabled = /**
       * Whether the next period button is enabled.
       * @return {?}
       */
      function () {
          return !this.maxDate || !this._isSameView(this._activeDate, this.maxDate);
      };
      /** Handles keydown events on the calendar body. */
      /**
       * Handles keydown events on the calendar body.
       * @param {?} event
       * @return {?}
       */
      MatCalendar.prototype._handleCalendarBodyKeydown = /**
       * Handles keydown events on the calendar body.
       * @param {?} event
       * @return {?}
       */
      function (event) {
          // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent
          // disabled ones from being selected. This may not be ideal, we should look into whether
          // navigation should skip over disabled dates, and if so, how to implement that efficiently.
          if (this._monthView) {
              this._handleCalendarBodyKeydownInMonthView(event);
          }
          else {
              this._handleCalendarBodyKeydownInYearView(event);
          }
      };
      /** Focuses the active cell after the microtask queue is empty. */
      /**
       * Focuses the active cell after the microtask queue is empty.
       * @return {?}
       */
      MatCalendar.prototype._focusActiveCell = /**
       * Focuses the active cell after the microtask queue is empty.
       * @return {?}
       */
      function () {
          var _this = this;
          this._ngZone.runOutsideAngular(function () {
              _this._ngZone.onStable.asObservable().pipe(rxjs_operators_take.take(1)).subscribe(function () {
                  _this._elementRef.nativeElement.querySelector('.mat-calendar-body-active').focus();
              });
          });
      };
      /**
       * Whether the two dates represent the same view in the current view mode (month or year).
       * @param {?} date1
       * @param {?} date2
       * @return {?}
       */
      MatCalendar.prototype._isSameView = /**
       * Whether the two dates represent the same view in the current view mode (month or year).
       * @param {?} date1
       * @param {?} date2
       * @return {?}
       */
      function (date1, date2) {
          return this._monthView ?
              this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2) &&
                  this._dateAdapter.getMonth(date1) == this._dateAdapter.getMonth(date2) :
              this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2);
      };
      /**
       * Handles keydown events on the calendar body when calendar is in month view.
       * @param {?} event
       * @return {?}
       */
      MatCalendar.prototype._handleCalendarBodyKeydownInMonthView = /**
       * Handles keydown events on the calendar body when calendar is in month view.
       * @param {?} event
       * @return {?}
       */
      function (event) {
          switch (event.keyCode) {
              case _angular_cdk_keycodes.LEFT_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -1);
                  break;
              case _angular_cdk_keycodes.RIGHT_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1);
                  break;
              case _angular_cdk_keycodes.UP_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, -7);
                  break;
              case _angular_cdk_keycodes.DOWN_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 7);
                  break;
              case _angular_cdk_keycodes.HOME:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, 1 - this._dateAdapter.getDate(this._activeDate));
                  break;
              case _angular_cdk_keycodes.END:
                  this._activeDate = this._dateAdapter.addCalendarDays(this._activeDate, (this._dateAdapter.getNumDaysInMonth(this._activeDate) -
                      this._dateAdapter.getDate(this._activeDate)));
                  break;
              case _angular_cdk_keycodes.PAGE_UP:
                  this._activeDate = event.altKey ?
                      this._dateAdapter.addCalendarYears(this._activeDate, -1) :
                      this._dateAdapter.addCalendarMonths(this._activeDate, -1);
                  break;
              case _angular_cdk_keycodes.PAGE_DOWN:
                  this._activeDate = event.altKey ?
                      this._dateAdapter.addCalendarYears(this._activeDate, 1) :
                      this._dateAdapter.addCalendarMonths(this._activeDate, 1);
                  break;
              case _angular_cdk_keycodes.ENTER:
                  if (this._dateFilterForViews(this._activeDate)) {
                      this._dateSelected(this._activeDate);
                      // Prevent unexpected default actions such as form submission.
                      event.preventDefault();
                  }
                  return;
              default:
                  // Don't prevent default or focus active cell on keys that we don't explicitly handle.
                  return;
          }
          this._focusActiveCell();
          // Prevent unexpected default actions such as form submission.
          event.preventDefault();
      };
      /**
       * Handles keydown events on the calendar body when calendar is in year view.
       * @param {?} event
       * @return {?}
       */
      MatCalendar.prototype._handleCalendarBodyKeydownInYearView = /**
       * Handles keydown events on the calendar body when calendar is in year view.
       * @param {?} event
       * @return {?}
       */
      function (event) {
          switch (event.keyCode) {
              case _angular_cdk_keycodes.LEFT_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -1);
                  break;
              case _angular_cdk_keycodes.RIGHT_ARROW:
                  this._activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 1);
                  break;
              case _angular_cdk_keycodes.UP_ARROW:
                  this._activeDate = this._prevMonthInSameCol(this._activeDate);
                  break;
              case _angular_cdk_keycodes.DOWN_ARROW:
                  this._activeDate = this._nextMonthInSameCol(this._activeDate);
                  break;
              case _angular_cdk_keycodes.HOME:
                  this._activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, -this._dateAdapter.getMonth(this._activeDate));
                  break;
              case _angular_cdk_keycodes.END:
                  this._activeDate = this._dateAdapter.addCalendarMonths(this._activeDate, 11 - this._dateAdapter.getMonth(this._activeDate));
                  break;
              case _angular_cdk_keycodes.PAGE_UP:
                  this._activeDate =
                      this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? -10 : -1);
                  break;
              case _angular_cdk_keycodes.PAGE_DOWN:
                  this._activeDate =
                      this._dateAdapter.addCalendarYears(this._activeDate, event.altKey ? 10 : 1);
                  break;
              case _angular_cdk_keycodes.ENTER:
                  this._monthSelected(this._activeDate);
                  break;
              default:
                  // Don't prevent default or focus active cell on keys that we don't explicitly handle.
                  return;
          }
          this._focusActiveCell();
          // Prevent unexpected default actions such as form submission.
          event.preventDefault();
      };
      /**
       * Determine the date for the month that comes before the given month in the same column in the
       * calendar table.
       * @param {?} date
       * @return {?}
       */
      MatCalendar.prototype._prevMonthInSameCol = /**
       * Determine the date for the month that comes before the given month in the same column in the
       * calendar table.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          // Determine how many months to jump forward given that there are 2 empty slots at the beginning
          // of each year.
          var /** @type {?} */ increment = this._dateAdapter.getMonth(date) <= 4 ? -5 :
              (this._dateAdapter.getMonth(date) >= 7 ? -7 : -12);
          return this._dateAdapter.addCalendarMonths(date, increment);
      };
      /**
       * Determine the date for the month that comes after the given month in the same column in the
       * calendar table.
       * @param {?} date
       * @return {?}
       */
      MatCalendar.prototype._nextMonthInSameCol = /**
       * Determine the date for the month that comes after the given month in the same column in the
       * calendar table.
       * @param {?} date
       * @return {?}
       */
      function (date) {
          // Determine how many months to jump forward given that there are 2 empty slots at the beginning
          // of each year.
          var /** @type {?} */ increment = this._dateAdapter.getMonth(date) <= 4 ? 7 :
              (this._dateAdapter.getMonth(date) >= 7 ? 5 : 12);
          return this._dateAdapter.addCalendarMonths(date, increment);
      };
      /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      MatCalendar.prototype._getValidDateOrNull = /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      function (obj) {
          return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
      };
      MatCalendar.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-calendar',
                      template: "<div class=\"mat-calendar-header\"><div class=\"mat-calendar-controls\"><button mat-button class=\"mat-calendar-period-button\" (click)=\"_currentPeriodClicked()\" [attr.aria-label]=\"_periodButtonLabel\">{{_periodButtonText}}<div class=\"mat-calendar-arrow\" [class.mat-calendar-invert]=\"!_monthView\"></div></button><div class=\"mat-calendar-spacer\"></div><button mat-icon-button class=\"mat-calendar-previous-button\" [disabled]=\"!_previousEnabled()\" (click)=\"_previousClicked()\" [attr.aria-label]=\"_prevButtonLabel\"></button> <button mat-icon-button class=\"mat-calendar-next-button\" [disabled]=\"!_nextEnabled()\" (click)=\"_nextClicked()\" [attr.aria-label]=\"_nextButtonLabel\"></button></div></div><div class=\"mat-calendar-content\" (keydown)=\"_handleCalendarBodyKeydown($event)\" [ngSwitch]=\"_monthView\" cdkMonitorSubtreeFocus><mat-month-view *ngSwitchCase=\"true\" [activeDate]=\"_activeDate\" [selected]=\"selected\" [dateFilter]=\"_dateFilterForViews\" (selectedChange)=\"_dateSelected($event)\" (_userSelection)=\"_userSelected()\"></mat-month-view><mat-year-view *ngSwitchDefault [activeDate]=\"_activeDate\" [selected]=\"selected\" [dateFilter]=\"_dateFilterForViews\" (selectedChange)=\"_monthSelected($event)\"></mat-year-view></div>",
                      styles: [".mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 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 0}.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}"],
                      host: {
                          'class': 'mat-calendar',
                      },
                      exportAs: 'matCalendar',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatCalendar.ctorParameters = function () { return [
          { type: _angular_core.ElementRef, },
          { type: MatDatepickerIntl, },
          { type: _angular_core.NgZone, },
          { type: _angular_material_core.DateAdapter, decorators: [{ type: _angular_core.Optional },] },
          { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_material_core.MAT_DATE_FORMATS,] },] },
          { type: _angular_core.ChangeDetectorRef, },
      ]; };
      MatCalendar.propDecorators = {
          "startAt": [{ type: _angular_core.Input },],
          "startView": [{ type: _angular_core.Input },],
          "selected": [{ type: _angular_core.Input },],
          "minDate": [{ type: _angular_core.Input },],
          "maxDate": [{ type: _angular_core.Input },],
          "dateFilter": [{ type: _angular_core.Input },],
          "selectedChange": [{ type: _angular_core.Output },],
          "_userSelection": [{ type: _angular_core.Output },],
          "monthView": [{ type: _angular_core.ViewChild, args: [MatMonthView,] },],
          "yearView": [{ type: _angular_core.ViewChild, args: [MatYearView,] },],
      };
      return MatCalendar;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * Used to generate a unique ID for each datepicker instance.
   */
  var datepickerUid = 0;
  /**
   * Injection token that determines the scroll handling while the calendar is open.
   */
  var MAT_DATEPICKER_SCROLL_STRATEGY = new _angular_core.InjectionToken('mat-datepicker-scroll-strategy');
  /**
   * \@docs-private
   * @param {?} overlay
   * @return {?}
   */
  function MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
      return function () { return overlay.scrollStrategies.reposition(); };
  }
  /**
   * \@docs-private
   */
  var MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER = {
      provide: MAT_DATEPICKER_SCROLL_STRATEGY,
      deps: [_angular_cdk_overlay.Overlay],
      useFactory: MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY,
  };
  /**
   * Component used as the content for the datepicker dialog and popup. We use this instead of using
   * MatCalendar directly as the content so we can control the initial focus. This also gives us a
   * place to put additional features of the popup that are not part of the calendar itself in the
   * future. (e.g. confirmation buttons).
   * \@docs-private
   */
  var MatDatepickerContent = (function () {
      function MatDatepickerContent() {
      }
      /**
       * @return {?}
       */
      MatDatepickerContent.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._calendar._focusActiveCell();
      };
      /**
       * Handles keydown event on datepicker content.
       * @param event The event.
       */
      /**
       * Handles keydown event on datepicker content.
       * @param {?} event The event.
       * @return {?}
       */
      MatDatepickerContent.prototype._handleKeydown = /**
       * Handles keydown event on datepicker content.
       * @param {?} event The event.
       * @return {?}
       */
      function (event) {
          if (event.keyCode === _angular_cdk_keycodes.ESCAPE) {
              this.datepicker.close();
              event.preventDefault();
              event.stopPropagation();
          }
      };
      MatDatepickerContent.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-datepicker-content',
                      template: "<mat-calendar cdkTrapFocus [id]=\"datepicker.id\" [ngClass]=\"datepicker.panelClass\" [startAt]=\"datepicker.startAt\" [startView]=\"datepicker.startView\" [minDate]=\"datepicker._minDate\" [maxDate]=\"datepicker._maxDate\" [dateFilter]=\"datepicker._dateFilter\" [selected]=\"datepicker._selected\" (selectedChange)=\"datepicker._select($event)\" (_userSelection)=\"datepicker.close()\"></mat-calendar>",
                      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}}"],
                      host: {
                          'class': 'mat-datepicker-content',
                          '[class.mat-datepicker-content-touch]': 'datepicker.touchUi',
                          '(keydown)': '_handleKeydown($event)',
                      },
                      exportAs: 'matDatepickerContent',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatDatepickerContent.ctorParameters = function () { return []; };
      MatDatepickerContent.propDecorators = {
          "_calendar": [{ type: _angular_core.ViewChild, args: [MatCalendar,] },],
      };
      return MatDatepickerContent;
  }());
  /**
   * Component responsible for managing the datepicker popup/dialog.
   */
  var MatDatepicker = (function () {
      function MatDatepicker(_dialog, _overlay, _ngZone, _viewContainerRef, _scrollStrategy, _dateAdapter, _dir, _document) {
          this._dialog = _dialog;
          this._overlay = _overlay;
          this._ngZone = _ngZone;
          this._viewContainerRef = _viewContainerRef;
          this._scrollStrategy = _scrollStrategy;
          this._dateAdapter = _dateAdapter;
          this._dir = _dir;
          this._document = _document;
          /**
           * The view that the calendar should start in.
           */
          this.startView = 'month';
          this._touchUi = false;
          /**
           * Emits new selected date when selected date changes.
           * @deprecated Switch to the `dateChange` and `dateInput` binding on the input element.
           */
          this.selectedChanged = new _angular_core.EventEmitter();
          /**
           * Emits when the datepicker has been opened.
           */
          this.openedStream = new _angular_core.EventEmitter();
          /**
           * Emits when the datepicker has been closed.
           */
          this.closedStream = new _angular_core.EventEmitter();
          /**
           * Whether the calendar is open.
           */
          this.opened = false;
          /**
           * The id for the datepicker calendar.
           */
          this.id = "mat-datepicker-" + datepickerUid++;
          this._validSelected = null;
          /**
           * The element that was focused before the datepicker was opened.
           */
          this._focusedElementBeforeOpen = null;
          this._inputSubscription = rxjs_Subscription.Subscription.EMPTY;
          /**
           * Emits when the datepicker is disabled.
           */
          this._disabledChange = new rxjs_Subject.Subject();
          if (!this._dateAdapter) {
              throw createMissingDateImplError('DateAdapter');
          }
      }
      Object.defineProperty(MatDatepicker.prototype, "startAt", {
          get: /**
           * The date to open the calendar to initially.
           * @return {?}
           */
          function () {
              // If an explicit startAt is set we start there, otherwise we start at whatever the currently
              // selected value is.
              return this._startAt || (this._datepickerInput ? this._datepickerInput.value : null);
          },
          set: /**
           * @param {?} date
           * @return {?}
           */
          function (date) {
              this._startAt = this._getValidDateOrNull(this._dateAdapter.deserialize(date));
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "touchUi", {
          get: /**
           * Whether the calendar UI is in touch mode. In touch mode the calendar opens in a dialog rather
           * than a popup and elements have more padding to allow for bigger touch targets.
           * @return {?}
           */
          function () {
              return this._touchUi;
          },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._touchUi = _angular_cdk_coercion.coerceBooleanProperty(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "disabled", {
          get: /**
           * Whether the datepicker pop-up should be disabled.
           * @return {?}
           */
          function () {
              return this._disabled === undefined && this._datepickerInput ?
                  this._datepickerInput.disabled : !!this._disabled;
          },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              var /** @type {?} */ newValue = _angular_cdk_coercion.coerceBooleanProperty(value);
              if (newValue !== this._disabled) {
                  this._disabled = newValue;
                  this._disabledChange.next(newValue);
              }
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "_selected", {
          /** The currently selected date. */
          get: /**
           * The currently selected date.
           * @return {?}
           */
          function () { return this._validSelected; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) { this._validSelected = value; },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "_minDate", {
          /** The minimum selectable date. */
          get: /**
           * The minimum selectable date.
           * @return {?}
           */
          function () {
              return this._datepickerInput && this._datepickerInput.min;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "_maxDate", {
          /** The maximum selectable date. */
          get: /**
           * The maximum selectable date.
           * @return {?}
           */
          function () {
              return this._datepickerInput && this._datepickerInput.max;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepicker.prototype, "_dateFilter", {
          get: /**
           * @return {?}
           */
          function () {
              return this._datepickerInput && this._datepickerInput._dateFilter;
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MatDatepicker.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this.close();
          this._inputSubscription.unsubscribe();
          this._disabledChange.complete();
          if (this._popupRef) {
              this._popupRef.dispose();
          }
      };
      /** Selects the given date */
      /**
       * Selects the given date
       * @param {?} date
       * @return {?}
       */
      MatDatepicker.prototype._select = /**
       * Selects the given date
       * @param {?} date
       * @return {?}
       */
      function (date) {
          var /** @type {?} */ oldValue = this._selected;
          this._selected = date;
          if (!this._dateAdapter.sameDate(oldValue, this._selected)) {
              this.selectedChanged.emit(date);
          }
      };
      /**
       * Register an input with this datepicker.
       * @param input The datepicker input to register with this datepicker.
       */
      /**
       * Register an input with this datepicker.
       * @param {?} input The datepicker input to register with this datepicker.
       * @return {?}
       */
      MatDatepicker.prototype._registerInput = /**
       * Register an input with this datepicker.
       * @param {?} input The datepicker input to register with this datepicker.
       * @return {?}
       */
      function (input) {
          var _this = this;
          if (this._datepickerInput) {
              throw Error('A MatDatepicker can only be associated with a single input.');
          }
          this._datepickerInput = input;
          this._inputSubscription =
              this._datepickerInput._valueChange.subscribe(function (value) { return _this._selected = value; });
      };
      /** Open the calendar. */
      /**
       * Open the calendar.
       * @return {?}
       */
      MatDatepicker.prototype.open = /**
       * Open the calendar.
       * @return {?}
       */
      function () {
          if (this.opened || this.disabled) {
              return;
          }
          if (!this._datepickerInput) {
              throw Error('Attempted to open an MatDatepicker with no associated input.');
          }
          if (this._document) {
              this._focusedElementBeforeOpen = this._document.activeElement;
          }
          this.touchUi ? this._openAsDialog() : this._openAsPopup();
          this.opened = true;
          this.openedStream.emit();
      };
      /** Close the calendar. */
      /**
       * Close the calendar.
       * @return {?}
       */
      MatDatepicker.prototype.close = /**
       * Close the calendar.
       * @return {?}
       */
      function () {
          if (!this.opened) {
              return;
          }
          if (this._popupRef && this._popupRef.hasAttached()) {
              this._popupRef.detach();
          }
          if (this._dialogRef) {
              this._dialogRef.close();
              this._dialogRef = null;
          }
          if (this._calendarPortal && this._calendarPortal.isAttached) {
              this._calendarPortal.detach();
          }
          if (this._focusedElementBeforeOpen &&
              typeof this._focusedElementBeforeOpen.focus === 'function') {
              this._focusedElementBeforeOpen.focus();
              this._focusedElementBeforeOpen = null;
          }
          this.opened = false;
          this.closedStream.emit();
      };
      /**
       * Open the calendar as a dialog.
       * @return {?}
       */
      MatDatepicker.prototype._openAsDialog = /**
       * Open the calendar as a dialog.
       * @return {?}
       */
      function () {
          var _this = this;
          this._dialogRef = this._dialog.open(MatDatepickerContent, {
              direction: this._dir ? this._dir.value : 'ltr',
              viewContainerRef: this._viewContainerRef,
              panelClass: 'mat-datepicker-dialog',
          });
          this._dialogRef.afterClosed().subscribe(function () { return _this.close(); });
          this._dialogRef.componentInstance.datepicker = this;
      };
      /**
       * Open the calendar as a popup.
       * @return {?}
       */
      MatDatepicker.prototype._openAsPopup = /**
       * Open the calendar as a popup.
       * @return {?}
       */
      function () {
          var _this = this;
          if (!this._calendarPortal) {
              this._calendarPortal = new _angular_cdk_portal.ComponentPortal(MatDatepickerContent, this._viewContainerRef);
          }
          if (!this._popupRef) {
              this._createPopup();
          }
          if (!this._popupRef.hasAttached()) {
              var /** @type {?} */ componentRef = this._popupRef.attach(this._calendarPortal);
              componentRef.instance.datepicker = this;
              // Update the position once the calendar has rendered.
              this._ngZone.onStable.asObservable().pipe(rxjs_operators_take.take(1)).subscribe(function () {
                  _this._popupRef.updatePosition();
              });
          }
          this._popupRef.backdropClick().subscribe(function () { return _this.close(); });
      };
      /**
       * Create the popup.
       * @return {?}
       */
      MatDatepicker.prototype._createPopup = /**
       * Create the popup.
       * @return {?}
       */
      function () {
          var /** @type {?} */ overlayConfig = new _angular_cdk_overlay.OverlayConfig({
              positionStrategy: this._createPopupPositionStrategy(),
              hasBackdrop: true,
              backdropClass: 'mat-overlay-transparent-backdrop',
              direction: this._dir ? this._dir.value : 'ltr',
              scrollStrategy: this._scrollStrategy(),
              panelClass: 'mat-datepicker-popup',
          });
          this._popupRef = this._overlay.create(overlayConfig);
      };
      /**
       * Create the popup PositionStrategy.
       * @return {?}
       */
      MatDatepicker.prototype._createPopupPositionStrategy = /**
       * Create the popup PositionStrategy.
       * @return {?}
       */
      function () {
          return this._overlay.position()
              .connectedTo(this._datepickerInput.getPopupConnectionElementRef(), { originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' })
              .withFallbackPosition({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
              .withFallbackPosition({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' })
              .withFallbackPosition({ originX: 'end', originY: 'top' }, { overlayX: 'end', overlayY: 'bottom' });
      };
      /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      MatDatepicker.prototype._getValidDateOrNull = /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      function (obj) {
          return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
      };
      MatDatepicker.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-datepicker',
                      template: '',
                      exportAs: 'matDatepicker',
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                  },] },
      ];
      /** @nocollapse */
      MatDatepicker.ctorParameters = function () { return [
          { type: _angular_material_dialog.MatDialog, },
          { type: _angular_cdk_overlay.Overlay, },
          { type: _angular_core.NgZone, },
          { type: _angular_core.ViewContainerRef, },
          { type: undefined, decorators: [{ type: _angular_core.Inject, args: [MAT_DATEPICKER_SCROLL_STRATEGY,] },] },
          { type: _angular_material_core.DateAdapter, decorators: [{ type: _angular_core.Optional },] },
          { type: _angular_cdk_bidi.Directionality, decorators: [{ type: _angular_core.Optional },] },
          { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_common.DOCUMENT,] },] },
      ]; };
      MatDatepicker.propDecorators = {
          "startAt": [{ type: _angular_core.Input },],
          "startView": [{ type: _angular_core.Input },],
          "touchUi": [{ type: _angular_core.Input },],
          "disabled": [{ type: _angular_core.Input },],
          "selectedChanged": [{ type: _angular_core.Output },],
          "panelClass": [{ type: _angular_core.Input },],
          "openedStream": [{ type: _angular_core.Output, args: ['opened',] },],
          "closedStream": [{ type: _angular_core.Output, args: ['closed',] },],
      };
      return MatDatepicker;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  var MAT_DATEPICKER_VALUE_ACCESSOR = {
      provide: _angular_forms.NG_VALUE_ACCESSOR,
      useExisting: _angular_core.forwardRef(function () { return MatDatepickerInput; }),
      multi: true
  };
  var MAT_DATEPICKER_VALIDATORS = {
      provide: _angular_forms.NG_VALIDATORS,
      useExisting: _angular_core.forwardRef(function () { return MatDatepickerInput; }),
      multi: true
  };
  /**
   * An event used for datepicker input and change events. We don't always have access to a native
   * input or change event because the event may have been triggered by the user clicking on the
   * calendar popup. For consistency, we always use MatDatepickerInputEvent instead.
   */
  var MatDatepickerInputEvent = (function () {
      function MatDatepickerInputEvent(target, targetElement) {
          this.target = target;
          this.targetElement = targetElement;
          this.value = this.target.value;
      }
      return MatDatepickerInputEvent;
  }());
  /**
   * Directive used to connect an input to a MatDatepicker.
   */
  var MatDatepickerInput = (function () {
      function MatDatepickerInput(_elementRef, _dateAdapter, _dateFormats, _formField) {
          var _this = this;
          this._elementRef = _elementRef;
          this._dateAdapter = _dateAdapter;
          this._dateFormats = _dateFormats;
          this._formField = _formField;
          /**
           * Emits when a `change` event is fired on this `<input>`.
           */
          this.dateChange = new _angular_core.EventEmitter();
          /**
           * Emits when an `input` event is fired on this `<input>`.
           */
          this.dateInput = new _angular_core.EventEmitter();
          /**
           * Emits when the value changes (either due to user input or programmatic change).
           */
          this._valueChange = new _angular_core.EventEmitter();
          /**
           * Emits when the disabled state has changed
           */
          this._disabledChange = new _angular_core.EventEmitter();
          this._onTouched = function () { };
          this._cvaOnChange = function () { };
          this._validatorOnChange = function () { };
          this._datepickerSubscription = rxjs_Subscription.Subscription.EMPTY;
          this._localeSubscription = rxjs_Subscription.Subscription.EMPTY;
          /**
           * The form control validator for whether the input parses.
           */
          this._parseValidator = function () {
              return _this._lastValueValid ?
                  null : { 'matDatepickerParse': { 'text': _this._elementRef.nativeElement.value } };
          };
          /**
           * The form control validator for the min date.
           */
          this._minValidator = function (control) {
              var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
              return (!_this.min || !controlValue ||
                  _this._dateAdapter.compareDate(_this.min, controlValue) <= 0) ?
                  null : { 'matDatepickerMin': { 'min': _this.min, 'actual': controlValue } };
          };
          /**
           * The form control validator for the max date.
           */
          this._maxValidator = function (control) {
              var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
              return (!_this.max || !controlValue ||
                  _this._dateAdapter.compareDate(_this.max, controlValue) >= 0) ?
                  null : { 'matDatepickerMax': { 'max': _this.max, 'actual': controlValue } };
          };
          /**
           * The form control validator for the date filter.
           */
          this._filterValidator = function (control) {
              var /** @type {?} */ controlValue = _this._getValidDateOrNull(_this._dateAdapter.deserialize(control.value));
              return !_this._dateFilter || !controlValue || _this._dateFilter(controlValue) ?
                  null : { 'matDatepickerFilter': true };
          };
          /**
           * The combined form control validator for this input.
           */
          this._validator = _angular_forms.Validators.compose([this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator]);
          /**
           * Whether the last value set on the input was valid.
           */
          this._lastValueValid = false;
          if (!this._dateAdapter) {
              throw createMissingDateImplError('DateAdapter');
          }
          if (!this._dateFormats) {
              throw createMissingDateImplError('MAT_DATE_FORMATS');
          }
          // Update the displayed date when the locale changes.
          this._localeSubscription = _dateAdapter.localeChanges.subscribe(function () {
              _this.value = _this.value;
          });
      }
      Object.defineProperty(MatDatepickerInput.prototype, "matDatepicker", {
          set: /**
           * The datepicker that this input is associated with.
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.registerDatepicker(value);
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @param {?} value
       * @return {?}
       */
      MatDatepickerInput.prototype.registerDatepicker = /**
       * @param {?} value
       * @return {?}
       */
      function (value) {
          if (value) {
              this._datepicker = value;
              this._datepicker._registerInput(this);
          }
      };
      Object.defineProperty(MatDatepickerInput.prototype, "matDatepickerFilter", {
          set: /**
           * @param {?} filter
           * @return {?}
           */
          function (filter) {
              this._dateFilter = filter;
              this._validatorOnChange();
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepickerInput.prototype, "value", {
          get: /**
           * The value of the input.
           * @return {?}
           */
          function () {
              return this._value;
          },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              value = this._dateAdapter.deserialize(value);
              this._lastValueValid = !value || this._dateAdapter.isValid(value);
              value = this._getValidDateOrNull(value);
              var /** @type {?} */ oldDate = this.value;
              this._value = value;
              this._elementRef.nativeElement.value =
                  value ? this._dateAdapter.format(value, this._dateFormats.display.dateInput) : '';
              if (!this._dateAdapter.sameDate(oldDate, value)) {
                  this._valueChange.emit(value);
              }
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepickerInput.prototype, "min", {
          get: /**
           * The minimum valid date.
           * @return {?}
           */
          function () { return this._min; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._min = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
              this._validatorOnChange();
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepickerInput.prototype, "max", {
          get: /**
           * The maximum valid date.
           * @return {?}
           */
          function () { return this._max; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._max = this._getValidDateOrNull(this._dateAdapter.deserialize(value));
              this._validatorOnChange();
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MatDatepickerInput.prototype, "disabled", {
          get: /**
           * Whether the datepicker-input is disabled.
           * @return {?}
           */
          function () { return !!this._disabled; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              var /** @type {?} */ newValue = _angular_cdk_coercion.coerceBooleanProperty(value);
              if (this._disabled !== newValue) {
                  this._disabled = newValue;
                  this._disabledChange.emit(newValue);
              }
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MatDatepickerInput.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          var _this = this;
          if (this._datepicker) {
              this._datepickerSubscription =
                  this._datepicker.selectedChanged.subscribe(function (selected) {
                      _this.value = selected;
                      _this._cvaOnChange(selected);
                      _this._onTouched();
                      _this.dateInput.emit(new MatDatepickerInputEvent(_this, _this._elementRef.nativeElement));
                      _this.dateChange.emit(new MatDatepickerInputEvent(_this, _this._elementRef.nativeElement));
                  });
          }
      };
      /**
       * @return {?}
       */
      MatDatepickerInput.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this._datepickerSubscription.unsubscribe();
          this._localeSubscription.unsubscribe();
          this._valueChange.complete();
          this._disabledChange.complete();
      };
      /**
       * @param {?} fn
       * @return {?}
       */
      MatDatepickerInput.prototype.registerOnValidatorChange = /**
       * @param {?} fn
       * @return {?}
       */
      function (fn) {
          this._validatorOnChange = fn;
      };
      /**
       * @param {?} c
       * @return {?}
       */
      MatDatepickerInput.prototype.validate = /**
       * @param {?} c
       * @return {?}
       */
      function (c) {
          return this._validator ? this._validator(c) : null;
      };
      /**
       * Gets the element that the datepicker popup should be connected to.
       * @return The element to connect the popup to.
       */
      /**
       * Gets the element that the datepicker popup should be connected to.
       * @return {?} The element to connect the popup to.
       */
      MatDatepickerInput.prototype.getPopupConnectionElementRef = /**
       * Gets the element that the datepicker popup should be connected to.
       * @return {?} The element to connect the popup to.
       */
      function () {
          return this._formField ? this._formField.underlineRef : this._elementRef;
      };
      // Implemented as part of ControlValueAccessor
      /**
       * @param {?} value
       * @return {?}
       */
      MatDatepickerInput.prototype.writeValue = /**
       * @param {?} value
       * @return {?}
       */
      function (value) {
          this.value = value;
      };
      // Implemented as part of ControlValueAccessor
      /**
       * @param {?} fn
       * @return {?}
       */
      MatDatepickerInput.prototype.registerOnChange = /**
       * @param {?} fn
       * @return {?}
       */
      function (fn) {
          this._cvaOnChange = fn;
      };
      // Implemented as part of ControlValueAccessor
      /**
       * @param {?} fn
       * @return {?}
       */
      MatDatepickerInput.prototype.registerOnTouched = /**
       * @param {?} fn
       * @return {?}
       */
      function (fn) {
          this._onTouched = fn;
      };
      // Implemented as part of ControlValueAccessor
      /**
       * @param {?} disabled
       * @return {?}
       */
      MatDatepickerInput.prototype.setDisabledState = /**
       * @param {?} disabled
       * @return {?}
       */
      function (disabled) {
          this.disabled = disabled;
      };
      /**
       * @param {?} event
       * @return {?}
       */
      MatDatepickerInput.prototype._onKeydown = /**
       * @param {?} event
       * @return {?}
       */
      function (event) {
          if (event.altKey && event.keyCode === _angular_cdk_keycodes.DOWN_ARROW) {
              this._datepicker.open();
              event.preventDefault();
          }
      };
      /**
       * @param {?} value
       * @return {?}
       */
      MatDatepickerInput.prototype._onInput = /**
       * @param {?} value
       * @return {?}
       */
      function (value) {
          var /** @type {?} */ date = this._dateAdapter.parse(value, this._dateFormats.parse.dateInput);
          this._lastValueValid = !date || this._dateAdapter.isValid(date);
          date = this._getValidDateOrNull(date);
          this._value = date;
          this._cvaOnChange(date);
          this._valueChange.emit(date);
          this.dateInput.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
      };
      /**
       * @return {?}
       */
      MatDatepickerInput.prototype._onChange = /**
       * @return {?}
       */
      function () {
          this.dateChange.emit(new MatDatepickerInputEvent(this, this._elementRef.nativeElement));
      };
      /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      MatDatepickerInput.prototype._getValidDateOrNull = /**
       * @param {?} obj The object to check.
       * @return {?} The given object if it is both a date instance and valid, otherwise null.
       */
      function (obj) {
          return (this._dateAdapter.isDateInstance(obj) && this._dateAdapter.isValid(obj)) ? obj : null;
      };
      MatDatepickerInput.decorators = [
          { type: _angular_core.Directive, args: [{
                      selector: 'input[matDatepicker]',
                      providers: [
                          MAT_DATEPICKER_VALUE_ACCESSOR,
                          MAT_DATEPICKER_VALIDATORS,
                          { provide: _angular_material_input.MAT_INPUT_VALUE_ACCESSOR, useExisting: MatDatepickerInput },
                      ],
                      host: {
                          '[attr.aria-haspopup]': 'true',
                          '[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)': '_onTouched()',
                          '(keydown)': '_onKeydown($event)',
                      },
                      exportAs: 'matDatepickerInput',
                  },] },
      ];
      /** @nocollapse */
      MatDatepickerInput.ctorParameters = function () { return [
          { type: _angular_core.ElementRef, },
          { type: _angular_material_core.DateAdapter, decorators: [{ type: _angular_core.Optional },] },
          { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_material_core.MAT_DATE_FORMATS,] },] },
          { type: _angular_material_formField.MatFormField, decorators: [{ type: _angular_core.Optional },] },
      ]; };
      MatDatepickerInput.propDecorators = {
          "matDatepicker": [{ type: _angular_core.Input },],
          "matDatepickerFilter": [{ type: _angular_core.Input },],
          "value": [{ type: _angular_core.Input },],
          "min": [{ type: _angular_core.Input },],
          "max": [{ type: _angular_core.Input },],
          "disabled": [{ type: _angular_core.Input },],
          "dateChange": [{ type: _angular_core.Output },],
          "dateInput": [{ type: _angular_core.Output },],
      };
      return MatDatepickerInput;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  var MatDatepickerToggle = (function () {
      function MatDatepickerToggle(_intl, _changeDetectorRef) {
          this._intl = _intl;
          this._changeDetectorRef = _changeDetectorRef;
          this._stateChanges = rxjs_Subscription.Subscription.EMPTY;
      }
      Object.defineProperty(MatDatepickerToggle.prototype, "disabled", {
          get: /**
           * Whether the toggle button is disabled.
           * @return {?}
           */
          function () {
              return this._disabled === undefined ? this.datepicker.disabled : !!this._disabled;
          },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this._disabled = _angular_cdk_coercion.coerceBooleanProperty(value);
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @param {?} changes
       * @return {?}
       */
      MatDatepickerToggle.prototype.ngOnChanges = /**
       * @param {?} changes
       * @return {?}
       */
      function (changes) {
          if (changes["datepicker"]) {
              this._watchStateChanges();
          }
      };
      /**
       * @return {?}
       */
      MatDatepickerToggle.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this._stateChanges.unsubscribe();
      };
      /**
       * @return {?}
       */
      MatDatepickerToggle.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._watchStateChanges();
      };
      /**
       * @param {?} event
       * @return {?}
       */
      MatDatepickerToggle.prototype._open = /**
       * @param {?} event
       * @return {?}
       */
      function (event) {
          if (this.datepicker && !this.disabled) {
              this.datepicker.open();
              event.stopPropagation();
          }
      };
      /**
       * @return {?}
       */
      MatDatepickerToggle.prototype._watchStateChanges = /**
       * @return {?}
       */
      function () {
          var _this = this;
          var /** @type {?} */ datepickerDisabled = this.datepicker ? this.datepicker._disabledChange : rxjs_observable_of.of();
          var /** @type {?} */ inputDisabled = this.datepicker && this.datepicker._datepickerInput ?
              this.datepicker._datepickerInput._disabledChange : rxjs_observable_of.of();
          this._stateChanges.unsubscribe();
          this._stateChanges = rxjs_observable_merge.merge(this._intl.changes, datepickerDisabled, inputDisabled)
              .subscribe(function () { return _this._changeDetectorRef.markForCheck(); });
      };
      MatDatepickerToggle.decorators = [
          { type: _angular_core.Component, args: [{selector: 'mat-datepicker-toggle',
                      template: "<button mat-icon-button type=\"button\" [attr.aria-label]=\"_intl.openCalendarLabel\" [disabled]=\"disabled\" (click)=\"_open($event)\"><mat-icon><svg viewBox=\"0 0 24 24\" width=\"100%\" height=\"100%\" fill=\"currentColor\" style=\"vertical-align: top\" focusable=\"false\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><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\"/></svg></mat-icon></button>",
                      host: {
                          'class': 'mat-datepicker-toggle',
                      },
                      exportAs: 'matDatepickerToggle',
                      encapsulation: _angular_core.ViewEncapsulation.None,
                      preserveWhitespaces: false,
                      changeDetection: _angular_core.ChangeDetectionStrategy.OnPush,
                  },] },
      ];
      /** @nocollapse */
      MatDatepickerToggle.ctorParameters = function () { return [
          { type: MatDatepickerIntl, },
          { type: _angular_core.ChangeDetectorRef, },
      ]; };
      MatDatepickerToggle.propDecorators = {
          "datepicker": [{ type: _angular_core.Input, args: ['for',] },],
          "disabled": [{ type: _angular_core.Input },],
      };
      return MatDatepickerToggle;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  var MatDatepickerModule = (function () {
      function MatDatepickerModule() {
      }
      MatDatepickerModule.decorators = [
          { type: _angular_core.NgModule, args: [{
                      imports: [
                          _angular_common.CommonModule,
                          _angular_material_button.MatButtonModule,
                          _angular_material_dialog.MatDialogModule,
                          _angular_material_icon.MatIconModule,
                          _angular_cdk_overlay.OverlayModule,
                          _angular_cdk_a11y.A11yModule,
                      ],
                      exports: [
                          MatCalendar,
                          MatCalendarBody,
                          MatDatepicker,
                          MatDatepickerContent,
                          MatDatepickerInput,
                          MatDatepickerToggle,
                          MatMonthView,
                          MatYearView,
                      ],
                      declarations: [
                          MatCalendar,
                          MatCalendarBody,
                          MatDatepicker,
                          MatDatepickerContent,
                          MatDatepickerInput,
                          MatDatepickerToggle,
                          MatMonthView,
                          MatYearView,
                      ],
                      providers: [
                          MatDatepickerIntl,
                          MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER,
                      ],
                      entryComponents: [
                          MatDatepickerContent,
                      ]
                  },] },
      ];
      /** @nocollapse */
      MatDatepickerModule.ctorParameters = function () { return []; };
      return MatDatepickerModule;
  }());
  
  exports.MatDatepickerModule = MatDatepickerModule;
  exports.MatCalendar = MatCalendar;
  exports.MatCalendarCell = MatCalendarCell;
  exports.MatCalendarBody = MatCalendarBody;
  exports.MAT_DATEPICKER_SCROLL_STRATEGY = MAT_DATEPICKER_SCROLL_STRATEGY;
  exports.MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY = MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY;
  exports.MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER = MAT_DATEPICKER_SCROLL_STRATEGY_PROVIDER;
  exports.MatDatepickerContent = MatDatepickerContent;
  exports.MatDatepicker = MatDatepicker;
  exports.MAT_DATEPICKER_VALUE_ACCESSOR = MAT_DATEPICKER_VALUE_ACCESSOR;
  exports.MAT_DATEPICKER_VALIDATORS = MAT_DATEPICKER_VALIDATORS;
  exports.MatDatepickerInputEvent = MatDatepickerInputEvent;
  exports.MatDatepickerInput = MatDatepickerInput;
  exports.MatDatepickerIntl = MatDatepickerIntl;
  exports.MatDatepickerToggle = MatDatepickerToggle;
  exports.MatMonthView = MatMonthView;
  exports.MatYearView = MatYearView;
  
  Object.defineProperty(exports, '__esModule', { value: true });
  
  })));
  //# sourceMappingURL=material-datepicker.umd.js.map
  