UNPKG

@angular/material

Version:
9 lines 52.9 kB
/** * @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(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/cdk/a11y"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/collections"),require("@angular/cdk/keycodes"),require("@angular/cdk/rxjs"),require("@angular/forms"),require("@angular/common"),require("@angular/cdk/platform"),require("@angular/animations"),require("rxjs/Subject"),require("@angular/platform-browser"),require("rxjs/observable/fromEvent"),require("rxjs/observable/merge"),require("rxjs/Subscription")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/cdk/a11y","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/collections","@angular/cdk/keycodes","@angular/cdk/rxjs","@angular/forms","@angular/common","@angular/cdk/platform","@angular/animations","rxjs/Subject","@angular/platform-browser","rxjs/observable/fromEvent","rxjs/observable/merge","rxjs/Subscription"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.chips=t.ng.material.chips||{}),t.ng.core,t.ng.cdk.a11y,t.ng.cdk.bidi,t.ng.cdk.coercion,t.ng.cdk.collections,t.ng.cdk.keycodes,t.ng.cdk.rxjs,t.ng.forms,t.ng.common,t.ng.cdk.platform,t.ng.animations,t.Rx,t.ng.platformBrowser,t.Rx.Observable,t.Rx.Observable,t.Rx)}(this,function(t,e,i,n,r,o,a,s,c,l,p,u,h,d,f,m,g){"use strict";function y(t,e){function i(){this.constructor=t}k(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function _(t){return function(t){function e(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=t.apply(this,e)||this;return n._disabled=!1,n}return y(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),e}(t)}function b(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(null==t)throw TypeError("Cannot convert undefined or null to object");for(var n=0,r=e;n<r.length;n++){var o=r[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(t[a]=o[a])}return t}function v(t,e){for(var i=Array(t),n=0;n<t;n++)i[n]=e(n);return i}function C(t){window.getComputedStyle(t).getPropertyValue("opacity")}function w(t,e,i){var n=Math.max(Math.abs(t-i.left),Math.abs(t-i.right)),r=Math.max(Math.abs(e-i.top),Math.abs(e-i.bottom));return Math.sqrt(n*n+r*r)}function I(){return Error("Placeholder attribute and child element were both specified.")}function D(t){return Error("A hint was already declared for 'align=\""+t+"\"'.")}function x(){return Error("mat-form-field must contain a MatFormFieldControl. Did you forget to add matInput to the native input or textarea element?")}var k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},O=(new e.InjectionToken("md-compatibility-mode"),new e.InjectionToken("mat-sanity-checks"),new e.InjectionToken("MAT_DATE_LOCALE")),E=function(){function t(){this._localeChanges=new h.Subject}return Object.defineProperty(t.prototype,"localeChanges",{get:function(){return this._localeChanges},enumerable:!0,configurable:!0}),t.prototype.getYear=function(t){},t.prototype.getMonth=function(t){},t.prototype.getDate=function(t){},t.prototype.getDayOfWeek=function(t){},t.prototype.getMonthNames=function(t){},t.prototype.getDateNames=function(){},t.prototype.getDayOfWeekNames=function(t){},t.prototype.getYearName=function(t){},t.prototype.getFirstDayOfWeek=function(){},t.prototype.getNumDaysInMonth=function(t){},t.prototype.clone=function(t){},t.prototype.createDate=function(t,e,i){},t.prototype.today=function(){},t.prototype.parse=function(t,e){},t.prototype.format=function(t,e){},t.prototype.addCalendarYears=function(t,e){},t.prototype.addCalendarMonths=function(t,e){},t.prototype.addCalendarDays=function(t,e){},t.prototype.toIso8601=function(t){},t.prototype.fromIso8601=function(t){},t.prototype.isDateInstance=function(t){},t.prototype.isValid=function(t){},t.prototype.setLocale=function(t){this.locale=t,this._localeChanges.next()},t.prototype.compareDate=function(t,e){return this.getYear(t)-this.getYear(e)||this.getMonth(t)-this.getMonth(e)||this.getDate(t)-this.getDate(e)},t.prototype.sameDate=function(t,e){return t&&e?!this.compareDate(t,e):t==e},t.prototype.clampDate=function(t,e,i){return e&&this.compareDate(t,e)<0?e:i&&this.compareDate(t,i)>0?i:t},t}(),P="undefined"!=typeof Intl,R={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"]},S=v(31,function(t){return String(t+1)}),F={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},M=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/,A=(function(t){function i(e){var i=t.call(this)||this;return i.useUtcForDisplay=!0,t.prototype.setLocale.call(i,e),i}y(i,t),i.prototype.getYear=function(t){return t.getFullYear()},i.prototype.getMonth=function(t){return t.getMonth()},i.prototype.getDate=function(t){return t.getDate()},i.prototype.getDayOfWeek=function(t){return t.getDay()},i.prototype.getMonthNames=function(t){var e=this;if(P){var i=new Intl.DateTimeFormat(this.locale,{month:t});return v(12,function(t){return e._stripDirectionalityCharacters(i.format(new Date(2017,t,1)))})}return R[t]},i.prototype.getDateNames=function(){var t=this;if(P){var e=new Intl.DateTimeFormat(this.locale,{day:"numeric"});return v(31,function(i){return t._stripDirectionalityCharacters(e.format(new Date(2017,0,i+1)))})}return S},i.prototype.getDayOfWeekNames=function(t){var e=this;if(P){var i=new Intl.DateTimeFormat(this.locale,{weekday:t});return v(7,function(t){return e._stripDirectionalityCharacters(i.format(new Date(2017,0,t+1)))})}return F[t]},i.prototype.getYearName=function(t){if(P){var e=new Intl.DateTimeFormat(this.locale,{year:"numeric"});return this._stripDirectionalityCharacters(e.format(t))}return String(this.getYear(t))},i.prototype.getFirstDayOfWeek=function(){return 0},i.prototype.getNumDaysInMonth=function(t){return this.getDate(this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+1,0))},i.prototype.clone=function(t){return this.createDate(this.getYear(t),this.getMonth(t),this.getDate(t))},i.prototype.createDate=function(t,e,i){if(e<0||e>11)throw Error('Invalid month index "'+e+'". Month index has to be between 0 and 11.');if(i<1)throw Error('Invalid date "'+i+'". Date has to be greater than 0.');var n=this._createDateWithOverflow(t,e,i);if(n.getMonth()!=e)throw Error('Invalid date "'+i+'" for month with index "'+e+'".');return n},i.prototype.today=function(){return new Date},i.prototype.parse=function(t){return"number"==typeof t?new Date(t):t?new Date(Date.parse(t)):null},i.prototype.format=function(t,e){if(!this.isValid(t))throw Error("NativeDateAdapter: Cannot format invalid date.");if(P){this.useUtcForDisplay&&(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),e=b({},e,{timeZone:"utc"}));var i=new Intl.DateTimeFormat(this.locale,e);return this._stripDirectionalityCharacters(i.format(t))}return this._stripDirectionalityCharacters(t.toDateString())},i.prototype.addCalendarYears=function(t,e){return this.addCalendarMonths(t,12*e)},i.prototype.addCalendarMonths=function(t,e){var i=this._createDateWithOverflow(this.getYear(t),this.getMonth(t)+e,this.getDate(t));return this.getMonth(i)!=((this.getMonth(t)+e)%12+12)%12&&(i=this._createDateWithOverflow(this.getYear(i),this.getMonth(i),0)),i},i.prototype.addCalendarDays=function(t,e){return this._createDateWithOverflow(this.getYear(t),this.getMonth(t),this.getDate(t)+e)},i.prototype.toIso8601=function(t){return[t.getUTCFullYear(),this._2digit(t.getUTCMonth()+1),this._2digit(t.getUTCDate())].join("-")},i.prototype.fromIso8601=function(t){if(M.test(t)){var e=new Date(t);if(this.isValid(e))return e}return null},i.prototype.isDateInstance=function(t){return t instanceof Date},i.prototype.isValid=function(t){return!isNaN(t.getTime())},i.prototype._createDateWithOverflow=function(t,e,i){var n=new Date(t,e,i);return t>=0&&t<100&&n.setFullYear(this.getYear(n)-1900),n},i.prototype._2digit=function(t){return("00"+t).slice(-2)},i.prototype._stripDirectionalityCharacters=function(t){return t.replace(/[\u200e\u200f]/g,"")},i.decorators=[{type:e.Injectable}],i.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[O]}]}]}}(E),new e.InjectionToken("mat-date-formats"),function(t){function i(){var i=t.call(this)||this;return i._hammer="undefined"!=typeof window?window.Hammer:null,i.events=i._hammer?["longpress","slide","slidestart","slideend","slideright","slideleft"]:[],!i._hammer&&e.isDevMode()&&console.warn("Could not find HammerJS. Certain Angular Material components may not work correctly."),i}y(i,t),i.prototype.buildHammer=function(t){var e=new this._hammer(t),i=new this._hammer.Pan,n=new this._hammer.Swipe,r=new this._hammer.Press,o=this._createRecognizer(i,{event:"slide",threshold:0},n),a=this._createRecognizer(r,{event:"longpress",time:500});return i.recognizeWith(n),e.add([n,r,i,o,a]),e},i.prototype._createRecognizer=function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];var r=new t.constructor(e);return i.push(t),i.forEach(function(t){return r.recognizeWith(t)}),r},i.decorators=[{type:e.Injectable}],i.ctorParameters=function(){return[]}}(d.HammerGestureConfig),{});A.FADING_IN=0,A.VISIBLE=1,A.FADING_OUT=2,A.HIDDEN=3,A[A.FADING_IN]="FADING_IN",A[A.VISIBLE]="VISIBLE",A[A.FADING_OUT]="FADING_OUT",A[A.HIDDEN]="HIDDEN";var j=function(){function t(t,e,i){this._renderer=t,this.element=e,this.config=i,this.state=A.HIDDEN}return t.prototype.fadeOut=function(){this._renderer.fadeOutRipple(this)},t}(),T=function(){function t(t,e,i){this._ngZone=e,this._isPointerDown=!1,this._triggerEvents=new Map,this._activeRipples=new Set,this.rippleConfig={},this.rippleDisabled=!1,i.isBrowser&&(this._containerElement=t.nativeElement,this._triggerEvents.set("mousedown",this.onMousedown.bind(this)),this._triggerEvents.set("touchstart",this.onTouchstart.bind(this)),this._triggerEvents.set("mouseup",this.onPointerUp.bind(this)),this._triggerEvents.set("touchend",this.onPointerUp.bind(this)),this._triggerEvents.set("mouseleave",this.onPointerLeave.bind(this)),this.setTriggerElement(this._containerElement))}return t.prototype.fadeInRipple=function(t,e,i){var n=this;void 0===i&&(i={});var r=this._containerElement.getBoundingClientRect();i.centered&&(t=r.left+r.width/2,e=r.top+r.height/2);var o=i.radius||w(t,e,r),a=1/(i.speedFactor||1)*450,s=t-r.left,c=e-r.top,l=document.createElement("div");l.classList.add("mat-ripple-element"),l.style.left=s-o+"px",l.style.top=c-o+"px",l.style.height=2*o+"px",l.style.width=2*o+"px",l.style.backgroundColor=i.color||null,l.style.transitionDuration=a+"ms",this._containerElement.appendChild(l),C(l),l.style.transform="scale(1)";var p=new j(this,l,i);return p.state=A.FADING_IN,this._activeRipples.add(p),this.runTimeoutOutsideZone(function(){p.state=A.VISIBLE,i.persistent||n._isPointerDown||p.fadeOut()},a),p},t.prototype.fadeOutRipple=function(t){if(this._activeRipples.delete(t)){var e=t.element;e.style.transitionDuration="400ms",e.style.opacity="0",t.state=A.FADING_OUT,this.runTimeoutOutsideZone(function(){t.state=A.HIDDEN,e.parentNode.removeChild(e)},400)}},t.prototype.fadeOutAll=function(){this._activeRipples.forEach(function(t){return t.fadeOut()})},t.prototype.setTriggerElement=function(t){var e=this;this._triggerElement&&this._triggerEvents.forEach(function(t,i){e._triggerElement.removeEventListener(i,t)}),t&&this._ngZone.runOutsideAngular(function(){e._triggerEvents.forEach(function(e,i){return t.addEventListener(i,e)})}),this._triggerElement=t},t.prototype.onMousedown=function(t){this.rippleDisabled||(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this.rippleConfig))},t.prototype.onPointerUp=function(){this._isPointerDown=!1,this._activeRipples.forEach(function(t){t.config.persistent||t.state!==A.VISIBLE||t.fadeOut()})},t.prototype.onPointerLeave=function(){this._isPointerDown&&this.onPointerUp()},t.prototype.onTouchstart=function(t){if(!this.rippleDisabled){var e=t.touches[0],i=e.clientX,n=e.clientY;this._isPointerDown=!0,this.fadeInRipple(i,n,this.rippleConfig)}},t.prototype.runTimeoutOutsideZone=function(t,e){void 0===e&&(e=0),this._ngZone.runOutsideAngular(function(){return setTimeout(t,e)})},t}(),B=new e.InjectionToken("mat-ripple-global-options"),L=(function(){function t(t,e,i,n){this.radius=0,this.speedFactor=1,this._rippleRenderer=new T(t,e,i),this._globalOptions=n||{},this._updateRippleRenderer()}t.prototype.ngOnChanges=function(t){(t.trigger||t._matRippleTrigger)&&this.trigger&&this._rippleRenderer.setTriggerElement(this.trigger),this._updateRippleRenderer()},t.prototype.ngOnDestroy=function(){this._rippleRenderer.setTriggerElement(null)},t.prototype.launch=function(t,e,i){return void 0===i&&(i=this.rippleConfig),this._rippleRenderer.fadeInRipple(t,e,i)},t.prototype.fadeOutAll=function(){this._rippleRenderer.fadeOutAll()},Object.defineProperty(t.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}),t.prototype._updateRippleRenderer=function(){this._rippleRenderer.rippleDisabled=this._globalOptions.disabled||this.disabled,this._rippleRenderer.rippleConfig=this.rippleConfig},t.decorators=[{type:e.Directive,args:[{selector:"[mat-ripple], [matRipple]",exportAs:"matRipple",host:{class:"mat-ripple","[class.mat-ripple-unbounded]":"unbounded"}}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.NgZone},{type:p.Platform},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[B]}]}]},t.propDecorators={trigger:[{type:e.Input,args:["matRippleTrigger"]}],centered:[{type:e.Input,args:["matRippleCentered"]}],disabled:[{type:e.Input,args:["matRippleDisabled"]}],radius:[{type:e.Input,args:["matRippleRadius"]}],speedFactor:[{type:e.Input,args:["matRippleSpeedFactor"]}],color:[{type:e.Input,args:["matRippleColor"]}],unbounded:[{type:e.Input,args:["matRippleUnbounded"]}]}}(),function(){function t(){}return t}()),N=_(L),V=0,W=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._labelId="mat-optgroup-label-"+V++,e}return y(i,t),i.decorators=[{type:e.Component,args:[{selector:"mat-optgroup",exportAs:"matOptgroup",template:'<label class="mat-optgroup-label" [id]="_labelId">{{ label }}</label><ng-content select="mat-option"></ng-content>',encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,inputs:["disabled"],host:{class:"mat-optgroup",role:"group","[class.mat-optgroup-disabled]":"disabled","[attr.aria-disabled]":"disabled.toString()","[attr.aria-labelledby]":"_labelId"}}]}],i.ctorParameters=function(){return[]},i.propDecorators={label:[{type:e.Input}]},i}(N),q=0,Y=function(){function t(t,e){void 0===e&&(e=!1),this.source=t,this.isUserInput=e}return t}(),U=(function(){function t(t,i,n){this._element=t,this._changeDetectorRef=i,this.group=n,this._selected=!1,this._active=!1,this._multiple=!1,this._disableRipple=!1,this._disabled=!1,this._id="mat-option-"+q++,this.onSelectionChange=new e.EventEmitter}Object.defineProperty(t.prototype,"multiple",{get:function(){return this._multiple},set:function(t){t!==this._multiple&&(this._multiple=t,this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this._selected},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.group&&this.group.disabled||this._disabled},set:function(t){this._disabled=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disableRipple",{get:function(){return this._disableRipple},set:function(t){this._disableRipple=t,this._changeDetectorRef.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewValue",{get:function(){return(this._getHostElement().textContent||"").trim()},enumerable:!0,configurable:!0}),t.prototype.select=function(){this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},t.prototype.deselect=function(){this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent()},t.prototype.focus=function(){var t=this._getHostElement();"function"==typeof t.focus&&t.focus()},t.prototype.setActiveStyles=function(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())},t.prototype.setInactiveStyles=function(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())},t.prototype.getLabel=function(){return this.viewValue},t.prototype._handleKeydown=function(t){t.keyCode!==a.ENTER&&t.keyCode!==a.SPACE||(this._selectViaInteraction(),t.preventDefault())},t.prototype._selectViaInteraction=function(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))},t.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},t.prototype._getHostElement=function(){return this._element.nativeElement},t.prototype._emitSelectionChangeEvent=function(t){void 0===t&&(t=!1),this.onSelectionChange.emit(new Y(this,t))},t.countGroupLabelsBeforeOption=function(t,e,i){if(i.length){for(var n=e.toArray(),r=i.toArray(),o=0,a=0;a<t+1;a++)n[a].group&&n[a].group===r[o]&&o++;return o}return 0},t.decorators=[{type:e.Component,args:[{selector:"mat-option",exportAs:"matOption",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><span class="mat-option-text"><ng-content></ng-content></span><div class="mat-option-ripple" mat-ripple [matRippleTrigger]="_getHostElement()" [matRippleDisabled]="disabled || disableRipple"></div>',encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:W,decorators:[{type:e.Optional}]}]},t.propDecorators={value:[{type:e.Input}],disabled:[{type:e.Input}],onSelectionChange:[{type:e.Output}]}}(),new e.InjectionToken("mat-placeholder-global-options")),z=0,H=function(){function t(){this.id="mat-error-"+z++}return t.decorators=[{type:e.Directive,args:[{selector:"mat-error",host:{class:"mat-error",role:"alert","[attr.id]":"id"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={id:[{type:e.Input}]},t}(),G=function(){function t(){}return t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(t){},t}(),K=0,J=function(){function t(){this.align="start",this.id="mat-hint-"+K++}return t.decorators=[{type:e.Directive,args:[{selector:"mat-hint",host:{class:"mat-hint","[class.mat-right]":'align == "end"',"[attr.id]":"id","[attr.align]":"null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={align:[{type:e.Input}],id:[{type:e.Input}]},t}(),Z=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"mat-placeholder"}]}],t.ctorParameters=function(){return[]},t}(),$=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"[matPrefix]"}]}],t.ctorParameters=function(){return[]},t}(),X=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"[matSuffix]"}]}],t.ctorParameters=function(){return[]},t}(),Q=0,tt=(function(){function t(t,e,i,n){this._elementRef=t,this._renderer=e,this._changeDetectorRef=i,this.color="primary",this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+Q++,this._placeholderOptions=n||{},this.floatPlaceholder=this._placeholderOptions.float||"auto"}Object.defineProperty(t.prototype,"dividerColor",{get:function(){return this.color},set:function(t){this.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideRequiredMarker",{get:function(){return this._hideRequiredMarker},set:function(t){this._hideRequiredMarker=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_shouldAlwaysFloat",{get:function(){return"always"===this._floatPlaceholder&&!this._showAlwaysAnimate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_canPlaceholderFloat",{get:function(){return"never"!==this._floatPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hintLabel",{get:function(){return this._hintLabel},set:function(t){this._hintLabel=t,this._processHints()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"floatPlaceholder",{get:function(){return this._floatPlaceholder},set:function(t){t!==this._floatPlaceholder&&(this._floatPlaceholder=t||this._placeholderOptions.float||"auto",this._changeDetectorRef.markForCheck())},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._validateControlChild(),this._control.controlType&&this._renderer.addClass(this._elementRef.nativeElement,"mat-form-field-type-"+this._control.controlType),s.startWith.call(this._control.stateChanges,null).subscribe(function(){t._validatePlaceholders(),t._syncDescribedByIds(),t._changeDetectorRef.markForCheck()});var e=this._control.ngControl;e&&e.valueChanges&&e.valueChanges.subscribe(function(){t._changeDetectorRef.markForCheck()}),s.startWith.call(this._hintChildren.changes,null).subscribe(function(){t._processHints(),t._changeDetectorRef.markForCheck()}),s.startWith.call(this._errorChildren.changes,null).subscribe(function(){t._syncDescribedByIds(),t._changeDetectorRef.markForCheck()})},t.prototype.ngAfterContentChecked=function(){this._validateControlChild()},t.prototype.ngAfterViewInit=function(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()},t.prototype._shouldForward=function(t){var e=this._control?this._control.ngControl:null;return e&&e[t]},t.prototype._hasPlaceholder=function(){return!(!this._control.placeholder&&!this._placeholderChild)},t.prototype._getDisplayedMessages=function(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"},t.prototype._animateAndLockPlaceholder=function(){var t=this;this._placeholder&&this._canPlaceholderFloat&&(this._showAlwaysAnimate=!0,this._floatPlaceholder="always",s.first.call(f.fromEvent(this._placeholder.nativeElement,"transitionend")).subscribe(function(){t._showAlwaysAnimate=!1}),this._changeDetectorRef.markForCheck())},t.prototype._validatePlaceholders=function(){if(this._control.placeholder&&this._placeholderChild)throw I()},t.prototype._processHints=function(){this._validateHints(),this._syncDescribedByIds()},t.prototype._validateHints=function(){var t=this;if(this._hintChildren){var e,i;this._hintChildren.forEach(function(n){if("start"==n.align){if(e||t.hintLabel)throw D("start");e=n}else if("end"==n.align){if(i)throw D("end");i=n}})}},t.prototype._syncDescribedByIds=function(){if(this._control){var t=[];if("hint"===this._getDisplayedMessages()){var e=this._hintChildren?this._hintChildren.find(function(t){return"start"===t.align}):null,i=this._hintChildren?this._hintChildren.find(function(t){return"end"===t.align}):null;e?t.push(e.id):this._hintLabel&&t.push(this._hintLabelId),i&&t.push(i.id)}else this._errorChildren&&(t=this._errorChildren.map(function(t){return t.id}));this._control.setDescribedByIds(t)}},t.prototype._validateControlChild=function(){if(!this._control)throw x()},t.decorators=[{type:e.Component,args:[{selector:"mat-input-container, mat-form-field",exportAs:"matFormField",template:'<div class="mat-input-wrapper mat-form-field-wrapper"><div class="mat-input-flex mat-form-field-flex" #connectionContainer (click)="_control.onContainerClick && _control.onContainerClick($event)"><div class="mat-input-prefix mat-form-field-prefix" *ngIf="_prefixChildren.length"><ng-content select="[matPrefix]"></ng-content></div><div class="mat-input-infix mat-form-field-infix"><ng-content></ng-content><span class="mat-input-placeholder-wrapper mat-form-field-placeholder-wrapper"><label class="mat-input-placeholder mat-form-field-placeholder" [attr.for]="_control.id" [attr.aria-owns]="_control.id" [class.mat-empty]="_control.empty && !_shouldAlwaysFloat" [class.mat-form-field-empty]="_control.empty && !_shouldAlwaysFloat" [class.mat-accent]="color == \'accent\'" [class.mat-warn]="color == \'warn\'" #placeholder *ngIf="_hasPlaceholder()"><ng-content select="mat-placeholder"></ng-content>{{_control.placeholder}} <span class="mat-placeholder-required mat-form-field-required-marker" aria-hidden="true" *ngIf="!hideRequiredMarker && _control.required">*</span></label></span></div><div class="mat-input-suffix mat-form-field-suffix" *ngIf="_suffixChildren.length"><ng-content select="[matSuffix]"></ng-content></div></div><div class="mat-input-underline mat-form-field-underline" #underline [class.mat-disabled]="_control.disabled"><span class="mat-input-ripple mat-form-field-ripple" [class.mat-accent]="color == \'accent\'" [class.mat-warn]="color == \'warn\'"></span></div><div class="mat-input-subscript-wrapper mat-form-field-subscript-wrapper" [ngSwitch]="_getDisplayedMessages()"><div *ngSwitchCase="\'error\'" [@transitionMessages]="_subscriptAnimationState"><ng-content select="mat-error"></ng-content></div><div class="mat-input-hint-wrapper mat-form-field-hint-wrapper" *ngSwitchCase="\'hint\'" [@transitionMessages]="_subscriptAnimationState"><div *ngIf="hintLabel" [id]="_hintLabelId" class="mat-hint">{{hintLabel}}</div><ng-content select="mat-hint:not([align=\'end\'])"></ng-content><div class="mat-input-hint-spacer mat-form-field-hint-spacer"></div><ng-content select="mat-hint[align=\'end\']"></ng-content></div></div></div>',styles:[".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none}.mat-form-field-prefix .mat-icon,.mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-prefix .mat-icon-button,.mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0}.mat-form-field-placeholder-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}.mat-form-field-placeholder{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform:perspective(100px);-ms-transform:none;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),color .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1);display:none}[dir=rtl] .mat-form-field-placeholder{transform-origin:100% 0;left:auto;right:0}.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-placeholder,.mat-form-field-empty.mat-form-field-placeholder{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-placeholder-wrapper .mat-form-field-placeholder{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-placeholder-wrapper .mat-form-field-placeholder{display:block;transition:none}.mat-form-field-placeholder:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;height:1px;width:100%}.mat-form-field-underline.mat-disabled{background-position:0;background-color:transparent}.mat-form-field-underline .mat-form-field-ripple{position:absolute;height:1px;top:0;left:0;width:100%;transform-origin:50%;transform:scaleX(.5);visibility:hidden;transition:background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-focused .mat-form-field-underline .mat-form-field-ripple{height:2px}.mat-focused .mat-form-field-underline .mat-form-field-ripple,.mat-form-field-invalid .mat-form-field-underline .mat-form-field-ripple{visibility:visible;transform:scaleX(1);transition:transform 150ms linear,background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-form-field-subscript-wrapper{position:absolute;width:100%;overflow:hidden}.mat-form-field-placeholder-wrapper .mat-icon,.mat-form-field-subscript-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block} .mat-input-element{font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element::placeholder{color:transparent!important}.mat-input-element::-moz-placeholder{color:transparent!important}.mat-input-element::-webkit-input-placeholder{color:transparent!important}.mat-input-element:-ms-input-placeholder{color:transparent!important}textarea.mat-input-element{resize:vertical;overflow:auto}"],animations:[u.trigger("transitionMessages",[u.state("enter",u.style({opacity:1,transform:"translateY(0%)"})),u.transition("void => enter",[u.style({opacity:0,transform:"translateY(-100%)"}),u.animate("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])],host:{class:"mat-input-container mat-form-field","[class.mat-input-invalid]":"_control.errorState","[class.mat-form-field-invalid]":"_control.errorState","[class.mat-form-field-can-float]":"_canPlaceholderFloat","[class.mat-form-field-should-float]":"_control.shouldPlaceholderFloat || _shouldAlwaysFloat","[class.mat-focused]":"_control.focused","[class.mat-primary]":'color == "primary"',"[class.mat-accent]":'color == "accent"',"[class.mat-warn]":'color == "warn"',"[class.ng-untouched]":'_shouldForward("untouched")',"[class.ng-touched]":'_shouldForward("touched")',"[class.ng-pristine]":'_shouldForward("pristine")',"[class.ng-dirty]":'_shouldForward("dirty")',"[class.ng-valid]":'_shouldForward("valid")',"[class.ng-invalid]":'_shouldForward("invalid")',"[class.ng-pending]":'_shouldForward("pending")'},encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:e.ChangeDetectorRef},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[U]}]}]},t.propDecorators={color:[{type:e.Input}],dividerColor:[{type:e.Input}],hideRequiredMarker:[{type:e.Input}],hintLabel:[{type:e.Input}],floatPlaceholder:[{type:e.Input}],underlineRef:[{type:e.ViewChild,args:["underline"]}],_connectionContainerRef:[{type:e.ViewChild,args:["connectionContainer"]}],_placeholder:[{type:e.ViewChild,args:["placeholder"]}],_control:[{type:e.ContentChild,args:[G]}],_placeholderChild:[{ type:e.ContentChild,args:[Z]}],_errorChildren:[{type:e.ContentChildren,args:[H]}],_hintChildren:[{type:e.ContentChildren,args:[J]}],_prefixChildren:[{type:e.ContentChildren,args:[$]}],_suffixChildren:[{type:e.ContentChildren,args:[X]}]}}(),function(){function t(t,e,i){void 0===i&&(i=!1),this.source=t,this.selected=e,this.isUserInput=i}return t}()),et=function(){function t(t,e){this._renderer=t,this._elementRef=e}return t}(),it=function(t,e){return function(t){function i(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var r=t.apply(this,i)||this;return r.color=e,r}return y(i,t),Object.defineProperty(i.prototype,"color",{get:function(){return this._color},set:function(t){var i=t||e;i!==this._color&&(this._color&&this._renderer.removeClass(this._elementRef.nativeElement,"mat-"+this._color),i&&this._renderer.addClass(this._elementRef.nativeElement,"mat-"+i),this._color=i)},enumerable:!0,configurable:!0}),i}(t)}(_(et),"primary"),nt=function(){function t(){}return t.decorators=[{type:e.Directive,args:[{selector:"mat-basic-chip, [mat-basic-chip]",host:{class:"mat-basic-chip"}}]}],t.ctorParameters=function(){return[]},t}(),rt=function(t){function i(i,n){var r=t.call(this,i,n)||this;return r._elementRef=n,r._selected=!1,r._selectable=!0,r._removable=!0,r._hasFocus=!1,r._onFocus=new h.Subject,r._onBlur=new h.Subject,r.selectionChange=new e.EventEmitter,r.destroyed=new e.EventEmitter,r.destroy=r.destroyed,r.removed=new e.EventEmitter,r.onRemove=r.removed,r}return y(i,t),Object.defineProperty(i.prototype,"selected",{get:function(){return this._selected},set:function(t){this._selected=r.coerceBooleanProperty(t),this.selectionChange.emit({source:this,isUserInput:!1,selected:t})},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return void 0!=this._value?this._value:this._elementRef.nativeElement.textContent},set:function(t){this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectable",{get:function(){return this._selectable},set:function(t){this._selectable=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"removable",{get:function(){return this._removable},set:function(t){this._removable=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ariaSelected",{get:function(){return this.selectable?this.selected.toString():null},enumerable:!0,configurable:!0}),i.prototype.ngOnDestroy=function(){this.destroyed.emit({chip:this})},i.prototype.select=function(){this._selected=!0,this.selectionChange.emit({source:this,isUserInput:!1,selected:!0})},i.prototype.deselect=function(){this._selected=!1,this.selectionChange.emit({source:this,isUserInput:!1,selected:!1})},i.prototype.selectViaInteraction=function(){this._selected=!0,this.selectionChange.emit({source:this,isUserInput:!0,selected:!0})},i.prototype.toggleSelected=function(t){return void 0===t&&(t=!1),this._selected=!this.selected,this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected}),this.selected},i.prototype.focus=function(){this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})},i.prototype.remove=function(){this.removable&&this.removed.emit({chip:this})},i.prototype._handleClick=function(t){this.disabled||(t.preventDefault(),t.stopPropagation(),this.focus())},i.prototype._handleKeydown=function(t){if(!this.disabled)switch(t.keyCode){case a.DELETE:case a.BACKSPACE:this.remove(),t.preventDefault();break;case a.SPACE:this.selectable&&this.toggleSelected(!0),t.preventDefault()}},i.prototype._blur=function(){this._hasFocus=!1,this._onBlur.next({chip:this})},i.decorators=[{type:e.Directive,args:[{selector:"mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]",inputs:["color","disabled"],exportAs:"matChip",host:{class:"mat-chip",tabindex:"-1",role:"option","[class.mat-chip-selected]":"selected","[attr.disabled]":"disabled || null","[attr.aria-disabled]":"disabled.toString()","[attr.aria-selected]":"ariaSelected","(click)":"_handleClick($event)","(keydown)":"_handleKeydown($event)","(focus)":"_hasFocus = true","(blur)":"_blur()"}}]}],i.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ElementRef}]},i.propDecorators={selected:[{type:e.Input}],value:[{type:e.Input}],selectable:[{type:e.Input}],removable:[{type:e.Input}],selectionChange:[{type:e.Output}],destroyed:[{type:e.Output}],destroy:[{type:e.Output}],removed:[{type:e.Output}],onRemove:[{type:e.Output,args:["remove"]}]},i}(it),ot=function(){function t(t){this._parentChip=t}return t.prototype._handleClick=function(){this._parentChip.removable&&this._parentChip.remove()},t.decorators=[{type:e.Directive,args:[{selector:"[matChipRemove]",host:{class:"mat-chip-remove","(click)":"_handleClick($event)"}}]}],t.ctorParameters=function(){return[{type:rt}]},t}(),at=0,st=function(){function t(t,e){this.source=t,this.value=e}return t}(),ct=function(){function t(t,i,n,r,o,a,s){this._renderer=t,this._elementRef=i,this._changeDetectorRef=n,this._dir=r,this._parentForm=o,this._parentFormGroup=a,this.ngControl=s,this.controlType="mat-chip-list",this.stateChanges=new h.Subject,this._lastDestroyedIndex=null,this._chipSet=new WeakMap,this._tabOutSubscription=g.Subscription.EMPTY,this._selectable=!0,this._multiple=!1,this._uid="mat-chip-list-"+at++,this._required=!1,this._disabled=!1,this._tabIndex=0,this._userTabIndex=null,this._onTouched=function(){},this._onChange=function(){},this._compareWith=function(t,e){return t===e},this.ariaOrientation="horizontal",this.change=new e.EventEmitter,this.valueChange=new e.EventEmitter,this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"selected",{get:function(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"multiple",{get:function(){return this._multiple},set:function(t){this._multiple=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compareWith",{get:function(){return this._compareWith},set:function(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this.writeValue(t),this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id||this._uid},set:function(t){this._id=t,this.stateChanges.next()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=r.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._chipInput?this._chipInput.placeholder:this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focused",{get:function(){return this.chips.some(function(t){return t._hasFocus})||this._chipInput&&this._chipInput.focused},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return(!this._chipInput||this._chipInput.empty)&&0===this.chips.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldPlaceholderFloat",{get:function(){return this.empty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.ngControl?this.ngControl.disabled:this._disabled},set:function(t){this._disabled=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errorState",{get:function(){var t=this.ngControl&&this.ngControl.invalid,e=this.ngControl&&this.ngControl.touched,i=this._parentFormGroup&&this._parentFormGroup.submitted||this._parentForm&&this._parentForm.submitted;return!(!t||!e&&!i)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectable",{get:function(){return this._selectable},set:function(t){this._selectable=r.coerceBooleanProperty(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tabIndex",{set:function(t){this._userTabIndex=t,this._tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chipSelectionChanges",{get:function(){return m.merge.apply(void 0,this.chips.map(function(t){return t.selectionChange}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chipFocusChanges",{get:function(){return m.merge.apply(void 0,this.chips.map(function(t){return t._onFocus}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chipBlurChanges",{get:function(){return m.merge.apply(void 0,this.chips.map(function(t){return t._onBlur}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chipRemoveChanges",{get:function(){return m.merge.apply(void 0,this.chips.map(function(t){return t.destroy}))},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this._keyManager=new i.FocusKeyManager(this.chips).withWrap(),this._tabOutSubscription=this._keyManager.tabOut.subscribe(function(){t._tabIndex=-1,setTimeout(function(){return t._tabIndex=t._userTabIndex||0})}),this._changeSubscription=s.startWith.call(this.chips.changes,null).subscribe(function(){t._resetChips(),t._initializeSelection(),t._updateTabIndex(),t._updateFocusForDestroyedChips()})},t.prototype.ngOnInit=function(){this._selectionModel=new o.SelectionModel(this.multiple,void 0,!1),this.stateChanges.next()},t.prototype.ngOnDestroy=function(){this._tabOutSubscription.unsubscribe(),this._changeSubscription&&this._changeSubscription.unsubscribe(),this._dropSubscriptions()},t.prototype.registerInput=function(t){this._chipInput=t},t.prototype.setDescribedByIds=function(t){this._ariaDescribedby=t.join(" ")},t.prototype.writeValue=function(t){this.chips&&this._setSelectionByValue(t,!1)},t.prototype.registerOnChange=function(t){this._onChange=t},t.prototype.registerOnTouched=function(t){this._onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t,this._renderer.setProperty(this._elementRef.nativeElement,"disabled",t),this.stateChanges.next()},t.prototype.onContainerClick=function(){this.focus()},t.prototype.focus=function(){this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(),this.stateChanges.next()))},t.prototype._focusInput=function(){this._chipInput&&this._chipInput.focus()},t.prototype._keydown=function(t){var e=t.keyCode,i=t.target,n=this._isInputEmpty(i),r=this._dir&&"rtl"==this._dir.value,o=e===(r?a.RIGHT_ARROW:a.LEFT_ARROW),s=e===(r?a.LEFT_ARROW:a.RIGHT_ARROW),c=e===a.BACKSPACE;if(n&&c)return this._keyManager.setLastItemActive(),void t.preventDefault();i&&i.classList.contains("mat-chip")&&(o?(this._keyManager.setPreviousItemActive(),t.preventDefault()):s?(this._keyManager.setNextItemActive(),t.preventDefault()):this._keyManager.onKeydown(t)),this.stateChanges.next()},t.prototype._updateTabIndex=function(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)},t.prototype._updateKeyManager=function(t){var e=this.chips.toArray().indexOf(t);this._isValidIndex(e)&&(t._hasFocus&&(e<this.chips.length-1?this._keyManager.setActiveItem(e):e-1>=0&&this._keyManager.setActiveItem(e-1)),this._keyManager.activeItemIndex===e&&(this._lastDestroyedIndex=e))},t.prototype._updateFocusForDestroyedChips=function(){var t=this.chips;if(null!=this._lastDestroyedIndex&&t.length>0){var e=Math.min(this._lastDestroyedIndex,t.length-1);this._keyManager.setActiveItem(e);var i=this._keyManager.activeItem;i&&i.focus()}this._lastDestroyedIndex=null},t.prototype._isValidIndex=function(t){return t>=0&&t<this.chips.length},t.prototype._isInputEmpty=function(t){if(t&&"input"===t.nodeName.toLowerCase()){return!t.value}return!1},t.prototype._setSelectionByValue=function(t,e){var i=this;if(void 0===e&&(e=!0),this._clearSelection(),this.chips.forEach(function(t){return t.deselect()}),Array.isArray(t))t.forEach(function(t){return i._selectValue(t,e)}),this._sortValues();else{var n=this._selectValue(t,e);n&&this._keyManager.setActiveItem(this.chips.toArray().indexOf(n))}},t.prototype._selectValue=function(t,e){var i=this;void 0===e&&(e=!0);var n=this.chips.find(function(e){return null!=e.value&&i._compareWith(e.value,t)});return n&&(e?n.selectViaInteraction():n.select(),this._selectionModel.select(n)),n},t.prototype._initializeSelection=function(){var t=this;Promise.resolve().then(function(){(t.ngControl||t._value)&&(t._setSelectionByValue(t.ngControl?t.ngControl.value:t._value,!1),t.stateChanges.next())})},t.prototype._clearSelection=function(t){this._selectionModel.clear(),this.chips.forEach(function(e){e!==t&&e.deselect()}),this.stateChanges.next()},t.prototype._sortValues=function(){var t=this;this._multiple&&(this._selectionModel.clear(),this.chips.forEach(function(e){e.selected&&t._selectionModel.select(e)}),this.stateChanges.next())},t.prototype._propagateChanges=function(t){var e=null;e=Array.isArray(this.selected)?this.selected.map(function(t){return t.value}):this.selected?this.selected.value:t,this._value=e,this.change.emit(new st(this,e)),this.valueChange.emit(e),this._onChange(e),this._changeDetectorRef.markForCheck()},t.prototype._blur=function(){var t=this;this.disabled||(this._chipInput?setTimeout(function(){t.focused||t._markAsTouched()}):this._markAsTouched())},t.prototype._markAsTouched=function(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()},t.prototype._resetChips=function(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()},t.prototype._dropSubscriptions=function(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null)},t.prototype._listenToChipsSelection=function(){var t=this;this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(function(e){e.source.selected?t._selectionModel.select(e.source):t._selectionModel.deselect(e.source),t.multiple||t.chips.forEach(function(e){!t._selectionModel.isSelected(e)&&e.selected&&e.deselect()}),e.isUserInput&&t._propagateChanges()})},t.prototype._listenToChipsFocus=function(){var t=this;this._chipFocusSubscription=this.chipFocusChanges.subscribe(function(e){var i=t.chips.toArray().indexOf(e.chip);t._isValidIndex(i)&&t._keyManager.updateActiveItemIndex(i),t.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(function(e){t._blur(),t.stateChanges.next()})},t.prototype._listenToChipsRemoved=function(){var t=this;this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(function(e){t._updateKeyManager(e.chip)})},t.decorators=[{type:e.Component,args:[{selector:"mat-chip-list",template:'<div class="mat-chip-list-wrapper"><ng-content></ng-content></div>',exportAs:"matChipList",host:{"[attr.tabindex]":"_tabIndex","[attr.aria-describedby]":"_ariaDescribedby || null","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[attr.aria-invalid]":"errorState","[attr.aria-multiselectable]":"multiple","[class.mat-chip-list-disabled]":"disabled","[class.mat-chip-list-invalid]":"errorState","[class.mat-chip-list-required]":"required",role:"listbox","[attr.aria-orientation]":"ariaOrientation",class:"mat-chip-list","(focus)":"focus()","(blur)":"_blur()","(keydown)":"_keydown($event)"},providers:[{provide:G,useExisting:t}],styles:[".mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline}.mat-chip:not(.mat-basic-chip){transition:box-shadow 280ms cubic-bezier(.4,0,.2,1);display:inline-flex;padding:7px 12px;border-radius:24px;align-items:center;cursor:default}.mat-chip:not(.mat-basic-chip)+.mat-chip:not(.mat-basic-chip){margin:0 0 3px 8px}[dir=rtl] .mat-chip:not(.mat-basic-chip)+.mat-chip:not(.mat-basic-chip){margin:0 8px 3px 0}.mat-form-field-prefix .mat-chip:not(.mat-basic-chip):last-child{margin-right:8px}[dir=rtl] .mat-form-field-prefix .mat-chip:not(.mat-basic-chip):last-child{margin-left:8px}.mat-chip:not(.mat-basic-chip) .mat-chip-remove.mat-icon{width:1em;height:1em}.mat-chip:not(.mat-basic-chip):focus{box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);outline:0}@media screen and (-ms-high-contrast:active){.mat-chip:not(.mat-basic-chip){outline:solid 1px}}.mat-chip-list-stacked .mat-chip-list-wrapper{display:block}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-chip:not(.mat-basic-chip){display:block;margin:0;margin-bottom:8px}[dir=rtl] .mat-chip-list-stacked .mat-chip-list-wrapper .mat-chip:not(.mat-basic-chip){margin:0;margin-bottom:8px}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-chip:not(.mat-basic-chip):last-child,[dir=rtl] .mat-chip-list-stacked .mat-chip-list-wrapper .mat-chip:not(.mat-basic-chip):last-child{margin-bottom:0}.mat-form-field-prefix .mat-chip-list-wrapper{margin-bottom:8px}.mat-chip-remove{margin-right:-4px;margin-left:6px;cursor:pointer}[dir=rtl] .mat-chip-remove{margin-right:6px;margin-left:-4px}input.mat-chip-input{width:150px;margin:3px}"],encapsulation:e.ViewEncapsulation.None,preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:n.Directionality,decorators:[{type:e.Optional}]},{type:c.NgForm,decorators:[{type:e.Optional}]},{type:c.FormGroupDirective,decorato