import{a as he,f as R,i as Ee,j as Re,l as Te,m as De,n as Fe,o as Le,q as T,v as Ie}from"./chunk-Z3H43YNT.js";import{D as f,E as fe,I as ge,J as E,K as g,S as ve,W as ye,_ as be,ca as Oe,g as pe,ga as Ae,h as ue,j as de,ja as Se,la as we,n as me,o as _e,oa as Pe,ta as Ce,xa as Me}from"./chunk-E4UUPK46.js";import{a as ke}from"./chunk-WWNBTMQ7.js";import{A as V,Ba as j,Bb as G,Bc as te,Eb as z,G as h,H as A,Ha as w,Hb as Q,Ic as ie,Kb as U,Kc as oe,Kd as k,La as c,Lc as ne,Ma as q,Mc as ae,Nc as se,Ob as X,Oc as le,Od as r,Pb as Z,Pc as p,Qb as P,Qc as u,R as x,T as B,Ta as Y,Ub as J,Wa as _,Wc as re,Yc as ce,a as d,c as y,e as b,fa as W,ga as m,hc as C,ja as H,ld as M,p as O,ra as N,ta as K,uc as $,v as I,va as S,vc as ee,xa as s}from"./chunk-O7RN3KYY.js";import{a as L}from"./chunk-ZE2KCNEA.js";L();var Ke=["panel"],je=["*"];function qe(a,v){if(a&1&&($(0,"div",1,0),ae(2),ee()),a&2){let e=v.id,t=oe();ce(t._classList),re("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),te("id",t.id),C("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var D=class{source;option;constructor(v,e){this.source=v,this.option=e}},Be=new S("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),At=(()=>{class a{_changeDetectorRef=s(k);_elementRef=s(_);_defaults=s(Be);_animationsDisabled=R();_activeOptionChanges=d.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=!1;optionSelected=new c;opened=new c;closed=new c;optionActivated=new c;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}id=s(ge).getId("mat-autocomplete-");inertGroups;constructor(){let e=s(pe);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new fe(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let t=new D(this,e);this.optionSelected.emit(t)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=X({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,o){if(t&1&&se(o,De,5)(o,Re,5),t&2){let n;p(n=u())&&(i.options=n),p(n=u())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(z,7)(Ke,5),t&2){let o;p(o=u())&&(i.template=o.first),p(o=u())&&(i.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",r],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",r],requireSelection:[2,"requireSelection","requireSelection",r],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",r],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",r]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[M([{provide:Ee,useExisting:a}])],ngContentSelectors:je,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(ne(),J(0,qe,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel { width: 100%; max-height: 256px; visibility: hidden; transform-origin: center top; overflow: auto; padding: 8px 0; box-sizing: border-box; position: relative; border-radius: var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small)); box-shadow: var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)); background-color: var(--mat-autocomplete-background-color, var(--mat-sys-surface-container)); } @media (forced-colors: active) { div.mat-mdc-autocomplete-panel { outline: solid 1px; } } .cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel { border-top-left-radius: 0; border-top-right-radius: 0; } .mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel { border-bottom-left-radius: 0; border-bottom-right-radius: 0; transform-origin: center bottom; } div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible { visibility: visible; } div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden, .cdk-overlay-pane:has(> .mat-mdc-autocomplete-hidden) { visibility: hidden; pointer-events: none; } @keyframes _mat-autocomplete-enter { from { opacity: 0; transform: scaleY(0.8); } to { opacity: 1; transform: none; } } .mat-autocomplete-panel-animations-enabled { animation: _mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1); } mat-autocomplete { display: none; } `],encapsulation:2,changeDetection:0})}return a})(),St=(()=>{class a{elementRef=s(_);constructor(){}static \u0275fac=function(t){return new(t||a)};static \u0275dir=P({type:a,selectors:[["","matAutocompleteOrigin",""]],exportAs:["matAutocompleteOrigin"]})}return a})(),Ye={provide:ke,useExisting:N(()=>ze),multi:!0};var Ge=new S("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=s(w);return()=>Se(a)}}),ze=(()=>{class a{_environmentInjector=s(j);_element=s(_);_injector=s(w);_viewContainerRef=s(U);_zone=s(q);_changeDetectorRef=s(k);_dir=s(ye,{optional:!0});_formField=s(Ie,{optional:!0,host:!0});_viewportRuler=s(Oe);_scrollStrategy=s(Ge);_renderer=s(Q);_animationsDisabled=R();_defaults=s(Be,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new b;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=d.EMPTY;_breakpointObserver=s(de);_handsetLandscapeSubscription=d.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new b;_overlayPanelClass=ue(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=!1;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&g(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return h(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(A(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(A(()=>this._overlayAttached)):O()).pipe(I(e=>e instanceof Te?e:null))}optionSelections=V(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(W(e),m(()=>h(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(m(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new y(e=>{let t=o=>{let n=_e(o),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,F=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&n!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(n))&&(!F||!F.contains(n))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(n)&&e.next(o)},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{i.forEach(o=>o())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e,i=t.keyCode,o=f(t);if(i===27&&!o&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let n=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==n)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(n=>n.selected);if(o){let n=this._getDisplayValue(o.value);i!==n&&o.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return me()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new y(i=>{G(()=>{i.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(H(()=>this._positionStrategy.reapplyLastPosition()),B(0))??O();return h(e,t).pipe(m(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),x(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;E(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new ve(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Ce(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(he.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!f(e)||e.keyCode===38&&f(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0}_getOverlayConfig(){return new we({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=Pe(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],n;this.position==="above"?n=o:this.position==="below"?n=t:n=[...t,...o],e.withPositions(n)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&g(this._trackedModal,"aria-owns",t),E(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;g(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=P({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&ie("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(n){return i._handleInput(n)})("keydown",function(n){return i._handleKeydown(n)})("click",function(){return i._handleClick()}),t&2&&C("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen||i.autocomplete==null?null:i.autocomplete.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",r]},exportAs:["matAutocompleteTrigger"],features:[M([Ye]),Y]})}return a})(),wt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=Z({type:a});static \u0275inj=K({imports:[Me,T,Ae,T,be]})}return a})();export{Be as a,At as b,St as c,ze as d,wt as e};