Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-tooltip

Package Overview
Dependencies
Maintainers
6
Versions
347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tooltip - npm Package Compare versions

Comparing version 5.26.0 to 5.26.1-beta.1168.0

2

dist/react-tooltip.umd.min.js

@@ -7,3 +7,3 @@ /*

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.classNames)}(this,(function(e,t,o,l){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t),c=r(l);const s="react-tooltip-core-styles",i="react-tooltip-base-styles",a={core:!1,base:!1};function u({css:e,id:t=i,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=s),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css","top"===c&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),a[o]=!0}const d=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v={getTooltipData:()=>f},m=t.createContext(v);function y(e=p){return t.useContext(m).getTooltipData(e)}const h="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,w=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},S=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},b=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:c="absolute",middlewares:s=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=s;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:c,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var E={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},g={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",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 _=({forwardRef:e,id:l,className:r,classNameArrow:s,variant:i="dark",anchorId:a,anchorSelect:u,place:p="top",offset:f=10,events:v=["hover"],openOnClick:m=!1,positionStrategy:w="absolute",middlewares:_,wrapper:A,delayShow:O=0,delayHide:T=0,float:k=!1,hidden:R=!1,noArrow:C=!1,clickable:L=!1,closeOnEsc:x=!1,closeOnScroll:N=!1,closeOnResize:$=!1,openEvents:j,closeEvents:I,globalCloseEvents:B,imperativeModeOnly:D,style:q,position:z,afterShow:M,afterHide:H,content:P,contentWrapperRef:W,isOpen:F,defaultIsOpen:U=!1,setIsOpen:V,activeAnchor:K,setActiveAnchor:X,border:Y,opacity:G,arrowColor:Z,role:J="tooltip"})=>{var Q;const ee=t.useRef(null),te=t.useRef(null),oe=t.useRef(null),le=t.useRef(null),re=t.useRef(null),[ne,ce]=t.useState(p),[se,ie]=t.useState({}),[ae,ue]=t.useState({}),[de,pe]=t.useState(!1),[fe,ve]=t.useState(!1),[me,ye]=t.useState(null),he=t.useRef(!1),we=t.useRef(null),{anchorRefs:Se,setActiveAnchor:be}=y(l),Ee=t.useRef(!1),[ge,_e]=t.useState([]),Ae=t.useRef(!1),Oe=m||v.includes("click"),Te=Oe||(null==j?void 0:j.click)||(null==j?void 0:j.dblclick)||(null==j?void 0:j.mousedown),ke=j?{...j}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!j&&Oe&&Object.assign(ke,{mouseenter:!1,focus:!1,click:!0});const Re=I?{...I}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!I&&Oe&&Object.assign(Re,{mouseleave:!1,blur:!1});const Ce=B?{...B}:{escape:x||!1,scroll:N||!1,resize:$||!1,clickOutsideAnchor:Te||!1};D&&(Object.assign(ke,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Re,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ce,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),h((()=>(Ae.current=!0,()=>{Ae.current=!1})),[]);const Le=e=>{Ae.current&&(e&&ve(!0),setTimeout((()=>{Ae.current&&(null==V||V(e),void 0===F&&pe(e))}),10))};t.useEffect((()=>{if(void 0===F)return()=>null;F&&ve(!0);const e=setTimeout((()=>{pe(F)}),10);return()=>{clearTimeout(e)}}),[F]),t.useEffect((()=>{if(de!==he.current)if(re.current&&clearTimeout(re.current),he.current=de,de)null==M||M();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s?)$/);if(!t)return 0;const[,o,l]=t;return"s"!==l&&"ms"!==l?0:Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));re.current=setTimeout((()=>{ve(!1),ye(null),null==H||H()}),e+25)}}),[de]);const xe=(e=O)=>{oe.current&&clearTimeout(oe.current),oe.current=setTimeout((()=>{Le(!0)}),e)},Ne=(e=T)=>{le.current&&clearTimeout(le.current),le.current=setTimeout((()=>{Ee.current||Le(!1)}),e)},$e=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return X(null),void be({current:null});O?xe():Le(!0),X(o),be({current:o}),le.current&&clearTimeout(le.current)},je=()=>{L?Ne(T||100):T?Ne():Le(!1),oe.current&&clearTimeout(oe.current)},Ie=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};b({place:null!==(o=null==me?void 0:me.place)&&void 0!==o?o:p,offset:f,elementReference:l,tooltipReference:ee.current,tooltipArrowReference:te.current,strategy:w,middlewares:_,border:Y}).then((e=>{Object.keys(e.tooltipStyles).length&&ie(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ue(e.tooltipArrowStyles),ce(e.place)}))},Be=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};Ie(o),we.current=o},De=e=>{var t;if(!de)return;const o=e.target;if(null===(t=ee.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${a}']`),...ge].some((e=>null==e?void 0:e.contains(o)))||(Le(!1),oe.current&&clearTimeout(oe.current))},qe=d($e,50,!0),ze=d(je,50,!0),Me=e=>{ze.cancel(),qe(e)},He=()=>{qe.cancel(),ze()},Pe=t.useCallback((()=>{var e,t;const o=null!==(e=null==me?void 0:me.position)&&void 0!==e?e:z;o?Ie(o):k?we.current&&Ie(we.current):(null==K?void 0:K.isConnected)&&b({place:null!==(t=null==me?void 0:me.place)&&void 0!==t?t:p,offset:f,elementReference:K,tooltipReference:ee.current,tooltipArrowReference:te.current,strategy:w,middlewares:_,border:Y}).then((e=>{Ae.current&&(Object.keys(e.tooltipStyles).length&&ie(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ue(e.tooltipArrowStyles),ce(e.place))}))}),[de,K,P,q,p,null==me?void 0:me.place,f,w,z,null==me?void 0:me.position,k]);t.useEffect((()=>{var e,t;const l=new Set(Se);ge.forEach((e=>{l.add({current:e})}));const r=document.querySelector(`[id='${a}']`);r&&l.add({current:r});const n=()=>{Le(!1)},c=S(K),s=S(ee.current);Ce.scroll&&(window.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n));let i=null;Ce.resize?window.addEventListener("resize",n):K&&ee.current&&(i=o.autoUpdate(K,ee.current,Pe,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const u=e=>{"Escape"===e.key&&Le(!1)};Ce.escape&&window.addEventListener("keydown",u),Ce.clickOutsideAnchor&&window.addEventListener("click",De);const d=[],p=e=>{de&&(null==e?void 0:e.target)===K||$e(e)},f=e=>{de&&(null==e?void 0:e.target)===K&&je()},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(ke).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:Me}):m.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(Re).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:He}):m.includes(e)&&d.push({event:e,listener:f}))})),k&&d.push({event:"pointermove",listener:Be});const y=()=>{Ee.current=!0},h=()=>{Ee.current=!1,je()};return L&&!Te&&(null===(e=ee.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ee.current)||void 0===t||t.addEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t)}))})),()=>{var e,t;Ce.scroll&&(window.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),Ce.resize?window.removeEventListener("resize",n):null==i||i(),Ce.clickOutsideAnchor&&window.removeEventListener("click",De),Ce.escape&&window.removeEventListener("keydown",u),L&&!Te&&(null===(e=ee.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ee.current)||void 0===t||t.removeEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t)}))}))}}),[K,Pe,fe,Se,ge,j,I,B,Oe]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==me?void 0:me.anchorSelect)&&void 0!==e?e:u)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target)}if("childList"===e.type){if(K){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,K))&&(ve(!1),Le(!1),X(null),oe.current&&clearTimeout(oe.current),le.current&&clearTimeout(le.current),!0)}))}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||r.length)&&_e((e=>[...e.filter((e=>!r.includes(e))),...t]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{r.disconnect()}}),[l,u,null==me?void 0:me.anchorSelect,K]),t.useEffect((()=>{Pe()}),[Pe]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Pe()))}));return e.observe(W.current),()=>{e.disconnect()}}),[P,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),o=[...ge,t];K&&o.includes(K)||X(null!==(e=ge[0])&&void 0!==e?e:t)}),[a,ge,K]),t.useEffect((()=>(U&&Le(!0),()=>{oe.current&&clearTimeout(oe.current),le.current&&clearTimeout(le.current)})),[]),t.useEffect((()=>{var e;let t=null!==(e=null==me?void 0:me.anchorSelect)&&void 0!==e?e:u;if(!t&&l&&(t=`[data-tooltip-id='${l}']`),t)try{const e=Array.from(document.querySelectorAll(t));_e(e)}catch(e){_e([])}}),[l,u,null==me?void 0:me.anchorSelect]);const We=null!==(Q=null==me?void 0:me.content)&&void 0!==Q?Q:P,Fe=de&&Object.keys(se).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ye(null!=e?e:null),(null==e?void 0:e.delay)?xe(e.delay):Le(!0)},close:e=>{(null==e?void 0:e.delay)?Ne(e.delay):Le(!1)},activeAnchor:K,place:ne,isOpen:Boolean(fe&&!R&&We&&Fe)}))),fe&&!R&&We?n.default.createElement(A,{id:l,role:J,className:c.default("react-tooltip",E.tooltip,g.tooltip,g[i],r,`react-tooltip__place-${ne}`,E[Fe?"show":"closing"],Fe?"react-tooltip__show":"react-tooltip__closing","fixed"===w&&E.fixed,L&&E.clickable),onTransitionEnd:e=>{re.current&&clearTimeout(re.current),de||"opacity"!==e.propertyName||(ve(!1),ye(null),null==H||H())},style:{...q,...se,opacity:void 0!==G&&Fe?G:void 0},ref:ee},We,n.default.createElement(A,{className:c.default("react-tooltip-arrow",E.arrow,g.arrow,s,C&&E.noArrow),style:{...ae,background:Z?`linear-gradient(to right bottom, transparent 50%, ${Z} 50%)`:void 0},ref:te})):null},A=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),O=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),T=n.default.forwardRef((({id:e,anchorId:o,anchorSelect:l,content:r,html:s,render:i,className:a,classNameArrow:u,variant:d="dark",place:p="top",offset:f=10,wrapper:v="div",children:m=null,events:h=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:b,delayShow:E=0,delayHide:g=0,float:T=!1,hidden:k=!1,noArrow:R=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:N=!1,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B=!1,style:D,position:q,isOpen:z,defaultIsOpen:M=!1,disableStyleInjection:H=!1,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,role:X="tooltip"},Y)=>{const[G,Z]=t.useState(r),[J,Q]=t.useState(s),[ee,te]=t.useState(p),[oe,le]=t.useState(d),[re,ne]=t.useState(f),[ce,se]=t.useState(E),[ie,ae]=t.useState(g),[ue,de]=t.useState(T),[pe,fe]=t.useState(k),[ve,me]=t.useState(v),[ye,he]=t.useState(h),[we,Se]=t.useState(S),[be,Ee]=t.useState(null),[ge,_e]=t.useState(null),Ae=t.useRef(H),{anchorRefs:Oe,activeAnchor:Te}=y(e),ke=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),Re=e=>{const t={place:e=>{var t;te(null!==(t=e)&&void 0!==t?t:p)},content:e=>{Z(null!=e?e:r)},html:e=>{Q(null!=e?e:s)},variant:e=>{var t;le(null!==(t=e)&&void 0!==t?t:d)},offset:e=>{ne(null===e?f:Number(e))},wrapper:e=>{var t;me(null!==(t=e)&&void 0!==t?t:v)},events:e=>{const t=null==e?void 0:e.split(" ");he(null!=t?t:h)},"position-strategy":e=>{var t;Se(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{se(null===e?E:Number(e))},"delay-hide":e=>{ae(null===e?g:Number(e))},float:e=>{de(null===e?T:"true"===e)},hidden:e=>{fe(null===e?k:"true"===e)},"class-name":e=>{Ee(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))};t.useEffect((()=>{Z(r)}),[r]),t.useEffect((()=>{Q(s)}),[s]),t.useEffect((()=>{te(p)}),[p]),t.useEffect((()=>{le(d)}),[d]),t.useEffect((()=>{ne(f)}),[f]),t.useEffect((()=>{se(E)}),[E]),t.useEffect((()=>{ae(g)}),[g]),t.useEffect((()=>{de(T)}),[T]),t.useEffect((()=>{fe(k)}),[k]),t.useEffect((()=>{Se(S)}),[S]),t.useEffect((()=>{Ae.current!==H&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[H]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===H,disableBase:H}}))}),[]),t.useEffect((()=>{var t;const r=new Set(Oe);let n=l;if(!n&&e&&(n=`[data-tooltip-id='${e}']`),n)try{document.querySelectorAll(n).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${o}']`);if(c&&r.add({current:c}),!r.size)return()=>null;const s=null!==(t=null!=ge?ge:c)&&void 0!==t?t:Te.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=ke(s);Re(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(s){const e=ke(s);Re(e),i.observe(s,a)}return()=>{i.disconnect()}}),[Oe,Te,ge,o,l]),t.useEffect((()=>{(null==D?void 0:D.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),P&&!O("border",`${P}`)&&console.warn(`[react-tooltip] "${P}" is not a valid \`border\`.`),(null==D?void 0:D.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),W&&!O("opacity",`${W}`)&&console.warn(`[react-tooltip] "${W}" is not a valid \`opacity\`.`)}),[]);let Ce=m;const Le=t.useRef(null);if(i){const e=i({content:null!=G?G:null,activeAnchor:ge});Ce=e?n.default.createElement("div",{ref:Le,className:"react-tooltip-content-wrapper"},e):null}else G&&(Ce=G);J&&(Ce=n.default.createElement(A,{content:J}));const xe={forwardRef:Y,id:e,anchorId:o,anchorSelect:l,className:c.default(a,be),classNameArrow:u,content:Ce,contentWrapperRef:Le,place:ee,variant:oe,offset:re,wrapper:ve,events:ye,openOnClick:w,positionStrategy:we,middlewares:b,delayShow:ce,delayHide:ie,float:ue,hidden:pe,noArrow:R,clickable:C,closeOnEsc:L,closeOnScroll:x,closeOnResize:N,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B,style:D,position:q,isOpen:z,defaultIsOpen:M,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,activeAnchor:ge,setActiveAnchor:e=>_e(e),role:X};return n.default.createElement(_,{...xe})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`: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;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||u({css:`
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.classNames)}(this,(function(e,t,o,l){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t),c=r(l);const s="react-tooltip-core-styles",i="react-tooltip-base-styles",a={core:!1,base:!1};function u({css:e,id:t=i,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=s),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css","top"===c&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),a[o]=!0}const d=(e,t,o)=>{let l=null;const r=function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))};return r.cancel=()=>{l&&(clearTimeout(l),l=null)},r},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v={getTooltipData:()=>f},m=t.createContext(v);function y(e=p){return t.useContext(m).getTooltipData(e)}const h="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,w=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},S=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},b=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:c="absolute",middlewares:s=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=s;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:c,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var E={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},g={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",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 _=({forwardRef:e,id:l,className:r,classNameArrow:s,variant:i="dark",anchorId:a,anchorSelect:u,place:p="top",offset:f=10,events:v=["hover"],openOnClick:m=!1,positionStrategy:w="absolute",middlewares:_,wrapper:A,delayShow:O=0,delayHide:T=0,float:k=!1,hidden:R=!1,noArrow:C=!1,clickable:L=!1,closeOnEsc:x=!1,closeOnScroll:N=!1,closeOnResize:$=!1,openEvents:j,closeEvents:I,globalCloseEvents:B,imperativeModeOnly:D,style:q,position:z,afterShow:M,afterHide:H,content:P,contentWrapperRef:W,isOpen:F,defaultIsOpen:U=!1,setIsOpen:V,activeAnchor:K,setActiveAnchor:X,border:Y,opacity:G,arrowColor:Z,role:J="tooltip"})=>{var Q;const ee=t.useRef(null),te=t.useRef(null),oe=t.useRef(null),le=t.useRef(null),re=t.useRef(null),[ne,ce]=t.useState(p),[se,ie]=t.useState({}),[ae,ue]=t.useState({}),[de,pe]=t.useState(!1),[fe,ve]=t.useState(!1),[me,ye]=t.useState(null),he=t.useRef(!1),we=t.useRef(null),{anchorRefs:Se,setActiveAnchor:be}=y(l),Ee=t.useRef(!1),[ge,_e]=t.useState([]),Ae=t.useRef(!1),Oe=m||v.includes("click"),Te=Oe||(null==j?void 0:j.click)||(null==j?void 0:j.dblclick)||(null==j?void 0:j.mousedown),ke=j?{...j}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!j&&Oe&&Object.assign(ke,{mouseenter:!1,focus:!1,click:!0});const Re=I?{...I}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!I&&Oe&&Object.assign(Re,{mouseleave:!1,blur:!1});const Ce=B?{...B}:{escape:x||!1,scroll:N||!1,resize:$||!1,clickOutsideAnchor:Te||!1};D&&(Object.assign(ke,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Re,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ce,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),h((()=>(Ae.current=!0,()=>{Ae.current=!1})),[]);const Le=e=>{Ae.current&&(e&&ve(!0),setTimeout((()=>{Ae.current&&(null==V||V(e),void 0===F&&pe(e))}),10))};t.useEffect((()=>{if(void 0===F)return()=>null;F&&ve(!0);const e=setTimeout((()=>{pe(F)}),10);return()=>{clearTimeout(e)}}),[F]),t.useEffect((()=>{if(de!==he.current)if(re.current&&clearTimeout(re.current),he.current=de,de)null==M||M();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s?)$/);if(!t)return 0;const[,o,l]=t;return"s"!==l&&"ms"!==l?0:Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));re.current=setTimeout((()=>{ve(!1),ye(null),null==H||H()}),e+25)}}),[de]);const xe=(e=O)=>{oe.current&&clearTimeout(oe.current),fe?Le(!0):oe.current=setTimeout((()=>{Le(!0)}),e)},Ne=(e=T)=>{le.current&&clearTimeout(le.current),le.current=setTimeout((()=>{Ee.current||Le(!1)}),e)},$e=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return X(null),void be({current:null});O?xe():Le(!0),X(o),be({current:o}),le.current&&clearTimeout(le.current)},je=()=>{L?Ne(T||100):T?Ne():Le(!1),oe.current&&clearTimeout(oe.current)},Ie=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};b({place:null!==(o=null==me?void 0:me.place)&&void 0!==o?o:p,offset:f,elementReference:l,tooltipReference:ee.current,tooltipArrowReference:te.current,strategy:w,middlewares:_,border:Y}).then((e=>{Object.keys(e.tooltipStyles).length&&ie(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ue(e.tooltipArrowStyles),ce(e.place)}))},Be=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};Ie(o),we.current=o},De=e=>{var t;if(!de)return;const o=e.target;if(null===(t=ee.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${a}']`),...ge].some((e=>null==e?void 0:e.contains(o)))||(Le(!1),oe.current&&clearTimeout(oe.current))},qe=d($e,50,!0),ze=d(je,50,!0),Me=e=>{ze.cancel(),qe(e)},He=()=>{qe.cancel(),ze()},Pe=t.useCallback((()=>{var e,t;const o=null!==(e=null==me?void 0:me.position)&&void 0!==e?e:z;o?Ie(o):k?we.current&&Ie(we.current):(null==K?void 0:K.isConnected)&&b({place:null!==(t=null==me?void 0:me.place)&&void 0!==t?t:p,offset:f,elementReference:K,tooltipReference:ee.current,tooltipArrowReference:te.current,strategy:w,middlewares:_,border:Y}).then((e=>{Ae.current&&(Object.keys(e.tooltipStyles).length&&ie(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ue(e.tooltipArrowStyles),ce(e.place))}))}),[de,K,P,q,p,null==me?void 0:me.place,f,w,z,null==me?void 0:me.position,k]);t.useEffect((()=>{var e,t;const l=new Set(Se);ge.forEach((e=>{l.add({current:e})}));const r=document.querySelector(`[id='${a}']`);r&&l.add({current:r});const n=()=>{Le(!1)},c=S(K),s=S(ee.current);Ce.scroll&&(window.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n));let i=null;Ce.resize?window.addEventListener("resize",n):K&&ee.current&&(i=o.autoUpdate(K,ee.current,Pe,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const u=e=>{"Escape"===e.key&&Le(!1)};Ce.escape&&window.addEventListener("keydown",u),Ce.clickOutsideAnchor&&window.addEventListener("click",De);const d=[],p=e=>{de&&(null==e?void 0:e.target)===K||$e(e)},f=e=>{de&&(null==e?void 0:e.target)===K&&je()},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(ke).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:Me}):m.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(Re).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:He}):m.includes(e)&&d.push({event:e,listener:f}))})),k&&d.push({event:"pointermove",listener:Be});const y=()=>{Ee.current=!0},h=()=>{Ee.current=!1,je()};return L&&!Te&&(null===(e=ee.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=ee.current)||void 0===t||t.addEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t)}))})),()=>{var e,t;Ce.scroll&&(window.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),Ce.resize?window.removeEventListener("resize",n):null==i||i(),Ce.clickOutsideAnchor&&window.removeEventListener("click",De),Ce.escape&&window.removeEventListener("keydown",u),L&&!Te&&(null===(e=ee.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=ee.current)||void 0===t||t.removeEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t)}))}))}}),[K,Pe,fe,Se,ge,j,I,B,Oe,O,T]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==me?void 0:me.anchorSelect)&&void 0!==e?e:u)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l?t.push(e.target):e.oldValue===l&&r.push(e.target)}if("childList"===e.type){if(K){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,K))&&(ve(!1),Le(!1),X(null),oe.current&&clearTimeout(oe.current),le.current&&clearTimeout(le.current),!0)}))}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||r.length)&&_e((e=>[...e.filter((e=>!r.includes(e))),...t]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{r.disconnect()}}),[l,u,null==me?void 0:me.anchorSelect,K]),t.useEffect((()=>{Pe()}),[Pe]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>Pe()))}));return e.observe(W.current),()=>{e.disconnect()}}),[P,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),o=[...ge,t];K&&o.includes(K)||X(null!==(e=ge[0])&&void 0!==e?e:t)}),[a,ge,K]),t.useEffect((()=>(U&&Le(!0),()=>{oe.current&&clearTimeout(oe.current),le.current&&clearTimeout(le.current)})),[]),t.useEffect((()=>{var e;let t=null!==(e=null==me?void 0:me.anchorSelect)&&void 0!==e?e:u;if(!t&&l&&(t=`[data-tooltip-id='${l}']`),t)try{const e=Array.from(document.querySelectorAll(t));_e(e)}catch(e){_e([])}}),[l,u,null==me?void 0:me.anchorSelect]),t.useEffect((()=>{oe.current&&(clearTimeout(oe.current),xe(O))}),[O]);const We=null!==(Q=null==me?void 0:me.content)&&void 0!==Q?Q:P,Fe=de&&Object.keys(se).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ye(null!=e?e:null),(null==e?void 0:e.delay)?xe(e.delay):Le(!0)},close:e=>{(null==e?void 0:e.delay)?Ne(e.delay):Le(!1)},activeAnchor:K,place:ne,isOpen:Boolean(fe&&!R&&We&&Fe)}))),fe&&!R&&We?n.default.createElement(A,{id:l,role:J,className:c.default("react-tooltip",E.tooltip,g.tooltip,g[i],r,`react-tooltip__place-${ne}`,E[Fe?"show":"closing"],Fe?"react-tooltip__show":"react-tooltip__closing","fixed"===w&&E.fixed,L&&E.clickable),onTransitionEnd:e=>{re.current&&clearTimeout(re.current),de||"opacity"!==e.propertyName||(ve(!1),ye(null),null==H||H())},style:{...q,...se,opacity:void 0!==G&&Fe?G:void 0},ref:ee},We,n.default.createElement(A,{className:c.default("react-tooltip-arrow",E.arrow,g.arrow,s,C&&E.noArrow),style:{...ae,background:Z?`linear-gradient(to right bottom, transparent 50%, ${Z} 50%)`:void 0},ref:te})):null},A=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),O=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),T=n.default.forwardRef((({id:e,anchorId:o,anchorSelect:l,content:r,html:s,render:i,className:a,classNameArrow:u,variant:d="dark",place:p="top",offset:f=10,wrapper:v="div",children:m=null,events:h=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:b,delayShow:E=0,delayHide:g=0,float:T=!1,hidden:k=!1,noArrow:R=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:N=!1,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B=!1,style:D,position:q,isOpen:z,defaultIsOpen:M=!1,disableStyleInjection:H=!1,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,role:X="tooltip"},Y)=>{const[G,Z]=t.useState(r),[J,Q]=t.useState(s),[ee,te]=t.useState(p),[oe,le]=t.useState(d),[re,ne]=t.useState(f),[ce,se]=t.useState(E),[ie,ae]=t.useState(g),[ue,de]=t.useState(T),[pe,fe]=t.useState(k),[ve,me]=t.useState(v),[ye,he]=t.useState(h),[we,Se]=t.useState(S),[be,Ee]=t.useState(null),[ge,_e]=t.useState(null),Ae=t.useRef(H),{anchorRefs:Oe,activeAnchor:Te}=y(e),ke=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),Re=e=>{const t={place:e=>{var t;te(null!==(t=e)&&void 0!==t?t:p)},content:e=>{Z(null!=e?e:r)},html:e=>{Q(null!=e?e:s)},variant:e=>{var t;le(null!==(t=e)&&void 0!==t?t:d)},offset:e=>{ne(null===e?f:Number(e))},wrapper:e=>{var t;me(null!==(t=e)&&void 0!==t?t:v)},events:e=>{const t=null==e?void 0:e.split(" ");he(null!=t?t:h)},"position-strategy":e=>{var t;Se(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{se(null===e?E:Number(e))},"delay-hide":e=>{ae(null===e?g:Number(e))},float:e=>{de(null===e?T:"true"===e)},hidden:e=>{fe(null===e?k:"true"===e)},"class-name":e=>{Ee(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))};t.useEffect((()=>{Z(r)}),[r]),t.useEffect((()=>{Q(s)}),[s]),t.useEffect((()=>{te(p)}),[p]),t.useEffect((()=>{le(d)}),[d]),t.useEffect((()=>{ne(f)}),[f]),t.useEffect((()=>{se(E)}),[E]),t.useEffect((()=>{ae(g)}),[g]),t.useEffect((()=>{de(T)}),[T]),t.useEffect((()=>{fe(k)}),[k]),t.useEffect((()=>{Se(S)}),[S]),t.useEffect((()=>{Ae.current!==H&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[H]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===H,disableBase:H}}))}),[]),t.useEffect((()=>{var t;const r=new Set(Oe);let n=l;if(!n&&e&&(n=`[data-tooltip-id='${e}']`),n)try{document.querySelectorAll(n).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${o}']`);if(c&&r.add({current:c}),!r.size)return()=>null;const s=null!==(t=null!=ge?ge:c)&&void 0!==t?t:Te.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=ke(s);Re(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(s){const e=ke(s);Re(e),i.observe(s,a)}return()=>{i.disconnect()}}),[Oe,Te,ge,o,l]),t.useEffect((()=>{(null==D?void 0:D.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),P&&!O("border",`${P}`)&&console.warn(`[react-tooltip] "${P}" is not a valid \`border\`.`),(null==D?void 0:D.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),W&&!O("opacity",`${W}`)&&console.warn(`[react-tooltip] "${W}" is not a valid \`opacity\`.`)}),[]);let Ce=m;const Le=t.useRef(null);if(i){const e=i({content:null!=G?G:null,activeAnchor:ge});Ce=e?n.default.createElement("div",{ref:Le,className:"react-tooltip-content-wrapper"},e):null}else G&&(Ce=G);J&&(Ce=n.default.createElement(A,{content:J}));const xe={forwardRef:Y,id:e,anchorId:o,anchorSelect:l,className:c.default(a,be),classNameArrow:u,content:Ce,contentWrapperRef:Le,place:ee,variant:oe,offset:re,wrapper:ve,events:ye,openOnClick:w,positionStrategy:we,middlewares:b,delayShow:ce,delayHide:ie,float:ue,hidden:pe,noArrow:R,clickable:C,closeOnEsc:L,closeOnScroll:x,closeOnResize:N,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B,style:D,position:q,isOpen:z,defaultIsOpen:M,border:P,opacity:W,arrowColor:F,setIsOpen:U,afterShow:V,afterHide:K,activeAnchor:ge,setActiveAnchor:e=>_e(e),role:X};return n.default.createElement(_,{...xe})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`: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;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||u({css:`
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.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)}`,type:"base"})})),e.Tooltip=T,e.TooltipProvider=({children:e})=>{const[o,l]=t.useState({[p]:new Set}),[r,c]=t.useState({[p]:{current:null}}),s=(e,...t)=>{l((o=>{var l;const r=null!==(l=o[e])&&void 0!==l?l:new Set;return t.forEach((e=>r.add(e))),{...o,[e]:new Set(r)}}))},i=(e,...t)=>{l((o=>{const l=o[e];return l?(t.forEach((e=>l.delete(e))),{...o}):o}))},a=t.useCallback(((e=p)=>{var t,l;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(l=r[e])&&void 0!==l?l:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{c((o=>{var l;return(null===(l=o[e])||void 0===l?void 0:l.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,r,s,i]),u=t.useMemo((()=>({getTooltipData:a})),[a]);return n.default.createElement(m.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:l,place:r,content:s,html:i,variant:a,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:v,delayHide:m})=>{const{attach:h,detach:w}=y(e),S=t.useRef(null);return t.useEffect((()=>(h(S),()=>{w(S)})),[]),n.default.createElement("span",{ref:S,className:c.default("react-tooltip-wrapper",l),"data-tooltip-place":r,"data-tooltip-content":s,"data-tooltip-html":i,"data-tooltip-variant":a,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":v,"data-tooltip-delay-hide":m},o)},e.removeStyle=function({type:e="base",id:t=i}={}){if(!a[e])return;"core"===e&&(t=s);const o=document.getElementById(t);"style"===(null==o?void 0:o.tagName)?null==o||o.remove():console.warn(`[react-tooltip] Failed to remove 'style' element with id '${t}'. Call \`injectStyle()\` first`),a[e]=!1},Object.defineProperty(e,"__esModule",{value:!0})}));
{
"name": "react-tooltip",
"version": "5.26.0",
"version": "5.26.1-beta.1168.0",
"description": "react tooltip component",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc