react-tooltip 5.5.1 → 5.5.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 +818 -1226
- package/dist/react-tooltip.cjs.min.js +11 -2
- package/dist/react-tooltip.esm.js +819 -1227
- package/dist/react-tooltip.esm.min.js +11 -2
- package/dist/react-tooltip.umd.js +818 -1226
- package/dist/react-tooltip.umd.min.js +11 -2
- package/package.json +6 -6
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import e,{createContext as t,useId as n,useState as r,useCallback as o,useMemo as i,useContext as l,useRef as a,useEffect as c}from"react";var s={exports:{}},u={};!function(){var t=e,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),h=Symbol.iterator;var v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];w("error",e,n)}function w(e,t,n){var r=v.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]));var o=n.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}var b;function x(e){return e.displayName||"Context"}function S(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case r:return"Portal";case l:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return x(e)+".Consumer";case a:return x(e._context)+".Provider";case s:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:S(e.type)||"Memo";case y:var n=e,u=n._payload,m=n._init;try{return S(m(u))}catch(e){return null}}return null}b=Symbol.for("react.module.reference");var _,R,k,T,j,O,E,A=Object.assign,P=0;function L(){}L.__reactDisabledLog=!0;var N,$=v.ReactCurrentDispatcher;function C(e,t,n){if(void 0===N)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);N=r&&r[1]||""}return"\n"+N+e}var D,F=!1,W="function"==typeof WeakMap?WeakMap:Map;function I(e,t){if(!e||F)return"";var n,r=D.get(e);if(void 0!==r)return r;F=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=$.current,$.current=null,function(){if(0===P){_=console.log,R=console.info,k=console.warn,T=console.error,j=console.group,O=console.groupCollapsed,E=console.groupEnd;var e={configurable:!0,enumerable:!0,value:L,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}P++}();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(l,[])}catch(e){n=e}Reflect.construct(e,[],l)}else{try{l.call()}catch(e){n=e}e.call(l.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),c=n.stack.split("\n"),s=a.length-1,u=c.length-1;s>=1&&u>=0&&a[s]!==c[u];)u--;for(;s>=1&&u>=0;s--,u--)if(a[s]!==c[u]){if(1!==s||1!==u)do{if(s--,--u<0||a[s]!==c[u]){var f="\n"+a[s].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&D.set(e,f),f}}while(s>=1&&u>=0);break}}}finally{F=!1,$.current=o,function(){if(0==--P){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:_}),info:A({},e,{value:R}),warn:A({},e,{value:k}),error:A({},e,{value:T}),group:A({},e,{value:j}),groupCollapsed:A({},e,{value:O}),groupEnd:A({},e,{value:E})})}P<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var p=e?e.displayName||e.name:"",d=p?C(p):"";return"function"==typeof e&&D.set(e,d),d}function H(e,t,n){if(null==e)return"";if("function"==typeof e)return I(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return C(e);switch(e){case f:return C("Suspense");case p:return C("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return I(e.render,!1);case d:return H(e.type,t,n);case y:var o=e,i=o._payload,l=o._init;try{return H(l(i),t,n)}catch(e){}}return""}D=new W;var B=Object.prototype.hasOwnProperty,U={},M=v.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);M.setExtraStackFrame(n)}else M.setExtraStackFrame(null)}var z=Array.isArray;function Y(e){return z(e)}function q(e){return""+e}function X(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}var K,J,Z,G=v.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0};Z={};function ee(e,t,r,o,i){var l,a={},c=null,s=null;for(l in void 0!==r&&(X(r),c=""+r),function(e){if(B.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(X(t.key),c=""+t.key),function(e){if(B.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&G.current&&t&&G.current.stateNode!==t){var n=S(G.current.type);Z[n]||(g('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',S(G.current.type),e.ref),Z[n]=!0)}}(t,i)),t)B.call(t,l)&&!Q.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(c||s){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){K||(K=!0,g("%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})}(a,f),s&&function(e,t){var n=function(){J||(J=!0,g("%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})}(a,f)}return function(e,t,r,o,i,l,a){var c={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:l,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,i,o,G.current,a)}var te,ne=v.ReactCurrentOwner,re=v.ReactDebugCurrentFrame;function oe(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);re.setExtraStackFrame(n)}else re.setExtraStackFrame(null)}function ie(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function le(){if(ne.current){var e=S(ne.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}te=!1;var ae={};function ce(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=le();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(!ae[n]){ae[n]=!0;var r="";e&&e._owner&&e._owner!==ne.current&&(r=" It was passed a child from "+S(e._owner.type)+"."),oe(e),g('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),oe(null)}}}function se(e,t){if("object"==typeof e)if(Y(e))for(var n=0;n<e.length;n++){var r=e[n];ie(r)&&ce(r,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var i,l=o.call(e);!(i=l.next()).done;)ie(i.value)&&ce(i.value,t)}}function ue(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!==s&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=S(n);!function(e,t,n,r,o){var i=Function.call.bind(B);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var c=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(V(o),g("%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,l,typeof a),V(null)),a instanceof Error&&!(a.message in U)&&(U[a.message]=!0,V(o),g("Failed %s type: %s",n,a.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!te){te=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fe(e,t,r,u,h,v){var w=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===l||e===i||e===f||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||void 0!==e.getModuleId)}(e);if(!w){var x="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(x+=" 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 _,R=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(h);x+=R||le(),null===e?_="null":Y(e)?_="array":void 0!==e&&e.$$typeof===n?(_="<"+(S(e.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,x)}var k=ee(e,t,r,h,v);if(null==k)return k;if(w){var T=t.children;if(void 0!==T)if(u)if(Y(T)){for(var j=0;j<T.length;j++)se(T[j],e);Object.freeze&&Object.freeze(T)}else g("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 se(T,e)}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){oe(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),oe(null);break}}null!==e.ref&&(oe(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}(k):ue(k),k}var pe=function(e,t,n){return fe(e,t,n,!1)},de=function(e,t,n){return fe(e,t,n,!0)};u.Fragment=o,u.jsx=pe,u.jsxs=de}(),s.exports=u;var f,p={exports:{}};
|
|
1
|
+
import e,{createContext as t,useState as n,useCallback as r,useMemo as o,useContext as i,useRef as l,useEffect as a}from"react";var s,c={exports:{}},u={};
|
|
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
|
+
s=u,function(){var t=e,n=60103,r=60106;s.Fragment=60107;var o=60108,i=60114,l=60109,a=60110,c=60112,u=60113,f=60120,p=60115,d=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"),r=w("react.portal"),s.Fragment=w("react.fragment"),o=w("react.strict_mode"),i=w("react.profiler"),l=w("react.provider"),a=w("react.context"),c=w("react.forward_ref"),u=w("react.suspense"),f=w("react.suspense_list"),p=w("react.memo"),d=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,x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];R("error",e,n)}function R(e,t,n){var r=x.ReactDebugCurrentFrame,o="";if(k){var i=O(k.type),l=k._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(T,"");if(/^index\./.test(i)){var l=o.match(T);if(l){var a=l[1];a&&(i=a.replace(T,"")+"/"+i)}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,k._source,l&&O(l.type))}""!==(o+=r.getStackAddendum())&&(t+="%s",n=n.concat([o]));var a=n.map((function(e){return""+e}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}var T=/^(.*)[\\\/]/;function O(e){if(null==e)return null;if("number"==typeof e.tag&&_("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s.Fragment:return"Fragment";case r:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case a:return"Context.Consumer";case l:return"Context.Provider";case c:return m=e,h=e.render,v="ForwardRef",g=h.displayName||h.name||"",m.displayName||(""!==g?v+"("+g+")":v);case p:return O(e.type);case y:return O(e.render);case d:var t=1===(n=e)._status?n._result:null;if(t)return O(t)}var n,m,h,v,g;return null}var S={};x.ReactDebugCurrentFrame;var k=null;function A(e){k=e}var j,E,L,P=x.ReactCurrentOwner,D=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function I(e,t,r,o,i){var l,a={},s=null,c=null;for(l in void 0!==r&&(s=""+r),function(e){if(D.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(D.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=O(P.current.type);L[n]||(_('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',O(P.current.type),e.ref),L[n]=!0)}}(t,i)),t)D.call(t,l)&&!N.hasOwnProperty(l)&&(a[l]=t[l]);if(e&&e.defaultProps){var u=e.defaultProps;for(l in u)void 0===a[l]&&(a[l]=u[l])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){j||(j=!0,_("%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})}(a,f),c&&function(e,t){var n=function(){E||(E=!0,_("%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})}(a,f)}return function(e,t,r,o,i,l,a){var s={$$typeof:n,type:e,key:t,ref:r,props:a,_owner:l,_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,a)}L={};var $,F=x.ReactCurrentOwner;function C(e){k=e}function W(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function H(){if(F.current){var e=O(F.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}x.ReactDebugCurrentFrame,$=!1;var U={};function B(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(!U[n]){U[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+O(e._owner.type)+"."),C(e),_('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),C(null)}}}function V(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];W(r)&&B(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,l=o.call(e);!(i=l.next()).done;)W(i.value)&&B(i.value,t)}}function M(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!==p)return;t=n.propTypes}if(t){var r=O(n);!function(e,t,n,r,o){var i=Function.call.bind(Object.prototype.hasOwnProperty);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}a=e[l](t,l,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(A(o),_("%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,l,typeof a),A(null)),a instanceof Error&&!(a.message in S)&&(S[a.message]=!0,A(o),_("Failed %s type: %s",n,a.message),A(null))}}(t,e.props,"prop",r,e)}else void 0===n.PropTypes||$||($=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function z(e,t,r,w,b,x){var R=function(e){return"string"==typeof e||"function"==typeof e||e===s.Fragment||e===i||e===v||e===o||e===u||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===l||e.$$typeof===a||e.$$typeof===c||e.$$typeof===h||e.$$typeof===y||e[0]===m)}(e);if(!R){var T="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(T+=" 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 S,k=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(b);T+=k||H(),null===e?S="null":Array.isArray(e)?S="array":void 0!==e&&e.$$typeof===n?(S="<"+(O(e.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):S=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,T)}var A=I(e,t,r,b,x);if(null==A)return A;if(R){var j=t.children;if(void 0!==j)if(w)if(Array.isArray(j)){for(var E=0;E<j.length;E++)V(j[E],e);Object.freeze&&Object.freeze(j)}else _("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 V(j,e)}return e===s.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){C(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),C(null);break}}null!==e.ref&&(C(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),C(null))}(A):M(A),A}var Y=function(e,t,n){return z(e,t,n,!1)},q=function(e,t,n){return z(e,t,n,!0)};s.jsx=Y,s.jsxs=q}(),c.exports=u;var f,p={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
|
-
*/f=p,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}f.exports?(t.default=t,f.exports=t):window.classNames=t}();var d=p.exports;const y=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},m=({content:e})=>s.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),h={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v=t(Object.assign((()=>h),h)),g=({children:e})=>{const t=n(),[l,a]=r({[t]:new Set}),[c,u]=r({[t]:{current:null}}),f=(e,...t)=>{a((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)}}))},p=(e,...t)=>{a((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},d=o((e=>{var n,r;return{anchorRefs:null!==(n=l[null!=e?e:t])&&void 0!==n?n:new Set,activeAnchor:null!==(r=c[null!=e?e:t])&&void 0!==r?r:{current:null},attach:(...n)=>f(null!=e?e:t,...n),detach:(...n)=>p(null!=e?e:t,...n),setActiveAnchor:n=>((e,t)=>{u((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(null!=e?e:t,n)}}),[t,l,c,f,p]),y=i((()=>{const e=d(t);return Object.assign((e=>d(e)),e)}),[d]);return s.exports.jsx(v.Provider,{value:y,children:e})};function w(){return l(v)}const b=({tooltipId:e,children:t,className:n,place:r,content:o,html:i,variant:l,offset:u,wrapper:f,events:p,positionStrategy:y,delayShow:m,delayHide:h})=>{const{attach:v,detach:g}=w()(e),b=a(null);return c((()=>(v(b),()=>{g(b)})),[]),s.exports.jsx("span",{ref:b,className:d("react-tooltip-wrapper",n),"data-tooltip-place":r,"data-tooltip-content":o,"data-tooltip-html":i,"data-tooltip-variant":l,"data-tooltip-offset":u,"data-tooltip-wrapper":f,"data-tooltip-events":p,"data-tooltip-position-strategy":y,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":h,children:t})};function x(e){return e.split("-")[0]}function S(e){return e.split("-")[1]}function _(e){return["top","bottom"].includes(x(e))?"x":"y"}function R(e){return"y"===e?"height":"width"}function k(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,a=_(t),c=R(a),s=r[c]/2-o[c]/2,u="x"===a;let f;switch(x(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:l};break;case"left":f={x:r.x-o.width,y:l};break;default:f={x:r.x,y:r.y}}switch(S(t)){case"start":f[a]-=s*(n&&u?-1:1);break;case"end":f[a]+=s*(n&&u?-1:1)}return f}function T(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 j(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function O(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=T(d),m=a[p?"floating"===f?"reference":"floating":f],h=j(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(a.floating)),boundary:s,rootBoundary:u,strategy:c})),v=j(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...l.floating,x:r,y:o}:l.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),strategy:c}):l[f]);return{top:h.top-v.top+y.top,bottom:v.bottom-h.bottom+y.bottom,left:h.left-v.left+y.left,right:v.right-h.right+y.right}}const E=Math.min,A=Math.max;function P(e,t,n){return A(e,E(t,n))}const L={left:"right",right:"left",bottom:"top",top:"bottom"};function N(e){return e.replace(/left|right|bottom|top/g,(e=>L[e]))}const $={start:"end",end:"start"};function C(e){return e.replace(/start|end/g,(e=>$[e]))}const D=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:s=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...y}=e,m=x(r),h=f||(m===l||!d?[N(l)]:function(e){const t=N(e);return[C(e),t,C(t)]}(l)),v=[l,...h],g=await O(t,y),w=[];let b=(null==(n=o.flip)?void 0:n.overflows)||[];if(s&&w.push(g[m]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=S(e),o=_(e),i=R(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=N(l)),{main:l,cross:N(l)}}(r,i,await(null==a.isRTL?void 0:a.isRTL(c.floating)));w.push(g[e],g[t])}if(b=[...b,{placement:r,overflows:w}],!w.every((e=>e<=0))){var k,T;const e=(null!=(k=null==(T=o.flip)?void 0:T.index)?k:0)+1,t=v[e];if(t)return{data:{index:e,overflows:b},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var j;const e=null==(j=b.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:j[0].placement;e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};const F=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)),l=x(n),a=S(n),c="x"===_(n),s=["left","top"].includes(l)?-1:1,u=i&&c?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof y&&(d="end"===a?-1*y:y),c?{x:d*u,y:p*s}:{x:p*s,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function W(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function I(e){if(null==e)return window;if(!W(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return I(e).getComputedStyle(e)}function B(e){return W(e)?"":e?(e.nodeName||"").toLowerCase():""}function U(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function M(e){return e instanceof I(e).HTMLElement}function V(e){return e instanceof I(e).Element}function z(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof I(e).ShadowRoot||e instanceof ShadowRoot}function Y(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=H(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function q(e){return["table","td","th"].includes(B(e))}function X(e){const t=/firefox/i.test(U()),n=H(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 K(){return!/^((?!chrome|android).)*safari/i.test(U())}function J(e){return["html","body","#document"].includes(B(e))}const Z=Math.min,G=Math.max,Q=Math.round;function ee(e,t,n){var r,o,i,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect();let c=1,s=1;t&&M(e)&&(c=e.offsetWidth>0&&Q(a.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Q(a.height)/e.offsetHeight||1);const u=V(e)?I(e):window,f=!K()&&n,p=(a.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/c,d=(a.top+(f&&null!=(i=null==(l=u.visualViewport)?void 0:l.offsetTop)?i:0))/s,y=a.width/c,m=a.height/s;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function te(e){return(t=e,(t instanceof I(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function ne(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(e){return ee(te(e)).left+ne(e).scrollLeft}function oe(e,t,n){const r=M(t),o=te(t),i=ee(e,r&&function(e){const t=ee(e);return Q(t.width)!==e.offsetWidth||Q(t.height)!==e.offsetHeight}(t),"fixed"===n);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==B(t)||Y(o))&&(l=ne(t)),M(t)){const e=ee(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=re(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function ie(e){if("html"===B(e))return e;const t=e.assignedSlot||e.parentNode||(z(e)?e.host:null)||te(e);return z(t)?t.host:t}function le(e){return M(e)&&"fixed"!==H(e).position?e.offsetParent:null}function ae(e){const t=I(e);let n=le(e);for(;n&&q(n)&&"static"===H(n).position;)n=le(n);return n&&("html"===B(n)||"body"===B(n)&&"static"===H(n).position&&!X(n))?t:n||function(e){let t=ie(e);for(;M(t)&&!J(t);){if(X(t))return t;t=ie(t)}return null}(e)||t}function ce(e){if(M(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ee(e);return{width:t.width,height:t.height}}function se(e){const t=ie(e);return J(t)?e.ownerDocument.body:M(t)&&Y(t)?t:se(t)}function ue(e,t){var n;void 0===t&&(t=[]);const r=se(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=I(r),l=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,a=t.concat(l);return o?a:a.concat(ue(l))}function fe(e,t,n){return"viewport"===t?j(function(e,t){const n=I(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,c=0;if(o){i=o.width,l=o.height;const e=K();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:a,y:c}}(e,n)):V(t)?function(e,t){const n=ee(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):j(function(e){var t;const n=te(e),r=ne(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=G(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=G(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+re(e);const c=-r.scrollTop;return"rtl"===H(o||n).direction&&(a+=G(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:a,y:c}}(te(e)))}const pe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ue(e).filter((e=>V(e)&&"body"!==B(e))),n=e,r=null;for(;V(n)&&!J(n);){const e=H(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!X(n)?t=t.filter((e=>e!==n)):r=e,n=ie(n)}return t}(t):[].concat(n),l=[...i,r],a=l[0],c=l.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=G(r.top,e.top),e.right=Z(r.right,e.right),e.bottom=Z(r.bottom,e.bottom),e.left=G(r.left,e.left),e}),fe(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=M(n),i=te(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==B(n)||Y(i))&&(l=ne(n)),M(n))){const e=ee(n,!0);a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{...t,x:t.x-l.scrollLeft+a.x,y:t.y-l.scrollTop+a.y}},isElement:V,getDimensions:ce,getOffsetParent:ae,getDocumentElement:te,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:oe(t,ae(n),r),floating:{...ce(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===H(e).direction},de=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));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(" ")),a.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 s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=k(s,r,c),p=r,d={},y=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:h,y:v,data:g,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:s,platform:l,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=v?v:f,d={...d,[i]:{...d[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&&(p=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=k(s,p,c))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:pe,...n}),ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const l=[F(Number(o)),D(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=a,s={x:t,y:n},u=await O(e,c),f=_(x(r)),p="x"===f?"y":"x";let d=s[f],y=s[p];if(o){const e="y"===f?"bottom":"right";d=P(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";y=P(y+u["y"===p?"top":"left"],y,y-u[e])}const m=l.fn({...e,[f]:d,[p]:y});return{...m,data:{x:m.x-t,y:m.y-n}}}})];var a;return n?(l.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:l,rects:a,platform:c}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const s=T(r),u={x:o,y:i},f=_(l),p=S(l),d=R(f),y=await c.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",v=a.reference[d]+a.reference[f]-u[f]-a.floating[d],g=u[f]-a.reference[f],w=await(null==c.getOffsetParent?void 0:c.getOffsetParent(n));let b=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0;0===b&&(b=a.floating[d]);const x=v/2-g/2,k=s[m],j=b-y[d]-s[h],O=b/2-y[d]/2+x,E=P(k,O,j),A=("start"===p?s[m]:s[h])>0&&O!==E&&a.reference[d]<=a.floating[d];return{[f]:u[f]-(A?O<k?k-O:j-O:0),data:{[f]:E,centerOffset:O-E}}}}))({element:n,padding:5})),de(e,t,{placement:r,strategy:i,middleware:l}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:c}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:l,tooltipArrowStyles:{left:null!=a?`${a}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):de(e,t,{placement:"bottom",strategy:i,middleware:l}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};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:t,classNameArrow:n,variant:o="dark",anchorId:i,place:l="top",offset:u=10,events:f=["hover"],positionStrategy:p="absolute",wrapper:h="div",children:v=null,delayShow:g=0,delayHide:b=0,float:x=!1,noArrow:S=!1,clickable:_=!1,style:R,position:k,afterShow:T,afterHide:j,content:O,html:E,isOpen:A,setIsOpen:P})=>{const L=a(null),N=a(null),$=a(null),C=a(null),[D,F]=r({}),[W,I]=r({}),[H,B]=r(!1),U=a(!1),[M,V]=r(!1),z=a(null),{anchorRefs:Y,setActiveAnchor:q}=w()(e),[X,K]=r({current:null}),J=a(!1),Z=e=>{P?P(e):void 0===A&&B(e)};c((()=>{H!==U.current&&(U.current=H,H?null==T||T():null==j||j())}),[H]);const G=(e=b)=>{C.current&&clearTimeout(C.current),C.current=setTimeout((()=>{J.current||Z(!1)}),e)},Q=e=>{var t;if(!e)return;g?($.current&&clearTimeout($.current),$.current=setTimeout((()=>{Z(!0)}),g)):Z(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;K((e=>e.current===n?e:{current:n})),q({current:n}),C.current&&clearTimeout(C.current)},ee=()=>{_?G(b||50):b?G():Z(!1),$.current&&clearTimeout($.current)},te=({x:e,y:t})=>{const n={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};V(!0),ye({place:l,offset:u,elementReference:n,tooltipReference:L.current,tooltipArrowReference:N.current,strategy:p}).then((e=>{V(!1),Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&I(e.tooltipArrowStyles)}))},ne=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};te(n),z.current=n},re=e=>{Q(e),b&&G()},oe=e=>{var t;(null===(t=X.current)||void 0===t?void 0:t.contains(e.target))||Z(!1)},ie=y(Q,50),le=y(ee,50);c((()=>{var e,t;const n=new Set(Y),r=document.querySelector(`[id='${i}']`);if(r&&(K((e=>e.current===r?e:{current:r})),n.add({current:r})),!n.size)return()=>null;const o=[];f.find((e=>"click"===e))&&(window.addEventListener("click",oe),o.push({event:"click",listener:re})),f.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:ie},{event:"mouseleave",listener:le},{event:"focus",listener:ie},{event:"blur",listener:le}),x&&o.push({event:"mousemove",listener:ne}));const l=()=>{J.current=!0},a=()=>{J.current=!1,ee()};return _&&(null===(e=L.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=L.current)||void 0===t||t.addEventListener("mouseleave",a)),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;window.removeEventListener("click",oe),_&&(null===(e=L.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=L.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[Y,X,i,f,b,g]),c((()=>{if(k)return te(k),()=>null;if(x)return z.current&&te(z.current),()=>null;let e=X.current;i&&(e=document.querySelector(`[id='${i}']`)),V(!0);let t=!0;return ye({place:l,offset:u,elementReference:e,tooltipReference:L.current,tooltipArrowReference:N.current,strategy:p}).then((e=>{t&&(V(!1),Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&I(e.tooltipArrowStyles))})),()=>{t=!1}}),[H,A,i,X,O,E,l,u,p,k]),c((()=>()=>{$.current&&clearTimeout($.current),C.current&&clearTimeout(C.current)}),[]);const ae=Boolean(E||O||v);return s.exports.jsxs(h,{id:e,role:"tooltip",className:d("react-tooltip",me.tooltip,me[o],t,{[me.show]:ae&&!M&&(A||H),[me.fixed]:"fixed"===p,[me.clickable]:_}),style:{...R,...D},ref:L,children:[v||E&&s.exports.jsx(m,{content:E})||O,s.exports.jsx("div",{className:d("react-tooltip-arrow",me.arrow,n,{[me["no-arrow"]]:S}),style:W,ref:N})]})},ve=({id:e,anchorId:t,content:n,html:o,className:i,classNameArrow:l,variant:a="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:v=0,float:g=!1,noArrow:b=!1,clickable:x=!1,style:S,position:_,isOpen:R,setIsOpen:k,afterShow:T,afterHide:j})=>{const[O,E]=r(n),[A,P]=r(o),[L,N]=r(u),[$,C]=r(a),[D,F]=r(f),[W,I]=r(h),[H,B]=r(v),[U,M]=r(g),[V,z]=r(p),[Y,q]=r(y),[X,K]=r(m),{anchorRefs:J,activeAnchor:Z}=w()(e),G=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}),{}),Q=e=>{const t={place:e=>{var t;N(null!==(t=e)&&void 0!==t?t:u)},content:e=>{E(null!=e?e:n)},html:e=>{P(null!=e?e:o)},variant:e=>{var t;C(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{F(null===e?f:Number(e))},wrapper:e=>{var t;z(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");q(null!=t?t:y)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{I(null===e?h:Number(e))},"delay-hide":e=>{B(null===e?v:Number(e))},float:e=>{M(null===e?g: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)}))};c((()=>{E(n)}),[n]),c((()=>{P(o)}),[o]),c((()=>{var e;const n=new Set(J),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>null;const o=null!==(e=Z.current)&&void 0!==e?e:r,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!o||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=G(o);Q(n)}))})),l={attributes:!0,childList:!1,subtree:!1};if(o){const e=G(o);Q(e),i.observe(o,l)}return()=>{i.disconnect()}}),[J,Z,t]);const ee={id:e,anchorId:t,className:i,classNameArrow:l,content:O,html:A,place:L,variant:$,offset:D,wrapper:V,events:Y,positionStrategy:X,delayShow:W,delayHide:H,float:U,noArrow:b,clickable:x,style:S,position:_,isOpen:R,setIsOpen:k,afterShow:T,afterHide:j};return d?s.exports.jsx(he,{...ee,children:d}):s.exports.jsx(he,{...ee})};export{ve as Tooltip,g as TooltipProvider,b as TooltipWrapper};
|
|
15
|
+
*/f=p,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&n.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}}return n.join(" ")}f.exports?(t.default=t,f.exports=t):window.classNames=t}();var d=p.exports;const y=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},m=({content:e})=>c.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),h={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v=t({getTooltipData:()=>h}),g=({children:e})=>{const[t,i]=n({DEFAULT_TOOLTIP_ID:new Set}),[l,a]=n({DEFAULT_TOOLTIP_ID:{current:null}}),s=(e,...t)=>{i((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)}}))},u=(e,...t)=>{i((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},f=r(((e="DEFAULT_TOOLTIP_ID")=>{var n,r;return{anchorRefs:null!==(n=t[e])&&void 0!==n?n:new Set,activeAnchor:null!==(r=l[e])&&void 0!==r?r:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>u(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)}}),[t,l,s,u]),p=o((()=>({getTooltipData:f})),[f]);return c.exports.jsx(v.Provider,{value:p,children:e})};function w(e="DEFAULT_TOOLTIP_ID"){return i(v).getTooltipData(e)}const b=({tooltipId:e,children:t,className:n,place:r,content:o,html:i,variant:s,offset:u,wrapper:f,events:p,positionStrategy:y,delayShow:m,delayHide:h})=>{const{attach:v,detach:g}=w(e),b=l(null);return a((()=>(v(b),()=>{g(b)})),[]),c.exports.jsx("span",{ref:b,className:d("react-tooltip-wrapper",n),"data-tooltip-place":r,"data-tooltip-content":o,"data-tooltip-html":i,"data-tooltip-variant":s,"data-tooltip-offset":u,"data-tooltip-wrapper":f,"data-tooltip-events":p,"data-tooltip-position-strategy":y,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":h,children:t})};function x(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function R(e){return["top","bottom"].includes(x(e))?"x":"y"}function T(e){return"y"===e?"height":"width"}function O(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,a=R(t),s=T(a),c=r[s]/2-o[s]/2,u="x"===a;let f;switch(x(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:l};break;case"left":f={x:r.x-o.width,y:l};break;default:f={x:r.x,y:r.y}}switch(_(t)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(n&&u?-1:1)}return f}function S(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 k(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function A(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=S(d),m=a[p?"floating"===f?"reference":"floating":f],h=k(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(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v=k(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...l.floating,x:r,y:o}:l.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),strategy:s}):l[f]);return{top:h.top-v.top+y.top,bottom:v.bottom-h.bottom+y.bottom,left:h.left-v.left+y.left,right:v.right-h.right+y.right}}const j=Math.min,E=Math.max;function L(e,t,n){return E(e,j(t,n))}const P={left:"right",right:"left",bottom:"top",top:"bottom"};function D(e){return e.replace(/left|right|bottom|top/g,(e=>P[e]))}const N={start:"end",end:"start"};function I(e){return e.replace(/start|end/g,(e=>N[e]))}const $=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:d=!0,...y}=e,m=x(r),h=f||(m===l||!d?[D(l)]:function(e){const t=D(e);return[I(e),t,I(t)]}(l)),v=[l,...h],g=await A(t,y),w=[];let b=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&w.push(g[m]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=_(e),o=R(e),i=T(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=D(l)),{main:l,cross:D(l)}}(r,i,await(null==a.isRTL?void 0:a.isRTL(s.floating)));w.push(g[e],g[t])}if(b=[...b,{placement:r,overflows:w}],!w.every((e=>e<=0))){var O,S;const e=(null!=(O=null==(S=o.flip)?void 0:S.index)?O:0)+1,t=v[e];if(t)return{data:{index:e,overflows:b},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var k;const e=null==(k=b.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0].placement;e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};const F=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)),l=x(n),a=_(n),s="x"===R(n),c=["left","top"].includes(l)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:d,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof y&&(d="end"===a?-1*y:y),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function C(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function W(e){if(null==e)return window;if(!C(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return W(e).getComputedStyle(e)}function U(e){return C(e)?"":e?(e.nodeName||"").toLowerCase():""}function B(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function V(e){return e instanceof W(e).HTMLElement}function M(e){return e instanceof W(e).Element}function z(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof W(e).ShadowRoot||e instanceof ShadowRoot}function Y(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=H(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function q(e){return["table","td","th"].includes(U(e))}function X(e){const t=/firefox/i.test(B()),n=H(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 K(){return!/^((?!chrome|android).)*safari/i.test(B())}function J(e){return["html","body","#document"].includes(U(e))}const Z=Math.min,G=Math.max,Q=Math.round;function ee(e,t,n){var r,o,i,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect();let s=1,c=1;t&&V(e)&&(s=e.offsetWidth>0&&Q(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Q(a.height)/e.offsetHeight||1);const u=M(e)?W(e):window,f=!K()&&n,p=(a.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(a.top+(f&&null!=(i=null==(l=u.visualViewport)?void 0:l.offsetTop)?i:0))/c,y=a.width/s,m=a.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function te(e){return(t=e,(t instanceof W(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function ne(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(e){return ee(te(e)).left+ne(e).scrollLeft}function oe(e,t,n){const r=V(t),o=te(t),i=ee(e,r&&function(e){const t=ee(e);return Q(t.width)!==e.offsetWidth||Q(t.height)!==e.offsetHeight}(t),"fixed"===n);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==U(t)||Y(o))&&(l=ne(t)),V(t)){const e=ee(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=re(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function ie(e){if("html"===U(e))return e;const t=e.assignedSlot||e.parentNode||(z(e)?e.host:null)||te(e);return z(t)?t.host:t}function le(e){return V(e)&&"fixed"!==H(e).position?e.offsetParent:null}function ae(e){const t=W(e);let n=le(e);for(;n&&q(n)&&"static"===H(n).position;)n=le(n);return n&&("html"===U(n)||"body"===U(n)&&"static"===H(n).position&&!X(n))?t:n||function(e){let t=ie(e);for(;V(t)&&!J(t);){if(X(t))return t;t=ie(t)}return null}(e)||t}function se(e){if(V(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ee(e);return{width:t.width,height:t.height}}function ce(e){const t=ie(e);return J(t)?e.ownerDocument.body:V(t)&&Y(t)?t:ce(t)}function ue(e,t){var n;void 0===t&&(t=[]);const r=ce(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=W(r),l=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,a=t.concat(l);return o?a:a.concat(ue(l))}function fe(e,t,n){return"viewport"===t?k(function(e,t){const n=W(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=K();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):M(t)?function(e,t){const n=ee(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):k(function(e){var t;const n=te(e),r=ne(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=G(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=G(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+re(e);const s=-r.scrollTop;return"rtl"===H(o||n).direction&&(a+=G(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:a,y:s}}(te(e)))}const pe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ue(e).filter((e=>M(e)&&"body"!==U(e))),n=e,r=null;for(;M(n)&&!J(n);){const e=H(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!X(n)?t=t.filter((e=>e!==n)):r=e,n=ie(n)}return t}(t):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=G(r.top,e.top),e.right=Z(r.right,e.right),e.bottom=Z(r.bottom,e.bottom),e.left=G(r.left,e.left),e}),fe(t,a,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=V(n),i=te(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==U(n)||Y(i))&&(l=ne(n)),V(n))){const e=ee(n,!0);a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{...t,x:t.x-l.scrollLeft+a.x,y:t.y-l.scrollTop+a.y}},isElement:M,getDimensions:se,getOffsetParent:ae,getDocumentElement:te,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:oe(t,ae(n),r),floating:{...se(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===H(e).direction},de=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(t));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(" ")),a.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 l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=O(c,r,s),p=r,d={},y=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:h,y:v,data:g,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=v?v:f,d={...d,[i]:{...d[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&&(p=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=O(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:pe,...n}),ye=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const l=[F(Number(o)),$(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=a,c={x:t,y:n},u=await A(e,s),f=R(x(r)),p="x"===f?"y":"x";let d=c[f],y=c[p];if(o){const e="y"===f?"bottom":"right";d=L(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";y=L(y+u["y"===p?"top":"left"],y,y-u[e])}const m=l.fn({...e,[f]:d,[p]:y});return{...m,data:{x:m.x-t,y:m.y-n}}}})];var a;return n?(l.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:l,rects:a,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=S(r),u={x:o,y:i},f=R(l),p=_(l),d=T(f),y=await s.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",v=a.reference[d]+a.reference[f]-u[f]-a.floating[d],g=u[f]-a.reference[f],w=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let b=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0;0===b&&(b=a.floating[d]);const x=v/2-g/2,O=c[m],k=b-y[d]-c[h],A=b/2-y[d]/2+x,j=L(O,A,k),E=("start"===p?c[m]:c[h])>0&&A!==j&&a.reference[d]<=a.floating[d];return{[f]:u[f]-(E?A<O?O-A:k-A:0),data:{[f]:j,centerOffset:A-j}}}}))({element:n,padding:5})),de(e,t,{placement:r,strategy:i,middleware:l}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{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"}}}))):de(e,t,{placement:"bottom",strategy:i,middleware:l}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};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:t,classNameArrow:r,variant:o="dark",anchorId:i,place:s="top",offset:u=10,events:f=["hover"],positionStrategy:p="absolute",wrapper:h="div",children:v=null,delayShow:g=0,delayHide:b=0,float:x=!1,noArrow:_=!1,clickable:R=!1,style:T,position:O,afterShow:S,afterHide:k,content:A,html:j,isOpen:E,setIsOpen:L})=>{const P=l(null),D=l(null),N=l(null),I=l(null),[$,F]=n({}),[C,W]=n({}),[H,U]=n(!1),B=l(!1),[V,M]=n(!1),z=l(null),{anchorRefs:Y,setActiveAnchor:q}=w(e),[X,K]=n({current:null}),J=l(!1),Z=e=>{L?L(e):void 0===E&&U(e)};a((()=>{H!==B.current&&(B.current=H,H?null==S||S():null==k||k())}),[H]);const G=(e=b)=>{I.current&&clearTimeout(I.current),I.current=setTimeout((()=>{J.current||Z(!1)}),e)},Q=e=>{var t;if(!e)return;g?(N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{Z(!0)}),g)):Z(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;K((e=>e.current===n?e:{current:n})),q({current:n}),I.current&&clearTimeout(I.current)},ee=()=>{R?G(b||50):b?G():Z(!1),N.current&&clearTimeout(N.current)},te=({x:e,y:t})=>{const n={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};M(!0),ye({place:s,offset:u,elementReference:n,tooltipReference:P.current,tooltipArrowReference:D.current,strategy:p}).then((e=>{M(!1),Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&W(e.tooltipArrowStyles)}))},ne=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};te(n),z.current=n},re=e=>{Q(e),b&&G()},oe=e=>{var t;(null===(t=X.current)||void 0===t?void 0:t.contains(e.target))||Z(!1)},ie=y(Q,50),le=y(ee,50);a((()=>{var e,t;const n=new Set(Y),r=document.querySelector(`[id='${i}']`);if(r&&(K((e=>e.current===r?e:{current:r})),n.add({current:r})),!n.size)return()=>null;const o=[];f.find((e=>"click"===e))&&(window.addEventListener("click",oe),o.push({event:"click",listener:re})),f.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:ie},{event:"mouseleave",listener:le},{event:"focus",listener:ie},{event:"blur",listener:le}),x&&o.push({event:"mousemove",listener:ne}));const l=()=>{J.current=!0},a=()=>{J.current=!1,ee()};return R&&(null===(e=P.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=P.current)||void 0===t||t.addEventListener("mouseleave",a)),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;window.removeEventListener("click",oe),R&&(null===(e=P.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=P.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;null===(r=n.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[Y,X,i,f,b,g]),a((()=>{if(O)return te(O),()=>null;if(x)return z.current&&te(z.current),()=>null;let e=X.current;i&&(e=document.querySelector(`[id='${i}']`)),M(!0);let t=!0;return ye({place:s,offset:u,elementReference:e,tooltipReference:P.current,tooltipArrowReference:D.current,strategy:p}).then((e=>{t&&(M(!1),Object.keys(e.tooltipStyles).length&&F(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&W(e.tooltipArrowStyles))})),()=>{t=!1}}),[H,E,i,X,A,j,s,u,p,O]),a((()=>()=>{N.current&&clearTimeout(N.current),I.current&&clearTimeout(I.current)}),[]);const ae=Boolean(j||A||v);return c.exports.jsxs(h,{id:e,role:"tooltip",className:d("react-tooltip",me.tooltip,me[o],t,{[me.show]:ae&&!V&&(E||H),[me.fixed]:"fixed"===p,[me.clickable]:R}),style:{...T,...$},ref:P,children:[v||j&&c.exports.jsx(m,{content:j})||A,c.exports.jsx("div",{className:d("react-tooltip-arrow",me.arrow,r,{[me["no-arrow"]]:_}),style:C,ref:D})]})},ve=({id:e,anchorId:t,content:r,html:o,className:i,classNameArrow:l,variant:s="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:v=0,float:g=!1,noArrow:b=!1,clickable:x=!1,style:_,position:R,isOpen:T,setIsOpen:O,afterShow:S,afterHide:k})=>{const[A,j]=n(r),[E,L]=n(o),[P,D]=n(u),[N,I]=n(s),[$,F]=n(f),[C,W]=n(h),[H,U]=n(v),[B,V]=n(g),[M,z]=n(p),[Y,q]=n(y),[X,K]=n(m),{anchorRefs:J,activeAnchor:Z}=w(e),G=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}),{}),Q=e=>{const t={place:e=>{var t;D(null!==(t=e)&&void 0!==t?t:u)},content:e=>{j(null!=e?e:r)},html:e=>{L(null!=e?e:o)},variant:e=>{var t;I(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{F(null===e?f:Number(e))},wrapper:e=>{var t;z(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");q(null!=t?t:y)},"position-strategy":e=>{var t;K(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{W(null===e?h:Number(e))},"delay-hide":e=>{U(null===e?v:Number(e))},float:e=>{V(null===e?g: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)}))};a((()=>{j(r)}),[r]),a((()=>{L(o)}),[o]),a((()=>{var e;const n=new Set(J),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>null;const o=null!==(e=Z.current)&&void 0!==e?e:r,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!o||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=G(o);Q(n)}))})),l={attributes:!0,childList:!1,subtree:!1};if(o){const e=G(o);Q(e),i.observe(o,l)}return()=>{i.disconnect()}}),[J,Z,t]);const ee={id:e,anchorId:t,className:i,classNameArrow:l,content:A,html:E,place:P,variant:N,offset:$,wrapper:M,events:Y,positionStrategy:X,delayShow:C,delayHide:H,float:B,noArrow:b,clickable:x,style:_,position:R,isOpen:T,setIsOpen:O,afterShow:S,afterHide:k};return d?c.exports.jsx(he,{...ee,children:d}):c.exports.jsx(he,{...ee})};export{ve as Tooltip,g as TooltipProvider,b as TooltipWrapper};
|