react-tooltip 5.2.0 → 5.3.1
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 -2
- package/dist/react-tooltip-tokens.css +1 -0
- package/dist/react-tooltip.cjs.js +109 -19
- package/dist/react-tooltip.cjs.min.js +2 -2
- package/dist/react-tooltip.css +6 -1
- package/dist/react-tooltip.d.ts +13 -3
- package/dist/react-tooltip.esm.js +109 -19
- package/dist/react-tooltip.esm.min.js +2 -2
- package/dist/react-tooltip.min.css +1 -1
- package/dist/react-tooltip.umd.js +109 -19
- package/dist/react-tooltip.umd.min.js +2 -2
- package/package.json +1 -1
|
@@ -2703,7 +2703,7 @@ const computeTooltipPosition = async ({ elementReference = null, tooltipReferenc
|
|
|
2703
2703
|
}
|
|
2704
2704
|
const middleware = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })];
|
|
2705
2705
|
if (tooltipArrowReference) {
|
|
2706
|
-
middleware.push(arrow({ element: tooltipArrowReference }));
|
|
2706
|
+
middleware.push(arrow({ element: tooltipArrowReference, padding: 5 }));
|
|
2707
2707
|
return computePosition(elementReference, tooltipReference, {
|
|
2708
2708
|
placement: place,
|
|
2709
2709
|
strategy,
|
|
@@ -2738,11 +2738,11 @@ const computeTooltipPosition = async ({ elementReference = null, tooltipReferenc
|
|
|
2738
2738
|
});
|
|
2739
2739
|
};
|
|
2740
2740
|
|
|
2741
|
-
var styles = {"tooltip":"styles-module_tooltip__mnnfp","fixed":"styles-module_fixed__7ciUi","arrow":"styles-module_arrow__K0L3T","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"};
|
|
2741
|
+
var styles = {"tooltip":"styles-module_tooltip__mnnfp","fixed":"styles-module_fixed__7ciUi","arrow":"styles-module_arrow__K0L3T","no-arrow":"styles-module_no-arrow__KcFZN","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"};
|
|
2742
2742
|
|
|
2743
2743
|
const Tooltip = ({
|
|
2744
2744
|
// props
|
|
2745
|
-
id, className, classNameArrow, variant = 'dark', anchorId, place = 'top', offset = 10, events = ['hover'], positionStrategy = 'absolute', wrapper: WrapperElement = 'div', children = null, delayShow = 0, delayHide = 0, style: externalStyles,
|
|
2745
|
+
id, className, classNameArrow, variant = 'dark', anchorId, place = 'top', offset = 10, events = ['hover'], positionStrategy = 'absolute', wrapper: WrapperElement = 'div', children = null, delayShow = 0, delayHide = 0, float = false, noArrow, style: externalStyles, position,
|
|
2746
2746
|
// props handled by controller
|
|
2747
2747
|
isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
2748
2748
|
const tooltipRef = useRef(null);
|
|
@@ -2753,6 +2753,7 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2753
2753
|
const [inlineArrowStyles, setInlineArrowStyles] = useState({});
|
|
2754
2754
|
const [show, setShow] = useState(false);
|
|
2755
2755
|
const [calculatingPosition, setCalculatingPosition] = useState(false);
|
|
2756
|
+
const lastFloatPosition = useRef(null);
|
|
2756
2757
|
const { anchorRefs, setActiveAnchor: setProviderActiveAnchor } = useTooltip()(id);
|
|
2757
2758
|
const [activeAnchor, setActiveAnchor] = useState({ current: null });
|
|
2758
2759
|
const handleShow = (value) => {
|
|
@@ -2806,13 +2807,67 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2806
2807
|
clearTimeout(tooltipShowDelayTimerRef.current);
|
|
2807
2808
|
}
|
|
2808
2809
|
};
|
|
2810
|
+
const handleTooltipPosition = ({ x, y }) => {
|
|
2811
|
+
const virtualElement = {
|
|
2812
|
+
getBoundingClientRect() {
|
|
2813
|
+
return {
|
|
2814
|
+
x,
|
|
2815
|
+
y,
|
|
2816
|
+
width: 0,
|
|
2817
|
+
height: 0,
|
|
2818
|
+
top: y,
|
|
2819
|
+
left: x,
|
|
2820
|
+
right: x,
|
|
2821
|
+
bottom: y,
|
|
2822
|
+
};
|
|
2823
|
+
},
|
|
2824
|
+
};
|
|
2825
|
+
setCalculatingPosition(true);
|
|
2826
|
+
computeTooltipPosition({
|
|
2827
|
+
place,
|
|
2828
|
+
offset,
|
|
2829
|
+
elementReference: virtualElement,
|
|
2830
|
+
tooltipReference: tooltipRef.current,
|
|
2831
|
+
tooltipArrowReference: tooltipArrowRef.current,
|
|
2832
|
+
strategy: positionStrategy,
|
|
2833
|
+
}).then((computedStylesData) => {
|
|
2834
|
+
setCalculatingPosition(false);
|
|
2835
|
+
if (Object.keys(computedStylesData.tooltipStyles).length) {
|
|
2836
|
+
setInlineStyles(computedStylesData.tooltipStyles);
|
|
2837
|
+
}
|
|
2838
|
+
if (Object.keys(computedStylesData.tooltipArrowStyles).length) {
|
|
2839
|
+
setInlineArrowStyles(computedStylesData.tooltipArrowStyles);
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
};
|
|
2843
|
+
const handleMouseMove = (event) => {
|
|
2844
|
+
if (!event) {
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
const mouseEvent = event;
|
|
2848
|
+
const mousePosition = {
|
|
2849
|
+
x: mouseEvent.clientX,
|
|
2850
|
+
y: mouseEvent.clientY,
|
|
2851
|
+
};
|
|
2852
|
+
handleTooltipPosition(mousePosition);
|
|
2853
|
+
lastFloatPosition.current = mousePosition;
|
|
2854
|
+
};
|
|
2809
2855
|
const handleClickTooltipAnchor = () => {
|
|
2810
2856
|
if (setIsOpen) {
|
|
2811
2857
|
setIsOpen(!isOpen);
|
|
2812
2858
|
}
|
|
2813
|
-
else if (isOpen === undefined) {
|
|
2814
|
-
setShow(
|
|
2859
|
+
else if (!setIsOpen && isOpen === undefined) {
|
|
2860
|
+
setShow(true);
|
|
2861
|
+
if (delayHide) {
|
|
2862
|
+
handleHideTooltipDelayed();
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
const handleClickOutsideAnchor = (event) => {
|
|
2867
|
+
if (event.target === activeAnchor.current) {
|
|
2868
|
+
return;
|
|
2815
2869
|
}
|
|
2870
|
+
setShow(false);
|
|
2816
2871
|
};
|
|
2817
2872
|
// debounce handler to prevent call twice when
|
|
2818
2873
|
// mouse enter and focus events being triggered toggether
|
|
@@ -2826,15 +2881,21 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2826
2881
|
elementRefs.add({ current: anchorById });
|
|
2827
2882
|
}
|
|
2828
2883
|
if (!elementRefs.size) {
|
|
2829
|
-
|
|
2830
|
-
return () => { };
|
|
2884
|
+
return () => null;
|
|
2831
2885
|
}
|
|
2832
2886
|
const enabledEvents = [];
|
|
2833
2887
|
if (events.find((event) => event === 'click')) {
|
|
2888
|
+
window.addEventListener('click', handleClickOutsideAnchor);
|
|
2834
2889
|
enabledEvents.push({ event: 'click', listener: handleClickTooltipAnchor });
|
|
2835
2890
|
}
|
|
2836
2891
|
if (events.find((event) => event === 'hover')) {
|
|
2837
2892
|
enabledEvents.push({ event: 'mouseenter', listener: debouncedHandleShowTooltip }, { event: 'mouseleave', listener: debouncedHandleHideTooltip }, { event: 'focus', listener: debouncedHandleShowTooltip }, { event: 'blur', listener: debouncedHandleHideTooltip });
|
|
2893
|
+
if (float) {
|
|
2894
|
+
enabledEvents.push({
|
|
2895
|
+
event: 'mousemove',
|
|
2896
|
+
listener: handleMouseMove,
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2838
2899
|
}
|
|
2839
2900
|
enabledEvents.forEach(({ event, listener }) => {
|
|
2840
2901
|
elementRefs.forEach((ref) => {
|
|
@@ -2843,6 +2904,7 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2843
2904
|
});
|
|
2844
2905
|
});
|
|
2845
2906
|
return () => {
|
|
2907
|
+
window.removeEventListener('click', handleClickOutsideAnchor);
|
|
2846
2908
|
enabledEvents.forEach(({ event, listener }) => {
|
|
2847
2909
|
elementRefs.forEach((ref) => {
|
|
2848
2910
|
var _a;
|
|
@@ -2850,8 +2912,27 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2850
2912
|
});
|
|
2851
2913
|
});
|
|
2852
2914
|
};
|
|
2853
|
-
}, [anchorRefs, anchorId, events, delayHide, delayShow]);
|
|
2915
|
+
}, [anchorRefs, activeAnchor, anchorId, events, delayHide, delayShow]);
|
|
2854
2916
|
useEffect(() => {
|
|
2917
|
+
if (position) {
|
|
2918
|
+
// if `position` is set, override regular and `float` positioning
|
|
2919
|
+
handleTooltipPosition(position);
|
|
2920
|
+
return () => null;
|
|
2921
|
+
}
|
|
2922
|
+
if (float) {
|
|
2923
|
+
if (lastFloatPosition.current) {
|
|
2924
|
+
/*
|
|
2925
|
+
Without this, changes to `content`, `place`, `offset`, ..., will only
|
|
2926
|
+
trigger a position calculation after a `mousemove` event.
|
|
2927
|
+
|
|
2928
|
+
To see why this matters, comment this line, run `yarn dev` and click the
|
|
2929
|
+
"Hover me!" anchor.
|
|
2930
|
+
*/
|
|
2931
|
+
handleTooltipPosition(lastFloatPosition.current);
|
|
2932
|
+
}
|
|
2933
|
+
// if `float` is set, override regular positioning
|
|
2934
|
+
return () => null;
|
|
2935
|
+
}
|
|
2855
2936
|
let elementReference = activeAnchor.current;
|
|
2856
2937
|
if (anchorId) {
|
|
2857
2938
|
// `anchorId` element takes precedence
|
|
@@ -2882,7 +2963,7 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2882
2963
|
return () => {
|
|
2883
2964
|
mounted = false;
|
|
2884
2965
|
};
|
|
2885
|
-
}, [show, isOpen, anchorId, activeAnchor, content, place, offset, positionStrategy]);
|
|
2966
|
+
}, [show, isOpen, anchorId, activeAnchor, content, place, offset, positionStrategy, position]);
|
|
2886
2967
|
useEffect(() => {
|
|
2887
2968
|
return () => {
|
|
2888
2969
|
if (tooltipShowDelayTimerRef.current) {
|
|
@@ -2893,19 +2974,23 @@ isHtmlContent = false, content, isOpen, setIsOpen, }) => {
|
|
|
2893
2974
|
}
|
|
2894
2975
|
};
|
|
2895
2976
|
}, []);
|
|
2977
|
+
const hasContentOrChildren = Boolean(content || children);
|
|
2896
2978
|
return (jsxRuntime.exports.jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames(styles['tooltip'], styles[variant], className, {
|
|
2897
|
-
[styles['show']]: !calculatingPosition && (isOpen || show),
|
|
2979
|
+
[styles['show']]: hasContentOrChildren && !calculatingPosition && (isOpen || show),
|
|
2898
2980
|
[styles['fixed']]: positionStrategy === 'fixed',
|
|
2899
|
-
}), style: { ...externalStyles, ...inlineStyles }, ref: tooltipRef, children: [children || (isHtmlContent ? jsxRuntime.exports.jsx(TooltipContent, { content: content }) : content), jsxRuntime.exports.jsx("div", { className: classNames(styles['arrow'], classNameArrow
|
|
2981
|
+
}), style: { ...externalStyles, ...inlineStyles }, ref: tooltipRef, children: [children || (isHtmlContent ? jsxRuntime.exports.jsx(TooltipContent, { content: content }) : content), jsxRuntime.exports.jsx("div", { className: classNames(styles['arrow'], classNameArrow, {
|
|
2982
|
+
[styles['no-arrow']]: noArrow,
|
|
2983
|
+
}), style: inlineArrowStyles, ref: tooltipArrowRef })] }));
|
|
2900
2984
|
};
|
|
2901
2985
|
|
|
2902
|
-
const TooltipController = ({ id, anchorId, content, html, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], positionStrategy = 'absolute', delayShow = 0, delayHide = 0, style, isOpen, setIsOpen, }) => {
|
|
2986
|
+
const TooltipController = ({ id, anchorId, content, html, className, classNameArrow, variant = 'dark', place = 'top', offset = 10, wrapper = 'div', children = null, events = ['hover'], positionStrategy = 'absolute', delayShow = 0, delayHide = 0, float = false, noArrow, style, position, isOpen, setIsOpen, }) => {
|
|
2903
2987
|
const [tooltipContent, setTooltipContent] = useState(content || html);
|
|
2904
2988
|
const [tooltipPlace, setTooltipPlace] = useState(place);
|
|
2905
2989
|
const [tooltipVariant, setTooltipVariant] = useState(variant);
|
|
2906
2990
|
const [tooltipOffset, setTooltipOffset] = useState(offset);
|
|
2907
2991
|
const [tooltipDelayShow, setTooltipDelayShow] = useState(delayShow);
|
|
2908
2992
|
const [tooltipDelayHide, setTooltipDelayHide] = useState(delayHide);
|
|
2993
|
+
const [tooltipFloat, setTooltipFloat] = useState(float);
|
|
2909
2994
|
const [tooltipWrapper, setTooltipWrapper] = useState(wrapper);
|
|
2910
2995
|
const [tooltipEvents, setTooltipEvents] = useState(events);
|
|
2911
2996
|
const [tooltipPositionStrategy, setTooltipPositionStrategy] = useState(positionStrategy);
|
|
@@ -2929,12 +3014,11 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2929
3014
|
setTooltipPlace((_a = value) !== null && _a !== void 0 ? _a : place);
|
|
2930
3015
|
},
|
|
2931
3016
|
content: (value) => {
|
|
2932
|
-
setIsHtmlContent(false);
|
|
2933
3017
|
setTooltipContent(value !== null && value !== void 0 ? value : content);
|
|
2934
3018
|
},
|
|
2935
3019
|
html: (value) => {
|
|
2936
3020
|
var _a;
|
|
2937
|
-
setIsHtmlContent(
|
|
3021
|
+
setIsHtmlContent(Boolean(value !== null && value !== void 0 ? value : html));
|
|
2938
3022
|
setTooltipContent((_a = value !== null && value !== void 0 ? value : html) !== null && _a !== void 0 ? _a : content);
|
|
2939
3023
|
},
|
|
2940
3024
|
variant: (value) => {
|
|
@@ -2962,6 +3046,9 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2962
3046
|
'delay-hide': (value) => {
|
|
2963
3047
|
setTooltipDelayHide(value === null ? delayHide : Number(value));
|
|
2964
3048
|
},
|
|
3049
|
+
float: (value) => {
|
|
3050
|
+
setTooltipFloat(value === null ? float : Boolean(value));
|
|
3051
|
+
},
|
|
2965
3052
|
};
|
|
2966
3053
|
// reset unset data attributes to default values
|
|
2967
3054
|
// without this, data attributes from the last active anchor will still be used
|
|
@@ -2972,10 +3059,11 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2972
3059
|
});
|
|
2973
3060
|
};
|
|
2974
3061
|
useEffect(() => {
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
}
|
|
3062
|
+
setIsHtmlContent(false);
|
|
3063
|
+
setTooltipContent(content);
|
|
2978
3064
|
if (html) {
|
|
3065
|
+
// html will take precedence
|
|
3066
|
+
setIsHtmlContent(true);
|
|
2979
3067
|
setTooltipContent(html);
|
|
2980
3068
|
}
|
|
2981
3069
|
}, [content, html]);
|
|
@@ -2987,8 +3075,7 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
2987
3075
|
elementRefs.add({ current: anchorById });
|
|
2988
3076
|
}
|
|
2989
3077
|
if (!elementRefs.size) {
|
|
2990
|
-
|
|
2991
|
-
return () => { };
|
|
3078
|
+
return () => null;
|
|
2992
3079
|
}
|
|
2993
3080
|
const observerCallback = (mutationList) => {
|
|
2994
3081
|
mutationList.forEach((mutation) => {
|
|
@@ -3035,7 +3122,10 @@ const TooltipController = ({ id, anchorId, content, html, className, classNameAr
|
|
|
3035
3122
|
positionStrategy: tooltipPositionStrategy,
|
|
3036
3123
|
delayShow: tooltipDelayShow,
|
|
3037
3124
|
delayHide: tooltipDelayHide,
|
|
3125
|
+
float: tooltipFloat,
|
|
3126
|
+
noArrow,
|
|
3038
3127
|
style,
|
|
3128
|
+
position,
|
|
3039
3129
|
isOpen,
|
|
3040
3130
|
setIsOpen,
|
|
3041
3131
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e,{createContext as t,useId as n,useState as r,useCallback as o,useMemo as i,useContext as a,useRef as l,useEffect as s}from"react";var c={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"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=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 g=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];b("error",e,n)}function b(e,t,n){var r=g.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 w;function x(e){return e.displayName||"Context"}function S(e){if(null==e)return null;if("number"==typeof e.tag&&v("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 a:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return x(e)+".Consumer";case l:return x(e._context)+".Provider";case c: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}w=Symbol.for("react.module.reference");var _,R,k,T,j,O,E,A=Object.assign,P=0;function N(){}N.__reactDisabledLog=!0;var L,C=g.ReactCurrentDispatcher;function $(e,t,n){if(void 0===L)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+e}var D,W=!1,F="function"==typeof WeakMap?WeakMap:Map;function I(e,t){if(!e||W)return"";var n,r=D.get(e);if(void 0!==r)return r;W=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=C.current,C.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:N,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}P++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var l=t.stack.split("\n"),s=n.stack.split("\n"),c=l.length-1,u=s.length-1;c>=1&&u>=0&&l[c]!==s[u];)u--;for(;c>=1&&u>=0;c--,u--)if(l[c]!==s[u]){if(1!==c||1!==u)do{if(c--,--u<0||l[c]!==s[u]){var f="\n"+l[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:_}),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&&v("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,n){if(null==e)return"";if("function"==typeof e)return I(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return $(e);switch(e){case f:return $("Suspense");case p:return $("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return I(e.render,!1);case d:return H(e.type,t,n);case y:var o=e,i=o._payload,a=o._init;try{return H(a(i),t,n)}catch(e){}}return""}D=new F;var U=Object.prototype.hasOwnProperty,M={},B=g.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);B.setExtraStackFrame(n)}else B.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 v("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 J,K,Z,G=g.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0};Z={};function ee(e,t,r,o,i){var a,l={},s=null,c=null;for(a in void 0!==r&&(X(r),s=""+r),function(e){if(U.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),s=""+t.key),function(e){if(U.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&&G.current&&t&&G.current.stateNode!==t){var n=S(G.current.type);Z[n]||(v('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)U.call(t,a)&&!Q.hasOwnProperty(a)&&(l[a]=t[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)void 0===l[a]&&(l[a]=u[a])}if(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){J||(J=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,f),c&&function(e,t){var n=function(){K||(K=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,f)}return function(e,t,r,o,i,a,l){var s={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,c,i,o,G.current,l)}var te,ne=g.ReactCurrentOwner,re=g.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 ae(){if(ne.current){var e=S(ne.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}te=!1;var le={};function se(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=ae();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(!le[n]){le[n]=!0;var r="";e&&e._owner&&e._owner!==ne.current&&(r=" It was passed a child from "+S(e._owner.type)+"."),oe(e),v('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 ce(e,t){if("object"==typeof e)if(Y(e))for(var n=0;n<e.length;n++){var r=e[n];ie(r)&&se(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,a=o.call(e);!(i=a.next()).done;)ie(i.value)&&se(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!==c&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=S(n);!function(e,t,n,r,o){var i=Function.call.bind(U);for(var a in e)if(i(e,a)){var l=void 0;try{if("function"!=typeof e[a]){var s=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}l=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(V(o),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,typeof l),V(null)),l instanceof Error&&!(l.message in M)&&(M[l.message]=!0,V(o),v("Failed %s type: %s",n,l.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!te){te=!0,v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fe(e,t,r,u,h,g){var b=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===i||e===f||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===w||void 0!==e.getModuleId)}(e);if(!b){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||ae(),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,v("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,g);if(null==k)return k;if(b){var T=t.children;if(void 0!==T)if(u)if(Y(T)){for(var j=0;j<T.length;j++)ce(T[j],e);Object.freeze&&Object.freeze(T)}else v("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===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),v("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),v("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}(),c.exports=u;var f,p={exports:{}};
|
|
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 s}from"react";var c={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"),s=Symbol.for("react.context"),c=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 g=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(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=g.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&&v("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 s:return x(e)+".Consumer";case a:return x(e._context)+".Provider";case c: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 N(){}N.__reactDisabledLog=!0;var L,C=g.ReactCurrentDispatcher;function $(e,t,n){if(void 0===L)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||""}return"\n"+L+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=C.current,C.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:N,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"),s=n.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{F=!1,C.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&&v("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,n){if(null==e)return"";if("function"==typeof e)return I(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return $(e);switch(e){case f:return $("Suspense");case p:return $("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c: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=g.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 v("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=g.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0};Z={};function ee(e,t,r,o,i){var l,a={},s=null,c=null;for(l in void 0!==r&&(X(r),s=""+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),s=""+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)&&(c=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]||(v('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(s||c){var f="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){K||(K=!0,v("%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(){J||(J=!0,v("%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,G.current,a)}var te,ne=g.ReactCurrentOwner,re=g.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 se(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),v('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 ce(e,t){if("object"==typeof e)if(Y(e))for(var n=0;n<e.length;n++){var r=e[n];ie(r)&&se(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)&&se(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!==c&&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 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||(V(o),v("%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),v("Failed %s type: %s",n,a.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!te){te=!0,v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fe(e,t,r,u,h,g){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===s||e.$$typeof===c||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,v("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,g);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++)ce(T[j],e);Object.freeze&&Object.freeze(T)}else v("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===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),v("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),v("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}(),c.exports=u;var f,p={exports:{}};
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
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 a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}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:()=>{}},g=t(Object.assign((()=>h),h)),v=({children:e})=>{const t=n(),[a,l]=r({[t]:new Set}),[s,u]=r({[t]:{current:null}}),f=(e,...t)=>{l((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)=>{l((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=a[null!=e?e:t])&&void 0!==n?n:new Set,activeAnchor:null!==(r=s[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,a,s,f,p]),y=i((()=>{const e=d(t);return Object.assign((e=>d(e)),e)}),[d]);return c.exports.jsx(g.Provider,{value:y,children:e})};function b(){return a(g)}const w=({tooltipId:e,children:t,place:n,content:r,html:o,variant:i,offset:a,wrapper:u,events:f,positionStrategy:p,delayShow:d,delayHide:y})=>{const{attach:m,detach:h}=b()(e),g=l(null);return s((()=>(m(g),()=>{h(g)})),[]),c.exports.jsx("span",{ref:g,"data-tooltip-place":n,"data-tooltip-content":r,"data-tooltip-html":o,"data-tooltip-variant":i,"data-tooltip-offset":a,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":y,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,a=r.y+r.height/2-o.height/2,l=_(t),s=R(l),c=r[s]/2-o[s]/2,u="x"===l;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:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(S(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(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:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=T(d),m=l[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(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=j(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const E=Math.min,A=Math.max;function P(e,t,n){return A(e,E(t,n))}const N={left:"right",right:"left",bottom:"top",top:"bottom"};function L(e){return e.replace(/left|right|bottom|top/g,(e=>N[e]))}const C={start:"end",end:"start"};function $(e){return e.replace(/start|end/g,(e=>C[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:a,platform:l,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===a||!d?[L(a)]:function(e){const t=L(e);return[$(e),t,$(t)]}(a)),g=[a,...h],v=await O(t,y),b=[];let w=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(v[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 a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=L(a)),{main:a,cross:L(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));b.push(v[e],v[t])}if(w=[...w,{placement:r,overflows:b}],!b.every((e=>e<=0))){var k,T;const e=(null!=(k=null==(T=o.flip)?void 0:T.index)?k:0)+1,t=g[e];if(t)return{data:{index:e,overflows:w},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var j;const e=null==(j=w.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=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const W=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=x(n),l=S(n),s="x"===_(n),c=["left","top"].includes(a)?-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 l&&"number"==typeof y&&(d="end"===l?-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 F(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function I(e){if(null==e)return window;if(!F(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return I(e).getComputedStyle(e)}function U(e){return F(e)?"":e?(e.nodeName||"").toLowerCase():""}function M(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function B(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(U(e))}function X(e){const t=/firefox/i.test(M()),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 J(){return!/^((?!chrome|android).)*safari/i.test(M())}function K(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,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&B(e)&&(s=e.offsetWidth>0&&Q(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&Q(l.height)/e.offsetHeight||1);const u=V(e)?I(e):window,f=!J()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.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 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=B(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 a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==U(t)||Y(o))&&(a=ne(t)),B(t)){const e=ee(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=re(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.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 ae(e){return B(e)&&"fixed"!==H(e).position?e.offsetParent:null}function le(e){const t=I(e);let n=ae(e);for(;n&&q(n)&&"static"===H(n).position;)n=ae(n);return n&&("html"===U(n)||"body"===U(n)&&"static"===H(n).position&&!X(n))?t:n||function(e){let t=ie(e);for(;B(t)&&!K(t);){if(X(t))return t;t=ie(t)}return null}(e)||t}function se(e){if(B(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 K(t)?e.ownerDocument.body:B(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=I(r),a=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(ue(a))}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,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=J();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):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),a=G(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+re(e);const s=-r.scrollTop;return"rtl"===H(o||n).direction&&(l+=G(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,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=>V(e)&&"body"!==U(e))),n=e,r=null;for(;V(n)&&!K(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),a=[...i,r],l=a[0],s=a.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,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=B(n),i=te(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==U(n)||Y(i))&&(a=ne(n)),B(n))){const e=ee(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:V,getDimensions:se,getOffsetParent:le,getDocumentElement:te,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:oe(t,le(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:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=k(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:g,data:v,reset:b}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=g?g:f,d={...d,[i]:{...d[i],...v}},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 a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:f}=k(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 a=[W(Number(o)),D(),(l={padding:5},void 0===l&&(l={}),{name:"shift",options:l,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=l,c={x:t,y:n},u=await O(e,s),f=_(x(r)),p="x"===f?"y":"x";let d=c[f],y=c[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=a.fn({...e,[f]:d,[p]:y});return{...m,data:{x:m.x-t,y:m.y-n}}}})];var l;return n?(a.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=T(r),u={x:o,y:i},f=_(a),p=S(a),d=R(f),y=await s.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",g=l.reference[d]+l.reference[f]-u[f]-l.floating[d],v=u[f]-l.reference[f],b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let w=b?"y"===f?b.clientHeight||0:b.clientWidth||0:0;0===w&&(w=l.floating[d]);const x=g/2-v/2,k=c[m],j=w-y[d]-c[h],O=w/2-y[d]/2+x,E=P(k,O,j),A=("start"===p?c[m]:c[h])>0&&O!==E&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(A?O<k?k-O:j-O:0),data:{[f]:E,centerOffset:O-E}}}}))({element:n})),de(e,t,{placement:r,strategy:i,middleware:a}).then((({x:e,y:t,placement:n,middlewareData:r})=>{var o,i;const a={left:`${e}px`,top:`${t}px`},{x:l,y:s}=null!==(o=r.arrow)&&void 0!==o?o:{x:0,y:0};return{tooltipStyles:a,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom"]:"-4px"}}}))):de(e,t,{placement:"bottom",strategy:i,middleware:a}).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",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:a="top",offset:u=10,events:f=["hover"],positionStrategy:p="absolute",wrapper:h="div",children:g=null,delayShow:v=0,delayHide:w=0,style:x,isHtmlContent:S=!1,content:_,isOpen:R,setIsOpen:k})=>{const T=l(null),j=l(null),O=l(null),E=l(null),[A,P]=r({}),[N,L]=r({}),[C,$]=r(!1),[D,W]=r(!1),{anchorRefs:F,setActiveAnchor:I}=b()(e),[H,U]=r({current:null}),M=e=>{k?k(e):void 0===R&&$(e)},B=()=>{k?k(!R):void 0===R&&$((e=>!e))},V=y((e=>{e&&(v?(O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{M(!0)}),v)):M(!0),U((t=>t.current===e.target?t:{current:e.target})),I({current:e.target}),E.current&&clearTimeout(E.current))}),50),z=y((()=>{w?(E.current&&clearTimeout(E.current),E.current=setTimeout((()=>{M(!1)}),w)):M(!1),O.current&&clearTimeout(O.current)}),50);return s((()=>{const e=new Set(F),t=document.querySelector(`[id='${i}']`);if(t&&(U((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>{};const n=[];return f.find((e=>"click"===e))&&n.push({event:"click",listener:B}),f.find((e=>"hover"===e))&&n.push({event:"mouseenter",listener:V},{event:"mouseleave",listener:z},{event:"focus",listener:V},{event:"blur",listener:z}),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[F,i,f,w,v]),s((()=>{let e=H.current;i&&(e=document.querySelector(`[id='${i}']`)),W(!0);let t=!0;return ye({place:a,offset:u,elementReference:e,tooltipReference:T.current,tooltipArrowReference:j.current,strategy:p}).then((e=>{t&&(W(!1),Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&L(e.tooltipArrowStyles))})),()=>{t=!1}}),[C,R,i,H,_,a,u,p]),s((()=>()=>{O.current&&clearTimeout(O.current),E.current&&clearTimeout(E.current)}),[]),c.exports.jsxs(h,{id:e,role:"tooltip",className:d(me.tooltip,me[o],t,{[me.show]:!D&&(R||C),[me.fixed]:"fixed"===p}),style:{...x,...A},ref:T,children:[g||(S?c.exports.jsx(m,{content:_}):_),c.exports.jsx("div",{className:d(me.arrow,n),style:N,ref:j})]})},ge=({id:e,anchorId:t,content:n,html:o,className:i,classNameArrow:a,variant:l="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],positionStrategy:m="absolute",delayShow:h=0,delayHide:g=0,style:v,isOpen:w,setIsOpen:x})=>{const[S,_]=r(n||o),[R,k]=r(u),[T,j]=r(l),[O,E]=r(f),[A,P]=r(h),[N,L]=r(g),[C,$]=r(p),[D,W]=r(y),[F,I]=r(m),[H,U]=r(Boolean(o)),{anchorRefs:M,activeAnchor:B}=b()(e),V=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;k(null!==(t=e)&&void 0!==t?t:u)},content:e=>{U(!1),_(null!=e?e:n)},html:e=>{var t;U(!!e),_(null!==(t=null!=e?e:o)&&void 0!==t?t:n)},variant:e=>{var t;j(null!==(t=e)&&void 0!==t?t:l)},offset:e=>{E(null===e?f:Number(e))},wrapper:e=>{var t;$(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");W(null!=t?t:y)},"position-strategy":e=>{var t;I(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{P(null===e?h:Number(e))},"delay-hide":e=>{L(null===e?g:Number(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)}))};s((()=>{n&&_(n),o&&_(o)}),[n,o]),s((()=>{var e;const n=new Set(M),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>{};const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!B.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=V(B.current);z(n)}))})),i={attributes:!0,childList:!1,subtree:!1},a=null!==(e=B.current)&&void 0!==e?e:r;if(a){const e=V(a);z(e),o.observe(a,i)}return()=>{o.disconnect()}}),[M,B,t]);const Y={id:e,anchorId:t,className:i,classNameArrow:a,content:S,isHtmlContent:H,place:R,variant:T,offset:O,wrapper:C,events:D,positionStrategy:F,delayShow:A,delayHide:N,style:v,isOpen:w,setIsOpen:x};return d?c.exports.jsx(he,{...Y,children:d}):c.exports.jsx(he,{...Y})};export{ge as Tooltip,v as TooltipProvider,w as TooltipWrapper};
|
|
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})=>c.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}}),h={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},g=t(Object.assign((()=>h),h)),v=({children:e})=>{const t=n(),[l,a]=r({[t]:new Set}),[s,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=s[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,s,f,p]),y=i((()=>{const e=d(t);return Object.assign((e=>d(e)),e)}),[d]);return c.exports.jsx(g.Provider,{value:y,children:e})};function w(){return l(g)}const b=({tooltipId:e,children:t,place:n,content:r,html:o,variant:i,offset:l,wrapper:u,events:f,positionStrategy:p,delayShow:d,delayHide:y})=>{const{attach:m,detach:h}=w()(e),g=a(null);return s((()=>(m(g),()=>{h(g)})),[]),c.exports.jsx("span",{ref:g,"data-tooltip-place":n,"data-tooltip-content":r,"data-tooltip-html":o,"data-tooltip-variant":i,"data-tooltip-offset":l,"data-tooltip-wrapper":u,"data-tooltip-events":f,"data-tooltip-position-strategy":p,"data-tooltip-delay-show":d,"data-tooltip-delay-hide":y,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),s=R(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(S(t)){case"start":f[a]-=c*(n&&u?-1:1);break;case"end":f[a]+=c*(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:s}=e,{boundary:c="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:c,rootBoundary:u,strategy:s})),g=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:s}):l[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const E=Math.min,A=Math.max;function P(e,t,n){return A(e,E(t,n))}const N={left:"right",right:"left",bottom:"top",top:"bottom"};function L(e){return e.replace(/left|right|bottom|top/g,(e=>N[e]))}const C={start:"end",end:"start"};function $(e){return e.replace(/start|end/g,(e=>C[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: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?[L(l)]:function(e){const t=L(e);return[$(e),t,$(t)]}(l)),g=[l,...h],v=await O(t,y),w=[];let b=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&w.push(v[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=L(l)),{main:l,cross:L(l)}}(r,i,await(null==a.isRTL?void 0:a.isRTL(s.floating)));w.push(v[e],v[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=g[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),s="x"===_(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 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 s=1,c=1;t&&M(e)&&(s=e.offsetWidth>0&&Q(a.width)/e.offsetWidth||1,c=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))/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 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 se(e){if(M(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:M(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=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,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)):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 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=>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],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=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: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}=k(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:g,data:v,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!=g?g:f,d={...d,[i]:{...d[i],...v}},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}=k(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)),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}}},...s}=a,c={x:t,y:n},u=await O(e,s),f=_(x(r)),p="x"===f?"y":"x";let d=c[f],y=c[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:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=T(r),u={x:o,y:i},f=_(l),p=S(l),d=R(f),y=await s.getDimensions(n),m="y"===f?"top":"left",h="y"===f?"bottom":"right",g=a.reference[d]+a.reference[f]-u[f]-a.floating[d],v=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=g/2-v/2,k=c[m],j=b-y[d]-c[h],O=b/2-y[d]/2+x,E=P(k,O,j),A=("start"===p?c[m]:c[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: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",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:g=null,delayShow:v=0,delayHide:b=0,float:x=!1,noArrow:S,style:_,position:R,isHtmlContent:k=!1,content:T,isOpen:j,setIsOpen:O})=>{const E=a(null),A=a(null),P=a(null),N=a(null),[L,C]=r({}),[$,D]=r({}),[F,W]=r(!1),[I,H]=r(!1),B=a(null),{anchorRefs:U,setActiveAnchor:M}=w()(e),[V,z]=r({current:null}),Y=e=>{O?O(e):void 0===j&&W(e)},q=()=>{N.current&&clearTimeout(N.current),N.current=setTimeout((()=>{Y(!1)}),b)},X=({x:e,y:t})=>{const n={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};H(!0),ye({place:l,offset:u,elementReference:n,tooltipReference:E.current,tooltipArrowReference:A.current,strategy:p}).then((e=>{H(!1),Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&D(e.tooltipArrowStyles)}))},K=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};X(n),B.current=n},J=()=>{O?O(!j):O||void 0!==j||(W(!0),b&&q())},Z=e=>{e.target!==V.current&&W(!1)},G=y((e=>{e&&(v?(P.current&&clearTimeout(P.current),P.current=setTimeout((()=>{Y(!0)}),v)):Y(!0),z((t=>t.current===e.target?t:{current:e.target})),M({current:e.target}),N.current&&clearTimeout(N.current))}),50),Q=y((()=>{b?q():Y(!1),P.current&&clearTimeout(P.current)}),50);s((()=>{const e=new Set(U),t=document.querySelector(`[id='${i}']`);if(t&&(z((e=>e.current===t?e:{current:t})),e.add({current:t})),!e.size)return()=>null;const n=[];return f.find((e=>"click"===e))&&(window.addEventListener("click",Z),n.push({event:"click",listener:J})),f.find((e=>"hover"===e))&&(n.push({event:"mouseenter",listener:G},{event:"mouseleave",listener:Q},{event:"focus",listener:G},{event:"blur",listener:Q}),x&&n.push({event:"mousemove",listener:K})),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.addEventListener(t,n)}))})),()=>{window.removeEventListener("click",Z),n.forEach((({event:t,listener:n})=>{e.forEach((e=>{var r;null===(r=e.current)||void 0===r||r.removeEventListener(t,n)}))}))}}),[U,V,i,f,b,v]),s((()=>{if(R)return X(R),()=>null;if(x)return B.current&&X(B.current),()=>null;let e=V.current;i&&(e=document.querySelector(`[id='${i}']`)),H(!0);let t=!0;return ye({place:l,offset:u,elementReference:e,tooltipReference:E.current,tooltipArrowReference:A.current,strategy:p}).then((e=>{t&&(H(!1),Object.keys(e.tooltipStyles).length&&C(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&D(e.tooltipArrowStyles))})),()=>{t=!1}}),[F,j,i,V,T,l,u,p,R]),s((()=>()=>{P.current&&clearTimeout(P.current),N.current&&clearTimeout(N.current)}),[]);const ee=Boolean(T||g);return c.exports.jsxs(h,{id:e,role:"tooltip",className:d(me.tooltip,me[o],t,{[me.show]:ee&&!I&&(j||F),[me.fixed]:"fixed"===p}),style:{..._,...L},ref:E,children:[g||(k?c.exports.jsx(m,{content:T}):T),c.exports.jsx("div",{className:d(me.arrow,n,{[me["no-arrow"]]:S}),style:$,ref:A})]})},ge=({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:g=0,float:v=!1,noArrow:b,style:x,position:S,isOpen:_,setIsOpen:R})=>{const[k,T]=r(n||o),[j,O]=r(u),[E,A]=r(a),[P,N]=r(f),[L,C]=r(h),[$,D]=r(g),[F,W]=r(v),[I,H]=r(p),[B,U]=r(y),[M,V]=r(m),[z,Y]=r(Boolean(o)),{anchorRefs:q,activeAnchor:X}=w()(e),K=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}),{}),J=e=>{const t={place:e=>{var t;O(null!==(t=e)&&void 0!==t?t:u)},content:e=>{T(null!=e?e:n)},html:e=>{var t;Y(Boolean(null!=e?e:o)),T(null!==(t=null!=e?e:o)&&void 0!==t?t:n)},variant:e=>{var t;A(null!==(t=e)&&void 0!==t?t:a)},offset:e=>{N(null===e?f:Number(e))},wrapper:e=>{var t;H(null!==(t=e)&&void 0!==t?t:"div")},events:e=>{const t=null==e?void 0:e.split(" ");U(null!=t?t:y)},"position-strategy":e=>{var t;V(null!==(t=e)&&void 0!==t?t:m)},"delay-show":e=>{C(null===e?h:Number(e))},"delay-hide":e=>{D(null===e?g:Number(e))},float:e=>{W(null===e?v: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)}))};s((()=>{Y(!1),T(n),o&&(Y(!0),T(o))}),[n,o]),s((()=>{var e;const n=new Set(q),r=document.querySelector(`[id='${t}']`);if(r&&n.add({current:r}),!n.size)return()=>null;const o=new MutationObserver((e=>{e.forEach((e=>{var t;if(!X.current||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=K(X.current);J(n)}))})),i={attributes:!0,childList:!1,subtree:!1},l=null!==(e=X.current)&&void 0!==e?e:r;if(l){const e=K(l);J(e),o.observe(l,i)}return()=>{o.disconnect()}}),[q,X,t]);const Z={id:e,anchorId:t,className:i,classNameArrow:l,content:k,isHtmlContent:z,place:j,variant:E,offset:P,wrapper:I,events:B,positionStrategy:M,delayShow:L,delayHide:$,float:F,noArrow:b,style:x,position:S,isOpen:_,setIsOpen:R};return d?c.exports.jsx(he,{...Z,children:d}):c.exports.jsx(he,{...Z})};export{ge as Tooltip,v as TooltipProvider,b as TooltipWrapper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7}.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.styles-module_fixed__7ciUi{position:fixed}.styles-module_arrow__K0L3T{background:inherit;height:8px;position:absolute;transform:rotate(45deg);width:8px}.styles-module_show__2NboJ{opacity
|
|
1
|
+
:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;left:0;opacity:0;padding:8px 16px;pointer-events:none;position:absolute;top:0;transition:opacity .3s ease-out;visibility:hidden;width:max-content;will-change:opacity,visibility}.styles-module_fixed__7ciUi{position:fixed}.styles-module_arrow__K0L3T{background:inherit;height:8px;position:absolute;transform:rotate(45deg);width:8px}.styles-module_no-arrow__KcFZN{display:none}.styles-module_show__2NboJ{opacity:var(--rt-opacity);visibility:visible}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}
|