-
Notifications
You must be signed in to change notification settings - Fork 1
/
default-node_modules_angular_cdk_fesm2022_overlay_mjs.31d23577918ea337.js
2 lines (2 loc) · 38.2 KB
/
default-node_modules_angular_cdk_fesm2022_overlay_mjs.31d23577918ea337.js
1
2
"use strict";(self.webpackChunksite=self.webpackChunksite||[]).push([["default-node_modules_angular_cdk_fesm2022_overlay_mjs"],{3136:(ut,V,p)=>{p.d(V,{eC:()=>dt,wW:()=>T,mc:()=>k,o9:()=>R,Y1:()=>pt});var S=p(4092),m=p(3267),r=p(5460),f=p(9480),b=p(264),Z=p(2440),z=p(1100),j=p(8788),U=p(2712),G=p(2512),E=p(4288),x=p(6886),C=p(3441),w=p(2676),K=p(3456),D=p(1908);const B=(0,b.kk)();class J{constructor(t,s){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=s}attach(){}enable(){if(this._canBeEnabled()){const t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=(0,f.ph)(-this._previousScrollPosition.left),t.style.top=(0,f.ph)(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const t=this._document.documentElement,e=t.style,i=this._document.body.style,n=e.scrollBehavior||"",a=i.scrollBehavior||"";this._isEnabled=!1,e.left=this._previousHTMLStyles.left,e.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),B&&(e.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),B&&(e.scrollBehavior=n,i.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const s=this._document.body,e=this._viewportRuler.getViewportSize();return s.scrollHeight>e.height||s.scrollWidth>e.width}}class Q{constructor(t,s,e,i){this._scrollDispatcher=t,this._ngZone=s,this._viewportRuler=e,this._config=i,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef=t}enable(){if(this._scrollSubscription)return;const t=this._scrollDispatcher.scrolled(0).pipe((0,Z.I)(s=>!s||!this._overlayRef.overlayElement.contains(s.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{const s=this._viewportRuler.getViewportScrollPosition().top;Math.abs(s-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class M{enable(){}disable(){}attach(){}}function P(o,t){return t.some(s=>o.bottom<s.top||o.top>s.bottom||o.right<s.left||o.left>s.right)}function L(o,t){return t.some(s=>o.top<s.top||o.bottom>s.bottom||o.left<s.left||o.right>s.right)}class q{constructor(t,s,e,i){this._scrollDispatcher=t,this._viewportRuler=s,this._ngZone=e,this._config=i,this._scrollSubscription=null}attach(t){this._overlayRef=t}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const s=this._overlayRef.overlayElement.getBoundingClientRect(),{width:e,height:i}=this._viewportRuler.getViewportSize();P(s,[{width:e,height:i,bottom:i,right:e,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let tt=(()=>{var o;class t{constructor(e,i,n,a){this._scrollDispatcher=e,this._viewportRuler=i,this._ngZone=n,this.noop=()=>new M,this.close=l=>new Q(this._scrollDispatcher,this._ngZone,this._viewportRuler,l),this.block=()=>new J(this._viewportRuler,this._document),this.reposition=l=>new q(this._scrollDispatcher,this._viewportRuler,this._ngZone,l),this._document=a}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(S.Yn),r.CoB(S.S8),r.CoB(r.WW2),r.CoB(m.Ud))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})();class R{constructor(t){if(this.scrollStrategy=new M,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){const s=Object.keys(t);for(const e of s)void 0!==t[e]&&(this[e]=t[e])}}}class et{constructor(t,s){this.connectionPair=t,this.scrollableViewProperties=s}}let Y=(()=>{var o;class t{constructor(e){this._attachedOverlays=[],this._document=e}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){const i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(m.Ud))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})(),it=(()=>{var o;class t extends Y{constructor(e,i){super(e),this._ngZone=i,this._keydownListener=n=>{const a=this._attachedOverlays;for(let l=a.length-1;l>-1;l--)if(a[l]._keydownEvents.observers.length>0){const c=a[l]._keydownEvents;this._ngZone?this._ngZone.run(()=>c.next(n)):c.next(n);break}}}add(e){super.add(e),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(m.Ud),r.CoB(r.WW2,8))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})(),st=(()=>{var o;class t extends Y{constructor(e,i,n){super(e),this._platform=i,this._ngZone=n,this._cursorStyleIsSet=!1,this._pointerDownListener=a=>{this._pointerDownEventTarget=(0,b.oZ)(a)},this._clickListener=a=>{const l=(0,b.oZ)(a),c="click"===a.type&&this._pointerDownEventTarget?this._pointerDownEventTarget:l;this._pointerDownEventTarget=null;const d=this._attachedOverlays.slice();for(let h=d.length-1;h>-1;h--){const _=d[h];if(_._outsidePointerEvents.observers.length<1||!_.hasAttached())continue;if(_.overlayElement.contains(l)||_.overlayElement.contains(c))break;const v=_._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>v.next(a)):v.next(a)}}}add(e){if(super.add(e),!this._isAttached){const i=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(i)):this._addEventListeners(i),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const e=this._document.body;e.removeEventListener("pointerdown",this._pointerDownListener,!0),e.removeEventListener("click",this._clickListener,!0),e.removeEventListener("auxclick",this._clickListener,!0),e.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(e.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(e){e.addEventListener("pointerdown",this._pointerDownListener,!0),e.addEventListener("click",this._clickListener,!0),e.addEventListener("auxclick",this._clickListener,!0),e.addEventListener("contextmenu",this._clickListener,!0)}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(m.Ud),r.CoB(b.WU),r.CoB(r.WW2,8))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})(),A=(()=>{var o;class t{constructor(e,i){this._platform=i,this._document=e}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const e="cdk-overlay-container";if(this._platform.isBrowser||(0,b.mW)()){const n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let a=0;a<n.length;a++)n[a].remove()}const i=this._document.createElement("div");i.classList.add(e),(0,b.mW)()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(m.Ud),r.CoB(b.WU))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})();class ot{constructor(t,s,e,i,n,a,l,c,d,h=!1){this._portalOutlet=t,this._host=s,this._pane=e,this._config=i,this._ngZone=n,this._keyboardDispatcher=a,this._document=l,this._location=c,this._outsideClickDispatcher=d,this._animationsDisabled=h,this._backdropElement=null,this._backdropClick=new C.E,this._attachments=new C.E,this._detachments=new C.E,this._locationChanges=w.wH.EMPTY,this._backdropClickHandler=_=>this._backdropClick.next(_),this._backdropTransitionendHandler=_=>{this._disposeBackdrop(_.target)},this._keydownEvents=new C.E,this._outsidePointerEvents=new C.E,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);const s=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe((0,z.U)(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),"function"==typeof s?.onDestroy&&s.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),s}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){const t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._previousHostParent=this._pane=this._host=null,t&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config={...this._config,...t},this._updateElementSize()}setDirection(t){this._config={...this._config,direction:t},this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){const t=this._config.direction;return t?"string"==typeof t?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const t=this._pane.style;t.width=(0,f.ph)(this._config.width),t.height=(0,f.ph)(this._config.height),t.minWidth=(0,f.ph)(this._config.minWidth),t.minHeight=(0,f.ph)(this._config.minHeight),t.maxWidth=(0,f.ph)(this._config.maxWidth),t.maxHeight=(0,f.ph)(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){const t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){const t=this._backdropElement;if(t){if(this._animationsDisabled)return void this._disposeBackdrop(t);t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",this._backdropTransitionendHandler)}),t.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(t)},500))}}_toggleClasses(t,s,e){const i=(0,f.Mt)(s||[]).filter(n=>!!n);i.length&&(e?t.classList.add(...i):t.classList.remove(...i))}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const t=this._ngZone.onStable.pipe((0,j.a)((0,K.U)(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),t.unsubscribe())})})}_disposeScrollStrategy(){const t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}_disposeBackdrop(t){t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",this._backdropTransitionendHandler),t.remove(),this._backdropElement===t&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}}const X="cdk-overlay-connected-position-bounding-box",nt=/([A-Za-z%]+)$/;class rt{get positions(){return this._preferredPositions}constructor(t,s,e,i,n){this._viewportRuler=s,this._document=e,this._platform=i,this._overlayContainer=n,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new C.E,this._resizeSubscription=w.wH.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}attach(t){this._validatePositions(),t.hostElement.classList.add(X),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const t=this._originRect,s=this._overlayRect,e=this._viewportRect,i=this._containerRect,n=[];let a;for(let l of this._preferredPositions){let c=this._getOriginPoint(t,i,l),d=this._getOverlayPoint(c,s,l),h=this._getOverlayFit(d,s,e,l);if(h.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(l,c);this._canFitWithFlexibleDimensions(h,d,e)?n.push({position:l,origin:c,overlayRect:s,boundingBoxRect:this._calculateBoundingBoxRect(c,l)}):(!a||a.overlayFit.visibleArea<h.visibleArea)&&(a={overlayFit:h,overlayPoint:d,originPoint:c,position:l,overlayRect:s})}if(n.length){let l=null,c=-1;for(const d of n){const h=d.boundingBoxRect.width*d.boundingBoxRect.height*(d.position.weight||1);h>c&&(c=h,l=d)}return this._isPushed=!1,void this._applyPosition(l.position,l.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(a.position,a.originPoint);this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&O(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(X),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;const t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const s=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,s)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,-1===t.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,s,e){let i,n;if("center"==e.originX)i=t.left+t.width/2;else{const a=this._isRtl()?t.right:t.left,l=this._isRtl()?t.left:t.right;i="start"==e.originX?a:l}return s.left<0&&(i-=s.left),n="center"==e.originY?t.top+t.height/2:"top"==e.originY?t.top:t.bottom,s.top<0&&(n-=s.top),{x:i,y:n}}_getOverlayPoint(t,s,e){let i,n;return i="center"==e.overlayX?-s.width/2:"start"===e.overlayX?this._isRtl()?-s.width:0:this._isRtl()?0:-s.width,n="center"==e.overlayY?-s.height/2:"top"==e.overlayY?0:-s.height,{x:t.x+i,y:t.y+n}}_getOverlayFit(t,s,e,i){const n=F(s);let{x:a,y:l}=t,c=this._getOffset(i,"x"),d=this._getOffset(i,"y");c&&(a+=c),d&&(l+=d);let v=0-l,g=l+n.height-e.height,u=this._subtractOverflows(n.width,0-a,a+n.width-e.width),y=this._subtractOverflows(n.height,v,g),I=u*y;return{visibleArea:I,isCompletelyWithinViewport:n.width*n.height===I,fitsInViewportVertically:y===n.height,fitsInViewportHorizontally:u==n.width}}_canFitWithFlexibleDimensions(t,s,e){if(this._hasFlexibleDimensions){const i=e.bottom-s.y,n=e.right-s.x,a=W(this._overlayRef.getConfig().minHeight),l=W(this._overlayRef.getConfig().minWidth);return(t.fitsInViewportVertically||null!=a&&a<=i)&&(t.fitsInViewportHorizontally||null!=l&&l<=n)}return!1}_pushOverlayOnScreen(t,s,e){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};const i=F(s),n=this._viewportRect,a=Math.max(t.x+i.width-n.width,0),l=Math.max(t.y+i.height-n.height,0),c=Math.max(n.top-e.top-t.y,0),d=Math.max(n.left-e.left-t.x,0);let h=0,_=0;return h=i.width<=n.width?d||-a:t.x<this._viewportMargin?n.left-e.left-t.x:0,_=i.height<=n.height?c||-l:t.y<this._viewportMargin?n.top-e.top-t.y:0,this._previousPushAmount={x:h,y:_},{x:t.x+h,y:t.y+_}}_applyPosition(t,s){if(this._setTransformOrigin(t),this._setOverlayElementStyles(s,t),this._setBoundingBoxStyles(s,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._lastPosition=t,this._positionChanges.observers.length){const e=this._getScrollVisibility(),i=new et(t,e);this._positionChanges.next(i)}this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;const s=this._boundingBox.querySelectorAll(this._transformOriginSelector);let e,i=t.overlayY;e="center"===t.overlayX?"center":this._isRtl()?"start"===t.overlayX?"right":"left":"start"===t.overlayX?"left":"right";for(let n=0;n<s.length;n++)s[n].style.transformOrigin=`${e} ${i}`}_calculateBoundingBoxRect(t,s){const e=this._viewportRect,i=this._isRtl();let n,a,l,h,_,v;if("top"===s.overlayY)a=t.y,n=e.height-a+this._viewportMargin;else if("bottom"===s.overlayY)l=e.height-t.y+2*this._viewportMargin,n=e.height-l+this._viewportMargin;else{const g=Math.min(e.bottom-t.y+e.top,t.y),u=this._lastBoundingBoxSize.height;n=2*g,a=t.y-g,n>u&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-u/2)}if("end"===s.overlayX&&!i||"start"===s.overlayX&&i)v=e.width-t.x+this._viewportMargin,h=t.x-this._viewportMargin;else if("start"===s.overlayX&&!i||"end"===s.overlayX&&i)_=t.x,h=e.right-t.x;else{const g=Math.min(e.right-t.x+e.left,t.x),u=this._lastBoundingBoxSize.width;h=2*g,_=t.x-g,h>u&&!this._isInitialRender&&!this._growAfterOpen&&(_=t.x-u/2)}return{top:a,left:_,bottom:l,right:v,width:h,height:n}}_setBoundingBoxStyles(t,s){const e=this._calculateBoundingBoxRect(t,s);!this._isInitialRender&&!this._growAfterOpen&&(e.height=Math.min(e.height,this._lastBoundingBoxSize.height),e.width=Math.min(e.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const n=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;i.height=(0,f.ph)(e.height),i.top=(0,f.ph)(e.top),i.bottom=(0,f.ph)(e.bottom),i.width=(0,f.ph)(e.width),i.left=(0,f.ph)(e.left),i.right=(0,f.ph)(e.right),i.alignItems="center"===s.overlayX?"center":"end"===s.overlayX?"flex-end":"flex-start",i.justifyContent="center"===s.overlayY?"center":"bottom"===s.overlayY?"flex-end":"flex-start",n&&(i.maxHeight=(0,f.ph)(n)),a&&(i.maxWidth=(0,f.ph)(a))}this._lastBoundingBoxSize=e,O(this._boundingBox.style,i)}_resetBoundingBoxStyles(){O(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){O(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,s){const e={},i=this._hasExactPosition(),n=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(i){const h=this._viewportRuler.getViewportScrollPosition();O(e,this._getExactOverlayY(s,t,h)),O(e,this._getExactOverlayX(s,t,h))}else e.position="static";let l="",c=this._getOffset(s,"x"),d=this._getOffset(s,"y");c&&(l+=`translateX(${c}px) `),d&&(l+=`translateY(${d}px)`),e.transform=l.trim(),a.maxHeight&&(i?e.maxHeight=(0,f.ph)(a.maxHeight):n&&(e.maxHeight="")),a.maxWidth&&(i?e.maxWidth=(0,f.ph)(a.maxWidth):n&&(e.maxWidth="")),O(this._pane.style,e)}_getExactOverlayY(t,s,e){let i={top:"",bottom:""},n=this._getOverlayPoint(s,this._overlayRect,t);return this._isPushed&&(n=this._pushOverlayOnScreen(n,this._overlayRect,e)),"bottom"===t.overlayY?i.bottom=this._document.documentElement.clientHeight-(n.y+this._overlayRect.height)+"px":i.top=(0,f.ph)(n.y),i}_getExactOverlayX(t,s,e){let a,i={left:"",right:""},n=this._getOverlayPoint(s,this._overlayRect,t);return this._isPushed&&(n=this._pushOverlayOnScreen(n,this._overlayRect,e)),a=this._isRtl()?"end"===t.overlayX?"left":"right":"end"===t.overlayX?"right":"left","right"===a?i.right=this._document.documentElement.clientWidth-(n.x+this._overlayRect.width)+"px":i.left=(0,f.ph)(n.x),i}_getScrollVisibility(){const t=this._getOriginRect(),s=this._pane.getBoundingClientRect(),e=this._scrollables.map(i=>i.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:L(t,e),isOriginOutsideView:P(t,e),isOverlayClipped:L(s,e),isOverlayOutsideView:P(s,e)}}_subtractOverflows(t,...s){return s.reduce((e,i)=>e-Math.max(i,0),t)}_getNarrowedViewportRect(){const t=this._document.documentElement.clientWidth,s=this._document.documentElement.clientHeight,e=this._viewportRuler.getViewportScrollPosition();return{top:e.top+this._viewportMargin,left:e.left+this._viewportMargin,right:e.left+t-this._viewportMargin,bottom:e.top+s-this._viewportMargin,width:t-2*this._viewportMargin,height:s-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,s){return"x"===s?null==t.offsetX?this._offsetX:t.offsetX:null==t.offsetY?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&(0,f.Mt)(t).forEach(s=>{""!==s&&-1===this._appliedPanelClasses.indexOf(s)&&(this._appliedPanelClasses.push(s),this._pane.classList.add(s))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){const t=this._origin;if(t instanceof r.GMv)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();const s=t.width||0,e=t.height||0;return{top:t.y,bottom:t.y+e,left:t.x,right:t.x+s,height:e,width:s}}}function O(o,t){for(let s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);return o}function W(o){if("number"!=typeof o&&null!=o){const[t,s]=o.split(nt);return s&&"px"!==s?null:parseFloat(t)}return o||null}function F(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}const H="cdk-global-overlay-wrapper";class at{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(t){const s=t.getConfig();this._overlayRef=t,this._width&&!s.width&&t.updateSize({width:this._width}),this._height&&!s.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(H),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const t=this._overlayRef.overlayElement.style,s=this._overlayRef.hostElement.style,e=this._overlayRef.getConfig(),{width:i,height:n,maxWidth:a,maxHeight:l}=e,c=!("100%"!==i&&"100vw"!==i||a&&"100%"!==a&&"100vw"!==a),d=!("100%"!==n&&"100vh"!==n||l&&"100%"!==l&&"100vh"!==l),h=this._xPosition,_=this._xOffset,v="rtl"===this._overlayRef.getConfig().direction;let g="",u="",y="";c?y="flex-start":"center"===h?(y="center",v?u=_:g=_):v?"left"===h||"end"===h?(y="flex-end",g=_):("right"===h||"start"===h)&&(y="flex-start",u=_):"left"===h||"start"===h?(y="flex-start",g=_):("right"===h||"end"===h)&&(y="flex-end",u=_),t.position=this._cssPosition,t.marginLeft=c?"0":g,t.marginTop=d?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=c?"0":u,s.justifyContent=y,s.alignItems=d?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const t=this._overlayRef.overlayElement.style,s=this._overlayRef.hostElement,e=s.style;s.classList.remove(H),e.justifyContent=e.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}}let lt=(()=>{var o;class t{constructor(e,i,n,a){this._viewportRuler=e,this._document=i,this._platform=n,this._overlayContainer=a}global(){return new at}flexibleConnectedTo(e){return new rt(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(S.S8),r.CoB(m.Ud),r.CoB(b.WU),r.CoB(A))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})(),ht=0,k=(()=>{var o;class t{constructor(e,i,n,a,l,c,d,h,_,v,g,u){this.scrollStrategies=e,this._overlayContainer=i,this._componentFactoryResolver=n,this._positionBuilder=a,this._keyboardDispatcher=l,this._injector=c,this._ngZone=d,this._document=h,this._directionality=_,this._location=v,this._outsideClickDispatcher=g,this._animationsModuleType=u}create(e){const i=this._createHostElement(),n=this._createPaneElement(i),a=this._createPortalOutlet(n),l=new R(e);return l.direction=l.direction||this._directionality.value,new ot(a,i,n,l,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,"NoopAnimations"===this._animationsModuleType)}position(){return this._positionBuilder}_createPaneElement(e){const i=this._document.createElement("div");return i.id="cdk-overlay-"+ht++,i.classList.add("cdk-overlay-pane"),e.appendChild(i),i}_createHostElement(){const e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}_createPortalOutlet(e){return this._appRef||(this._appRef=this._injector.get(r.Swk)),new x.S4(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return(o=t).\u0275fac=function(e){return new(e||o)(r.CoB(tt),r.CoB(A),r.CoB(r.ce5),r.CoB(lt),r.CoB(it),r.CoB(r.zZn),r.CoB(r.WW2),r.CoB(m.Ud),r.CoB(E.yG),r.CoB(m.oB),r.CoB(st),r.CoB(r.qwP,8))},o.\u0275prov=r.wxM({token:o,factory:o.\u0275fac,providedIn:"root"}),t})();const ct=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],N=new r.UbH("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{const o=(0,r.uUt)(k);return()=>o.scrollStrategies.reposition()}});let T=(()=>{var o;class t{constructor(e){this.elementRef=e}}return(o=t).\u0275fac=function(e){return new(e||o)(r.GI1(r.GMv))},o.\u0275dir=r.Sc5({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"],standalone:!0}),t})(),dt=(()=>{var o;class t{get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}constructor(e,i,n,a,l){this._overlay=e,this._dir=l,this._backdropSubscription=w.wH.EMPTY,this._attachSubscription=w.wH.EMPTY,this._detachSubscription=w.wH.EMPTY,this._positionSubscription=w.wH.EMPTY,this._disposeOnNavigation=!1,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.hasBackdrop=!1,this.lockPosition=!1,this.flexibleDimensions=!1,this.growAfterOpen=!1,this.push=!1,this.backdropClick=new r._w7,this.positionChange=new r._w7,this.attach=new r._w7,this.detach=new r._w7,this.overlayKeydown=new r._w7,this.overlayOutsideClick=new r._w7,this._templatePortal=new x.CC(i,n),this._scrollStrategyFactory=a,this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=ct);const e=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===D.UX&&!this.disableClose&&!(0,D.Yp)(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new R({direction:this._dir,positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){const i=this.positions.map(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.panelClass||void 0}));return e.setOrigin(this._getFlexibleConnectedPositionStrategyOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const e=this._overlay.position().flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());return this._updatePositionStrategy(e),e}_getFlexibleConnectedPositionStrategyOrigin(){return this.origin instanceof T?this.origin.elementRef:this.origin}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(function $(o,t=!1){return(0,U.i)((s,e)=>{let i=0;s.subscribe((0,G.e)(e,n=>{const a=o(n,i++);(a||t)&&e.next(n),!a&&e.complete()}))})}(()=>this.positionChange.observers.length>0)).subscribe(e=>{this.positionChange.emit(e),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return(o=t).\u0275fac=function(e){return new(e||o)(r.GI1(k),r.GI1(r.Yw2),r.GI1(r.y8U),r.GI1(N),r.GI1(E.yG,8))},o.\u0275dir=r.Sc5({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[r.Wk5.None,"cdkConnectedOverlayOrigin","origin"],positions:[r.Wk5.None,"cdkConnectedOverlayPositions","positions"],positionStrategy:[r.Wk5.None,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[r.Wk5.None,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[r.Wk5.None,"cdkConnectedOverlayOffsetY","offsetY"],width:[r.Wk5.None,"cdkConnectedOverlayWidth","width"],height:[r.Wk5.None,"cdkConnectedOverlayHeight","height"],minWidth:[r.Wk5.None,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[r.Wk5.None,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[r.Wk5.None,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[r.Wk5.None,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[r.Wk5.None,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[r.Wk5.None,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[r.Wk5.None,"cdkConnectedOverlayOpen","open"],disableClose:[r.Wk5.None,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[r.Wk5.None,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayHasBackdrop","hasBackdrop",r.cZD],lockPosition:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayLockPosition","lockPosition",r.cZD],flexibleDimensions:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",r.cZD],growAfterOpen:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",r.cZD],push:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayPush","push",r.cZD],disposeOnNavigation:[r.Wk5.HasDecoratorInputTransform,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",r.cZD]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],standalone:!0,features:[r.QJr,r.SYr]}),t})();const ft={provide:N,deps:[k],useFactory:function _t(o){return()=>o.scrollStrategies.reposition()}};let pt=(()=>{var o;class t{}return(o=t).\u0275fac=function(e){return new(e||o)},o.\u0275mod=r.a4G({type:o}),o.\u0275inj=r.s3X({providers:[k,ft],imports:[E.gN,x.g$,S.c$,S.c$]}),t})()}}]);
//# sourceMappingURL=default-node_modules_angular_cdk_fesm2022_overlay_mjs.31d23577918ea337.js.map