@angular/material
Version:
Angular Material
9 lines • 52.3 kB
JavaScript
/**
* @license
* Copyright Google Inc. 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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/collections"),require("@angular/cdk/keycodes"),require("@angular/cdk/overlay"),require("@angular/cdk/platform"),require("@angular/cdk/rxjs"),require("@angular/forms"),require("@angular/platform-browser"),require("rxjs/Subject"),require("@angular/cdk/scrolling"),require("@angular/cdk/portal"),require("rxjs/observable/merge"),require("rxjs/Subscription"),require("@angular/animations")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/collections","@angular/cdk/keycodes","@angular/cdk/overlay","@angular/cdk/platform","@angular/cdk/rxjs","@angular/forms","@angular/platform-browser","rxjs/Subject","@angular/cdk/scrolling","@angular/cdk/portal","rxjs/observable/merge","rxjs/Subscription","@angular/animations"],t):t((e.ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.select=e.ng.material.select||{}),e.ng.core,e.ng.common,e.ng.cdk.a11y,e.ng.cdk.bidi,e.ng.cdk.coercion,e.ng.cdk.collections,e.ng.cdk.keycodes,e.ng.cdk.overlay,e.ng.cdk.platform,e.ng.cdk.rxjs,e.ng.forms,e.ng.platformBrowser,e.Rx,e.ng.cdk.scrolling,e.ng.cdk.portal,e.Rx.Observable,e.Rx,e.ng.animations)}(this,function(e,t,n,o,r,i,a,s,l,c,p,u,d,h,m,f,g,y,_){"use strict";function b(e,t){function n(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,t){return Error('The "'+e+'-" prefix cannot be used in ng-material v1 compatibility mode. It was used on an "'+t.toLowerCase()+'" element.')}function D(e){return function(e){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=e.apply(this,t)||this;return o._disabled=!1,o}return b(t,e),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=i.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),t}(e)}function C(e){return e||new G}function O(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(null==e)throw TypeError("Cannot convert undefined or null to object");for(var o=0,r=t;o<r.length;o++){var i=r[o];if(null!=i)for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}function E(e,t){for(var n=Array(e),o=0;o<e;o++)n[o]=t(o);return n}function w(e){window.getComputedStyle(e).getPropertyValue("opacity")}function R(e,t,n){var o=Math.max(Math.abs(e-n.left),Math.abs(e-n.right)),r=Math.max(Math.abs(t-n.top),Math.abs(t-n.bottom));return Math.sqrt(o*o+r*r)}function I(){return Error("Cannot change `multiple` mode of select after initialization.")}function S(){return Error("Cannot assign truthy non-array value to select in `multiple` mode.")}function k(){return Error("Cannot assign a non-function value to `compareWith`.")}function M(e){return function(){return e.scrollStrategies.reposition()}}function x(e,t,n){return Math.min(Math.max(e,t),n)}var T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},P=function(){function e(){}return e}();P.STANDARD_CURVE="cubic-bezier(0.4,0.0,0.2,1)",P.DECELERATION_CURVE="cubic-bezier(0.0,0.0,0.2,1)",P.ACCELERATION_CURVE="cubic-bezier(0.4,0.0,1,1)",P.SHARP_CURVE="cubic-bezier(0.4,0.0,0.6,1)";var A=function(){function e(){}return e}();A.COMPLEX="375ms",A.ENTERING="225ms",A.EXITING="195ms";var L=new t.InjectionToken("md-compatibility-mode"),N=function(){function e(e,t){if(!e)throw v("mat",t.nativeElement.nodeName)}return e}();N.decorators=[{type:t.Directive,args:[{selector:"\n [mat-button],\n [mat-fab],\n [mat-icon-button],\n [mat-mini-fab],\n [mat-raised-button],\n [matCardSubtitle],\n [matCardTitle],\n [matCellDef],\n [matColumnDef],\n [matDialogActions],\n [matDialogClose],\n [matDialogContent],\n [matDialogTitle],\n [matHeaderCellDef],\n [matHeaderRowDef],\n [matLine],\n [matRowDef],\n [matStepLabel],\n [matStepperNext],\n [matStepperPrevious],\n [matTabLabel],\n [matTabLink],\n [matTabNav],\n [matTooltip],\n [matInput],\n [matPrefix],\n [matSuffix],\n mat-autocomplete,\n mat-button-toggle,\n mat-button-toggle,\n mat-button-toggle-group,\n mat-card,\n mat-card-actions,\n mat-card-content,\n mat-card-footer,\n mat-card-header,\n mat-card-subtitle,\n mat-card-title,\n mat-card-title-group,\n mat-cell,\n mat-checkbox,\n mat-chip,\n mat-dialog-actions,\n mat-dialog-container,\n mat-dialog-content,\n mat-divider,\n mat-error,\n mat-grid-list,\n mat-grid-tile,\n mat-grid-tile-footer,\n mat-grid-tile-header,\n mat-header-cell,\n mat-header-row,\n mat-hint,\n mat-horizontal-stepper,\n mat-icon,\n mat-input-container,\n mat-form-field,\n mat-list,\n mat-list-item,\n mat-menu,\n mat-nav-list,\n mat-option,\n mat-placeholder,\n mat-progress-bar,\n mat-pseudo-checkbox,\n mat-radio-button,\n mat-radio-group,\n mat-row,\n mat-select,\n mat-sidenav,\n mat-sidenav-container,\n mat-slider,\n mat-spinner,\n mat-step,\n mat-tab,\n mat-table,\n mat-tab-group,\n mat-toolbar,\n mat-vertical-stepper"}]}],N.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[L]}]},{type:t.ElementRef}]};var j=function(){function e(e,t){if(e)throw v("md",t.nativeElement.nodeName)}return e}();j.decorators=[{type:t.Directive,args:[{selector:"\n [md-button],\n [md-fab],\n [md-icon-button],\n [md-mini-fab],\n [md-raised-button],\n [mdCardSubtitle],\n [mdCardTitle],\n [mdCellDef],\n [mdColumnDef],\n [mdDialogActions],\n [mdDialogClose],\n [mdDialogContent],\n [mdDialogTitle],\n [mdHeaderCellDef],\n [mdHeaderRowDef],\n [mdLine],\n [mdRowDef],\n [mdStepLabel],\n [mdStepperNext],\n [mdStepperPrevious],\n [mdTabLabel],\n [mdTabLink],\n [mdTabNav],\n [mdTooltip],\n [mdInput],\n [mdPrefix],\n [mdSuffix],\n md-autocomplete,\n md-button-toggle,\n md-button-toggle,\n md-button-toggle-group,\n md-card,\n md-card-actions,\n md-card-content,\n md-card-footer,\n md-card-header,\n md-card-subtitle,\n md-card-title,\n md-card-title-group,\n md-cell,\n md-checkbox,\n md-chip,\n md-dialog-actions,\n md-dialog-container,\n md-dialog-content,\n md-divider,\n md-error,\n md-grid-list,\n md-grid-tile,\n md-grid-tile-footer,\n md-grid-tile-header,\n md-header-cell,\n md-header-row,\n md-hint,\n md-horizontal-stepper,\n md-icon,\n md-input-container,\n md-form-field,\n md-list,\n md-list-item,\n md-menu,\n md-nav-list,\n md-option,\n md-placeholder,\n md-progress-bar,\n md-pseudo-checkbox,\n md-radio-button,\n md-radio-group,\n md-row,\n md-select,\n md-sidenav,\n md-sidenav-container,\n md-slider,\n md-spinner,\n md-step,\n md-tab,\n md-table,\n md-tab-group,\n md-toolbar,\n md-vertical-stepper"}]}],j.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[L]}]},{type:t.ElementRef}]};var F=function(){function e(){}return e}();F.decorators=[{type:t.NgModule,args:[{declarations:[N,j],exports:[N,j]}]}],F.ctorParameters=function(){return[]};var V=function(){function e(){}return e}();V.decorators=[{type:t.NgModule,args:[{providers:[{provide:L,useValue:!0}]}]}],V.ctorParameters=function(){return[]};var Y=new t.InjectionToken("md-sanity-checks"),W=function(){function e(e,n){this._document=e,this._hasDoneGlobalChecks=!1,n&&!this._hasDoneGlobalChecks&&e&&t.isDevMode()&&(this._checkDoctype(),this._checkTheme(),this._hasDoneGlobalChecks=!0)}return e.prototype._checkDoctype=function(){this._document.doctype||console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")},e.prototype._checkTheme=function(){if("function"==typeof getComputedStyle){var e=this._document.createElement("div");e.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(e),"none"!==getComputedStyle(e).display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(e)}},e}();W.decorators=[{type:t.NgModule,args:[{imports:[F,r.BidiModule],exports:[F,r.BidiModule],providers:[{provide:Y,useValue:!0}]}]}],W.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[d.DOCUMENT]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[Y]}]}]};var G=function(){function e(){this._listeners=[]}return e.prototype.notify=function(e,t){for(var n=0,o=this._listeners;n<o.length;n++){(0,o[n])(e,t)}},e.prototype.listen=function(e){var t=this;return this._listeners.push(e),function(){t._listeners=t._listeners.filter(function(t){return e!==t})}},e}();G.decorators=[{type:t.Injectable}],G.ctorParameters=function(){return[]};var B=(new t.Optional,new t.SkipSelf,new t.InjectionToken("MAT_DATE_LOCALE")),q={provide:B,useExisting:t.LOCALE_ID},H=function(){function e(){this._localeChanges=new h.Subject}return Object.defineProperty(e.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!0,configurable:!0}),e.prototype.getYear=function(e){},e.prototype.getMonth=function(e){},e.prototype.getDate=function(e){},e.prototype.getDayOfWeek=function(e){},e.prototype.getMonthNames=function(e){},e.prototype.getDateNames=function(){},e.prototype.getDayOfWeekNames=function(e){},e.prototype.getYearName=function(e){},e.prototype.getFirstDayOfWeek=function(){},e.prototype.getNumDaysInMonth=function(e){},e.prototype.clone=function(e){},e.prototype.createDate=function(e,t,n){},e.prototype.today=function(){},e.prototype.parse=function(e,t){},e.prototype.format=function(e,t){},e.prototype.addCalendarYears=function(e,t){},e.prototype.addCalendarMonths=function(e,t){},e.prototype.addCalendarDays=function(e,t){},e.prototype.toIso8601=function(e){},e.prototype.fromIso8601=function(e){},e.prototype.isDateInstance=function(e){},e.prototype.isValid=function(e){},e.prototype.setLocale=function(e){this.locale=e,this._localeChanges.next()},e.prototype.compareDate=function(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)},e.prototype.sameDate=function(e,t){return e&&t?!this.compareDate(e,t):e==t},e.prototype.clampDate=function(e,t,n){return t&&this.compareDate(e,t)<0?t:n&&this.compareDate(e,n)>0?n:e},e}(),U="undefined"!=typeof Intl,z={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},X=E(31,function(e){return String(e+1)}),K={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},J=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/,Z=function(e){function t(t){var n=e.call(this)||this;return n.useUtcForDisplay=!0,e.prototype.setLocale.call(n,t),n}return b(t,e),t.prototype.getYear=function(e){return e.getFullYear()},t.prototype.getMonth=function(e){return e.getMonth()},t.prototype.getDate=function(e){return e.getDate()},t.prototype.getDayOfWeek=function(e){return e.getDay()},t.prototype.getMonthNames=function(e){var t=this;if(U){var n=new Intl.DateTimeFormat(this.locale,{month:e});return E(12,function(e){return t._stripDirectionalityCharacters(n.format(new Date(2017,e,1)))})}return z[e]},t.prototype.getDateNames=function(){var e=this;if(U){var t=new Intl.DateTimeFormat(this.locale,{day:"numeric"});return E(31,function(n){return e._stripDirectionalityCharacters(t.format(new Date(2017,0,n+1)))})}return X},t.prototype.getDayOfWeekNames=function(e){var t=this;if(U){var n=new Intl.DateTimeFormat(this.locale,{weekday:e});return E(7,function(e){return t._stripDirectionalityCharacters(n.format(new Date(2017,0,e+1)))})}return K[e]},t.prototype.getYearName=function(e){if(U){var t=new Intl.DateTimeFormat(this.locale,{year:"numeric"});return this._stripDirectionalityCharacters(t.format(e))}return String(this.getYear(e))},t.prototype.getFirstDayOfWeek=function(){return 0},t.prototype.getNumDaysInMonth=function(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))},t.prototype.clone=function(e){return this.createDate(this.getYear(e),this.getMonth(e),this.getDate(e))},t.prototype.createDate=function(e,t,n){if(t<0||t>11)throw Error('Invalid month index "'+t+'". Month index has to be between 0 and 11.');if(n<1)throw Error('Invalid date "'+n+'". Date has to be greater than 0.');var o=this._createDateWithOverflow(e,t,n);if(o.getMonth()!=t)throw Error('Invalid date "'+n+'" for month with index "'+t+'".');return o},t.prototype.today=function(){return new Date},t.prototype.parse=function(e){return"number"==typeof e?new Date(e):e?new Date(Date.parse(e)):null},t.prototype.format=function(e,t){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(U){this.useUtcForDisplay&&(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),t=O({},t,{timeZone:"utc"}));var n=new Intl.DateTimeFormat(this.locale,t);return this._stripDirectionalityCharacters(n.format(e))}return this._stripDirectionalityCharacters(e.toDateString())},t.prototype.addCalendarYears=function(e,t){return this.addCalendarMonths(e,12*t)},t.prototype.addCalendarMonths=function(e,t){var n=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+t,this.getDate(e));return this.getMonth(n)!=((this.getMonth(e)+t)%12+12)%12&&(n=this._createDateWithOverflow(this.getYear(n),this.getMonth(n),0)),n},t.prototype.addCalendarDays=function(e,t){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+t)},t.prototype.toIso8601=function(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")},t.prototype.fromIso8601=function(e){if(J.test(e)){var t=new Date(e);if(this.isValid(t))return t}return null},t.prototype.isDateInstance=function(e){return e instanceof Date},t.prototype.isValid=function(e){return!isNaN(e.getTime())},t.prototype._createDateWithOverflow=function(e,t,n){var o=new Date(e,t,n);return e>=0&&e<100&&o.setFullYear(this.getYear(o)-1900),o},t.prototype._2digit=function(e){return("00"+e).slice(-2)},t.prototype._stripDirectionalityCharacters=function(e){return e.replace(/[\u200e\u200f]/g,"")},t}(H);Z.decorators=[{type:t.Injectable}],Z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[B]}]}]};var $=new t.InjectionToken("md-date-formats"),Q={parse:{dateInput:null},display:{dateInput:{year:"numeric",month:"numeric",day:"numeric"},monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},ee=function(){function e(){}return e}();ee.decorators=[{type:t.NgModule,args:[{providers:[{provide:H,useClass:Z},q]}]}],ee.ctorParameters=function(){return[]};var te=function(){function e(){}return e}();te.decorators=[{type:t.NgModule,args:[{imports:[ee],providers:[{provide:$,useValue:Q}]}]}],te.ctorParameters=function(){return[]};var ne=(new t.InjectionToken("md-error-global-options"),function(e){function n(){var n=e.call(this)||this;return n._hammer="undefined"!=typeof window?window.Hammer:null,n.events=n._hammer?["longpress","slide","slidestart","slideend","slideright","slideleft"]:[],!n._hammer&&t.isDevMode()&&console.warn("Could not find HammerJS. Certain Angular Material components may not work correctly."),n}return b(n,e),n.prototype.buildHammer=function(e){var t=new this._hammer(e),n=new this._hammer.Pan,o=new this._hammer.Swipe,r=new this._hammer.Press,i=this._createRecognizer(n,{event:"slide",threshold:0},o),a=this._createRecognizer(r,{event:"longpress",time:500});return n.recognizeWith(o),t.add([o,r,n,i,a]),t},n.prototype._createRecognizer=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=new e.constructor(t);return n.push(e),n.forEach(function(e){return r.recognizeWith(e)}),r},n}(d.HammerGestureConfig));ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[]};var oe=function(){function e(){}return e}();oe.decorators=[{type:t.Directive,args:[{selector:"[md-line], [mat-line], [mdLine], [matLine]",host:{class:"mat-line"}}]}],oe.ctorParameters=function(){return[]};var re=function(){function e(){}return e}();re.decorators=[{type:t.NgModule,args:[{imports:[W],exports:[oe,W],declarations:[oe]}]}],re.ctorParameters=function(){return[]};var ie={};ie.FADING_IN=0,ie.VISIBLE=1,ie.FADING_OUT=2,ie.HIDDEN=3,ie[ie.FADING_IN]="FADING_IN",ie[ie.VISIBLE]="VISIBLE",ie[ie.FADING_OUT]="FADING_OUT",ie[ie.HIDDEN]="HIDDEN";var ae=function(){function e(e,t,n){this._renderer=e,this.element=t,this.config=n,this.state=ie.HIDDEN}return e.prototype.fadeOut=function(){this._renderer.fadeOutRipple(this)},e}(),se=function(){function e(e,t,n,o){this._ngZone=t,this._ruler=n,this._isMousedown=!1,this._triggerEvents=new Map,this._activeRipples=new Set,this.rippleConfig={},this.rippleDisabled=!1,o.isBrowser&&(this._containerElement=e.nativeElement,this._triggerEvents.set("mousedown",this.onMousedown.bind(this)),this._triggerEvents.set("mouseup",this.onMouseup.bind(this)),this._triggerEvents.set("mouseleave",this.onMouseLeave.bind(this)),this.setTriggerElement(this._containerElement))}return e.prototype.fadeInRipple=function(e,t,n){var o=this;void 0===n&&(n={});var r=this._containerElement.getBoundingClientRect();if(n.centered)e=r.left+r.width/2,t=r.top+r.height/2;else{var i=this._ruler.getViewportScrollPosition();e-=i.left,t-=i.top}var a=n.radius||R(e,t,r),s=1/(n.speedFactor||1)*450,l=e-r.left,c=t-r.top,p=document.createElement("div");p.classList.add("mat-ripple-element"),p.style.left=l-a+"px",p.style.top=c-a+"px",p.style.height=2*a+"px",p.style.width=2*a+"px",p.style.backgroundColor=n.color||null,p.style.transitionDuration=s+"ms",this._containerElement.appendChild(p),w(p),p.style.transform="scale(1)";var u=new ae(this,p,n);return u.state=ie.FADING_IN,this._activeRipples.add(u),this.runTimeoutOutsideZone(function(){u.state=ie.VISIBLE,n.persistent||o._isMousedown||u.fadeOut()},s),u},e.prototype.fadeOutRipple=function(e){if(this._activeRipples.delete(e)){var t=e.element;t.style.transitionDuration="400ms",t.style.opacity="0",e.state=ie.FADING_OUT,this.runTimeoutOutsideZone(function(){e.state=ie.HIDDEN,t.parentNode.removeChild(t)},400)}},e.prototype.fadeOutAll=function(){this._activeRipples.forEach(function(e){return e.fadeOut()})},e.prototype.setTriggerElement=function(e){var t=this;this._triggerElement&&this._triggerEvents.forEach(function(e,n){t._triggerElement.removeEventListener(n,e)}),e&&this._ngZone.runOutsideAngular(function(){t._triggerEvents.forEach(function(t,n){return e.addEventListener(n,t)})}),this._triggerElement=e},e.prototype.onMousedown=function(e){this.rippleDisabled||(this._isMousedown=!0,this.fadeInRipple(e.pageX,e.pageY,this.rippleConfig))},e.prototype.onMouseup=function(){this._isMousedown=!1,this._activeRipples.forEach(function(e){e.config.persistent||e.state!==ie.VISIBLE||e.fadeOut()})},e.prototype.onMouseLeave=function(){this._isMousedown&&this.onMouseup()},e.prototype.runTimeoutOutsideZone=function(e,t){void 0===t&&(t=0),this._ngZone.runOutsideAngular(function(){return setTimeout(e,t)})},e}(),le=new t.InjectionToken("md-ripple-global-options"),ce=function(){function e(e,t,n,o,r){this.radius=0,this.speedFactor=1,this._rippleRenderer=new se(e,t,n,o),this._globalOptions=r||{},this._updateRippleRenderer()}return Object.defineProperty(e.prototype,"_matRippleTrigger",{get:function(){return this.trigger},set:function(e){this.trigger=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleCentered",{get:function(){return this.centered},set:function(e){this.centered=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleDisabled",{get:function(){return this.disabled},set:function(e){this.disabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleRadius",{get:function(){return this.radius},set:function(e){this.radius=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleSpeedFactor",{get:function(){return this.speedFactor},set:function(e){this.speedFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_matRippleUnbounded",{get:function(){return this.unbounded},set:function(e){this.unbounded=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){(e.trigger||e._matRippleTrigger)&&this.trigger&&this._rippleRenderer.setTriggerElement(this.trigger),this._updateRippleRenderer()},e.prototype.ngOnDestroy=function(){this._rippleRenderer.setTriggerElement(null)},e.prototype.launch=function(e,t,n){return void 0===n&&(n=this.rippleConfig),this._rippleRenderer.fadeInRipple(e,t,n)},e.prototype.fadeOutAll=function(){this._rippleRenderer.fadeOutAll()},Object.defineProperty(e.prototype,"rippleConfig",{get:function(){return{centered:this.centered,speedFactor:this.speedFactor*(this._globalOptions.baseSpeedFactor||1),radius:this.radius,color:this.color}},enumerable:!0,configurable:!0}),e.prototype._updateRippleRenderer=function(){this._rippleRenderer.rippleDisabled=this._globalOptions.disabled||this.disabled,this._rippleRenderer.rippleConfig=this.rippleConfig},e}();ce.decorators=[{type:t.Directive,args:[{selector:"[md-ripple], [mat-ripple], [mdRipple], [matRipple]",exportAs:"mdRipple, matRipple",host:{class:"mat-ripple","[class.mat-ripple-unbounded]":"unbounded"}}]}],ce.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone},{type:m.ViewportRuler},{type:c.Platform},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[le]}]}]},ce.propDecorators={trigger:[{type:t.Input,args:["mdRippleTrigger"]}],centered:[{type:t.Input,args:["mdRippleCentered"]}],disabled:[{type:t.Input,args:["mdRippleDisabled"]}],radius:[{type:t.Input,args:["mdRippleRadius"]}],speedFactor:[{type:t.Input,args:["mdRippleSpeedFactor"]}],color:[{type:t.Input,args:["mdRippleColor"]}],unbounded:[{type:t.Input,args:["mdRippleUnbounded"]}],_matRippleTrigger:[{type:t.Input,args:["matRippleTrigger"]}],_matRippleCentered:[{type:t.Input,args:["matRippleCentered"]}],_matRippleDisabled:[{type:t.Input,args:["matRippleDisabled"]}],_matRippleRadius:[{type:t.Input,args:["matRippleRadius"]}],_matRippleSpeedFactor:[{type:t.Input,args:["matRippleSpeedFactor"]}],_matRippleColor:[{type:t.Input,args:["matRippleColor"]}],_matRippleUnbounded:[{type:t.Input,args:["matRippleUnbounded"]}]};var pe=function(){function e(){}return e}();pe.decorators=[{type:t.NgModule,args:[{imports:[W,c.PlatformModule,m.ScrollDispatchModule],exports:[ce,W],declarations:[ce],providers:[m.VIEWPORT_RULER_PROVIDER]}]}],pe.ctorParameters=function(){return[]};var ue=function(){function e(){this.state="unchecked",this.disabled=!1}return e}();ue.decorators=[{type:t.Component,args:[{encapsulation:t.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,selector:"md-pseudo-checkbox, mat-pseudo-checkbox",styles:[".mat-pseudo-checkbox{width:20px;height:20px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0,0,.2,.1),background-color 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:'';border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0,0,.2,.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:9px;left:2px;width:16px;opacity:1}.mat-pseudo-checkbox-checked::after{top:5px;left:3px;width:12px;height:5px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1}"],template:"",host:{class:"mat-pseudo-checkbox","[class.mat-pseudo-checkbox-indeterminate]":'state === "indeterminate"',"[class.mat-pseudo-checkbox-checked]":'state === "checked"',"[class.mat-pseudo-checkbox-disabled]":"disabled"}}]}],ue.ctorParameters=function(){return[]},ue.propDecorators={state:[{type:t.Input}],disabled:[{type:t.Input}]};var de=function(){function e(){}return e}();de.decorators=[{type:t.NgModule,args:[{exports:[ue],declarations:[ue]}]}],de.ctorParameters=function(){return[]};var he=function(){function e(){}return e}(),me=D(he),fe=0,ge=function(e){function t(){var t=e.apply(this,arguments)||this;return t._labelId="mat-optgroup-label-"+fe++,t}return b(t,e),t}(me);ge.decorators=[{type:t.Component,args:[{selector:"md-optgroup, mat-optgroup",template:'<label class="mat-optgroup-label" [id]="_labelId">{{ label }}</label><ng-content select="md-option, mat-option"></ng-content>',encapsulation:t.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,inputs:["disabled"],host:{class:"mat-optgroup",role:"group","[class.mat-optgroup-disabled]":"disabled","[attr.aria-disabled]":"disabled.toString()","[attr.aria-labelledby]":"_labelId"}}]}],ge.ctorParameters=function(){return[]},ge.propDecorators={label:[{type:t.Input}]};var ye=0,_e=function(){function e(e,t){void 0===t&&(t=!1),this.source=e,this.isUserInput=t}return e}(),be=function(){function e(e,n,o){this._element=e,this._changeDetectorRef=n,this.group=o,this._selected=!1,this._active=!1,this._multiple=!1,this._disableRipple=!1,this._disabled=!1,this._id="md-option-"+ye++,this.onSelectionChange=new t.EventEmitter}return Object.defineProperty(e.prototype,"multiple",{get:function(){return this._multiple},set:function(e){e!==this._multiple&&(this._multiple=e,this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.group&&this.group.disabled||this._disabled},set:function(e){this._disabled=i.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(e){this._disableRipple=e,this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewValue",{get:function(){return(this._getHostElement().textContent||"").trim()},enumerable:!0,configurable:!0}),e.prototype.select=function(){this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},e.prototype.deselect=function(){this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},e.prototype.focus=function(){var e=this._getHostElement();"function"==typeof e.focus&&e.focus()},e.prototype.setActiveStyles=function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())},e.prototype.setInactiveStyles=function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())},e.prototype.getLabel=function(){return this.viewValue},e.prototype._handleKeydown=function(e){e.keyCode!==s.ENTER&&e.keyCode!==s.SPACE||(this._selectViaInteraction(),e.preventDefault())},e.prototype._selectViaInteraction=function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))},e.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},e.prototype._getHostElement=function(){return this._element.nativeElement},e.prototype._emitSelectionChangeEvent=function(e){void 0===e&&(e=!1),this.onSelectionChange.emit(new _e(this,e))},e.countGroupLabelsBeforeOption=function(e,t,n){if(n.length){for(var o=t.toArray(),r=n.toArray(),i=0,a=0;a<e+1;a++)o[a].group&&o[a].group===r[i]&&i++;return i}return 0},e}();be.decorators=[{type:t.Component,args:[{selector:"md-option, mat-option",host:{role:"option","[attr.tabindex]":"_getTabIndex()","[class.mat-selected]":"selected","[class.mat-option-multiple]":"multiple","[class.mat-active]":"active","[id]":"id","[attr.aria-selected]":"selected.toString()","[attr.aria-disabled]":"disabled.toString()","[class.mat-option-disabled]":"disabled","(click)":"_selectViaInteraction()","(keydown)":"_handleKeydown($event)",class:"mat-option"},template:'<span *ngIf="multiple"><mat-pseudo-checkbox class="mat-option-pseudo-checkbox" [state]="selected ? \'checked\' : \'\'" [disabled]="disabled"></mat-pseudo-checkbox></span><ng-content></ng-content><div class="mat-option-ripple" mat-ripple [matRippleTrigger]="_getHostElement()" [matRippleDisabled]="disabled || disableRipple"></div>',encapsulation:t.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,viewProviders:[{provide:L,useValue:!0}]}]}],be.ctorParameters=function(){return[{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:ge,decorators:[{type:t.Optional}]}]},be.propDecorators={value:[{type:t.Input}],disabled:[{type:t.Input}],onSelectionChange:[{type:t.Output}]};var ve=function(){function e(){}return e}();ve.decorators=[{type:t.NgModule,args:[{imports:[pe,n.CommonModule,de],exports:[be,ge],declarations:[be,ge]}]}],ve.ctorParameters=function(){return[]};var De=new t.InjectionToken("md-placeholder-global-options"),Ce=function(){function e(){}return e}();Ce.decorators=[{type:t.NgModule,args:[{imports:[o.A11yModule],exports:[o.A11yModule]}]}],Ce.ctorParameters=function(){return[]};var Oe=_.trigger("transformPlaceholder",[_.state("floating-ltr",_.style({top:"-22px",left:"-2px",transform:"scale(0.75)"})),_.state("floating-rtl",_.style({top:"-22px",left:"2px",transform:"scale(0.75)"})),_.transition("* => *",_.animate("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))]),Ee=_.trigger("transformPanel",[_.state("showing",_.style({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),_.state("showing-multiple",_.style({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),_.transition("void => *",[_.style({opacity:0,minWidth:"100%",transform:"scaleY(0)"}),_.animate("150ms cubic-bezier(0.25, 0.8, 0.25, 1)")]),_.transition("* => void",[_.animate("250ms 100ms linear",_.style({opacity:0}))])]),we=_.trigger("fadeInContent",[_.state("showing",_.style({opacity:1})),_.transition("void => showing",[_.style({opacity:0}),_.animate("150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])]),Re=Math.floor(256/48),Ie=new t.InjectionToken("md-select-scroll-strategy"),Se={provide:Ie,deps:[l.Overlay],useFactory:M},ke=function(){function e(e,t){this.source=e,this.value=t}return e}(),Me=function(){function e(e,t){this._renderer=e,this._elementRef=t}return e}(),xe=function(e,t){return void 0===t&&(t=0),function(e){function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=e.apply(this,n)||this;return r._tabIndex=t,r}return b(n,e),Object.defineProperty(n.prototype,"tabIndex",{get:function(){return this.disabled?-1:this._tabIndex},set:function(e){this._tabIndex=null!=e?e:t},enumerable:!0,configurable:!0}),n}(e)}(function(e,t){return function(e){function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=e.apply(this,n)||this;return r.color=t,r}return b(n,e),Object.defineProperty(n.prototype,"color",{get:function(){return this._color},
set:function(e){var n=e||t;n!==this._color&&(this._color&&this._renderer.removeClass(this._elementRef.nativeElement,"mat-"+this._color),n&&this._renderer.addClass(this._elementRef.nativeElement,"mat-"+n),this._color=n)},enumerable:!0,configurable:!0}),n}(e)}(D(Me),"primary")),Te=function(){function e(){}return e}();Te.decorators=[{type:t.Directive,args:[{selector:"md-select-trigger, mat-select-trigger"}]}],Te.ctorParameters=function(){return[]};var Pe=function(e){function n(n,o,r,i,a,s,l,c,p,u,d,h){var m=e.call(this,i,a)||this;return m._viewportRuler=n,m._changeDetectorRef=o,m._platform=r,m._dir=s,m._parentForm=l,m._parentFormGroup=c,m._control=p,m._scrollStrategyFactory=h,m._panelOpen=!1,m._optionSubscription=y.Subscription.EMPTY,m._changeSubscription=y.Subscription.EMPTY,m._tabSubscription=y.Subscription.EMPTY,m._required=!1,m._scrollTop=0,m._multiple=!1,m._compareWith=function(e,t){return e===t},m._placeholderState="",m._onChange=function(){},m._onTouched=function(){},m._optionIds="",m._transformOrigin="top",m._panelDoneAnimating=!1,m._scrollStrategy=m._scrollStrategyFactory(),m._offsetY=0,m._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}],m._disableRipple=!1,m.ariaLabel="",m.ariaLabelledby="",m.onOpen=new t.EventEmitter,m.onClose=new t.EventEmitter,m.change=new t.EventEmitter,m.valueChange=new t.EventEmitter,m._control&&(m._control.valueAccessor=m),m.tabIndex=parseInt(u)||0,m._placeholderOptions=d||{},m.floatPlaceholder=m._placeholderOptions.float||"auto",m}return b(n,e),Object.defineProperty(n.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){var t=this;this._placeholder=e,Promise.resolve(null).then(function(){return t._setTriggerWidth()})},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this._required},set:function(e){this._required=i.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"multiple",{get:function(){return this._multiple},set:function(e){if(this._selectionModel)throw I();this._multiple=i.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"compareWith",{get:function(){return this._compareWith},set:function(e){if("function"!=typeof e)throw k();this._compareWith=e,this._selectionModel&&this._initializeSelection()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"floatPlaceholder",{get:function(){return this._floatPlaceholder},set:function(e){this._floatPlaceholder=e||this._placeholderOptions.float||"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(e){this.writeValue(e),this._value=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(e){this._disableRipple=i.coerceBooleanProperty(e),this._setOptionDisableRipple()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"optionSelectionChanges",{get:function(){return g.merge.apply(void 0,this.options.map(function(e){return e.onSelectionChange}))},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){this._selectionModel=new a.SelectionModel(this.multiple,void 0,!1)},n.prototype.ngAfterContentInit=function(){var e=this;this._initKeyManager(),this._changeSubscription=p.startWith.call(this.options.changes,null).subscribe(function(){e._resetOptions(),e._initializeSelection()})},n.prototype.ngOnDestroy=function(){this._dropSubscriptions(),this._changeSubscription.unsubscribe(),this._tabSubscription.unsubscribe()},n.prototype.toggle=function(){this.panelOpen?this.close():this.open()},n.prototype.open=function(){!this.disabled&&this.options.length&&(this._triggerWidth||this._setTriggerWidth(),this._calculateOverlayPosition(),this._placeholderState=this._floatPlaceholderState(),this._panelOpen=!0,this._changeDetectorRef.markForCheck())},n.prototype.close=function(){this._panelOpen&&(this._panelOpen=!1,this._selectionModel.isEmpty()&&(this._placeholderState=""),this._changeDetectorRef.markForCheck(),this.focus())},n.prototype.writeValue=function(e){this.options&&this._setSelectionByValue(e)},n.prototype.registerOnChange=function(e){this._onChange=e},n.prototype.registerOnTouched=function(e){this._onTouched=e},n.prototype.setDisabledState=function(e){this.disabled=e,this._changeDetectorRef.markForCheck()},Object.defineProperty(n.prototype,"panelOpen",{get:function(){return this._panelOpen},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"triggerValue",{get:function(){if(!this._selectionModel||this._selectionModel.isEmpty())return"";if(this._multiple){var e=this._selectionModel.selected.map(function(e){return e.viewValue});return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue},enumerable:!0,configurable:!0}),n.prototype._isRtl=function(){return!!this._dir&&"rtl"===this._dir.value},n.prototype._setTriggerWidth=function(){this._triggerWidth=this._platform.isBrowser?this._getTriggerRect().width:112,this._changeDetectorRef.markForCheck()},n.prototype._handleClosedKeydown=function(e){this.disabled||(e.keyCode===s.ENTER||e.keyCode===s.SPACE?(e.preventDefault(),this.open()):e.keyCode!==s.UP_ARROW&&e.keyCode!==s.DOWN_ARROW||this._handleArrowKey(e))},n.prototype._handlePanelKeydown=function(e){e.keyCode===s.HOME||e.keyCode===s.END?(e.preventDefault(),e.keyCode===s.HOME?this._keyManager.setFirstItemActive():this._keyManager.setLastItemActive()):this._keyManager.onKeydown(e)},n.prototype._onPanelDone=function(){this.panelOpen?(this._focusCorrectOption(),this.onOpen.emit()):(this.onClose.emit(),this._panelDoneAnimating=!1,this.overlayDir.offsetX=0,this._changeDetectorRef.markForCheck())},n.prototype._onFadeInDone=function(){this._panelDoneAnimating=this.panelOpen,this._changeDetectorRef.markForCheck()},n.prototype._onBlur=function(){this.disabled||this.panelOpen||(this._onTouched(),this._changeDetectorRef.markForCheck())},n.prototype._onAttached=function(){this._calculateOverlayOffsetX(),this._setScrollTop()},n.prototype._hasValue=function(){return this._selectionModel&&this._selectionModel.hasValue()},n.prototype._isErrorState=function(){var e=this._control&&this._control.invalid,t=this._control&&this._control.touched,n=this._parentFormGroup&&this._parentFormGroup.submitted||this._parentForm&&this._parentForm.submitted;return!(!e||!t&&!n)},n.prototype._setScrollTop=function(){this.overlayDir.overlayRef.overlayElement.querySelector(".mat-select-panel").scrollTop=this._scrollTop},n.prototype._initializeSelection=function(){var e=this;Promise.resolve().then(function(){e._setSelectionByValue(e._control?e._control.value:e._value)})},n.prototype._setSelectionByValue=function(e,t){var n=this;void 0===t&&(t=!1);var o=Array.isArray(e);if(this.multiple&&e&&!o)throw S();if(this._clearSelection(),o)e.forEach(function(e){return n._selectValue(e,t)}),this._sortValues();else{var r=this._selectValue(e,t);r&&this._keyManager.setActiveItem(this.options.toArray().indexOf(r))}this._setValueWidth(),this._selectionModel.isEmpty()&&(this._placeholderState=""),this._changeDetectorRef.markForCheck()},n.prototype._selectValue=function(e,n){var o=this;void 0===n&&(n=!1);var r=this.options.find(function(n){try{return null!=n.value&&o._compareWith(n.value,e)}catch(e){return t.isDevMode()&&console.warn(e),!1}});return r&&(n?r._selectViaInteraction():r.select(),this._selectionModel.select(r)),r},n.prototype._clearSelection=function(e){this._selectionModel.clear(),this.options.forEach(function(t){t!==e&&t.deselect()})},n.prototype._getTriggerRect=function(){return this.trigger.nativeElement.getBoundingClientRect()},n.prototype._initKeyManager=function(){var e=this;this._keyManager=new o.FocusKeyManager(this.options).withTypeAhead(),this._tabSubscription=this._keyManager.tabOut.subscribe(function(){return e.close()})},n.prototype._resetOptions=function(){this._dropSubscriptions(),this._listenToOptions(),this._setOptionIds(),this._setOptionMultiple(),this._setOptionDisableRipple()},n.prototype._listenToOptions=function(){var e=this;this._optionSubscription=p.filter.call(this.optionSelectionChanges,function(e){return e.isUserInput}).subscribe(function(t){e._onSelect(t.source),e._setValueWidth(),e.multiple||e.close()})},n.prototype._onSelect=function(e){var t=this._selectionModel.isSelected(e);this.multiple?(this._selectionModel.toggle(e),t?e.deselect():e.select(),this._sortValues()):(this._clearSelection(null==e.value?void 0:e),null==e.value?this._propagateChanges(e.value):this._selectionModel.select(e)),t!==this._selectionModel.isSelected(e)&&this._propagateChanges()},n.prototype._sortValues=function(){var e=this;this._multiple&&(this._selectionModel.clear(),this.options.forEach(function(t){t.selected&&e._selectionModel.select(t)}))},n.prototype._dropSubscriptions=function(){this._optionSubscription.unsubscribe()},n.prototype._propagateChanges=function(e){var t=null;t=Array.isArray(this.selected)?this.selected.map(function(e){return e.value}):this.selected?this.selected.value:e,this._value=t,this._onChange(t),this.change.emit(new ke(this,t)),this.valueChange.emit(t)},n.prototype._setOptionIds=function(){this._optionIds=this.options.map(function(e){return e.id}).join(" ")},n.prototype._setOptionMultiple=function(){var e=this;this.multiple&&Promise.resolve(null).then(function(){e.options.forEach(function(t){return t.multiple=e.multiple})})},n.prototype._setOptionDisableRipple=function(){var e=this;this.options&&this.options.forEach(function(t){return t.disableRipple=e.disableRipple})},n.prototype._setValueWidth=function(){this._selectedValueWidth=this._triggerWidth-13,this._changeDetectorRef.markForCheck()},n.prototype._focusCorrectOption=function(){this._selectionModel.isEmpty()?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._getOptionIndex(this._selectionModel.selected[0]))},n.prototype.focus=function(){this._elementRef.nativeElement.focus()},n.prototype._getOptionIndex=function(e){return this.options.reduce(function(t,n,o){return void 0===t?e===n?o:void 0:t},void 0)},n.prototype._calculateOverlayPosition=function(){var e=this._getItemCount(),t=Math.min(48*e,256),n=48*e,o=n-t;if(this._hasValue()){var r=this._getOptionIndex(this._selectionModel.selected[0]);r+=be.countGroupLabelsBeforeOption(r,this.options,this.optionGroups);var i=t/2;this._scrollTop=this._calculateOverlayScroll(r,i,o),this._offsetY=this._calculateOverlayOffsetY(r,i,o)}else{var a=be.countGroupLabelsBeforeOption(0,this.options,this.optionGroups);this._offsetY=-9-48*a}this._checkOverlayWithinViewport(o)},n.prototype._calculateOverlayScroll=function(e,t,n){return x(0,48*e-t+24,n)},n.prototype._getPlaceholderAnimationState=function(){return"never"===this.floatPlaceholder?"":"always"===this.floatPlaceholder?this._floatPlaceholderState():this._placeholderState},n.prototype._getPlaceholderOpacity=function(){return"never"!==this.floatPlaceholder||this._selectionModel.isEmpty()?"1":"0"},Object.defineProperty(n.prototype,"_ariaLabel",{get:function(){return this.ariaLabelledby?null:this.ariaLabel||this.placeholder},enumerable:!0,configurable:!0}),n.prototype._calculateOverlayOffsetX=function(){var e,t=this.overlayDir.overlayRef.overlayElement.getBoundingClientRect(),n=this._viewportRuler.getViewportRect(),o=this._isRtl(),r=this.multiple?64:32;if(this.multiple)e=48;else{var i=this._selectionModel.selected[0]||this.options.first;e=i&&i.group?32:16}o||(e*=-1);var a=0-(t.left+e-(o?r:0)),s=t.right+e-n.width+(o?0:r);a>0?e+=a+8:s>0&&(e-=s+8),this.overlayDir.offsetX=e,this.overlayDir.overlayRef.updatePosition()},n.prototype._calculateOverlayOffsetY=function(e,t,n){var o;if(0===this._scrollTop)o=48*e;else if(this._scrollTop===n){var r=this._getItemCount()-Re,i=e-r;o=48*i+16}else o=t-24;return-1*o-9},n.prototype._checkOverlayWithinViewport=function(e){var t=this._viewportRuler.getViewportRect(),n=this._getTriggerRect(),o=n.top-8,r=t.height-n.bottom-8,i=Math.abs(this._offsetY),a=Math.min(48*this._getItemCount(),256),s=a-i-n.height;s>r?this._adjustPanelUp(s,r):i>o?this._adjustPanelDown(i,o,e):this._transformOrigin=this._getOriginBasedOnOption()},n.prototype._adjustPanelUp=function(e,t){var n=e-t;this._scrollTop-=n,this._offsetY-=n,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")},n.prototype._adjustPanelDown=function(e,t,n){var o=e-t;if(this._scrollTop+=o,this._offsetY+=o,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=n)return this._scrollTop=n,this._offsetY=0,void(this._transformOrigin="50% top 0px")},n.prototype._getOriginBasedOnOption=function(){return"50% "+(Math.abs(this._offsetY)-9+24)+"px 0px"},n.prototype._floatPlaceholderState=function(){return this._isRtl()?"floating-rtl":"floating-ltr"},n.prototype._handleArrowKey=function(e){if(this._multiple)e.preventDefault(),this.open();else{var t=this._keyManager.activeItem;this._keyManager.onKeydown(e);var n=this._keyManager.activeItem;n!==t&&(this._clearSelection(),this._setSelectionByValue(n.value,!0),this._propagateChanges())}},n.prototype._getItemCount=function(){return this.options.length+this.optionGroups.length},n}(xe);Pe.decorators=[{type:t.Component,args:[{selector:"md-select, mat-select",template:'<div cdk-overlay-origin class="mat-select-trigger" aria-hidden="true" (click)="toggle()" #origin="cdkOverlayOrigin" #trigger><span class="mat-select-placeholder" [class.mat-floating-placeholder]="_hasValue()" [@transformPlaceholder]="_getPlaceholderAnimationState()" [style.opacity]="_getPlaceholderOpacity()" [style.width.px]="_selectedValueWidth">{{ placeholder }}</span> <span class="mat-select-value" *ngIf="_hasValue()"><span class="mat-select-value-text" [ngSwitch]="!!customTrigger"><span *ngSwitchDefault>{{ triggerValue }}</span><ng-content select="md-select-trigger, mat-select-trigger" *ngSwitchCase="true"></ng-content></span></span><span class="mat-select-arrow"></span> <span class="mat-select-underline"></span></div><ng-template cdk-connected-overlay hasBackdrop backdropClass="cdk-overlay-transparent-backdrop" [scrollStrategy]="_scrollStrategy" [origin]="origin" [open]="panelOpen" [positions]="_positions" [minWidth]="_triggerWidth" [offsetY]="_offsetY" (backdropClick)="close()" (attach)="_onAttached()" (detach)="close()"><div class="mat-select-panel {{ \'mat-\' + color }}" [ngClass]="panelClass" [@transformPanel]="multiple ? \'showing-multiple\' : \'showing\'" (@transformPanel.done)="_onPanelDone()" (keydown)="_handlePanelKeydown($event)" [style.transformOrigin]="_transformOrigin" [class.mat-select-panel-done-animating]="_panelDoneAnimating"><div class="mat-select-content" [@fadeInContent]="\'showing\'" (@fadeInContent.done)="_onFadeInDone()"><ng-content></ng-content></div></div></ng-template>',styles:[".mat-select{display:inline-block;outline:0}.mat-select-trigger{display:flex;align-items:center;height:30px;min-width:112px;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-underline{position:absolute;bottom:0;left:0;right:0;height:1px}.mat-select:focus .mat-select-underline{height:2px}.mat-select-disabled .mat-select-underline{background-color:transparent;background-position:0 bottom}.mat-select-placeholder{position:relative;padding:0 2px;transform-origin:left top;flex-grow:1}.mat-select-placeholder.mat-floating-placeholder{top:-22px;left:-2px;text-align:left;transform:scale(.75)}[dir=rtl] .mat-select-placeholder{transform-origin:right top}[dir=rtl] .mat-select-placeholder.mat-floating-placeholder{left:2px;text-align:right}.mat-select-required .mat-select-placeholder::after{content:' *'}.mat-select-value{position:absolute;max-width:calc(100% - 18px);flex-grow:1;top:0;left:0;bottom:0;display:flex;align-items:center}[dir=rtl] .mat-select-value{left:auto;right:0}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:30px}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%}.mat-select-panel:not([class*=mat-elevation-z]){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)}@media screen and (-ms-high-contrast:active){.mat-select-panel{outline:solid 1px}}"],inputs:["color","disabled","tabIndex"],encapsulation:t.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:t.ChangeDetectionStrategy.OnPush,host:{role:"listbox","[attr.tabindex]":"tabIndex","[attr.aria-label]":"_ariaLabel","[attr.aria-labelledby]":"ariaLabelledby","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[attr.aria-invalid]":"_isErrorState()","[attr.aria-owns]":"_optionIds","[attr.aria-multiselectable]":"multiple","[class.mat-select-disabled]":"disabled","[class.mat-select-invalid]":"_isErrorState()","[class.mat-select-required]":"required",class:"mat-select","(keydown)":"_handleClosedKeydown($event)","(blur)":"_onBlur()"},animations:[Oe,Ee,we],exportAs:"mdSelect, matSelect"}]}],Pe.ctorParameters=function(){return[{type:l.ViewportRuler},{type:t.ChangeDetectorRef},{type:c.Platform},{type:t.Renderer2},{type:t.Ele