@livelybone/react-popper
Version:
A wrap of react-popper, achieved visible controlling via click/hover event or ref.show/ref.hide/ref.toggle
10 lines (8 loc) • 49.9 kB
JavaScript
/**
* Bundle of @livelybone/react-popper
* Generated: 2020-03-29
* Version: 1.8.2
* License: MIT
* Author: 2631541504@qq.com
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactPopper={},e.React)}(this,function(e,o){"use strict";var b="default"in o?o.default:o;function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(e){return t(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)})(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],0<=t.indexOf(n)||(o[n]=e[n]);return o},c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var l=u(function(e){function t(){return e.exports=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},t.apply(this,arguments)}e.exports=t});var d=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var h=function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t};for(var m=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},y="undefined"!=typeof window&&"undefined"!=typeof document,v=["Edge","Trident","Firefox"],g=0,w=0;w<v.length;w+=1)if(y&&0<=navigator.userAgent.indexOf(v[w])){g=1;break}var E=y&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},g))}};function O(e){return e&&"[object Function]"==={}.toString.call(e)}function x(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function S(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function P(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=x(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:P(S(e))}var T=y&&!(!window.MSInputMethodContext||!document.documentMode),j=y&&/MSIE 10/.test(navigator.userAgent);function M(e){return 11===e?T:10===e?j:T||j}function N(e){if(!e)return document.documentElement;for(var t=M(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===x(n,"position")?N(n):n:e?e.ownerDocument.documentElement:document.documentElement}function C(e){return null!==e.parentNode?C(e.parentNode):e}function _(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||N(e.firstElementChild)===e)}(a)?a:N(a);var s=C(e);return s.host?_(s.host,t):_(e,C(t).host)}function k(e,t){var n="top"===(1<arguments.length&&void 0!==t?t:"top")?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"!==r&&"HTML"!==r)return e[n];var o=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||o)[n]}function A(e,t){var n="x"===t?"Left":"Top",r="Left"==n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function R(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],M(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function D(e){var t=e.body,n=e.documentElement,r=M(10)&&getComputedStyle(n);return{height:R("Height",t,n,r),width:R("Width",t,n,r)}}var F=function(e,t,n){return t&&I(e.prototype,t),n&&I(e,n),e};function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $=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};function H(e){return $({},e,{right:e.left+e.width,bottom:e.top+e.height})}function W(e){var t={};try{if(M(10)){t=e.getBoundingClientRect();var n=k(e,"top"),r=k(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?D(e.ownerDocument):{},a=i.width||e.clientWidth||o.right-o.left,s=i.height||e.clientHeight||o.bottom-o.top,f=e.offsetWidth-a,c=e.offsetHeight-s;if(f||c){var p=x(e);f-=A(p,"x"),c-=A(p,"y"),o.width-=f,o.height-=c}return H(o)}function B(e,t,n){var r=2<arguments.length&&void 0!==n&&n,o=M(10),i="HTML"===t.nodeName,a=W(e),s=W(t),f=P(e),c=x(t),p=parseFloat(c.borderTopWidth,10),u=parseFloat(c.borderLeftWidth,10);r&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var l=H({top:a.top-s.top-p,left:a.left-s.left-u,width:a.width,height:a.height});if(l.marginTop=0,l.marginLeft=0,!o&&i){var d=parseFloat(c.marginTop,10),h=parseFloat(c.marginLeft,10);l.top-=p-d,l.bottom-=p-d,l.left-=u-h,l.right-=u-h,l.marginTop=d,l.marginLeft=h}return(o&&!r?t.contains(f):t===f&&"BODY"!==f.nodeName)&&(l=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,o=k(t,"top"),i=k(t,"left"),a=r?-1:1;return e.top+=o*a,e.bottom+=o*a,e.left+=i*a,e.right+=i*a,e}(l,t)),l}function V(e){if(!e||!e.parentElement||M())return document.documentElement;for(var t=e.parentElement;t&&"none"===x(t,"transform");)t=t.parentElement;return t||document.documentElement}function U(e,t,n,r,o){var i=4<arguments.length&&void 0!==o&&o,a={top:0,left:0},s=i?V(e):_(e,t);if("viewport"===r)a=function(e,t){var n=1<arguments.length&&void 0!==t&&t,r=e.ownerDocument.documentElement,o=B(e,r),i=Math.max(r.clientWidth,window.innerWidth||0),a=Math.max(r.clientHeight,window.innerHeight||0),s=n?0:k(r),f=n?0:k(r,"left");return H({top:s-o.top+o.marginTop,left:f-o.left+o.marginLeft,width:i,height:a})}(s,i);else{var f=void 0;"scrollParent"===r?"BODY"===(f=P(S(t))).nodeName&&(f=e.ownerDocument.documentElement):f="window"===r?e.ownerDocument.documentElement:r;var c=B(f,s,i);if("HTML"!==f.nodeName||function e(t){var n=t.nodeName;if("BODY"===n||"HTML"===n)return!1;if("fixed"===x(t,"position"))return!0;var r=S(t);return!!r&&e(r)}(s))a=c;else{var p=D(e.ownerDocument),u=p.height,l=p.width;a.top+=c.top-c.marginTop,a.bottom=u+c.top,a.left+=c.left-c.marginLeft,a.right=l+c.left}}var d="number"==typeof(n=n||0);return a.left+=d?n:n.left||0,a.top+=d?n:n.top||0,a.right-=d?n:n.right||0,a.bottom-=d?n:n.bottom||0,a}function q(e,t,r,n,o,i){var a=5<arguments.length&&void 0!==i?i:0;if(-1===e.indexOf("auto"))return e;var s=U(r,n,a,o),f={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},c=Object.keys(f).map(function(e){return $({key:e},f[e],{area:function(e){return e.width*e.height}(f[e])})}).sort(function(e,t){return t.area-e.area}),p=c.filter(function(e){var t=e.width,n=e.height;return t>=r.clientWidth&&n>=r.clientHeight}),u=0<p.length?p[0].key:c[0].key,l=e.split("-")[1];return u+(l?"-"+l:"")}function z(e,t,n,r){var o=3<arguments.length&&void 0!==r?r:null;return B(n,o?V(t):_(t,n),o)}function Y(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function G(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function J(e,t,n){n=n.split("-")[0];var r=Y(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",c=i?"width":"height";return o[a]=t[a]+t[f]/2-r[f]/2,o[s]=n===s?t[s]-r[c]:t[G(s)],o}function X(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function K(e,n,t){return(void 0===t?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=X(e,function(e){return e[t]===n});return e.indexOf(r)}(e,"name",t))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var t=e.function||e.fn;e.enabled&&O(t)&&(n.offsets.popper=H(n.offsets.popper),n.offsets.reference=H(n.offsets.reference),n=t(n,e))}),n}function Q(e,n){return e.some(function(e){var t=e.name;return e.enabled&&t===n})}function Z(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function ee(e){var t=e.ownerDocument;return t?t.defaultView:window}function te(e,t,n,r){n.updateBound=r,ee(e).addEventListener("resize",n.updateBound,{passive:!0});var o=P(e);return function e(t,n,r,o){var i="BODY"===t.nodeName,a=i?t.ownerDocument.defaultView:t;a.addEventListener(n,r,{passive:!0}),i||e(P(a.parentNode),n,r,o),o.push(a)}(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function ne(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=function(e,t){return ee(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}(this.reference,this.state))}function re(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function oe(n,r){Object.keys(r).forEach(function(e){var t="";-1!==["width","height","top","right","bottom","left"].indexOf(e)&&re(r[e])&&(t="px"),n.style[e]=r[e]+t})}var ie=y&&/Firefox/i.test(navigator.userAgent);function ae(e,t,n){var r=X(e,function(e){return e.name===t}),o=!!r&&e.some(function(e){return e.name===n&&e.enabled&&e.order<r.order});if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var se=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],fe=se.slice(3);function ce(e,t){var n=1<arguments.length&&void 0!==t&&t,r=fe.indexOf(e),o=fe.slice(r+1).concat(fe.slice(0,r));return n?o.reverse():o}var pe="flip",ue="clockwise",le="counterclockwise";function de(e,o,i,t){var a=[0,0],s=-1!==["right","left"].indexOf(t),n=e.split(/(\+|\-)/).map(function(e){return e.trim()}),r=n.indexOf(X(n,function(e){return-1!==e.search(/,|\s/)}));n[r]&&-1===n[r].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/,c=-1!==r?[n.slice(0,r).concat([n[r].split(f)[0]]),[n[r].split(f)[1]].concat(n.slice(r+1))]:[n];return(c=c.map(function(e,t){var n=(1===t?!s:s)?"height":"width",r=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,r=!0,e):r?(e[e.length-1]+=t,r=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0!==a.indexOf("%"))return"vh"!==a&&"vw"!==a?i:("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return H(s)[t]/100*i}(e,n,o,i)})})).forEach(function(n,r){n.forEach(function(e,t){re(e)&&(a[r]+=e*("-"===n[t-1]?-1:1))})}),a}var he={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),f=s?"left":"top",c=s?"width":"height",p={start:L({},f,i[f]),end:L({},f,i[f]+i[c]-a[c])};e.offsets.popper=$({},a,p[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],f=void 0;return f=re(+n)?[+n,0]:de(n,i,a,s),"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,r){var t=r.boundariesElement||N(e.instance.popper);e.instance.reference===t&&(t=N(t));var n=Z("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[n];o.top="",o.left="",o[n]="";var f=U(e.instance.popper,e.instance.reference,r.padding,t,e.positionFixed);o.top=i,o.left=a,o[n]=s,r.boundaries=f;var c=r.priority,p=e.offsets.popper,u={primary:function(e){var t=p[e];return p[e]<f[e]&&!r.escapeWithReference&&(t=Math.max(p[e],f[e])),L({},e,t)},secondary:function(e){var t="right"===e?"left":"top",n=p[t];return p[e]>f[e]&&!r.escapeWithReference&&(n=Math.min(p[t],f[e]-("right"===e?p.width:p.height))),L({},t,n)}};return c.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";p=$({},p,u[t](e))}),e.offsets.popper=p,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",f=a?"left":"top",c=a?"width":"height";return n[s]<i(r[f])&&(e.offsets.popper[f]=i(r[f])-n[c]),n[f]>i(r[s])&&(e.offsets.popper[f]=i(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!ae(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,f=-1!==["left","right"].indexOf(o),c=f?"height":"width",p=f?"Top":"Left",u=p.toLowerCase(),l=f?"left":"top",d=f?"bottom":"right",h=Y(r)[c];s[d]-h<a[u]&&(e.offsets.popper[u]-=a[u]-(s[d]-h)),s[u]+h>a[d]&&(e.offsets.popper[u]+=s[u]+h-a[d]),e.offsets.popper=H(e.offsets.popper);var m=s[u]+s[c]/2-h/2,y=x(e.instance.popper),v=parseFloat(y["margin"+p],10),b=parseFloat(y["border"+p+"Width"],10),g=m-e.offsets.popper[u]-v-b;return g=Math.max(Math.min(a[c]-h,g),0),e.arrowElement=r,e.offsets.arrow=(L(n={},u,Math.round(g)),L(n,l,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(m,y){if(Q(m.instance.modifiers,"inner"))return m;if(m.flipped&&m.placement===m.originalPlacement)return m;var v=U(m.instance.popper,m.instance.reference,y.padding,y.boundariesElement,m.positionFixed),b=m.placement.split("-")[0],g=G(b),w=m.placement.split("-")[1]||"",E=[];switch(y.behavior){case pe:E=[b,g];break;case ue:E=ce(b);break;case le:E=ce(b,!0);break;default:E=y.behavior}return E.forEach(function(e,t){if(b!==e||E.length===t+1)return m;b=m.placement.split("-")[0],g=G(b);var n=m.offsets.popper,r=m.offsets.reference,o=Math.floor,i="left"===b&&o(n.right)>o(r.left)||"right"===b&&o(n.left)<o(r.right)||"top"===b&&o(n.bottom)>o(r.top)||"bottom"===b&&o(n.top)<o(r.bottom),a=o(n.left)<o(v.left),s=o(n.right)>o(v.right),f=o(n.top)<o(v.top),c=o(n.bottom)>o(v.bottom),p="left"===b&&a||"right"===b&&s||"top"===b&&f||"bottom"===b&&c,u=-1!==["top","bottom"].indexOf(b),l=!!y.flipVariations&&(u&&"start"===w&&a||u&&"end"===w&&s||!u&&"start"===w&&f||!u&&"end"===w&&c),d=!!y.flipVariationsByContent&&(u&&"start"===w&&s||u&&"end"===w&&a||!u&&"start"===w&&c||!u&&"end"===w&&f),h=l||d;(i||p||h)&&(m.flipped=!0,(i||p)&&(b=E[t+1]),h&&(w=function(e){return"end"===e?"start":"start"===e?"end":e}(w)),m.placement=b+(w?"-"+w:""),m.offsets.popper=$({},m.offsets.popper,J(m.instance.popper,m.offsets.reference,m.placement)),m=K(m.instance.modifiers,m,"flip"))}),m},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=G(t),e.offsets.popper=H(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!ae(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=X(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=X(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,s=N(e.instance.popper),f=W(s),c={position:o.position},p=function(e,t){function n(e){return e}var r=e.offsets,o=r.popper,i=r.reference,a=Math.round,s=Math.floor,f=a(i.width),c=a(o.width),p=-1!==["left","right"].indexOf(e.placement),u=-1!==e.placement.indexOf("-"),l=t?p||u||f%2==c%2?a:s:n,d=t?a:n;return{left:l(f%2==1&&c%2==1&&!u&&t?o.left-1:o.left),top:d(o.top),bottom:d(o.bottom),right:l(o.right)}}(e,window.devicePixelRatio<2||!ie),u="bottom"===n?"top":"bottom",l="right"===r?"left":"right",d=Z("transform"),h=void 0,m=void 0;if(m="bottom"==u?"HTML"===s.nodeName?-s.clientHeight+p.bottom:-f.height+p.bottom:p.top,h="right"==l?"HTML"===s.nodeName?-s.clientWidth+p.right:-f.width+p.right:p.left,a&&d)c[d]="translate3d("+h+"px, "+m+"px, 0)",c[u]=0,c[l]=0,c.willChange="transform";else{var y="bottom"==u?-1:1,v="right"==l?-1:1;c[u]=m*y,c[l]=h*v,c.willChange=u+", "+l}var b={"x-placement":e.placement};return e.attributes=$({},b,e.attributes),e.styles=$({},c,e.styles),e.arrowStyles=$({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){return oe(e.instance.popper,e.styles),function(t,n){Object.keys(n).forEach(function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})}(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&oe(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=z(o,t,e,n.positionFixed),a=q(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),oe(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},me=(F(ye,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=z(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=q(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=J(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=K(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,Q(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[Z("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=te(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return ne.call(this)}}]),ye);function ye(e,t){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ye),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=E(this.update.bind(this)),this.options=$({},ye.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=t&&t.jquery?t[0]:t,this.options.modifiers={},Object.keys($({},ye.Defaults.modifiers,r.modifiers)).forEach(function(e){n.options.modifiers[e]=$({},ye.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return $({name:e},n.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&O(e.onLoad)&&e.onLoad(n.reference,n.popper,n.options,e,n.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}me.Utils=("undefined"!=typeof window?window:global).PopperUtils,me.placements=se,me.Defaults=he;var ve=u(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,f=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,l=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case p:case u:case i:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case c:case l:case f:return e;default:return t}}case y:case m:case o:return t}}}function w(e){return g(e)===u}t.typeOf=g,t.AsyncMode=p,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=f,t.Element=r,t.ForwardRef=l,t.Fragment=i,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=d,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===u||e===s||e===a||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===f||e.$$typeof===c||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b)},t.isAsyncMode=function(e){return w(e)||g(e)===p},t.isConcurrentMode=w,t.isContextConsumer=function(e){return g(e)===c},t.isContextProvider=function(e){return g(e)===f},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===l},t.isFragment=function(e){return g(e)===i},t.isLazy=function(e){return g(e)===y},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===o},t.isProfiler=function(e){return g(e)===s},t.isStrictMode=function(e){return g(e)===a},t.isSuspense=function(e){return g(e)===d}});p(ve);ve.typeOf,ve.AsyncMode,ve.ConcurrentMode,ve.ContextConsumer,ve.ContextProvider,ve.Element,ve.ForwardRef,ve.Fragment,ve.Lazy,ve.Memo,ve.Portal,ve.Profiler,ve.StrictMode,ve.Suspense,ve.isValidElementType,ve.isAsyncMode,ve.isConcurrentMode,ve.isContextConsumer,ve.isContextProvider,ve.isElement,ve.isForwardRef,ve.isFragment,ve.isLazy,ve.isMemo,ve.isPortal,ve.isProfiler,ve.isStrictMode,ve.isSuspense;var be=u(function(e,R){"production"!==process.env.NODE_ENV&&function(){Object.defineProperty(R,"__esModule",{value:!0});var e="function"==typeof Symbol&&Symbol.for,o=e?Symbol.for("react.element"):60103,i=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,f=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,p=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,t=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,n=e?Symbol.for("react.fundamental"):60117,r=e?Symbol.for("react.responder"):60118;var v=function(e,t){if(void 0===t)throw new Error("`lowPriorityWarning(condition, format, ...args)` requires a warning message argument");if(!e){for(var n=arguments.length,r=Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];(function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.warn(i);try{throw new Error(i)}catch(e){}}).apply(void 0,[t].concat(r))}};function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:var n=e.type;switch(n){case u:case l:case a:case f:case s:case h:return n;default:var r=n&&n.$$typeof;switch(r){case p:case d:case c:return r;default:return t}}case y:case m:case i:return t}}}var g=u,w=l,E=p,O=c,x=o,S=d,P=a,T=y,j=m,M=i,N=f,C=s,_=h,k=!1;function A(e){return b(e)===l}R.typeOf=b,R.AsyncMode=g,R.ConcurrentMode=w,R.ContextConsumer=E,R.ContextProvider=O,R.Element=x,R.ForwardRef=S,R.Fragment=P,R.Lazy=T,R.Memo=j,R.Portal=M,R.Profiler=N,R.StrictMode=C,R.Suspense=_,R.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===l||e===f||e===s||e===h||e===t||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===p||e.$$typeof===d||e.$$typeof===n||e.$$typeof===r)},R.isAsyncMode=function(e){return k||v(!(k=!0),"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."),A(e)||b(e)===u},R.isConcurrentMode=A,R.isContextConsumer=function(e){return b(e)===p},R.isContextProvider=function(e){return b(e)===c},R.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},R.isForwardRef=function(e){return b(e)===d},R.isFragment=function(e){return b(e)===a},R.isLazy=function(e){return b(e)===y},R.isMemo=function(e){return b(e)===m},R.isPortal=function(e){return b(e)===i},R.isProfiler=function(e){return b(e)===f},R.isStrictMode=function(e){return b(e)===s},R.isSuspense=function(e){return b(e)===h}}()});p(be);be.typeOf,be.AsyncMode,be.ConcurrentMode,be.ContextConsumer,be.ContextProvider,be.Element,be.ForwardRef,be.Fragment,be.Lazy,be.Memo,be.Portal,be.Profiler,be.StrictMode,be.Suspense,be.isValidElementType,be.isAsyncMode,be.isConcurrentMode,be.isContextConsumer,be.isContextProvider,be.isElement,be.isForwardRef,be.isFragment,be.isLazy,be.isMemo,be.isPortal,be.isProfiler,be.isStrictMode,be.isSuspense;var ge=u(function(e){"production"===process.env.NODE_ENV?e.exports=ve:e.exports=be}),we=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var xe=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))Ee.call(n,a)&&(o[a]=n[a]);if(we){r=we(n);for(var s=0;s<r.length;s++)Oe.call(n,r[s])&&(o[r[s]]=n[r[s]])}}return o},Se="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Pe=function(){};if("production"!==process.env.NODE_ENV){var Te=Se,je={},Me=Function.call.bind(Object.prototype.hasOwnProperty);Pe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Ne(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Me(e,i)){var a;try{if("function"!=typeof e[i]){var s=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw s.name="Invariant Violation",s}a=e[i](t,i,r,n,null,Te)}catch(e){a=e}if(!a||a instanceof Error||Pe((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in je)){je[a.message]=!0;var f=o?o():"";Pe("Failed "+n+" type: "+a.message+(null!=f?f:""))}}}Ne.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(je={})};var Ce=Ne,_e=Function.call.bind(Object.prototype.hasOwnProperty),ke=function(){};function Ae(){return null}"production"!==process.env.NODE_ENV&&(ke=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}});function Re(a,l){var i="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",d="<<anonymous>>",e={array:t("array"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:n(Ae),arrayOf:function(f){return n(function(e,t,n,r,o){if("function"!=typeof f)return new h("Property `"+o+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var i=e[t];if(!Array.isArray(i))return new h("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected an array.");for(var a=0;a<i.length;a++){var s=f(i,a,n,r,o+"["+a+"]",Se);if(s instanceof Error)return s}return null})},element:n(function(e,t,n,r,o){var i=e[t];return a(i)?null:new h("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:n(function(e,t,n,r,o){var i=e[t];return ge.isValidElementType(i)?null:new h("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(a){return n(function(e,t,n,r,o){if(e[t]instanceof a)return null;var i=a.name||d;return new h("Invalid "+r+" `"+o+"` of type `"+function(e){return e.constructor&&e.constructor.name?e.constructor.name:d}(e[t])+"` supplied to `"+n+"`, expected instance of `"+i+"`.")})},node:n(function(e,t,n,r,o){return f(e[t])?null:new h("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(c){return n(function(e,t,n,r,o){if("function"!=typeof c)return new h("Property `"+o+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var i=e[t],a=m(i);if("object"!==a)return new h("Invalid "+r+" `"+o+"` of type `"+a+"` supplied to `"+n+"`, expected an object.");for(var s in i)if(_e(i,s)){var f=c(i,s,n,r,o+"."+s,Se);if(f instanceof Error)return f}return null})},oneOf:function(f){if(!Array.isArray(f))return"production"!==process.env.NODE_ENV&&ke(1<arguments.length?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Ae;return n(function(e,t,n,r,o){for(var i=e[t],a=0;a<f.length;a++)if(c(i,f[a]))return null;var s=JSON.stringify(f,function(e,t){return"symbol"===p(t)?String(t):t});return new h("Invalid "+r+" `"+o+"` of value `"+String(i)+"` supplied to `"+n+"`, expected one of "+s+".")})},oneOfType:function(a){if(!Array.isArray(a))return"production"!==process.env.NODE_ENV&&ke("Invalid argument supplied to oneOfType, expected an instance of array."),Ae;for(var e=0;e<a.length;e++){var t=a[e];if("function"!=typeof t)return ke("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+r(t)+" at index "+e+"."),Ae}return n(function(e,t,n,r,o){for(var i=0;i<a.length;i++){if(null==(0,a[i])(e,t,n,r,o,Se))return null}return new h("Invalid "+r+" `"+o+"` supplied to `"+n+"`.")})},shape:function(p){return n(function(e,t,n,r,o){var i=e[t],a=m(i);if("object"!==a)return new h("Invalid "+r+" `"+o+"` of type `"+a+"` supplied to `"+n+"`, expected `object`.");for(var s in p){var f=p[s];if(f){var c=f(i,s,n,r,o+"."+s,Se);if(c)return c}}return null})},exact:function(u){return n(function(e,t,n,r,o){var i=e[t],a=m(i);if("object"!==a)return new h("Invalid "+r+" `"+o+"` of type `"+a+"` supplied to `"+n+"`, expected `object`.");var s=xe({},e[t],u);for(var f in s){var c=u[f];if(!c)return new h("Invalid "+r+" `"+o+"` key `"+f+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(e[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(u),null," "));var p=c(i,f,n,r,o+"."+f,Se);if(p)return p}return null})}};function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e){this.message=e,this.stack=""}function n(c){if("production"!==process.env.NODE_ENV)var p={},u=0;function e(e,t,n,r,o,i,a){if(r=r||d,i=i||n,a!==Se){if(l){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var f=r+":"+n;!p[f]&&u<3&&(ke("You are manually calling a React.PropTypes validation function for the `"+i+"` prop on `"+r+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),p[f]=!0,u++)}}return null==t[n]?e?null===t[n]?new h("The "+o+" `"+i+"` is marked as required in `"+r+"`, but its value is `null`."):new h("The "+o+" `"+i+"` is marked as required in `"+r+"`, but its value is `undefined`."):null:c(t,n,r,o,i)}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function t(s){return n(function(e,t,n,r,o,i){var a=e[t];return m(a)===s?null:new h("Invalid "+r+" `"+o+"` of type `"+p(a)+"` supplied to `"+n+"`, expected `"+s+"`.")})}function f(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(f);if(null===e||a(e))return!0;var t=function(e){var t=e&&(i&&e[i]||e[s]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!f(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!f(o[1]))return!1}return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function p(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function r(e){var t=p(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return h.prototype=Error.prototype,e.checkPropTypes=Ce,e.resetWarningCache=Ce.resetWarningCache,e.PropTypes=e}function De(){}function Fe(){}Fe.resetWarningCache=De;function Ie(){return c[$e]=(c[$e]||0)+1}var Le=u(function(e){if("production"!==process.env.NODE_ENV){var t=ge;e.exports=Re(t.isElement,!0)}else e.exports=function(){function e(e,t,n,r,o,i){if(i!==Se){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}var n={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Fe,resetWarningCache:De};return n.PropTypes=n}()}),$e="__global_unique_id__",He=function(){};if("production"!==process.env.NODE_ENV){He=function(e,t,n){var r=arguments.length;n=new Array(2<r?r-2:0);for(var o=2;o<r;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||function(e,t){var n=arguments.length;t=new Array(1<n?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return t[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}}.apply(null,[t].concat(n))}}var We=He,Be=u(function(e,t){t.__esModule=!0;n(b);var u=n(Le),l=n(Ie),d=n(We);function n(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=1073741823;t.default=function(e,o){var t,n,i,r="__create-react-context-"+(0,l.default)()+"__",a=(y(s,i=b.Component),s.prototype.getChildContext=function(){var e;return(e={})[r]=this.emitter,e},s.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,n=e.value,r=void 0;!function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(t,n)?(r="function"==typeof o?o(t,n):v,"production"!==process.env.NODE_ENV&&(0,d.default)((r&v)===r,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",r),0!=(r|=0)&&this.emitter.set(e.value,r)):r=0}},s.prototype.render=function(){return this.props.children},s);function s(){var e,t;h(this,s);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t=m(this,i.call.apply(i,[this].concat(r)))).emitter=function(n){var r=[];return{on:function(e){r.push(e)},off:function(t){r=r.filter(function(e){return e!==t})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}}(t.props.value),m(t,e)}a.childContextTypes=((t={})[r]=u.default.object.isRequired,t);var f,c=(y(p,f=b.Component),p.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?v:t},p.prototype.componentDidMount=function(){this.context[r]&&this.context[r].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?v:e},p.prototype.componentWillUnmount=function(){this.context[r]&&this.context[r].off(this.onUpdate)},p.prototype.getValue=function(){return this.context[r]?this.context[r].get():e},p.prototype.render=function(){return function(e){return Array.isArray(e)?e[0]:e}(this.props.children)(this.state.value)},p);function p(){var e,n;h(this,p);for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return(e=n=m(this,f.call.apply(f,[this].concat(r)))).state={value:n.getValue()},n.onUpdate=function(e,t){0!=((0|n.observedBits)&t)&&n.setState({value:n.getValue()})},m(n,e)}return c.contextTypes=((n={})[r]=u.default.object,n),{Provider:a,Consumer:c}},e.exports=t.default});p(Be);function Ve(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}}var Ue,qe=p(u(function(e,t){t.__esModule=!0;var n=o(b),r=o(Be);function o(e){return e&&e.__esModule?e:{default:e}}t.default=n.default.createContext||r.default,e.exports=t.default}))({setReferenceNode:void 0,referenceNode:void 0}),ze={position:"absolute",top:0,left:0,opacity:0,pointerEvents:"none"},Ye={},Ge=function(o){function e(){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n=o.call.apply(o,[this].concat(t))||this,m(d(n),"state",{data:void 0,placement:void 0}),m(d(n),"popperInstance",void 0),m(d(n),"popperNode",null),m(d(n),"arrowNode",null),m(d(n),"setPopperNode",function(e){e&&n.popperNode!==e&&(Ve(n.props.innerRef,e),n.popperNode=e,n.updatePopperInstance())}),m(d(n),"setArrowNode",function(e){n.arrowNode=e}),m(d(n),"updateStateModifier",{enabled:!0,order:900,fn:function(e){var t=e.placement;return n.setState({data:e,placement:t}),e}}),m(d(n),"getOptions",function(){return{placement:n.props.placement,eventsEnabled:n.props.eventsEnabled,positionFixed:n.props.positionFixed,modifiers:l({},n.props.modifiers,{arrow:l({},n.props.modifiers&&n.props.modifiers.arrow,{enabled:!!n.arrowNode,element:n.arrowNode}),applyStyle:{enabled:!1},updateStateModifier:n.updateStateModifier})}}),m(d(n),"getPopperStyle",function(){return n.popperNode&&n.state.data?l({position:n.state.data.offsets.popper.position},n.state.data.styles):ze}),m(d(n),"getPopperPlacement",function(){return n.state.data?n.state.placement:void 0}),m(d(n),"getArrowStyle",function(){return n.arrowNode&&n.state.data?n.state.data.arrowStyles:Ye}),m(d(n),"getOutOfBoundariesState",function(){return n.state.data?n.state.data.hide:void 0}),m(d(n),"destroyPopperInstance",function(){n.popperInstance&&(n.popperInstance.destroy(),n.popperInstance=null)}),m(d(n),"updatePopperInstance",function(){n.destroyPopperInstance();var e=d(n).popperNode,t=n.props.referenceElement;t&&e&&(n.popperInstance=new me(t,e,n.getOptions()))}),m(d(n),"scheduleUpdate",function(){n.popperInstance&&n.popperInstance.scheduleUpdate()}),n}h(e,o);var t=e.prototype;return t.componentDidUpdate=function(e,t){this.props.placement!==e.placement||this.props.referenceElement!==e.referenceElement||this.props.positionFixed!==e.positionFixed?this.updatePopperInstance():this.props.eventsEnabled!==e.eventsEnabled&&this.popperInstance&&(this.props.eventsEnabled?this.popperInstance.enableEventListeners():this.popperInstance.disableEventListeners()),t.placement!==this.state.placement&&this.scheduleUpdate()},t.componentWillUnmount=function(){Ve(this.props.innerRef,null),this.destroyPopperInstance()},t.render=function(){return function(e){return Array.isArray(e)?e[0]:e}(this.props.children)({ref:this.setPopperNode,style:this.getPopperStyle(),placement:this.getPopperPlacement(),outOfBoundaries:this.getOutOfBoundariesState(),scheduleUpdate:this.scheduleUpdate,arrowProps:{ref:this.setArrowNode,style:this.getArrowStyle()}})},e}(o.Component);function Je(e){var n=e.referenceElement,r=f(e,["referenceElement"]);return o.createElement(qe.Consumer,null,function(e){var t=e.referenceNode;return o.createElement(Ge,l({referenceElement:void 0!==n?n:t},r))})}function Xe(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=r[0],a=r[1],s=me.Defaults.modifiers.arrow.fn(i,a),f=/^(bottom|top)/.test(s.placement)?"left":"top";return s.offsets.arrow[f]=Ke(s,f,e,t),s}function Ke(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"middle",r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:15,o=e.offsets,i=o.arrow,a=i.left,s=i.top,f=o.reference,c=o.popper,p=e.arrowElement,u="left"===t?a:s,l="left"===t?"left":"top",d="left"===t?"width":"height",h="left"===t?"clientWidth":"clientHeight",m=p["left"===t?"offsetWidth":"offsetHeight"]||p[h];return"start"===n?r+Math.max(0,-(c[l]-f[l])):"end"===n?Math.min(f[d],c[d])-Math.min(0,c[l]-f[l])-r-m:u<r?r:u>c[d]-m-r?c[d]-m-r:u}function Qe(e,t){return!!(t&&e instanceof HTMLElement)&&(e&&e.contains(t))}function Ze(e,t){return("function"==typeof t?t():t)||e&&e.parentElement||void 0}function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function tt(o){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?et(i,!0).forEach(function(e){var t,n,r;t=o,r=i[n=e],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):et(i).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})}return o}m(Ge,"defaultProps",{placement:"bottom",eventsEnabled:!0,referenceElement:void 0,positionFixed:!1}),(Ue=e.TriggerType||(e.TriggerType={}))[Ue.click=0]="click",Ue[Ue.hover=1]="hover";var nt=function(){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?a(e):t}(this,s(t).call(this,e))).scheduleUpdate=void 0,n.popperRef=void 0,n.arrowRef=void 0,n.timer={type:"",id:null},n.show=function(e){if(n.shouldToggle(!0,a(n),e)&&(!n.delayShow&&!n.state.visible||"show"!==n.timer.type)){clearTimeout(n.timer.id);var t=function(){if(n.popperRef){var e=n.visible;n.setState({visible:!0},function(){n.afterToggle(e),n.scheduleUpdate()})}};n.delayShow?n.timer.id=setTimeout(t,n.delayShow):t(),n.timer.type="show"}},n.hide=function(e){if(n.shouldToggle(!1,a(n),e)&&(!n.delayHide&&n.state.visible||"hide"!==n.timer.type)){clearTimeout(n.timer.id);var t=function(){n.popperRef&&n.setState({visible:!1},n.afterToggle.bind(null,n.visible))};n.delayHide?n.timer.id=setTimeout(t,n.delayHide):t(),n.timer.type="hide"}},n.toggle=function(e){n.state.visible?n.hide(e):n.show(e)},n.eventHandler=function(e){Qe(n.popperRef,e.target)?n.show(e):Qe(n.referenceEl,e.target)?n.isHover?n.show(e):n.toggle(e):n.hide(e)},n.afterToggle=function(e){n.props.afterToggle&&e!==n.visible&&n.props.afterToggle(n.visible,a(n))},n.state={visible:!1,isMounted:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}(t,o.Component),function(e,t,n){t&&r(e.prototype,t),n&&r(e,n)}(t,[{key:"componentDidMount",value:function(){this.setState({isMounted:!0}),window.addEventListener(this.eventName,this.eventHandler,!0)}},{key:"componentWillUnmount",value:function(){window.removeEventListener(this.eventName,this.eventHandler,!0)}},{key:"render",value:function(){var a=this,e=this.props,t=e.placement,s=e.className,f=e.forceShow,c=e.children,n=e.positionFixed,r=void 0===n||n,o=this.state,p=o.visible,u=o.isMounted;return b.createElement(Je,{positionFixed:r,placement:t||"bottom-start",referenceElement:this.referenceEl,modifiers:this.modifiers},function(e){var t=e.ref,n=e.style,r=e.placement,o=e.arrowProps,i=e.scheduleUpdate;return a.scheduleUpdate=i,b.createElement("div",{ref:function(e){t(e),a.popperRef=e},className:"react-popper ".concat(s||""," ").concat(f?"force-show":""," ").concat(u&&p?"show":"hide").replace(/\s+(?=(\s|$))/g,""),style:n,"data-placement":r},b.createElement("div",{className:"arrow","data-placement":r,"data-x-arrow":!0,ref:function(e){o.ref(e),a.arrowRef=e},style:o.style}),"function"==typeof c?c(tt({},e,{popperRef:a})):c)})}},{key:"referenceEl",get:function(){return Ze(this.popperRef,this.props.referenceRef)}},{key:"isHover",get:function(){return this.props.trigger===e.TriggerType.hover}},{key:"eventName",get:function(){return this.isHover?"mouseover":"click"}},{key:"modifiers",get:function(){var e=this.props,t=e.modifiers,n=e.arrowOffset,r=e.arrowPosition;return tt({},t,{arrow:tt({},t,{element:this.arrowRef,fn:Xe.bind(null,r,n)})})}},{key:"visible",get:function(){return this.props.forceShow||this.state.visible}},{key:"delayShow",get:function(){return this.props.delayShow||0}},{key:"delayHide",get:function(){return this.props.delayHide||(this.isHover?200:0)}},{key:"shouldToggle",get:function(){return this.props.shouldToggle||function(){return!0}}}]),t}();e.arrowModifier=Xe,e.containsOrEqual=Qe,e.convertPos=Ke,e.default=nt,e.getReferenceEl=Ze,Object.defineProperty(e,"__esModule",{value:!0})});