react-tooltip 5.8.2-beta.4 → 5.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-tooltip.cjs.js +1155 -505
- package/dist/react-tooltip.cjs.min.js +11 -2
- package/dist/react-tooltip.d.ts +7 -3
- package/dist/react-tooltip.esm.js +1114 -462
- package/dist/react-tooltip.esm.min.js +11 -2
- package/dist/react-tooltip.umd.js +1158 -507
- package/dist/react-tooltip.umd.min.js +11 -2
- package/package.json +1 -2
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactTooltip={},t.jsxRuntime,t.React)}(this,(function(t,e,n){"use strict";function o(t){return t.split("-")[1]}function r(t){return"y"===t?"height":"width"}function i(t){return t.split("-")[0]}function l(t){return["top","bottom"].includes(i(t))?"x":"y"}function a(t,e,n){let{reference:a,floating:s}=t;const c=a.x+a.width/2-s.width/2,u=a.y+a.height/2-s.height/2,f=l(e),d=r(f),p=a[d]/2-s[d]/2,h="x"===f;let m;switch(i(e)){case"top":m={x:c,y:a.y-s.height};break;case"bottom":m={x:c,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:u};break;case"left":m={x:a.x-s.width,y:u};break;default:m={x:a.x,y:a.y}}switch(o(e)){case"start":m[f]-=p*(n&&h?-1:1);break;case"end":m[f]+=p*(n&&h?-1:1)}return m}function s(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function c(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function u(t,e){var n;void 0===e&&(e={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:u}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=e,g=s(m),y=a[h?"floating"===p?"reference":"floating":p],v=c(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(y)))||n?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:d,strategy:u})),w="floating"===p?{...l.floating,x:o,y:r}:l.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},S=c(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:x,strategy:u}):w);return{top:(v.top-S.top+g.top)/b.y,bottom:(S.bottom-v.bottom+g.bottom)/b.y,left:(v.left-S.left+g.left)/b.x,right:(S.right-v.right+g.right)/b.x}}const f=Math.min,d=Math.max;function p(t,e,n){return d(t,f(e,n))}const h=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-start",e+"-end")),[]),m={left:"right",right:"left",bottom:"top",top:"bottom"};function g(t){return t.replace(/left|right|bottom|top/g,(t=>m[t]))}function y(t,e,n){void 0===n&&(n=!1);const i=o(t),a=l(t),s=r(a);let c="x"===a?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(c=g(c)),{main:c,cross:g(c)}}const v={start:"end",end:"start"};function w(t){return t.replace(/start|end/g,(t=>v[t]))}const x=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:l,rects:a,initialPlacement:s,platform:c,elements:f}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...b}=t,S=i(r),R=i(s)===s,A=await(null==c.isRTL?void 0:c.isRTL(f.floating)),T=h||(R||!x?[g(s)]:function(t){const e=g(t);return[w(t),e,w(e)]}(s));h||"none"===v||T.push(...function(t,e,n,r){const l=o(t);let a=function(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:l;default:return[]}}(i(t),"start"===n,r);return l&&(a=a.map((t=>t+"-"+l)),e&&(a=a.concat(a.map(w)))),a}(s,x,v,A));const E=[s,...T],L=await u(e,b),_=[];let k=(null==(n=l.flip)?void 0:n.overflows)||[];if(d&&_.push(L[S]),p){const{main:t,cross:e}=y(r,a,A);_.push(L[t],L[e])}if(k=[...k,{placement:r,overflows:_}],!_.every((t=>t<=0))){var O,P;const t=((null==(O=l.flip)?void 0:O.index)||0)+1,e=E[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let n=null==(P=k.find((t=>t.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(m){case"bestFit":{var j;const t=null==(j=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:j[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}};const b=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,a=await async function(t,e){const{placement:n,platform:r,elements:a}=t,s=await(null==r.isRTL?void 0:r.isRTL(a.floating)),c=i(n),u=o(n),f="x"===l(n),d=["left","top"].includes(c)?-1:1,p=s&&f?-1:1,h="function"==typeof e?e(t):e;let{mainAxis:m,crossAxis:g,alignmentAxis:y}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return u&&"number"==typeof y&&(g="end"===u?-1*y:y),f?{x:g*p,y:m*d}:{x:m*d,y:g*p}}(e,t);return{x:n+a.x,y:r+a.y,data:a}}}};const S=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...f}=t,d={x:n,y:o},h=await u(e,f),m=l(i(r)),g="x"===m?"y":"x";let y=d[m],v=d[g];if(a){const t="y"===m?"bottom":"right";y=p(y+h["y"===m?"top":"left"],y,y-h[t])}if(s){const t="y"===g?"bottom":"right";v=p(v+h["y"===g?"top":"left"],v,v-h[t])}const w=c.fn({...e,[m]:y,[g]:v});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function R(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function A(t){return R(t).getComputedStyle(t)}const T=Math.min,E=Math.max,L=Math.round;function _(t){const e=A(t);let n=parseFloat(e.width),o=parseFloat(e.height);const r=t.offsetWidth,i=t.offsetHeight,l=L(n)!==r||L(o)!==i;return l&&(n=r,o=i),{width:n,height:o,fallback:l}}function k(t){return D(t)?(t.nodeName||"").toLowerCase():""}let O;function P(){if(O)return O;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(O=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),O):navigator.userAgent}function j(t){return t instanceof R(t).HTMLElement}function N(t){return t instanceof R(t).Element}function D(t){return t instanceof R(t).Node}function C(t){if("undefined"==typeof ShadowRoot)return!1;return t instanceof R(t).ShadowRoot||t instanceof ShadowRoot}function F(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function H(t){return["table","td","th"].includes(k(t))}function W(t){const e=/firefox/i.test(P()),n=A(t),o=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!o&&"none"!==o||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function I(){return!/^((?!chrome|android).)*safari/i.test(P())}function B(t){return["html","body","#document"].includes(k(t))}function $(t){return N(t)?t:t.contextElement}const M={x:1,y:1};function q(t){const e=$(t);if(!j(e))return M;const n=e.getBoundingClientRect(),{width:o,height:r,fallback:i}=_(e);let l=(i?L(n.width):n.width)/o,a=(i?L(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}function V(t,e,n,o){var r,i;void 0===e&&(e=!1),void 0===n&&(n=!1);const l=t.getBoundingClientRect(),a=$(t);let s=M;e&&(o?N(o)&&(s=q(o)):s=q(t));const c=a?R(a):window,u=!I()&&n;let f=(l.left+(u&&(null==(r=c.visualViewport)?void 0:r.offsetLeft)||0))/s.x,d=(l.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,p=l.width/s.x,h=l.height/s.y;if(a){const t=R(a),e=o&&N(o)?R(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=q(n),e=n.getBoundingClientRect(),o=getComputedStyle(n);e.x+=(n.clientLeft+parseFloat(o.paddingLeft))*t.x,e.y+=(n.clientTop+parseFloat(o.paddingTop))*t.y,f*=t.x,d*=t.y,p*=t.x,h*=t.y,f+=e.x,d+=e.y,n=R(n).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function U(t){return((D(t)?t.ownerDocument:t.document)||window.document).documentElement}function X(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(t){return V(U(t)).left+X(t).scrollLeft}function z(t){if("html"===k(t))return t;const e=t.assignedSlot||t.parentNode||C(t)&&t.host||U(t);return C(e)?e.host:e}function Y(t){const e=z(t);return B(e)?e.ownerDocument.body:j(e)&&F(e)?e:Y(e)}function J(t,e){var n;void 0===e&&(e=[]);const o=Y(t),r=o===(null==(n=t.ownerDocument)?void 0:n.body),i=R(o);return r?e.concat(i,i.visualViewport||[],F(o)?o:[]):e.concat(o,J(o))}function Z(t,e,n){return"viewport"===e?c(function(t,e){const n=R(t),o=U(t),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,s=0;if(r){i=r.width,l=r.height;const t=I();(t||!t&&"fixed"===e)&&(a=r.offsetLeft,s=r.offsetTop)}return{width:i,height:l,x:a,y:s}}(t,n)):N(e)?c(function(t,e){const n=V(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=j(t)?q(t):{x:1,y:1};return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(e,n)):c(function(t){const e=U(t),n=X(t),o=t.ownerDocument.body,r=E(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=E(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+K(t);const a=-n.scrollTop;return"rtl"===A(o).direction&&(l+=E(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}(U(t)))}function G(t){return j(t)&&"fixed"!==A(t).position?t.offsetParent:null}function Q(t){const e=R(t);let n=G(t);for(;n&&H(n)&&"static"===A(n).position;)n=G(n);return n&&("html"===k(n)||"body"===k(n)&&"static"===A(n).position&&!W(n))?e:n||function(t){let e=z(t);for(;j(e)&&!B(e);){if(W(e))return e;e=z(e)}return null}(t)||e}function tt(t,e,n){const o=j(e),r=U(e),i=V(t,!0,"fixed"===n,e);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==k(e)||F(r))&&(l=X(e)),j(e)){const t=V(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else r&&(a.x=K(r));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}const et={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let o=J(t).filter((t=>N(t)&&"body"!==k(t))),r=null;const i="fixed"===A(t).position;let l=i?z(t):t;for(;N(l)&&!B(l);){const t=A(l),e=W(l);(i?e||r:e||"static"!==t.position||!r||!["absolute","fixed"].includes(r.position))?r=t:o=o.filter((t=>t!==l)),l=z(l)}return e.set(t,o),o}(e,this._c):[].concat(n),l=[...i,o],a=l[0],s=l.reduce(((t,n)=>{const o=Z(e,n,r);return t.top=E(o.top,t.top),t.right=T(o.right,t.right),t.bottom=T(o.bottom,t.bottom),t.left=E(o.left,t.left),t}),Z(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const r=j(n),i=U(n);if(n===i)return e;let l={scrollLeft:0,scrollTop:0},a={x:1,y:1};const s={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==k(n)||F(i))&&(l=X(n)),j(n))){const t=V(n);a=q(n),s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-l.scrollLeft*a.x+s.x,y:e.y*a.y-l.scrollTop*a.y+s.y}},isElement:N,getDimensions:function(t){return j(t)?_(t):t.getBoundingClientRect()},getOffsetParent:Q,getDocumentElement:U,getScale:q,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const r=this.getOffsetParent||Q,i=this.getDimensions;return{reference:tt(e,await r(n),o),floating:{x:0,y:0,...await i(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===A(t).direction},nt=(t,e,n)=>{const o=new Map,r={platform:et,...n},i={...r.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));if(null==l&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),s.filter((t=>{let{name:e}=t;return"autoPlacement"===e||"flip"===e})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));t&&e||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let u=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:d}=a(u,o,c),p=o,h={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:g}=s[n],{x:y,y:v,data:w,reset:x}=await g({x:f,y:d,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:u,platform:l,elements:{reference:t,floating:e}});f=null!=y?y:f,d=null!=v?v:d,h={...h,[i]:{...h[i],...w}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(u=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):x.rects),({x:f,y:d}=a(u,p,c))),n=-1)}return{x:f,y:d,placement:p,strategy:r,middlewareData:h}})(t,e,{...r,platform:i})};var ot={exports:{}};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t),o={exports:{}},i={};
|
|
2
|
+
/** @license React v16.14.0
|
|
3
|
+
* react-jsx-runtime.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
!function(e){!function(){var t=r.default,n=60103,o=60106;e.Fragment=60107;var i=60108,a=60114,l=60109,s=60110,c=60112,u=60113,f=60120,d=60115,p=60116,y=60121,m=60122,h=60117,v=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),a=w("react.profiler"),l=w("react.provider"),s=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),d=w("react.memo"),p=w("react.lazy"),y=w("react.block"),m=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),v=w("react.debug_trace_mode"),w("react.offscreen"),g=w("react.legacy_hidden")}var b="function"==typeof Symbol&&Symbol.iterator;var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];_("error",e,n)}function _(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(k){var i=E(k.type),a=k._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(R,"");if(/^index\./.test(i)){var a=o.match(R);if(a){var l=a[1];if(l)i=l.replace(R,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,k._source,a&&E(a.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var l=n.map((function(e){return""+e}));l.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,l)}var R=/^(.*)[\\\/]/;function E(t){if(null==t)return null;if("number"==typeof t.tag&&S("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case e.Fragment:return"Fragment";case o:return"Portal";case a:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case s:return"Context.Consumer";case l:return"Context.Provider";case c:return m=t,h=t.render,v="ForwardRef",g=h.displayName||h.name||"",m.displayName||(""!==g?v+"("+g+")":v);case d:return E(t.type);case y:return E(t.render);case p:var n=1===(r=t)._status?r._result:null;if(n)return E(n)}var r,m,h,v,g;return null}var T={};x.ReactDebugCurrentFrame;var k=null;function A(e){k=e}var O,j,L,P=x.ReactCurrentOwner,N=Object.prototype.hasOwnProperty,$={key:!0,ref:!0,__self:!0,__source:!0};L={};function C(e,t,r,o,i){var a,l={},s=null,c=null;for(a in void 0!==r&&(s=""+r),function(e){if(N.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(s=""+t.key),function(e){if(N.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&P.current&&t&&P.current.stateNode!==t){var n=E(P.current.type);L[n]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(P.current.type),e.ref),L[n]=!0)}}(t,i)),t)N.call(t,a)&&!$.hasOwnProperty(a)&&(l[a]=t[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)void 0===l[a]&&(l[a]=u[a])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){O||(O=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,f),c&&function(e,t){var n=function(){j||(j=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,f)}return function(e,t,r,o,i,a,l){var s={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,P.current,l)}var D,F=x.ReactCurrentOwner;function I(e){k=e}function W(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function H(){if(F.current){var e=E(F.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}x.ReactDebugCurrentFrame,D=!1;var B={};function U(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=H();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!B[n]){B[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+E(e._owner.type)+"."),I(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),I(null)}}}function M(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];W(r)&&U(r,t)}else if(W(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=b&&e[b]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,a=o.call(e);!(i=a.next()).done;)W(i.value)&&U(i.value,t)}}function q(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==c&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=E(n);!function(e,t,n,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var a in e)if(i(e,a)){var l=void 0;try{if("function"!=typeof e[a]){var s=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}l=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(A(o),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,typeof l),A(null)),l instanceof Error&&!(l.message in T)&&(T[l.message]=!0,A(o),S("Failed %s type: %s",n,l.message),A(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!D){D=!0,S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function V(t,r,o,w,b,x){var _=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===a||t===v||t===i||t===u||t===f||t===g||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===l||t.$$typeof===s||t.$$typeof===c||t.$$typeof===h||t.$$typeof===y||t[0]===m)}(t);if(!_){var R="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T,k=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(b);R+=k||H(),null===t?T="null":Array.isArray(t)?T="array":void 0!==t&&t.$$typeof===n?(T="<"+(E(t.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):T=typeof t,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,R)}var A=C(t,r,o,b,x);if(null==A)return A;if(_){var O=r.children;if(void 0!==O)if(w)if(Array.isArray(O)){for(var j=0;j<O.length;j++)M(O[j],t);Object.freeze&&Object.freeze(O)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(O,t)}return t===e.Fragment?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){I(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),I(null);break}}null!==e.ref&&(I(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}(A):q(A),A}var Y=function(e,t,n){return V(e,t,n,!1)},z=function(e,t,n){return V(e,t,n,!0)};e.jsx=Y,e.jsxs=z}()}(i),function(e){e.exports=i}(o);var a={exports:{}};
|
|
2
11
|
/*!
|
|
3
12
|
Copyright (c) 2018 Jed Watson.
|
|
4
13
|
Licensed under the MIT License (MIT), see
|
|
5
14
|
http://jedwatson.github.io/classnames
|
|
6
|
-
*/!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t=[],o=0;o<arguments.length;o++){var r=arguments[o];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)){if(r.length){var l=n.apply(null,r);l&&t.push(l)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){t.push(r.toString());continue}for(var a in r)e.call(r,a)&&r[a]&&t.push(a)}}}return t.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(ot);var rt=ot.exports;const it=(t,e,n)=>{let o=null;return function(...r){o&&clearTimeout(o),o=setTimeout((()=>{o=null,n||t.apply(this,r)}),e)}},lt=({content:t})=>e.jsx("span",{dangerouslySetInnerHTML:{__html:t}}),at="DEFAULT_TOOLTIP_ID",st={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},ct={getTooltipData:()=>st},ut=n.createContext(ct);function ft(t=at){return n.useContext(ut).getTooltipData(t)}const dt=async({elementReference:t=null,tooltipReference:e=null,tooltipArrowReference:n=null,place:i="top",offset:a=10,strategy:c="absolute",middlewares:u=[b(Number(a)),x(),S({padding:5})]})=>{if(!t)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===e)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:d={element:n,padding:5},async fn(t){const{element:e,padding:n=0}=d||{},{x:i,y:a,placement:c,rects:u,platform:f}=t;if(null==e)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const h=s(n),m={x:i,y:a},g=l(c),y=r(g),v=await f.getDimensions(e),w="y"===g?"top":"left",x="y"===g?"bottom":"right",b=u.reference[y]+u.reference[g]-m[g]-u.floating[y],S=m[g]-u.reference[g],R=await(null==f.getOffsetParent?void 0:f.getOffsetParent(e));let A=R?"y"===g?R.clientHeight||0:R.clientWidth||0:0;0===A&&(A=u.floating[y]);const T=b/2-S/2,E=h[w],L=A-v[y]-h[x],_=A/2-v[y]/2+T,k=p(E,_,L),O=null!=o(c)&&_!=k&&u.reference[y]/2-(_<E?h[w]:h[x])-v[y]/2<0;return{[g]:m[g]-(O?_<E?E-_:L-_:0),data:{[g]:k,centerOffset:_-k}}}}),nt(t,e,{placement:i,strategy:c,middleware:f}).then((({x:t,y:e,placement:n,middlewareData:o})=>{var r,i;const l={left:`${t}px`,top:`${e}px`},{x:a,y:s}=null!==(r=o.arrow)&&void 0!==r?r:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):nt(t,e,{placement:"bottom",strategy:c,middleware:f}).then((({x:t,y:e})=>({tooltipStyles:{left:`${t}px`,top:`${e}px`},tooltipArrowStyles:{}})));var d};var pt={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ht=({id:t,className:o,classNameArrow:r,variant:i="dark",anchorId:l,anchorSelect:a,place:s="top",offset:c=10,events:u=["hover"],positionStrategy:f="absolute",middlewares:d,wrapper:p,children:h=null,delayShow:m=0,delayHide:g=0,float:y=!1,noArrow:v=!1,clickable:w=!1,closeOnEsc:x=!1,style:b,position:S,afterShow:R,afterHide:A,content:T,html:E,isOpen:L,setIsOpen:_,activeAnchor:k,setActiveAnchor:O})=>{const P=n.useRef(null),j=n.useRef(null),N=n.useRef(null),D=n.useRef(null),[C,F]=n.useState({}),[H,W]=n.useState({}),[I,B]=n.useState(!1),[$,M]=n.useState(!1),q=n.useRef(!1),V=n.useRef(null),{anchorRefs:U,setActiveAnchor:X}=ft(t),K=n.useRef(!1),[z,Y]=n.useState([]),J=n.useRef(!1);n.useLayoutEffect((()=>(J.current=!0,()=>{J.current=!1})),[]),n.useEffect((()=>{if(!I){const t=setTimeout((()=>{M(!1)}),150);return()=>{clearTimeout(t)}}return()=>null}),[I]);const Z=t=>{J.current&&(t&&M(!0),setTimeout((()=>{J.current&&(null==_||_(t),void 0===L&&B(t))}),10))};n.useEffect((()=>{if(void 0===L)return()=>null;L&&M(!0);const t=setTimeout((()=>{B(L)}),10);return()=>{clearTimeout(t)}}),[L]),n.useEffect((()=>{I!==q.current&&(q.current=I,I?null==R||R():null==A||A())}),[I]);const G=(t=g)=>{D.current&&clearTimeout(D.current),D.current=setTimeout((()=>{K.current||Z(!1)}),t)},Q=t=>{var e;if(!t)return;m?(N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{Z(!0)}),m)):Z(!0);const n=null!==(e=t.currentTarget)&&void 0!==e?e:t.target;O(n),X({current:n}),D.current&&clearTimeout(D.current)},tt=()=>{w?G(g||100):g?G():Z(!1),N.current&&clearTimeout(N.current)},et=({x:t,y:e})=>{dt({place:s,offset:c,elementReference:{getBoundingClientRect:()=>({x:t,y:e,width:0,height:0,top:e,left:t,right:t,bottom:e})},tooltipReference:P.current,tooltipArrowReference:j.current,strategy:f,middlewares:d}).then((t=>{Object.keys(t.tooltipStyles).length&&F(t.tooltipStyles),Object.keys(t.tooltipArrowStyles).length&&W(t.tooltipArrowStyles)}))},nt=t=>{if(!t)return;const e=t,n={x:e.clientX,y:e.clientY};et(n),V.current=n},ot=t=>{Q(t),g&&G()},at=t=>{const e=document.querySelector(`[id='${l}']`);(null==e?void 0:e.contains(t.target))||z.some((e=>e.contains(t.target)))||Z(!1)},st=t=>{"Escape"===t.key&&Z(!1)},ct=it(Q,50),ut=it(tt,50);n.useEffect((()=>{var t,e;const n=new Set(U);z.forEach((t=>{n.add({current:t})}));const o=document.querySelector(`[id='${l}']`);o&&n.add({current:o}),x&&window.addEventListener("keydown",st);const r=[];u.find((t=>"click"===t))&&(window.addEventListener("click",at),r.push({event:"click",listener:ot})),u.find((t=>"hover"===t))&&(r.push({event:"mouseenter",listener:ct},{event:"mouseleave",listener:ut},{event:"focus",listener:ct},{event:"blur",listener:ut}),y&&r.push({event:"mousemove",listener:nt}));const i=()=>{K.current=!0},a=()=>{K.current=!1,tt()};return w&&(null===(t=P.current)||void 0===t||t.addEventListener("mouseenter",i),null===(e=P.current)||void 0===e||e.addEventListener("mouseleave",a)),r.forEach((({event:t,listener:e})=>{n.forEach((n=>{var o;null===(o=n.current)||void 0===o||o.addEventListener(t,e)}))})),()=>{var t,e;u.find((t=>"click"===t))&&window.removeEventListener("click",at),x&&window.removeEventListener("keydown",st),w&&(null===(t=P.current)||void 0===t||t.removeEventListener("mouseenter",i),null===(e=P.current)||void 0===e||e.removeEventListener("mouseleave",a)),r.forEach((({event:t,listener:e})=>{n.forEach((n=>{var o;null===(o=n.current)||void 0===o||o.removeEventListener(t,e)}))}))}}),[$,U,z,x,u]),n.useEffect((()=>{let e=null!=a?a:"";!e&&t&&(e=`[data-tooltip-id='${t}']`);const n=new MutationObserver((n=>{const o=[];n.forEach((n=>{if("attributes"===n.type&&"data-tooltip-id"===n.attributeName){n.target.getAttribute("data-tooltip-id")===t&&o.push(n.target)}if("childList"===n.type&&(k&&[...n.removedNodes].some((t=>!!t.contains(k)&&(M(!1),Z(!1),O(null),!0))),e))try{const t=[...n.addedNodes].filter((t=>1===t.nodeType));o.push(...t.filter((t=>t.matches(e)))),o.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch(t){}})),o.length&&Y((t=>[...t,...o]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{n.disconnect()}}),[t,a,k]),n.useEffect((()=>{S?et(S):y?V.current&&et(V.current):dt({place:s,offset:c,elementReference:k,tooltipReference:P.current,tooltipArrowReference:j.current,strategy:f,middlewares:d}).then((t=>{J.current&&(Object.keys(t.tooltipStyles).length&&F(t.tooltipStyles),Object.keys(t.tooltipArrowStyles).length&&W(t.tooltipArrowStyles))}))}),[I,k,T,E,s,c,f,S]),n.useEffect((()=>{var t;const e=document.querySelector(`[id='${l}']`),n=[...z,e];k&&n.includes(k)||O(null!==(t=z[0])&&void 0!==t?t:e)}),[l,z,k]),n.useEffect((()=>()=>{N.current&&clearTimeout(N.current),D.current&&clearTimeout(D.current)}),[]),n.useEffect((()=>{let e=a;if(!e&&t&&(e=`[data-tooltip-id='${t}']`),e)try{const t=Array.from(document.querySelectorAll(e));Y(t)}catch(t){Y([])}}),[t,a]);const ht=Boolean(E||T||h)&&I&&Object.keys(C).length>0;return $?e.jsxs(p,{id:t,role:"tooltip",className:rt("react-tooltip",pt.tooltip,pt[i],o,{[pt.show]:ht,[pt.fixed]:"fixed"===f,[pt.clickable]:w}),style:{...b,...C},ref:P,children:[E&&e.jsx(lt,{content:E})||T||h,e.jsx(p,{className:rt("react-tooltip-arrow",pt.arrow,r,{[pt["no-arrow"]]:v}),style:H,ref:j})]}):null};t.Tooltip=({id:t,anchorId:o,anchorSelect:r,content:i,html:l,className:a,classNameArrow:s,variant:c="dark",place:u="top",offset:f=10,wrapper:d="div",children:p=null,events:h=["hover"],positionStrategy:m="absolute",middlewares:g,delayShow:y=0,delayHide:v=0,float:w=!1,noArrow:x=!1,clickable:b=!1,closeOnEsc:S=!1,style:R,position:A,isOpen:T,setIsOpen:E,afterShow:L,afterHide:_})=>{const[k,O]=n.useState(i),[P,j]=n.useState(l),[N,D]=n.useState(u),[C,F]=n.useState(c),[H,W]=n.useState(f),[I,B]=n.useState(y),[$,M]=n.useState(v),[q,V]=n.useState(w),[U,X]=n.useState(d),[K,z]=n.useState(h),[Y,J]=n.useState(m),[Z,G]=n.useState(null),{anchorRefs:Q,activeAnchor:tt}=ft(t),et=t=>null==t?void 0:t.getAttributeNames().reduce(((e,n)=>{var o;if(n.startsWith("data-tooltip-")){e[n.replace(/^data-tooltip-/,"")]=null!==(o=null==t?void 0:t.getAttribute(n))&&void 0!==o?o:null}return e}),{}),nt=t=>{const e={place:t=>{var e;D(null!==(e=t)&&void 0!==e?e:u)},content:t=>{O(null!=t?t:i)},html:t=>{j(null!=t?t:l)},variant:t=>{var e;F(null!==(e=t)&&void 0!==e?e:c)},offset:t=>{W(null===t?f:Number(t))},wrapper:t=>{var e;X(null!==(e=t)&&void 0!==e?e:d)},events:t=>{const e=null==t?void 0:t.split(" ");z(null!=e?e:h)},"position-strategy":t=>{var e;J(null!==(e=t)&&void 0!==e?e:m)},"delay-show":t=>{B(null===t?y:Number(t))},"delay-hide":t=>{M(null===t?v:Number(t))},float:t=>{V(null===t?w:Boolean(t))}};Object.values(e).forEach((t=>t(null))),Object.entries(t).forEach((([t,n])=>{var o;null===(o=e[t])||void 0===o||o.call(e,n)}))};n.useEffect((()=>{O(i)}),[i]),n.useEffect((()=>{j(l)}),[l]),n.useEffect((()=>{D(u)}),[u]),n.useEffect((()=>{var e;const n=new Set(Q);let i=r;if(!i&&t&&(i=`[data-tooltip-id='${t}']`),i)try{document.querySelectorAll(i).forEach((t=>{n.add({current:t})}))}catch(t){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const l=document.querySelector(`[id='${o}']`);if(l&&n.add({current:l}),!n.size)return()=>null;const a=null!==(e=null!=Z?Z:l)&&void 0!==e?e:tt.current,s=new MutationObserver((t=>{t.forEach((t=>{var e;if(!a||"attributes"!==t.type||!(null===(e=t.attributeName)||void 0===e?void 0:e.startsWith("data-tooltip-")))return;const n=et(a);nt(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const t=et(a);nt(t),s.observe(a,c)}return()=>{s.disconnect()}}),[Q,tt,Z,o,r]);const ot={id:t,anchorId:o,anchorSelect:r,className:a,classNameArrow:s,content:k,html:P,place:N,variant:C,offset:H,wrapper:U,events:K,positionStrategy:Y,middlewares:g,delayShow:I,delayHide:$,float:q,noArrow:x,clickable:b,closeOnEsc:S,style:R,position:A,isOpen:T,setIsOpen:E,afterShow:L,afterHide:_,activeAnchor:Z,setActiveAnchor:t=>G(t)};return p?e.jsx(ht,{...ot,children:p}):e.jsx(ht,{...ot})},t.TooltipProvider=({children:t})=>{const[o,r]=n.useState({[at]:new Set}),[i,l]=n.useState({[at]:{current:null}}),a=(t,...e)=>{r((n=>{var o;const r=null!==(o=n[t])&&void 0!==o?o:new Set;return e.forEach((t=>r.add(t))),{...n,[t]:new Set(r)}}))},s=(t,...e)=>{r((n=>{const o=n[t];return o?(e.forEach((t=>o.delete(t))),{...n}):n}))},c=n.useCallback(((t=at)=>{var e,n;return{anchorRefs:null!==(e=o[t])&&void 0!==e?e:new Set,activeAnchor:null!==(n=i[t])&&void 0!==n?n:{current:null},attach:(...e)=>a(t,...e),detach:(...e)=>s(t,...e),setActiveAnchor:e=>((t,e)=>{l((n=>{var o;return(null===(o=n[t])||void 0===o?void 0:o.current)===e.current?n:{...n,[t]:e}}))})(t,e)}}),[o,i,a,s]),u=n.useMemo((()=>({getTooltipData:c})),[c]);return e.jsx(ut.Provider,{value:u,children:t})},t.TooltipWrapper=({tooltipId:t,children:o,className:r,place:i,content:l,html:a,variant:s,offset:c,wrapper:u,events:f,positionStrategy:d,delayShow:p,delayHide:h})=>{const{attach:m,detach:g}=ft(t),y=n.useRef(null);return n.useEffect((()=>(m(y),()=>{g(y)})),[]),e.jsx("span",{ref:y,className:rt("react-tooltip-wrapper",r),"data-tooltip-place":i,"data-tooltip-content":l,"data-tooltip-html":a,"data-tooltip-variant":s,"data-tooltip-offset":c,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":d,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":h,children:o})},t.autoPlacement=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,l;const{rects:a,middlewareData:s,placement:c,platform:f,elements:d}=e,{alignment:p,allowedPlacements:m=h,autoAlignment:g=!0,...v}=t,x=void 0!==p||m===h?function(t,e,n){return(t?[...n.filter((e=>o(e)===t)),...n.filter((e=>o(e)!==t))]:n.filter((t=>i(t)===t))).filter((n=>!t||o(n)===t||!!e&&w(n)!==n))}(p||null,g,m):m,b=await u(e,v),S=(null==(n=s.autoPlacement)?void 0:n.index)||0,R=x[S];if(null==R)return{};const{main:A,cross:T}=y(R,a,await(null==f.isRTL?void 0:f.isRTL(d.floating)));if(c!==R)return{reset:{placement:x[0]}};const E=[b[i(R)],b[A],b[T]],L=[...(null==(r=s.autoPlacement)?void 0:r.overflows)||[],{placement:R,overflows:E}],_=x[S+1];if(_)return{data:{index:S+1,overflows:L},reset:{placement:_}};const k=L.slice().sort(((t,e)=>t.overflows[0]-e.overflows[0])),O=null==(l=k.find((t=>{let{overflows:e}=t;return e.every((t=>t<=0))})))?void 0:l.placement,P=O||k[0].placement;return P!==c?{data:{index:S+1,overflows:L},reset:{placement:P}}:{}}}},t.flip=x,t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:a,strategy:u}=e,{padding:p=2,x:h,y:m}=t,g=c(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:r.reference,offsetParent:await(null==a.getOffsetParent?void 0:a.getOffsetParent(o.floating)),strategy:u}):r.reference),y=await(null==a.getClientRects?void 0:a.getClientRects(o.reference))||[],v=s(p);const w=await a.getElementRects({reference:{getBoundingClientRect:function(){if(2===y.length&&y[0].left>y[1].right&&null!=h&&null!=m)return y.find((t=>h>t.left-v.left&&h<t.right+v.right&&m>t.top-v.top&&m<t.bottom+v.bottom))||g;if(y.length>=2){if("x"===l(n)){const t=y[0],e=y[y.length-1],o="top"===i(n),r=t.top,l=e.bottom,a=o?t.left:e.left,s=o?t.right:e.right;return{top:r,bottom:l,left:a,right:s,width:s-a,height:l-r,x:a,y:r}}const t="left"===i(n),e=d(...y.map((t=>t.right))),o=f(...y.map((t=>t.left))),r=y.filter((n=>t?n.left===o:n.right===e)),a=r[0].top,s=r[r.length-1].bottom;return{top:a,bottom:s,left:o,right:e,width:e-o,height:s-a,x:o,y:a}}return g}},floating:o.floating,strategy:u});return r.reference.x!==w.reference.x||r.reference.y!==w.reference.y||r.reference.width!==w.reference.width||r.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},t.offset=b,t.shift=S,t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:l,elements:a}=e,{apply:s=(()=>{}),...c}=t,f=await u(e,c),p=i(n),h=o(n);let m,g;"top"===p||"bottom"===p?(m=p,g=h===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(g=p,m="end"===h?"top":"bottom");const y=d(f.left,0),v=d(f.right,0),w=d(f.top,0),x=d(f.bottom,0),b={availableHeight:r.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==x?w+x:d(f.top,f.bottom)):f[m]),availableWidth:r.floating.width-(["top","bottom"].includes(n)?2*(0!==y||0!==v?y+v:d(f.left,f.right)):f[g])};await s({...e,...b});const S=await l.getDimensions(a.floating);return r.floating.width!==S.width||r.floating.height!==S.height?{reset:{rects:!0}}:{}}}},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
15
|
+
*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var l in o)t.call(o,l)&&o[l]&&e.push(l)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(a);var l=a.exports;const s=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},c=({content:e})=>o.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},d={getTooltipData:()=>f},p=t.createContext(d);function y(e=u){return t.useContext(p).getTooltipData(e)}const m="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;function h(e){return e.split("-")[1]}function v(e){return"y"===e?"height":"width"}function g(e){return e.split("-")[0]}function w(e){return["top","bottom"].includes(g(e))?"x":"y"}function b(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=w(t),s=v(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(g(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(h(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function x(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function S(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function _(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,y=x(p),m=l[d?"floating"===f?"reference":"floating":f],h=S(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===f?{...a.floating,x:r,y:o}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),w=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},b=S(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:g,strategy:s}):v);return{top:(h.top-b.top+y.top)/w.y,bottom:(b.bottom-h.bottom+y.bottom)/w.y,left:(h.left-b.left+y.left)/w.x,right:(b.right-h.right+y.right)/w.x}}const R=Math.min,E=Math.max;function T(e,t,n){return E(e,R(t,n))}const k={left:"right",right:"left",bottom:"top",top:"bottom"};function A(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}const O={start:"end",end:"start"};function j(e){return e.replace(/start|end/g,(e=>O[e]))}const L=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...m}=e,b=g(r),x=g(a)===a,S=await(null==l.isRTL?void 0:l.isRTL(s.floating)),R=f||(x||!y?[A(a)]:function(e){const t=A(e);return[j(e),t,j(t)]}(a));f||"none"===p||R.push(...function(e,t,n,r){const o=h(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(g(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(j)))),i}(a,y,p,S));const E=[a,...R],T=await _(t,m),k=[];let O=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&k.push(T[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=h(e),o=w(e),i=v(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=A(a)),{main:a,cross:A(a)}}(r,i,S);k.push(T[e],T[t])}if(O=[...O,{placement:r,overflows:k}],!k.every((e=>e<=0))){var L,P;const e=((null==(L=o.flip)?void 0:L.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(P=O.find((e=>e.overflows[0]<=0)))?void 0:P.placement;if(!n)switch(d){case"bestFit":{var N;const e=null==(N=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const P=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=g(n),l=h(n),s="x"===w(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof y&&(p="end"===l?-1*y:y),s?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};const N=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=e,c={x:n,y:r},u=await _(t,s),f=w(g(o)),d="x"===f?"y":"x";let p=c[f],y=c[d];if(i){const e="y"===f?"bottom":"right";p=T(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";y=T(y+u["y"===d?"top":"left"],y,y-u[e])}const m=l.fn({...t,[f]:p,[d]:y});return{...m,data:{x:m.x-n,y:m.y-r}}}}};function $(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function C(e){return $(e).getComputedStyle(e)}const D=Math.min,F=Math.max,I=Math.round;function W(e){const t=C(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,a=I(n)!==o||I(r)!==i;return a&&(n=o,r=i),{width:n,height:r,fallback:a}}function H(e){return V(e)?(e.nodeName||"").toLowerCase():""}let B;function U(){if(B)return B;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(B=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),B):navigator.userAgent}function M(e){return e instanceof $(e).HTMLElement}function q(e){return e instanceof $(e).Element}function V(e){return e instanceof $(e).Node}function Y(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof $(e).ShadowRoot||e instanceof ShadowRoot}function z(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function X(e){return["table","td","th"].includes(H(e))}function K(e){const t=/firefox/i.test(U()),n=C(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function J(){return!/^((?!chrome|android).)*safari/i.test(U())}function Z(e){return["html","body","#document"].includes(H(e))}function G(e){return q(e)?e:e.contextElement}const Q={x:1,y:1};function ee(e){const t=G(e);if(!M(t))return Q;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=W(t);let a=(i?I(n.width):n.width)/r,l=(i?I(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}function te(e,t,n,r){var o,i;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),l=G(e);let s=Q;t&&(r?q(r)&&(s=ee(r)):s=ee(e));const c=l?$(l):window,u=!J()&&n;let f=(a.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/s.x,d=(a.top+(u&&(null==(i=c.visualViewport)?void 0:i.offsetTop)||0))/s.y,p=a.width/s.x,y=a.height/s.y;if(l){const e=$(l),t=r&&q(r)?$(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=ee(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,f*=e.x,d*=e.y,p*=e.x,y*=e.y,f+=t.x,d+=t.y,n=$(n).frameElement}}return{width:p,height:y,top:d,right:f+p,bottom:d+y,left:f,x:f,y:d}}function ne(e){return((V(e)?e.ownerDocument:e.document)||window.document).documentElement}function re(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function oe(e){return te(ne(e)).left+re(e).scrollLeft}function ie(e){if("html"===H(e))return e;const t=e.assignedSlot||e.parentNode||Y(e)&&e.host||ne(e);return Y(t)?t.host:t}function ae(e){const t=ie(e);return Z(t)?t.ownerDocument.body:M(t)&&z(t)?t:ae(t)}function le(e,t){var n;void 0===t&&(t=[]);const r=ae(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=$(r);return o?t.concat(i,i.visualViewport||[],z(r)?r:[]):t.concat(r,le(r))}function se(e,t,n){return"viewport"===t?S(function(e,t){const n=$(e),r=ne(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=J();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):q(t)?S(function(e,t){const n=te(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=M(e)?ee(e):{x:1,y:1};return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n)):S(function(e){const t=ne(e),n=re(e),r=e.ownerDocument.body,o=F(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=F(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+oe(e);const l=-n.scrollTop;return"rtl"===C(r).direction&&(a+=F(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(ne(e)))}function ce(e){return M(e)&&"fixed"!==C(e).position?e.offsetParent:null}function ue(e){const t=$(e);let n=ce(e);for(;n&&X(n)&&"static"===C(n).position;)n=ce(n);return n&&("html"===H(n)||"body"===H(n)&&"static"===C(n).position&&!K(n))?t:n||function(e){let t=ie(e);for(;M(t)&&!Z(t);){if(K(t))return t;t=ie(t)}return null}(e)||t}function fe(e,t,n){const r=M(t),o=ne(t),i=te(e,!0,"fixed"===n,t);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==H(t)||z(o))&&(a=re(t)),M(t)){const e=te(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=oe(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}const de={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=le(e).filter((e=>q(e)&&"body"!==H(e))),o=null;const i="fixed"===C(e).position;let a=i?ie(e):e;for(;q(a)&&!Z(a);){const e=C(a),t=K(a);(i?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:r=r.filter((e=>e!==a)),a=ie(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=se(t,n,o);return e.top=F(r.top,e.top),e.right=D(r.right,e.right),e.bottom=D(r.bottom,e.bottom),e.left=F(r.left,e.left),e}),se(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=M(n),i=ne(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},l={x:1,y:1};const s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==H(n)||z(i))&&(a=re(n)),M(n))){const e=te(n);l=ee(n),s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+s.x,y:t.y*l.y-a.scrollTop*l.y+s.y}},isElement:q,getDimensions:function(e){return M(e)?W(e):e.getBoundingClientRect()},getOffsetParent:ue,getDocumentElement:ne,getScale:ee,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||ue,i=this.getDimensions;return{reference:fe(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===C(e).direction},pe=(e,t,n)=>{const r=new Map,o={platform:de,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=b(c,r,s),d=r,p={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:v,data:g,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=v?v:f,p={...p,[i]:{...p[i],...g}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=b(c,d,s))),n=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})},ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute",middlewares:a=[P(Number(o)),L(),N({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const l=a;return n?(l.push({name:"arrow",options:s={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=s||{},{x:r,y:o,placement:i,rects:a,platform:l}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=x(n),u={x:r,y:o},f=w(i),d=v(f),p=await l.getDimensions(t),y="y"===f?"top":"left",m="y"===f?"bottom":"right",g=a.reference[d]+a.reference[f]-u[f]-a.floating[d],b=u[f]-a.reference[f],S=await(null==l.getOffsetParent?void 0:l.getOffsetParent(t));let _=S?"y"===f?S.clientHeight||0:S.clientWidth||0:0;0===_&&(_=a.floating[d]);const R=g/2-b/2,E=c[y],k=_-p[d]-c[m],A=_/2-p[d]/2+R,O=T(E,A,k),j=null!=h(i)&&A!=O&&a.reference[d]/2-(A<E?c[y]:c[m])-p[d]/2<0;return{[f]:u[f]-(j?A<E?E-A:k-A:0),data:{[f]:O,centerOffset:A-O}}}}),pe(e,t,{placement:r,strategy:i,middleware:l}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):pe(e,t,{placement:"bottom",strategy:i,middleware:l}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var s};var me={tooltip:"styles-module_tooltip__mnnfp",fixed:"styles-module_fixed__7ciUi",arrow:"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN",clickable:"styles-module_clickable__Bv9o7",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const he=({id:e,className:n,classNameArrow:r,variant:i="dark",anchorId:a,anchorSelect:u,place:f="top",offset:d=10,events:p=["hover"],positionStrategy:h="absolute",middlewares:v,wrapper:g,children:w=null,delayShow:b=0,delayHide:x=0,float:S=!1,noArrow:_=!1,clickable:R=!1,closeOnEsc:E=!1,style:T,position:k,afterShow:A,afterHide:O,content:j,html:L,isOpen:P,setIsOpen:N,activeAnchor:$,setActiveAnchor:C})=>{const D=t.useRef(null),F=t.useRef(null),I=t.useRef(null),W=t.useRef(null),[H,B]=t.useState({}),[U,M]=t.useState({}),[q,V]=t.useState(!1),[Y,z]=t.useState(!1),X=t.useRef(!1),K=t.useRef(null),{anchorRefs:J,setActiveAnchor:Z}=y(e),G=t.useRef(!1),[Q,ee]=t.useState([]),te=t.useRef(!1);m((()=>(te.current=!0,()=>{te.current=!1})),[]),t.useEffect((()=>{if(!q){const e=setTimeout((()=>{z(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[q]);const ne=e=>{te.current&&(e&&z(!0),setTimeout((()=>{te.current&&(null==N||N(e),void 0===P&&V(e))}),10))};t.useEffect((()=>{if(void 0===P)return()=>null;P&&z(!0);const e=setTimeout((()=>{V(P)}),10);return()=>{clearTimeout(e)}}),[P]),t.useEffect((()=>{q!==X.current&&(X.current=q,q?null==A||A():null==O||O())}),[q]);const re=(e=x)=>{W.current&&clearTimeout(W.current),W.current=setTimeout((()=>{G.current||ne(!1)}),e)},oe=e=>{var t;if(!e)return;b?(I.current&&clearTimeout(I.current),I.current=setTimeout((()=>{ne(!0)}),b)):ne(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;C(n),Z({current:n}),W.current&&clearTimeout(W.current)},ie=()=>{R?re(x||100):x?re():ne(!1),I.current&&clearTimeout(I.current)},ae=({x:e,y:t})=>{ye({place:f,offset:d,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:D.current,tooltipArrowReference:F.current,strategy:h,middlewares:v}).then((e=>{Object.keys(e.tooltipStyles).length&&B(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&M(e.tooltipArrowStyles)}))},le=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};ae(n),K.current=n},se=e=>{oe(e),x&&re()},ce=e=>{const t=document.querySelector(`[id='${a}']`);(null==t?void 0:t.contains(e.target))||Q.some((t=>t.contains(e.target)))||ne(!1)},ue=e=>{"Escape"===e.key&&ne(!1)},fe=s(oe,50),de=s(ie,50);t.useEffect((()=>{var e,t;const n=new Set(J);Q.forEach((e=>{n.add({current:e})}));const r=document.querySelector(`[id='${a}']`);r&&n.add({current:r}),E&&window.addEventListener("keydown",ue);const o=[];p.find((e=>"click"===e))&&(window.addEventListener("click",ce),o.push({event:"click",listener:se})),p.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:fe},{event:"mouseleave",listener:de},{event:"focus",listener:fe},{event:"blur",listener:de}),S&&o.push({event:"mousemove",listener:le}));const i=()=>{G.current=!0},l=()=>{G.current=!1,ie()};return R&&(null===(e=D.current)||void 0===e||e.addEventListener("mouseenter",i),null===(t=D.current)||void 0===t||t.addEventListener("mouseleave",l)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;p.find((e=>"click"===e))&&window.removeEventListener("click",ce),E&&window.removeEventListener("keydown",ue),R&&(null===(e=D.current)||void 0===e||e.removeEventListener("mouseenter",i),null===(t=D.current)||void 0===t||t.removeEventListener("mouseleave",l)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[Y,J,Q,E,p]),t.useEffect((()=>{let t=null!=u?u:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const n=new MutationObserver((n=>{const r=[];n.forEach((n=>{if("attributes"===n.type&&"data-tooltip-id"===n.attributeName){n.target.getAttribute("data-tooltip-id")===e&&r.push(n.target)}if("childList"===n.type&&($&&[...n.removedNodes].some((e=>!!e.contains($)&&(z(!1),ne(!1),C(null),!0))),t))try{const e=[...n.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&ee((e=>[...e,...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{n.disconnect()}}),[e,u,$]),t.useEffect((()=>{k?ae(k):S?K.current&&ae(K.current):ye({place:f,offset:d,elementReference:$,tooltipReference:D.current,tooltipArrowReference:F.current,strategy:h,middlewares:v}).then((e=>{te.current&&(Object.keys(e.tooltipStyles).length&&B(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&M(e.tooltipArrowStyles))}))}),[q,$,j,L,f,d,h,k]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),n=[...Q,t];$&&n.includes($)||C(null!==(e=Q[0])&&void 0!==e?e:t)}),[a,Q,$]),t.useEffect((()=>()=>{I.current&&clearTimeout(I.current),W.current&&clearTimeout(W.current)}),[]),t.useEffect((()=>{let t=u;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));ee(e)}catch(e){ee([])}}),[e,u]);const pe=Boolean(L||j||w)&&q&&Object.keys(H).length>0;return Y?o.exports.jsxs(g,{id:e,role:"tooltip",className:l("react-tooltip",me.tooltip,me[i],n,{[me.show]:pe,[me.fixed]:"fixed"===h,[me.clickable]:R}),style:{...T,...H},ref:D,children:[L&&o.exports.jsx(c,{content:L})||j||w,o.exports.jsx(g,{className:l("react-tooltip-arrow",me.arrow,r,{[me["no-arrow"]]:_}),style:U,ref:F})]}):null};e.Tooltip=({id:e,anchorId:n,anchorSelect:r,content:i,html:a,className:l,classNameArrow:s,variant:c="dark",place:u="top",offset:f=10,wrapper:d="div",children:p=null,events:m=["hover"],positionStrategy:h="absolute",middlewares:v,delayShow:g=0,delayHide:w=0,float:b=!1,noArrow:x=!1,clickable:S=!1,closeOnEsc:_=!1,style:R,position:E,isOpen:T,setIsOpen:k,afterShow:A,afterHide:O})=>{const[j,L]=t.useState(i),[P,N]=t.useState(a),[$,C]=t.useState(u),[D,F]=t.useState(c),[I,W]=t.useState(f),[H,B]=t.useState(g),[U,M]=t.useState(w),[q,V]=t.useState(b),[Y,z]=t.useState(d),[X,K]=t.useState(m),[J,Z]=t.useState(h),[G,Q]=t.useState(null),{anchorRefs:ee,activeAnchor:te}=y(e),ne=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var r;if(n.startsWith("data-tooltip-")){t[n.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(n))&&void 0!==r?r:null}return t}),{}),re=e=>{const t={place:e=>{var t;C(null!==(t=e)&&void 0!==t?t:u)},content:e=>{L(null!=e?e:i)},html:e=>{N(null!=e?e:a)},variant:e=>{var t;F(null!==(t=e)&&void 0!==t?t:c)},offset:e=>{W(null===e?f:Number(e))},wrapper:e=>{var t;z(null!==(t=e)&&void 0!==t?t:d)},events:e=>{const t=null==e?void 0:e.split(" ");K(null!=t?t:m)},"position-strategy":e=>{var t;Z(null!==(t=e)&&void 0!==t?t:h)},"delay-show":e=>{B(null===e?g:Number(e))},"delay-hide":e=>{M(null===e?w:Number(e))},float:e=>{V(null===e?b:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;null===(r=t[e])||void 0===r||r.call(t,n)}))};t.useEffect((()=>{L(i)}),[i]),t.useEffect((()=>{N(a)}),[a]),t.useEffect((()=>{C(u)}),[u]),t.useEffect((()=>{var t;const o=new Set(ee);let i=r;if(!i&&e&&(i=`[data-tooltip-id='${e}']`),i)try{document.querySelectorAll(i).forEach((e=>{o.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${r}" is not a valid CSS selector`)}const a=document.querySelector(`[id='${n}']`);if(a&&o.add({current:a}),!o.size)return()=>null;const l=null!==(t=null!=G?G:a)&&void 0!==t?t:te.current,s=new MutationObserver((e=>{e.forEach((e=>{var t;if(!l||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=ne(l);re(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(l){const e=ne(l);re(e),s.observe(l,c)}return()=>{s.disconnect()}}),[ee,te,G,n,r]);const oe={id:e,anchorId:n,anchorSelect:r,className:l,classNameArrow:s,content:j,html:P,place:$,variant:D,offset:I,wrapper:Y,events:X,positionStrategy:J,middlewares:v,delayShow:H,delayHide:U,float:q,noArrow:x,clickable:S,closeOnEsc:_,style:R,position:E,isOpen:T,setIsOpen:k,afterShow:A,afterHide:O,activeAnchor:G,setActiveAnchor:e=>Q(e)};return p?o.exports.jsx(he,{...oe,children:p}):o.exports.jsx(he,{...oe})},e.TooltipProvider=({children:e})=>{const[n,r]=t.useState({[u]:new Set}),[i,a]=t.useState({[u]:{current:null}}),l=(e,...t)=>{r((n=>{var r;const o=null!==(r=n[e])&&void 0!==r?r:new Set;return t.forEach((e=>o.add(e))),{...n,[e]:new Set(o)}}))},s=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},c=t.useCallback(((e=u)=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=i[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>s(e,...t),setActiveAnchor:t=>((e,t)=>{a((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,i,l,s]),f=t.useMemo((()=>({getTooltipData:c})),[c]);return o.exports.jsx(p.Provider,{value:f,children:e})},e.TooltipWrapper=({tooltipId:e,children:n,className:r,place:i,content:a,html:s,variant:c,offset:u,wrapper:f,events:d,positionStrategy:p,delayShow:m,delayHide:h})=>{const{attach:v,detach:g}=y(e),w=t.useRef(null);return t.useEffect((()=>(v(w),()=>{g(w)})),[]),o.exports.jsx("span",{ref:w,className:l("react-tooltip-wrapper",r),"data-tooltip-place":i,"data-tooltip-content":a,"data-tooltip-html":s,"data-tooltip-variant":c,"data-tooltip-offset":u,"data-tooltip-wrapper":f,"data-tooltip-events":d,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":h,children:n})},Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-tooltip",
|
|
3
|
-
"version": "5.8.2
|
|
3
|
+
"version": "5.8.2",
|
|
4
4
|
"description": "react tooltip component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "node ./cli.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch",
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
"rollup-plugin-dts": "^5.0.0",
|
|
90
90
|
"rollup-plugin-filesize": "^9.1.1",
|
|
91
91
|
"rollup-plugin-html-scaffold": "^0.2.0",
|
|
92
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
93
92
|
"rollup-plugin-postcss": "^4.0.1",
|
|
94
93
|
"rollup-plugin-progress": "^1.1.2",
|
|
95
94
|
"rollup-plugin-string": "^3.0.0",
|