(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function t(e){return'[object Object]'==={}.toString.call(e)}function o(e){return[].slice.call(e)}function n(e){if(e instanceof Element||t(e))return[e];if(e instanceof NodeList)return o(e);if(Array.isArray(e))return e;try{return o(document.querySelectorAll(e))}catch(e){return[]}}function r(e){e.refObj=!0,e.attributes=e.attributes||{},e.setAttribute=function(t,o){e.attributes[t]=o},e.getAttribute=function(t){return e.attributes[t]},e.removeAttribute=function(t){delete e.attributes[t]},e.hasAttribute=function(t){return t in e.attributes},e.addEventListener=function(){},e.removeEventListener=function(){},e.classList={classNames:{},add:function(t){return e.classList.classNames[t]=!0},remove:function(t){return delete e.classList.classNames[t],!0},contains:function(t){return t in e.classList.classNames}}}function s(e){for(var t=['','webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),n=0;n'):p.classList.add('tippy-arrow'),n.appendChild(p)}if(o.animateFill){n.setAttribute('data-animatefill','');var l=a();l.classList.add('tippy-backdrop'),l.setAttribute('data-state','hidden'),n.appendChild(l)}o.inertia&&n.setAttribute('data-inertia',''),o.interactive&&n.setAttribute('data-interactive','');var d=o.html;if(d){var c;d instanceof Element?(r.appendChild(d),c='#'+(d.id||'tippy-html-template')):(r.innerHTML=document.querySelector(d).innerHTML,c=d),i.setAttribute('data-html',''),n.setAttribute('data-template-id',c),o.interactive&&i.setAttribute('tabindex','-1')}else r[o.allowTitleHTML?'innerHTML':'textContent']=t;return n.appendChild(r),i.appendChild(n),i}function l(e,t,o,i){var n=o.onTrigger,r=o.onMouseLeave,s=o.onBlur,a=o.onDelegateShow,p=o.onDelegateHide,l=[];if('manual'===e)return l;var d=function(e,o){t.addEventListener(e,o),l.push({event:e,handler:o})};return i.target?(je.supportsTouch&&i.touchHold&&(d('touchstart',a),d('touchend',p)),'mouseenter'===e&&(d('mouseover',a),d('mouseout',p)),'focus'===e&&(d('focusin',a),d('focusout',p)),'click'===e&&d('click',a)):(d(e,n),je.supportsTouch&&i.touchHold&&(d('touchstart',n),d('touchend',r)),'mouseenter'===e&&d('mouseleave',r),'focus'===e&&d(ze?'focusout':'blur',s)),l}function d(e,t){var o=Ve.reduce(function(o,i){var n=e.getAttribute('data-tippy-'+i.toLowerCase())||t[i];return'false'===n&&(n=!1),'true'===n&&(n=!0),isFinite(n)&&!isNaN(parseFloat(n))&&(n=parseFloat(n)),'target'!==i&&'string'==typeof n&&'['===n.trim().charAt(0)&&(n=JSON.parse(n)),o[i]=n,o},{});return Ze({},t,o)}function c(e,t){return t.arrow&&(t.animateFill=!1),t.appendTo&&'function'==typeof t.appendTo&&(t.appendTo=t.appendTo()),'function'==typeof t.html&&(t.html=t.html(e)),t}function f(e){var t=function(t){return e.querySelector(t)};return{tooltip:t(Xe.TOOLTIP),backdrop:t(Xe.BACKDROP),content:t(Xe.CONTENT),arrow:t(Xe.ARROW)||t(Xe.ROUND_ARROW)}}function m(e){var t=e.getAttribute('title');t&&e.setAttribute('data-original-title',t),e.removeAttribute('title')}function u(e){return e&&'[object Function]'==={}.toString.call(e)}function h(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function g(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function b(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var t=h(e),o=t.overflow,i=t.overflowX,n=t.overflowY;return /(auto|scroll|overlay)/.test(o+n+i)?e:b(g(e))}function y(e){return 11===e?it:10===e?nt:it||nt}function v(e){if(!e)return document.documentElement;for(var t=y(10)?document.body:null,o=e.offsetParent;o===t&&e.nextElementSibling;)o=(e=e.nextElementSibling).offsetParent;var i=o&&o.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TD','TABLE'].indexOf(o.nodeName)&&'static'===h(o,'position')?v(o):o:e?e.ownerDocument.documentElement:document.documentElement}function w(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||v(e.firstElementChild)===e)}function E(e){return null===e.parentNode?e:E(e.parentNode)}function T(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);var s=r.commonAncestorContainer;if(e!==s&&t!==s||i.contains(n))return w(s)?s:v(s);var a=E(e);return a.host?T(a.host,t):T(e,E(t).host)}function L(e){var t=1=o.clientWidth&&i>=o.clientHeight}),d=0r,bottom:n-a.bottom>r,left:a.left-i>r,right:i-a.right>r};return'top'===p?d.top=a.top-n>l:'bottom'===p?d.bottom=n-a.bottom>l:'left'===p?d.left=a.left-i>l:'right'===p?d.right=i-a.right>l:void 0,d.top||d.bottom||d.left||d.right}function me(e,t,o,i){if(!t.length)return'';var n={scale:function(){return 1===t.length?''+t[0]:o?t[0]+', '+t[1]:t[1]+', '+t[0]}(),translate:function(){return 1===t.length?i?-t[0]+'px':t[0]+'px':o?i?t[0]+'px, '+-t[1]+'px':t[0]+'px, '+t[1]+'px':i?-t[1]+'px, '+t[0]+'px':t[1]+'px, '+t[0]+'px'}()};return n[e]}function ue(e,t){if(!e)return'';return t?e:{X:'Y',Y:'X'}[e]}function he(e,t,o){var i=ce(e),n='top'===i||'bottom'===i,r='right'===i||'bottom'===i,a=function(e){var t=o.match(e);return t?t[1]:''},p=function(e){var t=o.match(e);return t?t[1].split(',').map(parseFloat):[]},l={translate:/translateX?Y?\(([^)]+)\)/,scale:/scaleX?Y?\(([^)]+)\)/},d={translate:{axis:a(/translate([XY])/),numbers:p(l.translate)},scale:{axis:a(/scale([XY])/),numbers:p(l.scale)}},c=o.replace(l.translate,'translate'+ue(d.translate.axis,n)+'('+me('translate',d.translate.numbers,n,r)+')').replace(l.scale,'scale'+ue(d.scale.axis,n)+'('+me('scale',d.scale.numbers,n,r)+')');t.style[s('transform')]=c}function ge(e){return-(e-Ke.distance)+'px'}function be(e){requestAnimationFrame(function(){setTimeout(e,1)})}function ye(t,o){var i=Element.prototype.closest||function(t){for(var o=this;o;){if(e.call(o,t))return o;o=o.parentElement}};return i.call(t,o)}function ve(e,t){return Array.isArray(e)?e[t]:e}function we(e,t){e.forEach(function(e){e&&e.setAttribute('data-state',t)})}function Ee(e,t){e.filter(Boolean).forEach(function(e){e.style[s('transitionDuration')]=t+'ms'})}function Te(e){var t=window.scrollX||window.pageXOffset,o=window.scrollY||window.pageYOffset;e.focus(),scroll(t,o)}function Le(){var e=this._(ht).lastTriggerEvent;return this.options.followCursor&&!je.usingTouch&&e&&'focus'!==e.type}function Oe(e){var t=ye(e.target,this.options.target);if(t&&!t._tippy){var o=t.getAttribute('title')||this.title;o&&(t.setAttribute('title',o),We(t,Ze({},this.options,{target:null})),xe.call(t._tippy,e))}}function xe(e){var t=this,o=this.options;if(Pe.call(this),!this.state.visible){if(o.target)return void Oe.call(this,e);if(this._(ht).isPreparingToShow=!0,o.wait)return void o.wait.call(this.popper,this.show.bind(this),e);if(Le.call(this)){this._(ht).followCursorListener||Ie.call(this);var i=f(this.popper),n=i.arrow;n&&(n.style.margin='0'),document.addEventListener('mousemove',this._(ht).followCursorListener)}var r=ve(o.delay,0);r?this._(ht).showTimeout=setTimeout(function(){t.show()},r):this.show()}}function Ae(){var e=this;if(Pe.call(this),!!this.state.visible){this._(ht).isPreparingToShow=!1;var t=ve(this.options.delay,1);t?this._(ht).hideTimeout=setTimeout(function(){e.state.visible&&e.hide()},t):this.hide()}}function Ce(){var e=this;return{onTrigger:function(t){if(e.state.enabled){var o=je.supportsTouch&&je.usingTouch&&-1<['mouseenter','mouseover','focus'].indexOf(t.type);o&&e.options.touchHold||(e._(ht).lastTriggerEvent=t,'click'===t.type&&'persistent'!==e.options.hideOnClick&&e.state.visible?Ae.call(e):xe.call(e,t))}},onMouseLeave:function(t){if(!(-1<['mouseleave','mouseout'].indexOf(t.type)&&je.supportsTouch&&je.usingTouch&&e.options.touchHold)){if(e.options.interactive){var o=Ae.bind(e),i=function t(i){var n=ye(i.target,Xe.REFERENCE),r=ye(i.target,Xe.POPPER)===e.popper,s=n===e.reference;r||s||fe(i,e.popper,e.options)&&(document.body.removeEventListener('mouseleave',o),document.removeEventListener('mousemove',t),Ae.call(e,t))};return document.body.addEventListener('mouseleave',o),void document.addEventListener('mousemove',i)}Ae.call(e)}},onBlur:function(t){if(!(t.target!==e.reference||je.usingTouch)){if(e.options.interactive){if(!t.relatedTarget)return;if(ye(t.relatedTarget,Xe.POPPER))return}Ae.call(e)}},onDelegateShow:function(t){ye(t.target,e.options.target)&&xe.call(e,t)},onDelegateHide:function(t){ye(t.target,e.options.target)&&Ae.call(e)}}}function ke(){var e=this,t=this.popper,o=this.reference,i=this.options,n=f(t),r=n.tooltip,s=i.popperOptions,a='round'===i.arrowType?Xe.ROUND_ARROW:Xe.ARROW,p=r.querySelector(a),l=Ze({placement:i.placement},s||{},{modifiers:Ze({},s?s.modifiers:{},{arrow:Ze({element:a},s&&s.modifiers?s.modifiers.arrow:{}),flip:Ze({enabled:i.flip,padding:i.distance+5,behavior:i.flipBehavior},s&&s.modifiers?s.modifiers.flip:{}),offset:Ze({offset:i.offset},s&&s.modifiers?s.modifiers.offset:{})}),onCreate:function(){r.style[ce(t)]=ge(i.distance),p&&i.arrowTransform&&he(t,p,i.arrowTransform)},onUpdate:function(){var e=r.style;e.top='',e.bottom='',e.left='',e.right='',e[ce(t)]=ge(i.distance),p&&i.arrowTransform&&he(t,p,i.arrowTransform)}});return Re.call(this,{target:t,callback:function(){e.popperInstance.update()},options:{childList:!0,subtree:!0,characterData:!0}}),new ft(o,t,l)}function Se(e){var t=this.options;if(this.popperInstance?(this.popperInstance.scheduleUpdate(),t.livePlacement&&!Le.call(this)&&this.popperInstance.enableEventListeners()):(this.popperInstance=ke.call(this),!t.livePlacement&&this.popperInstance.disableEventListeners()),!Le.call(this)){var o=f(this.popper),i=o.arrow;i&&(i.style.margin=''),this.popperInstance.reference=this.reference}de(this.popperInstance,e,!0),t.appendTo.contains(this.popper)||t.appendTo.appendChild(this.popper)}function Pe(){var e=this._(ht),t=e.showTimeout,o=e.hideTimeout;clearTimeout(t),clearTimeout(o)}function Ie(){var e=this;this._(ht).followCursorListener=function(t){var o=e._(ht).lastMouseMoveEvent=t,i=o.clientX,n=o.clientY;e.popperInstance&&(e.popperInstance.reference={getBoundingClientRect:function(){return{width:0,height:0,top:n,left:i,right:i,bottom:n}},clientWidth:0,clientHeight:0},e.popperInstance.scheduleUpdate())}}function De(){var e=this,t=function(){e.popper.style[s('transitionDuration')]=e.options.updateDuration+'ms'},o=function(){e.popper.style[s('transitionDuration')]=''};(function i(){e.popperInstance&&e.popperInstance.update(),t(),e.state.visible?requestAnimationFrame(i):o()})()}function Re(e){var t=e.target,o=e.callback,i=e.options;if(window.MutationObserver){var n=new MutationObserver(o);n.observe(t,i),this._(ht).mutationObservers.push(n)}}function _e(e,t){if(!e)return t();var o=f(this.popper),i=o.tooltip,n=function(e,t){t&&i[e+'EventListener']('ontransitionend'in window?'transitionend':'webkitTransitionEnd',t)},r=function o(r){r.target===i&&(n('remove',o),t())};n('remove',this._(ht).transitionendListener),n('add',r),this._(ht).transitionendListener=r}function He(e,t){return e.reduce(function(e,o){var i=yt,n=c(o,t.performance?t:d(o,t)),r=o.getAttribute('title');if(!r&&!n.target&&!n.html&&!n.dynamicTitle)return e;o.setAttribute(n.target?'data-tippy-delegate':'data-tippy',''),m(o);var s=p(i,r,n),a=new bt({id:i,reference:o,popper:s,options:n,title:r,popperInstance:null});n.createPopperInstanceOnInit&&(a.popperInstance=ke.call(a),a.popperInstance.disableEventListeners());var u=Ce.call(a);return a.listeners=n.trigger.trim().split(' ').reduce(function(e,t){return e.concat(l(t,o,u,n))},[]),n.dynamicTitle&&Re.call(a,{target:o,callback:function(){var e=f(s),t=e.content,i=o.getAttribute('title');i&&(t[n.allowTitleHTML?'innerHTML':'textContent']=a.title=i,m(o))},options:{attributes:!0}}),o._tippy=a,s._tippy=a,s._reference=o,e.push(a),yt++,e},[])}function Ne(e){var t=o(document.querySelectorAll(Xe.POPPER));t.forEach(function(t){var o=t._tippy;if(o){var i=o.options;(!0===i.hideOnClick||-1t-e&&(je.usingTouch=!1,document.removeEventListener('mousemove',i),!je.iOS&&document.body.classList.remove('tippy-touch'),je.onUserInputChange('mouse')),e=t}}();document.addEventListener('click',function(e){if(!(e.target instanceof Element))return Ne();var t=ye(e.target,Xe.REFERENCE),o=ye(e.target,Xe.POPPER);if(!(o&&o._tippy&&o._tippy.options.interactive)){if(t&&t._tippy){var i=t._tippy.options,n=-1p[e]&&!t.escapeWithReference&&(i=Be(d[o],p[e]-('right'===e?d.width:d.height))),at({},o,i)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';d=pt({},d,c[t](e))}),e.offsets.popper=d,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split('-')[0],r=Fe,s=-1!==['top','bottom'].indexOf(n),a=s?'right':'bottom',p=s?'left':'top',l=s?'width':'height';return o[a]r(i[a])&&(e.offsets.popper[p]=r(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var o;if(!ie(e.instance.modifiers,'arrow','keepTogether'))return e;var i=t.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var n=e.placement.split('-')[0],r=e.offsets,s=r.popper,a=r.reference,p=-1!==['left','right'].indexOf(n),l=p?'height':'width',d=p?'Top':'Left',c=d.toLowerCase(),f=p?'left':'top',m=p?'bottom':'right',u=W(i)[l];a[m]-us[m]&&(e.offsets.popper[c]+=a[c]+u-s[m]),e.offsets.popper=k(e.offsets.popper);var g=a[c]+a[l]/2-u/2,b=h(e.instance.popper),y=parseFloat(b['margin'+d],10),v=parseFloat(b['border'+d+'Width'],10),w=g-e.offsets.popper[c]-y-v;return w=Ye(Be(s[l]-u,w),0),e.arrowElement=i,e.offsets.arrow=(o={},at(o,c,Ue(w)),at(o,f,''),o),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(j(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=_(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split('-')[0],n=B(i),r=e.placement.split('-')[1]||'',s=[];switch(t.behavior){case ct.FLIP:s=[i,n];break;case ct.CLOCKWISE:s=re(i);break;case ct.COUNTERCLOCKWISE:s=re(i,!0);break;default:s=t.behavior;}return s.forEach(function(a,p){if(i!==a||s.length===p+1)return e;i=e.placement.split('-')[0],n=B(i);var l=e.offsets.popper,d=e.offsets.reference,c=Fe,f='left'===i&&c(l.right)>c(d.left)||'right'===i&&c(l.left)c(d.top)||'bottom'===i&&c(l.top)c(o.right),h=c(l.top)c(o.bottom),b='left'===i&&m||'right'===i&&u||'top'===i&&h||'bottom'===i&&g,y=-1!==['top','bottom'].indexOf(i),v=!!t.flipVariations&&(y&&'start'===r&&m||y&&'end'===r&&u||!y&&'start'===r&&h||!y&&'end'===r&&g);(f||b||v)&&(e.flipped=!0,(f||b)&&(i=s[p+1]),v&&(r=ne(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=pt({},e.offsets.popper,U(e.instance.popper,e.offsets.reference,e.placement)),e=q(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],i=e.offsets,n=i.popper,r=i.reference,s=-1!==['left','right'].indexOf(o),a=-1===['top','left'].indexOf(o);return n[s?'left':'top']=r[o]-(a?n[s?'width':'height']:0),e.placement=B(t),e.offsets.popper=k(n),e}},hide:{order:800,enabled:!0,fn:function(e){if(!ie(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=F(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right