react-tooltip 5.5.1 → 5.6.0
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/README.md +2 -1
- package/dist/react-tooltip.cjs.js +2208 -2305
- package/dist/react-tooltip.cjs.min.js +11 -2
- package/dist/react-tooltip.d.ts +5 -1
- package/dist/react-tooltip.esm.js +2204 -2307
- package/dist/react-tooltip.esm.min.js +11 -2
- package/dist/react-tooltip.umd.js +2208 -2305
- package/dist/react-tooltip.umd.min.js +11 -2
- package/package.json +6 -6
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e),n={exports:{}},o={};!function(){var e=r.default,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=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=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];w("error",e,r)}function w(e,t,r){var n=v.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var o=r.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 i:return"Fragment";case n:return"Portal";case a:return"Profiler";case l:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return x(e)+".Consumer";case s:return x(e._context)+".Provider";case u:return function(e,t,r){var n=e.displayName;if(n)return n;var o=t.displayName||t.name||"";return""!==o?r+"("+o+")":r}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:S(e.type)||"Memo";case y:var r=e,o=r._payload,m=r._init;try{return S(m(o))}catch(e){return null}}return null}b=Symbol.for("react.module.reference");var R,_,k,T,E,j,O,A=Object.assign,P=0;function L(){}L.__reactDisabledLog=!0;var N,C=v.ReactCurrentDispatcher;function $(e,t,r){if(void 0===N)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);N=n&&n[1]||""}return"\n"+N+e}var D,W=!1,F="function"==typeof WeakMap?WeakMap:Map;function I(e,t){if(!e||W)return"";var r,n=D.get(e);if(void 0!==n)return n;W=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=C.current,C.current=null,function(){if(0===P){R=console.log,_=console.info,k=console.warn,T=console.error,E=console.group,j=console.groupCollapsed,O=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){r=e}Reflect.construct(e,[],l)}else{try{l.call()}catch(e){r=e}e.call(l.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),s=r.stack.split("\n"),c=a.length-1,u=s.length-1;c>=1&&u>=0&&a[c]!==s[u];)u--;for(;c>=1&&u>=0;c--,u--)if(a[c]!==s[u]){if(1!==c||1!==u)do{if(c--,--u<0||a[c]!==s[u]){var f="\n"+a[c].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(c>=1&&u>=0);break}}}finally{W=!1,C.current=o,function(){if(0==--P){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:R}),info:A({},e,{value:_}),warn:A({},e,{value:k}),error:A({},e,{value:T}),group:A({},e,{value:E}),groupCollapsed:A({},e,{value:j}),groupEnd:A({},e,{value:O})})}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?$(p):"";return"function"==typeof e&&D.set(e,d),d}function H(e,t,r){if(null==e)return"";if("function"==typeof e)return I(e,!(!(n=e.prototype)||!n.isReactComponent));var n;if("string"==typeof e)return $(e);switch(e){case f:return $("Suspense");case p:return $("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return I(e.render,!1);case d:return H(e.type,t,r);case y:var o=e,i=o._payload,l=o._init;try{return H(l(i),t,r)}catch(e){}}return""}D=new F;var M=Object.prototype.hasOwnProperty,B={},U=v.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);U.setExtraStackFrame(r)}else U.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,r,n,o,i){var l,a={},s=null,c=null;for(l in void 0!==n&&(X(n),s=""+n),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(r)&&(X(r.key),s=""+r.key),function(e){if(M.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(r)&&(c=r.ref,function(e,t){if("string"==typeof e.ref&&G.current&&t&&G.current.stateNode!==t){var r=S(G.current.type);Z[r]||(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[r]=!0)}}(r,i)),r)M.call(r,l)&&!Q.hasOwnProperty(l)&&(a[l]=r[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 r=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))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(a,f),c&&function(e,t){var r=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))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(a,f)}return function(e,r,n,o,i,l,a){var s={$$typeof:t,type:e,key:r,ref:n,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,G.current,a)}var te,re=v.ReactCurrentOwner,ne=v.ReactDebugCurrentFrame;function oe(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);ne.setExtraStackFrame(r)}else ne.setExtraStackFrame(null)}function ie(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function le(){if(re.current){var e=S(re.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}te=!1;var ae={};function se(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=le();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!ae[r]){ae[r]=!0;var n="";e&&e._owner&&e._owner!==re.current&&(n=" 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.',r,n),oe(null)}}}function ce(e,t){if("object"==typeof e)if(Y(e))for(var r=0;r<e.length;r++){var n=e[r];ie(n)&&se(n,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)&&se(i.value,t)}}function ue(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==u&&r.$$typeof!==d)return;t=r.propTypes}if(t){var n=S(r);!function(e,t,r,n,o){var i=Function.call.bind(M);for(var l in e)if(i(e,l)){var a=void 0;try{if("function"!=typeof e[l]){var s=Error((n||"React class")+": "+r+" 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,n,r,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).",n||"React class",r,l,typeof a),V(null)),a instanceof Error&&!(a.message in B)&&(B[a.message]=!0,V(o),g("Failed %s type: %s",r,a.message),V(null))}}(t,e.props,"prop",n,e)}else if(void 0!==r.PropTypes&&!te){te=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(r)||"Unknown")}"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fe(e,r,n,o,h,v){var w=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===l||e===f||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===s||e.$$typeof===c||e.$$typeof===u||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+=_||le(),null===e?R="null":Y(e)?R="array":void 0!==e&&e.$$typeof===t?(R="<"+(S(e.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):R=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",R,x)}var k=ee(e,r,n,h,v);if(null==k)return k;if(w){var T=r.children;if(void 0!==T)if(o)if(Y(T)){for(var E=0;E<T.length;E++)ce(T[E],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 ce(T,e)}return e===i?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){oe(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),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,r){return fe(e,t,r,!1)},de=function(e,t,r){return fe(e,t,r,!0)};o.Fragment=i,o.jsx=pe,o.jsxs=de}(),n.exports=o;var i,l={exports:{}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e){return e.split("-")[0]}function o(e){return e.split("-")[1]}function i(e){return["top","bottom"].includes(r(e))?"x":"y"}function l(e){return"y"===e?"height":"width"}function a(e,t,n){let{reference:a,floating:s}=e;const c=a.x+a.width/2-s.width/2,u=a.y+a.height/2-s.height/2,f=i(t),p=l(f),d=a[p]/2-s[p]/2,m="x"===f;let y;switch(r(t)){case"top":y={x:c,y:a.y-s.height};break;case"bottom":y={x:c,y:a.y+a.height};break;case"right":y={x:a.x+a.width,y:u};break;case"left":y={x:a.x-s.width,y:u};break;default:y={x:a.x,y:a.y}}switch(o(t)){case"start":y[f]-=d*(n&&m?-1:1);break;case"end":y[f]+=d*(n&&m?-1:1)}return y}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 c(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function u(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:m=!1,padding:y=0}=t,h=s(y),g=a[m?"floating"===d?"reference":"floating":d],v=c(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:p,strategy:u})),w=c(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===d?{...l.floating,x:r,y:o}:l.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),strategy:u}):l[d]);return{top:v.top-w.top+h.top,bottom:w.bottom-v.bottom+h.bottom,left:v.left-w.left+h.left,right:w.right-v.right+h.right}}const f=Math.min,p=Math.max;function d(e,t,n){return p(e,f(t,n))}const m={left:"right",right:"left",bottom:"top",top:"bottom"};function y(e){return e.replace(/left|right|bottom|top/g,(e=>m[e]))}function h(e,t,n){void 0===n&&(n=!1);const r=o(e),a=i(e),s=l(a);let c="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=y(c)),{main:c,cross:y(c)}}const g={start:"end",end:"start"};function v(e){return e.replace(/start|end/g,(e=>g[e]))}const w=["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]);const b=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",flipAlignment:g=!0,...w}=e,b=r(o),x=d||(b===a||!g?[y(a)]:function(e){const t=y(e);return[v(e),t,v(t)]}(a)),R=[a,...x],_=await u(t,w),S=[];let T=(null==(n=i.flip)?void 0:n.overflows)||[];if(f&&S.push(_[b]),p){const{main:e,cross:t}=h(o,l,await(null==s.isRTL?void 0:s.isRTL(c.floating)));S.push(_[e],_[t])}if(T=[...T,{placement:o,overflows:S}],!S.every((e=>e<=0))){var O,k;const e=(null!=(O=null==(k=i.flip)?void 0:k.index)?O:0)+1,t=R[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n="bottom";switch(m){case"bestFit":{var A;const e=null==(A=T.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:A[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}};const x=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:l}=t,a=await async function(e,t){const{placement:n,platform:l,elements:a}=e,s=await(null==l.isRTL?void 0:l.isRTL(a.floating)),c=r(n),u=o(n),f="x"===i(n),p=["left","top"].includes(c)?-1:1,d=s&&f?-1:1,m="function"==typeof t?t(e):t;let{mainAxis:y,crossAxis:h,alignmentAxis:g}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return u&&"number"==typeof g&&(h="end"===u?-1*g:g),f?{x:h*d,y:y*p}:{x:y*p,y:h*d}}(t,e);return{x:n+a.x,y:l+a.y,data:a}}}};const R=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=e,p={x:n,y:o},m=await u(t,f),y=i(r(l)),h="x"===y?"y":"x";let g=p[y],v=p[h];if(a){const e="y"===y?"bottom":"right";g=d(g+m["y"===y?"top":"left"],g,g-m[e])}if(s){const e="y"===h?"bottom":"right";v=d(v+m["y"===h?"top":"left"],v,v-m[e])}const w=c.fn({...t,[y]:g,[h]:v});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function _(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function S(e){if(null==e)return window;if(!_(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function T(e){return S(e).getComputedStyle(e)}function O(e){return _(e)?"":e?(e.nodeName||"").toLowerCase():""}function k(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function A(e){return e instanceof S(e).HTMLElement}function j(e){return e instanceof S(e).Element}function E(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof S(e).ShadowRoot||e instanceof ShadowRoot}function P(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=T(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function L(e){return["table","td","th"].includes(O(e))}function D(e){const t=/firefox/i.test(k()),n=T(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 N(){return!/^((?!chrome|android).)*safari/i.test(k())}function C(e){return["html","body","#document"].includes(O(e))}const I=Math.min,$=Math.max,F=Math.round;function W(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&&A(e)&&(s=e.offsetWidth>0&&F(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&F(a.height)/e.offsetHeight||1);const u=j(e)?S(e):window,f=!N()&&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,m=a.width/s,y=a.height/c;return{width:m,height:y,top:d,right:p+m,bottom:d+y,left:p,x:p,y:d}}function H(e){return(t=e,(t instanceof S(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function U(e){return j(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function B(e){return W(H(e)).left+U(e).scrollLeft}function V(e,t,n){const r=A(t),o=H(t),i=W(e,r&&function(e){const t=W(e);return F(t.width)!==e.offsetWidth||F(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"!==O(t)||P(o))&&(l=U(t)),A(t)){const e=W(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=B(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function M(e){if("html"===O(e))return e;const t=e.assignedSlot||e.parentNode||(E(e)?e.host:null)||H(e);return E(t)?t.host:t}function z(e){return A(e)&&"fixed"!==T(e).position?e.offsetParent:null}function q(e){const t=S(e);let n=z(e);for(;n&&L(n)&&"static"===T(n).position;)n=z(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===T(n).position&&!D(n))?t:n||function(e){let t=M(e);for(;A(t)&&!C(t);){if(D(t))return t;t=M(t)}return null}(e)||t}function Y(e){if(A(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=W(e);return{width:t.width,height:t.height}}function X(e){const t=M(e);return C(t)?e.ownerDocument.body:A(t)&&P(t)?t:X(t)}function K(e,t){var n;void 0===t&&(t=[]);const r=X(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=S(r),l=o?[i].concat(i.visualViewport||[],P(r)?r:[]):r,a=t.concat(l);return o?a:a.concat(K(l))}function J(e,t,n){return"viewport"===t?c(function(e,t){const n=S(e),r=H(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=N();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,n)):j(t)?function(e,t){const n=W(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):c(function(e){var t;const n=H(e),r=U(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=$(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=$(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-r.scrollLeft+B(e);const s=-r.scrollTop;return"rtl"===T(o||n).direction&&(a+=$(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:a,y:s}}(H(e)))}const Z={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=K(e).filter((e=>j(e)&&"body"!==O(e))),n=e,r=null;for(;j(n)&&!C(n);){const e=T(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!D(n)?t=t.filter((e=>e!==n)):r=e,n=M(n)}return t}(t):[].concat(n),l=[...i,r],a=l[0],s=l.reduce(((e,n)=>{const r=J(t,n,o);return e.top=$(r.top,e.top),e.right=I(r.right,e.right),e.bottom=I(r.bottom,e.bottom),e.left=$(r.left,e.left),e}),J(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=A(n),i=H(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==O(n)||P(i))&&(l=U(n)),A(n))){const e=W(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:j,getDimensions:Y,getOffsetParent:q,getDocumentElement:H,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:V(t,q(n),r),floating:{...Y(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===T(e).direction},G=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=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(" ")),s.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 u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:p}=a(u,r,c),d=r,m={},y=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:g,y:v,data:w,reset:b}=await h({x:f,y:p,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});f=null!=g?g:f,p=null!=v?v:p,m={...m,[i]:{...m[i],...w}},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(" ")),b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:p}=a(u,d,c))),n=-1)}return{x:f,y:p,placement:d,strategy:o,middlewareData:m}})(e,t,{platform:Z,...n});var Q={exports:{}},ee={};
|
|
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=n.default,r=60103,o=60106;e.Fragment=60107;var i=60108,l=60114,a=60109,s=60110,c=60112,u=60113,f=60120,p=60115,d=60116,m=60121,y=60122,h=60117,g=60129,v=60131;if("function"==typeof Symbol&&Symbol.for){var w=Symbol.for;r=w("react.element"),o=w("react.portal"),e.Fragment=w("react.fragment"),i=w("react.strict_mode"),l=w("react.profiler"),a=w("react.provider"),s=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"),m=w("react.block"),y=w("react.server.block"),h=w("react.fundamental"),w("react.scope"),w("react.opaque.id"),g=w("react.debug_trace_mode"),w("react.offscreen"),v=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 R(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=T(k.type),l=k._owner;o+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(S,"");if(/^index\./.test(i)){var l=o.match(S);if(l){var a=l[1];if(a)i=a.replace(S,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(i,k._source,l&&T(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 S=/^(.*)[\\\/]/;function T(t){if(null==t)return null;if("number"==typeof t.tag&&R("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 l: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 a:return"Context.Provider";case c:return y=t,h=t.render,g="ForwardRef",v=h.displayName||h.name||"",y.displayName||(""!==v?g+"("+v+")":g);case p:return T(t.type);case m:return T(t.render);case d:var n=1===(r=t)._status?r._result:null;if(n)return T(n)}var r,y,h,g,v;return null}var O={};x.ReactDebugCurrentFrame;var k=null;function A(e){k=e}var j,E,P,L=x.ReactCurrentOwner,D=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};P={};function C(e,t,n,o,i){var l,a={},s=null,c=null;for(l in void 0!==n&&(s=""+n),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&&L.current&&t&&L.current.stateNode!==t){var n=T(L.current.type);P[n]||(R('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',T(L.current.type),e.ref),P[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,R("%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,R("%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,n,o,i,l,a){var s={$$typeof:r,type:e,key:t,ref:n,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,L.current,a)}var I,$=x.ReactCurrentOwner;function F(e){k=e}function W(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}function H(){if($.current){var e=T($.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}x.ReactDebugCurrentFrame,I=!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!==$.current&&(r=" It was passed a child from "+T(e._owner.type)+"."),F(e),R('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),F(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=T(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),R("%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 O)&&(O[a.message]=!0,A(o),R("Failed %s type: %s",n,a.message),A(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!I){I=!0,R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function z(t,n,o,w,b,x){var _=function(t){return"string"==typeof t||"function"==typeof t||t===e.Fragment||t===l||t===g||t===i||t===u||t===f||t===v||"object"==typeof t&&null!==t&&(t.$$typeof===d||t.$$typeof===p||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c||t.$$typeof===h||t.$$typeof===m||t[0]===y)}(t);if(!_){var S="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(S+=" 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 O,k=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(b);S+=k||H(),null===t?O="null":Array.isArray(t)?O="array":void 0!==t&&t.$$typeof===r?(O="<"+(T(t.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):O=typeof t,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,S)}var A=C(t,n,o,b,x);if(null==A)return A;if(_){var j=n.children;if(void 0!==j)if(w)if(Array.isArray(j)){for(var E=0;E<j.length;E++)V(j[E],t);Object.freeze&&Object.freeze(j)}else R("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,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){F(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),F(null);break}}null!==e.ref&&(F(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}(A):M(A),A}var q=function(e,t,n){return z(e,t,n,!1)},Y=function(e,t,n){return z(e,t,n,!0)};e.jsx=q,e.jsxs=Y}()}(ee),Q.exports=ee;var te,ne={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
|
-
*/i=l,function(){var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var i=typeof o;if("string"===i||"number"===i)r.push(o);else if(Array.isArray(o)){if(o.length){var l=t.apply(null,o);l&&r.push(l)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&r.push(a)}}}return r.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();var a=l.exports;const s=(e,t,r)=>{let n=null;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||e.apply(this,o)}),t)}},c=({content:e})=>n.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),u={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},f=Object.assign((()=>u),u),p=e.createContext(f);function d(){return e.useContext(p)}function y(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return["top","bottom"].includes(y(e))?"x":"y"}function v(e){return"y"===e?"height":"width"}function g(e,t,r){let{reference:n,floating:o}=e;const i=n.x+n.width/2-o.width/2,l=n.y+n.height/2-o.height/2,a=h(t),s=v(a),c=n[s]/2-o[s]/2,u="x"===a;let f;switch(y(t)){case"top":f={x:i,y:n.y-o.height};break;case"bottom":f={x:i,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:l};break;case"left":f={x:n.x-o.width,y:l};break;default:f={x:n.x,y:n.y}}switch(m(t)){case"start":f[a]-=c*(r&&u?-1:1);break;case"end":f[a]+=c*(r&&u?-1:1)}return f}function w(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 b(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function x(e,t){var r;void 0===t&&(t={});const{x:n,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=w(d),m=a[p?"floating"===f?"reference":"floating":f],h=b(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v=b(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...l.floating,x:n,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 S=Math.min,R=Math.max;function _(e,t,r){return R(e,S(t,r))}const k={left:"right",right:"left",bottom:"top",top:"bottom"};function T(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}const E={start:"end",end:"start"};function j(e){return e.replace(/start|end/g,(e=>E[e]))}const O=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,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,...g}=e,w=y(n),b=f||(w===l||!d?[T(l)]:function(e){const t=T(e);return[j(e),t,j(t)]}(l)),S=[l,...b],R=await x(t,g),_=[];let k=(null==(r=o.flip)?void 0:r.overflows)||[];if(c&&_.push(R[w]),u){const{main:e,cross:t}=function(e,t,r){void 0===r&&(r=!1);const n=m(e),o=h(e),i=v(o);let l="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=T(l)),{main:l,cross:T(l)}}(n,i,await(null==a.isRTL?void 0:a.isRTL(s.floating)));_.push(R[e],R[t])}if(k=[...k,{placement:n,overflows:_}],!_.every((e=>e<=0))){var E,O;const e=(null!=(E=null==(O=o.flip)?void 0:O.index)?E:0)+1,t=S[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let r="bottom";switch(p){case"bestFit":{var A;const e=null==(A=k.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:A[0].placement;e&&(r=e);break}case"initialPlacement":r=l}if(n!==r)return{reset:{placement:r}}}return{}}}};const A=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await async function(e,t){const{placement:r,platform:n,elements:o}=e,i=await(null==n.isRTL?void 0:n.isRTL(o.floating)),l=y(r),a=m(r),s="x"===h(r),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:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof v&&(d="end"===a?-1*v:v),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return{x:r+o.x,y:n+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function L(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){return L(e).getComputedStyle(e)}function C(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function $(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function D(e){return e instanceof L(e).HTMLElement}function W(e){return e instanceof L(e).Element}function F(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof L(e).ShadowRoot||e instanceof ShadowRoot}function I(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=N(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(o)}function H(e){return["table","td","th"].includes(C(e))}function M(e){const t=/firefox/i.test($()),r=N(e),n=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!n&&"none"!==n||t&&"filter"===r.willChange||t&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some((e=>r.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=r.contain;return null!=t&&t.includes(e)}))}function B(){return!/^((?!chrome|android).)*safari/i.test($())}function U(e){return["html","body","#document"].includes(C(e))}const V=Math.min,z=Math.max,Y=Math.round;function q(e,t,r){var n,o,i,l;void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect();let s=1,c=1;t&&D(e)&&(s=e.offsetWidth>0&&Y(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Y(a.height)/e.offsetHeight||1);const u=W(e)?L(e):window,f=!B()&&r,p=(a.left+(f&&null!=(n=null==(o=u.visualViewport)?void 0:o.offsetLeft)?n: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 X(e){return(t=e,(t instanceof L(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function K(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function J(e){return q(X(e)).left+K(e).scrollLeft}function Z(e,t,r){const n=D(t),o=X(t),i=q(e,n&&function(e){const t=q(e);return Y(t.width)!==e.offsetWidth||Y(t.height)!==e.offsetHeight}(t),"fixed"===r);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(n||!n&&"fixed"!==r)if(("body"!==C(t)||I(o))&&(l=K(t)),D(t)){const e=q(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=J(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function G(e){if("html"===C(e))return e;const t=e.assignedSlot||e.parentNode||(F(e)?e.host:null)||X(e);return F(t)?t.host:t}function Q(e){return D(e)&&"fixed"!==N(e).position?e.offsetParent:null}function ee(e){const t=L(e);let r=Q(e);for(;r&&H(r)&&"static"===N(r).position;)r=Q(r);return r&&("html"===C(r)||"body"===C(r)&&"static"===N(r).position&&!M(r))?t:r||function(e){let t=G(e);for(;D(t)&&!U(t);){if(M(t))return t;t=G(t)}return null}(e)||t}function te(e){if(D(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=q(e);return{width:t.width,height:t.height}}function re(e){const t=G(e);return U(t)?e.ownerDocument.body:D(t)&&I(t)?t:re(t)}function ne(e,t){var r;void 0===t&&(t=[]);const n=re(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),i=L(n),l=o?[i].concat(i.visualViewport||[],I(n)?n:[]):n,a=t.concat(l);return o?a:a.concat(ne(l))}function oe(e,t,r){return"viewport"===t?b(function(e,t){const r=L(e),n=X(e),o=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const e=B();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(e,r)):W(t)?function(e,t){const r=q(e,!1,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft;return{top:n,left:o,x:o,y:n,right:o+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,r):b(function(e){var t;const r=X(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=z(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=z(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-n.scrollLeft+J(e);const s=-n.scrollTop;return"rtl"===N(o||r).direction&&(a+=z(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:a,y:s}}(X(e)))}const ie={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i="clippingAncestors"===r?function(e){let t=ne(e).filter((e=>W(e)&&"body"!==C(e))),r=e,n=null;for(;W(r)&&!U(r);){const e=N(r);"static"===e.position&&n&&["absolute","fixed"].includes(n.position)&&!M(r)?t=t.filter((e=>e!==r)):n=e,r=G(r)}return t}(t):[].concat(r),l=[...i,n],a=l[0],s=l.reduce(((e,r)=>{const n=oe(t,r,o);return e.top=z(n.top,e.top),e.right=V(n.right,e.right),e.bottom=V(n.bottom,e.bottom),e.left=z(n.left,e.left),e}),oe(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:r,strategy:n}=e;const o=D(r),i=X(r);if(r===i)return t;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((o||!o&&"fixed"!==n)&&(("body"!==C(r)||I(i))&&(l=K(r)),D(r))){const e=q(r,!0);a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}return{...t,x:t.x-l.scrollLeft+a.x,y:t.y-l.scrollTop+a.y}},isElement:W,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:r,strategy:n}=e;return{reference:Z(t,ee(r),n),floating:{...te(r),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===N(e).direction},le=(e,t,r)=>(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l}=r,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}=g(c,n,s),p=n,d={},y=0;for(let r=0;r<a.length;r++){const{name:i,fn:m}=a[r],{x:h,y:v,data:w,reset:b}=await m({x:u,y:f,initialPlacement:n,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],...w}},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(" ")),b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=g(c,p,s))),r=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:ie,...r}),ae=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:n="top",offset:o=10,strategy:i="absolute"})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const l=[A(Number(o)),O(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:r,placement:n}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=a,c={x:t,y:r},u=await x(e,s),f=h(y(n)),p="x"===f?"y":"x";let d=c[f],m=c[p];if(o){const e="y"===f?"bottom":"right";d=_(d+u["y"===f?"top":"left"],d,d-u[e])}if(i){const e="y"===p?"bottom":"right";m=_(m+u["y"===p?"top":"left"],m,m-u[e])}const v=l.fn({...e,[f]:d,[p]:m});return{...v,data:{x:v.x-t,y:v.y-r}}}})];var a;return r?(l.push((e=>({name:"arrow",options:e,async fn(t){const{element:r,padding:n=0}=null!=e?e:{},{x:o,y:i,placement:l,rects:a,platform:s}=t;if(null==r)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=w(n),u={x:o,y:i},f=h(l),p=m(l),d=v(f),y=await s.getDimensions(r),g="y"===f?"top":"left",b="y"===f?"bottom":"right",x=a.reference[d]+a.reference[f]-u[f]-a.floating[d],S=u[f]-a.reference[f],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r));let k=R?"y"===f?R.clientHeight||0:R.clientWidth||0:0;0===k&&(k=a.floating[d]);const T=x/2-S/2,E=c[g],j=k-y[d]-c[b],O=k/2-y[d]/2+T,A=_(E,O,j),P=("start"===p?c[g]:c[b])>0&&O!==A&&a.reference[d]<=a.floating[d];return{[f]:u[f]-(P?O<E?E-O:j-O:0),data:{[f]:A,centerOffset:O-A}}}}))({element:r,padding:5})),le(e,t,{placement:n,strategy:i,middleware:l}).then((({x:e,y:t,placement:r,middlewareData:n})=>{var o,i;const l={left:`${e}px`,top:`${t}px`},{x:a,y:s}=null!==(o=n.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"}[r.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):le(e,t,{placement:"bottom",strategy:i,middleware:l}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var se={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 ce=({id:t,className:r,classNameArrow:o,variant:i="dark",anchorId:l,place:u="top",offset:f=10,events:p=["hover"],positionStrategy:y="absolute",wrapper:m="div",children:h=null,delayShow:v=0,delayHide:g=0,float:w=!1,noArrow:b=!1,clickable:x=!1,style:S,position:R,afterShow:_,afterHide:k,content:T,html:E,isOpen:j,setIsOpen:O})=>{const A=e.useRef(null),P=e.useRef(null),L=e.useRef(null),N=e.useRef(null),[C,$]=e.useState({}),[D,W]=e.useState({}),[F,I]=e.useState(!1),H=e.useRef(!1),[M,B]=e.useState(!1),U=e.useRef(null),{anchorRefs:V,setActiveAnchor:z}=d()(t),[Y,q]=e.useState({current:null}),X=e.useRef(!1),K=e=>{O?O(e):void 0===j&&I(e)};e.useEffect((()=>{F!==H.current&&(H.current=F,F?null==_||_():null==k||k())}),[F]);const J=(e=g)=>{N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{X.current||K(!1)}),e)},Z=e=>{var t;if(!e)return;v?(L.current&&clearTimeout(L.current),L.current=setTimeout((()=>{K(!0)}),v)):K(!0);const r=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;q((e=>e.current===r?e:{current:r})),z({current:r}),N.current&&clearTimeout(N.current)},G=()=>{x?J(g||50):g?J():K(!1),L.current&&clearTimeout(L.current)},Q=({x:e,y:t})=>{const r={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};B(!0),ae({place:u,offset:f,elementReference:r,tooltipReference:A.current,tooltipArrowReference:P.current,strategy:y}).then((e=>{B(!1),Object.keys(e.tooltipStyles).length&&$(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&W(e.tooltipArrowStyles)}))},ee=e=>{if(!e)return;const t=e,r={x:t.clientX,y:t.clientY};Q(r),U.current=r},te=e=>{Z(e),g&&J()},re=e=>{var t;(null===(t=Y.current)||void 0===t?void 0:t.contains(e.target))||K(!1)},ne=s(Z,50),oe=s(G,50);e.useEffect((()=>{var e,t;const r=new Set(V),n=document.querySelector(`[id='${l}']`);if(n&&(q((e=>e.current===n?e:{current:n})),r.add({current:n})),!r.size)return()=>null;const o=[];p.find((e=>"click"===e))&&(window.addEventListener("click",re),o.push({event:"click",listener:te})),p.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:ne},{event:"mouseleave",listener:oe},{event:"focus",listener:ne},{event:"blur",listener:oe}),w&&o.push({event:"mousemove",listener:ee}));const i=()=>{X.current=!0},a=()=>{X.current=!1,G()};return x&&(null===(e=A.current)||void 0===e||e.addEventListener("mouseenter",i),null===(t=A.current)||void 0===t||t.addEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{r.forEach((r=>{var n;null===(n=r.current)||void 0===n||n.addEventListener(e,t)}))})),()=>{var e,t;window.removeEventListener("click",re),x&&(null===(e=A.current)||void 0===e||e.removeEventListener("mouseenter",i),null===(t=A.current)||void 0===t||t.removeEventListener("mouseleave",a)),o.forEach((({event:e,listener:t})=>{r.forEach((r=>{var n;null===(n=r.current)||void 0===n||n.removeEventListener(e,t)}))}))}}),[V,Y,l,p,g,v]),e.useEffect((()=>{if(R)return Q(R),()=>null;if(w)return U.current&&Q(U.current),()=>null;let e=Y.current;l&&(e=document.querySelector(`[id='${l}']`)),B(!0);let t=!0;return ae({place:u,offset:f,elementReference:e,tooltipReference:A.current,tooltipArrowReference:P.current,strategy:y}).then((e=>{t&&(B(!1),Object.keys(e.tooltipStyles).length&&$(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&W(e.tooltipArrowStyles))})),()=>{t=!1}}),[F,j,l,Y,T,E,u,f,y,R]),e.useEffect((()=>()=>{L.current&&clearTimeout(L.current),N.current&&clearTimeout(N.current)}),[]);const ie=Boolean(E||T||h);return n.exports.jsxs(m,{id:t,role:"tooltip",className:a("react-tooltip",se.tooltip,se[i],r,{[se.show]:ie&&!M&&(j||F),[se.fixed]:"fixed"===y,[se.clickable]:x}),style:{...S,...C},ref:A,children:[h||E&&n.exports.jsx(c,{content:E})||T,n.exports.jsx("div",{className:a("react-tooltip-arrow",se.arrow,o,{[se["no-arrow"]]:b}),style:D,ref:P})]})};exports.Tooltip=({id:t,anchorId:r,content:o,html:i,className:l,classNameArrow:a,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:v=0,float:g=!1,noArrow:w=!1,clickable:b=!1,style:x,position:S,isOpen:R,setIsOpen:_,afterShow:k,afterHide:T})=>{const[E,j]=e.useState(o),[O,A]=e.useState(i),[P,L]=e.useState(c),[N,C]=e.useState(s),[$,D]=e.useState(u),[W,F]=e.useState(h),[I,H]=e.useState(v),[M,B]=e.useState(g),[U,V]=e.useState(f),[z,Y]=e.useState(y),[q,X]=e.useState(m),{anchorRefs:K,activeAnchor:J}=d()(t),Z=e=>null==e?void 0:e.getAttributeNames().reduce(((t,r)=>{var n;if(r.startsWith("data-tooltip-")){t[r.replace(/^data-tooltip-/,"")]=null!==(n=null==e?void 0:e.getAttribute(r))&&void 0!==n?n:null}return t}),{}),G=e=>{const t={place:e=>{var t;L(null!==(t=e)&&void 0!==t?t:c)},content:e=>{j(null!=e?e:o)},html:e=>{A(null!=e?e:i)},variant:e=>{var t;C(null!==(t=e)&&void 0!==t?t:s)},offset:e=>{D(null===e?u:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");Y(null!=t?t:y)},"position-strategy":e=>{var t;X(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{F(null===e?h:Number(e))},"delay-hide":e=>{H(null===e?v:Number(e))},float:e=>{B(null===e?g:Boolean(e))}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,r])=>{var n;null===(n=t[e])||void 0===n||n.call(t,r)}))};e.useEffect((()=>{j(o)}),[o]),e.useEffect((()=>{A(i)}),[i]),e.useEffect((()=>{var e;const t=new Set(K),n=document.querySelector(`[id='${r}']`);if(n&&t.add({current:n}),!t.size)return()=>null;const o=null!==(e=J.current)&&void 0!==e?e:n,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 r=Z(o);G(r)}))})),l={attributes:!0,childList:!1,subtree:!1};if(o){const e=Z(o);G(e),i.observe(o,l)}return()=>{i.disconnect()}}),[K,J,r]);const Q={id:t,anchorId:r,className:l,classNameArrow:a,content:E,html:O,place:P,variant:N,offset:$,wrapper:U,events:z,positionStrategy:q,delayShow:W,delayHide:I,float:M,noArrow:w,clickable:b,style:x,position:S,isOpen:R,setIsOpen:_,afterShow:k,afterHide:T};return p?n.exports.jsx(ce,{...Q,children:p}):n.exports.jsx(ce,{...Q})},exports.TooltipProvider=({children:t})=>{const r=e.useId(),[o,i]=e.useState({[r]:new Set}),[l,a]=e.useState({[r]:{current:null}}),s=(e,...t)=>{i((r=>{var n;const o=null!==(n=r[e])&&void 0!==n?n:new Set;return t.forEach((e=>o.add(e))),{...r,[e]:new Set(o)}}))},c=(e,...t)=>{i((r=>{const n=r[e];return n?(t.forEach((e=>n.delete(e))),{...r}):r}))},u=e.useCallback((e=>{var t,n;return{anchorRefs:null!==(t=o[null!=e?e:r])&&void 0!==t?t:new Set,activeAnchor:null!==(n=l[null!=e?e:r])&&void 0!==n?n:{current:null},attach:(...t)=>s(null!=e?e:r,...t),detach:(...t)=>c(null!=e?e:r,...t),setActiveAnchor:t=>((e,t)=>{a((r=>{var n;return(null===(n=r[e])||void 0===n?void 0:n.current)===t.current?r:{...r,[e]:t}}))})(null!=e?e:r,t)}}),[r,o,l,s,c]),f=e.useMemo((()=>{const e=u(r);return Object.assign((e=>u(e)),e)}),[u]);return n.exports.jsx(p.Provider,{value:f,children:t})},exports.TooltipWrapper=({tooltipId:t,children:r,className:o,place:i,content:l,html:s,variant:c,offset:u,wrapper:f,events:p,positionStrategy:y,delayShow:m,delayHide:h})=>{const{attach:v,detach:g}=d()(t),w=e.useRef(null);return e.useEffect((()=>(v(w),()=>{g(w)})),[]),n.exports.jsx("span",{ref:w,className:a("react-tooltip-wrapper",o),"data-tooltip-place":i,"data-tooltip-content":l,"data-tooltip-html":s,"data-tooltip-variant":c,"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:r})};
|
|
15
|
+
*/te=ne,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(" ")}te.exports?(t.default=t,te.exports=t):window.classNames=t}();var re=ne.exports;const oe=(e,t,n)=>{let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,o)}),t)}},ie=({content:e})=>Q.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),le={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},ae={getTooltipData:()=>le},se=e.createContext(ae);function ce(t="DEFAULT_TOOLTIP_ID"){return e.useContext(se).getTooltipData(t)}const ue=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:a=10,strategy:c="absolute",middlewares:u=[x(Number(a)),b(),R({padding:5})]})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const f=u;return n?(f.push({name:"arrow",options:p={element:n,padding:5},async fn(e){const{element:t,padding:n=0}=null!=p?p:{},{x:r,y:a,placement:c,rects:u,platform:f}=e;if(null==t)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const m=s(n),y={x:r,y:a},h=i(c),g=o(c),v=l(h),w=await f.getDimensions(t),b="y"===h?"top":"left",x="y"===h?"bottom":"right",R=u.reference[v]+u.reference[h]-y[h]-u.floating[v],_=y[h]-u.reference[h],S=await(null==f.getOffsetParent?void 0:f.getOffsetParent(t));let T=S?"y"===h?S.clientHeight||0:S.clientWidth||0:0;0===T&&(T=u.floating[v]);const O=R/2-_/2,k=m[b],A=T-w[v]-m[x],j=T/2-w[v]/2+O,E=d(k,j,A),P=("start"===g?m[b]:m[x])>0&&j!==E&&u.reference[v]<=u.floating[v];return{[h]:y[h]-(P?j<k?k-j:A-j:0),data:{[h]:E,centerOffset:j-E}}}}),G(e,t,{placement:r,strategy:c,middleware:f}).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"}}}))):G(e,t,{placement:"bottom",strategy:c,middleware:f}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})));var p};var fe={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 pe=({id:t,className:n,classNameArrow:r,variant:o="dark",anchorId:i,place:l="top",offset:a=10,events:s=["hover"],positionStrategy:c="absolute",middlewares:u,wrapper:f="div",children:p=null,delayShow:d=0,delayHide:m=0,float:y=!1,noArrow:h=!1,clickable:g=!1,style:v,position:w,afterShow:b,afterHide:x,content:R,html:_,isOpen:S,setIsOpen:T})=>{const O=e.useRef(null),k=e.useRef(null),A=e.useRef(null),j=e.useRef(null),[E,P]=e.useState({}),[L,D]=e.useState({}),[N,C]=e.useState(!1),I=e.useRef(!1),[$,F]=e.useState(!1),W=e.useRef(null),{anchorRefs:H,setActiveAnchor:U}=ce(t),[B,V]=e.useState({current:null}),M=e.useRef(!1),z=e=>{T?T(e):void 0===S&&C(e)};e.useEffect((()=>{N!==I.current&&(I.current=N,N?null==b||b():null==x||x())}),[N]);const q=(e=m)=>{j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{M.current||z(!1)}),e)},Y=e=>{var t;if(!e)return;d?(A.current&&clearTimeout(A.current),A.current=setTimeout((()=>{z(!0)}),d)):z(!0);const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;V((e=>e.current===n?e:{current:n})),U({current:n}),j.current&&clearTimeout(j.current)},X=()=>{g?q(m||50):m?q():z(!1),A.current&&clearTimeout(A.current)},K=({x:e,y:t})=>{const n={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};F(!0),ue({place:l,offset:a,elementReference:n,tooltipReference:O.current,tooltipArrowReference:k.current,strategy:c,middlewares:u}).then((e=>{F(!1),Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&D(e.tooltipArrowStyles)}))},J=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};K(n),W.current=n},Z=e=>{Y(e),m&&q()},G=e=>{var t;(null===(t=B.current)||void 0===t?void 0:t.contains(e.target))||z(!1)},ee=oe(Y,50),te=oe(X,50);e.useEffect((()=>{var e,t;const n=new Set(H),r=document.querySelector(`[id='${i}']`);if(r&&(V((e=>e.current===r?e:{current:r})),n.add({current:r})),!n.size)return()=>null;const o=[];s.find((e=>"click"===e))&&(window.addEventListener("click",G),o.push({event:"click",listener:Z})),s.find((e=>"hover"===e))&&(o.push({event:"mouseenter",listener:ee},{event:"mouseleave",listener:te},{event:"focus",listener:ee},{event:"blur",listener:te}),y&&o.push({event:"mousemove",listener:J}));const l=()=>{M.current=!0},a=()=>{M.current=!1,X()};return g&&(null===(e=O.current)||void 0===e||e.addEventListener("mouseenter",l),null===(t=O.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",G),g&&(null===(e=O.current)||void 0===e||e.removeEventListener("mouseenter",l),null===(t=O.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)}))}))}}),[H,B,i,s,m,d]),e.useEffect((()=>{if(w)return K(w),()=>null;if(y)return W.current&&K(W.current),()=>null;let e=B.current;i&&(e=document.querySelector(`[id='${i}']`)),F(!0);let t=!0;return ue({place:l,offset:a,elementReference:e,tooltipReference:O.current,tooltipArrowReference:k.current,strategy:c,middlewares:u}).then((e=>{t&&(F(!1),Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&D(e.tooltipArrowStyles))})),()=>{t=!1}}),[N,S,i,B,R,_,l,a,c,w]),e.useEffect((()=>()=>{A.current&&clearTimeout(A.current),j.current&&clearTimeout(j.current)}),[]);const ne=Boolean(_||R||p);return Q.exports.jsxs(f,{id:t,role:"tooltip",className:re("react-tooltip",fe.tooltip,fe[o],n,{[fe.show]:ne&&!$&&(S||N),[fe.fixed]:"fixed"===c,[fe.clickable]:g}),style:{...v,...E},ref:O,children:[p||_&&Q.exports.jsx(ie,{content:_})||R,Q.exports.jsx("div",{className:re("react-tooltip-arrow",fe.arrow,r,{[fe["no-arrow"]]:h}),style:L,ref:k})]})};exports.Tooltip=({id:t,anchorId:n,content:r,html:o,className:i,classNameArrow:l,variant:a="dark",place:s="top",offset:c=10,wrapper:u="div",children:f=null,events:p=["hover"],positionStrategy:d="absolute",middlewares:m,delayShow:y=0,delayHide:h=0,float:g=!1,noArrow:v=!1,clickable:w=!1,style:b,position:x,isOpen:R,setIsOpen:_,afterShow:S,afterHide:T})=>{const[O,k]=e.useState(r),[A,j]=e.useState(o),[E,P]=e.useState(s),[L,D]=e.useState(a),[N,C]=e.useState(c),[I,$]=e.useState(y),[F,W]=e.useState(h),[H,U]=e.useState(g),[B,V]=e.useState(u),[M,z]=e.useState(p),[q,Y]=e.useState(d),{anchorRefs:X,activeAnchor:K}=ce(t),J=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}),{}),Z=e=>{const t={place:e=>{var t;P(null!==(t=e)&&void 0!==t?t:s)},content:e=>{k(null!=e?e:r)},html:e=>{j(null!=e?e:o)},variant:e=>{var t;D(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{C(null===e?c:Number(e))},wrapper:e=>{var t;V(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");z(null!=t?t:p)},"position-strategy":e=>{var t;Y(null!==(t=e)&&void 0!==t?t:d)},"delay-show":e=>{$(null===e?y:Number(e))},"delay-hide":e=>{W(null===e?h:Number(e))},float:e=>{U(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)}))};e.useEffect((()=>{k(r)}),[r]),e.useEffect((()=>{j(o)}),[o]),e.useEffect((()=>{var e;const t=new Set(X),r=document.querySelector(`[id='${n}']`);if(r&&t.add({current:r}),!t.size)return()=>null;const o=null!==(e=K.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=J(o);Z(n)}))})),l={attributes:!0,childList:!1,subtree:!1};if(o){const e=J(o);Z(e),i.observe(o,l)}return()=>{i.disconnect()}}),[X,K,n]);const G={id:t,anchorId:n,className:i,classNameArrow:l,content:O,html:A,place:E,variant:L,offset:N,wrapper:B,events:M,positionStrategy:q,middlewares:m,delayShow:I,delayHide:F,float:H,noArrow:v,clickable:w,style:b,position:x,isOpen:R,setIsOpen:_,afterShow:S,afterHide:T};return f?Q.exports.jsx(pe,{...G,children:f}):Q.exports.jsx(pe,{...G})},exports.TooltipProvider=({children:t})=>{const[n,r]=e.useState({DEFAULT_TOOLTIP_ID:new Set}),[o,i]=e.useState({DEFAULT_TOOLTIP_ID:{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)}}))},a=(e,...t)=>{r((n=>{const r=n[e];return r?(t.forEach((e=>r.delete(e))),{...n}):n}))},s=e.useCallback(((e="DEFAULT_TOOLTIP_ID")=>{var t,r;return{anchorRefs:null!==(t=n[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=o[e])&&void 0!==r?r:{current:null},attach:(...t)=>l(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{i((n=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.current)===t.current?n:{...n,[e]:t}}))})(e,t)}}),[n,o,l,a]),c=e.useMemo((()=>({getTooltipData:s})),[s]);return Q.exports.jsx(se.Provider,{value:c,children:t})},exports.TooltipWrapper=({tooltipId:t,children:n,className:r,place:o,content:i,html:l,variant:a,offset:s,wrapper:c,events:u,positionStrategy:f,delayShow:p,delayHide:d})=>{const{attach:m,detach:y}=ce(t),h=e.useRef(null);return e.useEffect((()=>(m(h),()=>{y(h)})),[]),Q.exports.jsx("span",{ref:h,className:re("react-tooltip-wrapper",r),"data-tooltip-place":o,"data-tooltip-content":i,"data-tooltip-html":l,"data-tooltip-variant":a,"data-tooltip-offset":s,"data-tooltip-wrapper":c,"data-tooltip-events":u,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":p,"data-tooltip-delay-hide":d,children:n})},exports.autoPlacement=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,i,l,a,s;const{x:c,y:f,rects:p,middlewareData:d,placement:m,platform:y,elements:g}=t,{alignment:b=null,allowedPlacements:x=w,autoAlignment:R=!0,..._}=e,S=function(e,t,n){return(e?[...n.filter((t=>o(t)===e)),...n.filter((t=>o(t)!==e))]:n.filter((e=>r(e)===e))).filter((n=>!e||o(n)===e||!!t&&v(n)!==n))}(b,R,x),T=await u(t,_),O=null!=(n=null==(i=d.autoPlacement)?void 0:i.index)?n:0,k=S[O];if(null==k)return{};const{main:A,cross:j}=h(k,p,await(null==y.isRTL?void 0:y.isRTL(g.floating)));if(m!==k)return{x:c,y:f,reset:{placement:S[0]}};const E=[T[r(k)],T[A],T[j]],P=[...null!=(l=null==(a=d.autoPlacement)?void 0:a.overflows)?l:[],{placement:k,overflows:E}],L=S[O+1];if(L)return{data:{index:O+1,overflows:P},reset:{placement:L}};const D=P.slice().sort(((e,t)=>e.overflows[0]-t.overflows[0])),N=null==(s=D.find((e=>{let{overflows:t}=e;return t.every((e=>e<=0))})))?void 0:s.placement,C=null!=N?N:D[0].placement;return C!==m?{data:{index:O+1,overflows:P},reset:{placement:C}}:{}}}},exports.flip=b,exports.inline=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){var n;const{placement:o,elements:l,rects:a,platform:u,strategy:d}=t,{padding:m=2,x:y,y:h}=e,g=c(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({rect:a.reference,offsetParent:await(null==u.getOffsetParent?void 0:u.getOffsetParent(l.floating)),strategy:d}):a.reference),v=null!=(n=await(null==u.getClientRects?void 0:u.getClientRects(l.reference)))?n:[],w=s(m);const b=await u.getElementRects({reference:{getBoundingClientRect:function(){var e;if(2===v.length&&v[0].left>v[1].right&&null!=y&&null!=h)return null!=(e=v.find((e=>y>e.left-w.left&&y<e.right+w.right&&h>e.top-w.top&&h<e.bottom+w.bottom)))?e:g;if(v.length>=2){if("x"===i(o)){const e=v[0],t=v[v.length-1],n="top"===r(o),i=e.top,l=t.bottom,a=n?e.left:t.left,s=n?e.right:t.right;return{top:i,bottom:l,left:a,right:s,width:s-a,height:l-i,x:a,y:i}}const e="left"===r(o),t=p(...v.map((e=>e.right))),n=f(...v.map((e=>e.left))),l=v.filter((r=>e?r.left===n:r.right===t)),a=l[0].top,s=l[l.length-1].bottom;return{top:a,bottom:s,left:n,right:t,width:t-n,height:s-a,x:n,y:a}}return g}},floating:l.floating,strategy:d});return a.reference.x!==b.reference.x||a.reference.y!==b.reference.y||a.reference.width!==b.reference.width||a.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},exports.offset=x,exports.shift=R,exports.size=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:l,elements:a}=t,{apply:s=(()=>{}),...c}=e,f=await u(t,c),d=r(n),m=o(n);let y,h;"top"===d||"bottom"===d?(y=d,h=m===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y="end"===m?"top":"bottom");const g=p(f.left,0),v=p(f.right,0),w=p(f.top,0),b=p(f.bottom,0),x={availableHeight:i.floating.height-(["left","right"].includes(n)?2*(0!==w||0!==b?w+b:p(f.top,f.bottom)):f[y]),availableWidth:i.floating.width-(["top","bottom"].includes(n)?2*(0!==g||0!==v?g+v:p(f.left,f.right)):f[h])};await s({...t,...x});const R=await l.getDimensions(a.floating);return i.floating.width!==R.width||i.floating.height!==R.height?{reset:{rects:!0}}:{}}}};
|
package/dist/react-tooltip.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ElementType, ReactNode, CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
export { autoPlacement, flip, inline, offset, shift, size } from '@floating-ui/dom';
|
|
2
3
|
|
|
3
4
|
type PlacesType = 'top' | 'right' | 'bottom' | 'left'
|
|
4
5
|
|
|
@@ -12,6 +13,8 @@ type EventsType = 'hover' | 'click'
|
|
|
12
13
|
|
|
13
14
|
type PositionStrategy = 'absolute' | 'fixed'
|
|
14
15
|
|
|
16
|
+
type Middleware = Middleware
|
|
17
|
+
|
|
15
18
|
type DataAttribute =
|
|
16
19
|
| 'place'
|
|
17
20
|
| 'content'
|
|
@@ -44,6 +47,7 @@ interface ITooltipController {
|
|
|
44
47
|
children?: ChildrenType
|
|
45
48
|
events?: EventsType[]
|
|
46
49
|
positionStrategy?: PositionStrategy
|
|
50
|
+
middlewares?: Middleware[]
|
|
47
51
|
delayShow?: number
|
|
48
52
|
delayHide?: number
|
|
49
53
|
float?: boolean
|
|
@@ -90,7 +94,7 @@ interface ITooltipWrapper {
|
|
|
90
94
|
delayHide?: ITooltipController['delayHide']
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
declare const TooltipController: ({ id, anchorId, content, html, className, classNameArrow, variant, place, offset, wrapper, children, events, positionStrategy, delayShow, delayHide, float, noArrow, clickable, style, position, isOpen, setIsOpen, afterShow, afterHide, }: ITooltipController) => JSX.Element;
|
|
97
|
+
declare const TooltipController: ({ id, anchorId, content, html, className, classNameArrow, variant, place, offset, wrapper, children, events, positionStrategy, middlewares, delayShow, delayHide, float, noArrow, clickable, style, position, isOpen, setIsOpen, afterShow, afterHide, }: ITooltipController) => JSX.Element;
|
|
94
98
|
|
|
95
99
|
declare const TooltipProvider: React.FC<PropsWithChildren>;
|
|
96
100
|
|