@momentum-design/components 0.120.5 → 0.120.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2572,7 +2572,7 @@
2572
2572
  border-top-right-radius: var(--mdc-popover-arrow-border-radius);
2573
2573
  border-bottom-left-radius: 100%;
2574
2574
  }
2575
- `,_f=[lT];var zl=V.constructTagName("popoverportal"),Fl=class extends K{connectedCallback(){super.connectedCallback(),this.ariaHidden="true",this.style.display="none"}disconnectedCallback(){var o;super.disconnectedCallback(),(o=this.onDisconnect)==null||o.call(this)}};var Vl=class{constructor(o){this.portalElement=null;this.disconnectAfterAppendTo=!1;this.arrowPixelChange=!1;this.popover=o}setupDelay(){try{let[o,t]=this.popover.delay.split(",").map(i=>{let a=parseInt(i,10);if(Number.isNaN(a)||a<0)throw new Error(`Invalid delay value: ${i}`);return a});return[o,t]}catch{return this.popover.delay="0,0",[0,0]}}setupHoverBridge(o){let t=this.popover.renderRoot.querySelector(".popover-hover-bridge");Object.assign(t.style,{top:"",left:"",right:"",bottom:""});let i=`calc(${this.popover.showArrow?"0.75rem + ":""}${this.popover.offset}px)`,a=this.popover.offsetHeight||0,d=this.popover.offsetWidth||0;if(t)switch(o.split("-")[0]){case"top":t.style.height=i,t.style.bottom=`calc(-1 * (${i}))`,t.style.left="50%",t.style.width=`${d}px`;break;case"left":t.style.height=`${a}px`,t.style.width=i,t.style.right=`calc(-1.5 * (${i}))`;break;case"right":t.style.height=`${a}px`,t.style.width=i,t.style.left=`calc(-0.5 * (${i}))`;break;case"bottom":default:t.style.height=i,t.style.top=`calc(-1 * (${i}))`,t.style.left="50%",t.style.width=`${d}px`;break}}setupAppendTo(){var o,t;if(this.popover.appendTo){let i=document.getElementById(this.popover.appendTo);i&&!Array.from(i.children).includes(this.popover)&&(this.disconnectAfterAppendTo=!0,this.portalElement=document.createElement(zl),this.portalElement.onDisconnect=()=>{this.popover.remove(),this.portalElement=null},(t=(o=this.popover.parentElement)==null?void 0:o.appendChild)==null||t.call(o,this.portalElement),i.appendChild(this.popover))}}cleanupAppendTo(){!this.disconnectAfterAppendTo&&this.portalElement&&this.portalElement.remove(),this.disconnectAfterAppendTo=!1}updateAriaLabels(){var o,t,i;this.popover.interactive&&this.popover.role&&(this.popover.ariaLabel||(this.popover.ariaLabel=((o=this.popover.triggerElement)==null?void 0:o.ariaLabel)||((t=this.popover.triggerElement)==null?void 0:t.textContent)||""),this.popover.ariaLabelledby||(this.popover.ariaLabelledby=((i=this.popover.triggerElement)==null?void 0:i.id)||""))}updateAriaModal(){this.popover.role===et.DIALOG||this.popover.role===et.ALERTDIALOG?this.popover.setAttribute("aria-modal","true"):this.popover.removeAttribute("aria-modal")}updateAriaExpandedAttribute(){var o,t,i;this.popover.disableAriaExpanded||((o=this.popover.triggerElement)==null||o.setAttribute("aria-expanded",`${this.popover.visible}`),(i=this.popover.triggerElement)==null||i.setAttribute("aria-haspopup",((t=this.popover.triggerElement)==null?void 0:t.getAttribute("aria-haspopup"))||this.popover.role||"dialog"))}updateArrowStyle(o,t){var W;if(!this.popover.arrowElement)return;let i=t.split("-")[0],a={top:"bottom",right:"left",bottom:"top",left:"right"}[i],{x:d,y:m}=o,b=this.popover.arrowElement.getBoundingClientRect(),C=(W=this.popover.arrowElement.offsetParent)==null?void 0:W.getBoundingClientRect();if(!this.arrowPixelChange){let q=C!=null&&C[a]?12-Math.abs(b[a]-C[a]):0;Math.round(q)===1?this.arrowPixelChange=!0:this.arrowPixelChange=!1}let L=this.arrowPixelChange?.5:0;this.popover.arrowElement.setAttribute("data-side",i),Object.assign(this.popover.arrowElement.style,{left:d!=null?`${d}px`:"",top:m!=null?`${m}px`:"",[a]:`${-this.popover.arrowElement.offsetHeight/2-L}px`})}updatePopoverStyle(o,t){Object.assign(this.popover.style,{left:`${o}px`,top:`${t}px`})}};var It=class extends ul(cl(dl(K))){constructor(){super();this.id="";this.triggerID="";this.trigger=_t.TRIGGER;this.placement=_t.PLACEMENT;this.color=_t.COLOR;this.visible=_t.VISIBLE;this.offset=_t.OFFSET;this.boundary=_t.BOUNDARY;this.boundaryRoot=_t.BOUNDARY_ROOT;this.focusTrap=_t.FOCUS_TRAP;this.preventScroll=_t.PREVENT_SCROLL;this.showArrow=_t.ARROW;this.closeButton=_t.CLOSE_BUTTON;this.interactive=_t.INTERACTIVE;this.delay=_t.DELAY;this.hideOnEscape=_t.HIDE_ON_ESCAPE;this.propagateEventOnEscape=_t.PROPAGATE_EVENT_ON_ESCAPE;this.hideOnBlur=_t.HIDE_ON_BLUR;this.hideOnOutsideClick=_t.HIDE_ON_CLICK_OUTSIDE;this.focusBackToTrigger=_t.FOCUS_BACK;this.backdrop=_t.BACKDROP;this.isBackdropInvisible=_t.IS_BACKDROP_INVISIBLE;this.flip=_t.FLIP;this.size=_t.SIZE;this.zIndex=_t.Z_INDEX;this.closeButtonAriaLabel=null;this.strategy=_t.STRATEGY;this.role=_t.ROLE;this.ariaLabelledby=null;this.ariaDescribedby=null;this.disableAriaExpanded=_t.DISABLE_ARIA_EXPANDED;this.keepConnectedTooltipClosed=_t.KEEP_CONNECTED_TOOLTIP_CLOSED;this.arrowElement=null;this.hoverTimer=null;this.isHovered=!1;this.openDelay=0;this.closeDelay=0;this.floatingUICleanupFunction=null;this.shouldSuppressOpening=!1;this.parseTrigger=()=>{var d;let a=(((d=this.trigger)==null?void 0:d.split(" "))||[]).filter(m=>Object.values(di).includes(m)).length>0?this.trigger:_t.TRIGGER;a==="mouseenter"&&(this.interactive?a="mouseenter click":a="mouseenter focusin"),this.trigger=a};this.setupTriggerListeners=()=>{if(this.trigger.includes("click")&&document.addEventListener("click",this.togglePopoverVisible,{capture:!0}),this.trigger.includes("mouseenter")){let t=this.renderRoot.querySelector(".popover-hover-bridge");t==null||t.addEventListener("mouseenter",this.show),document.addEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.addEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.addEventListener("mouseenter",this.cancelCloseDelay),this.addEventListener("mouseleave",this.startCloseDelay)}this.trigger.includes("focusin")&&(document.addEventListener("focusin",this.handleFocusIn,{capture:!0}),this.interactive||document.addEventListener("focusout",this.handleFocusOut,{capture:!0}))};this.removeTriggerListeners=()=>{document.removeEventListener("click",this.togglePopoverVisible,{capture:!0});let t=this.renderRoot.querySelector(".popover-hover-bridge");t==null||t.removeEventListener("mouseenter",this.show),document.removeEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.removeEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.removeEventListener("mouseenter",this.cancelCloseDelay),this.removeEventListener("mouseleave",this.startCloseDelay),document.removeEventListener("focusin",this.handleFocusIn,{capture:!0}),document.removeEventListener("focusout",this.handleFocusOut,{capture:!0})};this.removeAllListeners=()=>{this.removeTriggerListeners(),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown,{capture:!0})),this.hideOnBlur&&this.removeEventListener("focusout",this.onPopoverFocusOut)};this.onOutsidePopoverClick=t=>{if(Ie.peek()!==this)return;let i=t.composedPath(),a=this.contains(t.target)||i.includes(this.triggerElement)||i.includes(this),d=this.backdropElement?i.includes(this.backdropElement):!1;(!a||d)&&(this.hide(),ci.onClickOutside(this))};this.onEscapeKeydown=t=>{!this.visible||t.code!=="Escape"||(this.propagateEventOnEscape||t.stopPropagation(),t.preventDefault(),this.hide(),ci.onEscapeKeyPressed(this))};this.onPopoverFocusOut=t=>{this.contains(t.relatedTarget)||this.hide()};this.handleMouseEnter=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!0,this.show())};this.handleMouseLeave=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!1,this.startCloseDelay())};this.handleFocusOut=t=>{this.isEventFromTrigger(t)&&(this.isHovered||this.hide())};this.handleFocusIn=t=>{var i;this.isEventFromTrigger(t)&&((i=this.triggerElement)!=null&&i.matches(":focus-visible")||this.isHovered)&&this.show()};this.startCloseDelay=()=>{this.interactive?this.hoverTimer=window.setTimeout(()=>{this.visible=!1},this.closeDelay):this.hide()};this.cancelCloseDelay=()=>{this.hoverTimer&&(window.clearTimeout(this.hoverTimer),this.hoverTimer=null)};this.show=()=>{this.visible||this.shouldSuppressOpening||(this.cancelCloseDelay(),this.openDelay>0?setTimeout(()=>{this.visible=!0},this.openDelay):this.visible=!0)};this.hide=()=>{this.closeDelay?setTimeout(()=>{this.visible=!1},this.closeDelay):this.visible=!1};this.togglePopoverVisible=t=>{this.isEventFromTrigger(t)&&(this.visible?this.hide():this.show())};this.positionPopover=()=>{let{triggerElement:t}=this;if(!t)return;let i=!this.boundary||this.boundary==="clippingAncestors"?"clippingAncestors":Array.from(document.querySelectorAll(this.boundary)),a=this.boundaryRoot,d=[yf({boundary:i,rootBoundary:a,padding:this.boundaryPadding})],m=this.offset;if(this.flip&&d.push(Ef({boundary:i,rootBoundary:a})),this.size){let b=L=>{this.style.setProperty("--mdc-popover-internal-available-height",`${L}px`)},C=this.renderRoot.querySelector('[part="popover-content"]');d.push(Tf({boundary:i,rootBoundary:a,apply({availableHeight:L}){C&&(Object.assign(C.style,{maxHeight:`${L}px`,overflowY:"auto"}),b(L))},padding:50}))}if(this.showArrow&&(this.arrowElement=this.renderRoot.querySelector('div[part="popover-arrow"]'),this.arrowElement)){let b=this.arrowElement.offsetHeight,C=Math.sqrt(2*b**2)/2;m+=C,d.push(xf({element:this.arrowElement,padding:12}))}d.push(bf(m)),this.floatingUICleanupFunction=gf(t,this,async()=>{let{triggerElement:b}=this;if(!b)return;let{x:C,y:L,middlewareData:W,placement:q}=await Af(b,this,{placement:this.placement,middleware:d,strategy:this.strategy});this.utils.updatePopoverStyle(C,L),W.arrow&&this.arrowElement&&this.utils.updateArrowStyle(W.arrow,q),this.trigger.includes("mouseenter")&&this.interactive&&this.utils.setupHoverBridge(q)})};this.utils=new Vl(this),this.parseTrigger(),[this.openDelay,this.closeDelay]=this.utils.setupDelay()}get connectedTooltip(){let t=this.getRootNode().querySelectorAll(`mdc-tooltip[triggerID="${this.triggerID}"]`);return Array.from(t).find(i=>i!==this)}get triggerElement(){return this.getRootNode().querySelector(`[id="${this.triggerID}"]`)}async firstUpdated(t){super.firstUpdated(t),ci.onCreatedPopover(this)}connectedCallback(){super.connectedCallback(),this.style.zIndex=`${this.zIndex}`,this.utils.setupAppendTo(),this.setupTriggerListeners()}async disconnectedCallback(){var t,i;super.disconnectedCallback(),this.removeAllListeners(),(t=this.deactivateFocusTrap)==null||t.call(this),this.deactivatePreventScroll(),this.moveElementBackAfterBackdropRemoval(this.triggerElement),this.removeBackdrop(),(i=this.floatingUICleanupFunction)==null||i.call(this),this.cancelCloseDelay(),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),this.utils.cleanupAppendTo(),ci.onDestroyedPopover(this),Ie.remove(this)}async updated(t){if(super.updated(t),t.has("visible")){let i=t.get("visible")||!1;await this.isOpenUpdated(i,this.visible),this.utils.updateAriaExpandedAttribute()}t.has("trigger")&&(this.parseTrigger(),this.removeTriggerListeners(),this.setupTriggerListeners()),t.has("placement")&&this.setAttribute("placement",Object.values(Yt).includes(this.placement)?this.placement:_t.PLACEMENT),t.has("delay")&&([this.openDelay,this.closeDelay]=this.utils.setupDelay()),t.has("color")&&this.setAttribute("color",Object.values(Eo).includes(this.color)?this.color:_t.COLOR),t.has("zIndex")&&this.setAttribute("z-index",`${this.zIndex}`),t.has("appendTo")&&(this.appendTo?this.utils.setupAppendTo():this.utils.cleanupAppendTo()),(t.has("interactive")||t.has("aria-label")||t.has("aria-labelledby"))&&this.utils.updateAriaLabels(),t.has("role")&&(this.role===""&&(this.role=null),this.utils.updateAriaModal()),t.has("disableAriaExpanded")&&this.utils.updateAriaExpandedAttribute(),t.has("focusTrap")&&!this.focusTrap&&this.visible&&this.deactivateFocusTrap(),t.has("preventScroll")&&(!this.preventScroll&&this.visible?this.deactivatePreventScroll():this.preventScroll&&this.visible&&this.activatePreventScroll())}async isOpenUpdated(t,i){var d,m;let{triggerElement:a}=this;t===i||!a||(i&&!this.shouldSuppressOpening?(Ie.peek()!==this&&Ie.push(this),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.visible=!1,this.connectedTooltip.shouldSuppressOpening=!0),this.backdrop&&!this.backdropElement&&(this.createBackdrop("popover"),this.keepElementAboveBackdrop(a)),this.positionPopover(),this.hideOnBlur&&(this.addEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(a.style.pointerEvents="none")),this.hideOnEscape&&(this.addEventListener("keydown",this.onEscapeKeydown),document.addEventListener("keydown",this.onEscapeKeydown)),this.activatePreventScroll(),this.hideOnOutsideClick&&document.addEventListener("click",this.onOutsidePopoverClick,{capture:!0}),setTimeout(()=>{var b,C;this.interactive&&this.focusTrap&&((b=this.activateFocusTrap)==null||b.call(this),(C=this.setInitialFocus)==null||C.call(this))},0),ci.onShowPopover(this)):(Ie.peek()===this&&Ie.pop(),(d=this.floatingUICleanupFunction)==null||d.call(this),this.backdrop&&(this.moveElementBackAfterBackdropRemoval(a),this.removeBackdrop()),this.hideOnBlur&&(this.removeEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(a.style.pointerEvents="")),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.deactivatePreventScroll(),(m=this.deactivateFocusTrap)==null||m.call(this),this.focusBackToTrigger&&(a==null||a.focus()),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),ci.onHidePopover(this)))}isEventFromTrigger(t){var i;return this.triggerID?t.composed?t.composedPath().some(a=>(a==null?void 0:a.id)===this.triggerID):((i=t.target)==null?void 0:i.id)===this.triggerID:!1}render(){return _`
2575
+ `,_f=[lT];var zl=V.constructTagName("popoverportal"),Fl=class extends K{connectedCallback(){super.connectedCallback(),this.ariaHidden="true",this.style.display="none"}disconnectedCallback(){var o;super.disconnectedCallback(),(o=this.onDisconnect)==null||o.call(this)}};var Vl=class{constructor(o){this.portalElement=null;this.disconnectAfterAppendTo=!1;this.arrowPixelChange=!1;this.popover=o}setupDelay(){try{let[o,t]=this.popover.delay.split(",").map(i=>{let a=parseInt(i,10);if(Number.isNaN(a)||a<0)throw new Error(`Invalid delay value: ${i}`);return a});return[o,t]}catch{return this.popover.delay="0,0",[0,0]}}setupHoverBridge(o){let t=this.popover.renderRoot.querySelector('div[part="popover-hover-bridge"]');Object.assign(t.style,{top:"",left:"",right:"",bottom:""});let i=`calc(${this.popover.showArrow?"0.75rem + ":""}${this.popover.offset}px)`,a=this.popover.offsetHeight||0,d=this.popover.offsetWidth||0;if(t)switch(o.split("-")[0]){case"top":t.style.height=i,t.style.bottom=`calc(-1 * (${i}))`,t.style.left="50%",t.style.width=`${d}px`;break;case"left":t.style.height=`${a}px`,t.style.width=i,t.style.right=`calc(-1.5 * (${i}))`;break;case"right":t.style.height=`${a}px`,t.style.width=i,t.style.left=`calc(-0.5 * (${i}))`;break;case"bottom":default:t.style.height=i,t.style.top=`calc(-1 * (${i}))`,t.style.left="50%",t.style.width=`${d}px`;break}}setupAppendTo(){var o,t;if(this.popover.appendTo){let i=document.getElementById(this.popover.appendTo);i&&!Array.from(i.children).includes(this.popover)&&(this.disconnectAfterAppendTo=!0,this.portalElement=document.createElement(zl),this.portalElement.onDisconnect=()=>{this.popover.remove(),this.portalElement=null},(t=(o=this.popover.parentElement)==null?void 0:o.appendChild)==null||t.call(o,this.portalElement),i.appendChild(this.popover))}}cleanupAppendTo(){!this.disconnectAfterAppendTo&&this.portalElement&&this.portalElement.remove(),this.disconnectAfterAppendTo=!1}updateAriaLabels(){var o,t,i;this.popover.interactive&&this.popover.role&&(this.popover.ariaLabel||(this.popover.ariaLabel=((o=this.popover.triggerElement)==null?void 0:o.ariaLabel)||((t=this.popover.triggerElement)==null?void 0:t.textContent)||""),this.popover.ariaLabelledby||(this.popover.ariaLabelledby=((i=this.popover.triggerElement)==null?void 0:i.id)||""))}updateAriaModal(){this.popover.role===et.DIALOG||this.popover.role===et.ALERTDIALOG?this.popover.setAttribute("aria-modal","true"):this.popover.removeAttribute("aria-modal")}updateAriaExpandedAttribute(){var o,t,i;this.popover.disableAriaExpanded||((o=this.popover.triggerElement)==null||o.setAttribute("aria-expanded",`${this.popover.visible}`),(i=this.popover.triggerElement)==null||i.setAttribute("aria-haspopup",((t=this.popover.triggerElement)==null?void 0:t.getAttribute("aria-haspopup"))||this.popover.role||"dialog"))}updateArrowStyle(o,t){var W;if(!this.popover.arrowElement)return;let i=t.split("-")[0],a={top:"bottom",right:"left",bottom:"top",left:"right"}[i],{x:d,y:m}=o,b=this.popover.arrowElement.getBoundingClientRect(),C=(W=this.popover.arrowElement.offsetParent)==null?void 0:W.getBoundingClientRect();if(!this.arrowPixelChange){let q=C!=null&&C[a]?12-Math.abs(b[a]-C[a]):0;Math.round(q)===1?this.arrowPixelChange=!0:this.arrowPixelChange=!1}let L=this.arrowPixelChange?.5:0;this.popover.arrowElement.setAttribute("data-side",i),Object.assign(this.popover.arrowElement.style,{left:d!=null?`${d}px`:"",top:m!=null?`${m}px`:"",[a]:`${-this.popover.arrowElement.offsetHeight/2-L}px`})}updatePopoverStyle(o,t){Object.assign(this.popover.style,{left:`${o}px`,top:`${t}px`})}};var It=class extends ul(cl(dl(K))){constructor(){super();this.id="";this.triggerID="";this.trigger=_t.TRIGGER;this.placement=_t.PLACEMENT;this.color=_t.COLOR;this.visible=_t.VISIBLE;this.offset=_t.OFFSET;this.boundary=_t.BOUNDARY;this.boundaryRoot=_t.BOUNDARY_ROOT;this.focusTrap=_t.FOCUS_TRAP;this.preventScroll=_t.PREVENT_SCROLL;this.showArrow=_t.ARROW;this.closeButton=_t.CLOSE_BUTTON;this.interactive=_t.INTERACTIVE;this.delay=_t.DELAY;this.hideOnEscape=_t.HIDE_ON_ESCAPE;this.propagateEventOnEscape=_t.PROPAGATE_EVENT_ON_ESCAPE;this.hideOnBlur=_t.HIDE_ON_BLUR;this.hideOnOutsideClick=_t.HIDE_ON_CLICK_OUTSIDE;this.focusBackToTrigger=_t.FOCUS_BACK;this.backdrop=_t.BACKDROP;this.isBackdropInvisible=_t.IS_BACKDROP_INVISIBLE;this.flip=_t.FLIP;this.size=_t.SIZE;this.zIndex=_t.Z_INDEX;this.closeButtonAriaLabel=null;this.strategy=_t.STRATEGY;this.role=_t.ROLE;this.ariaLabelledby=null;this.ariaDescribedby=null;this.disableAriaExpanded=_t.DISABLE_ARIA_EXPANDED;this.keepConnectedTooltipClosed=_t.KEEP_CONNECTED_TOOLTIP_CLOSED;this.arrowElement=null;this.hoverTimer=null;this.isHovered=!1;this.openDelay=0;this.closeDelay=0;this.floatingUICleanupFunction=null;this.shouldSuppressOpening=!1;this.parseTrigger=()=>{var d;let a=(((d=this.trigger)==null?void 0:d.split(" "))||[]).filter(m=>Object.values(di).includes(m)).length>0?this.trigger:_t.TRIGGER;a==="mouseenter"&&(this.interactive?a="mouseenter click":a="mouseenter focusin"),this.trigger=a};this.setupTriggerListeners=()=>{if(this.trigger.includes("click")&&document.addEventListener("click",this.togglePopoverVisible,{capture:!0}),this.trigger.includes("mouseenter")){let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.addEventListener("mouseenter",this.show),document.addEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.addEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.addEventListener("mouseenter",this.cancelCloseDelay),this.addEventListener("mouseleave",this.startCloseDelay)}this.trigger.includes("focusin")&&(document.addEventListener("focusin",this.handleFocusIn,{capture:!0}),this.interactive||document.addEventListener("focusout",this.handleFocusOut,{capture:!0}))};this.removeTriggerListeners=()=>{document.removeEventListener("click",this.togglePopoverVisible,{capture:!0});let t=this.renderRoot.querySelector('div[part="popover-hover-bridge"]');t==null||t.removeEventListener("mouseenter",this.show),document.removeEventListener("mouseenter",this.handleMouseEnter,{capture:!0}),document.removeEventListener("mouseleave",this.handleMouseLeave,{capture:!0}),this.removeEventListener("mouseenter",this.cancelCloseDelay),this.removeEventListener("mouseleave",this.startCloseDelay),document.removeEventListener("focusin",this.handleFocusIn,{capture:!0}),document.removeEventListener("focusout",this.handleFocusOut,{capture:!0})};this.removeAllListeners=()=>{this.removeTriggerListeners(),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown,{capture:!0})),this.hideOnBlur&&this.removeEventListener("focusout",this.onPopoverFocusOut)};this.onOutsidePopoverClick=t=>{if(Ie.peek()!==this)return;let i=t.composedPath(),a=this.contains(t.target)||i.includes(this.triggerElement)||i.includes(this),d=this.backdropElement?i.includes(this.backdropElement):!1;(!a||d)&&(this.hide(),ci.onClickOutside(this))};this.onEscapeKeydown=t=>{!this.visible||t.code!=="Escape"||(this.propagateEventOnEscape||t.stopPropagation(),t.preventDefault(),this.hide(),ci.onEscapeKeyPressed(this))};this.onPopoverFocusOut=t=>{this.contains(t.relatedTarget)||this.hide()};this.handleMouseEnter=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!0,this.show())};this.handleMouseLeave=t=>{this.isEventFromTrigger(t)&&(this.isHovered=!1,this.startCloseDelay())};this.handleFocusOut=t=>{this.isEventFromTrigger(t)&&(this.isHovered||this.hide())};this.handleFocusIn=t=>{var i;this.isEventFromTrigger(t)&&((i=this.triggerElement)!=null&&i.matches(":focus-visible")||this.isHovered)&&this.show()};this.startCloseDelay=()=>{this.interactive?this.hoverTimer=window.setTimeout(()=>{this.visible=!1},this.closeDelay):this.hide()};this.cancelCloseDelay=()=>{this.hoverTimer&&(window.clearTimeout(this.hoverTimer),this.hoverTimer=null)};this.show=()=>{this.visible||this.shouldSuppressOpening||(this.cancelCloseDelay(),this.openDelay>0?setTimeout(()=>{this.visible=!0},this.openDelay):this.visible=!0)};this.hide=()=>{this.closeDelay?setTimeout(()=>{this.visible=!1},this.closeDelay):this.visible=!1};this.togglePopoverVisible=t=>{this.isEventFromTrigger(t)&&(this.visible?this.hide():this.show())};this.positionPopover=()=>{let{triggerElement:t}=this;if(!t)return;let i=!this.boundary||this.boundary==="clippingAncestors"?"clippingAncestors":Array.from(document.querySelectorAll(this.boundary)),a=this.boundaryRoot,d=[yf({boundary:i,rootBoundary:a,padding:this.boundaryPadding})],m=this.offset;if(this.flip&&d.push(Ef({boundary:i,rootBoundary:a})),this.size){let b=L=>{this.style.setProperty("--mdc-popover-internal-available-height",`${L}px`)},C=this.renderRoot.querySelector('[part="popover-content"]');d.push(Tf({boundary:i,rootBoundary:a,apply({availableHeight:L}){C&&(Object.assign(C.style,{maxHeight:`${L}px`,overflowY:"auto"}),b(L))},padding:50}))}if(this.showArrow&&(this.arrowElement=this.renderRoot.querySelector('div[part="popover-arrow"]'),this.arrowElement)){let b=this.arrowElement.offsetHeight,C=Math.sqrt(2*b**2)/2;m+=C,d.push(xf({element:this.arrowElement,padding:12}))}d.push(bf(m)),this.floatingUICleanupFunction=gf(t,this,async()=>{let{triggerElement:b}=this;if(!b)return;let{x:C,y:L,middlewareData:W,placement:q}=await Af(b,this,{placement:this.placement,middleware:d,strategy:this.strategy});this.utils.updatePopoverStyle(C,L),W.arrow&&this.arrowElement&&this.utils.updateArrowStyle(W.arrow,q),this.trigger.includes("mouseenter")&&this.utils.setupHoverBridge(q)})};this.utils=new Vl(this),this.parseTrigger(),[this.openDelay,this.closeDelay]=this.utils.setupDelay()}get connectedTooltip(){let t=this.getRootNode().querySelectorAll(`mdc-tooltip[triggerID="${this.triggerID}"]`);return Array.from(t).find(i=>i!==this)}get triggerElement(){return this.getRootNode().querySelector(`[id="${this.triggerID}"]`)}async firstUpdated(t){super.firstUpdated(t),ci.onCreatedPopover(this)}connectedCallback(){super.connectedCallback(),this.style.zIndex=`${this.zIndex}`,this.utils.setupAppendTo(),this.setupTriggerListeners()}async disconnectedCallback(){var t,i;super.disconnectedCallback(),this.removeAllListeners(),(t=this.deactivateFocusTrap)==null||t.call(this),this.deactivatePreventScroll(),this.moveElementBackAfterBackdropRemoval(this.triggerElement),this.removeBackdrop(),(i=this.floatingUICleanupFunction)==null||i.call(this),this.cancelCloseDelay(),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),this.utils.cleanupAppendTo(),ci.onDestroyedPopover(this),Ie.remove(this)}async updated(t){if(super.updated(t),t.has("visible")){let i=t.get("visible")||!1;await this.isOpenUpdated(i,this.visible),this.utils.updateAriaExpandedAttribute()}t.has("trigger")&&(this.parseTrigger(),this.removeTriggerListeners(),this.setupTriggerListeners()),t.has("placement")&&this.setAttribute("placement",Object.values(Yt).includes(this.placement)?this.placement:_t.PLACEMENT),t.has("delay")&&([this.openDelay,this.closeDelay]=this.utils.setupDelay()),t.has("color")&&this.setAttribute("color",Object.values(Eo).includes(this.color)?this.color:_t.COLOR),t.has("zIndex")&&this.setAttribute("z-index",`${this.zIndex}`),t.has("appendTo")&&(this.appendTo?this.utils.setupAppendTo():this.utils.cleanupAppendTo()),(t.has("interactive")||t.has("aria-label")||t.has("aria-labelledby"))&&this.utils.updateAriaLabels(),t.has("role")&&(this.role===""&&(this.role=null),this.utils.updateAriaModal()),t.has("disableAriaExpanded")&&this.utils.updateAriaExpandedAttribute(),t.has("focusTrap")&&!this.focusTrap&&this.visible&&this.deactivateFocusTrap(),t.has("preventScroll")&&(!this.preventScroll&&this.visible?this.deactivatePreventScroll():this.preventScroll&&this.visible&&this.activatePreventScroll())}async isOpenUpdated(t,i){var d,m;let{triggerElement:a}=this;t===i||!a||(i&&!this.shouldSuppressOpening?(Ie.peek()!==this&&Ie.push(this),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.visible=!1,this.connectedTooltip.shouldSuppressOpening=!0),this.backdrop&&!this.backdropElement&&(this.createBackdrop("popover"),this.keepElementAboveBackdrop(a)),this.positionPopover(),this.hideOnBlur&&(this.addEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(a.style.pointerEvents="none")),this.hideOnEscape&&(this.addEventListener("keydown",this.onEscapeKeydown),document.addEventListener("keydown",this.onEscapeKeydown)),this.activatePreventScroll(),this.hideOnOutsideClick&&document.addEventListener("click",this.onOutsidePopoverClick,{capture:!0}),setTimeout(()=>{var b,C;this.interactive&&this.focusTrap&&((b=this.activateFocusTrap)==null||b.call(this),(C=this.setInitialFocus)==null||C.call(this))},0),ci.onShowPopover(this)):(Ie.peek()===this&&Ie.pop(),(d=this.floatingUICleanupFunction)==null||d.call(this),this.backdrop&&(this.moveElementBackAfterBackdropRemoval(a),this.removeBackdrop()),this.hideOnBlur&&(this.removeEventListener("focusout",this.onPopoverFocusOut),this.trigger==="click"&&(a.style.pointerEvents="")),this.hideOnOutsideClick&&document.removeEventListener("click",this.onOutsidePopoverClick,{capture:!0}),this.hideOnEscape&&(this.removeEventListener("keydown",this.onEscapeKeydown),document.removeEventListener("keydown",this.onEscapeKeydown)),this.deactivatePreventScroll(),(m=this.deactivateFocusTrap)==null||m.call(this),this.focusBackToTrigger&&(a==null||a.focus()),this.keepConnectedTooltipClosed&&this.connectedTooltip&&(this.connectedTooltip.shouldSuppressOpening=!1),ci.onHidePopover(this)))}isEventFromTrigger(t){var i;return this.triggerID?t.composed?t.composedPath().some(a=>(a==null?void 0:a.id)===this.triggerID):((i=t.target)==null?void 0:i.id)===this.triggerID:!1}render(){return _`
2576
2576
  <div part="popover-hover-bridge"></div>
2577
2577
  ${this.closeButton?_` <mdc-button
2578
2578
  part="popover-close"