tippy.js
Version:
Highly customizable tooltip and popover library
3 lines (2 loc) • 22.2 kB
JavaScript
var tippy=function(e){"use strict";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e=e&&e.hasOwnProperty("default")?e.default:e;function n(e,t){e.innerHTML=t}function r(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function i(e,t){return{}.hasOwnProperty.call(e,t)}function o(e){return s(e)?[e]:function(e){return c(e,"NodeList")}(e)?b(e):Array.isArray(e)?e:b(document.querySelectorAll(e))}function a(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function u(e,t){return e&&e.modifiers&&e.modifiers[t]}function c(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function s(e){return c(e,"Element")}function p(e){return c(e,"MouseEvent")}function l(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t,n,r){e.filter(function(e){return e.name===t})[0][n]=r}function d(){return document.createElement("div")}function v(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function m(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function h(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)};var n}function g(e,t,n){e&&e!==t&&e.apply(void 0,n)}function b(e){return[].slice.call(e)}function y(e,t){for(;e;){if(t(e))return e;e=e.parentElement}return null}function w(e,t){return e.indexOf(t)>-1}function E(e){return e.split(/\s+/).filter(Boolean)}function A(e,t){return void 0!==e?e:t}function T(e){return[].concat(e)}function C(e){var t=T(e)[0];return t&&t.ownerDocument||document}function I(e,t){-1===e.indexOf(t)&&e.push(t)}function O(e){return"number"==typeof e?e:parseFloat(e)}function D(e,t,n){void 0===t&&(t=5);var r={top:0,right:0,bottom:0,left:0};return Object.keys(r).reduce(function(r,i){return r[i]="number"==typeof t?t:t[i],e===i&&(r[i]="number"==typeof t?t+n:t[e]+n),r},r)}var L={allowHTML:!0,animateFill:!1,animation:"fade",appendTo:function(){return document.body},aria:"describedby",arrow:!0,boundary:"scrollParent",content:"",delay:0,distance:10,duration:[300,250],flip:!0,flipBehavior:"flip",flipOnUpdate:!1,followCursor:!1,hideOnClick:!0,ignoreAttributes:!1,inlinePositioning:!1,inertia:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,lazy:!0,maxWidth:350,multiple:!1,offset:0,onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},placement:"top",plugins:[],popperOptions:{},role:"tooltip",showOnCreate:!1,sticky:!1,theme:"",touch:!0,trigger:"mouseenter focus",triggerTarget:null,updateDuration:0,zIndex:9999},x=Object.keys(L),M=["arrow","boundary","distance","flip","flipBehavior","flipOnUpdate","offset","placement","popperOptions"];function P(e){return t({},e,{},e.plugins.reduce(function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t},{}))}function V(e,n){var r=t({},n,{content:l(n.content,[e])},n.ignoreAttributes?{}:function(e,n){return(n?Object.keys(P(t({},L,{plugins:n}))):x).reduce(function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t},{})}(e,n.plugins));return r.interactive&&(r.aria=null),r}var k={passive:!0},S="tippy-iOS",B="tippy-popper",H="tippy-tooltip",U="tippy-content",N="tippy-backdrop",R="tippy-arrow",z="tippy-svg-arrow",q="."+B,F="."+H,j="."+U,_="."+R,W="."+z,X={isTouch:!1},Y=0;function J(){X.isTouch||(X.isTouch=!0,window.performance&&document.addEventListener("mousemove",G))}function G(){var e=performance.now();e-Y<20&&(X.isTouch=!1,document.removeEventListener("mousemove",G)),Y=e}function K(){var e=document.activeElement;if(r(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Q="undefined"!=typeof window&&"undefined"!=typeof document,Z=Q?navigator.userAgent:"",$=/MSIE |Trident\//.test(Z),ee=/UCBrowser\//.test(Z),te=Q&&/iPhone|iPad|iPod/.test(navigator.platform);function ne(e){var t=e&&te&&X.isTouch;document.body.classList[t?"add":"remove"](S)}function re(e){return e.split("-")[0]}function ie(e){e.setAttribute("data-inertia","")}function oe(e){e.setAttribute("data-interactive","")}function ae(e,t){if(s(t.content))n(e,""),e.appendChild(t.content);else if("function"!=typeof t.content){e[t.allowHTML?"innerHTML":"textContent"]=t.content}}function ue(e){return{tooltip:e.querySelector(F),content:e.querySelector(j),arrow:e.querySelector(_)||e.querySelector(W)}}function ce(e){var t=d();return!0===e?t.className=R:(t.className=z,s(e)?t.appendChild(e):n(t,e)),t}function se(e,t){var n=d();n.className=B,n.style.position="absolute",n.style.top="0",n.style.left="0";var r=d();r.className=H,r.id="tippy-"+e,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1"),fe(r,"add",t.theme);var i=d();return i.className=U,i.setAttribute("data-state","hidden"),t.interactive&&oe(r),t.arrow&&(r.setAttribute("data-arrow",""),r.appendChild(ce(t.arrow))),t.inertia&&ie(r),ae(i,t),r.appendChild(i),n.appendChild(r),pe(n,t,t),n}function pe(e,t,n){var r,i=ue(e),o=i.tooltip,a=i.content,u=i.arrow;e.style.zIndex=""+n.zIndex,o.setAttribute("data-animation",n.animation),o.style.maxWidth="number"==typeof(r=n.maxWidth)?r+"px":r,n.role?o.setAttribute("role",n.role):o.removeAttribute("role"),t.content!==n.content&&ae(a,n),!t.arrow&&n.arrow?(o.appendChild(ce(n.arrow)),o.setAttribute("data-arrow","")):t.arrow&&!n.arrow?(o.removeChild(u),o.removeAttribute("data-arrow")):t.arrow!==n.arrow&&(o.removeChild(u),o.appendChild(ce(n.arrow))),!t.interactive&&n.interactive?oe(o):t.interactive&&!n.interactive&&function(e){e.removeAttribute("data-interactive")}(o),!t.inertia&&n.inertia?ie(o):t.inertia&&!n.inertia&&function(e){e.removeAttribute("data-inertia")}(o),t.theme!==n.theme&&(fe(o,"remove",t.theme),fe(o,"add",n.theme))}function le(e,t,n){var r=ee&&void 0!==document.body.style.webkitTransition?"webkitTransitionEnd":"transitionend";e[t+"EventListener"](r,n)}function fe(e,t,n){E(n).forEach(function(n){e.classList[t](n+"-theme")})}var de=1,ve=[],me=[];function he(n,r){var o,c,s,d=P(V(n,r));if(!d.multiple&&n._tippy)return null;var x,S,B,H,U,N=!1,R=!1,z=0,F=[],j=h(De,d.interactiveDebounce),_=C(d.triggerTarget||n),W=de++,Y=se(W,d),J=ue(Y),G=(U=d.plugins).filter(function(e,t){return U.indexOf(e)===t}),K=J.tooltip,Q=J.content,Z=[K,Q],ee={id:W,reference:n,popper:Y,popperChildren:J,popperInstance:null,props:d,state:{currentPlacement:null,isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:G,clearDelayTimeouts:function(){clearTimeout(o),clearTimeout(c),cancelAnimationFrame(s)},setProps:function(e){if(ee.state.isDestroyed)return;fe("onBeforeUpdate",[ee,e]),Ie();var r=ee.props,o=V(n,t({},ee.props,{},e,{ignoreAttributes:!0}));o.ignoreAttributes=A(e.ignoreAttributes,r.ignoreAttributes),ee.props=o,Ce(),r.interactiveDebounce!==o.interactiveDebounce&&(be(),j=h(De,o.interactiveDebounce));pe(Y,r,o),ee.popperChildren=ue(Y),r.triggerTarget&&!o.triggerTarget?T(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):o.triggerTarget&&n.removeAttribute("aria-expanded");ge(),ee.popperInstance&&(M.some(function(t){return i(e,t)&&e[t]!==r[t]})?(ee.popperInstance.destroy(),Pe(),ee.state.isVisible&&ee.popperInstance.enableEventListeners()):ee.popperInstance.update());fe("onAfterUpdate",[ee,e])},setContent:function(e){ee.setProps({content:e})},show:function(e){void 0===e&&(e=a(ee.props.duration,0,L.duration));var t=ee.state.isVisible,n=ee.state.isDestroyed,r=!ee.state.isEnabled,i=X.isTouch&&!ee.props.touch;if(t||n||r||i)return;if(ae().hasAttribute("disabled"))return;ee.popperInstance||Pe();if(fe("onShow",[ee],!1),!1===ee.props.onShow(ee))return;we(),Y.style.visibility="visible",ee.state.isVisible=!0,ee.state.isMounted||v(Z.concat(Y),0);S=function(){ee.state.isVisible&&(v([Y],ee.props.updateDuration),v(Z,e),m(Z,"visible"),he(),ge(),I(me,ee),ne(!0),ee.state.isMounted=!0,fe("onMount",[ee]),function(e,t){Ae(e,t)}(e,function(){ee.state.isShown=!0,fe("onShown",[ee])}))},function(){z=0;var e,t=ee.props.appendTo,n=ae();e=ee.props.interactive&&t===L.appendTo||"parent"===t?n.parentNode:l(t,[n]);e.contains(Y)||e.appendChild(Y);f(ee.popperInstance.modifiers,"flip","enabled",ee.props.flip),ee.popperInstance.enableEventListeners(),ee.popperInstance.update()}()},hide:function(e){void 0===e&&(e=a(ee.props.duration,1,L.duration));var t=!ee.state.isVisible&&!N,n=ee.state.isDestroyed,r=!ee.state.isEnabled&&!N;if(t||n||r)return;if(fe("onHide",[ee],!1),!1===ee.props.onHide(ee)&&!N)return;Ee(),Y.style.visibility="hidden",ee.state.isVisible=!1,ee.state.isShown=!1,v(Z,e),m(Z,"hidden"),he(),ge(),function(e,t){Ae(e,function(){!ee.state.isVisible&&Y.parentNode&&Y.parentNode.contains(Y)&&t()})}(e,function(){ee.popperInstance.disableEventListeners(),ee.popperInstance.options.placement=ee.props.placement,Y.parentNode.removeChild(Y),0===(me=me.filter(function(e){return e!==ee})).length&&ne(!1),ee.state.isMounted=!1,fe("onHidden",[ee])})},enable:function(){ee.state.isEnabled=!0},disable:function(){ee.hide(),ee.state.isEnabled=!1},destroy:function(){if(ee.state.isDestroyed)return;N=!0,ee.clearDelayTimeouts(),ee.hide(0),Ie(),delete n._tippy,ee.popperInstance&&ee.popperInstance.destroy();N=!1,ee.state.isDestroyed=!0,fe("onDestroy",[ee])}};n._tippy=ee,Y._tippy=ee;var te=G.map(function(e){return e.fn(ee)});return Ce(),ge(),d.lazy||Pe(),fe("onCreate",[ee]),d.showOnCreate&&ke(),Y.addEventListener("mouseenter",function(){ee.props.interactive&&ee.state.isVisible&&ee.clearDelayTimeouts()}),Y.addEventListener("mouseleave",function(){ee.props.interactive&&w(ee.props.trigger,"mouseenter")&&_.addEventListener("mousemove",j)}),ee;function ie(){var e=ee.props.touch;return Array.isArray(e)?e:[e,0]}function oe(){return"hold"===ie()[0]}function ae(){return H||n}function ce(e){return ee.state.isMounted&&!ee.state.isVisible||X.isTouch||!x||"focus"===x.type?0:a(ee.props.delay,e?0:1,L.delay)}function fe(e,t,n){var r;(void 0===n&&(n=!0),te.forEach(function(n){i(n,e)&&n[e].apply(n,t)}),n)&&(r=ee.props)[e].apply(r,t)}function he(){var e=ee.props.aria;if(e){var t="aria-"+e,r=K.id;T(ee.props.triggerTarget||n).forEach(function(e){var n=e.getAttribute(t);if(ee.state.isVisible)e.setAttribute(t,n?n+" "+r:r);else{var i=n&&n.replace(r,"").trim();i?e.setAttribute(t,i):e.removeAttribute(t)}})}}function ge(){T(ee.props.triggerTarget||n).forEach(function(e){ee.props.interactive?e.setAttribute("aria-expanded",ee.state.isVisible&&e===ae()?"true":"false"):e.removeAttribute("aria-expanded")})}function be(){_.body.removeEventListener("mouseleave",Se),_.removeEventListener("mousemove",j),ve=ve.filter(function(e){return e!==j})}function ye(e){if(!ee.props.interactive||!Y.contains(e.target)){if(ae().contains(e.target)){if(X.isTouch)return;if(ee.state.isVisible&&w(ee.props.trigger,"click"))return}!0===ee.props.hideOnClick&&(ee.clearDelayTimeouts(),ee.hide(),R=!0,setTimeout(function(){R=!1}),ee.state.isMounted||Ee())}}function we(){_.addEventListener("mousedown",ye,!0)}function Ee(){_.removeEventListener("mousedown",ye,!0)}function Ae(e,t){function n(e){e.target===K&&(le(K,"remove",n),t())}if(0===e)return t();le(K,"remove",B),le(K,"add",n),B=n}function Te(e,t,r){void 0===r&&(r=!1),T(ee.props.triggerTarget||n).forEach(function(n){n.addEventListener(e,t,r),F.push({node:n,eventType:e,handler:t,options:r})})}function Ce(){oe()&&(Te("touchstart",Oe,k),Te("touchend",Le,k)),E(ee.props.trigger).forEach(function(e){if("manual"!==e)switch(Te(e,Oe),e){case"mouseenter":Te("mouseleave",Le);break;case"focus":Te($?"focusout":"blur",xe)}})}function Ie(){F.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),F=[]}function Oe(e){if(ee.state.isEnabled&&!Me(e)&&!R)if(x=e,H=e.currentTarget,ge(),!ee.state.isVisible&&p(e)&&ve.forEach(function(t){return t(e)}),"click"===e.type&&!1!==ee.props.hideOnClick&&ee.state.isVisible)Se(e);else{var t=ie(),n=t[0],r=t[1];X.isTouch&&"hold"===n&&r?o=setTimeout(function(){ke(e)},r):ke(e)}}function De(e){y(e.target,function(e){return e===n||e===Y})||function(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.tooltipRect,o=e.interactiveBorder,a=Math.min(t.top,i.top),u=Math.max(t.right,i.right),c=Math.max(t.bottom,i.bottom),s=Math.min(t.left,i.left);return a-r>o||r-c>o||s-n>o||n-u>o})}(b(Y.querySelectorAll(q)).concat(Y).map(function(e){var t=e._tippy,n=t.popperChildren.tooltip,r=t.props.interactiveBorder;return{popperRect:e.getBoundingClientRect(),tooltipRect:n.getBoundingClientRect(),interactiveBorder:r}}),e)&&(be(),Se(e))}function Le(e){if(!Me(e))return ee.props.interactive?(_.body.addEventListener("mouseleave",Se),_.addEventListener("mousemove",j),void I(ve,j)):void Se(e)}function xe(e){e.target===ae()&&(ee.props.interactive&&e.relatedTarget&&Y.contains(e.relatedTarget)||Se(e))}function Me(e){var t="ontouchstart"in window,n=w(e.type,"touch"),r=oe();return t&&X.isTouch&&r&&!n||X.isTouch&&!r&&n}function Pe(){var r,i=ee.props.popperOptions,o=ee.popperChildren.arrow,a=u(i,"flip"),c=u(i,"preventOverflow");function s(e){var t=ee.state.currentPlacement;ee.state.currentPlacement=e.placement,ee.props.flip&&!ee.props.flipOnUpdate&&(e.flipped&&(ee.popperInstance.options.placement=e.placement),f(ee.popperInstance.modifiers,"flip","enabled",!1)),K.setAttribute("data-placement",e.placement),!1!==e.attributes["x-out-of-boundaries"]?K.setAttribute("data-out-of-boundaries",""):K.removeAttribute("data-out-of-boundaries");var n=re(e.placement),i=w(["top","bottom"],n),o=w(["bottom","right"],n);K.style.top="0",K.style.left="0",K.style[i?"top":"left"]=(o?1:-1)*r+"px",t&&t!==e.placement&&ee.popperInstance.update()}var p=t({eventsEnabled:!1,placement:ee.props.placement},i,{modifiers:t({},i&&i.modifiers,{tippyDistance:{enabled:!0,order:0,fn:function(e){r=function(e,t){var n="string"==typeof t&&w(t,"rem"),r=e.documentElement;return r&&n?parseFloat(getComputedStyle(r).fontSize||String(16))*O(t):O(t)}(_,ee.props.distance);var t=re(e.placement),n=D(t,c&&c.padding,r),i=D(t,a&&a.padding,r),o=ee.popperInstance.modifiers;return f(o,"preventOverflow","padding",n),f(o,"flip","padding",i),e}},preventOverflow:t({boundariesElement:ee.props.boundary},c),flip:t({enabled:ee.props.flip,behavior:ee.props.flipBehavior},a),arrow:t({element:o,enabled:!!o},u(i,"arrow")),offset:t({offset:ee.props.offset},u(i,"offset"))}),onCreate:function(e){s(e),g(i&&i.onCreate,p.onCreate,[e]),Ve()},onUpdate:function(e){s(e),g(i&&i.onUpdate,p.onUpdate,[e]),Ve()}});ee.popperInstance=new e(n,Y,p)}function Ve(){0===z?(z++,ee.popperInstance.update()):S&&1===z&&(z++,Y.offsetHeight,S())}function ke(e){ee.clearDelayTimeouts(),ee.popperInstance||Pe(),e&&fe("onTrigger",[ee,e]),we();var t=ce(!0);t?o=setTimeout(function(){ee.show()},t):ee.show()}function Se(e){if(ee.clearDelayTimeouts(),fe("onUntrigger",[ee,e]),ee.state.isVisible){var t=ce(!1);t?c=setTimeout(function(){ee.state.isVisible&&ee.hide()},t):s=requestAnimationFrame(function(){ee.hide()})}else Ee()}}function ge(e,n,r){void 0===n&&(n={}),void 0===r&&(r=[]),r=L.plugins.concat(n.plugins||r),document.addEventListener("touchstart",J,t({},k,{capture:!0})),window.addEventListener("blur",K);var i=t({},L,{},n,{plugins:r}),a=o(e).reduce(function(e,t){var n=t&&he(t,i);return n&&e.push(n),e},[]);return s(e)?a[0]:a}ge.version="5.1.1",ge.defaultProps=L,ge.setDefaultProps=function(e){Object.keys(e).forEach(function(t){L[t]=e[t]})},ge.currentInput=X;var be={mouseover:"mouseenter",focusin:"focus",click:"click"};var ye={name:"animateFill",defaultValue:!1,fn:function(e){var t=e.popperChildren,n=t.tooltip,r=t.content,i=e.props.animateFill&&!ee?function(){var e=d();return e.className=N,m([e],"hidden"),e}():null;function o(){e.popperChildren.backdrop=i}return{onCreate:function(){i&&(o(),n.insertBefore(i,n.firstElementChild),n.setAttribute("data-animatefill",""),n.style.overflow="hidden",e.setProps({animation:"shift-away",arrow:!1}))},onMount:function(){if(i){var e=n.style.transitionDuration,t=Number(e.replace("ms",""));r.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,m([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&m([i],"hidden")},onAfterUpdate:function(){o()}}}};var we={name:"followCursor",defaultValue:!1,fn:function(e){var t,n=e.reference,r=e.popper,i=C(e.props.triggerTarget||n),o=null,a=!1,u=e.props;function c(){return"manual"===e.props.trigger.trim()}function s(){var t=!!c()||null!==o&&!(0===o.clientX&&0===o.clientY);return e.props.followCursor&&t}function l(){return X.isTouch||"initial"===e.props.followCursor&&e.state.isVisible}function f(){e.popperInstance&&(e.popperInstance.reference=n)}function d(){if(s()||e.props.placement!==u.placement){var t=u.placement,n=t.split("-")[1];a=!0,e.setProps({placement:s()&&n?t.replace(n,"start"===n?"end":"start"):t}),a=!1}}function v(){e.popperInstance&&s()&&(l()||!0!==e.props.followCursor)&&e.popperInstance.disableEventListeners()}function m(){s()?i.addEventListener("mousemove",b):f()}function h(){s()&&b(t)}function g(){i.removeEventListener("mousemove",b)}function b(i){var o=t=i,a=o.clientX,u=o.clientY;if(e.popperInstance&&e.state.currentPlacement){var c=y(i.target,function(e){return e===n}),s=n.getBoundingClientRect(),p=e.props.followCursor,f="horizontal"===p,d="vertical"===p,v=w(["top","bottom"],re(e.state.currentPlacement)),m=function(e,t){var n=t?e.offsetWidth:e.offsetHeight;return{size:n,x:t?n:0,y:t?0:n}}(r,v),h=m.size,b=m.x,E=m.y;!c&&e.props.interactive||(e.popperInstance.reference={referenceNode:n,clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return{width:v?h:0,height:v?0:h,top:(f?s.top:u)-E,bottom:(f?s.bottom:u)+E,left:(d?s.left:a)-b,right:(d?s.right:a)+b}}},e.popperInstance.update()),l()&&g()}}return{onAfterUpdate:function(e,t){var n;a||(n=t,Object.keys(n).forEach(function(e){u[e]=A(n[e],u[e])}),t.placement&&d()),t.placement&&v(),requestAnimationFrame(h)},onMount:function(){h(),v()},onShow:function(){c()&&(t=o={clientX:0,clientY:0},d(),m())},onTrigger:function(e,n){o||(p(n)&&(o={clientX:n.clientX,clientY:n.clientY},t=n),d(),m())},onUntrigger:function(){e.state.isVisible||(g(),o=null)},onHidden:function(){g(),f(),o=null}}}};var Ee={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t=e.reference;function n(){return e.props.inlinePositioning}return{onHidden:function(){n()&&(e.popperInstance.reference=t)},onShow:function(){n()&&(e.popperInstance.reference={referenceNode:t,clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return function(e,t,n){if(n.length<2||null===e)return t;var r;switch(e){case"top":case"bottom":var i=n[0],o=n[n.length-1],a="top"===e,u=i.top,c=o.bottom,s=a?i.left:o.left,p=a?i.right:o.right;r={top:u,bottom:c,left:s,right:p,width:p-s,height:c-u};break;case"left":case"right":var l=Math.min.apply(Math,n.map(function(e){return e.left})),f=Math.max.apply(Math,n.map(function(e){return e.right})),d=n.filter(function(t){return"left"===e?t.left===l:t.right===f}),v=d[0].top,m=d[d.length-1].bottom;r={top:v,bottom:m,left:l,right:f,width:f-l,height:m-v};break;default:r=t}return r}(e.state.currentPlacement&&re(e.state.currentPlacement),t.getBoundingClientRect(),b(t.getClientRects()))}})}}}};var Ae={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var i=null,o=null;function a(){var u=r("reference")?t.getBoundingClientRect():null,c=r("popper")?n.getBoundingClientRect():null;(u&&Te(i,u)||c&&Te(o,c))&&e.popperInstance.update(),i=u,o=c,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Te(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return ge.setDefaultProps({plugins:[ye,we,Ee,Ae]}),ge.createSingleton=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r=[]),r=n.plugins||r,e.forEach(function(e){e.disable()});var i,o,a=t({},L,{},n).aria,u=!1,c=e.map(function(e){return e.reference}),s={fn:function(t){function n(e){if(i){var n="aria-"+i;e&&!t.props.interactive?o.setAttribute(n,t.popperChildren.tooltip.id):o.removeAttribute(n)}}return{onAfterUpdate:function(e,n){var r=n.aria;void 0!==r&&r!==a&&(u?(u=!0,t.setProps({aria:null}),u=!1):a=r)},onDestroy:function(){e.forEach(function(e){e.enable()})},onMount:function(){n(!0)},onUntrigger:function(){n(!1)},onTrigger:function(r,u){var s=u.currentTarget,p=c.indexOf(s);o=s,i=a,t.state.isVisible&&n(!0),t.popperInstance.reference={referenceNode:s,clientHeight:0,clientWidth:0,getBoundingClientRect:function(){return s.getBoundingClientRect()}},t.setContent(e[p].props.content)}}}};return ge(d(),t({},n,{plugins:[s].concat(r),aria:null,triggerTarget:c}))},ge.delegate=function(e,n,r){void 0===r&&(r=[]),r=n.plugins||r;var i,o,a=[],u=[],c=n.target,s=(i=["target"],o=t({},n),i.forEach(function(e){delete o[e]}),o),p=t({},s,{plugins:r,trigger:"manual"}),l=t({},s,{plugins:r,showOnCreate:!0}),f=ge(e,p);function d(e){if(e.target){var t=e.target.closest(c);if(t)if(w(t.getAttribute("data-tippy-trigger")||n.trigger||L.trigger,be[e.type])){var r=ge(t,l);r&&(u=u.concat(r))}}}function v(e,t,n,r){void 0===r&&(r=!1),e.addEventListener(t,n,r),a.push({node:e,eventType:t,handler:n,options:r})}return T(f).forEach(function(e){var t=e.destroy;e.destroy=function(e){void 0===e&&(e=!0),e&&u.forEach(function(e){e.destroy()}),u=[],a.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),a=[],t()},function(e){var t=e.reference;v(t,"mouseover",d),v(t,"focusin",d),v(t,"click",d)}(e)}),f},ge.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,i=t.duration;me.forEach(function(e){var t=!1;n&&(t=r(n)?e.reference===n:e.popper===n.popper),t||e.hide(i)})},ge.roundArrow='<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>',ge}(Popper);
//# sourceMappingURL=tippy.iife.min.js.map