text: /**
   * @license
   * Copyright (c) 2018 Dominic Carretto
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://github.com/trimox/angular-mdc-web/blob/master/LICENSE
   */
  import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, Input, Renderer2, ViewEncapsulation, NgModule } from '@angular/core';
  
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }
  
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
  
    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
    if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  }
  
  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
  
    return self;
  }
  
  function _possibleConstructorReturn(self, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    }
  
    return _assertThisInitialized(self);
  }
  
  /**
   * @license
   * Copyright 2016 Google Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /**
   * @template A
   */
  var MDCFoundation =
  /*#__PURE__*/
  function () {
    _createClass(MDCFoundation, null, [{
      key: "cssClasses",
  
      /** @return enum{cssClasses} */
      get: function get() {
        // Classes extending MDCFoundation should implement this method to return an object which exports every
        // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
        return {};
      }
      /** @return enum{strings} */
  
    }, {
      key: "strings",
      get: function get() {
        // Classes extending MDCFoundation should implement this method to return an object which exports all
        // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
        return {};
      }
      /** @return enum{numbers} */
  
    }, {
      key: "numbers",
      get: function get() {
        // Classes extending MDCFoundation should implement this method to return an object which exports all
        // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
        return {};
      }
      /** @return {!Object} */
  
    }, {
      key: "defaultAdapter",
      get: function get() {
        // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
        // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
        // validation.
        return {};
      }
      /**
       * @param {A=} adapter
       */
  
    }]);
  
    function MDCFoundation() {
      var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  
      _classCallCheck(this, MDCFoundation);
  
      /** @protected {!A} */
      this.adapter_ = adapter;
    }
  
    _createClass(MDCFoundation, [{
      key: "init",
      value: function init() {// Subclasses should override this method to perform initialization routines (registering events, etc.)
      }
    }, {
      key: "destroy",
      value: function destroy() {// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
      }
    }]);
  
    return MDCFoundation;
  }();
  
  /**
   * @template F
   */
  
  var MDCComponent =
  /*#__PURE__*/
  function () {
    _createClass(MDCComponent, null, [{
      key: "attachTo",
  
      /**
       * @param {!Element} root
       * @return {!MDCComponent}
       */
      value: function attachTo(root) {
        // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
        // returns an instantiated component with its root set to that element. Also note that in the cases of
        // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
        // from getDefaultFoundation().
        return new MDCComponent(root, new MDCFoundation());
      }
      /**
       * @param {!Element} root
       * @param {F=} foundation
       * @param {...?} args
       */
  
    }]);
  
    function MDCComponent(root) {
      var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  
      _classCallCheck(this, MDCComponent);
  
      /** @protected {!Element} */
      this.root_ = root;
  
      for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
        args[_key - 2] = arguments[_key];
      }
  
      this.initialize.apply(this, args); // Note that we initialize foundation here and not within the constructor's default param so that
      // this.root_ is defined and can be used within the foundation class.
  
      /** @protected {!F} */
  
      this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
      this.foundation_.init();
      this.initialSyncWithDOM();
    }
  
    _createClass(MDCComponent, [{
      key: "initialize",
      value: function initialize()
      /* ...args */
      {} // Subclasses can override this to do any additional setup work that would be considered part of a
      // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
      // initialized. Any additional arguments besides root and foundation will be passed in here.
  
      /**
       * @return {!F} foundation
       */
  
    }, {
      key: "getDefaultFoundation",
      value: function getDefaultFoundation() {
        // Subclasses must override this method to return a properly configured foundation class for the
        // component.
        throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
      }
    }, {
      key: "initialSyncWithDOM",
      value: function initialSyncWithDOM() {// Subclasses should override this method if they need to perform work to synchronize with a host DOM
        // object. An example of this would be a form control wrapper that needs to synchronize its internal state
        // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
        // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
      }
    }, {
      key: "destroy",
      value: function destroy() {
        // Subclasses may implement this method to release any resources / deregister any listeners they have
        // attached. An example of this might be deregistering a resize event from the window object.
        this.foundation_.destroy();
      }
      /**
       * Wrapper method to add an event listener to the component's root element. This is most useful when
       * listening for custom events.
       * @param {string} evtType
       * @param {!Function} handler
       */
  
    }, {
      key: "listen",
      value: function listen(evtType, handler) {
        this.root_.addEventListener(evtType, handler);
      }
      /**
       * Wrapper method to remove an event listener to the component's root element. This is most useful when
       * unlistening for custom events.
       * @param {string} evtType
       * @param {!Function} handler
       */
  
    }, {
      key: "unlisten",
      value: function unlisten(evtType, handler) {
        this.root_.removeEventListener(evtType, handler);
      }
      /**
       * Fires a cross-browser-compatible custom event from the component root of the given type,
       * with the given data.
       * @param {string} evtType
       * @param {!Object} evtData
       * @param {boolean=} shouldBubble
       */
  
    }, {
      key: "emit",
      value: function emit(evtType, evtData) {
        var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
        var evt;
  
        if (typeof CustomEvent === 'function') {
          evt = new CustomEvent(evtType, {
            detail: evtData,
            bubbles: shouldBubble
          });
        } else {
          evt = document.createEvent('CustomEvent');
          evt.initCustomEvent(evtType, shouldBubble, false, evtData);
        }
  
        this.root_.dispatchEvent(evt);
      }
    }]);
  
    return MDCComponent;
  }();
  
  /**
   * @license
   * Copyright 2016 Google Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /**
   * @license
   * Copyright 2016 Google Inc. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  // property names.
  
  
  var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  
  /**
   * Copyright 2017 Google Inc. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  var cssClasses = {
    CLOSED_CLASS: 'mdc-linear-progress--closed',
    INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
    REVERSED_CLASS: 'mdc-linear-progress--reversed'
  };
  var strings = {
    PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
    BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  };
  
  var MDCLinearProgressFoundation =
  /*#__PURE__*/
  function (_MDCFoundation) {
    _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  
    _createClass(MDCLinearProgressFoundation, null, [{
      key: "cssClasses",
      get: function get() {
        return cssClasses;
      }
    }, {
      key: "strings",
      get: function get() {
        return strings;
      }
    }, {
      key: "defaultAdapter",
      get: function get() {
        return {
          addClass: function addClass()
          /* className: string */
          {},
          getPrimaryBar: function getPrimaryBar()
          /* el: Element */
          {},
          getBuffer: function getBuffer()
          /* el: Element */
          {},
          hasClass: function hasClass() {
            return (
              /* className: string */
              false
            );
          },
          removeClass: function removeClass()
          /* className: string */
          {},
          setStyle: function setStyle()
          /* el: Element, styleProperty: string, value: string */
          {}
        };
      }
    }]);
  
    function MDCLinearProgressFoundation(adapter) {
      _classCallCheck(this, MDCLinearProgressFoundation);
  
      return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, Object.assign(MDCLinearProgressFoundation.defaultAdapter, adapter)));
    }
  
    _createClass(MDCLinearProgressFoundation, [{
      key: "init",
      value: function init() {
        this.determinate_ = !this.adapter_.hasClass(cssClasses.INDETERMINATE_CLASS);
        this.reverse_ = this.adapter_.hasClass(cssClasses.REVERSED_CLASS);
        this.progress_ = 0;
      }
    }, {
      key: "setDeterminate",
      value: function setDeterminate(isDeterminate) {
        this.determinate_ = isDeterminate;
  
        if (this.determinate_) {
          this.adapter_.removeClass(cssClasses.INDETERMINATE_CLASS);
          this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
        } else {
          this.adapter_.addClass(cssClasses.INDETERMINATE_CLASS);
          this.setScale_(this.adapter_.getPrimaryBar(), 1);
          this.setScale_(this.adapter_.getBuffer(), 1);
        }
      }
    }, {
      key: "setProgress",
      value: function setProgress(value) {
        this.progress_ = value;
  
        if (this.determinate_) {
          this.setScale_(this.adapter_.getPrimaryBar(), value);
        }
      }
    }, {
      key: "setBuffer",
      value: function setBuffer(value) {
        if (this.determinate_) {
          this.setScale_(this.adapter_.getBuffer(), value);
        }
      }
    }, {
      key: "setReverse",
      value: function setReverse(isReversed) {
        this.reverse_ = isReversed;
  
        if (this.reverse_) {
          this.adapter_.addClass(cssClasses.REVERSED_CLASS);
        } else {
          this.adapter_.removeClass(cssClasses.REVERSED_CLASS);
        }
      }
    }, {
      key: "open",
      value: function open() {
        this.adapter_.removeClass(cssClasses.CLOSED_CLASS);
      }
    }, {
      key: "close",
      value: function close() {
        this.adapter_.addClass(cssClasses.CLOSED_CLASS);
      }
    }, {
      key: "setScale_",
      value: function setScale_(el, scaleValue) {
        var _this = this;
  
        var value = 'scaleX(' + scaleValue + ')';
        transformStyleProperties.forEach(function (transformStyleProperty) {
          _this.adapter_.setStyle(el, transformStyleProperty, value);
        });
      }
    }]);
  
    return MDCLinearProgressFoundation;
  }(MDCFoundation);
  
  var MDCLinearProgress =
  /*#__PURE__*/
  function (_MDCComponent) {
    _inherits(MDCLinearProgress, _MDCComponent);
  
    function MDCLinearProgress() {
      _classCallCheck(this, MDCLinearProgress);
  
      return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
    }
  
    _createClass(MDCLinearProgress, [{
      key: "open",
      value: function open() {
        this.foundation_.open();
      }
    }, {
      key: "close",
      value: function close() {
        this.foundation_.close();
      }
    }, {
      key: "getDefaultFoundation",
      value: function getDefaultFoundation() {
        var _this = this;
  
        return new MDCLinearProgressFoundation({
          addClass: function addClass(className) {
            return _this.root_.classList.add(className);
          },
          getPrimaryBar: function getPrimaryBar() {
            return _this.root_.querySelector(MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);
          },
          getBuffer: function getBuffer() {
            return _this.root_.querySelector(MDCLinearProgressFoundation.strings.BUFFER_SELECTOR);
          },
          hasClass: function hasClass(className) {
            return _this.root_.classList.contains(className);
          },
          removeClass: function removeClass(className) {
            return _this.root_.classList.remove(className);
          },
          setStyle: function setStyle(el, styleProperty, value) {
            return el.style[styleProperty] = value;
          }
        });
      }
    }, {
      key: "determinate",
      set: function set(value) {
        this.foundation_.setDeterminate(value);
      }
    }, {
      key: "progress",
      set: function set(value) {
        this.foundation_.setProgress(value);
      }
    }, {
      key: "buffer",
      set: function set(value) {
        this.foundation_.setBuffer(value);
      }
    }, {
      key: "reverse",
      set: function set(value) {
        this.foundation_.setReverse(value);
      }
    }], [{
      key: "attachTo",
      value: function attachTo(root) {
        return new MDCLinearProgress(root);
      }
    }]);
  
    return MDCLinearProgress;
  }(MDCComponent);
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  var MdcLinearProgress = /** @class */ (function () {
      function MdcLinearProgress(_changeDetectorRef, _renderer, elementRef) {
          var _this = this;
          this._changeDetectorRef = _changeDetectorRef;
          this._renderer = _renderer;
          this.elementRef = elementRef;
          this._reversed = false;
          this.secondary = false;
          this.closed = false;
          this.role = 'progressbar';
          this.isHostClass = true;
          this._mdcAdapter = {
              addClass: function (className) { return _this._renderer.addClass(_this._getHostElement(), className); },
              getPrimaryBar: function () { return _this._getHostElement().querySelector('.mdc-linear-progress__primary-bar'); },
              getBuffer: function () { return _this._getHostElement().querySelector('.mdc-linear-progress__buffer'); },
              hasClass: function (className) { return _this._getHostElement().classList.contains(className); },
              removeClass: function (className) { return _this._renderer.removeClass(_this._getHostElement(), className); },
              setStyle: function (el, styleProperty, value) { return _this._renderer.setStyle(el, styleProperty, value); }
          };
          this._foundation = new MDCLinearProgressFoundation(this._mdcAdapter);
      }
      Object.defineProperty(MdcLinearProgress.prototype, "determinate", {
          get: /**
           * @return {?}
           */
          function () { return this._determinate; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setDeterminate(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "reversed", {
          get: /**
           * @return {?}
           */
          function () { return this._reversed; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setReverse(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "progress", {
          get: /**
           * @return {?}
           */
          function () { return this._progress; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setProgress(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "buffer", {
          get: /**
           * @return {?}
           */
          function () { return this._buffer; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setBuffer(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "classSecondary", {
          get: /**
           * @return {?}
           */
          function () {
              return this.secondary ? 'mdc-linear-progress--secondary' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "classClosed", {
          get: /**
           * @return {?}
           */
          function () {
              return this.closed ? 'mdc-linear-progress--closed' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcLinearProgress.prototype, "classIndeterminate", {
          get: /**
           * @return {?}
           */
          function () {
              return !this.determinate ? 'mdc-linear-progress--indeterminate' : '';
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @return {?}
       */
      MdcLinearProgress.prototype.ngAfterViewInit = /**
       * @return {?}
       */
      function () {
          this._foundation.init();
      };
      /**
       * @return {?}
       */
      MdcLinearProgress.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this._foundation.destroy();
      };
      /**
       * @return {?}
       */
      MdcLinearProgress.prototype.open = /**
       * @return {?}
       */
      function () {
          this._foundation.open();
      };
      /**
       * @return {?}
       */
      MdcLinearProgress.prototype.close = /**
       * @return {?}
       */
      function () {
          this._foundation.close();
      };
      /**
       * @param {?} progress
       * @return {?}
       */
      MdcLinearProgress.prototype.setProgress = /**
       * @param {?} progress
       * @return {?}
       */
      function (progress) {
          this._progress = progress;
          this._foundation.setProgress(progress);
          this._changeDetectorRef.markForCheck();
      };
      /**
       * @param {?} buffer
       * @return {?}
       */
      MdcLinearProgress.prototype.setBuffer = /**
       * @param {?} buffer
       * @return {?}
       */
      function (buffer) {
          this._buffer = buffer;
          this._foundation.setBuffer(buffer);
          this._changeDetectorRef.markForCheck();
      };
      /**
       * @param {?} reverse
       * @return {?}
       */
      MdcLinearProgress.prototype.setReverse = /**
       * @param {?} reverse
       * @return {?}
       */
      function (reverse) {
          this._reversed = reverse;
          this._foundation.setReverse(reverse);
          this._changeDetectorRef.markForCheck();
      };
      /**
       * @param {?} determinate
       * @return {?}
       */
      MdcLinearProgress.prototype.setDeterminate = /**
       * @param {?} determinate
       * @return {?}
       */
      function (determinate) {
          this._determinate = determinate;
          this._foundation.setDeterminate(determinate);
          this._changeDetectorRef.markForCheck();
      };
      /**
       * Retrieves the DOM element of the component host.
       * @return {?}
       */
      MdcLinearProgress.prototype._getHostElement = /**
       * Retrieves the DOM element of the component host.
       * @return {?}
       */
      function () {
          return this.elementRef.nativeElement;
      };
      MdcLinearProgress.decorators = [
          { type: Component, args: [{selector: 'mdc-linear-progress',
                      exportAs: 'mdcLinearProgress',
                      template: "\n  <div class=\"mdc-linear-progress__buffering-dots\"></div>\n  <div class=\"mdc-linear-progress__buffer\"></div>\n  <div class=\"mdc-linear-progress__bar mdc-linear-progress__primary-bar\">\n   <span class=\"mdc-linear-progress__bar-inner\"></span>\n  </div>\n  <div class=\"mdc-linear-progress__bar mdc-linear-progress__secondary-bar\">\n   <span class=\"mdc-linear-progress__bar-inner\"></span>\n  </div>\n  ",
                      encapsulation: ViewEncapsulation.None,
                      changeDetection: ChangeDetectionStrategy.OnPush
                  },] },
      ];
      /** @nocollapse */
      MdcLinearProgress.ctorParameters = function () { return [
          { type: ChangeDetectorRef },
          { type: Renderer2 },
          { type: ElementRef }
      ]; };
      MdcLinearProgress.propDecorators = {
          determinate: [{ type: Input }],
          reversed: [{ type: Input }],
          secondary: [{ type: Input }],
          closed: [{ type: Input }],
          progress: [{ type: Input }],
          buffer: [{ type: Input }],
          role: [{ type: HostBinding, args: ['attr.role',] }],
          isHostClass: [{ type: HostBinding, args: ['class.mdc-linear-progress',] }],
          classSecondary: [{ type: HostBinding, args: ['class.mdc-linear-progress--secondary',] }],
          classClosed: [{ type: HostBinding, args: ['class.mdc-linear-progress--closed',] }],
          classIndeterminate: [{ type: HostBinding, args: ['class.mdc-linear-progress--indeterminate',] }]
      };
      return MdcLinearProgress;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  var MdcLinearProgressModule = /** @class */ (function () {
      function MdcLinearProgressModule() {
      }
      MdcLinearProgressModule.decorators = [
          { type: NgModule, args: [{
                      exports: [MdcLinearProgress],
                      declarations: [MdcLinearProgress],
                  },] },
      ];
      return MdcLinearProgressModule;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  export { MdcLinearProgressModule, MdcLinearProgress };
  