UNPKG

p3x-redis-ui-material

Version:

💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity

209 lines (203 loc) 31.5 kB
import{Ai as wy,Bn as cq,Di as wf,Dn as _y,Dr as lo,E as En,En as _r,Fi as xi,Ft as Ro,H as In,Hi as yp,Hn as cw,Hr as nn,Ht as Tf,Ii as xk,In as by,Ir as mo,It as Sn,J as Je$1,Jn as et,Jr as os,L as Hs,Lr as my,Lt as Sy,Mi as x_,Ni as xe,Nt as Re,O as Fr,Oi as wr,Or as lr,P as HT,Pi as xf,Pr as mc,Rn as co,Rt as T,S as Do,T as Ee,Tr as le,V as I,Vt as Te,W as J,Wt as Ty,Yn as f0,Zr as q$1,Zt as V,_ as Cf,_i as uY,ai as re,an as Wl,bi as uw,dn as Xe,dr as ie$1,dt as Nc,er as gT,et as L,f as Br,ft as Ne,gn as Z,gt as O,in as Wa,ir as h,kr as lt$1,li as se,mi as te,mr as iw,mt as Ni,n as $e,ni as qp,pt as Nf,qr as oe,si as rt$1,sn as Wp,ti as qi,u as Bc,ut as N_,wi as vt$1,wn as _e,wr as lc,xi as v,xn as Zp,xt as Pe,y as Cn,yi as up,zn as cp}from"./chunk-CHqDEyfr.js";import{l as S}from"./chunk-B_FU7ynV.js";import{s as Ve}from"./chunk-CLjqwtZV.js";import{t as i}from"./chunk-DxgAwx0L.js";import{t as f}from"./chunk-CaLi_qYn2.js";var nt=[`*`,[[`mat-option`],[`ng-container`]]];var ot=[`*`,`mat-option, ng-container`];var at=[`text`];var st=[[[`mat-icon`]],`*`];var lt=[`mat-icon`,`*`];function rt(n,l){if(n&1&&_y(0,`mat-pseudo-checkbox`,1),n&2){let e=gT();by(`disabled`,e.disabled)(`state`,e.selected?`checked`:`unchecked`)}}function ct(n,l){if(n&1&&_y(0,`mat-pseudo-checkbox`,3),n&2)by(`disabled`,gT().disabled)}function pt(n,l){if(n&1&&(Wa(0,`span`,4),HT(1),wf()),n&2){let e=gT();Sn(),Nf(`(`,e.group.label,`)`)}}var W=new v(`MAT_OPTION_PARENT_COMPONENT`);var z=new v(`MatOptgroup`);var dt=(()=>{class n{label;disabled=!1;_labelId=h(qi).getId(`mat-optgroup-label-`);_inert;constructor(){let e=h(W,{optional:!0});this._inert=e?.inertGroups??!1}static ɵfac=function(t){return new(t||n)};static ɵcmp=Ee({type:n,selectors:[[`mat-optgroup`]],hostAttrs:[1,`mat-mdc-optgroup`],hostVars:3,hostBindings:function(t,i){t&2&&xi(`role`,i._inert?null:`group`)(`aria-disabled`,i._inert?null:i.disabled.toString())(`aria-labelledby`,i._inert?null:i._labelId)},inputs:{label:`label`,disabled:[2,`disabled`,`disabled`,le]},exportAs:[`matOptgroup`],features:[Ni([{provide:z,useExisting:n}])],ngContentSelectors:ot,decls:5,vars:4,consts:[[`role`,`presentation`,1,`mat-mdc-optgroup-label`,3,`id`],[1,`mdc-list-item__primary-text`]],template:function(t,i){t&1&&(Cn(nt),Je$1(0,`span`,0)(1,`span`,1),HT(2),Te(3),et()(),Te(4,1)),t&2&&(vt$1(`mdc-list-item--disabled`,i.disabled),wy(`id`,i._labelId),Sn(2),Nf(``,i.label,` `))},styles:[`.mat-mdc-optgroup { color: var(--%NS%mat-optgroup-label-text-color, var(--%NS%mat-sys-on-surface-variant)); font-family: var(--%NS%mat-optgroup-label-text-font, var(--%NS%mat-sys-title-small-font)); line-height: var(--%NS%mat-optgroup-label-text-line-height, var(--%NS%mat-sys-title-small-line-height)); font-size: var(--%NS%mat-optgroup-label-text-size, var(--%NS%mat-sys-title-small-size)); letter-spacing: var(--%NS%mat-optgroup-label-text-tracking, var(--%NS%mat-sys-title-small-tracking)); font-weight: var(--%NS%mat-optgroup-label-text-weight, var(--%NS%mat-sys-title-small-weight)); } .mat-mdc-optgroup-label { display: flex; position: relative; align-items: center; justify-content: flex-start; overflow: hidden; min-height: 48px; padding: 0 16px; outline: none; } .mat-mdc-optgroup-label.mdc-list-item--disabled { opacity: 0.38; } .mat-mdc-optgroup-label .mdc-list-item__primary-text { font-size: inherit; font-weight: inherit; letter-spacing: inherit; line-height: inherit; font-family: inherit; text-decoration: inherit; text-transform: inherit; white-space: normal; color: inherit; } `],encapsulation:2})}return n})();var x=class{source;isUserInput;constructor(l,e=!1){this.source=l,this.isUserInput=e}};var q=(()=>{class n{_element=h(q$1);_changeDetectorRef=h(mc);_parent=h(W,{optional:!0});group=h(z,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue=``;get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=h(qi).getId(`mat-option-`);get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=xe(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new J;_text;_stateChanges=new I;constructor(){let e=h(rt$1);e.load(x_),e.load(Bc),this._signalDisableRipple=!!this._parent&&lr(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||``).trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,t){let i=this._getHostElement();typeof i.focus==`function`&&i.focus(t)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!Nc(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?`-1`:`0`}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new x(this,e))}static ɵfac=function(t){return new(t||n)};static ɵcmp=Ee({type:n,selectors:[[`mat-option`]],viewQuery:function(t,i){if(t&1&&lc(at,7),t&2){let o;Cf(o=xf())&&(i._text=o.first)}},hostAttrs:[`role`,`option`,1,`mat-mdc-option`,`mdc-list-item`],hostVars:11,hostBindings:function(t,i){t&1&&Sy(`click`,function(){return i._selectViaInteraction()})(`keydown`,function(a){return i._handleKeydown(a)}),t&2&&(wy(`id`,i.id),xi(`aria-selected`,i.selected)(`aria-disabled`,i.disabled.toString()),vt$1(`mdc-list-item--selected`,i.selected)(`mat-mdc-option-multiple`,i.multiple)(`mat-mdc-option-active`,i.active)(`mdc-list-item--disabled`,i.disabled))},inputs:{value:`value`,id:`id`,disabled:[2,`disabled`,`disabled`,le]},outputs:{onSelectionChange:`onSelectionChange`},exportAs:[`matOption`],ngContentSelectors:lt,decls:8,vars:5,consts:[[`text`,``],[`aria-hidden`,`true`,1,`mat-mdc-option-pseudo-checkbox`,3,`disabled`,`state`],[1,`mdc-list-item__primary-text`],[`state`,`checked`,`aria-hidden`,`true`,`appearance`,`minimal`,1,`mat-mdc-option-pseudo-checkbox`,3,`disabled`],[1,`cdk-visually-hidden`],[`aria-hidden`,`true`,`mat-ripple`,``,1,`mat-mdc-option-ripple`,`mat-focus-indicator`,3,`matRippleTrigger`,`matRippleDisabled`]],template:function(t,i){t&1&&(Cn(st),co(0,rt,1,2,`mat-pseudo-checkbox`,1),Te(1),Wa(2,`span`,2,0),Te(4,1),wf(),co(5,ct,1,1,`mat-pseudo-checkbox`,3),co(6,pt,2,1,`span`,4),_y(7,`div`,5)),t&2&&(lo(i.multiple?0:-1),Sn(5),lo(!i.multiple&&i.selected&&!i.hideSingleSelectionIndicator?5:-1),Sn(),lo(i.group&&i.group._inert?6:-1),Sn(),by(`matRippleTrigger`,i._getHostElement())(`matRippleDisabled`,i.disabled||i.disableRipple))},dependencies:[i,uY],styles:[`.mat-mdc-option { -webkit-user-select: none; user-select: none; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; display: flex; position: relative; align-items: center; justify-content: flex-start; overflow: hidden; min-height: 48px; padding: 0 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; color: var(--%NS%mat-option-label-text-color, var(--%NS%mat-sys-on-surface)); font-family: var(--%NS%mat-option-label-text-font, var(--%NS%mat-sys-label-large-font)); line-height: var(--%NS%mat-option-label-text-line-height, var(--%NS%mat-sys-label-large-line-height)); font-size: var(--%NS%mat-option-label-text-size, var(--%NS%mat-sys-body-large-size)); letter-spacing: var(--%NS%mat-option-label-text-tracking, var(--%NS%mat-sys-label-large-tracking)); font-weight: var(--%NS%mat-option-label-text-weight, var(--%NS%mat-sys-body-large-weight)); } .mat-mdc-option:hover:not(.mdc-list-item--disabled) { background-color: var(--%NS%mat-option-hover-state-layer-color, color-mix(in srgb, var(--%NS%mat-sys-on-surface) calc(var(--%NS%mat-sys-hover-state-layer-opacity) * 100%), transparent)); } .mat-mdc-option:focus.mdc-list-item, .mat-mdc-option.mat-mdc-option-active.mdc-list-item { background-color: var(--%NS%mat-option-focus-state-layer-color, color-mix(in srgb, var(--%NS%mat-sys-on-surface) calc(var(--%NS%mat-sys-focus-state-layer-opacity) * 100%), transparent)); outline: 0; } .mat-mdc-option.mdc-list-item--%NS%selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active, .mat-mdc-option-multiple, :focus, :hover) { background-color: var(--%NS%mat-option-selected-state-layer-color, var(--%NS%mat-sys-secondary-container)); } .mat-mdc-option.mdc-list-item--%NS%selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active, .mat-mdc-option-multiple, :focus, :hover) .mdc-list-item__primary-text { color: var(--%NS%mat-option-selected-state-label-text-color, var(--%NS%mat-sys-on-secondary-container)); } .mat-mdc-option .mat-pseudo-checkbox { --%NS%mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--%NS%mat-option-selected-state-label-text-color, var(--%NS%mat-sys-on-secondary-container)); } .mat-mdc-option.mdc-list-item { align-items: center; background: transparent; } .mat-mdc-option.mdc-list-item--disabled { cursor: default; pointer-events: none; } .mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox, .mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text, .mat-mdc-option.mdc-list-item--disabled > mat-icon { opacity: 0.38; } .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple) { padding-left: 32px; } [dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple) { padding-left: 16px; padding-right: 32px; } .mat-mdc-option .mat-icon, .mat-mdc-option .mat-pseudo-checkbox-full { margin-right: 16px; flex-shrink: 0; } [dir=rtl] .mat-mdc-option .mat-icon, [dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full { margin-right: 0; margin-left: 16px; } .mat-mdc-option .mat-pseudo-checkbox-minimal { margin-left: 16px; flex-shrink: 0; } [dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal { margin-right: 16px; margin-left: 0; } .mat-mdc-option .mat-mdc-option-ripple { top: 0; left: 0; right: 0; bottom: 0; position: absolute; pointer-events: none; } .mat-mdc-option .mdc-list-item__primary-text { white-space: normal; font-size: inherit; font-weight: inherit; letter-spacing: inherit; line-height: inherit; font-family: inherit; text-decoration: inherit; text-transform: inherit; margin-right: auto; } [dir=rtl] .mat-mdc-option .mdc-list-item__primary-text { margin-right: 0; margin-left: auto; } @media (forced-colors: active) { .mat-mdc-option.mdc-list-item--%NS%selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after { content: ""; position: absolute; top: 50%; right: 16px; transform: translateY(-50%); width: 10px; height: 0; border-bottom: solid 10px; border-radius: 10px; } [dir=rtl] .mat-mdc-option.mdc-list-item--%NS%selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after { right: auto; left: 16px; } } .mat-mdc-option-multiple { --%NS%mat-list-list-item-selected-container-color: var(--%NS%mat-list-list-item-container-color, transparent); } .mat-mdc-option-active .mat-focus-indicator::before { content: ""; } `],encapsulation:2})}return n})();function Ze(n,l,e){if(e.length){let t=l.toArray(),i=e.toArray(),o=0;for(let a=0;a<n+1;a++)t[a].group&&t[a].group===i[o]&&o++;return o}return 0}function Je(n,l,e,t){return n<e?n:n+l>e+t?Math.max(0,n-t+l):e}var ie=(()=>{class n{static ɵfac=function(t){return new(t||n)};static ɵmod=oe({type:n});static ɵinj=te({imports:[N_,f,q,nn]})}return n})();var ht=[`panel`];var _t=[`*`];function ft(n,l){if(n&1&&(Je$1(0,`div`,1,0),Te(2),et()),n&2){let e=l.id,t=gT();Tf(t._classList),vt$1(`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`),wy(`id`,t.id),xi(`aria-label`,t.ariaLabel||null)(`aria-labelledby`,t._getPanelAriaLabelledby(e))}}var ne=class{source;option;constructor(l,e){this.source=l,this.option=e}};var tt=new v(`mat-autocomplete-default-options`,{providedIn:`root`,factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})});var di=(()=>{class n{_changeDetectorRef=h(mc);_elementRef=h(q$1);_defaults=h(tt);_animationsDisabled=Do();_activeOptionChanges=L.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 J;opened=new J;closed=new J;optionActivated=new J;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=h(qi).getId(`mat-autocomplete-`);inertGroups;constructor(){let e=h(re);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 yp(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 ne(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 ɵfac=function(t){return new(t||n)};static ɵcmp=Ee({type:n,selectors:[[`mat-autocomplete`]],contentQueries:function(t,i,o){if(t&1&&Ty(o,q,5)(o,z,5),t&2){let a;Cf(a=xf())&&(i.options=a),Cf(a=xf())&&(i.optionGroups=a)}},viewQuery:function(t,i){if(t&1&&lc($e,7)(ht,5),t&2){let o;Cf(o=xf())&&(i.template=o.first),Cf(o=xf())&&(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`,le],autoSelectActiveOption:[2,`autoSelectActiveOption`,`autoSelectActiveOption`,le],requireSelection:[2,`requireSelection`,`requireSelection`,le],panelWidth:`panelWidth`,disableRipple:[2,`disableRipple`,`disableRipple`,le],classList:[0,`class`,`classList`],hideSingleSelectionIndicator:[2,`hideSingleSelectionIndicator`,`hideSingleSelectionIndicator`,le]},outputs:{optionSelected:`optionSelected`,opened:`opened`,closed:`closed`,optionActivated:`optionActivated`},exportAs:[`matAutocomplete`],features:[Ni([{provide:W,useExisting:n}])],ngContentSelectors:_t,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&&(Cn(),my(0,ft,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(--%NS%mat-autocomplete-container-shape, var(--%NS%mat-sys-corner-extra-small)); box-shadow: var(--%NS%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(--%NS%mat-autocomplete-background-color, var(--%NS%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})}return n})();var gt={provide:S,useExisting:Br(()=>bt),multi:!0};var vt=new v(`mat-autocomplete-scroll-strategy`,{providedIn:`root`,factory:()=>{let n=h(V);return()=>Wp(n)}});var bt=(()=>{class n{_environmentInjector=h(se);_element=h(q$1);_injector=h(V);_viewContainerRef=h(Pe);_zone=h(O);_changeDetectorRef=h(mc);_dir=h(mo,{optional:!0});_formField=h(Ve,{optional:!0,host:!0});_viewportRuler=h(wr);_scrollStrategy=h(vt);_renderer=h(Xe);_animationsDisabled=Do();_defaults=h(tt,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new I;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=L.EMPTY;_breakpointObserver=h(cp);_handsetLandscapeSubscription=L.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new I;_overlayPanelClass=_r(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position=`auto`;connectedTo;autocompleteAttribute=`off`;autocompleteDisabled=!1;_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()}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())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return cw(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(_e(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(_e(()=>this._overlayAttached)):Re()).pipe(ie$1(e=>e instanceof x?e:null))}optionSelections=iw(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(Fr(e),Hs(()=>cw(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(Hs(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new T(e=>{let t=o=>{let a=Ne(o),c=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,oe=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&a!==this._element.nativeElement&&!this._hasFocus()&&(!c||!c.contains(a))&&(!oe||!oe.contains(a))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(a)&&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=Nc(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 a=this.autocomplete._keyManager.activeItem,c=i===38||i===40;i===9||c&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):c&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(c||this.autocomplete._keyManager.activeItem!==a)&&(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(a=>a.selected);if(o){let a=this._getDisplayValue(o.value);i!==a&&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 f0()===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(){return cw(new T(i=>{In(()=>{i.next()},{injector:this._environmentInjector})}),this.autocomplete.options?.changes.pipe(Wl(()=>this._positionStrategy.reapplyLastPosition()),uw(0))??Re()).pipe(Hs(()=>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})),lt$1(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??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){this._attachOverlay(e),this._floatLabel()}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Ro(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Zp(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(cq.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.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!Nc(e)||e.keyCode===38&&Nc(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 os({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=qp(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}],a;this.position===`above`?a=o:this.position===`below`?a=t:a=[...t,...o],e.withPositions(a)}_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<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=Ze(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let o=t.options.toArray()[e];if(o){let a=o._getHostElement(),c=Je(a.offsetTop,a.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(c)}}}static ɵfac=function(t){return new(t||n)};static ɵdir=Z({type:n,selectors:[[`input`,`matAutocomplete`,``],[`textarea`,`matAutocomplete`,``]],hostAttrs:[1,`mat-mdc-autocomplete-trigger`],hostVars:7,hostBindings:function(t,i){t&1&&Sy(`focusin`,function(){return i._handleFocus()})(`blur`,function(){return i._onTouched()})(`input`,function(a){return i._handleInput(a)})(`keydown`,function(a){return i._handleKeydown(a)})(`click`,function(){return i._handleClick()}),t&2&&xi(`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?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`,le]},exportAs:[`matAutocompleteTrigger`],features:[Ni([gt]),En]})}return n})();var mi=(()=>{class n{static ɵfac=function(t){return new(t||n)};static ɵmod=oe({type:n});static ɵinj=te({imports:[xk,ie,up,ie,nn]})}return n})();export{di as a,mi as c,bt as i,q as l,W as n,dt as o,Ze as r,ie as s,Je as t,z as u};