UNPKG

@punkbit/test24jan

Version:

A standalone package for Fleek Agents AI user-interface

6 lines 211 kB
var Ss=Object.create;var ln=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Bs=Object.getOwnPropertyNames;var Ts=Object.getPrototypeOf,Ls=Object.prototype.hasOwnProperty;var Ns=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Os=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Bs(t))!Ls.call(e,n)&&n!==r&&ln(e,n,{get:()=>t[n],enumerable:!(o=Ps(t,n))||o.enumerable});return e};var Ds=(e,t,r)=>(r=e!=null?Ss(Ts(e)):{},Os(t||!e||!e.__esModule?ln(r,"default",{value:e,enumerable:!0}):r,e));var Zn=Ns((od,Kr)=>{(function(){"use strict";var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(n=o(n,r(s)))}return n}function r(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var s in n)e.call(n,s)&&n[s]&&(a=o(a,s));return a}function o(n,a){return a?n?n+" "+a:n+a:n}typeof Kr<"u"&&Kr.exports?(t.default=t,Kr.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});import{useRef as nc}from"react";import{Toaster as ac}from"react-hot-toast";var Fs={PUBLIC_FLEEK_REST_API_URL:"https://api.fleek.xyz",PUBLIC_UI_APP_URL:"https://app.fleek.xyz",PUBLIC_BEEHIIV_PROXY_SERVER_URL:"https://faas-lon1-917a94a7.doserverless.co/api/v1/web/fn-5aaf2a72-1b5b-4ac6-8c42-a2e735a32d8b/main/create-subscription"},Ot=e=>{let t=Fs[e];if(t==null)throw new Error(`Expected key "${e}" to be defined but got ${typeof t}`);if(typeof t!="string")throw new Error(`Expected key "${e}" to be string but got ${typeof t}`);return t};var Dt={endpoints:{aiAgents:"/ai-agents",projects:"/projects",teams:"/teams",subscriptions:"/subscriptions",plans:"/plans"},agentsDashboardPage:"/projects/[projectId]/agents/"},At={guides:{getStarted:"https://fleek.xyz/guides/eliza-guide/",characterfile:{fromScratch:"https://fleek.xyz/guides/eliza-guide/#manually-enter-agent-details",template:"https://fleek.xyz/guides/eliza-guide/#use-a-predefined-template"}},supportExternalUrl:"https://support.fleek.xyz/hc/en-us"};var bo=Ot("PUBLIC_FLEEK_REST_API_URL"),An=async(e,t,r)=>{if(!r||!e||!t)return{ok:!1,error:"Missing required parameters"};try{let{name:o}=JSON.parse(t),n=await fetch(`${bo}${Dt.endpoints.aiAgents}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({config:t,projectId:e,name:o})});if(!n.ok){let s=await n.text();return{ok:!1,error:`HTTP Error ${n.status}: ${s}`}}return{ok:!0,data:{agentId:(await n.json()).id}}}catch(o){return{ok:!1,error:o.message}}},cn=async(e,t)=>{try{let r=await fetch(`${bo}${Dt.endpoints.aiAgents}/${e}/status`,{method:"GET",headers:{authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`HTTP error! Status: ${r.status}`);return{ok:!0,data:await r.json()}}catch(r){throw console.error("Error fetching deployment status:",r),r}},dn=async(e,t)=>{if(!t||!e)return{ok:!1};try{let r=await fetch(`${bo}${Dt.endpoints.aiAgents}?projectId=${e}`,{method:"GET",headers:{authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`HTTP error! Status: ${r.status}`);return{ok:!0,data:await r.json()}}catch(r){throw console.error("Error fetching deployment status:",r),r}};import{useState as ur}from"react";import{jsx as U,jsxs as Hr}from"react/jsx-runtime";var mn=()=>U("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U("path",{d:"M10 10.7071L14.6464 15.3536C14.8417 15.5488 15.1583 15.5488 15.3536 15.3536C15.5488 15.1583 15.5488 14.8417 15.3536 14.6464L10.7071 10L15.3536 5.35355C15.5488 5.15829 15.5488 4.84171 15.3536 4.64645C15.1583 4.45118 14.8417 4.45118 14.6464 4.64645L10 9.29289L5.35355 4.64645C5.15829 4.45118 4.84171 4.45118 4.64645 4.64645C4.45118 4.84171 4.45118 5.15829 4.64645 5.35355L9.29289 10L4.64645 14.6464C4.45118 14.8417 4.45118 15.1583 4.64645 15.3536C4.84171 15.5488 5.15829 15.5488 5.35355 15.3536L10 10.7071Z",fill:"#FF3B30"})}),un=()=>U("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.6616 4.52965C16.9213 4.75695 16.9477 5.1518 16.7204 5.41157L7.97036 15.4116C7.85645 15.5418 7.69368 15.6189 7.5208 15.6247C7.34791 15.6304 7.18037 15.5643 7.05806 15.442L3.30806 11.6919C3.06398 11.4479 3.06398 11.0521 3.30806 10.8081C3.55214 10.564 3.94786 10.564 4.19194 10.8081L7.46956 14.0857L15.7796 4.58844C16.0069 4.32867 16.4018 4.30235 16.6616 4.52965Z",fill:"#3DD68C"})});var pn=()=>Hr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[U("path",{d:"M12.75 15H5.75C5.15326 15 4.58097 14.7629 4.15901 14.341C3.73705 13.919 3.5 13.3467 3.5 12.75V5.75C3.5 5.15326 3.73705 4.58097 4.15901 4.15901C4.58097 3.73705 5.15326 3.5 5.75 3.5H12.75C13.3467 3.5 13.919 3.73705 14.341 4.15901C14.7629 4.58097 15 5.15326 15 5.75V12.75C15 13.3467 14.7629 13.919 14.341 14.341C13.919 14.7629 13.3467 15 12.75 15Z",fill:"currentColor"}),U("path",{d:"M5 2.5H12.3713C12.2157 2.06164 11.9283 1.68215 11.5485 1.41359C11.1687 1.14503 10.7151 1.00056 10.25 1H3.25C2.65326 1 2.08097 1.23705 1.65901 1.65901C1.23705 2.08097 1 2.65326 1 3.25V10.25C1.00056 10.7151 1.14503 11.1687 1.41359 11.5485C1.68215 11.9283 2.06164 12.2157 2.5 12.3713V5C2.5 4.33696 2.76339 3.70107 3.23223 3.23223C3.70107 2.76339 4.33696 2.5 5 2.5Z",fill:"currentColor"})]}),fn=()=>Hr("svg",{width:"50",height:"35",viewBox:"0 0 50 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[U("path",{d:"M41.1627 11.7652C38.9207 3.79129 29.8629 -1.05017 20.9313 0.951477C13.9515 2.51576 8.8834 7.90149 8.36122 14.3093C3.40527 15.0389 0.0501836 19.2172 0.867474 23.6418C1.59401 27.5753 5.41169 30.456 9.877 30.4401H17.4559V27.7336H9.877C6.52845 27.7336 3.81387 25.3101 3.81387 22.3206C3.81387 19.331 6.52845 16.9075 9.877 16.9075C10.7142 16.9075 11.3928 16.3017 11.3928 15.5543C11.3852 8.82779 17.4869 3.36942 25.0212 3.36273C31.5432 3.3569 37.1576 7.47335 38.4192 13.1861C38.5438 13.7565 39.0622 14.1922 39.7076 14.2687C43.8515 14.7955 46.7324 18.2217 46.1424 21.9213C45.6125 25.2434 42.4354 27.7169 38.6769 27.7336H32.6137V30.4401H38.6769C44.5369 30.4243 49.2729 26.1703 49.2551 20.9386C49.2403 16.5837 45.9015 12.7987 41.1627 11.7652Z",fill:"#F5E147"}),U("path",{d:"M23.9586 17.2998L17.8955 22.7128L20.0328 24.6209L23.5191 21.522V34.4997H26.5506V21.522L30.0218 24.6209L32.159 22.7128L26.0959 17.2998C25.5046 16.7751 24.5499 16.7751 23.9586 17.2998Z",fill:"#F5E147"})]}),gn=()=>Hr("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 9.5C13.7761 9.5 14 9.72386 14 10V13.5C14 13.7761 13.7761 14 13.5 14H10C9.72386 14 9.5 13.7761 9.5 13.5C9.5 13.2239 9.72386 13 10 13H13V10C13 9.72386 13.2239 9.5 13.5 9.5Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.1464 9.14649C9.34164 8.9512 9.65822 8.95116 9.85351 9.1464L13.5348 12.8267C13.73 13.022 13.7301 13.3385 13.5348 13.5338C13.3396 13.7291 13.023 13.7291 12.8277 13.5339L9.14649 9.8536C8.9512 9.65836 8.95116 9.34178 9.1464 9.14649Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2.5C2 2.22386 2.22386 2 2.5 2H6C6.27614 2 6.5 2.22386 6.5 2.5C6.5 2.77614 6.27614 3 6 3H3V6C3 6.27614 2.77614 6.5 2.5 6.5C2.22386 6.5 2 6.27614 2 6V2.5Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.46518 2.46588C2.66042 2.2706 2.977 2.27056 3.17229 2.46579L6.85354 6.14611C7.04882 6.34134 7.04887 6.65793 6.85363 6.85321C6.65839 7.0485 6.34181 7.04854 6.14652 6.8533L2.46527 3.17299C2.26998 2.97775 2.26994 2.66117 2.46518 2.46588Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 2.5C9.5 2.22386 9.72386 2 10 2H13.5C13.7761 2 14 2.22386 14 2.5V6C14 6.27614 13.7761 6.5 13.5 6.5C13.2239 6.5 13 6.27614 13 6V3H10C9.72386 3 9.5 2.77614 9.5 2.5Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5338 2.46503C13.7291 2.66026 13.7291 2.97685 13.5339 3.17213L9.8536 6.85338C9.65836 7.04867 9.34178 7.04871 9.14649 6.85347C8.9512 6.65824 8.95116 6.34165 9.1464 6.14637L12.8267 2.46512C13.022 2.26983 13.3385 2.26979 13.5338 2.46503Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 9.5C2.77614 9.5 3 9.72386 3 10V13H6C6.27614 13 6.5 13.2239 6.5 13.5C6.5 13.7761 6.27614 14 6 14H2.5C2.22386 14 2 13.7761 2 13.5V10C2 9.72386 2.22386 9.5 2.5 9.5Z",fill:"#B4B4B4"}),U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.85352 9.1464C7.04881 9.34164 7.04885 9.65822 6.85361 9.85351L3.1733 13.5348C2.97806 13.73 2.66148 13.7301 2.46619 13.5348C2.27091 13.3396 2.27087 13.023 2.4661 12.8277L6.14642 9.14649C6.34165 8.9512 6.65824 8.95116 6.85352 9.1464Z",fill:"#B4B4B4"})]}),mr=({variant:e})=>e==="small"?U("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7365 0.0440924C19.8713 -0.0831111 20.0763 0.0903391 19.9709 0.242402L15.2549 7.04263C15.1807 7.14964 15.2656 7.29399 15.3961 7.28267L18.1684 7.04222C18.3064 7.03025 18.3897 7.19022 18.2998 7.29482L13.5419 12.835C13.4521 12.9397 13.5353 13.0996 13.6733 13.0876L16.6586 12.8287C16.8046 12.8161 16.8851 12.9929 16.7789 13.093L5.26353 23.9559C5.12868 24.0831 4.92364 23.9096 5.0291 23.7576L9.8071 16.8679C9.88131 16.7609 9.79642 16.6165 9.66594 16.6278L6.83434 16.8734C6.69677 16.8854 6.61339 16.7264 6.70226 16.6216L11.3202 11.1762C11.4091 11.0714 11.3257 10.9123 11.1881 10.9243L8.34145 11.1712C8.19545 11.1839 8.11499 11.007 8.22117 10.9069L19.7365 0.0440924Z",fill:"#B4B4B4"})}):U("svg",{width:"22",height:"45",viewBox:"0 0 22 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:U("path",{d:"M20.3695 13.0981L12.7018 24.2968L18.54 23.1037C18.6552 23.2863 18.7704 23.469 18.8856 23.6516L0.661202 45H0L7.49488 31.1342L1.98736 32.2587C1.81079 32.01 1.79577 31.992 1.61919 31.7433L9.0502 20.7429L3.46755 21.8819C3.29098 21.6115 3.29474 21.6115 3.11817 21.3376L21.3313 0H22L14.6066 13.6856L20.0014 12.5827C20.1817 12.8314 20.193 12.8494 20.3695 13.0981Z",fill:"white"})}),hn=()=>Hr("svg",{width:"34",height:"33",viewBox:"0 0 34 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading spinner",children:[U("path",{d:"M32 16.5C32 24.7843 25.2843 31.5 17 31.5C8.71573 31.5 2 24.7843 2 16.5C2 8.21573 8.71573 1.5 17 1.5C25.2843 1.5 32 8.21573 32 16.5Z",stroke:"#606060",strokeWidth:"2.42308"}),U("path",{d:"M2 16.5C2 8.21573 8.71573 1.5 17 1.5",stroke:"white",strokeWidth:"2.42308",strokeLinecap:"round"}),U("style",{children:` @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } `})]});import zr from"react-hot-toast";import{useAuthStore as Vs}from"@fleek-platform/login-button";import{Fragment as Ms,jsx as Ee,jsxs as De}from"react/jsx-runtime";var vn=20,yn=({isVisible:e,setIsVisible:t,onSuccess:r,activeProjectId:o,subscriptionAmount:n,productId:a,checkUserAmountAvailableAiModules:s,createSubscription:i})=>{let[l,A]=ur(!1),{accessToken:d}=Vs(),c=async()=>{if(!o||!d)return;A(!0);let p=await i(o,a,d);if(!p||!p.ok||!p.data?.url){zr.error("Failed to create subscription"),A(!1);return}window.open(p.data?.url,"_blank");let y=async h=>{try{if((await s(o)).hasEnoughAiModules){A(!1),t(!1),r?.(!0),zr.success("Subscription activated successfully!");return}if(h>=20){A(!1),zr.error("Subscription verification timed out. Please try again.");return}setTimeout(()=>y(h+1),5e3)}catch{A(!1),zr.error("Failed to verify subscription status")}};y(0)};return e?Ee("div",{className:"fixed bottom-0 left-0 right-0 top-0 z-100 flex h-full w-full items-center justify-center bg-[rgba(0,0,0,0.9)]",children:De("div",{className:"flex w-full max-w-[416px] flex-col rounded-[16px] border-1 border-[#3a3a3a] bg-[#191919] text-[#eeeeee] ",children:[De("div",{className:"flex flex-col items-center justify-center gap-[8px] border-b-1 border-b-[#3a3a3a] px-[16px] py-[24px]",children:[l?Ee(hn,{}):Ee(mr,{}),Ee("p",{className:"text-center text-[18px] font-bold leading-[24px]",children:l?"Pending payment":"Upgrade your plan"}),Ee("p",{className:"text-center text-[14px] leading-[20px] text-[#b4b4b4]",children:l?"Continue making your payment to deploy your AI agent.":`To deploy an AI agent, you need an ${n>1?"additional":""} AI Agent Plan`}),!l&&Ee("div",{className:"flex w-full flex-col gap-[16px] pt-[8px] text-[14px] font-medium leading-[20px]",children:De("p",{className:"flex flex-row justify-between",children:["AI Agent Plan ",De("span",{children:["$",vn," /mo"]})]})})]}),De("div",{className:"p-[16px]",children:[!l&&De("div",{className:"mb-[16px] flex flex-col gap-[16px] border-b-1 border-b-[#3a3a3a] pb-[16px] text-[14px] leading-[20px]",children:[Ee("p",{className:"font-bold",children:"Coming soon"}),De("p",{className:"flex flex-row gap-[6px]",children:[Ee(mr,{variant:"small"}),"Manage your agents in UI"]}),De("p",{className:"flex flex-row gap-[6px]",children:[Ee(mr,{variant:"small"}),"Collaborate to build agents"]}),De("p",{className:"flex flex-row gap-[6px]",children:[Ee(mr,{variant:"small"}),"Create personalities"]})]}),De("div",{className:"flex flex-row items-center justify-center gap-[16px] text-[14px] font-medium leading-[20px]",children:[!l&&De(Ms,{children:[Ee("button",{className:"h-[32px] w-full rounded-[8px] hover:text-[#ffffff]",onClick:()=>t(!1),children:"No thanks"}),Ee("button",{className:"h-[32px] w-full rounded-[8px] bg-[#2D2305] text-[#F5E147] hover:bg-[#362A07]",onClick:c,children:`Subscribe for $${vn} /mo`})]}),l&&Ee("button",{className:"h-[32px] w-full rounded-[8px] hover:text-[#ffffff]",onClick:()=>t(!1),children:"Cancel"})]})]})]})}):null},wn=()=>{let[e,t]=ur(!1),[r,o]=ur(),[n,a]=ur(void 0),[s,i]=ur(void 0);return{isSubscriptionModalVisible:e,openSubscriptionModal:(A,d)=>{a(A),i(d),t(!0)},subscriptionModalCallback:r,setSubscriptionModalCallback:o,setIsSubscriptionModalVisible:t,subscriptionAmount:n,productId:s}};import tc from"react";import{clsx as ks}from"clsx";import{twMerge as Hs}from"tailwind-merge";var B=(...e)=>Hs(ks(e));import{cva as zs}from"class-variance-authority";import Ws from"react";import{jsx as js}from"react/jsx-runtime";var Eo=zs("flex flex-col",{variants:{variant:{container:"bg-elz-neutral-1 p-16 gap-16 rounded-12 border border-elz-neutral-6 overflow-hidden"}}}),u=Ws.forwardRef(({children:e,variant:t,className:r,...o},n)=>js("div",{ref:n,className:B(Eo({variant:t}),r),...o,children:e}));import{cva as Xs}from"class-variance-authority";import{createElement as qs,forwardRef as Gs}from"react";var Ys=Xs("font-elz-plex-sans",{variants:{variant:{title:"text-balance font-elz-sans text-[3.6rem] font-semibold leading-[1.125] -tracking-2 text-elz-neutral-12 md:text-[5.2rem]",description:"text-[1.8rem] font-medium text-elz-neutral-11",feature:"text-[1.2rem] font-medium uppercase tracking-[0.256rem] text-elz-neutral-11",primary:"text-elz-neutral-12",secondary:"text-elz-neutral-11"},size:{"2xs":"text-[1rem]",xs:"text-[1.2rem]",sm:"text-[1.4rem]",md:"text-[1.6rem]",lg:"text-[1.8rem]",xl:"text-[2.0rem]","2xl":"text-[2.6rem]","3xl":"text-[3.4rem]","4xl":"text-[5.8rem]"},weight:{400:"font-normal",500:"font-medium",700:"font-bold"}},defaultVariants:{variant:"title"}});var x=Gs(({children:e,as:t="p",variant:r,size:o,weight:n,className:a,...s},i)=>qs(t,{ref:i,className:B(Ys({variant:r,size:o,weight:n}),a),...s},e));import{jsx as Ft,jsxs as Zs}from"react/jsx-runtime";var Us=({title:e,description:t,className:r,customTopElement:o,children:n})=>Zs(u,{className:B("gap-16",r),children:[o&&Ft(u,{className:"mr-auto",children:o}),Ft(x,{as:"h1",children:e}),typeof t=="string"?Ft(x,{as:"h2",variant:"description",children:t}):t,Ft(u,{children:n}),Ft("noscript",{children:Ft("div",{className:"text-center text-[14px] font-bold leading-[20px] text-[#F5E147]",children:"Please enable JavaScript to continue"})})]}),Co=Us;import Bi from"react-hot-toast";import ft,{useLayoutEffect as fi,useEffect as q,createContext as gi,useState as ee,useCallback as hi,useMemo as ad,useContext as vi,useRef as ke,useImperativeHandle as yi}from"react";var $e=Math.min,Ge=Math.max,fr=Math.round,gr=Math.floor,Fe=e=>({x:e,y:e}),Ks={left:"right",right:"left",bottom:"top",top:"bottom"},Qs={start:"end",end:"start"};function jr(e,t,r){return Ge(e,$e(t,r))}function Vt(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function Mt(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function Xr(e){return e==="y"?"height":"width"}function ct(e){return["top","bottom"].includes(et(e))?"y":"x"}function qr(e){return xo(ct(e))}function bn(e,t,r){r===void 0&&(r=!1);let o=Mt(e),n=qr(e),a=Xr(n),s=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=pr(s)),[s,pr(s)]}function En(e){let t=pr(e);return[Wr(e),t,Wr(t)]}function Wr(e){return e.replace(/start|end/g,t=>Qs[t])}function Js(e,t,r){let o=["left","right"],n=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?n:o:t?o:n;case"left":case"right":return t?a:s;default:return[]}}function Cn(e,t,r,o){let n=Mt(e),a=Js(et(e),r==="start",o);return n&&(a=a.map(s=>s+"-"+n),t&&(a=a.concat(a.map(Wr)))),a}function pr(e){return e.replace(/left|right|bottom|top/g,t=>Ks[t])}function _s(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ro(e){return typeof e!="number"?_s(e):{top:e,right:e,bottom:e,left:e}}function dt(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function xn(e,t,r){let{reference:o,floating:n}=e,a=ct(t),s=qr(t),i=Xr(s),l=et(t),A=a==="y",d=o.x+o.width/2-n.width/2,c=o.y+o.height/2-n.height/2,f=o[i]/2-n[i]/2,m;switch(l){case"top":m={x:d,y:o.y-n.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:c};break;case"left":m={x:o.x-n.width,y:c};break;default:m={x:o.x,y:o.y}}switch(Mt(t)){case"start":m[s]-=f*(r&&A?-1:1);break;case"end":m[s]+=f*(r&&A?-1:1);break}return m}var Rn=async(e,t,r)=>{let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t)),A=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:c}=xn(A,o,l),f=o,m={},p=0;for(let y=0;y<i.length;y++){let{name:h,fn:v}=i[y],{x:E,y:b,data:C,reset:I}=await v({x:d,y:c,initialPlacement:o,placement:f,strategy:n,middlewareData:m,rects:A,platform:s,elements:{reference:e,floating:t}});d=E??d,c=b??c,m={...m,[h]:{...m[h],...C}},I&&p<=50&&(p++,typeof I=="object"&&(I.placement&&(f=I.placement),I.rects&&(A=I.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:d,y:c}=xn(A,f,l)),y=-1)}return{x:d,y:c,placement:f,strategy:n,middlewareData:m}};async function Io(e,t){var r;t===void 0&&(t={});let{x:o,y:n,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:A="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:f=!1,padding:m=0}=Vt(t,e),p=Ro(m),h=i[f?c==="floating"?"reference":"floating":c],v=dt(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(h)))==null||r?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:A,rootBoundary:d,strategy:l})),E=c==="floating"?{x:o,y:n,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),C=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},I=dt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:E,offsetParent:b,strategy:l}):E);return{top:(v.top-I.top+p.top)/C.y,bottom:(I.bottom-v.bottom+p.bottom)/C.y,left:(v.left-I.left+p.left)/C.x,right:(I.right-v.right+p.right)/C.x}}var In=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:n,rects:a,platform:s,elements:i,middlewareData:l}=t,{element:A,padding:d=0}=Vt(e,t)||{};if(A==null)return{};let c=Ro(d),f={x:r,y:o},m=qr(n),p=Xr(m),y=await s.getDimensions(A),h=m==="y",v=h?"top":"left",E=h?"bottom":"right",b=h?"clientHeight":"clientWidth",C=a.reference[p]+a.reference[m]-f[m]-a.floating[p],I=f[m]-a.reference[m],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(A)),S=M?M[b]:0;(!S||!await(s.isElement==null?void 0:s.isElement(M)))&&(S=i.floating[b]||a.floating[p]);let X=C/2-I/2,N=S/2-y[p]/2-1,k=$e(c[v],N),z=$e(c[E],N),te=k,J=S-y[p]-z,H=S/2-y[p]/2+X,ye=jr(te,H,J),Ae=!l.arrow&&Mt(n)!=null&&H!==ye&&a.reference[p]/2-(H<te?k:z)-y[p]/2<0,re=Ae?H<te?H-te:H-J:0;return{[m]:f[m]+re,data:{[m]:ye,centerOffset:H-ye-re,...Ae&&{alignmentOffset:re}},reset:Ae}}});var Sn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;let{placement:n,middlewareData:a,rects:s,initialPlacement:i,platform:l,elements:A}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...h}=Vt(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};let v=et(n),E=ct(i),b=et(i)===i,C=await(l.isRTL==null?void 0:l.isRTL(A.floating)),I=f||(b||!y?[pr(i)]:En(i)),M=p!=="none";!f&&M&&I.push(...Cn(i,y,p,C));let S=[i,...I],X=await Io(t,h),N=[],k=((o=a.flip)==null?void 0:o.overflows)||[];if(d&&N.push(X[v]),c){let H=bn(n,s,C);N.push(X[H[0]],X[H[1]])}if(k=[...k,{placement:n,overflows:N}],!N.every(H=>H<=0)){var z,te;let H=(((z=a.flip)==null?void 0:z.index)||0)+1,ye=S[H];if(ye)return{data:{index:H,overflows:k},reset:{placement:ye}};let Ae=(te=k.filter(re=>re.overflows[0]<=0).sort((re,Z)=>re.overflows[1]-Z.overflows[1])[0])==null?void 0:te.placement;if(!Ae)switch(m){case"bestFit":{var J;let re=(J=k.filter(Z=>{if(M){let ce=ct(Z.placement);return ce===E||ce==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ce=>ce>0).reduce((ce,Xe)=>ce+Xe,0)]).sort((Z,ce)=>Z[1]-ce[1])[0])==null?void 0:J[0];re&&(Ae=re);break}case"initialPlacement":Ae=i;break}if(n!==Ae)return{reset:{placement:Ae}}}return{}}}};async function $s(e,t){let{placement:r,platform:o,elements:n}=e,a=await(o.isRTL==null?void 0:o.isRTL(n.floating)),s=et(r),i=Mt(r),l=ct(r)==="y",A=["left","top"].includes(s)?-1:1,d=a&&l?-1:1,c=Vt(t,e),{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return i&&typeof p=="number"&&(m=i==="end"?p*-1:p),l?{x:m*d,y:f*A}:{x:f*A,y:m*d}}var Pn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;let{x:n,y:a,placement:s,middlewareData:i}=t,l=await $s(t,e);return s===((r=i.offset)==null?void 0:r.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:n+l.x,y:a+l.y,data:{...l,placement:s}}}}},Bn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:n}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:h=>{let{x:v,y:E}=h;return{x:v,y:E}}},...l}=Vt(e,t),A={x:r,y:o},d=await Io(t,l),c=ct(et(n)),f=xo(c),m=A[f],p=A[c];if(a){let h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",E=m+d[h],b=m-d[v];m=jr(E,m,b)}if(s){let h=c==="y"?"top":"left",v=c==="y"?"bottom":"right",E=p+d[h],b=p-d[v];p=jr(E,p,b)}let y=i.fn({...t,[f]:m,[c]:p});return{...y,data:{x:y.x-r,y:y.y-o,enabled:{[f]:a,[c]:s}}}}}};function Gr(){return typeof window<"u"}function mt(e){return Ln(e)?(e.nodeName||"").toLowerCase():"#document"}function pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ve(e){var t;return(t=(Ln(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ln(e){return Gr()?e instanceof Node||e instanceof pe(e).Node:!1}function Se(e){return Gr()?e instanceof Element||e instanceof pe(e).Element:!1}function Me(e){return Gr()?e instanceof HTMLElement||e instanceof pe(e).HTMLElement:!1}function Tn(e){return!Gr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pe(e).ShadowRoot}function Ht(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(n)}function Nn(e){return["table","td","th"].includes(mt(e))}function hr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Yr(e){let t=Ur(),r=Se(e)?Pe(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function On(e){let t=Ye(e);for(;Me(t)&&!ut(t);){if(Yr(t))return t;if(hr(t))return null;t=Ye(t)}return null}function Ur(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ut(e){return["html","body","#document"].includes(mt(e))}function Pe(e){return pe(e).getComputedStyle(e)}function vr(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ye(e){if(mt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Tn(e)&&e.host||Ve(e);return Tn(t)?t.host:t}function Dn(e){let t=Ye(e);return ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Me(t)&&Ht(t)?t:Dn(t)}function kt(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=Dn(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),s=pe(n);if(a){let i=Zr(s);return t.concat(s,s.visualViewport||[],Ht(n)?n:[],i&&r?kt(i):[])}return t.concat(n,kt(n,[],r))}function Zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mn(e){let t=Pe(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=Me(e),a=n?e.offsetWidth:r,s=n?e.offsetHeight:o,i=fr(r)!==a||fr(o)!==s;return i&&(r=a,o=s),{width:r,height:o,$:i}}function Po(e){return Se(e)?e:e.contextElement}function zt(e){let t=Po(e);if(!Me(t))return Fe(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=Mn(t),s=(a?fr(r.width):r.width)/o,i=(a?fr(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var ei=Fe(0);function kn(e){let t=pe(e);return!Ur()||!t.visualViewport?ei:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ti(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==pe(e)?!1:t}function pt(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=Po(e),s=Fe(1);t&&(o?Se(o)&&(s=zt(o)):s=zt(e));let i=ti(a,r,o)?kn(a):Fe(0),l=(n.left+i.x)/s.x,A=(n.top+i.y)/s.y,d=n.width/s.x,c=n.height/s.y;if(a){let f=pe(a),m=o&&Se(o)?pe(o):o,p=f,y=Zr(p);for(;y&&o&&m!==p;){let h=zt(y),v=y.getBoundingClientRect(),E=Pe(y),b=v.left+(y.clientLeft+parseFloat(E.paddingLeft))*h.x,C=v.top+(y.clientTop+parseFloat(E.paddingTop))*h.y;l*=h.x,A*=h.y,d*=h.x,c*=h.y,l+=b,A+=C,p=pe(y),y=Zr(p)}}return dt({width:d,height:c,x:l,y:A})}function Bo(e,t){let r=vr(e).scrollLeft;return t?t.left+r:pt(Ve(e)).left+r}function Hn(e,t,r){r===void 0&&(r=!1);let o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:Bo(e,o)),a=o.top+t.scrollTop;return{x:n,y:a}}function ri(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",s=Ve(o),i=t?hr(t.floating):!1;if(o===s||i&&a)return r;let l={scrollLeft:0,scrollTop:0},A=Fe(1),d=Fe(0),c=Me(o);if((c||!c&&!a)&&((mt(o)!=="body"||Ht(s))&&(l=vr(o)),Me(o))){let m=pt(o);A=zt(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}let f=s&&!c&&!a?Hn(s,l,!0):Fe(0);return{width:r.width*A.x,height:r.height*A.y,x:r.x*A.x-l.scrollLeft*A.x+d.x+f.x,y:r.y*A.y-l.scrollTop*A.y+d.y+f.y}}function oi(e){return Array.from(e.getClientRects())}function ni(e){let t=Ve(e),r=vr(e),o=e.ownerDocument.body,n=Ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-r.scrollLeft+Bo(e),i=-r.scrollTop;return Pe(o).direction==="rtl"&&(s+=Ge(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:s,y:i}}function ai(e,t){let r=pe(e),o=Ve(e),n=r.visualViewport,a=o.clientWidth,s=o.clientHeight,i=0,l=0;if(n){a=n.width,s=n.height;let A=Ur();(!A||A&&t==="fixed")&&(i=n.offsetLeft,l=n.offsetTop)}return{width:a,height:s,x:i,y:l}}function si(e,t){let r=pt(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=Me(e)?zt(e):Fe(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=n*a.x,A=o*a.y;return{width:s,height:i,x:l,y:A}}function Fn(e,t,r){let o;if(t==="viewport")o=ai(e,r);else if(t==="document")o=ni(Ve(e));else if(Se(t))o=si(t,r);else{let n=kn(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dt(o)}function zn(e,t){let r=Ye(e);return r===t||!Se(r)||ut(r)?!1:Pe(r).position==="fixed"||zn(r,t)}function ii(e,t){let r=t.get(e);if(r)return r;let o=kt(e,[],!1).filter(i=>Se(i)&&mt(i)!=="body"),n=null,a=Pe(e).position==="fixed",s=a?Ye(e):e;for(;Se(s)&&!ut(s);){let i=Pe(s),l=Yr(s);!l&&i.position==="fixed"&&(n=null),(a?!l&&!n:!l&&i.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Ht(s)&&!l&&zn(e,s))?o=o.filter(d=>d!==s):n=i,s=Ye(s)}return t.set(e,o),o}function li(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,s=[...r==="clippingAncestors"?hr(t)?[]:ii(t,this._c):[].concat(r),o],i=s[0],l=s.reduce((A,d)=>{let c=Fn(t,d,n);return A.top=Ge(c.top,A.top),A.right=$e(c.right,A.right),A.bottom=$e(c.bottom,A.bottom),A.left=Ge(c.left,A.left),A},Fn(t,i,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ai(e){let{width:t,height:r}=Mn(e);return{width:t,height:r}}function ci(e,t,r){let o=Me(t),n=Ve(t),a=r==="fixed",s=pt(e,!0,a,t),i={scrollLeft:0,scrollTop:0},l=Fe(0);if(o||!o&&!a)if((mt(t)!=="body"||Ht(n))&&(i=vr(t)),o){let f=pt(t,!0,a,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else n&&(l.x=Bo(n));let A=n&&!o&&!a?Hn(n,i):Fe(0),d=s.left+i.scrollLeft-l.x-A.x,c=s.top+i.scrollTop-l.y-A.y;return{x:d,y:c,width:s.width,height:s.height}}function So(e){return Pe(e).position==="static"}function Vn(e,t){if(!Me(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ve(e)===r&&(r=r.ownerDocument.body),r}function Wn(e,t){let r=pe(e);if(hr(e))return r;if(!Me(e)){let n=Ye(e);for(;n&&!ut(n);){if(Se(n)&&!So(n))return n;n=Ye(n)}return r}let o=Vn(e,t);for(;o&&Nn(o)&&So(o);)o=Vn(o,t);return o&&ut(o)&&So(o)&&!Yr(o)?r:o||On(e)||r}var di=async function(e){let t=this.getOffsetParent||Wn,r=this.getDimensions,o=await r(e.floating);return{reference:ci(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function mi(e){return Pe(e).direction==="rtl"}var ui={convertOffsetParentRelativeRectToViewportRelativeRect:ri,getDocumentElement:Ve,getClippingRect:li,getOffsetParent:Wn,getElementRects:di,getClientRects:oi,getDimensions:Ai,getScale:zt,isElement:Se,isRTL:mi};function jn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pi(e,t){let r=null,o,n=Ve(e);function a(){var i;clearTimeout(o),(i=r)==null||i.disconnect(),r=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();let A=e.getBoundingClientRect(),{left:d,top:c,width:f,height:m}=A;if(i||t(),!f||!m)return;let p=gr(c),y=gr(n.clientWidth-(d+f)),h=gr(n.clientHeight-(c+m)),v=gr(d),b={rootMargin:-p+"px "+-y+"px "+-h+"px "+-v+"px",threshold:Ge(0,$e(1,l))||1},C=!0;function I(M){let S=M[0].intersectionRatio;if(S!==l){if(!C)return s();S?s(!1,S):o=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!jn(A,e.getBoundingClientRect())&&s(),C=!1}try{r=new IntersectionObserver(I,{...b,root:n.ownerDocument})}catch{r=new IntersectionObserver(I,b)}r.observe(e)}return s(!0),a}function Xn(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,A=Po(e),d=n||a?[...A?kt(A):[],...kt(t)]:[];d.forEach(v=>{n&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});let c=A&&i?pi(A,r):null,f=-1,m=null;s&&(m=new ResizeObserver(v=>{let[E]=v;E&&E.target===A&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),r()}),A&&!l&&m.observe(A),m.observe(t));let p,y=l?pt(e):null;l&&h();function h(){let v=pt(e);y&&!jn(y,v)&&r(),y=v,p=requestAnimationFrame(h)}return r(),()=>{var v;d.forEach(E=>{n&&E.removeEventListener("scroll",r),a&&E.removeEventListener("resize",r)}),c?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(p)}}var qn=Pn;var Gn=Bn,Yn=Sn;var Un=In;var To=(e,t,r)=>{let o=new Map,n={platform:ui,...r},a={...n.platform,_c:o};return Rn(e,t,{...n,platform:a})};var Qr=Ds(Zn(),1);var wi="react-tooltip-core-styles",bi="react-tooltip-base-styles",Kn={core:!1,base:!1};function Qn({css:e,id:t=bi,type:r="base",ref:o}){var n,a;if(!e||typeof document>"u"||Kn[r]||r==="core"&&typeof process<"u"&&(!((n=process==null?void 0:process.env)===null||n===void 0)&&n.REACT_TOOLTIP_DISABLE_CORE_STYLES)||r!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:process.env)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;r==="core"&&(t=wi),o||(o={});let{insertAt:s}=o;if(document.getElementById(t))return;let i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.id=t,l.type="text/css",s==="top"&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e)),Kn[r]=!0}var Jn=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:o="top",offset:n=10,strategy:a="absolute",middlewares:s=[qn(Number(n)),Yn({fallbackAxisSideDirection:"start"}),Gn({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};let l=s;return r?(l.push(Un({element:r,padding:5})),To(e,t,{placement:o,strategy:a,middleware:l}).then(({x:A,y:d,placement:c,middlewareData:f})=>{var m,p;let y={left:`${A}px`,top:`${d}px`,border:i},{x:h,y:v}=(m=f.arrow)!==null&&m!==void 0?m:{x:0,y:0},E=(p={top:"bottom",right:"left",bottom:"top",left:"right"}[c.split("-")[0]])!==null&&p!==void 0?p:"bottom",b=i&&{borderBottom:i,borderRight:i},C=0;if(i){let I=`${i}`.match(/(\d+)px/);C=I?.[1]?Number(I[1]):1}return{tooltipStyles:y,tooltipArrowStyles:{left:h!=null?`${h}px`:"",top:v!=null?`${v}px`:"",right:"",bottom:"",...b,[E]:`-${4+C}px`},place:c}})):To(e,t,{placement:"bottom",strategy:a,middleware:l}).then(({x:A,y:d,placement:c})=>({tooltipStyles:{left:`${A}px`,top:`${d}px`},tooltipArrowStyles:{},place:c}))},_n=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),$n=(e,t,r)=>{let o=null,n=function(...a){let s=()=>{o=null,r||e.apply(this,a)};r&&!o&&(e.apply(this,a),o=setTimeout(s,t)),r||(o&&clearTimeout(o),o=setTimeout(s,t))};return n.cancel=()=>{o&&(clearTimeout(o),o=null)},n},ea=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",No=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,a)=>No(n,t[a]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!ea(e)||!ea(t))return e===t;let r=Object.keys(e),o=Object.keys(t);return r.length===o.length&&r.every(n=>No(e[n],t[n]))},Ei=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;let t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(r=>{let o=t.getPropertyValue(r);return o==="auto"||o==="scroll"})},ta=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Ei(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Ci=typeof window<"u"?fi:q,Be=e=>{e.current&&(clearTimeout(e.current),e.current=null)},xi="DEFAULT_TOOLTIP_ID",Ri={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Ii=gi({getTooltipData:()=>Ri});function ra(e=xi){return vi(Ii).getTooltipData(e)}var Wt={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"},Lo={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"},Si=({forwardRef:e,id:t,className:r,classNameArrow:o,variant:n="dark",anchorId:a,anchorSelect:s,place:i="top",offset:l=10,events:A=["hover"],openOnClick:d=!1,positionStrategy:c="absolute",middlewares:f,wrapper:m,delayShow:p=0,delayHide:y=0,float:h=!1,hidden:v=!1,noArrow:E=!1,clickable:b=!1,closeOnEsc:C=!1,closeOnScroll:I=!1,closeOnResize:M=!1,openEvents:S,closeEvents:X,globalCloseEvents:N,imperativeModeOnly:k,style:z,position:te,afterShow:J,afterHide:H,disableTooltip:ye,content:Ae,contentWrapperRef:re,isOpen:Z,defaultIsOpen:ce=!1,setIsOpen:Xe,activeAnchor:_,setActiveAnchor:xt,border:Nr,opacity:Or,arrowColor:Dr,role:ho="tooltip"})=>{var _t;let de=ke(null),Rt=ke(null),Ne=ke(null),Qe=ke(null),$t=ke(null),[Je,vo]=ee({tooltipStyles:{},tooltipArrowStyles:{},place:i}),[we,Fr]=ee(!1),[at,st]=ee(!1),[Y,er]=ee(null),tr=ke(!1),rr=ke(null),{anchorRefs:or,setActiveAnchor:Vr}=ra(t),It=ke(!1),[_e,nr]=ee([]),it=ke(!1),St=d||A.includes("click"),ar=St||S?.click||S?.dblclick||S?.mousedown,Pt=S?{...S}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!S&&St&&Object.assign(Pt,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});let sr=X?{...X}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!X&&St&&Object.assign(sr,{mouseleave:!1,blur:!1,mouseout:!1});let Oe=N?{...N}:{escape:C||!1,scroll:I||!1,resize:M||!1,clickOutsideAnchor:ar||!1};k&&(Object.assign(Pt,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(sr,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Oe,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Ci(()=>(it.current=!0,()=>{it.current=!1}),[]);let K=w=>{it.current&&(w&&st(!0),setTimeout(()=>{it.current&&(Xe?.(w),Z===void 0&&Fr(w))},10))};q(()=>{if(Z===void 0)return()=>null;Z&&st(!0);let w=setTimeout(()=>{Fr(Z)},10);return()=>{clearTimeout(w)}},[Z]),q(()=>{if(we!==tr.current)if(Be($t),tr.current=we,we)J?.();else{let w=(T=>{let O=T.match(/^([\d.]+)(ms|s)$/);if(!O)return 0;let[,$,se]=O;return Number($)*(se==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));$t.current=setTimeout(()=>{st(!1),er(null),H?.()},w+25)}},[we]);let Mr=w=>{vo(T=>No(T,w)?T:w)},ir=(w=p)=>{Be(Ne),at?K(!0):Ne.current=setTimeout(()=>{K(!0)},w)},Bt=(w=y)=>{Be(Qe),Qe.current=setTimeout(()=>{It.current||K(!1)},w)},lr=w=>{var T;if(!w)return;let O=(T=w.currentTarget)!==null&&T!==void 0?T:w.target;if(!O?.isConnected)return xt(null),void Vr({current:null});p?ir():K(!0),xt(O),Vr({current:O}),Be(Qe)},Tt=()=>{b?Bt(y||100):y?Bt():K(!1),Be(Ne)},Lt=({x:w,y:T})=>{var O;let $={getBoundingClientRect:()=>({x:w,y:T,width:0,height:0,top:T,left:w,right:w,bottom:T})};Jn({place:(O=Y?.place)!==null&&O!==void 0?O:i,offset:l,elementReference:$,tooltipReference:de.current,tooltipArrowReference:Rt.current,strategy:c,middlewares:f,border:Nr}).then(se=>{Mr(se)})},Nt=w=>{if(!w)return;let T=w,O={x:T.clientX,y:T.clientY};Lt(O),rr.current=O},Ar=w=>{var T;if(!we)return;let O=w.target;O.isConnected&&(!((T=de.current)===null||T===void 0)&&T.contains(O)||[document.querySelector(`[id='${a}']`),..._e].some($=>$?.contains(O))||(K(!1),Be(Ne)))},kr=$n(lr,50,!0),oe=$n(Tt,50,!0),Re=w=>{oe.cancel(),kr(w)},P=()=>{kr.cancel(),oe()},D=hi(()=>{var w,T;let O=(w=Y?.position)!==null&&w!==void 0?w:te;O?Lt(O):h?rr.current&&Lt(rr.current):_?.isConnected&&Jn({place:(T=Y?.place)!==null&&T!==void 0?T:i,offset:l,elementReference:_,tooltipReference:de.current,tooltipArrowReference:Rt.current,strategy:c,middlewares:f,border:Nr}).then($=>{it.current&&Mr($)})},[we,_,Ae,z,i,Y?.place,l,c,te,Y?.position,h]);q(()=>{var w,T;let O=new Set(or);_e.forEach(W=>{ye?.(W)||O.add({current:W})});let $=document.querySelector(`[id='${a}']`);$&&!ye?.($)&&O.add({current:$});let se=()=>{K(!1)},ze=ta(_),We=ta(de.current);Oe.scroll&&(window.addEventListener("scroll",se),ze?.addEventListener("scroll",se),We?.addEventListener("scroll",se));let me=null;Oe.resize?window.addEventListener("resize",se):_&&de.current&&(me=Xn(_,de.current,D,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));let Ie=W=>{W.key==="Escape"&&K(!1)};Oe.escape&&window.addEventListener("keydown",Ie),Oe.clickOutsideAnchor&&window.addEventListener("click",Ar);let G=[],cr=W=>{we&&W?.target===_||lr(W)},Rs=W=>{we&&W?.target===_&&Tt()},on=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],nn=["click","dblclick","mousedown","mouseup"];Object.entries(Pt).forEach(([W,qe])=>{qe&&(on.includes(W)?G.push({event:W,listener:Re}):nn.includes(W)&&G.push({event:W,listener:cr}))}),Object.entries(sr).forEach(([W,qe])=>{qe&&(on.includes(W)?G.push({event:W,listener:P}):nn.includes(W)&&G.push({event:W,listener:Rs}))}),h&&G.push({event:"pointermove",listener:Nt});let an=()=>{It.current=!0},sn=()=>{It.current=!1,Tt()};return b&&!ar&&((w=de.current)===null||w===void 0||w.addEventListener("mouseenter",an),(T=de.current)===null||T===void 0||T.addEventListener("mouseleave",sn)),G.forEach(({event:W,listener:qe})=>{O.forEach(yo=>{var dr;(dr=yo.current)===null||dr===void 0||dr.addEventListener(W,qe)})}),()=>{var W,qe;Oe.scroll&&(window.removeEventListener("scroll",se),ze?.removeEventListener("scroll",se),We?.removeEventListener("scroll",se)),Oe.resize?window.removeEventListener("resize",se):me?.(),Oe.clickOutsideAnchor&&window.removeEventListener("click",Ar),Oe.escape&&window.removeEventListener("keydown",Ie),b&&!ar&&((W=de.current)===null||W===void 0||W.removeEventListener("mouseenter",an),(qe=de.current)===null||qe===void 0||qe.removeEventListener("mouseleave",sn)),G.forEach(({event:yo,listener:dr})=>{O.forEach(Is=>{var wo;(wo=Is.current)===null||wo===void 0||wo.removeEventListener(yo,dr)})})}},[_,D,at,or,_e,S,X,N,St,p,y]),q(()=>{var w,T;let O=(T=(w=Y?.anchorSelect)!==null&&w!==void 0?w:s)!==null&&T!==void 0?T:"";!O&&t&&(O=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);let $=new MutationObserver(se=>{let ze=[],We=[];se.forEach(me=>{if(me.type==="attributes"&&me.attributeName==="data-tooltip-id"&&(me.target.getAttribute("data-tooltip-id")===t?ze.push(me.target):me.oldValue===t&&We.push(me.target)),me.type==="childList"){if(_){let Ie=[...me.removedNodes].filter(G=>G.nodeType===1);if(O)try{We.push(...Ie.filter(G=>G.matches(O))),We.push(...Ie.flatMap(G=>[...G.querySelectorAll(O)]))}catch{}Ie.some(G=>{var cr;return!!(!((cr=G?.contains)===null||cr===void 0)&&cr.call(G,_))&&(st(!1),K(!1),xt(null),Be(Ne),Be(Qe),!0)})}if(O)try{let Ie=[...me.addedNodes].filter(G=>G.nodeType===1);ze.push(...Ie.filter(G=>G.matches(O))),ze.push(...Ie.flatMap(G=>[...G.querySelectorAll(O)]))}catch{}}}),(ze.length||We.length)&&nr(me=>[...me.filter(Ie=>!We.includes(Ie)),...ze])});return $.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{$.disconnect()}},[t,s,Y?.anchorSelect,_]),q(()=>{D()},[D]),q(()=>{if(!re?.current)return()=>null;let w=new ResizeObserver(()=>{setTimeout(()=>D())});return w.observe(re.current),()=>{w.disconnect()}},[Ae,re?.current]),q(()=>{var w;let T=document.querySelector(`[id='${a}']`),O=[..._e,T];_&&O.includes(_)||xt((w=_e[0])!==null&&w!==void 0?w:T)},[a,_e,_]),q(()=>(ce&&K(!0),()=>{Be(Ne),Be(Qe)}),[]),q(()=>{var w;let T=(w=Y?.anchorSelect)!==null&&w!==void 0?w:s;if(!T&&t&&(T=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),T)try{let O=Array.from(document.querySelectorAll(T));nr(O)}catch{nr([])}},[t,s,Y?.anchorSelect]),q(()=>{Ne.current&&(Be(Ne),ir(p))},[p]);let be=(_t=Y?.content)!==null&&_t!==void 0?_t:Ae,lt=we&&Object.keys(Je.tooltipStyles).length>0;return yi(e,()=>({open:w=>{if(w?.anchorSelect)try{document.querySelector(w.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${w.anchorSelect}" is not a valid CSS selector`)}er(w??null),w?.delay?ir(w.delay):K(!0)},close:w=>{w?.delay?Bt(w.delay):K(!1)},activeAnchor:_,place:Je.place,isOpen:!!(at&&!v&&be&&lt)})),at&&!v&&be?ft.createElement(m,{id:t,role:ho,className:(0,Qr.default)("react-tooltip",Wt.tooltip,Lo.tooltip,Lo[n],r,`react-tooltip__place-${Je.place}`,Wt[lt?"show":"closing"],lt?"react-tooltip__show":"react-tooltip__closing",c==="fixed"&&Wt.fixed,b&&Wt.clickable),onTransitionEnd:w=>{Be($t),we||w.propertyName!=="opacity"||(st(!1),er(null),H?.())},style:{...z,...Je.tooltipStyles,opacity:Or!==void 0&&lt?Or:void 0},ref:de},be,ft.createElement(m,{className:(0,Qr.default)("react-tooltip-arrow",Wt.arrow,Lo.arrow,o,E&&Wt.noArrow),style:{...Je.tooltipArrowStyles,background:Dr?`linear-gradient(to right bottom, transparent 50%, ${Dr} 50%)`:void 0},ref:Rt})):null},Pi=({content:e})=>ft.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),oa=ft.forwardRef(({id:e,anchorId:t,anchorSelect:r,content:o,html:n,render:a,className:s,classNameArrow:i,variant:l="dark",place:A="top",offset:d=10,wrapper:c="div",children:f=null,events:m=["hover"],openOnClick:p=!1,positionStrategy:y="absolute",middlewares:h,delayShow:v=0,delayHide:E=0,float:b=!1,hidden:C=!1,noArrow:I=!1,clickable:M=!1,closeOnEsc:S=!1,closeOnScroll:X=!1,closeOnResize:N=!1,openEvents:k,closeEvents:z,globalCloseEvents:te,imperativeModeOnly:J=!1,style:H,position:ye,isOpen:Ae,defaultIsOpen:re=!1,disableStyleInjection:Z=!1,border:ce,opacity:Xe,arrowColor:_,setIsOpen:xt,afterShow:Nr,afterHide:Or,disableTooltip:Dr,role:ho="tooltip"},_t)=>{let[de,Rt]=ee(o),[Ne,Qe]=ee(n),[$t,Je]=ee(A),[vo,we]=ee(l),[Fr,at]=ee(d),[st,Y]=ee(v),[er,tr]=ee(E),[rr,or]=ee(b),[Vr,It]=ee(C),[_e,nr]=ee(c),[it,St]=ee(m),[ar,Pt]=ee(y),[sr,Oe]=ee(null),[K,Mr]=ee(null),ir=ke(Z),{anchorRefs:Bt,activeAnchor:lr}=ra(e),Tt=oe=>oe?.getAttributeNames().reduce((Re,P)=>{var D;return P.startsWith("data-tooltip-")&&(Re[P.replace(/^data-tooltip-/,"")]=(D=oe?.getAttribute(P))!==null&&D!==void 0?D:null),Re},{}),Lt=oe=>{let Re={place:P=>{var D;Je((D=P)!==null&&D!==void 0?D:A)},content:P=>{Rt(P??o)},html:P=>{Qe(P??n)},variant:P=>{var D;we((D=P)!==null&&D!==void 0?D:l)},offset:P=>{at(P===null?d:Number(P))},wrapper:P=>{var D;nr((D=P)!==null&&D!==void 0?D:c)},events:P=>{let D=P?.split(" ");St(D??m)},"position-strategy":P=>{var D;Pt((D=P)!==null&&D!==void 0?D:y)},"delay-show":P=>{Y(P===null?v:Number(P))},"delay-hide":P=>{tr(P===null?E:Number(P))},float:P=>{or(P===null?b:P==="true")},hidden:P=>{It(P===null?C:P==="true")},"class-name":P=>{Oe(P)}};Object.values(Re).forEach(P=>P(null)),Object.entries(oe).forEach(([P,D])=>{var be;(be=Re[P])===null||be===void 0||be.call(Re,D)})};q(()=>{Rt(o)},[o]),q(()=>{Qe(n)},[n]),q(()=>{Je(A)},[A]),q(()=>{we(l)},[l]),q(()=>{at(d)},[d]),q(()=>{Y(v)},[v]),q(()=>{tr(E)},[E]),q(()=>{or(b)},[b]),q(()=>{It(C)},[C]),q(()=>{Pt(y)},[y]),q(()=>{ir.current!==Z&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[Z]),q(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:Z==="core",disableBase:Z}}))},[]),q(()=>{var oe;let Re=new Set(Bt),P=r;if(!P&&e&&(P=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),P)try{document.querySelectorAll(P).forEach(T=>{Re.add({current:T})})}catch{console.warn(`[react-tooltip] "${P}" is not a valid CSS selector`)}let D=document.querySelector(`[id='${t}']`);if(D&&Re.add({current:D}),!Re.size)return()=>null;let be=(oe=K??D)!==null&&oe!==void 0?oe:lr.current,lt=new MutationObserver(T=>{T.forEach(O=>{var $;if(!be||O.type!=="attributes"||!(!(($=O.attributeName)===null||$===void 0)&&$.startsWith("data-tooltip-")))return;let se=Tt(be);Lt(se)})}),w={attributes:!0,childList:!1,subtree:!1};if(be){let T=Tt(be);Lt(T),lt.observe(be,w)}return()=>{lt.disconnect()}},[Bt,lr,K,t,r]),q(()=>{H?.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),ce&&!_n("border",`${ce}`)&&console.warn(`[react-tooltip] "${ce}" is not a valid \`border\`.`),H?.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),Xe&&!_n("opacity",`${Xe}`)&&console.warn(`[react-tooltip] "${Xe}" is not a valid \`opacity\`.`)},[]);let Nt=f,Ar=ke(null);if(a){let oe=a({content:K?.getAttribute("data-tooltip-content")||de||null,activeAnchor:K});Nt=oe?ft.createElement("div",{ref:Ar,className:"react-tooltip-content-wrapper"},oe):null}else de&&(Nt=de);Ne&&(Nt=ft.createElement(Pi,{content:Ne}));let kr={forwardRef:_t,id:e,anchorId:t,anchorSelect:r,className:(0,Qr.default)(s,sr),classNameArrow:i,content:Nt,contentWrapperRef:Ar,place:$t,variant:vo,offset:Fr,wrapper:_e,events:it,openOnClick:p,positionStrategy:ar,middlewares:h,delayShow:st,delayHide:er,float:rr,hidden:Vr,noArrow:I,clickable:M,closeOnEsc:S,closeOnScroll:X,closeOnResize:N,openEvents:k,closeEvents:z,globalCloseEvents:te,imperativeModeOnly:J,style:H,position:ye,isOpen:Ae,defaultIsOpen:re,border:ce,opacity:Xe,arrowColor:_,setIsOpen:xt,afterShow:Nr,afterHide:Or,disableTooltip:Dr,activeAnchor:K,setActiveAnchor:oe=>Mr(oe),role:ho};return ft.createElement(Si,{...kr})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||Qn({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-