balm-ui
Version:
A modular and customizable UI library based on Material Design and Vue 3
1 lines • 41.2 kB
JavaScript
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define("UiTooltip",["vue"],e):"object"===typeof exports?exports.UiTooltip=e(require("vue")):t.UiTooltip=e(t.Vue)}("undefined"!==typeof self?self:this,(function(t){return function(){"use strict";var e={744:function(t){var e=function(t){return function(t){return!!t&&"object"===typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===o}(t)}(t)};var o="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l((o=t,Array.isArray(o)?[]:{}),t,e):t;var o}function r(t,e,o){return t.concat(e).map((function(t){return n(t,o)}))}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function a(t,e){try{return e in t}catch(o){return!1}}function s(t,e,o){var r={};return o.isMergeableObject(t)&&i(t).forEach((function(e){r[e]=n(t[e],o)})),i(e).forEach((function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&o.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return l;var o=e.customMerge(t);return"function"===typeof o?o:l}(i,o)(t[i],e[i],o):r[i]=n(e[i],o))})),r}function l(t,o,i){(i=i||{}).arrayMerge=i.arrayMerge||r,i.isMergeableObject=i.isMergeableObject||e,i.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(o);return a===Array.isArray(t)?a?i.arrayMerge(t,o,i):s(t,o,i):n(o,i)}l.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,o){return l(t,o,e)}),{})};var c=l;t.exports=c},262:function(t,e){e.A=(t,e)=>{const o=t.__vccOpts||t;for(const[n,r]of e)o[n]=r;return o}},154:function(e){e.exports=t}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};n.d(r,{default:function(){return Qt}});var i=n(744),a=n.n(i);const s=/(?:^\[object\s(.*?)\]$)/;var l=t=>Object.prototype.toString.call(t).replace(s,"$1").toLowerCase();const c=t=>{let{componentProps:e,propName:o,props:n}=t,r=n[o];if("object"===l(r)){const t=e[o].default;e[o].default=()=>a()(t,r)}else Array.isArray(r)?e[o].default=()=>r:e[o].default=r},h=t=>{let{componentMixins:e,propName:o,props:n}=t;if(e.length){let t=e.length;for(;t--;)if(e[t].props&&void 0!==e[t].props[o]){c({componentProps:e[t].props,propName:o,props:n});break}}};var d=(t,e)=>{for(const o of Object.keys(e))t.props?void 0===t.props[o]?h({componentMixins:t.mixins,propName:o,props:e}):c({componentProps:t.props,propName:o,props:e}):h({componentMixins:t.mixins,propName:o,props:e})};var u=(t,e)=>{for(const o of Object.keys(e))if(/^Ui[A-Z]{1}[A-Za-z]+$/.test(o)){const n=t[o],r=e[o];d(n,r)}};var p=t=>{const e={install(e){u(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});for(let o in t){const n=t[o];e.component(n.name,n)}}};return e},f=n(154);const T={class:"mdc-tooltip-wrapper--rich"};var E={name:"UiTooltipAnchor"};var m=(0,n(262).A)(E,[["render",function(t,e,o,n,r,i){return(0,f.openBlock)(),(0,f.createElementBlock)("div",T,[(0,f.renderSlot)(t.$slots,"default")])}]]),y=function(t,e){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},y(t,e)};function v(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var g=function(){return g=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},g.apply(this,arguments)};Object.create;function O(t){var e="function"===typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var o="function"===typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){r={error:s}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return a}function S(t,e,o){if(o||2===arguments.length)for(var n,r=0,i=e.length;r<i;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var w,D=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),C=function(){function t(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];this.root=t,this.initialize.apply(this,S([],A(o))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new D({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,o){this.root.addEventListener(t,e,o)},t.prototype.unlisten=function(t,e,o){this.root.removeEventListener(t,e,o)},t.prototype.emit=function(t,e,o){var n;void 0===o&&(o=!1),"function"===typeof CustomEvent?n=new CustomEvent(t,{bubbles:o,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,o,!1,e),this.root.dispatchEvent(n)},t}();!function(t){t.RICH="mdc-tooltip--rich",t.SHOWN="mdc-tooltip--shown",t.SHOWING="mdc-tooltip--showing",t.SHOWING_TRANSITION="mdc-tooltip--showing-transition",t.HIDE="mdc-tooltip--hide",t.HIDE_TRANSITION="mdc-tooltip--hide-transition",t.MULTILINE_TOOLTIP="mdc-tooltip--multiline",t.SURFACE="mdc-tooltip__surface",t.SURFACE_ANIMATION="mdc-tooltip__surface-animation",t.TOOLTIP_CARET_TOP="mdc-tooltip__caret-surface-top",t.TOOLTIP_CARET_BOTTOM="mdc-tooltip__caret-surface-bottom"}(w||(w={}));var x,_,P,R=4,H=8,b=8,N=600,I=500,B=24,M=200,L=24,W=.8,V="aria-expanded",k="aria-haspopup",j="data-mdc-tooltip-persistent",F="data-mdc-tooltip-has-caret",z="MDCTooltip:hidden";!function(t){t[t.DETECTED=0]="DETECTED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END"}(x||(x={})),function(t){t[t.DETECTED=0]="DETECTED",t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"}(_||(_={})),function(t){t[t.BOUNDED=0]="BOUNDED",t[t.UNBOUNDED=1]="UNBOUNDED"}(P||(P={}));var U,q,G,$="left",Y="right",K="center",X="top",Z="bottom";!function(t){t[t.DETECTED=0]="DETECTED",t[t.ABOVE_START=1]="ABOVE_START",t[t.ABOVE_CENTER=2]="ABOVE_CENTER",t[t.ABOVE_END=3]="ABOVE_END",t[t.TOP_SIDE_START=4]="TOP_SIDE_START",t[t.CENTER_SIDE_START=5]="CENTER_SIDE_START",t[t.BOTTOM_SIDE_START=6]="BOTTOM_SIDE_START",t[t.TOP_SIDE_END=7]="TOP_SIDE_END",t[t.CENTER_SIDE_END=8]="CENTER_SIDE_END",t[t.BOTTOM_SIDE_END=9]="BOTTOM_SIDE_END",t[t.BELOW_START=10]="BELOW_START",t[t.BELOW_CENTER=11]="BELOW_CENTER",t[t.BELOW_END=12]="BELOW_END"}(U||(U={})),function(t){t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW",t[t.SIDE_TOP=3]="SIDE_TOP",t[t.SIDE_CENTER=4]="SIDE_CENTER",t[t.SIDE_BOTTOM=5]="SIDE_BOTTOM"}(q||(q={})),function(t){t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t[t.SIDE_START=4]="SIDE_START",t[t.SIDE_END=5]="SIDE_END"}(G||(G={}));var Q=function(){function t(){this.rafIDs=new Map}return t.prototype.request=function(t,e){var o=this;this.cancel(t);var n=requestAnimationFrame((function(n){o.rafIDs.delete(t),e(n)}));this.rafIDs.set(t,n)},t.prototype.cancel=function(t){var e=this.rafIDs.get(t);e&&(cancelAnimationFrame(e),this.rafIDs.delete(t))},t.prototype.cancelAll=function(){var t=this;this.rafIDs.forEach((function(e,o){t.cancel(o)}))},t.prototype.getQueue=function(){var t=[];return this.rafIDs.forEach((function(e,o){t.push(o)})),t},t}(),J={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};function tt(t){return Boolean(t.document)&&"function"===typeof t.document.createElement}function et(t,e){if(tt(t)&&e in J){var o=t.document.createElement("div"),n=J[e],r=n.standard,i=n.prefixed;return r in o.style?r:i}return e}var ot="Unknown",nt="Backspace",rt="Enter",it="Spacebar",at="PageUp",st="PageDown",lt="End",ct="Home",ht="ArrowLeft",dt="ArrowUp",ut="ArrowRight",pt="ArrowDown",ft="Delete",Tt="Escape",Et="Tab",mt=new Set;mt.add(nt),mt.add(rt),mt.add(it),mt.add(at),mt.add(st),mt.add(lt),mt.add(ct),mt.add(ht),mt.add(dt),mt.add(ut),mt.add(pt),mt.add(ft),mt.add(Tt),mt.add(Et);var yt=8,vt=13,gt=32,Ot=33,At=34,St=35,wt=36,Dt=37,Ct=38,xt=39,_t=40,Pt=46,Rt=27,Ht=9,bt=new Map;bt.set(yt,nt),bt.set(vt,rt),bt.set(gt,it),bt.set(Ot,at),bt.set(At,st),bt.set(St,lt),bt.set(wt,ct),bt.set(Dt,ht),bt.set(Ct,dt),bt.set(xt,ut),bt.set(_t,pt),bt.set(Pt,ft),bt.set(Rt,Tt),bt.set(Ht,Et);var Nt=new Set;function It(t){var e=t.key;if(mt.has(e))return e;var o=bt.get(t.keyCode);return o||ot}Nt.add(at),Nt.add(st),Nt.add(lt),Nt.add(ct),Nt.add(ht),Nt.add(dt),Nt.add(ut),Nt.add(pt);var Bt,Mt=w.RICH,Lt=w.SHOWN,Wt=w.SHOWING,Vt=w.SHOWING_TRANSITION,kt=w.HIDE,jt=w.HIDE_TRANSITION,Ft=w.MULTILINE_TOOLTIP;!function(t){t.POLL_ANCHOR="poll_anchor"}(Bt||(Bt={}));var zt="undefined"!==typeof window,Ut=function(t){function e(o){var n=t.call(this,g(g({},e.defaultAdapter),o))||this;return n.tooltipShown=!1,n.anchorGap=R,n.xTooltipPos=x.DETECTED,n.yTooltipPos=_.DETECTED,n.tooltipPositionWithCaret=U.DETECTED,n.minViewportTooltipThreshold=b,n.hideDelayMs=N,n.showDelayMs=I,n.anchorRect=null,n.parentRect=null,n.frameId=null,n.hideTimeout=null,n.showTimeout=null,n.addAncestorScrollEventListeners=new Array,n.removeAncestorScrollEventListeners=new Array,n.animFrame=new Q,n.anchorBlurHandler=function(t){n.handleAnchorBlur(t)},n.documentClickHandler=function(t){n.handleDocumentClick(t)},n.documentKeydownHandler=function(t){n.handleKeydown(t)},n.tooltipMouseEnterHandler=function(){n.handleTooltipMouseEnter()},n.tooltipMouseLeaveHandler=function(){n.handleTooltipMouseLeave()},n.richTooltipFocusOutHandler=function(t){n.handleRichTooltipFocusOut(t)},n.windowScrollHandler=function(){n.handleWindowScrollEvent()},n.windowResizeHandler=function(){n.handleWindowChangeEvent()},n}return v(e,t),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttribute:function(){return null},setAttribute:function(){},removeAttribute:function(){},addClass:function(){},hasClass:function(){return!1},removeClass:function(){},getComputedStyleProperty:function(){return""},setStyleProperty:function(){},setSurfaceAnimationStyleProperty:function(){},getViewportWidth:function(){return 0},getViewportHeight:function(){return 0},getTooltipSize:function(){return{width:0,height:0}},getAnchorBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getParentBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getAnchorAttribute:function(){return null},setAnchorAttribute:function(){return null},isRTL:function(){return!1},anchorContainsElement:function(){return!1},tooltipContainsElement:function(){return!1},focusAnchorElement:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerAnchorEventHandler:function(){},deregisterAnchorEventHandler:function(){},registerDocumentEventHandler:function(){},deregisterDocumentEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){},notifyHidden:function(){},getTooltipCaretBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},setTooltipCaretStyle:function(){},clearTooltipCaretStyles:function(){},getActiveElement:function(){return null}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.richTooltip=this.adapter.hasClass(Mt),this.persistentTooltip="true"===this.adapter.getAttribute(j),this.interactiveTooltip=!!this.adapter.getAnchorAttribute(V)&&"dialog"===this.adapter.getAnchorAttribute(k),this.hasCaret=this.richTooltip&&"true"===this.adapter.getAttribute(F)},e.prototype.isShown=function(){return this.tooltipShown},e.prototype.isRich=function(){return this.richTooltip},e.prototype.isPersistent=function(){return this.persistentTooltip},e.prototype.handleAnchorMouseEnter=function(){var t=this;this.tooltipShown?this.show():(this.clearHideTimeout(),this.showTimeout=setTimeout((function(){t.show()}),this.showDelayMs))},e.prototype.handleAnchorTouchstart=function(){var t=this;this.showTimeout=setTimeout((function(){t.show()}),this.showDelayMs),this.adapter.registerWindowEventHandler("contextmenu",this.preventContextMenuOnLongTouch)},e.prototype.preventContextMenuOnLongTouch=function(t){t.preventDefault()},e.prototype.handleAnchorTouchend=function(){this.clearShowTimeout(),this.isShown()||this.adapter.deregisterWindowEventHandler("contextmenu",this.preventContextMenuOnLongTouch)},e.prototype.handleAnchorFocus=function(t){var e=this,o=t.relatedTarget;o instanceof HTMLElement&&this.adapter.tooltipContainsElement(o)||(this.showTimeout=setTimeout((function(){e.show()}),this.showDelayMs))},e.prototype.handleAnchorMouseLeave=function(){var t=this;this.clearShowTimeout(),this.hideTimeout=setTimeout((function(){t.hide()}),this.hideDelayMs)},e.prototype.handleAnchorClick=function(){this.tooltipShown?this.hide():this.show()},e.prototype.handleDocumentClick=function(t){var e=t.target instanceof HTMLElement&&(this.adapter.anchorContainsElement(t.target)||this.adapter.tooltipContainsElement(t.target));this.richTooltip&&this.persistentTooltip&&e||this.hide()},e.prototype.handleKeydown=function(t){if(It(t)===Tt){var e=this.adapter.getActiveElement();e instanceof HTMLElement&&this.adapter.tooltipContainsElement(e)&&this.adapter.focusAnchorElement(),this.hide()}},e.prototype.handleAnchorBlur=function(t){if(this.richTooltip){if(t.relatedTarget instanceof HTMLElement&&this.adapter.tooltipContainsElement(t.relatedTarget))return;if(null===t.relatedTarget&&this.interactiveTooltip)return}this.hide()},e.prototype.handleTooltipMouseEnter=function(){this.show()},e.prototype.handleTooltipMouseLeave=function(){var t=this;this.clearShowTimeout(),this.hideTimeout=setTimeout((function(){t.hide()}),this.hideDelayMs)},e.prototype.handleRichTooltipFocusOut=function(t){t.relatedTarget instanceof HTMLElement&&(this.adapter.anchorContainsElement(t.relatedTarget)||this.adapter.tooltipContainsElement(t.relatedTarget))||null===t.relatedTarget&&this.interactiveTooltip||this.hide()},e.prototype.handleWindowScrollEvent=function(){this.persistentTooltip?this.handleWindowChangeEvent():this.hide()},e.prototype.handleWindowChangeEvent=function(){var t=this;this.animFrame.request(Bt.POLL_ANCHOR,(function(){t.repositionTooltipOnAnchorMove()}))},e.prototype.show=function(){var t,e,o=this;if(this.clearHideTimeout(),this.clearShowTimeout(),!this.tooltipShown){this.tooltipShown=!0,this.adapter.removeAttribute("aria-hidden"),this.richTooltip&&(this.interactiveTooltip&&this.adapter.setAnchorAttribute("aria-expanded","true"),this.adapter.registerEventHandler("focusout",this.richTooltipFocusOutHandler)),this.persistentTooltip||(this.adapter.registerEventHandler("mouseenter",this.tooltipMouseEnterHandler),this.adapter.registerEventHandler("mouseleave",this.tooltipMouseLeaveHandler)),this.adapter.removeClass(kt),this.adapter.addClass(Wt),this.isTooltipMultiline()&&!this.richTooltip&&this.adapter.addClass(Ft),this.anchorRect=this.adapter.getAnchorBoundingRect(),this.parentRect=this.adapter.getParentBoundingRect(),this.richTooltip?this.positionRichTooltip():this.positionPlainTooltip(),this.adapter.registerAnchorEventHandler("blur",this.anchorBlurHandler),this.adapter.registerDocumentEventHandler("click",this.documentClickHandler),this.adapter.registerDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.registerWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.registerWindowEventHandler("resize",this.windowResizeHandler);try{for(var n=O(this.addAncestorScrollEventListeners),r=n.next();!r.done;r=n.next()){(0,r.value)()}}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.frameId=requestAnimationFrame((function(){o.clearAllAnimationClasses(),o.adapter.addClass(Lt),o.adapter.addClass(Vt)}))}},e.prototype.hide=function(){var t,e;if(this.clearHideTimeout(),this.clearShowTimeout(),this.tooltipShown){this.frameId&&cancelAnimationFrame(this.frameId),this.tooltipShown=!1,this.adapter.setAttribute("aria-hidden","true"),this.adapter.deregisterEventHandler("focusout",this.richTooltipFocusOutHandler),this.richTooltip&&this.interactiveTooltip&&this.adapter.setAnchorAttribute("aria-expanded","false"),this.persistentTooltip||(this.adapter.deregisterEventHandler("mouseenter",this.tooltipMouseEnterHandler),this.adapter.deregisterEventHandler("mouseleave",this.tooltipMouseLeaveHandler)),this.clearAllAnimationClasses(),this.adapter.addClass(kt),this.adapter.addClass(jt),this.adapter.removeClass(Lt),this.adapter.deregisterAnchorEventHandler("blur",this.anchorBlurHandler),this.adapter.deregisterDocumentEventHandler("click",this.documentClickHandler),this.adapter.deregisterDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.deregisterWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler),this.adapter.deregisterWindowEventHandler("contextmenu",this.preventContextMenuOnLongTouch);try{for(var o=O(this.removeAncestorScrollEventListeners),n=o.next();!n.done;n=o.next()){(0,n.value)()}}catch(r){t={error:r}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}},e.prototype.handleTransitionEnd=function(){var t=this.adapter.hasClass(kt);this.adapter.removeClass(Wt),this.adapter.removeClass(Vt),this.adapter.removeClass(kt),this.adapter.removeClass(jt),t&&null===this.showTimeout&&this.adapter.notifyHidden()},e.prototype.clearAllAnimationClasses=function(){this.adapter.removeClass(Vt),this.adapter.removeClass(jt)},e.prototype.setTooltipPosition=function(t){var e=t.xPos,o=t.yPos,n=t.withCaretPos;this.hasCaret&&n?this.tooltipPositionWithCaret=n:(e&&(this.xTooltipPos=e),o&&(this.yTooltipPos=o))},e.prototype.setAnchorBoundaryType=function(t){t===P.UNBOUNDED?this.anchorGap=H:this.anchorGap=R},e.prototype.setShowDelay=function(t){this.showDelayMs=t},e.prototype.setHideDelay=function(t){this.hideDelayMs=t},e.prototype.isTooltipMultiline=function(){var t=this.adapter.getTooltipSize();return t.height>B&&t.width>=M},e.prototype.positionPlainTooltip=function(){var t=this.calculateTooltipStyles(this.anchorRect),e=t.top,o=t.yTransformOrigin,n=t.left,r=t.xTransformOrigin,i=zt?et(window,"transform"):"transform";this.adapter.setSurfaceAnimationStyleProperty(i+"-origin",r+" "+o),this.adapter.setStyleProperty("top",e+"px"),this.adapter.setStyleProperty("left",n+"px")},e.prototype.positionRichTooltip=function(){var t,e,o,n,r=this.adapter.getComputedStyleProperty("width");this.adapter.setStyleProperty("width",r);var i=this.hasCaret?this.calculateTooltipWithCaretStyles(this.anchorRect):this.calculateTooltipStyles(this.anchorRect),a=i.top,s=i.yTransformOrigin,l=i.left,c=i.xTransformOrigin,h=zt?et(window,"transform"):"transform";this.adapter.setSurfaceAnimationStyleProperty(h+"-origin",c+" "+s);var d=l-(null!==(e=null===(t=this.parentRect)||void 0===t?void 0:t.left)&&void 0!==e?e:0),u=a-(null!==(n=null===(o=this.parentRect)||void 0===o?void 0:o.top)&&void 0!==n?n:0);this.adapter.setStyleProperty("top",u+"px"),this.adapter.setStyleProperty("left",d+"px")},e.prototype.calculateTooltipStyles=function(t){if(!t)return{top:0,left:0};var e=this.adapter.getTooltipSize(),o=this.calculateYTooltipDistance(t,e.height),n=this.calculateXTooltipDistance(t,e.width);return{top:o.distance,yTransformOrigin:o.yTransformOrigin,left:n.distance,xTransformOrigin:n.xTransformOrigin}},e.prototype.calculateXTooltipDistance=function(t,e){var o,n,r,i,a,s=!this.adapter.isRTL();this.richTooltip?(o=s?t.left-e:t.right,n=s?t.right:t.left-e,i=s?Y:$,a=s?$:Y):(o=s?t.left:t.right-e,n=s?t.right-e:t.left,r=t.left+(t.width-e)/2,i=s?$:Y,a=s?Y:$);var l=this.richTooltip?this.determineValidPositionOptions(o,n):this.determineValidPositionOptions(r,o,n);if(this.xTooltipPos===x.START&&l.has(o))return{distance:o,xTransformOrigin:i};if(this.xTooltipPos===x.END&&l.has(n))return{distance:n,xTransformOrigin:a};if(this.xTooltipPos===x.CENTER&&l.has(r))return{distance:r,xTransformOrigin:K};var c=(this.richTooltip?[{distance:n,xTransformOrigin:a},{distance:o,xTransformOrigin:i}]:[{distance:r,xTransformOrigin:K},{distance:o,xTransformOrigin:i},{distance:n,xTransformOrigin:a}]).find((function(t){var e=t.distance;return l.has(e)}));return c||(t.left<0?{distance:this.minViewportTooltipThreshold,xTransformOrigin:$}:{distance:this.adapter.getViewportWidth()-(e+this.minViewportTooltipThreshold),xTransformOrigin:Y})},e.prototype.determineValidPositionOptions=function(){for(var t,e,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var r=new Set,i=new Set;try{for(var a=O(o),s=a.next();!s.done;s=a.next()){var l=s.value;this.positionHonorsViewportThreshold(l)?r.add(l):this.positionDoesntCollideWithViewport(l)&&i.add(l)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return r.size?r:i},e.prototype.positionHonorsViewportThreshold=function(t){var e=this.adapter.getViewportWidth();return t+this.adapter.getTooltipSize().width<=e-this.minViewportTooltipThreshold&&t>=this.minViewportTooltipThreshold},e.prototype.positionDoesntCollideWithViewport=function(t){var e=this.adapter.getViewportWidth();return t+this.adapter.getTooltipSize().width<=e&&t>=0},e.prototype.calculateYTooltipDistance=function(t,e){var o=t.bottom+this.anchorGap,n=t.top-(this.anchorGap+e),r=this.determineValidYPositionOptions(n,o);return this.yTooltipPos===_.ABOVE&&r.has(n)?{distance:n,yTransformOrigin:Z}:this.yTooltipPos===_.BELOW&&r.has(o)||r.has(o)?{distance:o,yTransformOrigin:X}:r.has(n)?{distance:n,yTransformOrigin:Z}:{distance:o,yTransformOrigin:X}},e.prototype.determineValidYPositionOptions=function(t,e){var o=new Set,n=new Set;return this.yPositionHonorsViewportThreshold(t)?o.add(t):this.yPositionDoesntCollideWithViewport(t)&&n.add(t),this.yPositionHonorsViewportThreshold(e)?o.add(e):this.yPositionDoesntCollideWithViewport(e)&&n.add(e),o.size?o:n},e.prototype.yPositionHonorsViewportThreshold=function(t){var e=this.adapter.getViewportHeight();return t+this.adapter.getTooltipSize().height+this.minViewportTooltipThreshold<=e&&t>=this.minViewportTooltipThreshold},e.prototype.yPositionDoesntCollideWithViewport=function(t){var e=this.adapter.getViewportHeight();return t+this.adapter.getTooltipSize().height<=e&&t>=0},e.prototype.calculateTooltipWithCaretStyles=function(t){this.adapter.clearTooltipCaretStyles();var e=this.adapter.getTooltipCaretBoundingRect();if(!t||!e)return{position:U.DETECTED,top:0,left:0};var o=e.width/W,n=e.height/W/2,r=this.adapter.getTooltipSize(),i=this.calculateYWithCaretDistanceOptions(t,r.height,{caretWidth:o,caretHeight:n}),a=this.calculateXWithCaretDistanceOptions(t,r.width,{caretWidth:o,caretHeight:n}),s=this.validateTooltipWithCaretDistances(i,a);s.size<1&&(s=this.generateBackupPositionOption(t,r,{caretWidth:o,caretHeight:n}));var l=this.determineTooltipWithCaretDistance(s),c=l.position,h=l.xDistance,d=l.yDistance,u=this.setCaretPositionStyles(c,{caretWidth:o,caretHeight:n});return{yTransformOrigin:u.yTransformOrigin,xTransformOrigin:u.xTransformOrigin,top:d,left:h}},e.prototype.calculateXWithCaretDistanceOptions=function(t,e,o){var n=o.caretWidth,r=o.caretHeight,i=!this.adapter.isRTL(),a=t.left+t.width/2,s=t.left-(e+this.anchorGap+r),l=t.right+this.anchorGap+r,c=i?s:l,h=i?l:s,d=a-(L+n/2),u=a-(e-L-n/2),p=i?d:u,f=i?u:d,T=a-e/2;return new Map([[G.START,p],[G.CENTER,T],[G.END,f],[G.SIDE_END,h],[G.SIDE_START,c]])},e.prototype.calculateYWithCaretDistanceOptions=function(t,e,o){var n=o.caretWidth,r=o.caretHeight,i=t.top+t.height/2,a=t.bottom+this.anchorGap+r,s=t.top-(this.anchorGap+e+r),l=i-(L+n/2),c=i-e/2,h=i-(e-L-n/2);return new Map([[q.ABOVE,s],[q.BELOW,a],[q.SIDE_TOP,l],[q.SIDE_CENTER,c],[q.SIDE_BOTTOM,h]])},e.prototype.repositionTooltipOnAnchorMove=function(){var t=this.adapter.getAnchorBoundingRect();t&&this.anchorRect&&(t.top===this.anchorRect.top&&t.left===this.anchorRect.left&&t.height===this.anchorRect.height&&t.width===this.anchorRect.width||(this.anchorRect=t,this.parentRect=this.adapter.getParentBoundingRect(),this.richTooltip?this.positionRichTooltip():this.positionPlainTooltip()))},e.prototype.validateTooltipWithCaretDistances=function(t,e){var o,n,r,i,a,s,l=new Map,c=new Map,h=new Map([[q.ABOVE,[G.START,G.CENTER,G.END]],[q.BELOW,[G.START,G.CENTER,G.END]],[q.SIDE_TOP,[G.SIDE_START,G.SIDE_END]],[q.SIDE_CENTER,[G.SIDE_START,G.SIDE_END]],[q.SIDE_BOTTOM,[G.SIDE_START,G.SIDE_END]]]);try{for(var d=O(h.keys()),u=d.next();!u.done;u=d.next()){var p=u.value,f=t.get(p);if(this.yPositionHonorsViewportThreshold(f))try{for(var T=(r=void 0,O(h.get(p))),E=T.next();!E.done;E=T.next()){var m=E.value,y=e.get(m);if(this.positionHonorsViewportThreshold(y)){var v=this.caretPositionOptionsMapping(m,p);l.set(v,{xDistance:y,yDistance:f})}}}catch(S){r={error:S}}finally{try{E&&!E.done&&(i=T.return)&&i.call(T)}finally{if(r)throw r.error}}if(this.yPositionDoesntCollideWithViewport(f))try{for(var g=(a=void 0,O(h.get(p))),A=g.next();!A.done;A=g.next()){m=A.value,y=e.get(m);if(this.positionDoesntCollideWithViewport(y)){v=this.caretPositionOptionsMapping(m,p);c.set(v,{xDistance:y,yDistance:f})}}}catch(w){a={error:w}}finally{try{A&&!A.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}}}catch(D){o={error:D}}finally{try{u&&!u.done&&(n=d.return)&&n.call(d)}finally{if(o)throw o.error}}return l.size?l:c},e.prototype.generateBackupPositionOption=function(t,e,o){var n,r,i,a,s=!this.adapter.isRTL();t.left<0?(n=this.minViewportTooltipThreshold+o.caretHeight,r=s?G.END:G.START):(n=this.adapter.getViewportWidth()-(e.width+this.minViewportTooltipThreshold+o.caretHeight),r=s?G.START:G.END);t.top<0?(i=this.minViewportTooltipThreshold+o.caretHeight,a=q.BELOW):(i=this.adapter.getViewportHeight()-(e.height+this.minViewportTooltipThreshold+o.caretHeight),a=q.ABOVE);var l=this.caretPositionOptionsMapping(r,a);return new Map([[l,{xDistance:n,yDistance:i}]])},e.prototype.determineTooltipWithCaretDistance=function(t){if(t.has(this.tooltipPositionWithCaret)){var e=t.get(this.tooltipPositionWithCaret);return{position:this.tooltipPositionWithCaret,xDistance:e.xDistance,yDistance:e.yDistance}}var o=[U.ABOVE_START,U.ABOVE_CENTER,U.ABOVE_END,U.TOP_SIDE_START,U.CENTER_SIDE_START,U.BOTTOM_SIDE_START,U.TOP_SIDE_END,U.CENTER_SIDE_END,U.BOTTOM_SIDE_END,U.BELOW_START,U.BELOW_CENTER,U.BELOW_END].find((function(e){return t.has(e)})),n=t.get(o);return{position:o,xDistance:n.xDistance,yDistance:n.yDistance}},e.prototype.caretPositionOptionsMapping=function(t,e){switch(e){case q.ABOVE:if(t===G.START)return U.ABOVE_START;if(t===G.CENTER)return U.ABOVE_CENTER;if(t===G.END)return U.ABOVE_END;break;case q.BELOW:if(t===G.START)return U.BELOW_START;if(t===G.CENTER)return U.BELOW_CENTER;if(t===G.END)return U.BELOW_END;break;case q.SIDE_TOP:if(t===G.SIDE_START)return U.TOP_SIDE_START;if(t===G.SIDE_END)return U.TOP_SIDE_END;break;case q.SIDE_CENTER:if(t===G.SIDE_START)return U.CENTER_SIDE_START;if(t===G.SIDE_END)return U.CENTER_SIDE_END;break;case q.SIDE_BOTTOM:if(t===G.SIDE_START)return U.BOTTOM_SIDE_START;if(t===G.SIDE_END)return U.BOTTOM_SIDE_END}throw new Error("MDCTooltipFoundation: Invalid caret position of "+t+", "+e)},e.prototype.setCaretPositionStyles=function(t,e){var o,n,r=this.calculateCaretPositionOnTooltip(t,e);if(!r)return{yTransformOrigin:0,xTransformOrigin:0};this.adapter.clearTooltipCaretStyles(),this.adapter.setTooltipCaretStyle(r.yAlignment,r.yAxisPx),this.adapter.setTooltipCaretStyle(r.xAlignment,r.xAxisPx);var i=r.skew*(Math.PI/180),a=Math.cos(i);this.adapter.setTooltipCaretStyle("transform","rotate("+r.rotation+"deg) skewY("+r.skew+"deg) scaleX("+a+")"),this.adapter.setTooltipCaretStyle("transform-origin",r.xAlignment+" "+r.yAlignment);try{for(var s=O(r.caretCorners),l=s.next();!l.done;l=s.next()){var c=l.value;this.adapter.setTooltipCaretStyle(c,"0")}}catch(h){o={error:h}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return{yTransformOrigin:r.yTransformOrigin,xTransformOrigin:r.xTransformOrigin}},e.prototype.calculateCaretPositionOnTooltip=function(t,e){var o=!this.adapter.isRTL(),n=this.adapter.getComputedStyleProperty("width"),r=this.adapter.getComputedStyleProperty("height");if(n&&r&&e){var i="calc(("+n+" - "+e.caretWidth+"px) / 2)",a="calc(("+r+" - "+e.caretWidth+"px) / 2)",s="0",l=L+"px",c="calc("+n+" - "+l+")",h="calc("+r+" - "+l+")",d=35,u=Math.abs(55),p=["border-bottom-right-radius","border-top-left-radius"],f=["border-bottom-left-radius","border-top-right-radius"],T=20;switch(t){case U.BELOW_CENTER:return{yAlignment:X,xAlignment:$,yAxisPx:s,xAxisPx:i,rotation:-35,skew:-20,xTransformOrigin:i,yTransformOrigin:s,caretCorners:p};case U.BELOW_END:return{yAlignment:X,xAlignment:o?Y:$,yAxisPx:s,xAxisPx:l,rotation:o?d:-35,skew:o?T:-20,xTransformOrigin:o?c:l,yTransformOrigin:s,caretCorners:o?f:p};case U.BELOW_START:return{yAlignment:X,xAlignment:o?$:Y,yAxisPx:s,xAxisPx:l,rotation:o?-35:d,skew:o?-20:T,xTransformOrigin:o?l:c,yTransformOrigin:s,caretCorners:o?p:f};case U.TOP_SIDE_END:return{yAlignment:X,xAlignment:o?$:Y,yAxisPx:l,xAxisPx:s,rotation:o?u:-1*u,skew:o?-20:T,xTransformOrigin:o?s:n,yTransformOrigin:l,caretCorners:o?p:f};case U.CENTER_SIDE_END:return{yAlignment:X,xAlignment:o?$:Y,yAxisPx:a,xAxisPx:s,rotation:o?u:-1*u,skew:o?-20:T,xTransformOrigin:o?s:n,yTransformOrigin:a,caretCorners:o?p:f};case U.BOTTOM_SIDE_END:return{yAlignment:Z,xAlignment:o?$:Y,yAxisPx:l,xAxisPx:s,rotation:o?-1*u:u,skew:o?T:-20,xTransformOrigin:o?s:n,yTransformOrigin:h,caretCorners:o?f:p};case U.TOP_SIDE_START:return{yAlignment:X,xAlignment:o?Y:$,yAxisPx:l,xAxisPx:s,rotation:o?-1*u:u,skew:o?T:-20,xTransformOrigin:o?n:s,yTransformOrigin:l,caretCorners:o?f:p};case U.CENTER_SIDE_START:return{yAlignment:X,xAlignment:o?Y:$,yAxisPx:a,xAxisPx:s,rotation:o?-1*u:u,skew:o?T:-20,xTransformOrigin:o?n:s,yTransformOrigin:a,caretCorners:o?f:p};case U.BOTTOM_SIDE_START:return{yAlignment:Z,xAlignment:o?Y:$,yAxisPx:l,xAxisPx:s,rotation:o?u:-1*u,skew:o?-20:T,xTransformOrigin:o?n:s,yTransformOrigin:h,caretCorners:o?p:f};case U.ABOVE_CENTER:return{yAlignment:Z,xAlignment:$,yAxisPx:s,xAxisPx:i,rotation:d,skew:T,xTransformOrigin:i,yTransformOrigin:r,caretCorners:f};case U.ABOVE_END:return{yAlignment:Z,xAlignment:o?Y:$,yAxisPx:s,xAxisPx:l,rotation:o?-35:d,skew:o?-20:T,xTransformOrigin:o?c:l,yTransformOrigin:r,caretCorners:o?p:f};default:case U.ABOVE_START:return{yAlignment:Z,xAlignment:o?$:Y,yAxisPx:s,xAxisPx:l,rotation:o?d:-35,skew:o?T:-20,xTransformOrigin:o?l:c,yTransformOrigin:r,caretCorners:o?f:p}}}},e.prototype.clearShowTimeout=function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},e.prototype.clearHideTimeout=function(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},e.prototype.attachScrollHandler=function(t){var e=this;this.addAncestorScrollEventListeners.push((function(){t("scroll",e.windowScrollHandler)}))},e.prototype.removeScrollHandler=function(t){var e=this;this.removeAncestorScrollEventListeners.push((function(){t("scroll",e.windowScrollHandler)}))},e.prototype.destroy=function(){var t,e;this.frameId&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.clearHideTimeout(),this.clearShowTimeout(),this.adapter.removeClass(Lt),this.adapter.removeClass(Vt),this.adapter.removeClass(Wt),this.adapter.removeClass(kt),this.adapter.removeClass(jt),this.richTooltip&&this.adapter.deregisterEventHandler("focusout",this.richTooltipFocusOutHandler),this.persistentTooltip||(this.adapter.deregisterEventHandler("mouseenter",this.tooltipMouseEnterHandler),this.adapter.deregisterEventHandler("mouseleave",this.tooltipMouseLeaveHandler)),this.adapter.deregisterAnchorEventHandler("blur",this.anchorBlurHandler),this.adapter.deregisterDocumentEventHandler("click",this.documentClickHandler),this.adapter.deregisterDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.deregisterWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler);try{for(var o=O(this.removeAncestorScrollEventListeners),n=o.next();!n.done;n=o.next()){(0,n.value)()}}catch(r){t={error:r}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}this.animFrame.cancelAll()},e}(D),qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(){var t=this.root.getAttribute("id");if(!t)throw new Error("MDCTooltip: Tooltip component must have an id.");var e=document.querySelector('[data-tooltip-id="'+t+'"]')||document.querySelector('[aria-describedby="'+t+'"]');if(!e)throw new Error("MDCTooltip: Tooltip component requires an anchor element annotated with [aria-describedby] or [data-tooltip-id].");this.anchorElem=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.isTooltipRich=this.foundation.isRich(),this.isTooltipPersistent=this.foundation.isPersistent(),this.handleMouseEnter=function(){t.foundation.handleAnchorMouseEnter()},this.handleFocus=function(e){t.foundation.handleAnchorFocus(e)},this.handleMouseLeave=function(){t.foundation.handleAnchorMouseLeave()},this.handleTransitionEnd=function(){t.foundation.handleTransitionEnd()},this.handleClick=function(){t.foundation.handleAnchorClick()},this.handleTouchstart=function(){t.foundation.handleAnchorTouchstart()},this.handleTouchend=function(){t.foundation.handleAnchorTouchend()},this.isTooltipRich&&this.isTooltipPersistent?this.anchorElem.addEventListener("click",this.handleClick):(this.anchorElem.addEventListener("mouseenter",this.handleMouseEnter),this.anchorElem.addEventListener("focus",this.handleFocus),this.anchorElem.addEventListener("mouseleave",this.handleMouseLeave),this.anchorElem.addEventListener("touchstart",this.handleTouchstart),this.anchorElem.addEventListener("touchend",this.handleTouchend)),this.listen("transitionend",this.handleTransitionEnd)},e.prototype.destroy=function(){this.anchorElem&&(this.isTooltipRich&&this.isTooltipPersistent?this.anchorElem.removeEventListener("click",this.handleClick):(this.anchorElem.removeEventListener("mouseenter",this.handleMouseEnter),this.anchorElem.removeEventListener("focus",this.handleFocus),this.anchorElem.removeEventListener("mouseleave",this.handleMouseLeave),this.anchorElem.removeEventListener("touchstart",this.handleTouchstart),this.anchorElem.removeEventListener("touchend",this.handleTouchend))),this.unlisten("transitionend",this.handleTransitionEnd),t.prototype.destroy.call(this)},e.prototype.setTooltipPosition=function(t){this.foundation.setTooltipPosition(t)},e.prototype.setAnchorBoundaryType=function(t){this.foundation.setAnchorBoundaryType(t)},e.prototype.setShowDelay=function(t){this.foundation.setShowDelay(t)},e.prototype.setHideDelay=function(t){this.foundation.setHideDelay(t)},e.prototype.hide=function(){this.foundation.hide()},e.prototype.isShown=function(){return this.foundation.isShown()},e.prototype.attachScrollHandler=function(t){this.foundation.attachScrollHandler(t)},e.prototype.removeScrollHandler=function(t){this.foundation.removeScrollHandler(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new Ut({getAttribute:function(e){return t.root.getAttribute(e)},setAttribute:function(e,o){t.root.setAttribute(e,o)},removeAttribute:function(e){t.root.removeAttribute(e)},addClass:function(e){t.root.classList.add(e)},hasClass:function(e){return t.root.classList.contains(e)},removeClass:function(e){t.root.classList.remove(e)},getComputedStyleProperty:function(e){return window.getComputedStyle(t.root).getPropertyValue(e)},setStyleProperty:function(e,o){t.root.style.setProperty(e,o)},setSurfaceAnimationStyleProperty:function(e,o){var n=t.root.querySelector("."+w.SURFACE_ANIMATION);null===n||void 0===n||n.style.setProperty(e,o)},getViewportWidth:function(){return window.innerWidth},getViewportHeight:function(){return window.innerHeight},getTooltipSize:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorBoundingRect:function(){return t.anchorElem?t.anchorElem.getBoundingClientRect():null},getParentBoundingRect:function(){var e,o;return null!==(o=null===(e=t.root.parentElement)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==o?o:null},getAnchorAttribute:function(e){return t.anchorElem?t.anchorElem.getAttribute(e):null},setAnchorAttribute:function(e,o){var n;null===(n=t.anchorElem)||void 0===n||n.setAttribute(e,o)},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},anchorContainsElement:function(e){var o;return!!(null===(o=t.anchorElem)||void 0===o?void 0:o.contains(e))},tooltipContainsElement:function(e){return t.root.contains(e)},focusAnchorElement:function(){var e;null===(e=t.anchorElem)||void 0===e||e.focus()},registerEventHandler:function(e,o){t.root instanceof HTMLElement&&t.root.addEventListener(e,o)},deregisterEventHandler:function(e,o){t.root instanceof HTMLElement&&t.root.removeEventListener(e,o)},registerAnchorEventHandler:function(e,o){var n;null===(n=t.anchorElem)||void 0===n||n.addEventListener(e,o)},deregisterAnchorEventHandler:function(e,o){var n;null===(n=t.anchorElem)||void 0===n||n.removeEventListener(e,o)},registerDocumentEventHandler:function(t,e){document.body.addEventListener(t,e)},deregisterDocumentEventHandler:function(t,e){document.body.removeEventListener(t,e)},registerWindowEventHandler:function(t,e){window.addEventListener(t,e)},deregisterWindowEventHandler:function(t,e){window.removeEventListener(t,e)},notifyHidden:function(){t.emit(z,{})},getTooltipCaretBoundingRect:function(){var e=t.root.querySelector("."+w.TOOLTIP_CARET_TOP);return e?e.getBoundingClientRect():null},setTooltipCaretStyle:function(e,o){var n=t.root.querySelector("."+w.TOOLTIP_CARET_TOP),r=t.root.querySelector("."+w.TOOLTIP_CARET_BOTTOM);n&&r&&(n.style.setProperty(e,o),r.style.setProperty(e,o))},clearTooltipCaretStyles:function(){var e=t.root.querySelector("."+w.TOOLTIP_CARET_TOP),o=t.root.querySelector("."+w.TOOLTIP_CARET_BOTTOM);e&&o&&(e.removeAttribute("style"),o.removeAttribute("style"))},getActiveElement:function(){return document.activeElement}})},e}(C);var Gt=(t,e,o)=>t[o]||t.type===e[o]||t.type===o;const $t={class:"mdc-tooltip__title"},Yt={class:"mdc-tooltip__content"},Kt={TYPES:{plain:0,rich:1},cssClasses:{link:"mdc-tooltip__content-link"}},Xt={name:"UiTooltip",customOptions:{UI_TOOLTIP:Kt}};var Zt=Object.assign(Xt,{props:{type:{type:[String,Number],default:0},rich:{type:Boolean,default:!1},width:{type:[String,Number],default:0}},setup(t){const e=t,o=(0,f.ref)(null),n=(0,f.computed)((()=>Gt(e,Kt.TYPES,"rich"))),r=(0,f.computed)((()=>({"mdc-tooltip":!0,"mdc-tooltip--rich":n.value}))),i=(0,f.computed)((()=>e.width?{"max-width":`${e.width}px`}:{}));return(0,f.onMounted)((()=>new qt(o.value))),(e,n)=>((0,f.openBlock)(),(0,f.createElementBlock)("div",{ref_key:"tooltip",ref:o,class:(0,f.normalizeClass)(r.value),role:"tooltip","aria-hidden":"true"},[(0,f.createElementVNode)("div",{class:"mdc-tooltip__surface mdc-tooltip__surface-animation",style:(0,f.normalizeStyle)(i.value)},[t.rich?((0,f.openBlock)(),(0,f.createElementBlock)(f.Fragment,{key:0},[(0,f.createElementVNode)("h2",$t,[(0,f.renderSlot)(e.$slots,"title")]),(0,f.createElementVNode)("p",Yt,[(0,f.renderSlot)(e.$slots,"default",{linkClass:Kt.cssClasses.link})])],64)):(0,f.renderSlot)(e.$slots,"default",{key:1})],4)],2))}});var Qt=p({UiTooltipAnchor:m,UiTooltip:Zt});return r=r.default}()}));